Package net.solarnetwork.domain.datum
Interface DatumSamplesOperations
- All Superinterfaces:
Differentiable<DatumSamplesOperations>
- All Known Subinterfaces:
MutableDatumSamplesOperations
- All Known Implementing Classes:
DatumSamples,GeneralDatum,MapSampleOperations
API for accessing general datum sample property values.
- Since:
- 2.0
- Version:
- 1.0
- Author:
- matt
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanTest if this object differs from another.<V> VfindSampleValue(String key) Find a sample value.getSampleBigDecimal(DatumSamplesType type, String key) Get a BigDecimal value from a sample map, or null if not available.Get specific sample data.getSampleDouble(DatumSamplesType type, String key) Get a Double value from a sample map, or null if not available.getSampleFloat(DatumSamplesType type, String key) Get a Float value from a sample map, or null if not available.getSampleInteger(DatumSamplesType type, String key) Get an Integer value from a sample map, or null if not available.getSampleLong(DatumSamplesType type, String key) Get a Long value from a sample map, or null if not available.getSampleString(DatumSamplesType type, String key) Get a String value from a sample map, or null if not available.<V> VgetSampleValue(DatumSamplesType type, String key) Get a sample value.getTags()Get the sample tags.booleanhasSampleValue(String key) Test is a sample value is present for a given key.booleanhasSampleValue(DatumSamplesType type, String key) Test is a sample value is present for a given key.default booleanTest if a given tag is set.default booleanisEmpty()Test if there are any properties available.
-
Method Details
-
getSampleData
Get specific sample data.- Parameters:
type- the type of sample data to get- Returns:
- a map with the specific sample data, or null
- Throws:
IllegalArgumentException- iftypeis not supported
-
getSampleInteger
Get an Integer value from a sample map, or null if not available.- Parameters:
type- the type of sample data to getkey- the key of the value to get- Returns:
- the value as an Integer, or null if not available
-
getSampleLong
Get a Long value from a sample map, or null if not available.- Parameters:
type- the type of sample data to getkey- the key of the value to get- Returns:
- the value as an Long, or null if not available
-
getSampleFloat
Get a Float value from a sample map, or null if not available.- Parameters:
type- the type of sample data to getkey- the key of the value to get- Returns:
- the value as an Float, or null if not available
-
getSampleDouble
Get a Double value from a sample map, or null if not available.- Parameters:
type- the type of sample data to getkey- the key of the value to get- Returns:
- the value as an Double, or null if not available
-
getSampleBigDecimal
Get a BigDecimal value from a sample map, or null if not available.- Parameters:
type- the type of sample data to getkey- the key of the value to get- Returns:
- the value as an BigDecimal, or null if not available
-
getSampleString
Get a String value from a sample map, or null if not available.If
typeisDatumSamplesType.Tag, then this method will returnkeyif a tag by that name exists and otherwise it will return null.- Parameters:
type- the type of sample data to getkey- the key of the value, or tag name, to get- Returns:
- the value as an String, or null if not available
-
getSampleValue
Get a sample value.If
typeisDatumSamplesType.Tag, then this method will returnkeyif a tag by that name exists and otherwise it will return null.- Type Parameters:
V- the expected value type- Parameters:
type- the type of sample data to getkey- the key of the value, or tag name, to get- Returns:
- the value cast as a
V, or null if not available
-
hasSampleValue
Test is a sample value is present for a given key.Tags can be tested for as well by passing
DatumSamplesType.Tagand the tag name askey.- Parameters:
type- the type of sample data to testkey- the key of the value, or name of the tag, to look for- Returns:
- true if a value is present for the given key
-
findSampleValue
Find a sample value.This will search
Instantaneous,Accumulating, andStatusdata types, in that order, and return the first non-null value found.- Type Parameters:
V- the expected value type- Parameters:
key- the key of the value, or tag name, to get- Returns:
- the value cast as a
V, or null if not available
-
hasSampleValue
Test is a sample value is present for a given key.This will search
Instantaneous,Accumulating, andStatusdata types, in that order, and return the first non-null value found.- Parameters:
key- the key of the value, or name of the tag, to look for- Returns:
- true if a value is present for the given key
-
getTags
Get the sample tags.- Returns:
- the tags, or null
-
hasTag
Test if a given tag is set.- Parameters:
tag- the tag to look for- Returns:
- true if the given tag has been set on this instance
-
isEmpty
default boolean isEmpty()Test if there are any properties available.- Returns:
- true if there is at least one non-null property or tag available
-
differsFrom
Description copied from interface:DifferentiableTest if this object differs from another.- Specified by:
differsFromin interfaceDifferentiable<DatumSamplesOperations>- Parameters:
other- the other object to compare to- Returns:
- true if the object differs from this object
-