Interface MutableLong
-
- All Superinterfaces:
java.lang.AutoCloseable
public interface MutableLong extends java.lang.AutoCloseable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclose()default booleancompareAndSet(long expectedValue, long newValue)This is not meant to be atomic; it's semantically equivalent to:longget()java.lang.StringgetMutableLongId()voidset(long value)
-
-
-
Method Detail
-
getMutableLongId
java.lang.String getMutableLongId()
-
get
long get() throws UnavailableStateException
- Throws:
UnavailableStateException
-
set
void set(long value) throws UnavailableStateException
- Throws:
UnavailableStateException
-
compareAndSet
default boolean compareAndSet(long expectedValue, long newValue) throws UnavailableStateExceptionThis is not meant to be atomic; it's semantically equivalent to:long oldValue = mutableLong.get(); if (mutableLong.oldValue != expectedValue) { return false; } mutableLong.set(newValue); return true;- Throws:
UnavailableStateException
-
close
void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
-