Package no.digipost.util
-
Interface Summary Interface Description Assignment<V> An assignment may or may not be assigned, the assigned value can be retrieved withSupplier.get()
and will returnnull
if unassigned, and may be assigned withAssignment.set(Object)
if the assignment allows (re-)assignment.AtMostOne<T> This class offers a subtle functionality which is not available in the Collection API of Java: to retrieve the only element that is expected to be present, and, importantly,throw an exception if there are elements that will be discarded
if assuming that there is at most one element present.GetsNamedValue<V> SetsNamedValue<V> ViewableAsOptional<V> ViewableAsOptional.Single<V> ASupplier
which is alsoViewableAsOptional
. -
Class Summary Class Description Attribute<V> AnAttribute
defines a String-based name (or key) and the type of a value which the name maps to.AttributesMap An immutable collection ofattributes
.AttributesMap.Builder Builder to incrementally construct an immutableAttributesMap
.AutoClosed<T> An adapter to enable any arbitrary object to be managed by the try-with-resources facility of Java >= 7, i.e.ChainableAssignment<V,C> AnAssignment
with the added ability to chain several assignments withChainableAssignment.is(Object)
.JustA<T> Base class for creating simple "typed primitives" value classes.JustALong Base class for creating simple "typedlong
" value classes, for cases when you do not want to pass around simplelong
s for numbers that has certain (business-) semantics in your application, even though along
does adequately express the value.ThrowingAutoClosed<T,X extends Exception> An adapter to enable any arbitrary object to be managed by the try-with-resources facility of Java >= 7, i.e. -
Enum Summary Enum Description AttributesMap.Config Switches to indicate behavior other than default. -
Exception Summary Exception Description GetsNamedValue.NotFound ViewableAsOptional.TooManyElements An object which was attempted to be viewed as aOptional
representation of itself contained more than one element, and is thus not applicable for such conversion.