Class BasicCoreCriteria

java.lang.Object
net.solarnetwork.domain.SimplePagination
net.solarnetwork.central.common.dao.BasicCoreCriteria
All Implemented Interfaces:
Cloneable, EnabledCriteria, LocationCriteria, NodeCriteria, NodeOwnershipCriteria, SearchFilterCriteria, SecurityTokenCriteria, SourceCriteria, UserCriteria, UserModifiableFilter, net.solarnetwork.dao.PaginationCriteria
Direct Known Subclasses:
BasicLocationRequestCriteria, BasicUserEventFilter, BasicUserMetadataFilter

public class BasicCoreCriteria extends net.solarnetwork.domain.SimplePagination implements UserModifiableFilter, net.solarnetwork.dao.PaginationCriteria, LocationCriteria, NodeCriteria, SourceCriteria, UserCriteria, SecurityTokenCriteria, SearchFilterCriteria, EnabledCriteria, NodeOwnershipCriteria
Basic implementation of some core criteria APIs.
  • Constructor Details

    • BasicCoreCriteria

      public BasicCoreCriteria()
      Default constructor.
    • BasicCoreCriteria

      public BasicCoreCriteria(net.solarnetwork.dao.PaginationCriteria criteria)
      Copy constructor.
  • Method Details

    • clone

      public BasicCoreCriteria clone()
      Overrides:
      clone in class net.solarnetwork.domain.SimplePagination
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class net.solarnetwork.domain.SimplePagination
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class net.solarnetwork.domain.SimplePagination
    • copyFrom

      public void copyFrom(net.solarnetwork.dao.PaginationCriteria criteria)
      Copy the properties of another criteria into this instance.

      This method will test for conformance to all the various criteria interfaces implemented by this class, and copy those properties as well.

      Parameters:
      criteria - the criteria to copy
    • 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, 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()
      Description copied from interface: LocationCriteria
      Get the first location ID.

      This returns the first available location ID from the LocationCriteria.getLocationIds() array, or null if not available.

      Specified by:
      getLocationId in interface LocationCriteria
      Returns:
      the location ID, or null if not available
    • getLocationIds

      public Long[] getLocationIds()
      Description copied from interface: LocationCriteria
      Get an array of location IDs.
      Specified by:
      getLocationIds in interface LocationCriteria
      Returns:
      array of locations IDs (may be null)
    • setLocationIds

      public void setLocationIds(Long[] locationIds)
      Set the location IDs.
      Parameters:
      locationIds - the location IDs to set
    • 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, 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: NodeCriteria
      Get the first node ID.

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

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

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

      public void setNodeIds(Long[] nodeIds)
      Set the node IDs.
      Parameters:
      nodeIds - the nodeIds to set
    • 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, 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()
      Description copied from interface: SourceCriteria
      Get the first source ID.

      This returns the first available source ID from the SourceCriteria.getSourceIds() array, or null if not available.

      Specified by:
      getSourceId in interface SourceCriteria
      Returns:
      the first source ID, or null if not available
    • getSourceIds

      public String[] getSourceIds()
      Description copied from interface: SourceCriteria
      Get an array of source IDs.
      Specified by:
      getSourceIds in interface SourceCriteria
      Returns:
      array of source IDs (may be null)
    • setSourceIds

      public void setSourceIds(String[] sourceIds)
      Set the source IDs.
      Parameters:
      sourceIds - the sourceIds to set
    • 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()
      Description copied from interface: UserCriteria
      Get the first user ID.

      This returns the first available user ID from the UserCriteria.getUserIds() array, or null if not available.

      Specified by:
      getUserId in interface UserCriteria
      Returns:
      the first user ID, or null if not available
    • getUserIds

      public Long[] getUserIds()
      Description copied from interface: UserCriteria
      Get an array of user IDs.
      Specified by:
      getUserIds in interface UserCriteria
      Returns:
      array of user IDs (may be null)
    • setUserIds

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

      public void setTokenId(String tokenId)
      Set a single token ID.

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

      Parameters:
      tokenId - the token ID
    • getTokenId

      public String getTokenId()
      Description copied from interface: SecurityTokenCriteria
      Get the first token ID.

      This returns the first available token ID from the SecurityTokenCriteria.getTokenIds() array, or null if not available.

      Specified by:
      getTokenId in interface SecurityTokenCriteria
      Returns:
      the first token ID, or null if not available
    • getTokenIds

      public String[] getTokenIds()
      Description copied from interface: SecurityTokenCriteria
      Get an array of token IDs.
      Specified by:
      getTokenIds in interface SecurityTokenCriteria
      Returns:
      array of token IDs (may be null)
    • setTokenIds

      public void setTokenIds(String[] tokenIds)
      Set the token IDs.
      Parameters:
      tokenIds - the tokenIds to set
    • getLocation

      public net.solarnetwork.domain.SimpleLocation getLocation()
      Description copied from interface: LocationCriteria
      Get a location to use as geographic criteria.
      Specified by:
      getLocation in interface LocationCriteria
      Returns:
      the location whose properties represent geographic search criteria
    • setLocation

      public void setLocation(net.solarnetwork.domain.SimpleLocation location)
      Set the location geographic criteria.
      Parameters:
      location - the location to set
    • getSearchFilter

      public String getSearchFilter()
      Description copied from interface: SearchFilterCriteria
      Get the search filter.

      The actual syntax of this search filter is not defined by this API, and is implementation and context specific.

      Specified by:
      getSearchFilter in interface SearchFilterCriteria
      Returns:
      the search filter
    • setSearchFilter

      public void setSearchFilter(String searchFilter)
      Set the search filter.
      Parameters:
      searchFilter - the filter to set
    • getOrderBy

      public List<String> getOrderBy()
      Get the order-by list.

      This is derived from the SimplePagination.getSorts() list. The returned list will contain all the SortDescriptor.getSortKey() values. Any descriptor where SortDescriptor.isDescending() returns true will cause a ~ character to be added to the end of the associated sort key value.

      Returns:
      the order-by list
      Since:
      1.2
    • setOrderBy

      public void setOrderBy(List<String> orderBys)
      Set the order-by list.

      This creates the SimplePagination.getSorts() list. The values of the orderBys list represent the sort descriptor key values. If the value ends with a ~ character the descriptor will be set to descending order.

      Parameters:
      orderBys - the order-by list
      Since:
      1.2
      See Also:
    • getEnabled

      public Boolean getEnabled()
      Description copied from interface: EnabledCriteria
      Get the enabled flag.
      Specified by:
      getEnabled in interface EnabledCriteria
      Returns:
      the true or false to filter by that state, or null to not filter
    • setEnabled

      public void setEnabled(Boolean enabled)
      Set the enabled flag.
      Parameters:
      enabled - the enabled to set
      Since:
      1.3
    • getValidNodeOwnership

      public Boolean getValidNodeOwnership()
      Description copied from interface: NodeOwnershipCriteria
      Get the valid node ownership flag.

      This flag, when true, indicates a desire to filter the results to only the set of nodes actually owned by the users specified with the data. For example, a table might have a node ID column that is not a foreign key to the user_node mapping table, so there is no guarantee the record's node ID is actually owned by that record's account owner.

      Specified by:
      getValidNodeOwnership in interface NodeOwnershipCriteria
      Returns:
      the true or false to filter by that state, or null to not filter
    • setValidNodeOwnership

      public void setValidNodeOwnership(Boolean validNodeOwnership)
      Set the valid node ownership flag.
      Parameters:
      validNodeOwnership - the flag to set
      Since:
      1.3