Interface EntityPropertyQuery<T extends EntityPropertyQuery<T>>

All Known Subinterfaces:
EntityPropertyQuery.ExecutableQuery

@ExperimentalApi public interface EntityPropertyQuery<T extends EntityPropertyQuery<T>>
A query builder for requests to the JsonEntityPropertyManager.

Notes:

  • Queries must include an entity name or key at the very least.
  • Although it probably doesn't make any sense to do so, searching by the entity ID without the entity name is permitted, as long as the key is specified.
  • Null and blank values are generally not permitted, including for the key prefix search.
  • The offset is ignored unless maxResults is specified, and both are ignored for count queries.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    An EntityPropertyQuery for which sufficient contraints have been provided to make the query valid.
  • Method Summary

    Modifier and Type
    Method
    Description
    entityId(Long entityId)
    Restricts the search by the entity ID.
    entityName(String entityName)
    Restricts the search by the entity name, which can neither be null nor blank.
    key(String key)
    Restricts the search to the given property key, which can neither be null nor blank.
    keyPrefix(String keyPrefix)
    Restricts the search to the given property key prefix, which can neither be null nor blank.
    maxResults(int maxResults)
    The maximum number of results to return.
    offset(int offset)
    The offset into the result list at which to begin.
  • Method Details

    • entityName

      EntityPropertyQuery.ExecutableQuery entityName(@Nonnull String entityName)
      Restricts the search by the entity name, which can neither be null nor blank. If this is not specified, then the key is required.
      Parameters:
      entityName - the entity name; must not be null or blank
      Returns:
      this query, as an EntityPropertyQuery.ExecutableQuery, since specifying the entityName is sufficient to form a valid query
      Throws:
      IllegalArgumentException - if entityName is null or blank
    • key

      Restricts the search to the given property key, which can neither be null nor blank. If this is not specified, then the entity name is required. This restriction is not compatible with a key prefix restriction.
      Parameters:
      key - the property key
      Returns:
      this query, as an EntityPropertyQuery.ExecutableQuery, since specifying the key is sufficient to form a valid query
      Throws:
      IllegalArgumentException - if key is null or blank
      IllegalStateException - if keyPrefix(String) has already been specified
    • entityId

      T entityId(@Nonnull Long entityId)
      Restricts the search by the entity ID. This may be specified without specifying the entity name (so long as the key has been provided), but doing so probably does not make any sense.
      Parameters:
      entityId - the entity ID
      Returns:
      this query
      Throws:
      IllegalArgumentException - if entityId is null
    • keyPrefix

      T keyPrefix(@Nonnull String keyPrefix)
      Restricts the search to the given property key prefix, which can neither be null nor blank. The entity name is required to use this restriction, which is not compatible with a key restriction.
      Parameters:
      keyPrefix - the property key prefix
      Returns:
      this query
      Throws:
      IllegalArgumentException - if keyPrefix is null or blank
      IllegalStateException - if key(String) has already been specified
    • offset

      T offset(int offset)
      The offset into the result list at which to begin. You must also specify max results to use this feature.
      Parameters:
      offset - the (0-based) index offset into the complete results. Nonsensical values like -42 are silently ignored.
      Returns:
      this query
    • maxResults

      T maxResults(int maxResults)
      The maximum number of results to return. You must specify this value to use an offset.
      Parameters:
      maxResults - the maximum results to return. Nonsensical values like -42 are silently ignored.
      Returns:
      this query