Package codes.grow.packages.vault
Record Class Lease<T>
java.lang.Object
java.lang.Record
codes.grow.packages.vault.Lease<T>
- Type Parameters:
T- type of the data- Record Components:
leaseId- lease id, e.g.database/creds/app/abcleaseDuration- TTL of the leaserenewable- whether the lease can be reneweddata- the secret datawarnings- server warnings
public record Lease<T>(String leaseId, Duration leaseDuration, boolean renewable, T data, List<String> warnings)
extends Record
A secret with a lease (for example dynamic database credentials). Keep it alive with
LeaseManager.manage(Lease, RenewalOptions).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondata()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theleaseDurationrecord component.leaseId()Returns the value of theleaseIdrecord component.booleanReturns the value of therenewablerecord component.final StringtoString()Returns a string representation of this record class.warnings()Returns the value of thewarningsrecord component.
-
Constructor Details
-
Method Details
-
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 '=='. -
leaseId
Returns the value of theleaseIdrecord component.- Returns:
- the value of the
leaseIdrecord component
-
leaseDuration
Returns the value of theleaseDurationrecord component.- Returns:
- the value of the
leaseDurationrecord component
-
renewable
public boolean renewable()Returns the value of therenewablerecord component.- Returns:
- the value of the
renewablerecord component
-
data
Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
warnings
Returns the value of thewarningsrecord component.- Returns:
- the value of the
warningsrecord component
-