Top Description Fields Constructors Methods
org.osgi.service.dal.functions.data

public Class BooleanData

extends FunctionData
Class Inheritance
Imports
java.util.Map, org.osgi.service.dal.FunctionData, org.osgi.service.dal.functions.BooleanControl, .BooleanSensor

Function boolean data wrapper. It can contain a boolean value, timestamp and additional metadata. It doesn't support measurement unit.
See Also
BooleanControl, BooleanSensor, FunctionData

Field Summary

Modifier and TypeField and Description
public static final String
FIELD_VALUE

Represents the value field name.

private final boolean
Inherited from org.osgi.service.dal.FunctionData:
DESCRIPTIONFIELD_METADATAFIELD_TIMESTAMP

Constructor Summary

AccessConstructor and Description
public
BooleanData(Map<String, ?>
Contains the new BooleanData instance field values.
fields
)

Constructs new BooleanData instance with the specified field values.

public
BooleanData(long
The boolean data timestamp optional field.
timestamp
,
Map<String, ?>
The boolean data metadata optional field.
metadata
,
boolean
The boolean value mandatory field.
value
)

Constructs new BooleanData instance with the specified arguments.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

-1, 0 or 1 depending on the comparison rules.
compareTo
(Object
BooleanData to be compared.
o
)

Overrides org.osgi.service.dal.FunctionData.compareTo.

Implements java.lang.Comparable.compareTo.

Compares this BooleanData instance with the given argument.

public boolean

Returns:

true if this object is equivalent to the specified one.
equals
(Object
The object to compare this data.
o
)

Overrides org.osgi.service.dal.FunctionData.equals.

Two BooleanData instances are equal if they contain equal metadata, timestamp and boolean value.

public boolean

Returns:

BooleanData value.
getValue
()

Returns BooleanData value.

public int

Returns:

The hash code of this BooleanData object.
hashCode
()

Overrides org.osgi.service.dal.FunctionData.hashCode.

Returns the hash code for this BooleanData object.

public String

Returns:

The string representation of this boolean data.
toString
()

Overrides java.lang.Object.toString.

Returns the string representation of this boolean data.

Inherited from org.osgi.service.dal.FunctionData:
getMetadatagetTimestamp

Field Detail

FIELD_VALUEback to summary
public static final String FIELD_VALUE

Represents the value field name. The field value is available with getValue(). The field type is boolean . The constant can be used as a key to BooleanData(Map).

valueback to summary
private final boolean value

Constructor Detail

BooleanDataback to summary
public BooleanData(Map<String, ?> fields)

Constructs new 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.

Parameters
fields:Map<String, ?>

Contains the new BooleanData instance field values.

Exceptions
ClassCastException:
If the field value types are not expected.
IllegalArgumentException:
If the value is missing.
NullPointerException:
If the fields map is null.
BooleanDataback to summary
public BooleanData(long timestamp, Map<String, ?> metadata, boolean value)

Constructs new BooleanData instance with the specified arguments.

Parameters
timestamp:long

The boolean data timestamp optional field.

metadata:Map<String, ?>

The boolean data metadata optional field.

value:boolean

The boolean value mandatory field.

Method Detail

compareToback to summary
public int compareTo(Object o)

Overrides org.osgi.service.dal.FunctionData.compareTo.

Implements java.lang.Comparable.compareTo.

Compares this 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.
The fields are compared in this order: timestamp, metadata, value.
Parameters
o:Object

BooleanData to be compared.

Returns:int

-1, 0 or 1 depending on the comparison rules.

Annotations
@Override
Exceptions
ClassCastException:
If the method argument is not of type BooleanData.
See Also
java.lang.Comparable#compareTo(java.lang.Object)
equalsback to summary
public boolean equals(Object o)

Overrides org.osgi.service.dal.FunctionData.equals.

Two BooleanData instances are equal if they contain equal metadata, timestamp and boolean value.

Parameters
o:Object

The object to compare this data.

Returns:boolean

true if this object is equivalent to the specified one.

Annotations
@Override
See Also
org.osgi.service.dal.FunctionData#equals(java.lang.Object)
getValueback to summary
public boolean getValue()

Returns BooleanData value.

Returns:boolean

BooleanData value.

hashCodeback to summary
public int hashCode()

Overrides org.osgi.service.dal.FunctionData.hashCode.

Returns the hash code for this BooleanData object. The hash code is a sum of FunctionData#hashCode() and Boolean#hashCode(), where Boolean#hashCode() represents the boolean value hash code.

Returns:int

The hash code of this BooleanData object.

Annotations
@Override
See Also
org.osgi.service.dal.FunctionData#hashCode()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns the string representation of this boolean data.

Returns:String

The string representation of this boolean data.

Annotations
@Override