Class LifecycleRule

    • Method Detail

      • expiration

        public final LifecycleExpiration expiration()

        Specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker.

        Returns:
        Specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker.
      • id

        public final String id()

        Unique identifier for the rule. The value cannot be longer than 255 characters.

        Returns:
        Unique identifier for the rule. The value cannot be longer than 255 characters.
      • prefix

        @Deprecated
        public final String prefix()
        Deprecated.

        Prefix identifying one or more objects to which the rule applies. This is no longer used; use Filter instead.

        Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints.

        Returns:
        Prefix identifying one or more objects to which the rule applies. This is no longer used; use Filter instead.

        Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints.

      • filter

        public final LifecycleRuleFilter filter()

        The Filter is used to identify objects that a Lifecycle Rule applies to. A Filter must have exactly one of Prefix, Tag, or And specified. Filter is required if the LifecycleRule does not contain a Prefix element.

        Returns:
        The Filter is used to identify objects that a Lifecycle Rule applies to. A Filter must have exactly one of Prefix, Tag, or And specified. Filter is required if the LifecycleRule does not contain a Prefix element.
      • status

        public final ExpirationStatus status()

        If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied.

        If the service returns an enum value that is not available in the current SDK version, status will return ExpirationStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from statusAsString().

        Returns:
        If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied.
        See Also:
        ExpirationStatus
      • statusAsString

        public final String statusAsString()

        If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied.

        If the service returns an enum value that is not available in the current SDK version, status will return ExpirationStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from statusAsString().

        Returns:
        If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied.
        See Also:
        ExpirationStatus
      • hasTransitions

        public final boolean hasTransitions()
        For responses, this returns true if the service returned a value for the Transitions property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
      • transitions

        public final List<Transition> transitions()

        Specifies when an Amazon S3 object transitions to a specified storage class.

        Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

        This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasTransitions() method.

        Returns:
        Specifies when an Amazon S3 object transitions to a specified storage class.
      • hasNoncurrentVersionTransitions

        public final boolean hasNoncurrentVersionTransitions()
        For responses, this returns true if the service returned a value for the NoncurrentVersionTransitions property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
      • noncurrentVersionTransitions

        public final List<NoncurrentVersionTransition> noncurrentVersionTransitions()

        Specifies the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific storage class. If your bucket is versioning-enabled (or versioning is suspended), you can set this action to request that Amazon S3 transition noncurrent object versions to a specific storage class at a set period in the object's lifetime.

        Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

        This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasNoncurrentVersionTransitions() method.

        Returns:
        Specifies the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific storage class. If your bucket is versioning-enabled (or versioning is suspended), you can set this action to request that Amazon S3 transition noncurrent object versions to a specific storage class at a set period in the object's lifetime.
      • noncurrentVersionExpiration

        public final NoncurrentVersionExpiration noncurrentVersionExpiration()
        Returns the value of the NoncurrentVersionExpiration property for this object.
        Returns:
        The value of the NoncurrentVersionExpiration property for this object.
      • abortIncompleteMultipartUpload

        public final AbortIncompleteMultipartUpload abortIncompleteMultipartUpload()
        Returns the value of the AbortIncompleteMultipartUpload property for this object.
        Returns:
        The value of the AbortIncompleteMultipartUpload property for this object.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public final String toString()
        Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
        Overrides:
        toString in class Object
      • getValueForField

        public final <T> Optional<T> getValueForField​(String fieldName,
                                                      Class<T> clazz)