Class LifecycleRuleFilter

java.lang.Object
software.amazon.awssdk.services.s3.model.LifecycleRuleFilter
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<LifecycleRuleFilter.Builder,LifecycleRuleFilter>

@Generated("software.amazon.awssdk:codegen") public final class LifecycleRuleFilter extends Object implements SdkPojo, Serializable, ToCopyableBuilder<LifecycleRuleFilter.Builder,LifecycleRuleFilter>

The Filter is used to identify objects that a Lifecycle Rule applies to. A Filter can have exactly one of Prefix, Tag, ObjectSizeGreaterThan, ObjectSizeLessThan, or And specified. If the Filter element is left empty, the Lifecycle Rule applies to all objects in the bucket.

See Also:
  • Method Details

    • prefix

      public final String prefix()

      Prefix identifying one or more objects to which the rule applies.

      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.

      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.

    • tag

      public final Tag tag()

      This tag must exist in the object's tag set in order for the rule to apply.

      This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.

      Returns:
      This tag must exist in the object's tag set in order for the rule to apply.

      This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.

    • objectSizeGreaterThan

      public final Long objectSizeGreaterThan()

      Minimum object size to which the rule applies.

      Returns:
      Minimum object size to which the rule applies.
    • objectSizeLessThan

      public final Long objectSizeLessThan()

      Maximum object size to which the rule applies.

      Returns:
      Maximum object size to which the rule applies.
    • and

      public final LifecycleRuleAndOperator and()
      Returns the value of the And property for this object.
      Returns:
      The value of the And property for this object.
    • toBuilder

      public LifecycleRuleFilter.Builder toBuilder()
      Specified by:
      toBuilder in interface ToCopyableBuilder<LifecycleRuleFilter.Builder,LifecycleRuleFilter>
    • builder

      public static LifecycleRuleFilter.Builder builder()
    • serializableBuilderClass

      public static Class<? extends LifecycleRuleFilter.Builder> serializableBuilderClass()
    • hashCode

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

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

      public final boolean equalsBySdkFields(Object obj)
      Specified by:
      equalsBySdkFields in interface SdkPojo
    • 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)
    • fromPrefix

      public static LifecycleRuleFilter fromPrefix(String prefix)
      Create an instance of this class with prefix() initialized to the given value.

      Prefix identifying one or more objects to which the rule applies.

      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.

      Parameters:
      prefix - Prefix identifying one or more objects to which the rule applies.

      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.

    • fromTag

      public static LifecycleRuleFilter fromTag(Tag tag)
      Create an instance of this class with tag() initialized to the given value.

      This tag must exist in the object's tag set in order for the rule to apply.

      This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.

      Parameters:
      tag - This tag must exist in the object's tag set in order for the rule to apply.

      This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.

    • fromTag

      public static LifecycleRuleFilter fromTag(Consumer<Tag.Builder> tag)
      Create an instance of this class with tag() initialized to the given value.

      This tag must exist in the object's tag set in order for the rule to apply.

      This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.

      Parameters:
      tag - This tag must exist in the object's tag set in order for the rule to apply.

      This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.

    • fromObjectSizeGreaterThan

      public static LifecycleRuleFilter fromObjectSizeGreaterThan(Long objectSizeGreaterThan)
      Create an instance of this class with objectSizeGreaterThan() initialized to the given value.

      Minimum object size to which the rule applies.

      Parameters:
      objectSizeGreaterThan - Minimum object size to which the rule applies.
    • fromObjectSizeLessThan

      public static LifecycleRuleFilter fromObjectSizeLessThan(Long objectSizeLessThan)
      Create an instance of this class with objectSizeLessThan() initialized to the given value.

      Maximum object size to which the rule applies.

      Parameters:
      objectSizeLessThan - Maximum object size to which the rule applies.
    • fromAnd

      public static LifecycleRuleFilter fromAnd(LifecycleRuleAndOperator and)
      Create an instance of this class with and() initialized to the given value. Sets the value of the And property for this object.
      Parameters:
      and - The new value for the And property for this object.
    • fromAnd

      Create an instance of this class with and() initialized to the given value. Sets the value of the And property for this object.
      Parameters:
      and - The new value for the And property for this object.
    • type

      public LifecycleRuleFilter.Type type()
      Retrieve an enum value representing which member of this object is populated. When this class is returned in a service response, this will be LifecycleRuleFilter.Type.UNKNOWN_TO_SDK_VERSION if the service returned a member that is only known to a newer SDK version. When this class is created directly in your code, this will be LifecycleRuleFilter.Type.UNKNOWN_TO_SDK_VERSION if zero members are set, and null if more than one member is set.
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo