1 // Copyright 2012 Google Inc. All Rights Reserved.
3 package com
.google
.appengine
.api
.datastore
;
5 import com
.google
.storage
.onestore
.v3
.OnestoreEntity
.Index
.Property
;
10 * An interface that represents a collection of index constraints. It can validate
11 * if an index satisfies the constraints.
14 interface IndexComponent
{
17 * Given a list of index {@link Property}s, returns true if the index matches the
18 * constraints given by the {@link IndexComponent}.
20 * @param indexProperties the index properties to match against
21 * @return true if the index satisfies the component
23 boolean matches(List
<Property
> indexProperties
);
26 * Returns the list of {@link Property}s that best satisfy this index component.
28 List
<Property
> preferredIndexProperties();
31 * Returns the number of index constraints in this component.
33 * If a {@code List<Property>} satisfies this {@link IndexComponent}, and thus
34 * {@link IndexComponent#matches} returns true, the number of properties
35 * satisfied will be equal to the size of the {@link IndexComponent}.
37 * @return the number of index constraints.