Package org.pkl.core

Class TypeParameter

  • All Implemented Interfaces:
    java.io.Serializable

    public final class TypeParameter
    extends java.lang.Object
    implements java.io.Serializable
    A type parameter of a generic class, type alias, or method.
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  TypeParameter.Variance
      The variance of a type parameter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getIndex()
      Returns the index of this type parameter in its owner's type parameter list, starting from zero.
      java.lang.String getName()
      Returns the name of this type parameter.
      Member getOwner()
      Returns the generic class, type alias, or method that this type parameter belongs to.
      TypeParameter.Variance getVariance()
      Returns the variance of this type parameter.
      void initOwner​(Member owner)
      Initializes the generic class, type alias, or method that this type parameter belongs to.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TypeParameter

        public TypeParameter​(TypeParameter.Variance variance,
                             java.lang.String name,
                             int index)
    • Method Detail

      • initOwner

        public void initOwner​(Member owner)
        Initializes the generic class, type alias, or method that this type parameter belongs to. This method must be called as part of initializing this object. It is kept separate from the constructor to help clients avoid circular evaluation.
      • getOwner

        public Member getOwner()
        Returns the generic class, type alias, or method that this type parameter belongs to.
      • getName

        public java.lang.String getName()
        Returns the name of this type parameter.
      • getIndex

        public int getIndex()
        Returns the index of this type parameter in its owner's type parameter list, starting from zero.