Package net.karneim.pojobuilder.model
Class TypeM
- java.lang.Object
-
- net.karneim.pojobuilder.model.TypeM
-
- Direct Known Subclasses:
ArrayTypeM,PrimitiveTypeM,TypeVariableM
public class TypeM extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImportTypesMaddToImportTypes(ImportTypesM result)booleanequals(java.lang.Object obj)java.lang.StringgetGenericType()Returns a String representation of the minimal generics definition of this type.java.lang.StringgetGenericTypeDefinition()Returns a String representation of the complete generics definition of this type.java.lang.StringgetName()java.lang.StringgetPackageName()java.lang.StringgetSimpleName()java.lang.StringgetSimpleNames()TypeListMgetTypeParameters()inthashCode()ThishashCode()implementation doesn't use typeParameters to avoid a potential StackOverflowError.booleanisArrayType()booleanisGeneric()booleanisInPackage(java.lang.String packageName)booleanisPrimitive()booleanisTypeVariable()java.lang.StringtoString()TypeMwithTypeParameter(TypeM... params)
-
-
-
Method Detail
-
getTypeParameters
public TypeListM getTypeParameters()
-
getSimpleName
public java.lang.String getSimpleName()
-
getSimpleNames
public java.lang.String getSimpleNames()
-
getName
public java.lang.String getName()
-
isPrimitive
public boolean isPrimitive()
-
isTypeVariable
public boolean isTypeVariable()
-
isArrayType
public boolean isArrayType()
-
getPackageName
public java.lang.String getPackageName()
-
isGeneric
public boolean isGeneric()
-
getGenericTypeDefinition
public java.lang.String getGenericTypeDefinition()
Returns a String representation of the complete generics definition of this type. This can be used for generic parameter definitions of classes and methods.Named generic types are represented with bounds. To get a minimal representation used for field declarations see
getGenericType()Example Output:
"Map<T extends CharSequence, E extends List<? super Number>>"- Returns:
- the complete generics definition
-
getGenericType
public java.lang.String getGenericType()
Returns a String representation of the minimal generics definition of this type. This can be used for variable, parameter or return types such as field declarations.Named generic types are represented without bounds, because they are defined in the class or method signature. To get a representation of the full definition including bounds see
getGenericTypeDefinition()Example Output:
"Map<T, ? extends List<? super Number>>"- Returns:
- the generic type
-
addToImportTypes
public ImportTypesM addToImportTypes(ImportTypesM result)
-
isInPackage
public boolean isInPackage(java.lang.String packageName)
-
hashCode
public int hashCode()
ThishashCode()implementation doesn't use typeParameters to avoid a potential StackOverflowError. Theequals(Object)implementation does use that field.- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-