|
XNIO API 2.1.0.CR2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.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. |
|
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. |
|
Iterator<Option<?>> |
iterator()
Iterate over the options in this map. |
|
int |
size()
Get the number of options stored in this map. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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 get
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()
|
XNIO API 2.1.0.CR2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||