Class ReferenceWrapper.PrimitiveReferenceWrapper<T>
java.lang.Object
ru.progrm_jarvis.javacommons.primitive.wrapper.ReferenceWrapper.PrimitiveReferenceWrapper<T>
- Type Parameters:
T- type of reference
- All Implemented Interfaces:
ReferenceWrapper<T>
- Enclosing interface:
- ReferenceWrapper<T>
public static final class ReferenceWrapper.PrimitiveReferenceWrapper<T>
extends Object
implements ReferenceWrapper<T>
ReferenceWrapper implementation based on primitive reference.-
Nested Class Summary
Nested classes/interfaces inherited from interface ru.progrm_jarvis.javacommons.primitive.wrapper.ReferenceWrapper
ReferenceWrapper.AtomicReferenceWrapper<T>, ReferenceWrapper.PrimitiveReferenceWrapper<T> -
Method Summary
Modifier and TypeMethodDescriptionaccumulateAndGet(T updateValue, @NonNull BinaryOperator<T> accumulatorFunction) Gets the value after what it gets updated using the specified function and update value.booleanget()Gets the value.getAndAccumulate(T updateValue, @NonNull BinaryOperator<T> accumulatorFunction) Updates the current value using specified function and update value after what the new value is returned.Sets the value to the one given returning the previous one.getAndUpdate(@NonNull UnaryOperator<T> updateFunction) Updates the current value using the specified function after what the new value is returned.inthashCode()voidSets the value.toString()updateAndGet(@NonNull UnaryOperator<T> updateFunction) Gets the value after what it gets updated using the specified function.
-
Method Details
-
get
Description copied from interface:ReferenceWrapperGets the value.- Specified by:
getin interfaceReferenceWrapper<T>- Returns:
- value
-
set
Description copied from interface:ReferenceWrapperSets the value.- Specified by:
setin interfaceReferenceWrapper<T>- Parameters:
newValue- value to be set
-
getAndSet
Description copied from interface:ReferenceWrapperSets the value to the one given returning the previous one.- Specified by:
getAndSetin interfaceReferenceWrapper<T>- Parameters:
newValue- value to be set- Returns:
- previous value
-
getAndUpdate
Description copied from interface:ReferenceWrapperUpdates the current value using the specified function after what the new value is returned.- Specified by:
getAndUpdatein interfaceReferenceWrapper<T>- Parameters:
updateFunction- function to be used for updating the value- Returns:
- value before update
-
updateAndGet
Description copied from interface:ReferenceWrapperGets the value after what it gets updated using the specified function.- Specified by:
updateAndGetin interfaceReferenceWrapper<T>- Parameters:
updateFunction- function to be used for updating the value- Returns:
- value after update
-
getAndAccumulate
Description copied from interface:ReferenceWrapperUpdates the current value using specified function and update value after what the new value is returned.- Specified by:
getAndAccumulatein interfaceReferenceWrapper<T>- Parameters:
updateValue- update value (will be passed as the second function parameter)accumulatorFunction- function to be used for updating the value- Returns:
- value before update
-
accumulateAndGet
Description copied from interface:ReferenceWrapperGets the value after what it gets updated using the specified function and update value.- Specified by:
accumulateAndGetin interfaceReferenceWrapper<T>- Parameters:
updateValue- update value (will be passed as the second function parameter)accumulatorFunction- function to be used for updating the value- Returns:
- value after update
-
toString
-
equals
-
hashCode
public int hashCode()
-