Class BaseFilterSupport

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

public class BaseFilterSupport extends Object implements Filter, Serializable, MetadataFilter, TagFilter
Base common filter support.
Since:
1.2
See Also:
  • Constructor Details

    • BaseFilterSupport

      public BaseFilterSupport()
  • 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
      Returns:
      a filter map
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getTag

      public String getTag()
      Description copied from interface: TagFilter
      Get the first tag.

      This returns the first available tag from the TagFilter.getTags() array, or null if not available.

      Specified by:
      getTag in interface TagFilter
      Returns:
      the first tag, or null if not available
    • setTag

      public void setTag(String tag)
      Set a single tag.

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

      Parameters:
      tag - the tag
    • getTags

      public String[] getTags()
      Description copied from interface: TagFilter
      Get an array of tags.
      Specified by:
      getTags in interface TagFilter
      Returns:
      array of tags (may be null)
    • setTags

      public void setTags(String[] tags)
      Set a list of tags to filter on.
      Parameters:
      tags - the tags to filter on
    • setUserId

      public void setUserId(Long userId)
      Set a single user ID.

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

      Parameters:
      userId - the ID of the user
    • getUserId

      public Long getUserId()
      Get the first user ID.

      This returns the first available user ID from the userIds array, or null if not available.

      Returns:
      the first user ID, or null
    • getUserIds

      public Long[] getUserIds()
      Get all user IDs to filter on.
      Returns:
      The user IDs, or null.
    • setUserIds

      public void setUserIds(Long[] userIds)
      Set a list of user IDs to filter on.
      Parameters:
      userIds - The user IDs to filter on.
    • getMetadataFilter

      public String getMetadataFilter()
      Description copied from interface: MetadataFilter
      Get a metadata search filter, in LDAP search filter syntax.

      The metadata filter must be expressed in LDAP search filter style, using JSON pointer style paths for keys, for example (/m/foo=bar), (t=foo), or (&(&#47;**&#47;foo=bar)(t=special)).

      Specified by:
      getMetadataFilter in interface MetadataFilter
      Returns:
      the metadata filter to use (may be null)
    • setMetadataFilter

      public void setMetadataFilter(String metadataFilter)
      Set a metadata search filter, in LDAP search filter syntax.
      Parameters:
      metadataFilter - the metadata filter to use, or null
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object