org.infinispan.atomic
Class NullDelta

java.lang.Object
  extended by org.infinispan.atomic.NullDelta
All Implemented Interfaces:
Externalizable, Serializable, Delta

public class NullDelta
extends Object
implements Delta

Represents no changes.

Since:
4.0
Author:
Manik Surtani (manik AT jboss DOT org)
See Also:
Serialized Form

Field Summary
static NullDelta INSTANCE
           
 
Constructor Summary
NullDelta()
           
 
Method Summary
 DeltaAware merge(DeltaAware other)
          Merge the current set of deltas with a given DeltaAware instance, and return a coherent and complete DeltaAware instance.
 void readExternal(ObjectInput in)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final NullDelta INSTANCE
Constructor Detail

NullDelta

public NullDelta()
Method Detail

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

merge

public DeltaAware merge(DeltaAware other)
Description copied from interface: Delta
Merge the current set of deltas with a given DeltaAware instance, and return a coherent and complete DeltaAware instance. Implementations should be able to deal with null values passed in, or values of a different type from the expected DeltaAware instance. Usually the approach would be to ignore what is passed in, create a new instance of the DeltaAware implementation that the current Delta implementation is written for, apply changes and pass it back.

Specified by:
merge in interface Delta
Parameters:
other - instance to merge with, or null if no merging is needed
Returns:
a fully coherent and usable instance of DeltaAware which may or may not be the same instance passed in


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.