org.apache.ignite.internal.processors.cache.portable

## Class IgnitePortablesImpl

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.portable.IgnitePortablesImpl

All Implemented Interfaces:
  IgnitePortables

    public class IgnitePortablesImpl
    extends Object
    implements IgnitePortables

`IgnitePortables` implementation.

### Constructor Summary

Constructors
Constructor and Description
`IgnitePortablesImpl(GridKernalContext ctx, CacheObjectPortableProcessor proc)`

### Method Summary

Methods
`PortableBuilder` `builder(int typeId)` Creates new portable builder.
`PortableBuilder` `builder(PortableObject portableObj)` Creates portable builder initialized by existing portable object.
`PortableBuilder` `builder(String typeName)` Creates new portable builder.
`Collection<PortableMetadata>` `metadata()` Gets metadata for all known types.
`PortableMetadata` `metadata(Class<?> cls)` Gets metadata for provided class.
`PortableMetadata` `metadata(int typeId)` Gets metadata for provided type ID.
`PortableMetadata` `metadata(String typeName)` Gets metadata for provided class name.
`IgniteCacheObjectProcessor` `processor()`
`<T> T` `toPortable(Object obj)` Converts provided object to instance of `PortableObject`.
`int` `typeId(String typeName)` Gets type ID for given type name.

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

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

### Constructor Detail

#### IgnitePortablesImpl

    public IgnitePortablesImpl(GridKernalContext ctx,
                       CacheObjectPortableProcessor proc)

Parameters:
  `ctx` - Context.

### Method Detail

#### typeId

    public int typeId(String typeName)

Gets type ID for given type name.

Specified by:
  `typeId` in interface `IgnitePortables`
Parameters:
  `typeName` - Type name.
Returns:
  Type ID.

#### toPortable

    public <T> T toPortable(@Nullable
                   Object obj)
                 throws PortableException

Converts provided object to instance of `PortableObject`.

Specified by:
  `toPortable` in interface `IgnitePortables`
Parameters:
  `obj` - Object to convert.
Returns:
  Converted object.
Throws:
  `PortableException` - In case of error.

#### builder

    public PortableBuilder builder(int typeId)

Creates new portable builder.

Specified by:
  `builder` in interface `IgnitePortables`
Parameters:
  `typeId` - ID of the type.
Returns:
  Newly portable builder.

#### builder

    public PortableBuilder builder(String typeName)

Creates new portable builder.

Specified by:
  `builder` in interface `IgnitePortables`
Parameters:
  `typeName` - Type name.
Returns:
  Newly portable builder.

#### builder

    public PortableBuilder builder(PortableObject portableObj)

Creates portable builder initialized by existing portable object.

Specified by:
  `builder` in interface `IgnitePortables`
Parameters:
  `portableObj` - Portable object to initialize builder.
Returns:
  Portable builder.

#### metadata

    @Nullable
    public PortableMetadata metadata(Class<?> cls)
                              throws PortableException

Gets metadata for provided class.

Specified by:
  `metadata` in interface `IgnitePortables`
Parameters:
  `cls` - Class.
Returns:
  Metadata.
Throws:
  `PortableException` - In case of error.

#### metadata

    @Nullable
    public PortableMetadata metadata(String typeName)
                              throws PortableException

Gets metadata for provided class name.

Specified by:
  `metadata` in interface `IgnitePortables`
Parameters:
  `typeName` - Type name.
Returns:
  Metadata.
Throws:
  `PortableException` - In case of error.

#### metadata

    @Nullable
    public PortableMetadata metadata(int typeId)
                              throws PortableException

Gets metadata for provided type ID.

Specified by:
  `metadata` in interface `IgnitePortables`
Parameters:
  `typeId` - Type ID.
Returns:
  Metadata.
Throws:
  `PortableException` - In case of error.

#### metadata

    public Collection<PortableMetadata> metadata()
                                          throws PortableException

Gets metadata for all known types.

Specified by:
  `metadata` in interface `IgnitePortables`
Returns:
  Metadata.
Throws:
  `PortableException` - In case of error.

#### processor

    public IgniteCacheObjectProcessor processor()

Returns:
  Portable processor.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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