public interface Properties extends CanonicalMap
Properties
are a specialization of the Dictionary
.
Properties represent a collection if String
key and String
value pairs as properties usually occur in pure text form, to be converted to
the required data types. For this reason, the Properties
interface
provides additional conversion methods.Modifier and Type | Interface and Description |
---|---|
static interface |
Properties.MutableProperties
The Interface MutableProperties.
|
static interface |
Properties.PropertiesBuilder
The Interface PropertiesBuilder.
|
CanonicalMap.CanonicalMapBuilder, CanonicalMap.MutableCanonicalMap
PathMap.MutablePathMap<T>, PathMap.PathMapBuilder<T>
Dictionary.MutableDictionary<K,V>
Keys.MutableKeys<K,V>, Keys.MutableValues<K,V>
org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
org.refcodes.mixin.TypeAccessor.TypeMutator<T>, org.refcodes.mixin.TypeAccessor.TypeProperty<T>
PropertiesAccessorMixin.PropertiesMixin, PropertiesAccessorMixin.PropertiesMutatorMixin
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_COMMENT |
Modifier and Type | Method and Description |
---|---|
default boolean |
containsValue(Object value)
Contains value.
|
default Properties |
fromProperties()
This method creates a
Properties instance from this
Properties instance's elements (key/value-pairs) as of
interoperability reasons. |
default Properties |
retrieve(String aFromPath,
String aToPath)
Retrieve.
|
Properties |
retrieveFrom(String aFromPath)
Retrieve from.
|
Properties |
retrieveTo(String aToPath)
Retrieve to.
|
default void |
saveTo(File aFile)
Saves the properties to the given
File . |
default void |
saveTo(File aFile,
String aComment)
Saves the properties to the given
File . |
default void |
saveTo(OutputStream aOutputStream)
Saves the properties to the given
OutputStream . |
default void |
saveTo(OutputStream aOutputStream,
String aComment)
Saves the properties to the given
OutputStream . |
default void |
saveTo(String aFilePath)
Saves the properties to the given
File . |
default void |
saveTo(String aFilePath,
String aComment)
Saves the properties to the given
File . |
default Map<String,String> |
toMap()
This method creates a
Map instance from this Properties
instance's elements (key/value-pairs) as of interoperability reasons. |
static Properties |
toProperties(File aFile)
Loads the properties from the given
File . |
static Properties |
toProperties(InputStream aInputStream)
Loads the properties from the given
InputStream . |
static Properties |
toProperties(Map<?,?> aProperties)
Creates a
Properties.PropertiesBuilder instance filled with the provided
Properties . |
static Properties |
toProperties(Object aObject)
Creates an
Properties.PropertiesBuilder empty instance. |
static Properties |
toProperties(Properties aProperties)
Creates
Properties filled with the provided Properties . |
static Properties |
toProperties(String aFilePath)
Loads the properties from the given
File . |
static Properties |
toProperties(URL aURL)
Loads the properties from the given
URL . |
default String |
toPropertyPath(String aPath)
Converts the properties for saving that when saved, them properties will
not start with a delimiter, making them (when there are no sub-paths for
the properties) look just like normal well known properties, enabling
interchangeability with other systems reading the properties.
|
toType, toType
directories, directories, entries, entries, getArray, getArray, hasParentPath, isArray, isArray, isDirectory, isEntry, isRecord, isRootPath, keySet, paths, paths, records, records, toDataStructure, toDataStructure, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toPathMap, toPathMap, toPathMap, toPathMap, toPathMap, toPathMap, toPathMap, toPathMap, toRootPath
containsKey, get, keySet, values
isEmpty, size
get, getBoolean, getBoolean, getByte, getByte, getDouble, getDouble, getFloat, getFloat, getInteger, getInteger, getLong, getLong, getShort, getShort
static final String DEFAULT_COMMENT
static Properties toProperties(Object aObject)
Properties.PropertiesBuilder
empty instance.aObject
- the a objectProperties.PropertiesBuilder
.static Properties toProperties(Properties aProperties)
Properties
filled with the provided Properties
.aProperties
- the a propertiesProperties
.static Properties toProperties(Map<?,?> aProperties)
Properties.PropertiesBuilder
instance filled with the provided
Properties
.aProperties
- the a propertiesProperties.PropertiesBuilder
.static Properties toProperties(String aFilePath) throws IOException
File
. Save them using the
method saveTo(File)
.aFilePath
- The file path from which to load the properties.Properties
.IOException
- thrown in case loading the properties failedstatic Properties toProperties(File aFile) throws IOException
File
. Save them using the
method saveTo(File)
.aFile
- The File
from which to load the properties.Properties
.IOException
- thrown in case loading the properties failedstatic Properties toProperties(InputStream aInputStream) throws IOException
InputStream
. Save them using
the method saveTo(OutputStream)
.aInputStream
- The InputStream
from which to load the
properties.Properties
.IOException
- thrown in case loading the properties failedstatic Properties toProperties(URL aURL) throws IOException
URL
.aURL
- The URL
from which to load the properties.Properties
.IOException
- thrown in case loading the properties faileddefault Properties fromProperties()
Properties
instance from this
Properties
instance's elements (key/value-pairs) as of
interoperability reasons.Properties
object from the herein contained
key/value-pairs .default boolean containsValue(Object value)
containsValue
in interface CanonicalMap
containsValue
in interface Keys<String,String>
value
- the valuedefault Map<String,String> toMap()
Map
instance from this Properties
instance's elements (key/value-pairs) as of interoperability reasons.toMap
in interface PathMap<String>
Map
object from the herein contained key/value-pairs .PathMap.toMap(String)
default void saveTo(String aFilePath) throws IOException
File
. Load them via
Properties.MutableProperties.loadFrom(File)
aFilePath
- The file path from which to load the properties.IOException
- thrown in case saving the properties faileddefault void saveTo(File aFile) throws IOException
File
. Load them via
Properties.MutableProperties.loadFrom(File)
aFile
- The File
from which to load the properties.IOException
- thrown in case saving the properties faileddefault void saveTo(String aFilePath, String aComment) throws IOException
File
. Load them via
Properties.MutableProperties.loadFrom(File)
aFilePath
- The file path from which to load the properties.aComment
- The description for the properties file.IOException
- thrown in case saving the properties faileddefault void saveTo(File aFile, String aComment) throws IOException
File
. Load them via
Properties.MutableProperties.loadFrom(File)
aFile
- The File
from which to load the properties.aComment
- The description for the properties file.IOException
- thrown in case saving the properties faileddefault void saveTo(OutputStream aOutputStream) throws IOException
OutputStream
. Load them via
Properties.MutableProperties.loadFrom(InputStream)
aOutputStream
- the a output streamIOException
- thrown in case saving the properties faileddefault void saveTo(OutputStream aOutputStream, String aComment) throws IOException
OutputStream
. Load them via
Properties.MutableProperties.loadFrom(InputStream)
aOutputStream
- The OutputStream
to which to save the
properties to.aComment
- The description for the properties file.IOException
- thrown in case saving the properties faileddefault String toPropertyPath(String aPath)
aPath
- The path to be normalized.Properties retrieveFrom(String aFromPath)
retrieveFrom
in interface PathMap<String>
aFromPath
- the a from pathProperties retrieveTo(String aToPath)
retrieveTo
in interface PathMap<String>
aToPath
- the a to pathCopyright © 2017. All rights reserved.