Class FilterSupport

java.lang.Object
net.solarnetwork.central.support.BaseFilterSupport
net.solarnetwork.central.support.FilterSupport
All Implemented Interfaces:
Serializable, Filter, MetadataFilter, SolarNodeFilter, SolarNodeMetadataFilter, TagFilter
Direct Known Subclasses:
UserFilterCommand

public class FilterSupport extends BaseFilterSupport implements SolarNodeFilter, SolarNodeMetadataFilter
Supporting base class for Filter implementations.
Since:
1.32
See Also:
  • Constructor Details

    • FilterSupport

      public FilterSupport()
  • Method Details

    • getFilter

      public Map<String,?> getFilter()
      Description copied from interface: Filter
      Get a mapping of filter keys and associated filter values.
      Specified by:
      getFilter in interface Filter
      Overrides:
      getFilter in class BaseFilterSupport
      Returns:
      a filter map
    • toString

      public String toString()
      Overrides:
      toString in class BaseFilterSupport
    • setNodeId

      public void setNodeId(Long nodeId)
      Set a single node ID.

      This is a convenience method for requests that use a single node ID at a time. The node ID is still stored on the nodeIds array, just as the first value. Calling this method replaces any existing nodeIds value with a new array containing just the ID passed into this method.

      Parameters:
      nodeId - the ID of the node
    • getNodeId

      public Long getNodeId()
      Description copied from interface: SolarNodeFilter
      Get the first node ID.

      This returns the first available node ID from the SolarNodeFilter.getNodeIds() array, or null if not available.

      Specified by:
      getNodeId in interface SolarNodeFilter
      Specified by:
      getNodeId in interface SolarNodeMetadataFilter
      Returns:
      the node ID, or null if not available
    • getNodeIds

      public Long[] getNodeIds()
      Description copied from interface: SolarNodeFilter
      Get an array of node IDs.
      Specified by:
      getNodeIds in interface SolarNodeFilter
      Specified by:
      getNodeIds in interface SolarNodeMetadataFilter
      Returns:
      array of node IDs (may be null)
    • setNodeIds

      public void setNodeIds(Long[] nodeIds)
      Set a list of node IDs to filter on.
      Parameters:
      nodeIds - The nodeIds IDs to filter on.
    • setSourceId

      public void setSourceId(String sourceId)
      Set a single source ID.

      This is a convenience method for requests that use a single source ID at a time. The source ID is still stored on the sourceIds array, just as the first value. Calling this method replaces any existing sourceIds value with a new array containing just the ID passed into this method.

      Parameters:
      sourceId - the source ID
    • getSourceId

      public String getSourceId()
      Get the first source ID.

      This returns the first available source ID from the sourceIds array, or null if not available.

      Returns:
      the first source ID, or null
    • getSourceIds

      public String[] getSourceIds()
      Get all source IDs to filter on.
      Returns:
      The source IDs, or null.
    • setSourceIds

      public void setSourceIds(String[] sourceIds)
      Set a list of source IDs to filter on.
      Parameters:
      sourceIds - The source IDs to filter on.
    • setLocationId

      public void setLocationId(Long locationId)
      Set a single location ID.

      This is a convenience method for requests that use a single location ID at a time. The location ID is still stored on the locationIds array, just as the first value. Calling this method replaces any existing locationIds value with a new array containing just the ID passed into this method.

      Parameters:
      locationId - the ID of the location
    • getLocationId

      public Long getLocationId()
      Get the first location ID. This returns the first available location ID from the locationIds array, or null if not available.
      Returns:
      the first location ID, or null
    • getLocationIds

      public Long[] getLocationIds()
      Get all location IDs to filter on.
      Returns:
      The location IDs, or null.
    • setLocationIds

      public void setLocationIds(Long[] locationIds)
      Set a list of location IDs to filter on.
      Parameters:
      locationIds - The location IDs to filter on.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class BaseFilterSupport
      Since:
      1.1
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class BaseFilterSupport
      Since:
      1.1