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
countqueries.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAnEntityPropertyQueryfor which sufficient contraints have been provided to make the query valid. -
Method Summary
Modifier and TypeMethodDescriptionRestricts the search by the entity ID.entityName(String entityName) Restricts the search by the entity name, which can neither benullnor blank.Restricts the search to the given property key, which can neither benullnor blank.Restricts the search to the given property key prefix, which can neither benullnor 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
Restricts the search by the entity name, which can neither benullnor blank. If this is not specified, then thekeyis required.- Parameters:
entityName- the entity name; must not benullor blank- Returns:
- this query, as an
EntityPropertyQuery.ExecutableQuery, since specifying theentityNameis sufficient to form a valid query - Throws:
IllegalArgumentException- ifentityNameisnullor blank
-
key
Restricts the search to the given property key, which can neither benullnor blank. If this is not specified, then theentity nameis required. This restriction is not compatible with akey prefixrestriction.- Parameters:
key- the property key- Returns:
- this query, as an
EntityPropertyQuery.ExecutableQuery, since specifying thekeyis sufficient to form a valid query - Throws:
IllegalArgumentException- ifkeyisnullor blankIllegalStateException- ifkeyPrefix(String)has already been specified
-
entityId
Restricts the search by the entity ID. This may be specified without specifying the entity name (so long as thekeyhas been provided), but doing so probably does not make any sense.- Parameters:
entityId- the entity ID- Returns:
- this query
- Throws:
IllegalArgumentException- ifentityIdisnull
-
keyPrefix
Restricts the search to the given property key prefix, which can neither benullnor blank. Theentity nameis required to use this restriction, which is not compatible with akeyrestriction.- Parameters:
keyPrefix- the property key prefix- Returns:
- this query
- Throws:
IllegalArgumentException- ifkeyPrefixisnullor blankIllegalStateException- ifkey(String)has already been specified
-
offset
The offset into the result list at which to begin. You must also specifymax resultsto use this feature.- Parameters:
offset- the (0-based) index offset into the complete results. Nonsensical values like-42are silently ignored.- Returns:
- this query
-
maxResults
The maximum number of results to return. You must specify this value to use anoffset.- Parameters:
maxResults- the maximum results to return. Nonsensical values like-42are silently ignored.- Returns:
- this query
-