Package org.onosproject.cfg
Class ConfigProperty
- java.lang.Object
-
- org.onosproject.cfg.ConfigProperty
-
public final class ConfigProperty extends Object
Component configuration property.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConfigProperty.TypeRepresentation of the type of property value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanasBoolean()Returns the property value as a boolean.byteasByte()Returns the property value as a byte.doubleasDouble()Returns the property value as a double.floatasFloat()Returns the property value as a float.intasInteger()Returns the property value as an integer.longasLong()Returns the property value as a long.StringasString()Returns the property value as a string.StringdefaultValue()Returns the property default value as a string.static ConfigPropertydefineProperty(String name, ConfigProperty.Type type, String defaultValue, String description)Creates a new configuration property with its default value.Stringdescription()Returns the property description.booleanequals(Object obj)Equality is considered only on the basis of property name.inthashCode()booleanisSet()Indicates whether the property is set or whether it assumes its default value.Stringname()Returns the property name.static ConfigPropertyresetProperty(ConfigProperty property)Creates a new configuration property as a copy of an existing one, but without a specific value, thus making it take its default value.static ConfigPropertysetProperty(ConfigProperty property, String newValue)Creates a new configuration property as a copy of an existing one, but with a new value.StringtoString()ConfigProperty.Typetype()Returns the property type.Stringvalue()Returns the property value as a string.
-
-
-
Method Detail
-
defineProperty
public static ConfigProperty defineProperty(String name, ConfigProperty.Type type, String defaultValue, String description)
Creates a new configuration property with its default value.- Parameters:
name- property nametype- value typedefaultValue- default value as a stringdescription- property description- Returns:
- newly defined property
-
setProperty
public static ConfigProperty setProperty(ConfigProperty property, String newValue)
Creates a new configuration property as a copy of an existing one, but with a new value.- Parameters:
property- property to be changednewValue- new value as a string- Returns:
- newly updated property
-
resetProperty
public static ConfigProperty resetProperty(ConfigProperty property)
Creates a new configuration property as a copy of an existing one, but without a specific value, thus making it take its default value.- Parameters:
property- property to be reset- Returns:
- newly reset property
-
name
public String name()
Returns the property name.- Returns:
- property name
-
type
public ConfigProperty.Type type()
Returns the property type.- Returns:
- property type
-
description
public String description()
Returns the property description.- Returns:
- string value
-
defaultValue
public String defaultValue()
Returns the property default value as a string.- Returns:
- string default value
-
value
public String value()
Returns the property value as a string.- Returns:
- string value
-
isSet
public boolean isSet()
Indicates whether the property is set or whether it assumes its default value.- Returns:
- true if the property is set
-
asString
public String asString()
Returns the property value as a string.- Returns:
- string value
-
asByte
public byte asByte()
Returns the property value as a byte.- Returns:
- byte value
-
asInteger
public int asInteger()
Returns the property value as an integer.- Returns:
- integer value
-
asLong
public long asLong()
Returns the property value as a long.- Returns:
- long value
-
asFloat
public float asFloat()
Returns the property value as a float.- Returns:
- float value
-
asDouble
public double asDouble()
Returns the property value as a double.- Returns:
- double value
-
asBoolean
public boolean asBoolean()
Returns the property value as a boolean.- Returns:
- string value
-
equals
public boolean equals(Object obj)
Equality is considered only on the basis of property name.
-
-