Package org.onosproject.cfg
Class ConfigProperty
- java.lang.Object
- 
- org.onosproject.cfg.ConfigProperty
 
- 
 public final class ConfigProperty extends java.lang.ObjectComponent configuration property.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classConfigProperty.TypeRepresentation of the type of property value.
 - 
Method SummaryAll 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.java.lang.StringasString()Returns the property value as a string.java.lang.StringdefaultValue()Returns the property default value as a string.static ConfigPropertydefineProperty(java.lang.String name, ConfigProperty.Type type, java.lang.String defaultValue, java.lang.String description)Creates a new configuration property with its default value.java.lang.Stringdescription()Returns the property description.booleanequals(java.lang.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.java.lang.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, java.lang.String newValue)Creates a new configuration property as a copy of an existing one, but with a new value.java.lang.StringtoString()ConfigProperty.Typetype()Returns the property type.java.lang.Stringvalue()Returns the property value as a string.
 
- 
- 
- 
Method Detail- 
definePropertypublic static ConfigProperty defineProperty(java.lang.String name, ConfigProperty.Type type, java.lang.String defaultValue, java.lang.String description) Creates a new configuration property with its default value.- Parameters:
- name- property name
- type- value type
- defaultValue- default value as a string
- description- property description
- Returns:
- newly defined property
 
 - 
setPropertypublic static ConfigProperty setProperty(ConfigProperty property, java.lang.String newValue) Creates a new configuration property as a copy of an existing one, but with a new value.- Parameters:
- property- property to be changed
- newValue- new value as a string
- Returns:
- newly updated property
 
 - 
resetPropertypublic 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
 
 - 
namepublic java.lang.String name() Returns the property name.- Returns:
- property name
 
 - 
typepublic ConfigProperty.Type type() Returns the property type.- Returns:
- property type
 
 - 
descriptionpublic java.lang.String description() Returns the property description.- Returns:
- string value
 
 - 
defaultValuepublic java.lang.String defaultValue() Returns the property default value as a string.- Returns:
- string default value
 
 - 
valuepublic java.lang.String value() Returns the property value as a string.- Returns:
- string value
 
 - 
isSetpublic boolean isSet() Indicates whether the property is set or whether it assumes its default value.- Returns:
- true if the property is set
 
 - 
asStringpublic java.lang.String asString() Returns the property value as a string.- Returns:
- string value
 
 - 
asBytepublic byte asByte() Returns the property value as a byte.- Returns:
- byte value
 
 - 
asIntegerpublic int asInteger() Returns the property value as an integer.- Returns:
- integer value
 
 - 
asLongpublic long asLong() Returns the property value as a long.- Returns:
- long value
 
 - 
asFloatpublic float asFloat() Returns the property value as a float.- Returns:
- float value
 
 - 
asDoublepublic double asDouble() Returns the property value as a double.- Returns:
- double value
 
 - 
asBooleanpublic boolean asBoolean() Returns the property value as a boolean.- Returns:
- string value
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object obj) Equality is considered only on the basis of property name.- Overrides:
- equalsin class- java.lang.Object
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-