Class ClassRef

All Implemented Interfaces:
Attributeable, Mappable<ClassRef>, Nameable, Node, Renderable

public class ClassRef extends TypeRef implements Nameable, Mappable<ClassRef>
  • Field Details

  • Constructor Details

  • Method Details

    • forName

      public static ClassRef forName(String fullyQualifiedName)
    • forClass

      public static ClassRef forClass(Class c)
    • getFullyQualifiedName

      public String getFullyQualifiedName()
      Description copied from interface: Nameable
      Get the fully qualified name of the type. The expected format is package.outerClass.inerClass
      Specified by:
      getFullyQualifiedName in interface Nameable
      Returns:
      the fully qualified name
    • getDimensions

      public int getDimensions()
      Specified by:
      getDimensions in class TypeRef
    • getArguments

      public List<TypeRef> getArguments()
    • withDimensions

      public ClassRef withDimensions(int dimensions)
      Specified by:
      withDimensions in class TypeRef
    • getReferences

      public Set<ClassRef> getReferences()
    • getName

      public String getName()
      Description copied from interface: Nameable
      Get the name.
      Specified by:
      getName in interface Nameable
      Specified by:
      getName in class TypeRef
      Returns:
      the name
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object
    • render

      public String render()
      Description copied from interface: Renderable
      Render the type into a String for the purpose of code generation. This is slightly different from the `toString()` method as `toString()` is mostly needed for logging / debugging and should be idempotent. Regarding idempotency this method may yield different result based on the context it is used even if the internal state of the object does not change. An example of such case, is a reference to class that may change based on the package from which it's refenced.
      Specified by:
      render in interface Renderable
      Returns:
      the String representation of the object as it's meant to appear in the generated code.