| Modifier and Type | Field and Description |
|---|---|
static String |
DAYS |
static String |
HOURS |
static String |
MINUTES |
String |
name |
Map<String,String> |
options
Global options
|
static String |
SECONDS |
| Constructor and Description |
|---|
MapOperations() |
MapOperations(Map.Entry<String,Map<String,String>> entry)
Create an instance from an iterative map entry
|
MapOperations(String name,
Map<String,String> options)
Create an instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<String,String>> |
entrySet() |
boolean |
equals(Object o) |
String |
get(Object key) |
String |
getMandatoryOption(String key)
Get a cluster option or value
|
int |
getMandatoryOptionInt(String option)
Get a mandatory integer option; use
Integer.decode(String) so as to take hex
oct and bin values too. |
String |
getOption(String key,
String defVal)
Get an option value
|
Boolean |
getOptionBool(String key,
boolean defVal)
Get a boolean option
|
int |
getOptionInt(String option,
int defVal)
Get an integer option; use
Integer.decode(String) so as to take hex
oct and bin values too. |
long |
getOptionLong(String option,
long defVal)
Get a long option; use
Long.decode(String) so as to take hex
oct and bin values too. |
long |
getTimeRange(String basekey,
int defDays,
int defHours,
int defMins,
int defSecs)
Get the time range of a set of keys
|
int |
hashCode() |
boolean |
isEmpty() |
boolean |
isSet(String key) |
Set<String> |
keySet() |
void |
mergeMapPrefixedKeys(Map<String,String> that,
String prefix,
boolean overwrite)
Merge a map by prefixed keys
|
void |
mergeWithoutOverwrite(Map<String,String> that) |
Map<String,String> |
prefixedWith(String prefix)
Get all entries with a specific prefix
|
String |
put(String key,
String value) |
void |
putAll(Map<? extends String,? extends String> m) |
void |
putIfUnset(String key,
String value)
Set a property if it is not already set
|
String |
remove(Object key) |
void |
set(String key,
Object value) |
int |
size() |
String |
toString() |
Collection<String> |
values() |
void |
verifyOptionSet(String key)
Verify that an option is set: that is defined AND non-empty
|
public static final String DAYS
public static final String HOURS
public static final String MINUTES
public static final String SECONDS
public final String name
public MapOperations()
public MapOperations(String name, Map<String,String> options)
name - nameoptions - source of optionspublic String getOption(String key, String defVal)
key - keydefVal - default valuepublic Boolean getOptionBool(String key, boolean defVal)
key - option keydefVal - default valuepublic String getMandatoryOption(String key) throws BadConfigException
key - option keyBadConfigException - if the option is missingpublic int getOptionInt(String option, int defVal)
Integer.decode(String) so as to take hex
oct and bin values too.option - option namedefVal - default valueNumberFormatException - if the role could not be parsed.public long getOptionLong(String option, long defVal)
Long.decode(String) so as to take hex
oct and bin values too.option - option namedefVal - default valueNumberFormatExceptionpublic int getMandatoryOptionInt(String option) throws BadConfigException
Integer.decode(String) so as to take hex
oct and bin values too.option - option nameNumberFormatException - if the option could not be parsed.BadConfigException - if the option could not be foundpublic void verifyOptionSet(String key) throws BadConfigException
key - BadConfigExceptionpublic void mergeMapPrefixedKeys(Map<String,String> that, String prefix, boolean overwrite)
that - the map to merge inprefix - prefix to match onoverwrite - flag to enable overwritepublic void putIfUnset(String key, String value)
key - keyvalue - valuepublic boolean containsValue(Object value)
containsValue in interface Map<String,String>public boolean containsKey(Object key)
containsKey in interface Map<String,String>public boolean equals(Object o)
public int hashCode()
public boolean isSet(String key)
public long getTimeRange(String basekey, int defDays, int defHours, int defMins, int defSecs)
basekey - base key to which suffix gets applieddefDays - defHours - defMins - defSecs - Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.