org.apache.ignite.internal.portable

## Class PortableMetaDataImpl

- java.lang.Object
- - org.apache.ignite.internal.portable.PortableMetaDataImpl

All Implemented Interfaces:
  Externalizable, Serializable, PortableMarshalAware, PortableMetadata

    public class PortableMetaDataImpl
    extends Object
    implements PortableMetadata, PortableMarshalAware, Externalizable

Portable meta data implementation.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`PortableMetaDataImpl()` For `Externalizable`.
`PortableMetaDataImpl(String typeName, Map<String,String> fields, String affKeyFieldName)`

### Method Summary

Methods
`String` `affinityKeyFieldName()` Portable objects can optionally specify custom key-affinity mapping in the configuration.
`Collection<String>` `fields()` Gets collection of all field names for this portable type.
`Map<String,String>` `fields0()`
`Map<String,String>` `fieldsMeta()`
`String` `fieldTypeName(String fieldName)` Gets name of the field type for a given field.
`void` `readExternal(ObjectInput in)`
`void` `readPortable(PortableReader reader)` Reads fields from provided reader.
`String` `toString()`
`String` `typeName()` Gets portable type name.
`void` `writeExternal(ObjectOutput out)`
`void` `writePortable(PortableWriter writer)` Writes fields to provided writer.

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

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

### Constructor Detail

#### PortableMetaDataImpl

    public PortableMetaDataImpl()

For `Externalizable`.

#### PortableMetaDataImpl

    public PortableMetaDataImpl(String typeName,
                        @Nullable
                        Map<String,String> fields,
                        @Nullable
                        String affKeyFieldName)

Parameters:
  `typeName` - Type name.
  `fields` - Fields map.
  `affKeyFieldName` - Affinity key field name.

### Method Detail

#### typeName

    public String typeName()

Gets portable type name.

Specified by:
  `typeName` in interface `PortableMetadata`
Returns:
  Portable type name.

#### fields

    public Collection<String> fields()

Gets collection of all field names for this portable type.

Specified by:
  `fields` in interface `PortableMetadata`
Returns:
  Collection of all field names for this portable type.

#### fields0

    public Map<String,String> fields0()

Returns:
  Fields.

#### fieldTypeName

    @Nullable
    public String fieldTypeName(String fieldName)

Gets name of the field type for a given field.

Specified by:
  `fieldTypeName` in interface `PortableMetadata`
Parameters:
  `fieldName` - Field name.
Returns:
  Field type name.

#### affinityKeyFieldName

    @Nullable
    public String affinityKeyFieldName()

Portable objects can optionally specify custom key-affinity mapping in the configuration. This method returns the name of the field which should be used for the key-affinity mapping.

Specified by:
  `affinityKeyFieldName` in interface `PortableMetadata`
Returns:
  Affinity key field name.

#### fieldsMeta

    public Map<String,String> fieldsMeta()

Returns:
  Fields meta data.

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

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

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

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

#### writePortable

    public void writePortable(PortableWriter writer)
                       throws PortableException

Writes fields to provided writer.

Specified by:
  `writePortable` in interface `PortableMarshalAware`
Parameters:
  `writer` - Portable object writer.
Throws:
  `PortableException` - In case of error.

#### readPortable

    public void readPortable(PortableReader reader)
                      throws PortableException

Reads fields from provided reader.

Specified by:
  `readPortable` in interface `PortableMarshalAware`
Parameters:
  `reader` - Portable object reader.
Throws:
  `PortableException` - In case of error.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.4.0
Release Date | : September 24 2015