Package io.sundr.model
Class TypeDef
java.lang.Object
io.sundr.model.AttributeSupport
io.sundr.model.ModifierSupport
io.sundr.model.TypeDef
- All Implemented Interfaces:
Annotatable,Attributeable,Commentable,Mappable<TypeDef>,Nameable,Node,Renderable
public class TypeDef
extends ModifierSupport
implements Renderable, Nameable, Annotatable, Commentable, Mappable<TypeDef>
-
Field Summary
FieldsFields inherited from class io.sundr.model.ModifierSupport
ABSTRACT, FINAL, modifiers, PRIVATE, PROTECTED, PUBLIC, STATIC, SYNCHRONIZEDFields inherited from interface io.sundr.model.Attributeable
ALSO_IMPORT, DEFAULT_VALUE, INIT, INIT_FUNCTION, LAZY_INITFields inherited from interface io.sundr.model.Nameable
IN_PACKAGE, IS_UPPER_CASE, OUT_OF_PACKAGE, PACKAGE_SEPARATOR_REGEXFields inherited from interface io.sundr.model.Node
AT, CB, CC, CLP, COLN, COMA, CP, DOT, DQ, EMPTY, EQ, EXTENDS, GT, IMPLEMENTS, INDENT, JAVA_LANG, JAVA_LANG_ENUM, JAVA_LANG_OBJECT, JAVA_LANG_STRING, LT, NEWLINE, NEWLINE_PATTERN, OB, OC, OP, Q, SEMICOLN, SEMICOLN_SUFFIX_PATTERN, SPACE, STAR, THROWS, VARARG -
Constructor Summary
ConstructorsModifierConstructorDescriptionTypeDef(Kind kind, String packageName, String name, List<String> comments, List<AnnotationRef> annotations, List<ClassRef> extendsList, List<ClassRef> implementsList, List<TypeParamDef> parameters, List<Property> properties, List<Method> constructors, List<Method> methods, String outerTypeName, List<TypeDef> innerTypes, Modifiers modifiers, Map<AttributeKey, Object> attributes) protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic TypeDefGet the list of comments.Returns the fully qualified name of the type.getKind()getName()Get the name.Get the package nameinthashCode()booleanbooleanisClass()booleanisEnum()booleanrender()Render the type into aStringfor the purpose of code generation.voidCreates aClassReffor internal use inside the scope of the type (methods, properties etc).toReference(TypeRef... arguments) Creates aClassReffor the current definition with the specified arguments.toReference(Collection<TypeRef> arguments) Creates aClassReffor the current definition with the specified arguments.toReference(List<TypeRef> arguments) Creates aClassReffor the current definition with the specified arguments.toString()Creates aClassRefwithout bounds.Methods inherited from class io.sundr.model.ModifierSupport
getModifiers, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isSynchronized, isTransient, renderModifiers, renderModifiersMethods inherited from class io.sundr.model.AttributeSupport
getAttribute, getAttributes, hasAttributeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.sundr.model.Annotatable
renderAnnotationsMethods inherited from interface io.sundr.model.Commentable
renderCommentsMethods inherited from interface io.sundr.model.Renderable
tab
-
Field Details
-
OBJECT
-
ENUM
-
OBJECT_REF
-
ENUM_REF
-
-
Constructor Details
-
TypeDef
public TypeDef(Kind kind, String packageName, String name, List<String> comments, List<AnnotationRef> annotations, List<ClassRef> extendsList, List<ClassRef> implementsList, List<TypeParamDef> parameters, List<Property> properties, List<Method> constructors, List<Method> methods, String outerTypeName, List<TypeDef> innerTypes, Modifiers modifiers, Map<AttributeKey, Object> attributes) -
TypeDef
-
-
Method Details
-
forName
-
getFullyQualifiedName
Returns the fully qualified name of the type.- Specified by:
getFullyQualifiedNamein interfaceNameable- Returns:
- the fully qualified name
-
getKind
-
getComments
Description copied from interface:CommentableGet the list of comments.- Specified by:
getCommentsin interfaceCommentable- Returns:
- a
Listof comments.
-
getAnnotations
- Specified by:
getAnnotationsin interfaceAnnotatable
-
getPackageName
Description copied from interface:NameableGet the package name- Specified by:
getPackageNamein interfaceNameable- Returns:
- the package name.
-
getName
Description copied from interface:NameableGet the name. -
getExtendsList
-
getImplementsList
-
getParameters
-
getProperties
-
getConstructors
-
getMethods
-
getOuterTypeName
-
getInnerTypes
-
isClass
public boolean isClass() -
isInterface
public boolean isInterface() -
isEnum
public boolean isEnum() -
isAnnotation
public boolean isAnnotation() -
equals
-
hashCode
public int hashCode() -
toReference
Creates aClassReffor the current definition with the specified arguments.- Parameters:
arguments- The arguments to be passed to the reference.- Returns:
- a
ClassReffor the currnet type, with the specified type arguments
-
toReference
Creates aClassReffor the current definition with the specified arguments.- Parameters:
arguments- The arguments to be passed to the reference.- Returns:
- a
ClassReffor the currnet type, with the specified type arguments
-
toReference
Creates aClassReffor the current definition with the specified arguments.- Parameters:
arguments- The arguments to be passed to the reference.- Returns:
- a
ClassReffor the currnet type, with the specified type arguments
-
toInternalReference
Creates aClassReffor internal use inside the scope of the type (methods, properties etc). It uses as arguments the same 'letters' as the parameters definition.- Returns:
- a
ClassReffor the currnet type, using the type parameter names as as arguments.
-
toUnboundedReference
Creates aClassRefwithout bounds.- Returns:
- a
ClassReffor the currnet type, with the specified type arguments
-
getImports
-
getReferences
-
renderDefinition
-
renderDefinition
-
render
Description copied from interface:RenderableRender the type into aStringfor 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:
renderin interfaceRenderable- Returns:
- the
Stringrepresentation of the object as it's meant to appear in the generated code.
-
toString
-