Interface FieldInfo

All Superinterfaces:
AnnotationTarget, DeclarationInfo

public interface FieldInfo extends DeclarationInfo
A field, declared in some class.
Since:
4.0
  • Method Details

    • name

      String name()
      Returns the name of this field.
      Returns:
      the name of this field, never null
    • type

      Type type()
      Returns the type of this field.
      Returns:
      the type of this field, never null
    • isStatic

      boolean isStatic()
      Returns whether this field is static.
      Returns:
      whether this field is static.
    • isFinal

      boolean isFinal()
      Returns whether this field is final.
      Returns:
      whether this field is final.
    • modifiers

      int modifiers()
      Returns the modifiers of this field as an int. Use Modifier to inspect the value.
      Returns:
      the modifiers of this field
    • declaringClass

      ClassInfo declaringClass()
      Returns the class that declares this field.
      Returns:
      the class that declares this field, never null
    • kind

      default DeclarationInfo.Kind kind()
      Description copied from interface: DeclarationInfo
      Returns the kind of this declaration.
      Specified by:
      kind in interface DeclarationInfo
      Returns:
      the kind of this declaration
    • asField

      default FieldInfo asField()
      Description copied from interface: DeclarationInfo
      Returns this declaration as a field.
      Specified by:
      asField in interface DeclarationInfo
      Returns:
      this field, never null