Interface Ranking
public interface Ranking
Represents an element of a sorted set, composed of a member and its associated score.
In data stores such as Valkey, a sorted set maintains elements ordered by a numeric value (commonly referred to as a score). This interface models that concept in a domain-oriented way, abstracting the underlying storage details while preserving ordering semantics.
Design note: This type is a value object and should be treated as immutable.
Implementations are expected to provide consistent equals and hashCode
semantics based on both member and score.
- See Also:
-
Method Details
-
getPoints
Number getPoints()Returns the numeric score associated with this member.The score determines the ordering of elements within the sorted set.
- Returns:
- the score used for ordering; never
null
-
getMember
String getMember()Returns the unique member identifier within the sorted set.- Returns:
- the member identifier; never
null
-
of
Creates a newRankinginstance with the given member and score.This factory method provides a consistent way to create immutable
Rankinginstances.- Parameters:
member- the member identifier; must not benullpoints- the score associated with the member; must not benull- Returns:
- a new
Rankinginstance - Throws:
NullPointerException- if eithermemberorpointsisnull
-