Class ContainerBuilder


  • public class ContainerBuilder
    extends java.lang.Object
    A builder class for Container. Since Container is immutable, modifying a Container needs to build a new Container object with updated fields through this builder. A Container can be built in two ways: 1) from an existing Container object; and 2) by supplying required fields of a Container. This class is not thread safe.
    • Constructor Detail

      • ContainerBuilder

        public ContainerBuilder​(Container origin)
        Constructor. This will allow building a new Container from an existing Container. The builder will include all the information of the existing Container. This constructor should be used when modifying an existing container.
        Parameters:
        origin - The Container to build from.
      • ContainerBuilder

        public ContainerBuilder​(short id,
                                java.lang.String name,
                                Container.ContainerStatus status,
                                java.lang.String description,
                                short parentAccountId)
        Constructor for a ContainerBuilder taking individual arguments.
        Parameters:
        id - The id of the Container to build.
        name - The name of the Container.
        status - The status of the Container.
        description - The description of the Container.
        parentAccountId - The id of the parent Account of the Container to build.
    • Method Detail

      • setId

        public ContainerBuilder setId​(short id)
        Sets the ID of the Container to build.
        Parameters:
        id - The ID to set.
        Returns:
        This builder.
      • setName

        public ContainerBuilder setName​(java.lang.String name)
        Sets the name of the Container to build.
        Parameters:
        name - The name to set.
        Returns:
        This builder.
      • setDeleteTriggerTime

        public ContainerBuilder setDeleteTriggerTime​(long deleteTriggerTime)
        Sets the delete trigger time of the Container to build.
      • setDescription

        public ContainerBuilder setDescription​(java.lang.String description)
        Sets the description of the Container to build.
        Parameters:
        description - The description to set.
        Returns:
        This builder.
      • setParentAccountId

        public ContainerBuilder setParentAccountId​(short parentAccountId)
        Sets the ID of the parent Account of the Container to build.
        Parameters:
        parentAccountId - The parent Account ID to set.
        Returns:
        This builder.
      • setEncrypted

        public ContainerBuilder setEncrypted​(boolean encrypted)
        Sets the encryption setting of the Container to build.
        Parameters:
        encrypted - The encryption setting to set.
        Returns:
        This builder.
      • setPreviouslyEncrypted

        public ContainerBuilder setPreviouslyEncrypted​(boolean previouslyEncrypted)
        Sets the previously encrypted setting of the Container to build.
        Parameters:
        previouslyEncrypted - The previouslyEncrypted setting to set.
        Returns:
        This builder.
      • setCacheable

        public ContainerBuilder setCacheable​(boolean cacheable)
        Sets the caching setting of the Container to build
        Parameters:
        cacheable - The cache setting to set.
        Returns:
        This builder.
      • setBackupEnabled

        public ContainerBuilder setBackupEnabled​(boolean backupEnabled)
        Sets the backup setting of the Container to build
        Parameters:
        backupEnabled - The backup setting to set.
        Returns:
        This builder.
      • setMediaScanDisabled

        public ContainerBuilder setMediaScanDisabled​(boolean mediaScanDisabled)
        Sets the media scan disabled setting of the Container to build
        Parameters:
        mediaScanDisabled - The media scan disabled setting to set.
        Returns:
        This builder.
      • setTtlRequired

        public ContainerBuilder setTtlRequired​(boolean ttlRequired)
        Sets the ttl required setting of the Container.
        Parameters:
        ttlRequired - The ttlRequired setting to set.
        Returns:
        This builder.
      • setSecurePathRequired

        public ContainerBuilder setSecurePathRequired​(boolean securePathRequired)
        Sets the secure path validation required setting of the Container.
        Parameters:
        securePathRequired - The securePathRequired setting to set.
        Returns:
        This builder.
      • setReplicationPolicy

        public ContainerBuilder setReplicationPolicy​(java.lang.String replicationPolicy)
        Sets the replication policy desired by the Container.
        Parameters:
        replicationPolicy - the replication policy desired by the container
        Returns:
        This builder.
      • setContentTypeWhitelistForFilenamesOnDownload

        public ContainerBuilder setContentTypeWhitelistForFilenamesOnDownload​(java.util.Set<java.lang.String> contentTypeWhitelistForFilenamesOnDownload)
        Sets the whitelist for the content types for which filenames can be sent on download
        Parameters:
        contentTypeWhitelistForFilenamesOnDownload - the whitelist for the content types for which filenames can be sent on download
        Returns:
        This builder.
      • setLastModifiedTime

        public ContainerBuilder setLastModifiedTime​(long lastModifiedTime)
        Sets the created/modified time of the Container
        Parameters:
        lastModifiedTime - epoch time in milliseconds.
        Returns:
        This builder.
      • setSnapshotVersion

        public ContainerBuilder setSnapshotVersion​(int snapshotVersion)
        Sets the snapshot version of the Container to build.
        Parameters:
        snapshotVersion - The version to set.
        Returns:
        This builder.
      • build

        public Container build()
        Builds a Container object. id, name, status, isPrivate, and parentAccountId are required before build.
        Returns:
        A Container object.
        Throws:
        java.lang.IllegalStateException - If any required fields is not set.