DATATYPE - The data type that is wrapped together with the change indicator@Immutable public class ChangeWithValue<DATATYPE> extends Object implements IChangeIndicator, IWrapper<DATATYPE>
| Constructor and Description |
|---|
ChangeWithValue(IChangeIndicator aChangeIndicator,
DATATYPE aObj)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
static <DATATYPE> ChangeWithValue<DATATYPE> |
createChanged(DATATYPE aValue)
Create a new changed object with the given value.
|
static <DATATYPE> ChangeWithValue<DATATYPE> |
createUnchanged(DATATYPE aValue)
Create a new unchanged object with the given value.
|
boolean |
equals(Object o) |
DATATYPE |
get() |
DATATYPE |
getIfChanged(DATATYPE aUnchangedValue)
Get the store value if this is a change.
|
DATATYPE |
getIfChangedOrNull()
Get the store value if this is a changed.
|
DATATYPE |
getIfUnchanged(DATATYPE aChangedValue)
Get the store value if this is unchanged.
|
DATATYPE |
getIfUnchangedOrNull()
Get the store value if this is unchanged.
|
int |
hashCode() |
boolean |
isChanged() |
boolean |
isSet() |
boolean |
isUnchanged() |
String |
toString() |
public ChangeWithValue(@Nonnull IChangeIndicator aChangeIndicator, @Nullable DATATYPE aObj)
aChangeIndicator - The change indicator. May not be null.aObj - The assigned value. May be null.public boolean isChanged()
isChanged in interface IChangeIndicatortrue if changed and false if unchanged.public boolean isUnchanged()
isUnchanged in interface IChangeIndicatortrue if unchanged and false if changed.public boolean isSet()
@Nullable public DATATYPE getIfChanged(@Nullable DATATYPE aUnchangedValue)
aUnchangedValue - The unchanged value to be used. May be null.null.@Nullable public DATATYPE getIfChangedOrNull()
null is
returned.null.@Nullable public DATATYPE getIfUnchanged(@Nullable DATATYPE aChangedValue)
aChangedValue - The changed value to be used. May be null.null.@Nullable public DATATYPE getIfUnchangedOrNull()
null is
returned.null.@Nonnull public static <DATATYPE> ChangeWithValue<DATATYPE> createChanged(@Nullable DATATYPE aValue)
DATATYPE - The data type that is wrapped together with the change indicatoraValue - The value to be used. May be null.null.@Nonnull public static <DATATYPE> ChangeWithValue<DATATYPE> createUnchanged(@Nullable DATATYPE aValue)
DATATYPE - The data type that is wrapped together with the change indicatoraValue - The value to be used. May be null.null.Copyright © 2014–2015 Philip Helger. All rights reserved.