Record Class TieredEvictionManager.EvictionCandidate
java.lang.Object
java.lang.Record
com.loomcache.server.cache.TieredEvictionManager.EvictionCandidate
- All Implemented Interfaces:
Comparable<TieredEvictionManager.EvictionCandidate>
- Enclosing class:
TieredEvictionManager
public static record TieredEvictionManager.EvictionCandidate(String mapName, Object key, double score, long sizeBytes, long lastAccessedNanos)
extends Record
implements Comparable<TieredEvictionManager.EvictionCandidate>
Candidate for eviction.
-
Constructor Summary
ConstructorsConstructorDescriptionEvictionCandidate(String mapName, Object key, double score, long sizeBytes, long lastAccessedNanos) Creates an instance of aEvictionCandidaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionintfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.longReturns the value of thelastAccessedNanosrecord component.mapName()Returns the value of themapNamerecord component.doublescore()Returns the value of thescorerecord component.longReturns the value of thesizeBytesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EvictionCandidate
public EvictionCandidate(String mapName, Object key, double score, long sizeBytes, long lastAccessedNanos) Creates an instance of aEvictionCandidaterecord class.- Parameters:
mapName- the value for themapNamerecord componentkey- the value for thekeyrecord componentscore- the value for thescorerecord componentsizeBytes- the value for thesizeBytesrecord componentlastAccessedNanos- the value for thelastAccessedNanosrecord component
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<TieredEvictionManager.EvictionCandidate>
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
mapName
Returns the value of themapNamerecord component.- Returns:
- the value of the
mapNamerecord component
-
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
score
public double score()Returns the value of thescorerecord component.- Returns:
- the value of the
scorerecord component
-
sizeBytes
public long sizeBytes()Returns the value of thesizeBytesrecord component.- Returns:
- the value of the
sizeBytesrecord component
-
lastAccessedNanos
public long lastAccessedNanos()Returns the value of thelastAccessedNanosrecord component.- Returns:
- the value of the
lastAccessedNanosrecord component
-