net.vz.mongodb.jackson.internal.util
Class IdHandler<K,D>

java.lang.Object
  extended by net.vz.mongodb.jackson.internal.util.IdHandler<K,D>
Direct Known Subclasses:
IdHandler.ByteArrayToObjectIdHandler, IdHandler.NoopIdHandler, IdHandler.StringToObjectIdHandler

public abstract class IdHandler<K,D>
extends Object

Handler for ids. Converts them between the objects type and the database type

Since:
1.0
Author:
James Roper

Nested Class Summary
static class IdHandler.ByteArrayToObjectIdHandler
           
static class IdHandler.NoopIdHandler<K>
           
static class IdHandler.StringToObjectIdHandler
           
 
Constructor Summary
IdHandler()
           
 
Method Summary
static
<K> IdHandler<K,?>
create(org.codehaus.jackson.map.BeanProperty beanProperty, Class<K> keyType)
           
abstract  K fromDbId(D dbId)
          Convert the given database id to the java objects id
abstract  D toDbId(K id)
          Convert the given java object id to the databases id
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdHandler

public IdHandler()
Method Detail

fromDbId

public abstract K fromDbId(D dbId)
Convert the given database id to the java objects id

Parameters:
dbId - The database id to convert from
Returns:
The converted id

toDbId

public abstract D toDbId(K id)
Convert the given java object id to the databases id

Parameters:
id - The java object id to convert from
Returns:
The converted database id

create

public static <K> IdHandler<K,?> create(org.codehaus.jackson.map.BeanProperty beanProperty,
                                        Class<K> keyType)


Copyright © 2011-2012 VZ Netzwerke. All Rights Reserved.