Datensatzklasse MultiRightPair<LeftT,RightT>
java.lang.Object
java.lang.Record
de.kamillionlabs.hateoflux.utility.pair.MultiRightPair<LeftT,RightT>
- Typparameter:
LeftT- the type of the left element in the pairRightT- the type of the right elements in the pair- Datensatzkomponenten:
left- the left element of the pairrights- the list of right elements associated with the left element
Represents an immutable pair consisting of a single left value and multiple right values.
This record associates a left element of type LeftT with a list of right elements of type
RightT. It provides a way to group a single left value with multiple related right values
without enforcing key-value semantics. Unlike Pair, which holds only one right value,
MultiRightPair allows for multiple right values to be associated with a single left value.
- Siehe auch:
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungMultiRightPair(LeftT left, List<RightT> rights) Erstellt eine Instanz einer DatensatzklasseMultiRightPair. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic <LeftT,RightT>
Pair<LeftT, RightT> empty()Creates an emptyMultiRightPair.final booleanGibt an, ob ein anderes Objekt diesem gleich ("equal to") ist.getLeft()Gets the left elementGets the right elementsfinal inthashCode()Gibt einen Hashcodewert für diese Objekt zurück.booleanisEmpty()Indicates whether theMultiRightPairis emptyleft()Gibt den Wert für die Datensatzkomponenteleftzurück.static <LeftT,RightT>
MultiRightPair<LeftT, RightT> Creates a newMultiRightPairfrom aPair.static <LeftT,RightT>
MultiRightPair<LeftT, RightT> Creates a newMultiRightPairwith the specified left and right values.static <LeftT,RightT>
MultiRightPair<LeftT, RightT> of(LeftT left, RightT right) Creates a newMultiRightPairwith the specified left and single right value.rights()Gibt den Wert für die Datensatzkomponenterightszurück.final StringtoString()Gibt eine Zeichenfolgendarstellung dieser Datensatzklasse zurück.
-
Konstruktordetails
-
Methodendetails
-
getLeft
Gets the left element- Gibt zurück:
- the left element
-
getRights
Gets the right elements- Gibt zurück:
- the right elements
-
of
Creates a newMultiRightPairwith the specified left and right values.- Typparameter:
LeftT- the type of the left valueRightT- the type of the right value in the list- Parameter:
left- the left valuerights- the rights value- Gibt zurück:
- a new
MultiRightPairinstance containing the given values
-
of
Creates a newMultiRightPairwith the specified left and single right value.- Typparameter:
LeftT- the type of the left valueRightT- the type of the right value- Parameter:
left- the left valueright- the right value- Gibt zurück:
- a new
MultiRightPairinstance containing the given values - Siehe auch:
-
of
Creates a newMultiRightPairfrom aPair.- Typparameter:
LeftT- the type of the left valueRightT- the type of the right value- Parameter:
pair- paired values to take over- Gibt zurück:
- a new
MultiRightPairinstance containing the given values
-
isEmpty
public boolean isEmpty()Indicates whether theMultiRightPairis empty- Gibt zurück:
truetrue if the pair has values;falseotherwise
-
empty
Creates an emptyMultiRightPair.MultiRightPairs are immutable, so only used to signify that there exist no pair.- Typparameter:
LeftT- the type of the left valueRightT- the type of the right value- Gibt zurück:
- an empty pair
-
toString
Gibt eine Zeichenfolgendarstellung dieser Datensatzklasse zurück. Die Darstellung enthält den Namen der Klasse, gefolgt vom Namen und Wert jeder der Datensatzkomponenten. -
hashCode
public final int hashCode()Gibt einen Hashcodewert für diese Objekt zurück. Der Wert wird vom Hashcode jeder der Datensatzkomponenten abgeleitet. -
equals
Gibt an, ob ein anderes Objekt diesem gleich ("equal to") ist. Die Objekte sind gleich, wenn das andere Objekt der gleichen Klasse angehört und alle Datensatzkomponenten gleich sind. Alle Komponenten in dieser Datensatzklasse werden verglichen mitObjects::equals(Object,Object). -
left
Gibt den Wert für die Datensatzkomponenteleftzurück.- Gibt zurück:
- Wert der Datensatzkomponente
left
-
rights
Gibt den Wert für die Datensatzkomponenterightszurück.- Gibt zurück:
- Wert der Datensatzkomponente
rights
-