Package org.eclipse.mat.snapshot.model

# Class Field

java.lang.Object
org.eclipse.mat.snapshot.model.FieldDescriptor
org.eclipse.mat.snapshot.model.Field

All Implemented Interfaces:
  `Serializable`

public final class Field extends FieldDescriptor implements Serializable
Describes a member variable, i.e. name, signature and value.

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`Field(String name, int type, Object value)`
Create a representation of member variable

## Method Summary

Modifier and Type
Method
Description
`Object`
`getValue()`
Gets the value of the field.
`void`
`setValue(Object object)`
Set the value of the field.
`String`
`toString()`
A readable representation of the field.

### Methods inherited from class org.eclipse.mat.snapshot.model.FieldDescriptor

`getName, getType, getVerboseSignature, setName, setType`

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

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### Field

public Field(String name, int type, Object value)
Create a representation of member variable

Parameters:
  `name` - the name of the field
  `type` - the type `IObject.Type`
  `value` - value is one of
  `ObjectReference`
    for an object field
  `Byte`
    for a byte field
  `Short`
    for a short field
  `Integer`
    for an int field
  `Long`
    for a long field
  `Boolean`
    for a boolean field
  `Character`
    for a char field
  `Float`
    for a float field
  `Double`
    for a double field

## Method Details

### getValue

public Object getValue()
Gets the value of the field.

Returns:
  `ObjectReference`
    for an object field
  `Byte`
    for a byte field
  `Short`
    for a short field
  `Integer`
    for an int field
  `Long`
    for a long field
  `Boolean`
    for a boolean field
  `Character`
    for a char field
  `Float`
    for a float field
  `Double`
    for a double field

### setValue

public void setValue(Object object)
Set the value of the field. Normally the value should not be changed. Currently this is used after deserializing static fields to change the object reference to one having a link to the current snapshot.

Parameters:
  `object` - object is one of
  `ObjectReference`
    for an object field
  `Byte`
    for a byte field
  `Short`
    for a short field
  `Integer`
    for an int field
  `Long`
    for a long field
  `Boolean`
    for a boolean field
  `Character`
    for a char field
  `Float`
    for a float field
  `Double`
    for a double field

### toString

public String toString()
A readable representation of the field. Do not rely on the format of the result.

Overrides:
  `toString` in class `FieldDescriptor`
Returns:
  a description of this field.