Class OneOfN
java.lang.Object
de.xima.fc.api.rest.pub.client.user.OneOfN
- Direct Known Subclasses:
OneOfN.Either, OneOfN.Just, OneOfN.None, OneOfN.OneOf3, OneOfN.OneOf4, OneOfN.OneOf5
@Generated("de.xima.openapi.codegen.java_jaxrs.XimaJavaJaxrsGenerator")
public abstract class OneOfN
extends Object
Base class for emulating a sum type (also known as a discriminated union) of N elements.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classEmulates a sum type consisting of 2 cases.static interfaceA matcher object that contains a handler for each case and can be used to reduce a sum type to a single value.static final classEmulates a sum type consisting of 1 cases.static interfaceA matcher object that contains a handler for each case and can be used to reduce a sum type to a single value.static final classEmulates a sum type consisting of 0 cases.static interfaceA matcher object that contains a handler for each case and can be used to reduce a sum type to a single value.static final classEmulates a sum type consisting of 3 cases.static interfaceA matcher object that contains a handler for each case and can be used to reduce a sum type to a single value.static final classEmulates a sum type consisting of 4 cases.static interfaceA matcher object that contains a handler for each case and can be used to reduce a sum type to a single value.static final classEmulates a sum type consisting of 5 cases.static interfaceA matcher object that contains a handler for each case and can be used to reduce a sum type to a single value. -
Field Summary
Fields -
Method Summary
-
Field Details
-
choice
protected final int choice -
value
-
-
Method Details
-
getValue
Checks which case applies and returns the value for that case. You need to cast it yourself to the required type.- Returns:
- The value of this sum type.
-
getChoice
public int getChoice()- Returns:
- The 0-based index representing the case for which a value is present.
-
equals
-
hashCode
-
select
-
is
protected final boolean is(int choice) - Parameters:
choice- Index of the case to check.- Returns:
- Whether a value is presen for the given case.
-