java.lang.Comparable<SimpleExpiringObject<T>>public class SimpleExpiringObject<T> extends java.lang.Object implements java.lang.Comparable<SimpleExpiringObject<T>>
| Constructor | Description |
|---|---|
SimpleExpiringObject(T value,
long expiry,
java.util.concurrent.TimeUnit unit) |
Creates a new object with the given value and expiring after the given time.
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
compareTo(SimpleExpiringObject<T> other) |
|
boolean |
equals(java.lang.Object other) |
|
T |
getValue() |
Returns the value of this object.
|
int |
hashCode() |
|
boolean |
isExpired() |
Checks whether this object is expired.
|
public SimpleExpiringObject(T value, long expiry, java.util.concurrent.TimeUnit unit)
java.lang.IllegalArgumentException - if value is nulljava.lang.IllegalArgumentException - if expiry is negativejava.lang.IllegalArgumentException - if unit is nullpublic int compareTo(SimpleExpiringObject<T> other)
compareTo in interface java.lang.Comparable<T>public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic T getValue()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean isExpired()