Class Lease
java.lang.Object
org.springframework.vault.core.lease.domain.Lease
A lease abstracting the lease Id, duration and its renewability.
- Author:
- Mark Paluch, Steven Swor
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic LeasefromTimeToLive(Duration leaseDuration) Create a new non-renewableLease, without aleaseIdand specified duration.inthashCode()booleanbooleanstatic Leasenone()Factory method to return a non-renewable, zero-durationLease.static LeaseCreate a newLease.toString()
-
Method Details
-
of
Create a newLease.- Parameters:
leaseId- must not be empty or null.leaseDuration- the lease duration, must not be null or negative.renewable- true if this lease is renewable.- Returns:
- the created
Lease - Since:
- 2.0
-
fromTimeToLive
Create a new non-renewableLease, without aleaseIdand specified duration.- Parameters:
leaseDuration- the lease duration, must not be null or negative.- Returns:
- the created
Lease - Since:
- 2.0
-
none
Factory method to return a non-renewable, zero-durationLease.- Returns:
- a non-renewable, zero-duration
Lease.
-
hasLeaseId
public boolean hasLeaseId()- Returns:
- true is the lease is associated with a
leaseId. - Since:
- 1.1
-
getLeaseId
- Returns:
- the lease Id
-
getLeaseDuration
- Returns:
- the lease duration in seconds.
-
isRenewable
public boolean isRenewable()- Returns:
- true if the lease is renewable.
-
equals
-
hashCode
public int hashCode() -
toString
-