Package com.helger.commons.mutable
Class MutableBoolean
- java.lang.Object
-
- com.helger.commons.mutable.MutableBoolean
-
- All Implemented Interfaces:
IComparable<MutableBoolean>,ICloneable<MutableBoolean>,IMutableObject<MutableBoolean>,IGenericImplTrait<MutableBoolean>,Comparable<MutableBoolean>
@NotThreadSafe public class MutableBoolean extends Object implements IMutableObject<MutableBoolean>
Object wrapper around a boolean so that it can be passed a final object but is mutable.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description MutableBoolean(boolean bValue)MutableBoolean(MutableBoolean aValue)MutableBoolean(Boolean aValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanbooleanValue()intcompareTo(MutableBoolean rhs)booleanequals(Object o)BooleangetAsBoolean()MutableBooleangetClone()<T> TgetIf(Supplier<? extends T> aSupplier)<T> TgetIf(Supplier<? extends T> aSupplier, T aDefault)inthashCode()protected voidonAfterChange()This method is invoked after a value changed.EChangeset(boolean bValue)EChangeset(MutableBoolean aValue)EChangeset(Boolean aValue)StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.compare.IComparable
isEQ, isGE, isGT, isLE, isLT, isNE
-
Methods inherited from interface com.helger.commons.traits.IGenericImplTrait
thisAsT
-
-
-
-
Constructor Detail
-
MutableBoolean
public MutableBoolean(boolean bValue)
-
MutableBoolean
public MutableBoolean(@Nonnull MutableBoolean aValue)
-
-
Method Detail
-
onAfterChange
@OverrideOnDemand protected void onAfterChange()
This method is invoked after a value changed.
-
booleanValue
public boolean booleanValue()
-
set
@Nonnull public EChange set(@Nonnull MutableBoolean aValue)
-
compareTo
public int compareTo(@Nonnull MutableBoolean rhs)
- Specified by:
compareToin interfaceComparable<MutableBoolean>
-
getClone
@Nonnull public MutableBoolean getClone()
- Specified by:
getClonein interfaceICloneable<MutableBoolean>- Returns:
- A 100% deep-copy of the implementing class.
-
-