Package com.github.tadukoo.java.field
Class JavaField
java.lang.Object
com.github.tadukoo.java.field.JavaField
- All Implemented Interfaces:
JavaCodeType,JavaTokens
- Direct Known Subclasses:
EditableJavaField,UneditableJavaField
Java Field represents a field in a
Java class- Since:
- Alpha v.0.2 (as old version that is now more like UneditableJavaField), Alpha v.0.4 (as newer version)
- Version:
- Beta v.0.6
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<JavaAnnotation>Theannotationson the fieldprotected booleanWhether the field is final or notprotected booleanWhether the field is static or notprotected JavadocTheJavadocon the fieldprotected StringThe name of the fieldprotected JavaTypeThetypeof the fieldprotected StringThe value assigned to the fieldprotected VisibilityTheVisibilityof the fieldFields inherited from interface com.github.tadukoo.java.JavaCodeType
NEWLINE_WITH_2_TABS, NEWLINE_WITH_4_TABSFields inherited from interface com.github.tadukoo.java.JavaTokens
ABSTRACT_MODIFIER, ANNOTATION_START_TOKEN, ASSIGNMENT_OPERATOR_TOKEN, BLOCK_CLOSE_TOKEN, BLOCK_OPEN_TOKEN, CLASS_TOKEN, EXTENDS_TOKEN, FINAL_MODIFIER, IMPLEMENTS_TOKEN, IMPORT_TOKEN, JAVADOC_AUTHOR_TOKEN, JAVADOC_LINE_TOKEN, JAVADOC_PARAM_TOKEN, JAVADOC_RETURN_TOKEN, JAVADOC_SINCE_TOKEN, JAVADOC_START_TOKEN, JAVADOC_VERSION_TOKEN, LIST_SEPARATOR_TOKEN, MODIFIERS, MULTI_LINE_COMMENT_CLOSE_TOKEN, MULTI_LINE_COMMENT_START_TOKEN, PACKAGE_TOKEN, PARAMETER_CLOSE_TOKEN, PARAMETER_OPEN_TOKEN, PRIVATE_MODIFIER, PROTECTED_MODIFIER, PUBLIC_MODIFIER, SEMICOLON, SINGLE_LINE_COMMENT_TOKEN, STATIC_MODIFIER, THROWS_TOKEN, TYPE_PARAMETER_CLOSE_TOKEN, TYPE_PARAMETER_OPEN_TOKEN, VARARGS_TOKEN, VISIBILITY_MODIFIERS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJavaField(boolean editable, Javadoc javadoc, List<JavaAnnotation> annotations, Visibility visibility, boolean isStatic, boolean isFinal, JavaType type, String name, String value) Constructs a Java Field with the given parameters -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.github.tadukoo.java.JavaCodeType
escapeQuotes
-
Field Details
-
javadoc
TheJavadocon the field -
annotations
Theannotationson the field -
visibility
TheVisibilityof the field -
isStatic
protected boolean isStaticWhether the field is static or not -
isFinal
protected boolean isFinalWhether the field is final or not -
type
Thetypeof the field -
name
The name of the field -
value
The value assigned to the field
-
-
Constructor Details
-
JavaField
protected JavaField(boolean editable, Javadoc javadoc, List<JavaAnnotation> annotations, Visibility visibility, boolean isStatic, boolean isFinal, JavaType type, String name, String value) Constructs a Java Field with the given parameters- Parameters:
editable- Whether the field is editable or notjavadoc- TheJavadocon the fieldannotations- Theannotationson the fieldvisibility- TheVisibilityof the fieldisStatic- Whether the field is static or notisFinal- Whether the field is final or nottype- Thetypeof the fieldname- The name of the fieldvalue- The value assigned to the field
-
-
Method Details
-
getJavaCodeType
- Specified by:
getJavaCodeTypein interfaceJavaCodeType- Returns:
- What
typethis is
-
isEditable
public boolean isEditable()- Returns:
- Whether the field is editable or not
-
getJavadoc
- Returns:
- The
Javadocon the field
-
getAnnotations
- Returns:
- The
annotationson the field
-
getVisibility
- Returns:
- The
Visibilityof the field
-
isStatic
public boolean isStatic()- Returns:
- Whether the field is static or not
-
isFinal
public boolean isFinal()- Returns:
- Whether the field is final or not
-
getType
- Returns:
- The
typeof the field
-
getName
- Returns:
- The name of the field
-
getValue
- Returns:
- The value assigned to the field
-
toString
-
equals
-
toBuilderCode
- Specified by:
toBuilderCodein interfaceJavaCodeType- Returns:
- The String of code to build the
JavaCodeType
-