org.sourceforge.jemm.collections.internal.set
Class SetAddResponse

java.lang.Object
  extended by org.sourceforge.jemm.lifecycle.TypeResponse<SetAddResponse>
      extended by org.sourceforge.jemm.collections.internal.set.SetAddResponse
All Implemented Interfaces:
java.io.Serializable, Encodable<SetAddResponse>, Visitable

public class SetAddResponse
extends TypeResponse<SetAddResponse>

SetAddResult encodes the response to a SetAddRequest, there are three possible outcomes: 1) added = true, conflicts = null ( successfully added) 2) added = false, conflicts = null ( item already in map ) 3) added = false, conflicts = true ( item not added, potential conflicts returned )

Author:
Rory Graves
See Also:
Serialized Form

Constructor Summary
SetAddResponse(boolean added)
           
SetAddResponse(StoredValue[] conflicts)
           
 
Method Summary
 SetAddResponse encode(ValueEncoder encoder)
           
 StoredValue[] getConflicts()
          Returns the potential conflicts which prevented the item being added.
 void visit(ValueVisitor visitor)
           
 boolean wasAdded()
          Returns whether the item was added to the set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetAddResponse

public SetAddResponse(boolean added)

SetAddResponse

public SetAddResponse(StoredValue[] conflicts)
Method Detail

encode

public SetAddResponse encode(ValueEncoder encoder)

visit

public void visit(ValueVisitor visitor)

wasAdded

public boolean wasAdded()
Returns whether the item was added to the set.

Returns:
True if the item was added, false otherwise.

getConflicts

public StoredValue[] getConflicts()
Returns the potential conflicts which prevented the item being added.

Returns:
The potential conflicts whilst attempting to add the item, or null if none.


Copyright © 2009. All Rights Reserved.