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 pair
RightT - the type of the right elements in the pair
Datensatzkomponenten:
left - the left element of the pair
rights - the list of right elements associated with the left element

public record MultiRightPair<LeftT,RightT>(LeftT left, List<RightT> rights) extends Record
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

    Konstruktoren
    Konstruktor
    Beschreibung
    MultiRightPair(LeftT left, List<RightT> rights)
    Erstellt eine Instanz einer Datensatzklasse MultiRightPair.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    static <LeftT, RightT>
    Pair<LeftT,RightT>
    Creates an empty MultiRightPair.
    final boolean
    Gibt an, ob ein anderes Objekt diesem gleich ("equal to") ist.
    Gets the left element
    Gets the right elements
    final int
    Gibt einen Hashcodewert für diese Objekt zurück.
    boolean
    Indicates whether the MultiRightPair is empty
    Gibt den Wert für die Datensatzkomponente left zurück.
    static <LeftT, RightT>
    MultiRightPair<LeftT,RightT>
    of(Pair<LeftT,RightT> pair)
    Creates a new MultiRightPair from a Pair.
    static <LeftT, RightT>
    MultiRightPair<LeftT,RightT>
    of(LeftT left, List<RightT> rights)
    Creates a new MultiRightPair with the specified left and right values.
    static <LeftT, RightT>
    MultiRightPair<LeftT,RightT>
    of(LeftT left, RightT right)
    Creates a new MultiRightPair with the specified left and single right value.
    Gibt den Wert für die Datensatzkomponente rights zurück.
    final String
    Gibt eine Zeichenfolgendarstellung dieser Datensatzklasse zurück.

    Von Klasse geerbte Methoden java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Konstruktordetails

    • MultiRightPair

      public MultiRightPair(LeftT left, List<RightT> rights)
      Erstellt eine Instanz einer Datensatzklasse MultiRightPair.
      Parameter:
      left - Wert für die Datensatzkomponente left
      rights - Wert für die Datensatzkomponente rights
  • Methodendetails

    • getLeft

      public LeftT getLeft()
      Gets the left element
      Gibt zurück:
      the left element
    • getRights

      public List<RightT> getRights()
      Gets the right elements
      Gibt zurück:
      the right elements
    • of

      public static <LeftT, RightT> MultiRightPair<LeftT,RightT> of(LeftT left, List<RightT> rights)
      Creates a new MultiRightPair with the specified left and right values.
      Typparameter:
      LeftT - the type of the left value
      RightT - the type of the right value in the list
      Parameter:
      left - the left value
      rights - the rights value
      Gibt zurück:
      a new MultiRightPair instance containing the given values
    • of

      public static <LeftT, RightT> MultiRightPair<LeftT,RightT> of(LeftT left, RightT right)
      Creates a new MultiRightPair with the specified left and single right value.
      Typparameter:
      LeftT - the type of the left value
      RightT - the type of the right value
      Parameter:
      left - the left value
      right - the right value
      Gibt zurück:
      a new MultiRightPair instance containing the given values
      Siehe auch:
    • of

      public static <LeftT, RightT> MultiRightPair<LeftT,RightT> of(Pair<LeftT,RightT> pair)
      Creates a new MultiRightPair from a Pair.
      Typparameter:
      LeftT - the type of the left value
      RightT - the type of the right value
      Parameter:
      pair - paired values to take over
      Gibt zurück:
      a new MultiRightPair instance containing the given values
    • isEmpty

      public boolean isEmpty()
      Indicates whether the MultiRightPair is empty
      Gibt zurück:
      true true if the pair has values; false otherwise
    • empty

      public static <LeftT, RightT> Pair<LeftT,RightT> empty()
      Creates an empty MultiRightPair.

      MultiRightPairs are immutable, so only used to signify that there exist no pair.

      Typparameter:
      LeftT - the type of the left value
      RightT - the type of the right value
      Gibt zurück:
      an empty pair
    • toString

      public final String toString()
      Gibt eine Zeichenfolgendarstellung dieser Datensatzklasse zurück. Die Darstellung enthält den Namen der Klasse, gefolgt vom Namen und Wert jeder der Datensatzkomponenten.
      Angegeben von:
      toString in Klasse Record
      Gibt zurück:
      eine Zeichenfolgendarstellung dieses Objekts
    • hashCode

      public final int hashCode()
      Gibt einen Hashcodewert für diese Objekt zurück. Der Wert wird vom Hashcode jeder der Datensatzkomponenten abgeleitet.
      Angegeben von:
      hashCode in Klasse Record
      Gibt zurück:
      ein Hashcodewert für dieses Objekt
    • equals

      public final boolean equals(Object o)
      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 mit Objects::equals(Object,Object).
      Angegeben von:
      equals in Klasse Record
      Parameter:
      o - das Objekt, mit dem verglichen wird
      Gibt zurück:
      true, wenn dieses Objekt gleich dem Argument o ist, andernfalls false.
    • left

      public LeftT left()
      Gibt den Wert für die Datensatzkomponente left zurück.
      Gibt zurück:
      Wert der Datensatzkomponente left
    • rights

      public List<RightT> rights()
      Gibt den Wert für die Datensatzkomponente rights zurück.
      Gibt zurück:
      Wert der Datensatzkomponente rights