Record Class KeyRotation.VersionedKey<K>
java.lang.Object
java.lang.Record
cloud.opencode.base.crypto.rotation.KeyRotation.VersionedKey<K>
- Type Parameters:
K- the key type - 密钥类型
- Enclosing class:
KeyRotation<K>
public static record KeyRotation.VersionedKey<K>(String keyId, long version, K key, Instant createdAt, KeyRotation.KeyStatus status)
extends Record
A versioned key with metadata.
带元数据的版本化密钥。
- Since:
- JDK 25, opencode-base-crypto V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionVersionedKey(String keyId, long version, K key, Instant createdAt, KeyRotation.KeyStatus status) Creates an instance of aVersionedKeyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecreatedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.keyId()Returns the value of thekeyIdrecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.longversion()Returns the value of theversionrecord component.withStatus(KeyRotation.KeyStatus newStatus)
-
Constructor Details
-
VersionedKey
public VersionedKey(String keyId, long version, K key, Instant createdAt, KeyRotation.KeyStatus status) Creates an instance of aVersionedKeyrecord class.- Parameters:
keyId- the value for thekeyIdrecord componentversion- the value for theversionrecord componentkey- the value for thekeyrecord componentcreatedAt- the value for thecreatedAtrecord componentstatus- the value for thestatusrecord component
-
-
Method Details
-
withStatus
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
keyId
Returns the value of thekeyIdrecord component.- Returns:
- the value of the
keyIdrecord component
-
version
public long version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
createdAt
Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-