org.apache.tomcat.util.bcel.classfile

## Class Field

- java.lang.Object
- - org.apache.tomcat.util.bcel.classfile.AccessFlags
  - - org.apache.tomcat.util.bcel.classfile.FieldOrMethod
    - - org.apache.tomcat.util.bcel.classfile.Field

All Implemented Interfaces:
  Serializable, Cloneable

    public final class Field
    extends FieldOrMethod

This class represents the field info structure, i.e., the representation for a variable in the class. See JVM specification for details.

Author:
  M. Dahm
See Also:
  Serialized Form

### Field Summary

### Fields inherited from class org.apache.tomcat.util.bcel.classfile.FieldOrMethod

`attributes, attributes_count, constant_pool, name_index, signature_index`

### Fields inherited from class org.apache.tomcat.util.bcel.classfile.AccessFlags

`access_flags`

### Method Summary

Methods
`boolean` `equals(Object obj)` Return value as defined by given BCELComparator strategy.
`ConstantValue` `getConstantValue()`
`int` `hashCode()` Return value as defined by given BCELComparator strategy.
`String` `toString()` Return string representation close to declaration format, `public static final short MAX = 100', e.g..

### Methods inherited from class org.apache.tomcat.util.bcel.classfile.FieldOrMethod

`getName, getSignature, setAttributes`

### Methods inherited from class org.apache.tomcat.util.bcel.classfile.AccessFlags

`getAccessFlags`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Method Detail

#### getConstantValue

    public final ConstantValue getConstantValue()

Returns:
  constant value associated with this field (may be null)

#### toString

    public final String toString()

Return string representation close to declaration format, `public static final short MAX = 100', e.g..

Overrides:
  `toString` in class `Object`
Returns:
  String representation of field, including the signature.

#### equals

    public boolean equals(Object obj)

Return value as defined by given BCELComparator strategy. By default two Field objects are said to be equal when their names and signatures are equal.

Overrides:
  `equals` in class `Object`
See Also:
  `Object.equals(java.lang.Object)`

#### hashCode

    public int hashCode()

Return value as defined by given BCELComparator strategy. By default return the hashcode of the field's name XOR signature.

Overrides:
  `hashCode` in class `Object`
See Also:
  `Object.hashCode()`