Record Class KvVersionMetadata

java.lang.Object
java.lang.Record
codes.grow.packages.vault.KvVersionMetadata
Record Components:
version - version number
createdTime - creation time
deletionTime - soft-deletion time (empty when not deleted)
destroyed - whether the version is destroyed
customMetadata - custom metadata of the secret

public record KvVersionMetadata(int version, Optional<Instant> createdTime, Optional<Instant> deletionTime, boolean destroyed, Map<String,String> customMetadata) extends Record
Metadata of one KV v2 version.
  • Constructor Details

    • KvVersionMetadata

      public KvVersionMetadata(int version, Optional<Instant> createdTime, Optional<Instant> deletionTime, boolean destroyed, Map<String,String> customMetadata)
      Creates the record; the map is copied.
      Parameters:
      version - version
      createdTime - creation time
      deletionTime - deletion time
      destroyed - destroyed flag
      customMetadata - custom metadata
  • Method Details

    • deleted

      public boolean deleted()
      Returns whether the version is soft-deleted or destroyed.
      Returns:
      true when the data is gone
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • version

      public int version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • createdTime

      public Optional<Instant> createdTime()
      Returns the value of the createdTime record component.
      Returns:
      the value of the createdTime record component
    • deletionTime

      public Optional<Instant> deletionTime()
      Returns the value of the deletionTime record component.
      Returns:
      the value of the deletionTime record component
    • destroyed

      public boolean destroyed()
      Returns the value of the destroyed record component.
      Returns:
      the value of the destroyed record component
    • customMetadata

      public Map<String,String> customMetadata()
      Returns the value of the customMetadata record component.
      Returns:
      the value of the customMetadata record component