# Class ElementValuePair

java.lang.Object
org.apache.bcel.classfile.ElementValuePair

public class ElementValuePair extends Object
An annotation's element value pair.

Since:
  6.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ElementValuePair(int elementNameIndex, ElementValue elementValue, ConstantPool constantPool)`
  Constructs an ElementValuePair.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `dump(DataOutputStream dos)`
  Dumps this element value pair to a DataOutputStream.
  `int`
  `getNameIndex()`
  Gets the name index.
  `String`
  `getNameString()`
  Gets the name string.
  `final ElementValue`
  `getValue()`
  Gets the value.
  `String`
  `toShortString()`
  Gets a short string representation.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ElementValuePair

    public ElementValuePair(int elementNameIndex, ElementValue elementValue, ConstantPool constantPool)
    Constructs an ElementValuePair.
    Parameters:
      `elementNameIndex` - the element name index.
      `elementValue` - the element value.
      `constantPool` - the constant pool.

- ## Method Details

  - ### dump

    protected void dump(DataOutputStream dos) throws IOException
    Dumps this element value pair to a DataOutputStream.
    Parameters:
      `dos` - the output stream.
    Throws:
      `IOException` - if an I/O error occurs.

  - ### getNameIndex

    public int getNameIndex()
    Gets the name index.
    Returns:
      the name index.

  - ### getNameString

    public String getNameString()
    Gets the name string.
    Returns:
      the name string.

  - ### getValue

    public final ElementValue getValue()
    Gets the value.
    Returns:
      the element value.

  - ### toShortString

    public String toShortString()
    Gets a short string representation.
    Returns:
      a short string representation.