Package org.hcjf.properties
Class SystemProperties
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<java.lang.Object,java.lang.Object>
-
- java.util.Properties
-
- org.hcjf.properties.SystemProperties
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.Map<java.lang.Object,java.lang.Object>
public final class SystemProperties extends java.util.PropertiesThis class overrides the system properties default implementation adding some default values and properties definitions for the service-oriented platforms works.- Author:
- javaito
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSystemProperties.Cloudstatic classSystemProperties.Collectorstatic classSystemProperties.Cryptographystatic classSystemProperties.Encodingstatic classSystemProperties.Eventstatic classSystemProperties.FileSystemstatic classSystemProperties.Layerstatic classSystemProperties.Localestatic classSystemProperties.Logstatic classSystemProperties.Netstatic classSystemProperties.ProcessDiscoverystatic classSystemProperties.Querystatic classSystemProperties.Service
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFILE_ENCODINGstatic java.lang.StringHCJF_DECIMAL_NUMBER_REGEXstatic java.lang.StringHCJF_DEFAULT_DATE_FORMATstatic java.lang.StringHCJF_DEFAULT_DECIMAL_SEPARATORstatic java.lang.StringHCJF_DEFAULT_EXCEPTION_MESSAGE_TAGstatic java.lang.StringHCJF_DEFAULT_GROUPING_SEPARATORstatic java.lang.StringHCJF_DEFAULT_LRU_MAP_SIZEstatic java.lang.StringHCJF_DEFAULT_NUMBER_FORMATstatic java.lang.StringHCJF_DEFAULT_PROPERTIES_FILE_PATHstatic java.lang.StringHCJF_DEFAULT_PROPERTIES_FILE_XMLstatic java.lang.StringHCJF_DEFAULT_SCIENTIFIC_NUMBER_FORMATstatic java.lang.StringHCJF_INTEGER_NUMBER_REGEXstatic java.lang.StringHCJF_MATH_CONNECTOR_REGULAR_EXPRESSIONstatic java.lang.StringHCJF_MATH_REGULAR_EXPRESSIONstatic java.lang.StringHCJF_MATH_SPLITTER_REGULAR_EXPRESSIONstatic java.lang.StringHCJF_SCIENTIFIC_NUMBER_REGEXstatic java.lang.StringHCJF_UUID_REGEX
-
Method Summary
Modifier and Type Method Description static java.lang.Stringget(java.lang.String propertyName)This method return the string value of the system property named like the parameter.static java.lang.Stringget(java.lang.String propertyName, PropertyValueValidator<java.lang.String> validator)This method return the string value of the system property named like the parameter.static java.lang.BooleangetBoolean(java.lang.String propertyName)This method return the value of the system property as boolean.static <O> java.lang.Class<O>getClass(java.lang.String propertyName)This method return the value of the system property as class.static java.text.SimpleDateFormatgetDateFormat(java.lang.String propertyName)This method return the value of the property as a SimpleDateFormat instance.static java.text.DecimalFormatgetDecimalFormat(java.lang.String propertyName)This method return the value of the property as a DecimalFormat instnace.static java.lang.StringgetDefaultCharset()Return the default charset of the JVM instance.static java.lang.DoublegetDouble(java.lang.String propertyName)This method return the value of the system property as double.static java.lang.IntegergetInteger(java.lang.String propertyName)This method return the value of the system property as integer.static java.util.List<java.lang.String>getList(java.lang.String propertyName)This method return the value of the property as instance of list.static java.util.LocalegetLocale()This method return the valuo of the property called 'hcjf.default.locale' as a locale instance.static java.util.LocalegetLocale(java.lang.String propertyName)This method return the value of the property as Locale instance.static java.lang.LonggetLong(java.lang.String propertyName)This method return the value of the system property as long.static java.util.Map<java.lang.String,java.lang.String>getMap(java.lang.String propertyName)This method return the value of the property as instance of map.static <O> OgetObject(java.lang.String propertyName, java.lang.Class<O> objectType)Returns the implementation object expected for the specific object type.static <O> java.util.List<O>getObjects(java.lang.String propertyName, java.lang.Class<O> objectType)Returns a list of expected object instances for the specific object type.static java.nio.file.PathgetPath(java.lang.String propertyName)This method return the value of the system property asPathinstance.static java.util.regex.PatterngetPattern(java.lang.String propertyName)static java.util.regex.PatterngetPattern(java.lang.String propertyName, int flags)Return the compiled pattern from the property value.static java.util.Set<java.lang.String>getSet(java.lang.String propertyName)This method return the value of the property as instance of set.static java.util.UUIDgetUUID(java.lang.String propertyName)This method return the value of the system property asUUIDinstance.static voidputDefaultValue(java.lang.String propertyName, java.lang.String defaultValue)Put the default value for a property.java.lang.ObjectsetProperty(java.lang.String key, java.lang.String value)Calls the Hashtable methodput.-
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
-
-
-
Field Detail
-
HCJF_DEFAULT_DATE_FORMAT
public static final java.lang.String HCJF_DEFAULT_DATE_FORMAT
- See Also:
- Constant Field Values
-
HCJF_DEFAULT_NUMBER_FORMAT
public static final java.lang.String HCJF_DEFAULT_NUMBER_FORMAT
- See Also:
- Constant Field Values
-
HCJF_DEFAULT_SCIENTIFIC_NUMBER_FORMAT
public static final java.lang.String HCJF_DEFAULT_SCIENTIFIC_NUMBER_FORMAT
- See Also:
- Constant Field Values
-
HCJF_DEFAULT_DECIMAL_SEPARATOR
public static final java.lang.String HCJF_DEFAULT_DECIMAL_SEPARATOR
- See Also:
- Constant Field Values
-
HCJF_DEFAULT_GROUPING_SEPARATOR
public static final java.lang.String HCJF_DEFAULT_GROUPING_SEPARATOR
- See Also:
- Constant Field Values
-
HCJF_DEFAULT_PROPERTIES_FILE_PATH
public static final java.lang.String HCJF_DEFAULT_PROPERTIES_FILE_PATH
- See Also:
- Constant Field Values
-
HCJF_DEFAULT_PROPERTIES_FILE_XML
public static final java.lang.String HCJF_DEFAULT_PROPERTIES_FILE_XML
- See Also:
- Constant Field Values
-
HCJF_UUID_REGEX
public static final java.lang.String HCJF_UUID_REGEX
- See Also:
- Constant Field Values
-
HCJF_INTEGER_NUMBER_REGEX
public static final java.lang.String HCJF_INTEGER_NUMBER_REGEX
- See Also:
- Constant Field Values
-
HCJF_DECIMAL_NUMBER_REGEX
public static final java.lang.String HCJF_DECIMAL_NUMBER_REGEX
- See Also:
- Constant Field Values
-
HCJF_SCIENTIFIC_NUMBER_REGEX
public static final java.lang.String HCJF_SCIENTIFIC_NUMBER_REGEX
- See Also:
- Constant Field Values
-
HCJF_MATH_REGULAR_EXPRESSION
public static final java.lang.String HCJF_MATH_REGULAR_EXPRESSION
- See Also:
- Constant Field Values
-
HCJF_MATH_CONNECTOR_REGULAR_EXPRESSION
public static final java.lang.String HCJF_MATH_CONNECTOR_REGULAR_EXPRESSION
- See Also:
- Constant Field Values
-
HCJF_MATH_SPLITTER_REGULAR_EXPRESSION
public static final java.lang.String HCJF_MATH_SPLITTER_REGULAR_EXPRESSION
- See Also:
- Constant Field Values
-
HCJF_DEFAULT_LRU_MAP_SIZE
public static final java.lang.String HCJF_DEFAULT_LRU_MAP_SIZE
- See Also:
- Constant Field Values
-
HCJF_DEFAULT_EXCEPTION_MESSAGE_TAG
public static final java.lang.String HCJF_DEFAULT_EXCEPTION_MESSAGE_TAG
- See Also:
- Constant Field Values
-
FILE_ENCODING
public static final java.lang.String FILE_ENCODING
- See Also:
- Constant Field Values
-
-
Method Detail
-
putDefaultValue
public static void putDefaultValue(java.lang.String propertyName, java.lang.String defaultValue)Put the default value for a property.- Parameters:
propertyName- Property name.defaultValue- Property default value.- Throws:
java.lang.NullPointerException- Throw aNullPointerExceptionwhen the property name or default value are null.
-
setProperty
public java.lang.Object setProperty(java.lang.String key, java.lang.String value)Calls the Hashtable methodput. Provided for parallelism with the getProperty method. Enforces use of strings for property keys and values. The value returned is the result of the Hashtable call toput.- Overrides:
setPropertyin classjava.util.Properties- Parameters:
key- the key to be placed into this property list.value- the value corresponding to key.- Returns:
- the previous value of the specified key in this property
list, or
nullif it did not have one. - Since:
- 1.2
- See Also:
Properties.getProperty(java.lang.String)
-
get
public static java.lang.String get(java.lang.String propertyName, PropertyValueValidator<java.lang.String> validator)This method return the string value of the system property named like the parameter.- Parameters:
propertyName- Name of the find property.validator- Property validator.- Returns:
- Return the value of the property or null if the property is no defined.
-
get
public static java.lang.String get(java.lang.String propertyName)
This method return the string value of the system property named like the parameter.- Parameters:
propertyName- Name of the find property.- Returns:
- Return the value of the property or null if the property is no defined.
-
getBoolean
public static java.lang.Boolean getBoolean(java.lang.String propertyName)
This method return the value of the system property as boolean.- Parameters:
propertyName- Name of the find property.- Returns:
- Value of the system property as boolean, or null if the property is not found.
-
getInteger
public static java.lang.Integer getInteger(java.lang.String propertyName)
This method return the value of the system property as integer.- Parameters:
propertyName- Name of the find property.- Returns:
- Value of the system property as integer, or null if the property is not found.
-
getLong
public static java.lang.Long getLong(java.lang.String propertyName)
This method return the value of the system property as long.- Parameters:
propertyName- Name of the find property.- Returns:
- Value of the system property as long, or null if the property is not found.
-
getDouble
public static java.lang.Double getDouble(java.lang.String propertyName)
This method return the value of the system property as double.- Parameters:
propertyName- Name of the find property.- Returns:
- Value of the system property as double, or null if the property is not found.
-
getUUID
public static java.util.UUID getUUID(java.lang.String propertyName)
This method return the value of the system property asUUIDinstance.- Parameters:
propertyName- Name of the find property.- Returns:
- Value of the system property as
UUIDinstance, or null if the property is not found.
-
getPath
public static java.nio.file.Path getPath(java.lang.String propertyName)
This method return the value of the system property asPathinstance.- Parameters:
propertyName- Name of the find property.- Returns:
- Value of the system property as
Pathinstance, or null if the property is not found.
-
getClass
public static <O> java.lang.Class<O> getClass(java.lang.String propertyName)
This method return the value of the system property as class.- Type Parameters:
O- Type of the class instance expected.- Parameters:
propertyName- Name of the find property.- Returns:
- Class instance.
-
getDefaultCharset
public static java.lang.String getDefaultCharset()
Return the default charset of the JVM instance.- Returns:
- Default charset.
-
getLocale
public static java.util.Locale getLocale(java.lang.String propertyName)
This method return the value of the property as Locale instance. The instance returned will be stored on near cache and will be removed when the value of the property has been updated.- Parameters:
propertyName- Name of the property that contains locale representation.- Returns:
- Locale instance.
-
getLocale
public static java.util.Locale getLocale()
This method return the valuo of the property called 'hcjf.default.locale' as a locale instance. The instance returned will be stored on near cache and will be removed when the value of the property has been updated.- Returns:
- Locale instance.
-
getDecimalFormat
public static java.text.DecimalFormat getDecimalFormat(java.lang.String propertyName)
This method return the value of the property as a DecimalFormat instnace. The instance returned will be stored on near cache and will be removed when the value of the property has been updated.- Parameters:
propertyName- Name of the property that contains decimal pattern.- Returns:
- DecimalFormat instance.
-
getDateFormat
public static java.text.SimpleDateFormat getDateFormat(java.lang.String propertyName)
This method return the value of the property as a SimpleDateFormat instance. The instance returned will be stored on near cache and will be removed when the value of the property has been updated.- Parameters:
propertyName- Name of the property that contains date representation.- Returns:
- Simple date format instance.
-
getObject
public static <O> O getObject(java.lang.String propertyName, java.lang.Class<O> objectType)Returns the implementation object expected for the specific object type.- Type Parameters:
O- Expected object instance.- Parameters:
propertyName- Name of the property.objectType- Object type.- Returns:
- Object instance.
-
getObjects
public static <O> java.util.List<O> getObjects(java.lang.String propertyName, java.lang.Class<O> objectType)Returns a list of expected object instances for the specific object type.- Type Parameters:
O- Expected object instance.- Parameters:
propertyName- Name of the property.objectType- Object type.- Returns:
- Object instances.
-
getList
public static java.util.List<java.lang.String> getList(java.lang.String propertyName)
This method return the value of the property as instance of list.- Parameters:
propertyName- Name of the property that contains the json array representation.- Returns:
- List instance.
-
getSet
public static java.util.Set<java.lang.String> getSet(java.lang.String propertyName)
This method return the value of the property as instance of set.- Parameters:
propertyName- Name of the property that contains the json array representation.- Returns:
- Set instance.
-
getMap
public static java.util.Map<java.lang.String,java.lang.String> getMap(java.lang.String propertyName)
This method return the value of the property as instance of map.- Parameters:
propertyName- The name of the property that contains the json object representation.- Returns:
- Map instance.
-
getPattern
public static java.util.regex.Pattern getPattern(java.lang.String propertyName)
-
getPattern
public static java.util.regex.Pattern getPattern(java.lang.String propertyName, int flags)Return the compiled pattern from the property value.- Parameters:
propertyName- Name of the property.flags- Regex flags.- Returns:
- Compiled pattern.
-
-