Class ClassName

java.lang.Object
io.spring.initializr.generator.language.ClassName

public final class ClassName extends Object
Type reference abstraction to refer to a Class that is not available on the classpath.
Author:
Stephane Nicoll
  • Method Details

    • of

      public static ClassName of(String fqName)
      Create a ClassName based on the specified fully qualified name. The format of the class name must follow Class.getName(), in particular inner classes should be separated by a $.
      Parameters:
      fqName - the fully qualified name of the class
      Returns:
      a class name
    • of

      public static ClassName of(Class<?> type)
      Create a ClassName based on the specified Class.
      Parameters:
      type - the class to wrap
      Returns:
      a class name
    • getName

      public String getName()
      Return the fully qualified name.
      Returns:
      the reflection target name
    • getPackageName

      public String getPackageName()
      Return the package name.
      Returns:
      the package name
    • getSimpleName

      public String getSimpleName()
      Return the simple name.
      Returns:
      the simple name
    • getEnclosingType

      public ClassName getEnclosingType()
      Return the enclosing class name, or null if this instance does not have an enclosing type.
      Returns:
      the enclosing type, if any
    • getCanonicalName

      public String getCanonicalName()
      Return the canonical name.
      Returns:
      the canonical name
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object