Package com.deviceatlas
Class Property
java.lang.Object
com.deviceatlas.Property
Contains a property value. The value can be fetched as a generic Object or
one of the convenience methods can be used to get the value in a
specific type.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the value of the property as a boolean.intGet the value of the property as an int.Set<?>asSet()Gets a set of possible values for this property.asString()Get the value of the property as a String.booleanCheck if another object is equal to this object.Get the data type name for values associated with this PropertybyteGet the data type ID for values associated with this PropertyinthashCode()toString()Get the value of the property as a String.value()Get the value Object.
-
Method Details
-
getDataTypeId
public byte getDataTypeId()Get the data type ID for values associated with this Property- Returns:
- The ID of the data type
-
getDataType
Get the data type name for values associated with this Property- Returns:
- The name of the data type
-
value
Get the value Object. This needs to be cast to the appropriate type such as Integer to be used. E.g. Integer value = (Integer)property.value();- Returns:
- The raw Object value.
-
toString
Get the value of the property as a String. Alias for asString() . If a property has multiple possible values then the values are concatenated with a comma. -
asString
Get the value of the property as a String. Alias for toString() .- Returns:
- The String value of the property
-
asBoolean
Get the value of the property as a boolean.- Returns:
- The boolean value of the property
- Throws:
IncorrectPropertyTypeException- Thrown if the type of the value is not a DataType.BOOLEAN
-
asInteger
Get the value of the property as an int.- Returns:
- The integer value of the property.
- Throws:
IncorrectPropertyTypeException- Thrown if the type of the value is not compatible with a DataType.INTEGER
-
asSet
Gets a set of possible values for this property. This is typically only used when it is known that a given property name can have multiple possible values. All items in the set will have the same data type.- Returns:
- A set of values.
-
equals
Check if another object is equal to this object. It must have the same interface, data type and value. -
hashCode
public int hashCode()
-