|
XNIO API 3.0.7.GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xnio.OptionMap
public final class OptionMap
An immutable map of options to option values. No null keys or values are permitted.
| Nested Class Summary | |
|---|---|
static class |
OptionMap.Builder
A builder for immutable option maps. |
| Field Summary | |
|---|---|
static OptionMap |
EMPTY
The empty option map. |
| Method Summary | ||
|---|---|---|
static OptionMap.Builder |
builder()
Create a new builder. |
|
boolean |
contains(Option<?> option)
Determine whether this option map contains the given option. |
|
static
|
create(Option<T> option,
T value)
Create a single-valued option map. |
|
static
|
create(Option<T1> option1,
T1 value1,
Option<T2> option2,
T2 value2)
Create a two-valued option map. |
|
boolean |
equals(Object other)
Determine whether this option map is equal to another. |
|
boolean |
equals(OptionMap other)
Determine whether this option map is equal to another. |
|
boolean |
get(Option<Boolean> option,
boolean defaultValue)
Get a boolean value from this option map, with a specified default if the value is missing. |
|
int |
get(Option<Integer> option,
int defaultValue)
Get a int value from this option map, with a specified default if the value is missing. |
|
long |
get(Option<Long> option,
long defaultValue)
Get a long value from this option map, with a specified default if the value is missing. |
|
|
get(Option<T> option)
Get the value of an option from this option map. |
|
|
get(Option<T> option,
T defaultValue)
Get the value of an option from this option map, with a specified default if the value is missing. |
|
int |
hashCode()
Get the hash code for this option map. |
|
Iterator<Option<?>> |
iterator()
Iterate over the options in this map. |
|
int |
size()
Get the number of options stored in this map. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final OptionMap EMPTY
| Method Detail |
|---|
public boolean contains(Option<?> option)
option - the option to check
true if the option is present in the option mappublic <T> T get(Option<T> option)
T - the type of the optionoption - the option to get
null if it is not present
public <T> T get(Option<T> option,
T defaultValue)
T - the type of the optionoption - the option to getdefaultValue - the value to return if the option is not set
null if it is not present
public boolean get(Option<Boolean> option,
boolean defaultValue)
option - the option to getdefaultValue - the default value if the option is not present
public int get(Option<Integer> option,
int defaultValue)
option - the option to getdefaultValue - the default value if the option is not present
public long get(Option<Long> option,
long defaultValue)
option - the option to getdefaultValue - the default value if the option is not present
public Iterator<Option<?>> iterator()
iterator in interface Iterable<Option<?>>public int size()
public static OptionMap.Builder builder()
public static <T> OptionMap create(Option<T> option,
T value)
T - the option value typeoption - the option to put in the mapvalue - the option value
public static <T1,T2> OptionMap create(Option<T1> option1,
T1 value1,
Option<T2> option2,
T2 value2)
T1 - the first option value typeT2 - the second option value typeoption1 - the first option to put in the mapvalue1 - the first option valueoption2 - the second option to put in the mapvalue2 - the second option value
public String toString()
toString in class Objectpublic boolean equals(Object other)
equals in class Objectother - the other option map
true if they are equal, false otherwisepublic boolean equals(OptionMap other)
other - the other option map
true if they are equal, false otherwisepublic int hashCode()
hashCode in class Object
|
XNIO API 3.0.7.GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||