Record Class RotationRules

java.lang.Object
java.lang.Record
codes.grow.packages.awssecretsmanager.RotationRules
Record Components:
automaticallyAfterDays - rotate every N days (1–1000)
duration - rotation window length, e.g. 3h
scheduleExpression - rate(...) or cron(...) expression

public record RotationRules(Integer automaticallyAfterDays, String duration, String scheduleExpression) extends Record
A rotation schedule. Components are null when not set.
  • Constructor Details

    • RotationRules

      public RotationRules(Integer automaticallyAfterDays, String duration, String scheduleExpression)
      Creates an instance of a RotationRules record class.
      Parameters:
      automaticallyAfterDays - the value for the automaticallyAfterDays record component
      duration - the value for the duration record component
      scheduleExpression - the value for the scheduleExpression record component
  • Method Details

    • everyDays

      public static RotationRules everyDays(int days)
      Rotates every days days.
      Parameters:
      days - interval in days
      Returns:
      the rules
    • schedule

      public static RotationRules schedule(String expression)
      Rotates on a schedule expression.
      Parameters:
      expression - rate(...) or cron(...)
      Returns:
      the rules
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • automaticallyAfterDays

      public Integer automaticallyAfterDays()
      Returns the value of the automaticallyAfterDays record component.
      Returns:
      the value of the automaticallyAfterDays record component
    • duration

      public String duration()
      Returns the value of the duration record component.
      Returns:
      the value of the duration record component
    • scheduleExpression

      public String scheduleExpression()
      Returns the value of the scheduleExpression record component.
      Returns:
      the value of the scheduleExpression record component