Prism.Instance<A2,B2>
Modifier and Type | Method and Description |
---|---|
(K,?) |
build(B b)
Constructs a value of the output object type with the given output field value.
|
boolean |
equals(Object obj) |
((K,?)|A) |
match((K,?) pair)
Attempts to extract the input field from the input object.
|
String |
toString() |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
compose, composeUnchecked, upCast
public InjTagged(K key)
public ((K,?)|A) match((K,?) pair)
Prism
For example, say that the input object type is DataResult
and the output
object type is Optional
. Calling match
with the data result will return either the
value present in the result (if a DataResult
is a success), or an absent
Optional
(if the result is an error).
public (K,?) build(B b)
Prism
For example, this may be used to construct an Optional
or DataResult
from a plain value.