Package org.pkl.core

Class Pair<F,​S>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<java.lang.Object>, Value

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

      Constructors 
      Constructor Description
      Pair​(F first, S second)
      Constructs a pair with the given elements.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> T accept​(ValueConverter<T> converter)
      Invokes the given converters's convert method for this Value.
      void accept​(ValueVisitor visitor)
      Invokes the given visitor's visit method for this Value.
      boolean equals​(@Nullable java.lang.Object obj)  
      PClassInfo<?> getClassInfo()
      Returns information about the Pkl class associated with this Value.
      F getFirst()
      Returns the first element of this pair.
      S getSecond()
      Returns the second element of this pair.
      int hashCode()  
      java.util.Iterator<java.lang.Object> iterator()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • Pair

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

      • getFirst

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

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

        public java.util.Iterator<java.lang.Object> iterator()
        Specified by:
        iterator in interface java.lang.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 java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object