Package io.sundr.model
Class Method
java.lang.Object
io.sundr.model.AttributeSupport
io.sundr.model.ModifierSupport
io.sundr.model.Method
- All Implemented Interfaces:
Annotatable,Attributeable,Commentable,Erasable<Method>,Node,Renderable,WithReferences
public class Method
extends ModifierSupport
implements Renderable, WithReferences, Commentable, Annotatable, Erasable<Method>
-
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.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
ConstructorsConstructorDescriptionMethod(List<String> comments, List<AnnotationRef> annotations, List<TypeParamDef> parameters, String name, TypeRef returnType, List<Property> arguments, boolean varArgPreferred, List<ClassRef> exceptions, boolean defaultMethod, Block block, Modifiers modifiers, Map<AttributeKey, Object> attributes) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBlock()Get the list of comments.Returns the erasure of this method as a canonical string representation.getName()inthashCode()booleanbooleanstatic Methodstatic Methodrender()Render the type into aStringfor the purpose of code generation.renderDefinition(TypeDef enclosingType) voidrenderDefinition(StringBuilder sb, TypeDef enclosingType) toString()Returns an erased version of this object with generic type information removed.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
-
DEFAULT
- See Also:
-
-
Constructor Details
-
Method
public Method(List<String> comments, List<AnnotationRef> annotations, List<TypeParamDef> parameters, String name, TypeRef returnType, List<Property> arguments, boolean varArgPreferred, List<ClassRef> exceptions, boolean defaultMethod, Block block, Modifiers modifiers, Map<AttributeKey, Object> attributes)
-
-
Method Details
-
newMethod
-
newMethod
-
getComments
Description copied from interface:CommentableGet the list of comments.- Specified by:
getCommentsin interfaceCommentable- Returns:
- a
Listof comments.
-
getAnnotations
- Specified by:
getAnnotationsin interfaceAnnotatable
-
isVarArgPreferred
public boolean isVarArgPreferred() -
getParameters
-
getName
-
getReturnType
-
getArguments
-
getExceptions
-
isDefaultMethod
public boolean isDefaultMethod() -
getBlock
-
withErasure
Description copied from interface:ErasableReturns an erased version of this object with generic type information removed. This creates a canonical instance that can be used for comparison and resolution.- Specified by:
withErasurein interfaceErasable<Method>- Returns:
- the erased version of this object
-
getErasure
Returns the erasure of this method as a canonical string representation. The erasure includes the method name and parameter types, providing a stable way to compare methods regardless of object instance differences.- Specified by:
getErasurein interfaceErasable<Method>- Returns:
- the method erasure string in the format "methodName(paramType1,paramType2,...)"
-
getReferences
- Specified by:
getReferencesin interfaceWithReferences
-
equals
-
hashCode
public int hashCode() -
getSignature
-
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.
-
render
-
toString
-