net.sf.beanlib.provider.replicator
Class ImmutableReplicator

java.lang.Object
  extended by net.sf.beanlib.provider.replicator.ImmutableReplicator
All Implemented Interfaces:
ImmutableReplicatorSpi
Direct Known Subclasses:
HeteroImmutableReplicator, Jaxb2ImmutableReplicator

public class ImmutableReplicator
extends Object
implements ImmutableReplicatorSpi

Default implementation of ImmutableReplicatorSpi.

Author:
Joe D. Velopar

Nested Class Summary
private static class ImmutableReplicator.Factory
          Factory for ImmutableReplicator
 
Field Summary
static ImmutableReplicator.Factory factory
           
 
Constructor Summary
protected ImmutableReplicator()
           
 
Method Summary
static
<T> T
getDefaultPrimitiveValue(Class<T> primitiveClass)
           
static ImmutableReplicator newImmutableReplicatable(BeanTransformerSpi beanTransformer)
           
<V,T> T
replicateImmutable(V immutableFrom, Class<T> toClass)
          Returns a replicated immutable object.
private static boolean sameType(Class lhs, Class rhs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

public static final ImmutableReplicator.Factory factory
Constructor Detail

ImmutableReplicator

protected ImmutableReplicator()
Method Detail

newImmutableReplicatable

public static ImmutableReplicator newImmutableReplicatable(BeanTransformerSpi beanTransformer)

replicateImmutable

public <V,T> T replicateImmutable(V immutableFrom,
                                  Class<T> toClass)
Description copied from interface: ImmutableReplicatorSpi
Returns a replicated immutable object.

Specified by:
replicateImmutable in interface ImmutableReplicatorSpi
Type Parameters:
V - source immutable object type
T - target class type
Parameters:
immutableFrom - source immutable object
toClass - target class

getDefaultPrimitiveValue

public static <T> T getDefaultPrimitiveValue(Class<T> primitiveClass)

sameType

private static boolean sameType(Class lhs,
                                Class rhs)