Package app.ductape.sdk.cache
Record Class CacheManager.CacheFetchResult<T>
java.lang.Object
java.lang.Record
app.ductape.sdk.cache.CacheManager.CacheFetchResult<T>
- Enclosing class:
- CacheManager
public static record CacheManager.CacheFetchResult<T>(boolean hit, T data, String key, CacheManager.CacheSource source)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionCacheFetchResult(boolean hit, T data, String key, CacheManager.CacheSource source) Creates an instance of aCacheFetchResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondata()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhit()Returns the value of thehitrecord component.key()Returns the value of thekeyrecord component.source()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CacheFetchResult
Creates an instance of aCacheFetchResultrecord class.- Parameters:
hit- the value for thehitrecord componentdata- the value for thedatarecord componentkey- the value for thekeyrecord componentsource- the value for thesourcerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
hit
public boolean hit()Returns the value of thehitrecord component.- Returns:
- the value of the
hitrecord component
-
data
Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-