Package net.solarnetwork.domain.datum
Class DatumSupport
java.lang.Object
net.solarnetwork.domain.datum.DatumSupport
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AggregateDatumSamples,DatumSamples,GeneralDatumMetadata
Supporting abstract class for general node datum related objects.
- Version:
- 2.0
- Author:
- matt
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd a tag value.voidclear()Remove all data values.protected BigDecimalgetMapBigDecimal(String key, Map<String, ?> map) Get a BigDecimal value out of a Map.protected DoublegetMapDouble(String key, Map<String, ?> map) Get a Double value out of a Map.protected FloatgetMapFloat(String key, Map<String, ?> map) Get a Float value out of a Map.protected IntegergetMapInteger(String key, Map<String, ?> map) Get an Integer value out of a Map.protected LonggetMapLong(String key, Map<String, ?> map) Get a Long value out of a Map.protected StringgetMapString(String key, Map<String, ?> map) Get a String value out of a Map.getT()Shortcut forgetTags().getTags()Get an array of tags.booleanReturn true iftagscontainstag.booleanRemove a tag value.voidvoid
-
Constructor Details
-
DatumSupport
public DatumSupport()Constructor. -
DatumSupport
Copy constructor.- Parameters:
other- the other instance to copy- Since:
- 1.1
-
-
Method Details
-
clear
public void clear()Remove all data values. -
getMapString
Get a String value out of a Map. If the key exists but is not a String,Object.toString()will be called on that object.- Parameters:
key- the key of the object to getmap- the map to inspect, null is allowed- Returns:
- the value, or null if not found
-
getMapInteger
Get an Integer value out of a Map. If the key exists, is not an Integer, but is a Number,Number.intValue()will be called on that object.- Parameters:
key- the key of the object to getmap- the map to inspect, null is allowed- Returns:
- the value, or null if not found
-
getMapLong
Get a Long value out of a Map. If the key exists, is not a Long, but is a Number,Number.longValue()will be called on that object.- Parameters:
key- the key of the object to getmap- the map to inspect, null is allowed- Returns:
- the value, or null if not found
-
getMapFloat
Get a Float value out of a Map. If the key exists, is not a Float, but is a Number,Number.floatValue()will be called on that object.- Parameters:
key- the key of the object to getmap- the map to inspect, null is allowed- Returns:
- the value, or null if not found
-
getMapDouble
Get a Double value out of a Map. If the key exists, is not a Double, but is a Number,Number.doubleValue()will be called on that object.- Parameters:
key- the key of the object to getmap- the map to inspect, null is allowed- Returns:
- the value, or null if not found
-
getMapBigDecimal
Get a BigDecimal value out of a Map. If the key exists but is not a BigDecimal,Object.toString()will be called on that object andBigDecimal(String)will be returned.- Parameters:
key- the key of the object to getmap- the map to inspect, null is allowed- Returns:
- the value, or null if not found
-
getTags
Get an array of tags.- Returns:
- array of tags
-
setTags
-
getT
Shortcut forgetTags().- Returns:
- map
-
setT
-
hasTag
Return true iftagscontainstag.- Parameters:
tag- the tag value to test for existence- Returns:
- true if the tag is present
-
addTag
Add a tag value.- Parameters:
tag- the tag value to add- Returns:
- true if the tag was added, or false if the tag was already present
-
removeTag
Remove a tag value.- Parameters:
tag- the tag value to add- Returns:
- true if the tag was removed, or false if the tag was not present
-