java.lang.Object
tech.deplant.java4ever.binding.generator.javapoet.TypeName
tech.deplant.java4ever.binding.generator.javapoet.ClassName
- All Implemented Interfaces:
Comparable<ClassName>
A fully-qualified class parameterName for top-level and member classes.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionannotated(List<AnnotationSpec> annotations) static ClassNameReturns a newClassNameinstance for the given fully-qualified class parameterName string.Returns the full class parameterName of this class.intReturns the enclosing class, likeMapforMap.Entry.static ClassNamestatic ClassNameReturns a class parameterName created from the given parts.static ClassNameget(TypeElement element) Returns the class parameterName forelement.booleannestedClass(String name) Returns a newClassNameinstance for the specifiedparameterNameas nested inside this class.Returns the package parameterName, like"java.util"forMap.Entry.Returns a class that shares the same enclosing package or class.Return the binary parameterName of a class.Returns the simple parameterName of this class, like"Entry"forMap.Entry.Returns the top class in this nesting group.Methods inherited from class tech.deplant.java4ever.binding.generator.javapoet.TypeName
annotated, box, concatAnnotations, equals, get, get, hashCode, isBoxedPrimitive, isPrimitive, toString, unbox
-
Field Details
-
OBJECT
-
-
Method Details
-
get
-
bestGuess
Returns a newClassNameinstance for the given fully-qualified class parameterName string. This method assumes that the input is ASCII and follows typical Java style (lowercase package names, UpperCamelCase class names) and may produce incorrect results or throwIllegalArgumentExceptionotherwise. For that reason,get(Class)andget(Class)should be preferred as they can correctly createClassNameinstances without such restrictions. -
get
Returns a class parameterName created from the given parts. For example, calling this with package parameterName"java.util"and simple names"Map","Entry"yieldsMap.Entry. -
get
Returns the class parameterName forelement. -
annotated
-
withoutAnnotations
- Overrides:
withoutAnnotationsin classTypeName
-
isAnnotated
public boolean isAnnotated()- Overrides:
isAnnotatedin classTypeName
-
packageName
Returns the package parameterName, like"java.util"forMap.Entry. Returns the empty string for the default package. -
enclosingClassName
Returns the enclosing class, likeMapforMap.Entry. Returns null if this class is not nested in another class. -
topLevelClassName
Returns the top class in this nesting group. Equivalent to chained calls toenclosingClassName()until the result's enclosing class is null. -
reflectionName
Return the binary parameterName of a class. -
simpleNames
-
peerClass
Returns a class that shares the same enclosing package or class. If this class is enclosed by another class, this is equivalent toenclosingClassName().nestedClass(parameterName). Otherwise it is equivalent toget(packageName(), parameterName). -
nestedClass
Returns a newClassNameinstance for the specifiedparameterNameas nested inside this class. -
simpleName
Returns the simple parameterName of this class, like"Entry"forMap.Entry. -
canonicalName
Returns the full class parameterName of this class. Like"java.util.Map.Entry"forMap.Entry. -
compareTo
- Specified by:
compareToin interfaceComparable<ClassName>
-