Class InvocableCacheEx
Contains extension methods for IInvocableCache for the new Java 8 InvocableMap methods.
Inherited Members
Namespace: Tangosol.Net.Cache
Assembly: Coherence.dll
Syntax
public static class InvocableCacheEx
Methods
GetOrDefault(IInvocableCache, object, object)
Returns the value to which the specified key is mapped, or the defaultValue if this cache contains no mapping for the key.
Declaration
public static object GetOrDefault(this IInvocableCache invocable, object key, object defaultValue)
Parameters
| Type | Name | Description |
|---|---|---|
| IInvocableCache | invocable | The interface it extends. |
| object | key | The key whose associated value is to be returned. |
| object | defaultValue | The default value of the key. |
Returns
| Type | Description |
|---|---|
| object | The value to which the specified key is mapped, or defaultValue if this cache contains no mapping for the key. |
InsertIfAbsent(IInvocableCache, object, object)
If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value.
Declaration
public static object InsertIfAbsent(this IInvocableCache invocable, object key, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| IInvocableCache | invocable | The interface it extends. |
| object | key | Key with which the specified value is to be associated. |
| object | value | Value to be associated with the specified key. |
Returns
| Type | Description |
|---|---|
| object | The current value associated with the specified key, or null if there was no mapping for the key. |
Remove(IInvocableCache, object, object)
Removes the entry for the specified key only if it is currently mapped to the specified value.
Declaration
public static object Remove(this IInvocableCache invocable, object key, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| IInvocableCache | invocable | The interface it extends. |
| object | key | Key with which the specified value is associated. |
| object | value | Value expected to be associated with the specified key. |
Returns
| Type | Description |
|---|---|
| object | True if the value was removed. |
Replace(IInvocableCache, object, object)
Replaces the entry for the specified key only if it is currently mapped to some value.
Declaration
public static object Replace(this IInvocableCache invocable, object key, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| IInvocableCache | invocable | The interface it extends. |
| object | key | Key with which the specified value is associated. |
| object | value | Value to be associated with the specified key. |
Returns
| Type | Description |
|---|---|
| object | The previous value associated with the specified key, or null if there was no mapping for the key. |
Replace(IInvocableCache, object, object, object)
Replaces the entry for the specified key only if currently mapped to the specified value.
Declaration
public static object Replace(this IInvocableCache invocable, object key, object oldValue, object newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| IInvocableCache | invocable | The interface it extends. |
| object | key | Key with which the specified value is associated. |
| object | oldValue | Value expected to be associated with the specified key. |
| object | newValue | Value to be associated with the specified key. |
Returns
| Type | Description |
|---|---|
| object | True if the value was replaced. |