Package org.opt4j.config
Class PropertyModule
java.lang.Object
org.opt4j.config.PropertyModule
- All Implemented Interfaces:
com.google.inject.Module
,Serializable
,Comparable<PropertyModule>
public final class PropertyModule
extends Object
implements com.google.inject.Module, Serializable, Comparable<PropertyModule>
The
PropertyModule
is a decorator for a Module
that enables
property methods.- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPropertyModule
(com.google.inject.Module module) Constructs aPropertyModule
that decorates aModule
. -
Method Summary
Modifier and TypeMethodDescriptionclone()
int
compareTo
(PropertyModule other) void
configure
(com.google.inject.Binder binder) boolean
getConfiguration
(Document document) Returns the configuration of thePropertyModule
as XMLNode
.com.google.inject.Module
Returns the decoratedModule
.Returns the properties.getProperty
(String name) Returns theProperty
with the specifiedname
.int
hashCode()
void
setConfiguration
(Node node) Configures aPropertyModule
with an XMLNode
.static Object
toEnumElement
(String name, Class<? extends Enum> type) Converts a String to an element of a given enumeration.toString()
-
Field Details
-
module
protected final com.google.inject.Module module -
properties
-
c
protected static int c -
id
public final int id
-
-
Constructor Details
-
PropertyModule
public PropertyModule(com.google.inject.Module module) Constructs aPropertyModule
that decorates aModule
.- Parameters:
module
- the decorated module
-
-
Method Details
-
toEnumElement
Converts a String to an element of a given enumeration.- Parameters:
name
- the name of the elementtype
- the enumeration type- Returns:
- the element of the enumeration
-
configure
public void configure(com.google.inject.Binder binder) - Specified by:
configure
in interfacecom.google.inject.Module
-
getModule
public com.google.inject.Module getModule()Returns the decoratedModule
.- Returns:
- the module
-
getProperty
Returns theProperty
with the specifiedname
.- Parameters:
name
- the name of the property- Returns:
- the property with the specified
name
-
getProperties
Returns the properties.- Returns:
- the properties
-
toString
-
setConfiguration
Configures aPropertyModule
with an XMLNode
.- Parameters:
node
- the configuration as XML node- See Also:
-
getConfiguration
Returns the configuration of thePropertyModule
as XMLNode
.- Parameters:
document
- the XML document- Returns:
- the configuration as XML node
- See Also:
-
clone
-
compareTo
- Specified by:
compareTo
in interfaceComparable<PropertyModule>
-
hashCode
public int hashCode() -
equals
-