All Superinterfaces:
Comparable<ClassName>, TypeName
All Known Implementing Classes:
ClassNameImpl

@ClassVersion(sourceVersion="$Id: ClassName.java 1085 2024-01-05 16:23:28Z tquadrat $") @API(status=STABLE, since="0.0.5") public sealed interface ClassName extends TypeName, Comparable<ClassName> permits ClassNameImpl
The specification for a fully-qualified class name for top-level and member classes.
Author:
Square,Inc.
Modified by:
Thomas Thrien (thomas.thrien@tquadrat.org)
Version:
$Id: ClassName.java 1085 2024-01-05 16:23:28Z tquadrat $
Since:
0.0.5
UML Diagram
UML Diagram for "org.tquadrat.foundation.javacomposer.ClassName"

UML Diagram for "org.tquadrat.foundation.javacomposer.ClassName"

UML Diagram for "org.tquadrat.foundation.javacomposer.ClassName"
  • Method Details

    • annotated

      Creates a new instance for an implementation of ClassName as a copy of this one, but with the given annotations added.
      Specified by:
      annotated in interface TypeName
      Parameters:
      annotations - The annotations.
      Returns:
      The new instance.
    • compareTo

      Specified by:
      compareTo in interface Comparable<ClassName>
    • canonicalName

      Returns the canonical form of the class name.
      Returns:
      The canonical name.
    • equals

      boolean equals(Object o)
      Specified by:
      equals in interface TypeName
      Overrides:
      equals in class Object
    • from

      @API(status=STABLE, since="0.2.0") static ClassName from(Class<?> sourceClass)
      Creates a new instance for an implementation of ClassName from an instance of Class.
      Parameters:
      sourceClass - The instance of java.lang.Class.
      Returns:
      The respective instance of ClassName.
    • from

      @API(status=STABLE, since="0.2.0") static ClassName from(TypeElement element)
      Returns the class name for the given TypeElement instance.
      Parameters:
      element - The type element instance.
      Returns:
      The new class name instance.
    • from

      @API(status=STABLE, since="0.2.0") static ClassName from(CharSequence packageName, CharSequence simpleName, CharSequence... simpleNames)
      Returns a class name created from the given parts.

      For example, calling this method with package name "java.util" and simple names "Map" and "Entry" yields java.util.Map.Entry.
      Parameters:
      packageName - The package name.
      simpleName - The name of the top-level class.
      simpleNames - The names of the nested classes, from outer to inner.
      Returns:
      The new ClassName instance.
    • isAnnotated

      boolean isAnnotated()
      Checks whether this type name is annotated.
      Specified by:
      isAnnotated in interface TypeName
      Returns:
      true if it is annotated, false otherwise.
    • nestedClass

      Returns a new instance for an implementation of ClassName for the specified name as nested inside this class.
      Parameters:
      name - The name for the new nested class.
      Returns:
      The new instance.
    • packageName

      Returns the package name, like java.util for java.util.Map.Entry. Returns the empty String for the default package.
      Returns:
      The package name.
    • parentClass

      Returns the enclosing class, like Map for java.util.Map.Entry. The return value will be empty if this class is not nested in another class.
      Returns:
      An instance of Optional that holds the name of the enclosing class.
    • peerClass

      Creates a class that shares the same enclosing package or class.
      Parameters:
      name - The name of the peer class to create.
      Returns:
      The new instance for the peer class.
    • reflectionName

      Returns the binary name of a class, as used by reflection.
      Returns:
      The binary name.
    • simpleName

      Returns the simple name of this class, like Entry for java.util.Map.Entry.
      Returns:
      The simple name.
    • simpleNames

      Returns a list of the simple names for this nesting group.
      Returns:
      The simple names.
    • topLevelClassName

      Returns the top class in this nesting group.
      Returns:
      The name of the top level class.
    • withoutAnnotations

      Creates a new instance for an implementation of ClassName as a copy of this one, but without any annotations.
      Specified by:
      withoutAnnotations in interface TypeName
      Returns:
      The new instance.