org.apache.ignite.internal.binary

## Class BinaryMetadata

- java.lang.Object
- - org.apache.ignite.internal.binary.BinaryMetadata

All Implemented Interfaces:
  Externalizable, Serializable

    public class BinaryMetadata
    extends Object
    implements Externalizable

Binary metadata which is passed over a wire.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`BinaryMetadata()` For `Externalizable`.
`BinaryMetadata(int typeId, String typeName, Map<String,Integer> fields, String affKeyFieldName, Collection<BinarySchema> schemas, boolean isEnum)` Constructor.

### Method Summary

Methods
`String` `affinityKeyFieldName()`
`Collection<String>` `fields()`
`Map<String,Integer>` `fieldsMap()`
`String` `fieldTypeName(String fieldName)`
`boolean` `isEnum()`
`void` `readExternal(ObjectInput in)`
`void` `readFrom(DataInput in)` The object implements the readFrom method to restore its contents by calling the methods of DataInput for primitive types and strings or calling readExternal for other objects.
`Collection<BinarySchema>` `schemas()`
`String` `toString()`
`int` `typeId()`
`String` `typeName()`
`BinaryTypeImpl` `wrap(BinaryContext ctx)` Wrap metadata into binary type.
`void` `writeExternal(ObjectOutput out)`
`void` `writeTo(DataOutput out)` The object implements the writeTo method to save its contents by calling the methods of DataOutput for its primitive values and strings or calling the writeTo method for other objects.

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

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

### Constructor Detail

#### BinaryMetadata

    public BinaryMetadata()

For `Externalizable`.

#### BinaryMetadata

    public BinaryMetadata(int typeId,
                  String typeName,
                  @Nullable
                  Map<String,Integer> fields,
                  @Nullable
                  String affKeyFieldName,
                  @Nullable
                  Collection<BinarySchema> schemas,
                  boolean isEnum)

Constructor.

Parameters:
  `typeId` - Type ID.
  `typeName` - Type name.
  `fields` - Fields map.
  `affKeyFieldName` - Affinity key field name.
  `schemas` - Schemas.
  `isEnum` - Enum flag.

### Method Detail

#### typeId

    public int typeId()

Returns:
  Type ID.

#### typeName

    public String typeName()

Returns:
  Type name.

#### fields

    public Collection<String> fields()

Returns:
  Fields.

#### fieldsMap

    public Map<String,Integer> fieldsMap()

Returns:
  Fields.

#### fieldTypeName

    @Nullable
    public String fieldTypeName(String fieldName)

Parameters:
  `fieldName` - Field name.
Returns:
  Field type name.

#### affinityKeyFieldName

    @Nullable
    public String affinityKeyFieldName()

Returns:
  Affinity key field name.

#### schemas

    public Collection<BinarySchema> schemas()

Returns:
  Schemas.

#### isEnum

    public boolean isEnum()

Returns:
  `True` if this is enum type.

#### wrap

    public BinaryTypeImpl wrap(BinaryContext ctx)

Wrap metadata into binary type.

Parameters:
  `ctx` - Binary context.
Returns:
  Binary type.

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### writeTo

    public void writeTo(DataOutput out)
                 throws IOException

The object implements the writeTo method to save its contents by calling the methods of DataOutput for its primitive values and strings or calling the writeTo method for other objects.

Parameters:
  `out` - the stream to write the object to.
Throws:
  `IOException` - Includes any I/O exceptions that may occur.

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### readFrom

    public void readFrom(DataInput in)
                  throws IOException

The object implements the readFrom method to restore its contents by calling the methods of DataInput for primitive types and strings or calling readExternal for other objects. The readFrom method must read the values in the same sequence and with the same types as were written by writeTo.

Parameters:
  `in` - the stream to read data from in order to restore the object.
Throws:
  `IOException` - if I/O errors occur.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.8.0
Release Date | : December 5 2016