|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- @Immutable public interface Holder<T>
Instances are immutable containers for at most a single object. A Holder is either empty or filled and always remain in the same state once created, i.e. value returned by isEmpty() and isFilled() and getValue() must not change over time for a single instance. null is a legitimate value for a Holder and a filled Holder could return null from getValue().
Method Summary | |
---|---|
T |
getValue()
Retrieve the value of a filled Holder. |
T |
getValueOr(T defaultValue)
Retrieve the value of a filled Holder or the defaultValue if Holder is empty |
T |
getValueOrNull()
Retrieve the value of a filled Holder or null if Holder is empty. |
boolean |
isEmpty()
|
boolean |
isFilled()
|
Method Detail |
---|
boolean isEmpty()
boolean isFilled()
T getValue()
UnsupportedOperationException
- if Holder is emptyT getValueOrNull()
T getValueOr(T defaultValue)
defaultValue
- value to return if Holder is empty
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |