Class DefaultJavaField

    • Field Detail

      • initializationExpression

        private java.lang.String initializationExpression
      • enumConstant

        private boolean enumConstant
      • enumConstantClass

        private JavaClass enumConstantClass
      • enumConstantArguments

        private java.util.List<Expression> enumConstantArguments
    • Constructor Detail

      • DefaultJavaField

        public DefaultJavaField​(java.lang.String name)
      • DefaultJavaField

        public DefaultJavaField​(JavaClass type,
                                java.lang.String name)
    • Method Detail

      • getType

        public JavaClass getType()
        Equivalent of Field.getType()
        Specified by:
        getType in interface JavaField
        Returns:
        the type of this field, should never be null.
      • getCodeBlock

        public java.lang.String getCodeBlock()
        The in-code representation of this field.
        Specified by:
        getCodeBlock in interface JavaField
        Specified by:
        getCodeBlock in interface JavaModel
        Returns:
        the complete representation of this field
      • setType

        public void setType​(JavaClass type)
      • getInitializationExpression

        public java.lang.String getInitializationExpression()
        Get the original expression used to initialize the field.
        Specified by:
        getInitializationExpression in interface JavaField
        Returns:
        initialization as string.
      • setInitializationExpression

        public void setInitializationExpression​(java.lang.String initializationExpression)
      • isEnumConstant

        public boolean isEnumConstant()
        Equivalent of Field.isEnumConstant()
        Specified by:
        isEnumConstant in interface JavaField
        Returns:
        true if this field is an enum constant, otherwise false
      • setEnumConstant

        public void setEnumConstant​(boolean enumConstant)
      • setEnumConstantArguments

        public void setEnumConstantArguments​(java.util.List<Expression> enumConstantArguments)
      • setEnumConstantClass

        public void setEnumConstantClass​(JavaClass enumConstantClass)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Field.toString()
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares this Field against the specified object. Returns true if the objects are the same. Two Field objects are the same if they were declared by the same class and have the same name and type.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object