Record Class KeyedValue.UnzippedKeyValues<T>

java.lang.Object
java.lang.Record
ch.njol.skript.lang.KeyedValue.UnzippedKeyValues<T>
Type Parameters:
T - The type of the values in the list.
Record Components:
keys - A list of keys extracted from the KeyedValues.
values - A list of values extracted from the KeyedValues.
Enclosing class:
KeyedValue<T>

public static record KeyedValue.UnzippedKeyValues<T>(@NotNull List<@NotNull String> keys, @NotNull List<@NotNull T> values) extends Record
A record that represents a pair of lists: one for keys and one for values. This is used to store the result of unzipping KeyedValues into separate lists.
Both lists are guaranteed to be of the same length, and each key corresponds to the value at the same index.
If the keys are not provided, numerical indices (1, 2, 3, ..., n) are used as keys.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    UnzippedKeyValues(@NotNull String @Nullable [] keys, T @NotNull [] values)
     
    UnzippedKeyValues(@Nullable List<@NotNull String> keys, @NotNull List<@NotNull T> values)
    Creates an instance of a UnzippedKeyValues record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotNull List<@NotNull String>
    Returns the value of the keys record component.
    final String
    Returns a string representation of this record class.
    @NotNull List<@NotNull T>
    Returns the value of the values record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • UnzippedKeyValues

      public UnzippedKeyValues(@Nullable @Nullable List<@NotNull String> keys, @NotNull @NotNull List<@NotNull T> values)
      Creates an instance of a UnzippedKeyValues record class.
      Parameters:
      keys - the value for the keys record component
      values - the value for the values record component
    • UnzippedKeyValues

      public UnzippedKeyValues(@NotNull @NotNull String @Nullable [] keys, @NotNull T @NotNull [] values)
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • keys

      @NotNull public @NotNull List<@NotNull String> keys()
      Returns the value of the keys record component.
      Returns:
      the value of the keys record component
    • values

      @NotNull public @NotNull List<@NotNull T> values()
      Returns the value of the values record component.
      Returns:
      the value of the values record component