Class LongScoredValue<V>

java.lang.Object
io.lettuce.core.Value<V>
com.redis.lettucemod.bloom.LongScoredValue<V>
Type Parameters:
V - Value type.
All Implemented Interfaces:
Serializable

public class LongScoredValue<V> extends io.lettuce.core.Value<V>
A long scored-value extension to Value.
Author:
Will Glozer, Mark Paluch, Julien Ruaux
See Also:
  • Constructor Details

    • LongScoredValue

      protected LongScoredValue()
      Serializable constructor.
  • Method Details

    • from

      public static <T extends V, V> LongScoredValue<V> from(long score, Optional<T> optional)
      Creates a Value from a key and an Optional. The resulting value contains the value from the Optional if a value is present. Value is empty if the Optional is empty.
      Parameters:
      score - the score.
      optional - the optional. May be empty but never null.
      Returns:
      the Value.
    • fromNullable

      public static <T extends V, V> LongScoredValue<V> fromNullable(long score, T value)
      Creates a Value from a score and value. The resulting value contains the value if the value is not null.
      Parameters:
      score - the score.
      value - the value. May be null.
      Returns:
      the Value.
    • empty

      public static <V> LongScoredValue<V> empty()
      Returns an empty ScoredValue instance. No value is present for this instance.
      Returns:
      the LongScoredValue
    • just

      public static <T extends V, V> LongScoredValue<V> just(long score, T value)
      Creates a LongScoredValue from a key and value. The resulting value contains the value.
      Parameters:
      score - the score.
      value - the value. Must not be null.
      Returns:
      the LongScoredValue.
    • getScore

      public long getScore()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class io.lettuce.core.Value<V>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class io.lettuce.core.Value<V>
    • toString

      public String toString()
      Overrides:
      toString in class io.lettuce.core.Value<V>
    • map

      public <R> LongScoredValue<R> map(Function<? super V,? extends R> mapper)
      Returns a LongScoredValue consisting of the results of applying the given function to the value of this element. Mapping is performed only if a value is present.
      Overrides:
      map in class io.lettuce.core.Value<V>
      Type Parameters:
      R - element type of the new LongScoredValue.
      Parameters:
      mapper - a stateless function to apply to each element.
      Returns:
      the new LongScoredValue.
    • mapScore

      public LongScoredValue<V> mapScore(Function<? super Number,? extends Number> mapper)
      Returns a LongScoredValue consisting of the results of applying the given function to the score of this element. Mapping is performed only if a value is present.
      Parameters:
      mapper - a stateless function to apply to each element.
      Returns:
      the new LongScoredValue .