Class LifecycleRule
- java.lang.Object
-
- software.amazon.awssdk.services.s3.model.LifecycleRule
-
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<LifecycleRule.Builder,LifecycleRule>
@Generated("software.amazon.awssdk:codegen") public final class LifecycleRule extends Object implements SdkPojo, Serializable, ToCopyableBuilder<LifecycleRule.Builder,LifecycleRule>
A lifecycle rule for individual objects in an Amazon S3 bucket.
For more information see, Managing your storage lifecycle in the Amazon S3 User Guide.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
LifecycleRule.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AbortIncompleteMultipartUpload
abortIncompleteMultipartUpload()
Returns the value of the AbortIncompleteMultipartUpload property for this object.static LifecycleRule.Builder
builder()
boolean
equals(Object obj)
boolean
equalsBySdkFields(Object obj)
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.LifecycleRuleFilter
filter()
TheFilter
is used to identify objects that a Lifecycle Rule applies to.<T> Optional<T>
getValueForField(String fieldName, Class<T> clazz)
int
hashCode()
boolean
hasNoncurrentVersionTransitions()
For responses, this returns true if the service returned a value for the NoncurrentVersionTransitions property.boolean
hasTransitions()
For responses, this returns true if the service returned a value for the Transitions property.String
id()
Unique identifier for the rule.NoncurrentVersionExpiration
noncurrentVersionExpiration()
Returns the value of the NoncurrentVersionExpiration property for this object.List<NoncurrentVersionTransition>
noncurrentVersionTransitions()
Specifies the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific storage class.String
prefix()
Deprecated.Map<String,SdkField<?>>
sdkFieldNameToField()
List<SdkField<?>>
sdkFields()
static Class<? extends LifecycleRule.Builder>
serializableBuilderClass()
ExpirationStatus
status()
If 'Enabled', the rule is currently being applied.String
statusAsString()
If 'Enabled', the rule is currently being applied.LifecycleRule.Builder
toBuilder()
String
toString()
Returns a string representation of this object.List<Transition>
transitions()
Specifies when an Amazon S3 object transitions to a specified storage class.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
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. AFilter
must have exactly one ofPrefix
,Tag
, orAnd
specified.Filter
is required if theLifecycleRule
does not contain aPrefix
element.Tag
filters are not supported for directory buckets.- Returns:
- The
Filter
is used to identify objects that a Lifecycle Rule applies to. AFilter
must have exactly one ofPrefix
,Tag
, orAnd
specified.Filter
is required if theLifecycleRule
does not contain aPrefix
element.Tag
filters are not supported for directory buckets.
-
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 returnExpirationStatus.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromstatusAsString()
.- 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 returnExpirationStatus.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromstatusAsString()
.- 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 theisEmpty()
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.
This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.
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.
This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.
-
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 theisEmpty()
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.
This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.
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.
This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.
-
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.
-
toBuilder
public LifecycleRule.Builder toBuilder()
- Specified by:
toBuilder
in interfaceToCopyableBuilder<LifecycleRule.Builder,LifecycleRule>
-
builder
public static LifecycleRule.Builder builder()
-
serializableBuilderClass
public static Class<? extends LifecycleRule.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFields
in interfaceSdkPojo
-
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.
-
sdkFieldNameToField
public final Map<String,SdkField<?>> sdkFieldNameToField()
- Specified by:
sdkFieldNameToField
in interfaceSdkPojo
-
-