Package codes.grow.packages.vault
Record Class KvMetadata
java.lang.Object
java.lang.Record
codes.grow.packages.vault.KvMetadata
- Record Components:
casRequired- whether writes needcascreatedTime- creation timeupdatedTime- last update timecurrentVersion- current versionoldestVersion- oldest kept versionmaxVersions- maximum versions kept (0 = mount default)deleteVersionAfter- automatic deletion delay (zero = never)customMetadata- custom metadataversions- metadata per version number
public record KvMetadata(boolean casRequired, Optional<Instant> createdTime, Optional<Instant> updatedTime, int currentVersion, int oldestVersion, int maxVersions, Duration deleteVersionAfter, Map<String,String> customMetadata, Map<Integer,KvVersionMetadata> versions)
extends Record
Metadata of a KV v2 secret (
GET <mount>/metadata/<path>).-
Constructor Summary
ConstructorsConstructorDescriptionKvMetadata(boolean casRequired, Optional<Instant> createdTime, Optional<Instant> updatedTime, int currentVersion, int oldestVersion, int maxVersions, Duration deleteVersionAfter, Map<String, String> customMetadata, Map<Integer, KvVersionMetadata> versions) Creates the record; maps are copied. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecasRequiredrecord component.Returns the value of thecreatedTimerecord component.booleanReturns whether the current version is soft-deleted or destroyed.intReturns the value of thecurrentVersionrecord component.Returns the value of thecustomMetadatarecord component.Returns the value of thedeleteVersionAfterrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxVersionsrecord component.intReturns the value of theoldestVersionrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theupdatedTimerecord component.versions()Returns the value of theversionsrecord component.
-
Constructor Details
-
KvMetadata
public KvMetadata(boolean casRequired, Optional<Instant> createdTime, Optional<Instant> updatedTime, int currentVersion, int oldestVersion, int maxVersions, Duration deleteVersionAfter, Map<String, String> customMetadata, Map<Integer, KvVersionMetadata> versions) Creates the record; maps are copied.- Parameters:
casRequired- cas flagcreatedTime- creation timeupdatedTime- update timecurrentVersion- current versionoldestVersion- oldest versionmaxVersions- max versionsdeleteVersionAfter- deletion delaycustomMetadata- custom metadataversions- versions
-
-
Method Details
-
currentDeleted
public boolean currentDeleted()Returns whether the current version is soft-deleted or destroyed.- Returns:
- true when the latest data is gone
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
casRequired
public boolean casRequired()Returns the value of thecasRequiredrecord component.- Returns:
- the value of the
casRequiredrecord component
-
createdTime
Returns the value of thecreatedTimerecord component.- Returns:
- the value of the
createdTimerecord component
-
updatedTime
Returns the value of theupdatedTimerecord component.- Returns:
- the value of the
updatedTimerecord component
-
currentVersion
public int currentVersion()Returns the value of thecurrentVersionrecord component.- Returns:
- the value of the
currentVersionrecord component
-
oldestVersion
public int oldestVersion()Returns the value of theoldestVersionrecord component.- Returns:
- the value of the
oldestVersionrecord component
-
maxVersions
public int maxVersions()Returns the value of themaxVersionsrecord component.- Returns:
- the value of the
maxVersionsrecord component
-
deleteVersionAfter
Returns the value of thedeleteVersionAfterrecord component.- Returns:
- the value of the
deleteVersionAfterrecord component
-
customMetadata
Returns the value of thecustomMetadatarecord component.- Returns:
- the value of the
customMetadatarecord component
-
versions
Returns the value of theversionsrecord component.- Returns:
- the value of the
versionsrecord component
-