Class VersionedPut
VersionedPut is an IEntryProcessor that assumes that entry values implement IVersionable interface and sets an Value property if and only if the version of the specified value matches to the version of the current value.
Inherited Members
Namespace: Tangosol.Util.Processor
Assembly: Coherence.dll
Syntax
public class VersionedPut : AbstractProcessor, IEntryProcessor, IPortableObject
Remarks
In case of the match, the VersionedPut will increment the version indicator before the value is updated.
Constructors
VersionedPut()
Default constructor.
Declaration
public VersionedPut()
VersionedPut(IVersionable)
Construct a VersionedPut that updates an entry with a new value if and only if the version of the new value matches to the version of the current entry's value (which must exist).
Declaration
public VersionedPut(IVersionable value)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | value | An IVersionable value to update an entry with. |
Remarks
The result of the Process(IInvocableCacheEntry) invocation does not return any result.
VersionedPut(IVersionable, bool, bool)
Construct a VersionedPut that updates an entry with a new value if and only if the version of the new value matches to the version of the current entry's value.
Declaration
public VersionedPut(IVersionable value, bool allowInsert, bool ret)
Parameters
Type | Name | Description |
---|---|---|
IVersionable | value | An IVersionable value to update an entry with. |
bool | allowInsert | Specifies whether or not an insert should be allowed (no currently existing value). |
bool | ret | Specifies whether or not the processor should return the current value in case it has not been updated. |
Remarks
This processor optionally returns the current value as a result of the invocation if it has not been updated (the versions did not match).
Fields
NO_RESULT
Used internally to differentiate between "no result" and null result.
Declaration
protected readonly object NO_RESULT
Field Value
Type | Description |
---|---|
object |
m_insert
Specifies whether or not an insert is allowed.
Declaration
protected bool m_insert
Field Value
Type | Description |
---|---|
bool |
m_return
Specifies whether or not a return value is required.
Declaration
protected bool m_return
Field Value
Type | Description |
---|---|
bool |
m_value
Specifies the new value to update an entry with.
Declaration
protected IVersionable m_value
Field Value
Type | Description |
---|---|
IVersionable |
Methods
Equals(object)
Compare the VersionedPut with another object to determine equality.
Declaration
public override bool Equals(object o)
Parameters
Type | Name | Description |
---|---|---|
object | o | The object to compare with. |
Returns
Type | Description |
---|---|
bool | true iff this VersionedPut and the passed object are equivalent VersionedPut. |
Overrides
GetHashCode()
Determine a hash value for the VersionedPut object according to the general GetHashCode() contract.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | An integer hash value for this VersionedPut object. |
Overrides
Process(IInvocableCacheEntry)
Process an IInvocableCacheEntry.
Declaration
public override object Process(IInvocableCacheEntry entry)
Parameters
Type | Name | Description |
---|---|---|
IInvocableCacheEntry | entry | The IInvocableCacheEntry to process. |
Returns
Type | Description |
---|---|
object | The result of the processing, if any. |
Overrides
ProcessAll(ICollection)
Process a collection of IInvocableCacheEntry objects.
Declaration
public override IDictionary ProcessAll(ICollection entries)
Parameters
Type | Name | Description |
---|---|---|
ICollection | entries | A read-only collection of IInvocableCacheEntry objects to process. |
Returns
Type | Description |
---|---|
IDictionary | A dictionary containing the results of the processing, up to one entry for each IInvocableCacheEntry that was processed, keyed by the keys of the dictionary that were processed, with a corresponding value being the result of the processing for each key. |
Overrides
ReadExternal(IPofReader)
Restore the contents of a user type instance by reading its state using the specified IPofReader object.
Declaration
public virtual void ReadExternal(IPofReader reader)
Parameters
Type | Name | Description |
---|---|---|
IPofReader | reader | The IPofReader from which to read the object's state. |
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |
ToString()
Return a human-readable description for this VersionedPut.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A String description of the VersionedPut. |
Overrides
WriteExternal(IPofWriter)
Save the contents of a POF user type instance by writing its state using the specified IPofWriter object.
Declaration
public virtual void WriteExternal(IPofWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IPofWriter | writer | The IPofWriter to which to write the object's state. |
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |
processEntry(IInvocableCacheEntry, IVersionable, bool, bool)
Process the given entry.
Declaration
protected object processEntry(IInvocableCacheEntry entry, IVersionable valueNew, bool insert, bool ret)
Parameters
Type | Name | Description |
---|---|---|
IInvocableCacheEntry | entry | The IInvocableCacheEntry to process. |
IVersionable | valueNew | The new value to update an entry with. |
bool | insert | Specifies whether or not an insert is allowed. |
bool | ret | Specifies whether or not a return value is required. |
Returns
Type | Description |
---|---|
object | The result of the processing, if any. |