Class DatumSupport

java.lang.Object
net.solarnetwork.domain.datum.DatumSupport
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AggregateDatumSamples, DatumSamples, GeneralDatumMetadata

public abstract class DatumSupport extends Object implements Serializable
Supporting abstract class for general node datum related objects.
Version:
2.0
Author:
matt
See Also:
  • Constructor Details

    • DatumSupport

      public DatumSupport()
      Constructor.
    • DatumSupport

      public DatumSupport(DatumSamplesOperations other)
      Copy constructor.
      Parameters:
      other - the other instance to copy
      Since:
      1.1
  • Method Details

    • clear

      public void clear()
      Remove all data values.
    • getMapString

      protected String getMapString(String key, Map<String,?> map)
      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 get
      map - the map to inspect, null is allowed
      Returns:
      the value, or null if not found
    • getMapInteger

      protected Integer getMapInteger(String key, Map<String,?> map)
      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 get
      map - the map to inspect, null is allowed
      Returns:
      the value, or null if not found
    • getMapLong

      protected Long getMapLong(String key, Map<String,?> map)
      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 get
      map - the map to inspect, null is allowed
      Returns:
      the value, or null if not found
    • getMapFloat

      protected Float getMapFloat(String key, Map<String,?> map)
      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 get
      map - the map to inspect, null is allowed
      Returns:
      the value, or null if not found
    • getMapDouble

      protected Double getMapDouble(String key, Map<String,?> map)
      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 get
      map - the map to inspect, null is allowed
      Returns:
      the value, or null if not found
    • getMapBigDecimal

      protected BigDecimal getMapBigDecimal(String key, Map<String,?> map)
      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 and BigDecimal(String) will be returned.
      Parameters:
      key - the key of the object to get
      map - the map to inspect, null is allowed
      Returns:
      the value, or null if not found
    • getTags

      public Set<String> getTags()
      Get an array of tags.
      Returns:
      array of tags
    • setTags

      public void setTags(Set<String> tags)
    • getT

      public Set<String> getT()
      Shortcut for getTags().
      Returns:
      map
    • setT

      public void setT(Set<String> set)
    • hasTag

      public boolean hasTag(String tag)
      Return true if tags contains tag.
      Parameters:
      tag - the tag value to test for existence
      Returns:
      true if the tag is present
    • addTag

      public boolean addTag(String tag)
      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

      public boolean removeTag(String tag)
      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