Class EventHoldDuration

java.lang.Object
software.amazon.awssdk.eventnotifications.s3.model.EventHoldDuration

@SdkPublicApi public class EventHoldDuration extends Object
The duration of an event-hold retention, within ObjectRetentionEventData. Only present when variable (event-hold) retention is used.

The duration is modeled as a single unit/value pair to mirror the message-format contract emitted by the service: the unit becomes the JSON key and the value its number, producing {"days": 90} or {"years": 1}. Modeling it this way (rather than fixed days/years fields) means the reader surfaces whatever unit the service emits, so a new unit does not require an SDK change.

  • Constructor Details

    • EventHoldDuration

      public EventHoldDuration(String unit, Long value)
  • Method Details

    • getUnit

      public String getUnit()
      Returns:
      the duration unit, for example "days" or "years".
    • getValue

      public Long getValue()
      Returns:
      the duration value for the given unit.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object