T - the generic type that can be modified once, but only oncepublic class ModifyOnce<T> extends Object
| Constructor and Description |
|---|
ModifyOnce()
Creates a new
ModifyOnce object initialized to null. |
ModifyOnce(T defaultData)
Creates a new
ModifyOnce object initialized to defaultData. |
| Modifier and Type | Method and Description |
|---|---|
T |
get()
Returns the wrapped value.
|
void |
set(T data)
Sets the wrapped value.
|
public ModifyOnce()
ModifyOnce object initialized to null.public ModifyOnce(T defaultData)
ModifyOnce object initialized to defaultData.defaultData - The initial value of this ModifyOnce object.public T get()
public void set(T data)
IllegalStateException is thrown.data - The new data to store.IllegalStateException - if this is not the first modification attempt.Copyright © 2021 Apache Software Foundation. All rights reserved.