Package com.redis.lettucemod.bloom
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <V> LongScoredValue<V>empty()Returns an emptyScoredValueinstance.booleanstatic <T extends V,V>
LongScoredValue<V>static <T extends V,V>
LongScoredValue<V>fromNullable(long score, T value) Creates aValuefrom ascoreandvalue.longgetScore()inthashCode()static <T extends V,V>
LongScoredValue<V>just(long score, T value) <R> LongScoredValue<R>Returns aLongScoredValueconsisting of the results of applying the given function to the value of this element.Returns aLongScoredValueconsisting of the results of applying the given function to the score of this element.toString()Methods inherited from class io.lettuce.core.Value
from, fromNullable, getValue, getValueOrElse, getValueOrElseGet, getValueOrElseThrow, hasValue, ifEmpty, ifHasValue, ifHasValueOrElse, isEmpty, just, optional, stream
-
Constructor Details
-
LongScoredValue
protected LongScoredValue()Serializable constructor.
-
-
Method Details
-
from
Creates aValuefrom akeyand anOptional. The resulting value contains the value from theOptionalif a value is present. Value is empty if theOptionalis empty.- Parameters:
score- the score.optional- the optional. May be empty but nevernull.- Returns:
- the
Value.
-
fromNullable
Creates aValuefrom ascoreandvalue. The resulting value contains the value if thevalueis not null.- Parameters:
score- the score.value- the value. May benull.- Returns:
- the
Value.
-
empty
Returns an emptyScoredValueinstance. No value is present for this instance.- Returns:
- the
LongScoredValue
-
just
- Parameters:
score- the score.value- the value. Must not benull.- Returns:
- the
LongScoredValue.
-
getScore
public long getScore() -
equals
- Overrides:
equalsin classio.lettuce.core.Value<V>
-
hashCode
public int hashCode()- Overrides:
hashCodein classio.lettuce.core.Value<V>
-
toString
- Overrides:
toStringin classio.lettuce.core.Value<V>
-
map
Returns aLongScoredValueconsisting of the results of applying the given function to the value of this element. Mapping is performed only if avalue is present.- Overrides:
mapin classio.lettuce.core.Value<V>- Type Parameters:
R- element type of the newLongScoredValue.- Parameters:
mapper- a stateless function to apply to each element.- Returns:
- the new
LongScoredValue.
-
mapScore
Returns aLongScoredValueconsisting of the results of applying the given function to the score of this element. Mapping is performed only if avalue is present.- Parameters:
mapper- a stateless function to apply to each element.- Returns:
- the new
LongScoredValue.
-