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 optionally specifying the default Object Lock retention settings for new objects placed in the specified bucket.
-
The
DefaultRetentionsettings require both a mode and a period. -
The
DefaultRetentionperiod can be eitherDaysorYearsbut you must select one. You cannot specifyDaysandYearsat the same time.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDefaultRetention.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultRetention.Builderbuilder()Integerdays()The number of days that you want to specify for the default retention period.booleanequals(Object obj)booleanequalsBySdkFields(Object obj)<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)inthashCode()ObjectLockRetentionModemode()The default Object Lock retention mode you want to apply to new objects placed in the specified bucket.StringmodeAsString()The default Object Lock retention mode you want to apply to new objects placed in the specified bucket.Map<String,SdkField<?>>sdkFieldNameToField()List<SdkField<?>>sdkFields()static Class<? extends DefaultRetention.Builder>serializableBuilderClass()DefaultRetention.BuildertoBuilder()StringtoString()Returns a string representation of this object.Integeryears()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
DaysorYears.If the service returns an enum value that is not available in the current SDK version,
modewill 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
DaysorYears. - 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
DaysorYears.If the service returns an enum value that is not available in the current SDK version,
modewill 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
DaysorYears. - 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:
toBuilderin 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:
equalsBySdkFieldsin 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:
sdkFieldNameToFieldin interfaceSdkPojo
-
-