|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<OverflowPolicy>
com.hazelcast.ringbuffer.OverflowPolicy
@Beta public enum OverflowPolicy
Using this policy one can control the behavior what should to be done when an item is about to be added to the ringbuffer, but there is 0 remaining capacity. Overflowing happens when a time-to-live is set and the oldest item in the ringbuffer (the head) is not old enough to expire.
Ringbuffer.addAsync(Object, OverflowPolicy)
,
Ringbuffer.addAllAsync(java.util.Collection, OverflowPolicy)
Enum Constant Summary | |
---|---|
FAIL
Using this policy the call will fail immediately and the oldest item will not be overwritten before it is old enough to retire. |
|
OVERWRITE
Using this policy the oldest item is overwritten no matter it is not old enough to retire. |
Method Summary | |
---|---|
static OverflowPolicy |
getById(int id)
Returns the OverflowPolicy for the given id. |
int |
getId()
Gets the id for the given OverflowPolicy. |
static OverflowPolicy |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static OverflowPolicy[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final OverflowPolicy OVERWRITE
public static final OverflowPolicy FAIL
Method Detail |
---|
public static OverflowPolicy[] values()
for (OverflowPolicy c : OverflowPolicy.values()) System.out.println(c);
public static OverflowPolicy valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic int getId()
public static OverflowPolicy getById(int id)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |