public class CachedContext extends java.lang.Object implements java.lang.Comparable<CachedContext>
Constructor and Description |
---|
CachedContext(java.lang.String key,
java.lang.Object value)
Builds the context with a given key and value
|
CachedContext(java.lang.String key,
java.lang.Object value,
java.util.Date cacheTime)
Builds the context with a given key and value
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(CachedContext other) |
boolean |
equals(java.lang.Object o) |
java.util.Date |
getCacheTime()
Returns the CacheTime for the context (if this isn't null, it should be more accurate than the cache block's time)
|
java.lang.Object |
getId()
Returns the Id for the object (this can be used to track things in a database if needed, but isn't used for anything other than a custom use)
|
java.lang.String |
getKey()
Returns the Key for the object
|
java.lang.Object |
getValue()
Returns the Value for the object
|
int |
hashCode() |
void |
setId(java.lang.Object id)
Sets the Id for the object (this can be used to track things in a database if needed, but isn't used for anything other than a custom use)
|
java.lang.String |
toString() |
public CachedContext(@NotNull java.lang.String key, @Nullable java.lang.Object value)
key
- The context keyvalue
- The context valuepublic CachedContext(@NotNull java.lang.String key, @Nullable java.lang.Object value, @Nullable java.util.Date cacheTime)
key
- The context keyvalue
- The context valuecacheTime
- The time this was cached. This is optional and can be used if the time from the corresponding block isn't accurate@Nullable public java.lang.Object getId()
public void setId(@Nullable java.lang.Object id)
id
- The new value for Id (this can be used to track things in a database if needed, but isn't used for anything other than a custom use)@NotNull public java.lang.String getKey()
@Nullable public java.lang.Object getValue()
@Nullable public java.util.Date getCacheTime()
public int compareTo(@NotNull CachedContext other)
compareTo
in interface java.lang.Comparable<CachedContext>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
@NotNull public java.lang.String toString()
toString
in class java.lang.Object