Package org.pkl.core

Class TypeAlias

  • All Implemented Interfaces:
    java.io.Serializable, Value

    public final class TypeAlias
    extends Member
    implements Value
    Java representation of a pkl.base#TypeAlias value.
    See Also:
    Serialized Form
    • Constructor Detail

      • TypeAlias

        public TypeAlias​(@Nullable java.lang.String docComment,
                         Member.SourceLocation sourceLocation,
                         java.util.Set<Modifier> modifiers,
                         java.util.List<PObject> annotations,
                         java.lang.String simpleName,
                         java.lang.String moduleName,
                         java.lang.String qualifiedName,
                         java.util.List<TypeParameter> typeParameters)
    • Method Detail

      • initAliasedType

        public void initAliasedType​(PType type)
      • getModuleName

        public java.lang.String getModuleName()
        Returns the name of the module that this type alias is declared in. Note that a module name is not guaranteed to be unique, especially if it not declared but inferred from the module URI.
        Specified by:
        getModuleName in class Member
      • getQualifiedName

        public java.lang.String getQualifiedName()
        Returns the qualified name of this type alias, `moduleName#typeAliasName`. Note that a qualified type alias name is not guaranteed to be unique, especially if the module name is not declared but inferred from the module URI.
      • getDisplayName

        public java.lang.String getDisplayName()
        Returns the name of this type alias for use in user-facing messages.
      • getTypeParameters

        public java.util.List<TypeParameter> getTypeParameters()
      • getAliasedType

        public PType getAliasedType()
        Returns the type that this type alias stands for.
      • 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
      • toString

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