public abstract class ModuleConfig extends Object
Modifier and Type | Field and Description |
---|---|
protected ModuleId |
mModuleId |
protected List<ModuleProperty> |
mModuleProperties |
Constructor and Description |
---|
ModuleConfig() |
ModuleConfig(ModuleId moduleId) |
Modifier and Type | Method and Description |
---|---|
void |
addModuleProperty(ModuleProperty moduleProperty)
Add a new ModuleProperty to the current list.
|
boolean |
equals(Object other)
Compares the list of module properties as a set.
|
ModuleId |
getModuleId() |
List<ModuleProperty> |
getModuleProperties()
Returns the Properties used for configuring the module.
|
ModuleProperty |
getProperty(String key)
Gets the (first) ModuleProperty object that has been set for a given key.
|
List<String> |
getPropertyValues(String key)
Returns all values that have been set for a given key
|
String |
getSingletonPropertyValue(String key)
Returns the single module property value specified by the key
|
String |
getSingletonPropertyValue(String key,
String defaultValue)
Returns the single module property value specified by the key
|
Boolean |
getSingletonPropertyValueAsBoolean(String key)
Returns the single module property value specified by the key
|
boolean |
getSingletonPropertyValueAsBoolean(String key,
boolean defaultValue)
Returns the single module property value specified by the key
|
Integer |
getSingletonPropertyValueAsInteger(String key) |
Integer |
getSingletonPropertyValueAsInteger(String key,
int defaultValue) |
int |
hashCode() |
boolean |
hasProperty(String key)
Checks if a ModuleProperty exists for a given key.
|
boolean |
hasPropertyValue(String key) |
void |
setModuleId(ModuleId moduleId)
Set the identifier for the module being configured.
|
void |
setModuleProperties(List<ModuleProperty> moduleProperties)
Replace list of module properties with given list.
|
void |
setModulePropertyValues(String key,
String... values)
Sets the property values for the specified property key.
|
String |
toString() |
protected ModuleId mModuleId
protected List<ModuleProperty> mModuleProperties
public ModuleConfig()
public ModuleConfig(ModuleId moduleId)
public ModuleId getModuleId()
public void setModuleId(ModuleId moduleId)
moduleId
- public List<ModuleProperty> getModuleProperties()
public void setModuleProperties(List<ModuleProperty> moduleProperties)
moduleProperties
- list to use instead.public void addModuleProperty(ModuleProperty moduleProperty)
moduleProperty
- to addpublic ModuleProperty getProperty(String key)
key
- public boolean hasProperty(String key)
key
- public boolean hasPropertyValue(String key)
key
- public List<String> getPropertyValues(String key)
key
- public boolean equals(Object other)
public String getSingletonPropertyValue(String key)
key
- IllegalStateException
- if this module property has multiple values.public String getSingletonPropertyValue(String key, String defaultValue)
key
- defaultValue
- IllegalStateException
- if this module property has multiple values.public Boolean getSingletonPropertyValueAsBoolean(String key)
key
- public boolean getSingletonPropertyValueAsBoolean(String key, boolean defaultValue)
key
- defaultValue
- public Integer getSingletonPropertyValueAsInteger(String key)
key
- public Integer getSingletonPropertyValueAsInteger(String key, int defaultValue)
key
- defaultValue
- Copyright © 2007, 2013, Oracle and/or its affiliates. All rights reserved.