Package dev.cachly

Class SemanticResult<T>

java.lang.Object
dev.cachly.SemanticResult<T>
Type Parameters:
T - type of the cached value

public final class SemanticResult<T> extends Object
  • Method Details

    • getValue

      public T getValue()
      The resolved value (from cache or from the supplier).
    • isHit

      public boolean isHit()
      true if the value was served from the semantic cache.
    • getSimilarity

      public Double getSimilarity()
      Cosine similarity of the cache hit (0–1). Only set when isHit() is true.
      Returns:
      similarity score or null on cache miss
    • getConfidence

      public SemanticResult.Confidence getConfidence()
      Confidence band of the cache hit. Only set when isHit() is true.
      Returns:
      confidence or null on cache miss
    • toString

      public String toString()
      Overrides:
      toString in class Object