public class HazelcastProperties extends Object
HazelcastProperty
).
A HazelcastProperty
can be set as:
System.setProperty(String, String)
Config.setProperty(String, String)
Constructor and Description |
---|
HazelcastProperties(Config config)
Creates a container with configured Hazelcast properties.
|
HazelcastProperties(Properties nullableProperties)
Creates a container with configured Hazelcast properties.
|
Modifier and Type | Method and Description |
---|---|
String |
get(String key)
Returns the value for the given key.
|
boolean |
getBoolean(HazelcastProperty property)
Returns the configured boolean value of a
HazelcastProperty . |
double |
getDouble(HazelcastProperty property)
Returns the configured double value of a
HazelcastProperty . |
<E extends Enum> |
getEnum(HazelcastProperty property,
Class<E> enumClazz)
Returns the configured enum value of a
GroupProperty . |
float |
getFloat(HazelcastProperty property)
Returns the configured float value of a
HazelcastProperty . |
int |
getInteger(HazelcastProperty property)
Returns the configured int value of a
HazelcastProperty . |
long |
getLong(HazelcastProperty property)
Returns the configured long value of a
HazelcastProperty . |
long |
getMillis(HazelcastProperty property)
Returns the configured value of a
HazelcastProperty converted to milliseconds. |
long |
getNanos(HazelcastProperty property)
Returns the configured value of a
HazelcastProperty converted to nanoseconds. |
int |
getSeconds(HazelcastProperty property)
Returns the configured value of a
HazelcastProperty converted to seconds. |
String |
getString(HazelcastProperty property)
Returns the configured value of a
HazelcastProperty as String. |
Set<String> |
keySet()
Returns an immutable set of all keys in this HazelcastProperties.
|
public HazelcastProperties(Config config)
Uses the environmental value if no value is defined in the configuration. Uses the default value if no environmental value is defined.
config
- Config
used to configure the HazelcastProperty
values;
properties in config are allowed to be null
public HazelcastProperties(Properties nullableProperties)
Uses the environmental value if no value is defined in the configuration. Uses the default value if no environmental value is defined.
nullableProperties
- Properties
used to configure the HazelcastProperty
values;
properties are allowed to be null
public Set<String> keySet()
public String get(String key)
key
- the keynull
if no value is foundNullPointerException
- if key is null
public String getString(HazelcastProperty property)
HazelcastProperty
as String.property
- the HazelcastProperty
to get the value fromnull
if nothing has been configuredpublic boolean getBoolean(HazelcastProperty property)
HazelcastProperty
.property
- the HazelcastProperty
to get the value frompublic int getInteger(HazelcastProperty property)
HazelcastProperty
.property
- the HazelcastProperty
to get the value fromNumberFormatException
- if the value cannot be parsedpublic long getLong(HazelcastProperty property)
HazelcastProperty
.property
- the HazelcastProperty
to get the value fromNumberFormatException
- if the value cannot be parsedpublic float getFloat(HazelcastProperty property)
HazelcastProperty
.property
- the HazelcastProperty
to get the value fromNumberFormatException
- if the value cannot be parsedpublic double getDouble(HazelcastProperty property)
HazelcastProperty
.property
- the HazelcastProperty
to get the value fromNumberFormatException
- if the value cannot be parsedpublic long getNanos(HazelcastProperty property)
HazelcastProperty
converted to nanoseconds.property
- the HazelcastProperty
to get the value fromIllegalArgumentException
- if the HazelcastProperty
has no TimeUnit
public long getMillis(HazelcastProperty property)
HazelcastProperty
converted to milliseconds.property
- the HazelcastProperty
to get the value fromIllegalArgumentException
- if the HazelcastProperty
has no TimeUnit
public int getSeconds(HazelcastProperty property)
HazelcastProperty
converted to seconds.property
- the HazelcastProperty
to get the value fromIllegalArgumentException
- if the HazelcastProperty
has no TimeUnit
public <E extends Enum> E getEnum(HazelcastProperty property, Class<E> enumClazz)
GroupProperty
.
The case of the enum is ignored.
property
- the GroupProperty
to get the value fromIllegalArgumentException
- if the enum value can't be foundCopyright © 2018 Hazelcast, Inc.. All rights reserved.