asObject<T> method

MarshalledMapValuePhase<T> asObject<T>(
  1. IUnmarshalFactory<T> objFactory
)

As object. Provide factory with 'Class.unmarshal' idiom.

Implementation

MarshalledMapValuePhase<T> asObject<T>(IUnmarshalFactory<T> objFactory)
{
  // Deserialize keys using this object unmarshaller.
  for (int i = 0; i < _nativeMap.size(); i += 2)
  {
    _nativeMap.set(i, objFactory( _nativeMap.get(i) ) );
  }

  // Delegate to value phase.
  return new MarshalledMapValuePhase<T>(_nativeMap);
}