Class DefaultRetention
- java.lang.Object
-
- software.amazon.awssdk.services.s3.model.DefaultRetention
-
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<DefaultRetention.Builder,DefaultRetention>
@Generated("software.amazon.awssdk:codegen") public final class DefaultRetention extends Object implements SdkPojo, Serializable, ToCopyableBuilder<DefaultRetention.Builder,DefaultRetention>
The container element for specifying the default Object Lock retention settings for new objects placed in the specified bucket.
-
The
DefaultRetention
settings require both a mode and a period. -
The
DefaultRetention
period can be eitherDays
orYears
but you must select one. You cannot specifyDays
andYears
at the same time.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DefaultRetention.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultRetention.Builder
builder()
Integer
days()
The number of days that you want to specify for the default retention period.boolean
equals(Object obj)
boolean
equalsBySdkFields(Object obj)
<T> Optional<T>
getValueForField(String fieldName, Class<T> clazz)
int
hashCode()
ObjectLockRetentionMode
mode()
The default Object Lock retention mode you want to apply to new objects placed in the specified bucket.String
modeAsString()
The default Object Lock retention mode you want to apply to new objects placed in the specified bucket.List<SdkField<?>>
sdkFields()
static Class<? extends DefaultRetention.Builder>
serializableBuilderClass()
DefaultRetention.Builder
toBuilder()
String
toString()
Returns a string representation of this object.Integer
years()
The number of years that you want to specify for the default retention period.-
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
-
mode
public final ObjectLockRetentionMode mode()
The default Object Lock retention mode you want to apply to new objects placed in the specified bucket. Must be used with either
Days
orYears
.If the service returns an enum value that is not available in the current SDK version,
mode
will returnObjectLockRetentionMode.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available frommodeAsString()
.- Returns:
- The default Object Lock retention mode you want to apply to new objects placed in the specified bucket.
Must be used with either
Days
orYears
. - See Also:
ObjectLockRetentionMode
-
modeAsString
public final String modeAsString()
The default Object Lock retention mode you want to apply to new objects placed in the specified bucket. Must be used with either
Days
orYears
.If the service returns an enum value that is not available in the current SDK version,
mode
will returnObjectLockRetentionMode.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available frommodeAsString()
.- Returns:
- The default Object Lock retention mode you want to apply to new objects placed in the specified bucket.
Must be used with either
Days
orYears
. - See Also:
ObjectLockRetentionMode
-
days
public final Integer days()
The number of days that you want to specify for the default retention period. Must be used with
Mode
.- Returns:
- The number of days that you want to specify for the default retention period. Must be used with
Mode
.
-
years
public final Integer years()
The number of years that you want to specify for the default retention period. Must be used with
Mode
.- Returns:
- The number of years that you want to specify for the default retention period. Must be used with
Mode
.
-
toBuilder
public DefaultRetention.Builder toBuilder()
- Specified by:
toBuilder
in interfaceToCopyableBuilder<DefaultRetention.Builder,DefaultRetention>
-
builder
public static DefaultRetention.Builder builder()
-
serializableBuilderClass
public static Class<? extends DefaultRetention.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.
-
-