public enum PutCall extends Enum<PutCall> implements NamedEnum
The concepts of put and call apply to options trading. A call gives the owner the right, but not obligation, to buy the underlying at an agreed price in the future. A put gives a similar option to sell.
| Modifier and Type | Method and Description |
|---|---|
boolean |
isCall()
Checks if the type is 'Call'.
|
boolean |
isPut()
Checks if the type is 'Put'.
|
static PutCall |
of(String name)
Obtains an instance from the specified name.
|
static PutCall |
ofPut(boolean isPut)
Converts a boolean "is put" flag to the enum value.
|
PutCall |
opposite()
Supplies the opposite of this value.
|
String |
toString()
Returns the formatted name of the type.
|
static PutCall |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PutCall[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PutCall PUT
public static final PutCall CALL
public static PutCall[] values()
for (PutCall c : PutCall.values()) System.out.println(c);
public static PutCall valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static PutCall of(String name)
Parsing handles the mixed case form produced by toString() and
the upper and lower case variants of the enum constant name.
name - the name to parseIllegalArgumentException - if the name is not knownpublic static PutCall ofPut(boolean isPut)
isPut - the put flag, true for put, false for callpublic boolean isPut()
public boolean isCall()
public PutCall opposite()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.