Class BLStagingRepositoryUpload

java.lang.Object
com.io7m.brooklime.api.BLStagingRepositoryUpload
All Implemented Interfaces:
BLStagingRepositoryUploadType

public final class BLStagingRepositoryUpload extends Object implements BLStagingRepositoryUploadType
A request to upload a set of files to a staging repository.
  • Method Details

    • repositoryId

      public String repositoryId()
      Specified by:
      repositoryId in interface BLStagingRepositoryUploadType
      Returns:
      The ID of the staging repository
    • baseDirectory

      public Path baseDirectory()
      Specified by:
      baseDirectory in interface BLStagingRepositoryUploadType
      Returns:
      The base directory containing files
    • files

      public List<Path> files()
      Specified by:
      files in interface BLStagingRepositoryUploadType
      Returns:
      The files to be uploaded
    • retryDelay

      public Duration retryDelay()
      Specified by:
      retryDelay in interface BLStagingRepositoryUploadType
      Returns:
      The duration by which to pause between failed upload attempts
    • retryCount

      public int retryCount()
      Specified by:
      retryCount in interface BLStagingRepositoryUploadType
      Returns:
      The maximum number of times to retry uploading any given file
    • withRepositoryId

      public final BLStagingRepositoryUpload withRepositoryId(String value)
      Copy the current immutable object by setting a value for the repositoryId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for repositoryId
      Returns:
      A modified copy of the this object
    • withBaseDirectory

      public final BLStagingRepositoryUpload withBaseDirectory(Path value)
      Copy the current immutable object by setting a value for the baseDirectory attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for baseDirectory
      Returns:
      A modified copy of the this object
    • withFiles

      public final BLStagingRepositoryUpload withFiles(Path... elements)
      Copy the current immutable object with elements that replace the content of files.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withFiles

      public final BLStagingRepositoryUpload withFiles(Iterable<? extends Path> elements)
      Copy the current immutable object with elements that replace the content of files. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of files elements to set
      Returns:
      A modified copy of this object
    • withRetryDelay

      public final BLStagingRepositoryUpload withRetryDelay(Duration value)
      Copy the current immutable object by setting a value for the retryDelay attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for retryDelay
      Returns:
      A modified copy of the this object
    • withRetryCount

      public final BLStagingRepositoryUpload withRetryCount(int value)
      Copy the current immutable object by setting a value for the retryCount attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for retryCount
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of BLStagingRepositoryUpload that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: repositoryId, baseDirectory, files, retryDelay, retryCount.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value BLStagingRepositoryUpload with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      Creates an immutable copy of a BLStagingRepositoryUploadType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable BLStagingRepositoryUpload instance
    • builder

      public static BLStagingRepositoryUpload.Builder builder()
      Creates a builder for BLStagingRepositoryUpload.
       BLStagingRepositoryUpload.builder()
          .setRepositoryId(String) // required repositoryId
          .setBaseDirectory(java.nio.file.Path) // required baseDirectory
          .addFiles|addAllFiles(java.nio.file.Path) // files elements
          .setRetryDelay(java.time.Duration) // required retryDelay
          .setRetryCount(int) // required retryCount
          .build();
       
      Returns:
      A new BLStagingRepositoryUpload builder