Package de.dytanic.cloudnet.common
Class Properties
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<java.lang.String,java.lang.String>
-
- de.dytanic.cloudnet.common.Properties
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.Map<java.lang.String,java.lang.String>
public class Properties extends java.util.LinkedHashMap<java.lang.String,java.lang.String>- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Properties()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetBoolean(java.lang.String key)Returns a property parsed to Stringjava.util.Propertiesjava()Map all entries on this instance to a new java.util.Properties objectvoidload(java.io.File file)The the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't existsvoidload(java.io.InputStream inputStream)The the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't existsvoidload(java.io.Reader reader)The the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't existsvoidload(java.nio.file.Path path)The the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't existsstatic PropertiesparseLine(java.lang.String line)Parsed all properties, from a commandLine and split up into key/value pairsstatic PropertiesparseLine(java.lang.String[] args)Parsed all properties, from a commandLine and split up into key/value pairsvoidsave(java.io.File file)Writes all properties into the file like the .properties default in UTF-8voidsave(java.io.OutputStream outputStream)Writes all properties into the file like the .properties default in UTF-8voidsave(java.io.Writer writer)Writes all properties into the file like the .properties default in UTF-8voidsave(java.lang.String commit, java.io.File file)Writes all properties into the file like the .properties default in UTF-8voidsave(java.lang.String commit, java.io.OutputStream outputStream)Writes all properties into the file like the .properties default in UTF-8voidsave(java.lang.String commit, java.io.Writer writer)Writes all properties into the file like the .properties default in UTF-8voidsave(java.lang.String commit, java.nio.file.Path path)Writes all properties into the file like the .properties default in UTF-8voidsave(java.nio.file.Path path)Writes all properties into the file like the .properties default in UTF-8-
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
-
-
-
Method Detail
-
parseLine
public static Properties parseLine(java.lang.String line)
Parsed all properties, from a commandLine and split up into key/value pairs"count_of_fingers --are fingers=16" will be to
count_of_fingers = true are = true fingers = 16
- Parameters:
line- the following command line which should parsed- Returns:
- the current Properties object instance
-
parseLine
public static Properties parseLine(java.lang.String[] args)
Parsed all properties, from a commandLine and split up into key/value pairs"count_of_fingers --are fingers=16" will be to
count_of_fingers = true are = true fingers = 16
- Parameters:
args- the split command line arguments- Returns:
- the current Properties object instance
-
getBoolean
public boolean getBoolean(java.lang.String key)
Returns a property parsed to String- Parameters:
key- the property, which should get- Returns:
- the property parsed as boolean
-
load
public void load(java.io.File file) throws java.io.IOExceptionThe the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't exists- Parameters:
file- the path, from that the properties should load- Throws:
java.io.IOException- if exists an error to read the file- See Also:
Properties
-
load
public void load(java.nio.file.Path path) throws java.io.IOExceptionThe the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't exists- Parameters:
path- the path, from that the properties should load- Throws:
java.io.IOException- if exists an error to read the file- See Also:
Properties
-
load
public void load(java.io.InputStream inputStream) throws java.io.IOExceptionThe the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't exists- Parameters:
inputStream- the inputStream, from that the properties should load- Throws:
java.io.IOException- if exists an error to read the file- See Also:
Properties
-
load
public void load(java.io.Reader reader) throws java.io.IOExceptionThe the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't exists- Parameters:
reader- the Reader, from that the properties should load- Throws:
java.io.IOException- if exists an error to read the file- See Also:
Properties
-
save
public void save(java.io.File file) throws java.io.IOExceptionWrites all properties into the file like the .properties default in UTF-8- Parameters:
file- the target file, which should be written- Throws:
java.io.IOException- if an problem to write into the file exists- See Also:
Properties
-
save
public void save(java.lang.String commit, java.io.File file) throws java.io.IOExceptionWrites all properties into the file like the .properties default in UTF-8- Parameters:
commit- an optional comment on the file headerfile- the target file, which should be written- Throws:
java.io.IOException- if an problem to write into the file exists- See Also:
Properties
-
save
public void save(java.nio.file.Path path) throws java.io.IOExceptionWrites all properties into the file like the .properties default in UTF-8- Parameters:
path- the target file, which should be written- Throws:
java.io.IOException- if an problem to write into the file exists- See Also:
Properties
-
save
public void save(java.lang.String commit, java.nio.file.Path path) throws java.io.IOExceptionWrites all properties into the file like the .properties default in UTF-8- Parameters:
commit- an optional comment on the file headerpath- the target file, which should be written- Throws:
java.io.IOException- if an problem to write into the file exists- See Also:
Properties
-
save
public void save(java.io.OutputStream outputStream) throws java.io.IOExceptionWrites all properties into the file like the .properties default in UTF-8- Parameters:
outputStream- the target outputStream, which should be written- Throws:
java.io.IOException- if an problem to write into the file exists- See Also:
Properties
-
save
public void save(java.lang.String commit, java.io.OutputStream outputStream) throws java.io.IOExceptionWrites all properties into the file like the .properties default in UTF-8- Parameters:
commit- an optional comment on the file headeroutputStream- the target outputStream, which should be written- Throws:
java.io.IOException- if an problem to write into the file exists- See Also:
Properties
-
save
public void save(java.io.Writer writer)
Writes all properties into the file like the .properties default in UTF-8- Parameters:
writer- the target Writer, which should use- See Also:
Properties
-
save
public void save(java.lang.String commit, java.io.Writer writer)Writes all properties into the file like the .properties default in UTF-8- Parameters:
commit- an optional comment on the file headerwriter- the target Writer, which should use- See Also:
Properties
-
java
public java.util.Properties java()
Map all entries on this instance to a new java.util.Properties object
-
-