GigaSpaces XAP 9.7.2 API

com.gigaspaces.client
Class ChangeSet

java.lang.Object
  extended by com.gigaspaces.client.ChangeSet
All Implemented Interfaces:
com.gigaspaces.internal.utils.Textualizable, Externalizable, Serializable

public class ChangeSet
extends Object
implements Externalizable, com.gigaspaces.internal.utils.Textualizable

The set of changes to apply for matches entries of the change operation

Since:
9.1
Author:
Niv Ingberg
See Also:
Serialized Form

Constructor Summary
ChangeSet()
          Constructs an empty change set
 
Method Summary
 ChangeSet addAllToCollection(String path, Collection<? extends Serializable> newItems)
          Adds the given items to a collection property
 ChangeSet addAllToCollection(String path, Serializable... newItems)
          Adds the given items to a collection property
 ChangeSet addToCollection(String path, Serializable newItem)
          Adds the given item to a collection property.
 ChangeSet decrement(String path, byte delta)
          Decrement a byte property with the given delta.
 ChangeSet decrement(String path, double delta)
          Decrement a double property with the given delta.
 ChangeSet decrement(String path, float delta)
          Decrement a float property with the given delta.
 ChangeSet decrement(String path, int delta)
          Decrement a integer property with the given delta.
 ChangeSet decrement(String path, long delta)
          Decrement a long property with the given delta.
 ChangeSet decrement(String path, short delta)
          Decrement a short property with the given delta.
 ChangeSet increment(String path, byte delta)
          Increment a byte property with the given delta.
 ChangeSet increment(String path, double delta)
          Increment a double property with the given delta.
 ChangeSet increment(String path, float delta)
          Increment a float property with the given delta.
 ChangeSet increment(String path, int delta)
          Increment a integer property with the given delta.
 ChangeSet increment(String path, long delta)
          Increment a long property with the given delta.
 ChangeSet increment(String path, Number delta)
          Increment a numeric property with the given delta.
 ChangeSet increment(String path, short delta)
          Increment a short property with the given delta.
 ChangeSet lease(long lease)
          Change the entry lease with the new lease.
 ChangeSet putInMap(String path, Serializable key, Serializable value)
          Puts the given key and value in a map property.
 void readExternal(ObjectInput in)
           
 ChangeSet removeFromCollection(String path, Serializable itemToRemove)
          Removes the given item from a collection property.
 ChangeSet removeFromMap(String path, Serializable key)
          Removes the given key from a map property.
 ChangeSet set(String path, Serializable value)
          Sets the value of the given path.
 String toString()
           
 void toText(com.gigaspaces.internal.utils.Textualizer textualizer)
           
 ChangeSet unset(String path)
          Unsets the specified path.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChangeSet

public ChangeSet()
Constructs an empty change set

Method Detail

set

public ChangeSet set(String path,
                     Serializable value)
Sets the value of the given path.

Parameters:
path - The path that needs its value set.
value - The value to set for the given path.

unset

public ChangeSet unset(String path)
Unsets the specified path. If the path points to a dynamic property or a map key it will be removed, if it points to a fixed property it will be set to null, in that case, the target path must point to a nullable property otherwise an error will occur.

Parameters:
path - Path pointing to the requested property.

increment

public ChangeSet increment(String path,
                           byte delta)
Increment a byte property with the given delta.

Parameters:
path - The path pointing to a numeric property that needs its value increased.
delta - The delta to increment by.

increment

public ChangeSet increment(String path,
                           short delta)
Increment a short property with the given delta.

Parameters:
path - The path pointing to a numeric property that needs its value increased.
delta - The delta to increment by.

increment

public ChangeSet increment(String path,
                           int delta)
Increment a integer property with the given delta.

Parameters:
path - The path pointing to a numeric property that needs its value increased.
delta - The delta to increment by.

increment

public ChangeSet increment(String path,
                           long delta)
Increment a long property with the given delta.

Parameters:
path - The path pointing to a numeric property that needs its value increased.
delta - The delta to increment by.

increment

public ChangeSet increment(String path,
                           float delta)
Increment a float property with the given delta.

Parameters:
path - The path pointing to a numeric property that needs its value increased.
delta - The delta to increment by.

increment

public ChangeSet increment(String path,
                           double delta)
Increment a double property with the given delta.

Parameters:
path - The path pointing to a numeric property that needs its value increased.
delta - The delta to increment by.

increment

public ChangeSet increment(String path,
                           Number delta)
Increment a numeric property with the given delta.

Parameters:
path - The path pointing to a numeric property that needs its value increased.
delta - The delta to increment by.

decrement

public ChangeSet decrement(String path,
                           byte delta)
Decrement a byte property with the given delta.

Parameters:
path - The path pointing to a numeric property that needs its value decreased.
delta - The delta to decrement by.

decrement

public ChangeSet decrement(String path,
                           short delta)
Decrement a short property with the given delta.

Parameters:
path - The path pointing to a numeric property that needs its value decreased.
delta - The delta to decrement by.

decrement

public ChangeSet decrement(String path,
                           int delta)
Decrement a integer property with the given delta.

Parameters:
path - The path pointing to a numeric property that needs its value decreased.
delta - The delta to decrement by.

decrement

public ChangeSet decrement(String path,
                           long delta)
Decrement a long property with the given delta.

Parameters:
path - The path pointing to a numeric property that needs its value decreased.
delta - The delta to decrement by.

decrement

public ChangeSet decrement(String path,
                           float delta)
Decrement a float property with the given delta.

Parameters:
path - The path pointing to a numeric property that needs its value decreased.
delta - The delta to decrement by.

decrement

public ChangeSet decrement(String path,
                           double delta)
Decrement a double property with the given delta.

Parameters:
path - The path pointing to a numeric property that needs its value decreased.
delta - The delta to decrement by.

addToCollection

public ChangeSet addToCollection(String path,
                                 Serializable newItem)
Adds the given item to a collection property.

Parameters:
path - The path pointing to the collection that the item should be added to.
newItem - The item to add to the collection.

addAllToCollection

public ChangeSet addAllToCollection(String path,
                                    Serializable... newItems)
Adds the given items to a collection property

Parameters:
path - The path pointing to the collection that the item should be added to.
newItems - The items to add to the collection.

addAllToCollection

public ChangeSet addAllToCollection(String path,
                                    Collection<? extends Serializable> newItems)
Adds the given items to a collection property

Parameters:
path - The path pointing to the collection that the item should be added to.
newItems - The items to add to the collection.

removeFromCollection

public ChangeSet removeFromCollection(String path,
                                      Serializable itemToRemove)
Removes the given item from a collection property.

Parameters:
path - The path pointing to the collection that the item should be removed from.
itemToRemove - The item to remove from the collection.

putInMap

public ChangeSet putInMap(String path,
                          Serializable key,
                          Serializable value)
Puts the given key and value in a map property.

Parameters:
path - The path pointing to the map that the key and value should be put into
key - The map's key.
value - The value to associate with the given key.

removeFromMap

public ChangeSet removeFromMap(String path,
                               Serializable key)
Removes the given key from a map property.

Parameters:
path - The path pointing to the map that the key should be removed from.
key - The map's key.

lease

public ChangeSet lease(long lease)
Change the entry lease with the new lease.

Parameters:
lease - Change the lease duration with the new lease, the lease specifies how much time the lease of a changed entry should be after the change operation takes affect in milliseconds.

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

toString

public String toString()
Overrides:
toString in class Object

toText

public void toText(com.gigaspaces.internal.utils.Textualizer textualizer)
Specified by:
toText in interface com.gigaspaces.internal.utils.Textualizable

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.