Package dev.cachly
Class SemanticResult<T>
java.lang.Object
dev.cachly.SemanticResult<T>
- Type Parameters:
T- type of the cached value
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThree-level confidence band for a semantic cache hit. -
Method Summary
-
Method Details
-
getValue
The resolved value (from cache or from the supplier). -
isHit
public boolean isHit()trueif the value was served from the semantic cache. -
getSimilarity
Cosine similarity of the cache hit (0–1). Only set whenisHit()istrue.- Returns:
- similarity score or
nullon cache miss
-
getConfidence
Confidence band of the cache hit. Only set whenisHit()istrue.- Returns:
- confidence or
nullon cache miss
-
toString
-