Package org.organicdesign.fp.oneOf
Class Or.Good<G,B>
- java.lang.Object
-
- org.organicdesign.fp.oneOf.Or.Good<G,B>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bbad()Returns the bad value if this is a Bad, or throws an exception if this is a Good.booleanequals(java.lang.Object other)Ggood()Returns the good value if this is a Good, or throws an exception if this is a Bad.inthashCode()booleanisBad()Returns true if this Or has a bad value.booleanisGood()Returns true if this Or has a good value.<R> Rmatch(Fn1<G,R> fg, Fn1<B,R> fb)Exactly one of these functions will be executed - determined by whether this is a Good or a Bad.java.lang.StringtoString()
-
-
-
Method Detail
-
isGood
public boolean isGood()
Returns true if this Or has a good value.
-
isBad
public boolean isBad()
Returns true if this Or has a bad value.
-
good
public G good()
Returns the good value if this is a Good, or throws an exception if this is a Bad.
-
bad
public B bad()
Returns the bad value if this is a Bad, or throws an exception if this is a Good.
-
match
public <R> R match(Fn1<G,R> fg, Fn1<B,R> fb)
Exactly one of these functions will be executed - determined by whether this is a Good or a Bad.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-