Class StaticProperty
- Direct Known Subclasses:
DefaultStaticProperty
Users of the Static Object Model can define custom subtypes of StaticProperty or use
DefaultStaticProperty
, a trivial default implementation. In both cases, static properties
must be registered to a StaticShape.Builder
using
StaticShape.Builder.property(StaticProperty, Class, boolean)
. Then, after allocating a
StaticShape
instance with one of the StaticShape.Builder.build()
methods and
allocating a static object using the factory class provided by StaticShape.getFactory()
,
users can call the accessor methods defined in StaticProperty to get and set property values
stored in a static object instance.
A StaticProperty instance can be added to only one StaticShape.Builder
. StaticProperty
instances registered to the same StaticShape.Builder
must have
a unique id for that builder.
- Since:
- 21.3.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
compareAndExchangeBoolean
(Object obj, boolean expect, boolean update) Atomically sets the boolean value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value,==
the expected value.final byte
compareAndExchangeByte
(Object obj, byte expect, byte update) Atomically sets the byte value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value,==
the expected value.final char
compareAndExchangeChar
(Object obj, char expect, char update) Atomically sets the char value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value ,==
the expected value.final double
compareAndExchangeDouble
(Object obj, double expect, double update) Atomically sets the double value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value,==
the expected value.final float
compareAndExchangeFloat
(Object obj, float expect, float update) Atomically sets the float value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value,==
the expected value.final int
compareAndExchangeInt
(Object obj, int expect, int update) Atomically sets the int value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value,==
the expected value.final long
compareAndExchangeLong
(Object obj, long expect, long update) Atomically sets the long value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value,==
the expected value.final Object
compareAndExchangeObject
(Object obj, Object expect, Object update) Atomically sets theObject
value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value ,==
the expected value.final short
compareAndExchangeShort
(Object obj, short expect, short update) Atomically sets the short value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value,==
the expected value.final boolean
compareAndSwapBoolean
(Object obj, boolean expect, boolean update) Atomically sets the boolean value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.final boolean
compareAndSwapByte
(Object obj, byte expect, byte update) Atomically sets the byte value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.final boolean
compareAndSwapChar
(Object obj, char expect, char update) Atomically sets the char value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.final boolean
compareAndSwapDouble
(Object obj, double expect, double update) Atomically sets the double value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.final boolean
compareAndSwapFloat
(Object obj, float expect, float update) Atomically sets the float value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.final boolean
compareAndSwapInt
(Object obj, int expect, int update) Atomically sets the int value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.final boolean
compareAndSwapLong
(Object obj, long expect, long update) Atomically sets the long value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.final boolean
compareAndSwapObject
(Object obj, Object expect, Object update) Atomically sets theObject
value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.final boolean
compareAndSwapShort
(Object obj, short expect, short update) Atomically sets the short value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.final int
getAndAddInt
(Object obj, int delta) Atomically adds the given value to the current int value represented by this StaticProperty and stored in the specified static object.final long
getAndAddLong
(Object obj, long delta) Atomically adds the given value to the current long value represented by this StaticProperty and stored in the specified static object.final int
getAndSetInt
(Object obj, int value) Atomically sets the int value represented by this StaticProperty and stored in the specified static object to the given value and returns the old value.final long
getAndSetLong
(Object obj, long value) Atomically sets the long value represented by this StaticProperty and stored in the specified static object to the given value and returns the old value.final Object
getAndSetObject
(Object obj, Object value) Atomically sets theObject
value represented by this StaticProperty and stored in the specified static object to the given value and returns the old value.final boolean
getBoolean
(Object obj) Returns the boolean value represented by this StaticProperty and stored in the specified static object.final boolean
getBooleanVolatile
(Object obj) Returns the boolean value represented by this StaticProperty and stored in the specified static object.final byte
Returns the byte value represented by this StaticProperty and stored in the specified static object.final byte
getByteVolatile
(Object obj) Returns the byte value represented by this StaticProperty and stored in the specified static object.final char
Returns the char value represented by this StaticProperty and stored in the specified static object.final char
getCharVolatile
(Object obj) Returns the char value represented by this StaticProperty and stored in the specified static object.final double
Returns the double value represented by this StaticProperty and stored in the specified static object.final double
getDoubleVolatile
(Object obj) Returns the double value represented by this StaticProperty and stored in the specified static object.final float
Returns the float value represented by this StaticProperty and stored in the specified static object.final float
getFloatVolatile
(Object obj) Returns the float value represented by this StaticProperty and stored in the specified static object.protected abstract String
getId()
StaticProperty instances must have aString
identifier that is unique and constant for that shape.final int
Returns the int value represented by this StaticProperty and stored in the specified static object.final int
getIntVolatile
(Object obj) Returns the int value represented by this StaticProperty and stored in the specified static object.final long
Returns the long value represented by this StaticProperty and stored in the specified static object.final long
getLongVolatile
(Object obj) Returns the long value represented by this StaticProperty and stored in the specified static object.final Object
Returns theObject
value represented by this StaticProperty and stored in the specified static object.final Object
getObjectVolatile
(Object obj) Returns theObject
value represented by this StaticProperty and stored in the specified static object.final short
Returns the short value represented by this StaticProperty and stored in the specified static object.final short
getShortVolatile
(Object obj) Returns the short value represented by this StaticProperty and stored in the specified static object.final void
setBoolean
(Object obj, boolean value) Sets the boolean value represented by this StaticProperty and stored in the specified static object.final void
setBooleanVolatile
(Object obj, boolean value) Sets the boolean value represented by this StaticProperty and stored in the specified static object.final void
Sets the byte value represented by this StaticProperty and stored in the specified static object.final void
setByteVolatile
(Object obj, byte value) Sets the byte value represented by this StaticProperty and stored in the specified static object.final void
Sets the char value represented by this StaticProperty and stored in the specified static object.final void
setCharVolatile
(Object obj, char value) Sets the char value represented by this StaticProperty and stored in the specified static object.final void
Sets the double value represented by this StaticProperty and stored in the specified static object.final void
setDoubleVolatile
(Object obj, double value) Sets the double value represented by this StaticProperty and stored in the specified static object.final void
Sets the float value represented by this StaticProperty and stored in the specified static object.final void
setFloatVolatile
(Object obj, float value) Sets the float value represented by this StaticProperty and stored in the specified static object.final void
Sets the int value represented by this StaticProperty and stored in the specified static object.final void
setIntVolatile
(Object obj, int value) Sets the int value represented by this StaticProperty and stored in the specified static object.final void
Sets the long value represented by this StaticProperty and stored in the specified static object.final void
setLongVolatile
(Object obj, long value) Sets the long value represented by this StaticProperty and stored in the specified static object.final void
Sets theObject
value represented by this StaticProperty and stored in the specified static object.final void
setObjectVolatile
(Object obj, Object value) Sets theObject
value represented by this StaticProperty and stored in the specified static object.final void
Sets the short value represented by this StaticProperty and stored in the specified static object.final void
setShortVolatile
(Object obj, short value) Sets the short value represented by this StaticProperty and stored in the specified static object.
-
Constructor Details
-
StaticProperty
protected StaticProperty()Constructor for subclasses.- Since:
- 21.3.0
-
-
Method Details
-
getId
StaticProperty instances must have aString
identifier that is unique and constant for that shape. Subtypes of StaticProperty must make sure that the value returned by this method is constant in time.- Returns:
- the static property identifier
- Since:
- 21.3.0
-
getObject
Returns theObject
value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is primitive, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getObjectVolatile
Returns theObject
value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is primitive, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setObject
Sets theObject
value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not assignable fromthe type of value
, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setObjectVolatile
Sets theObject
value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not assignable fromthe type of value
, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndSwapObject
Atomically sets theObject
value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
true
if successful. False return indicates that the actual value was not equal to the expected value.- Throws:
IllegalArgumentException
- if the static property type is not assignable fromthe type of value
, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getAndSetObject
Atomically sets theObject
value represented by this StaticProperty and stored in the specified static object to the given value and returns the old value.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new value- Returns:
- the previous value
- Throws:
IllegalArgumentException
- if the static property type is not assignable fromthe type of value
, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndExchangeObject
Atomically sets theObject
value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value ,==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
- the witness value, which will be the same as the expected value if successful
- Throws:
IllegalArgumentException
- if the static property type is not assignable fromthe type of value
, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getBoolean
Returns the boolean value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the boolean class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getBooleanVolatile
Returns the boolean value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the boolean class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setBoolean
Sets the boolean value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the boolean class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setBooleanVolatile
Sets the boolean value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the boolean class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndSwapBoolean
Atomically sets the boolean value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
true
if successful. False return indicates that the actual value was not equal to the expected value.- Throws:
IllegalArgumentException
- if the static property type is not the boolean class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndExchangeBoolean
Atomically sets the boolean value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value,==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
- the witness value, which will be the same as the expected value if successful
- Throws:
IllegalArgumentException
- if the static property type is not the boolean class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getByte
Returns the byte value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the byte class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getByteVolatile
Returns the byte value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the byte class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setByte
Sets the byte value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the byte class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setByteVolatile
Sets the byte value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the byte class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndSwapByte
Atomically sets the byte value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
true
if successful. False return indicates that the actual value was not equal to the expected value.- Throws:
IllegalArgumentException
- if the static property type is not the byte class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndExchangeByte
Atomically sets the byte value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value,==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
- the witness value, which will be the same as the expected value if successful
- Throws:
IllegalArgumentException
- if the static property type is not the byte class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getChar
Returns the char value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the char class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getCharVolatile
Returns the char value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the char class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setChar
Sets the char value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the char class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setCharVolatile
Sets the char value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the char class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndSwapChar
Atomically sets the char value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
true
if successful. False return indicates that the actual value was not equal to the expected value.- Throws:
IllegalArgumentException
- if the static property type is not the char class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndExchangeChar
Atomically sets the char value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value ,==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
- the witness value, which will be the same as the expected value if successful
- Throws:
IllegalArgumentException
- if the static property type is not the char class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getDouble
Returns the double value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the double class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getDoubleVolatile
Returns the double value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the double class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setDouble
Sets the double value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the double class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setDoubleVolatile
Sets the double value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the double class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndSwapDouble
Atomically sets the double value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
true
if successful. False return indicates that the actual value was not equal to the expected value.- Throws:
IllegalArgumentException
- if the static property type is not the double class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndExchangeDouble
Atomically sets the double value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value,==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
- the witness value, which will be the same as the expected value if successful
- Throws:
IllegalArgumentException
- if the static property type is not the double class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getFloat
Returns the float value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the float class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getFloatVolatile
Returns the float value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the float class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setFloat
Sets the float value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the float class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setFloatVolatile
Sets the float value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the float class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndSwapFloat
Atomically sets the float value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
true
if successful. False return indicates that the actual value was not equal to the expected value.- Throws:
IllegalArgumentException
- if the static property type is not the float class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndExchangeFloat
Atomically sets the float value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value,==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
- the witness value, which will be the same as the expected value if successful
- Throws:
IllegalArgumentException
- if the static property type is not the float class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getInt
Returns the int value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the int class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getIntVolatile
Returns the int value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the int class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setInt
Sets the int value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the int class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setIntVolatile
Sets the int value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the int class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndSwapInt
Atomically sets the int value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
true
if successful. False return indicates that the actual value was not equal to the expected value.- Throws:
IllegalArgumentException
- if the static property type is not the int class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndExchangeInt
Atomically sets the int value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value,==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
- the witness value, which will be the same as the expected value if successful
- Since:
- 21.3.0
-
getAndAddInt
Atomically adds the given value to the current int value represented by this StaticProperty and stored in the specified static object.- Parameters:
obj
- the static object that stores the static property valuedelta
- the value to add- Returns:
- the previous value
- Throws:
IllegalArgumentException
- if the static property type is not the int class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getAndSetInt
Atomically sets the int value represented by this StaticProperty and stored in the specified static object to the given value and returns the old value.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new value- Returns:
- the previous value
- Throws:
IllegalArgumentException
- if the static property type is not the int class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getLong
Returns the long value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the long class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getLongVolatile
Returns the long value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the long class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setLong
Sets the long value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the long class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setLongVolatile
Sets the long value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the long class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndSwapLong
Atomically sets the long value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
true
if successful. False return indicates that the actual value was not equal to the expected value.- Throws:
IllegalArgumentException
- if the static property type is not the long class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndExchangeLong
Atomically sets the long value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value,==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
- the witness value, which will be the same as the expected value if successful
- Throws:
IllegalArgumentException
- if the static property type is not the long class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getAndAddLong
Atomically adds the given value to the current long value represented by this StaticProperty and stored in the specified static object.- Parameters:
obj
- the static object that stores the static property valuedelta
- the value to add- Returns:
- the previous value
- Throws:
IllegalArgumentException
- if the static property type is not the long class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getAndSetLong
Atomically sets the long value represented by this StaticProperty and stored in the specified static object to the given value and returns the old value.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new value- Returns:
- the previous value
- Throws:
IllegalArgumentException
- if the static property type is not the long class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getShort
Returns the short value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the short class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
getShortVolatile
Returns the short value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of reading as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property value- Returns:
- the value of the static property stored in static object obj
- Throws:
IllegalArgumentException
- if the static property type is not the short class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setShort
Sets the short value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared non-volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the short class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
setShortVolatile
Sets the short value represented by this StaticProperty and stored in the specified static object. This property access has the memory semantics of setting as if the variable was declared volatile.- Parameters:
obj
- the static object that stores the static property valuevalue
- the new static property value, to be stored in static object obj- Throws:
IllegalArgumentException
- if the static property type is not the short class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndSwapShort
Atomically sets the short value represented by this StaticProperty and stored in the specified static object to the given updated value if the current value==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
true
if successful. False return indicates that the actual value was not equal to the expected value.- Throws:
IllegalArgumentException
- if the static property type is not the short class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-
compareAndExchangeShort
Atomically sets the short value represented by this StaticProperty and stored in the specified static object tonewValue
if the current value, referred to as the witness value,==
the expected value.- Parameters:
obj
- the static object that stores the static property valueexpect
- the expected valueupdate
- the new value- Returns:
- the witness value, which will be the same as the expected value if successful
- Throws:
IllegalArgumentException
- if the static property type is not the short class, or obj does not have aStaticShape
compatible with this static property- Since:
- 21.3.0
-