public class BooleanData extends FunctionData
BooleanControl
,
BooleanSensor
,
FunctionData
Modifier and Type | Field and Description |
---|---|
static String |
FIELD_VALUE
Represents the value field name.
|
DESCRIPTION, FIELD_METADATA, FIELD_TIMESTAMP
Constructor and Description |
---|
BooleanData(long timestamp,
Map<String,?> metadata,
boolean value)
Constructs new
BooleanData instance with the specified arguments. |
BooleanData(Map<String,?> fields)
Constructs new
BooleanData instance with the specified field
values. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object o)
Compares this
BooleanData instance with the given argument. |
boolean |
equals(Object o)
Two
BooleanData instances are equal if they contain equal
metadata, timestamp and boolean value. |
boolean |
getValue()
Returns
BooleanData value. |
int |
hashCode()
Returns the hash code for this
BooleanData object. |
String |
toString()
Returns the string representation of this boolean data.
|
getMetadata, getTimestamp
public static final String FIELD_VALUE
getValue()
. The field type is boolean
. The constant can
be used as a key to BooleanData(Map)
.public BooleanData(Map<String,?> fields)
BooleanData
instance with the specified field
values. The map keys must match to the field names. The map values will
be assigned to the appropriate class fields. For example, the maps can
be: {"value"=Boolean(true)...}. That map will initialize the
FIELD_VALUE
field with true
.
FIELD_VALUE
- mandatory field. The value type must be
Boolean
.
fields
- Contains the new BooleanData
instance field values.ClassCastException
- If the field value types are not expected.IllegalArgumentException
- If the value is missing.NullPointerException
- If the fields map is null
.public BooleanData(long timestamp, Map<String,?> metadata, boolean value)
BooleanData
instance with the specified arguments.timestamp
- The boolean data timestamp optional field.metadata
- The boolean data metadata optional field.value
- The boolean value mandatory field.public boolean getValue()
BooleanData
value.BooleanData
value.public boolean equals(Object o)
BooleanData
instances are equal if they contain equal
metadata, timestamp and boolean value.equals
in class FunctionData
o
- The object to compare this data.true
if this object is equivalent to the specified one.FunctionData.equals(java.lang.Object)
public int hashCode()
BooleanData
object. The hash code
is a sum of FunctionData.hashCode()
and
Boolean.hashCode()
, where Boolean.hashCode()
represents
the boolean value hash code.hashCode
in class FunctionData
BooleanData
object.FunctionData.hashCode()
public int compareTo(Object o)
BooleanData
instance with the given argument. If
the argument is not BooleanData
, it throws
ClassCastException
. Otherwise, this method returns:
-1
if this instance field is less than a field of the
specified argument.0
if all fields are equivalent.1
if this instance field is greater than a field of the
specified argument.compareTo
in interface Comparable<Object>
compareTo
in class FunctionData
o
- BooleanData
to be compared.-1
, 0
or 1
depending on the comparison
rules.ClassCastException
- If the method argument is not of type
BooleanData
.Comparable.compareTo(java.lang.Object)
Copyright © Contributors to the Eclipse Foundation Licensed under the Eclipse Foundation Specification License – v1.0