public class Lease<T> extends Object implements Serializable
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_DURATION_SECS |
static String |
LEASE_DURATION |
| 构造器和说明 |
|---|
Lease(T renewal,
long durationSECS)
constructor
|
Lease(T renewal,
long duration,
TimeUnit unit)
Constructor.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(Object o)
Equals boolean.
|
long |
getBeginTimestamp()
Getter method for property beginTimestamp.
|
long |
getLastUpdateTimestamp()
Getter method for property lastUpdateTimestamp.
|
T |
getRenewal()
Getter method for property renewal.
|
int |
hashCode()
Hash code int.
|
boolean |
isExpired()
verify expired or not
|
void |
renew()
refresh lastUpdateTimestamp
|
void |
renew(long durationSECS)
refresh lastUpdateTimestamp by durationSECS
|
void |
setRenewal(T renewal)
Setter method for property renewal.
|
String |
toString()
To string string.
|
public Lease(T renewal, long durationSECS)
renewal - renewaldurationSECS - durationSECSpublic boolean isExpired()
public void renew()
public void renew(long durationSECS)
durationSECS - durationSECSpublic T getRenewal()
public void setRenewal(T renewal)
renewal - value to be assigned to property renewalpublic long getBeginTimestamp()
public long getLastUpdateTimestamp()
public boolean equals(Object o)
Copyright © 2023 The Ant Financial. All rights reserved.