public enum ReturnBehavior extends Enum<ReturnBehavior>
NamedMap.put(Object, Object)
and NamedMap.remove(Object)
methods
should return the previous value associated with the key.
Returning the previous value of the key requires reading the map from the data grid. For optimal
performance when the previous value is not required, set the ReturnBehavior to RETURN_NULL
.
The enum member is passed to NamedMap.setReturnBehavior(ReturnBehavior)
By default, return behavior is always null (RETURN_NULL
).Enum Constant and Description |
---|
RETURN_NULL
|
STANDARD
NamedMap.put(Object, Object) and NamedMap.remove(Object) will return the
previous value, as specified in Map . |
Modifier and Type | Method and Description |
---|---|
static ReturnBehavior |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ReturnBehavior[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ReturnBehavior RETURN_NULL
NamedMap.put(Object, Object)
and NamedMap.remove(Object)
always return null
.
This setting should be used to achieve best performance when the previous values are not needed.
This is the default setting.public static final ReturnBehavior STANDARD
NamedMap.put(Object, Object)
and NamedMap.remove(Object)
will return the
previous value, as specified in Map
. This setting should only be applied if
the returned values are intended to be used, since RETURN_NULL
provides better performance.public static ReturnBehavior[] values()
for (ReturnBehavior c : ReturnBehavior.values()) System.out.println(c);
public static ReturnBehavior valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright (C) 2007-2014 ScaleOut Software, Inc.