Class TypeMetadata

java.lang.Object
de.floydkretschmar.fixturize.domain.TypeMetadata

public final class TypeMetadata extends Object
Contains all names related to a specific type.
  • Method Details

    • hasPackageName

      public boolean hasPackageName()
      Returns a boolean indicating if a package name exists, or if it is part of the base package.
      Returns:
      true if the package name exists, false if it is an empty string
    • isGeneric

      public boolean isGeneric()
      Returns a boolean indicating if if the underlying type is a generic or not.
      Returns:
      true if the underlying type is a generic, false otherwise
    • createVariableElementMetadata

      public List<VariableElementMetadata> createVariableElementMetadata(List<? extends VariableElement> elements)
      Creates metadata for the specified variable elements using this type metadata.
      Parameters:
      elements - - for which metadata will be created
      Returns:
      the variable elements metadata
    • builder

      public static TypeMetadata.TypeMetadataBuilder builder()
    • getQualifiedClassName

      public String getQualifiedClassName()
      The fully qualified name of the type.
    • getQualifiedClassNameWithoutGeneric

      public String getQualifiedClassNameWithoutGeneric()
      The fully qualified name of the type but with the generics erased.
    • getSimpleClassName

      public String getSimpleClassName()
      The simple class name of the type
    • getSimpleClassNameWithoutGeneric

      public String getSimpleClassNameWithoutGeneric()
      The simple class name of the type but with the generics erased.
    • getPackageName

      public String getPackageName()
      The name of the package of the type. Empty if the class is located in the base package.
    • getQualifiedFixtureClassName

      public String getQualifiedFixtureClassName()
      The fully qualified name of the corresponding fixture class for the type.
    • getGenericPart

      public String getGenericPart()
      Only the generic part of the class definition. Empty if the type is not a generic.
    • getGenericTypeMap

      public Map<? extends TypeMirror,? extends DeclaredType> getGenericTypeMap()
      The map that contains the relation between generic types and their concrete implementation for the type. Empty if the type is not a generic.
    • 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