public class Or<G,B> extends OneOf2<G,B>
Modifier and Type | Method and Description |
---|---|
B |
bad()
Returns the bad value if this is a Bad, or throws an exception if this is a Good.
|
static <G,B> Or<G,B> |
bad(B bad)
Construct a new Bad from the given object.
|
G |
good()
Returns the good value if this is a Good, or throws an exception if this is a Bad.
|
static <G,B> Or<G,B> |
good(G good)
Construct a new Good from the given object.
|
boolean |
isBad()
Returns true if this Or has a bad value.
|
boolean |
isGood()
Returns true if this Or has a good value.
|
public static <G,B> Or<G,B> good(G good)
public static <G,B> Or<G,B> bad(B bad)
public boolean isGood()
public boolean isBad()
public G good()
public B bad()
Copyright © 2017. All rights reserved.