Package org.pkl.core

Class Pair<F,S>

java.lang.Object
org.pkl.core.Pair<F,S>
All Implemented Interfaces:
Serializable, Iterable<Object>, Value

public final class Pair<F,S> extends Object implements Value, Iterable<Object>
Java representation of a pkl.base#Pair value.
See Also:
  • Constructor Details

    • Pair

      public Pair(F first, S second)
      Constructs a pair with the given elements.
  • Method Details

    • getFirst

      public F getFirst()
      Returns the first element of this pair.
    • getSecond

      public S getSecond()
      Returns the second element of this pair.
    • iterator

      public Iterator<Object> iterator()
      Specified by:
      iterator in interface Iterable<F>
    • accept

      public void accept(ValueVisitor visitor)
      Description copied from interface: Value
      Invokes the given visitor's visit method for this Value.
      Specified by:
      accept in interface Value
    • accept

      public <T> T accept(ValueConverter<T> converter)
      Description copied from interface: Value
      Invokes the given converters's convert method for this Value.
      Specified by:
      accept in interface Value
    • getClassInfo

      public PClassInfo<?> getClassInfo()
      Description copied from interface: Value
      Returns information about the Pkl class associated with this Value.
      Specified by:
      getClassInfo in interface Value
    • equals

      public boolean equals(@Nullable @Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object