java.lang.Object
org.apache.jena.atlas.lib.PropertyUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckMetadata(Properties properties, String key, String expected) Check property has the value given - throw exception if not.voidcheckOrSetProperty(Properties properties, String key, String expected) Check property is an expected value or set if missingvoidensurePropertySet(Properties properties, String key, String expected) Set property if not already set.getOrSetDefault(Properties properties, String key, String expected) Get property or the default value - also set the default value if not presentstatic BooleangetPropertyAsBoolean(Properties properties, String key) static booleangetPropertyAsBoolean(Properties properties, String key, boolean dftValue) static intgetPropertyAsInteger(Properties properties, String key) static intgetPropertyAsInteger(Properties properties, String key, int defaultValue) static PropertiesloadFromFile(String filename) Load properties from a file if the file existsstatic voidloadFromFile(Properties properties, String filename) Load properties from a file if the file existsbooleanpropertyEquals(Properties properties, String key, String value) Test whether a property has a value.static voidstoreToFile(Properties properties, String comment, String filename)
-
Constructor Details
-
PropertyUtils
public PropertyUtils()
-
-
Method Details
-
loadFromFile
Load properties from a file if the file exists- Throws:
IOException
-
loadFromFile
Load properties from a file if the file exists- Throws:
IOException
-
storeToFile
public static void storeToFile(Properties properties, String comment, String filename) throws IOException - Throws:
IOException
-
getPropertyAsInteger
-
getPropertyAsInteger
-
getPropertyAsBoolean
-
getPropertyAsBoolean
-
propertyEquals
Test whether a property has a value. Null tests equal to not present. -
ensurePropertySet
Set property if not already set. -
getOrSetDefault
Get property or the default value - also set the default value if not present -
checkOrSetProperty
Check property is an expected value or set if missing -
checkMetadata
Check property has the value given - throw exception if not.
-