org.apache.avro.generic

## Class GenericData.EnumSymbol

- java.lang.Object
- - org.apache.avro.generic.GenericData.EnumSymbol

All Implemented Interfaces:
  Comparable<GenericData.EnumSymbol>, GenericContainer, GenericEnumSymbol<GenericData.EnumSymbol>

Enclosing class:
  GenericData

    public static class GenericData.EnumSymbol
    extends Object
    implements GenericEnumSymbol<GenericData.EnumSymbol>

Default implementation of `GenericEnumSymbol`.

### Constructor Summary

Constructors
Constructor and Description
`EnumSymbol(Schema schema, Object symbol)` Maps existing Objects into an Avro enum by calling toString(), eg for Java Enums
`EnumSymbol(Schema schema, String symbol)`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `compareTo(GenericData.EnumSymbol that)`
`boolean` `equals(Object o)`
`Schema` `getSchema()` The schema of this instance.
`int` `hashCode()`
`String` `toString()` Return the symbol.

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

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

### Constructor Detail

#### EnumSymbol

    public EnumSymbol(Schema schema,
                      String symbol)

#### EnumSymbol

    public EnumSymbol(Schema schema,
                      Object symbol)

Maps existing Objects into an Avro enum by calling toString(), eg for Java Enums

### Method Detail

#### getSchema

    public Schema getSchema()

Description copied from interface: `GenericContainer`
The schema of this instance.

Specified by:
  `getSchema` in interface `GenericContainer`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Description copied from interface: `GenericEnumSymbol`
Return the symbol.

Specified by:
  `toString` in interface `GenericEnumSymbol<GenericData.EnumSymbol>`
Overrides:
  `toString` in class `Object`

#### compareTo

    public int compareTo(GenericData.EnumSymbol that)

Specified by:
  `compareTo` in interface `Comparable<GenericData.EnumSymbol>`