org.sourceforge.jemm.collections.internal.set
Class SetAddResponse
java.lang.Object
org.sourceforge.jemm.lifecycle.TypeResponse<SetAddResponse>
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SetAddResponse
public SetAddResponse(boolean added)
SetAddResponse
public SetAddResponse(StoredValue[] conflicts)
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.