Class Query

  • All Implemented Interfaces:
    QueryOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class Query
    extends com.google.protobuf.GeneratedMessageV3
    implements QueryOrBuilder
     A query for entities.
     
    Protobuf type google.datastore.v1.Query
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • getProjectionList

        public List<Projection> getProjectionList()
         The projection to return. Defaults to returning all properties.
         
        repeated .google.datastore.v1.Projection projection = 2;
        Specified by:
        getProjectionList in interface QueryOrBuilder
      • getProjectionCount

        public int getProjectionCount()
         The projection to return. Defaults to returning all properties.
         
        repeated .google.datastore.v1.Projection projection = 2;
        Specified by:
        getProjectionCount in interface QueryOrBuilder
      • getProjection

        public Projection getProjection​(int index)
         The projection to return. Defaults to returning all properties.
         
        repeated .google.datastore.v1.Projection projection = 2;
        Specified by:
        getProjection in interface QueryOrBuilder
      • getProjectionOrBuilder

        public ProjectionOrBuilder getProjectionOrBuilder​(int index)
         The projection to return. Defaults to returning all properties.
         
        repeated .google.datastore.v1.Projection projection = 2;
        Specified by:
        getProjectionOrBuilder in interface QueryOrBuilder
      • getKindList

        public List<KindExpression> getKindList()
         The kinds to query (if empty, returns entities of all kinds).
         Currently at most 1 kind may be specified.
         
        repeated .google.datastore.v1.KindExpression kind = 3;
        Specified by:
        getKindList in interface QueryOrBuilder
      • getKindOrBuilderList

        public List<? extends KindExpressionOrBuilder> getKindOrBuilderList()
         The kinds to query (if empty, returns entities of all kinds).
         Currently at most 1 kind may be specified.
         
        repeated .google.datastore.v1.KindExpression kind = 3;
        Specified by:
        getKindOrBuilderList in interface QueryOrBuilder
      • getKindCount

        public int getKindCount()
         The kinds to query (if empty, returns entities of all kinds).
         Currently at most 1 kind may be specified.
         
        repeated .google.datastore.v1.KindExpression kind = 3;
        Specified by:
        getKindCount in interface QueryOrBuilder
      • getKind

        public KindExpression getKind​(int index)
         The kinds to query (if empty, returns entities of all kinds).
         Currently at most 1 kind may be specified.
         
        repeated .google.datastore.v1.KindExpression kind = 3;
        Specified by:
        getKind in interface QueryOrBuilder
      • getKindOrBuilder

        public KindExpressionOrBuilder getKindOrBuilder​(int index)
         The kinds to query (if empty, returns entities of all kinds).
         Currently at most 1 kind may be specified.
         
        repeated .google.datastore.v1.KindExpression kind = 3;
        Specified by:
        getKindOrBuilder in interface QueryOrBuilder
      • hasFilter

        public boolean hasFilter()
         The filter to apply.
         
        .google.datastore.v1.Filter filter = 4;
        Specified by:
        hasFilter in interface QueryOrBuilder
        Returns:
        Whether the filter field is set.
      • getFilter

        public Filter getFilter()
         The filter to apply.
         
        .google.datastore.v1.Filter filter = 4;
        Specified by:
        getFilter in interface QueryOrBuilder
        Returns:
        The filter.
      • getOrderList

        public List<PropertyOrder> getOrderList()
         The order to apply to the query results (if empty, order is unspecified).
         
        repeated .google.datastore.v1.PropertyOrder order = 5;
        Specified by:
        getOrderList in interface QueryOrBuilder
      • getOrderCount

        public int getOrderCount()
         The order to apply to the query results (if empty, order is unspecified).
         
        repeated .google.datastore.v1.PropertyOrder order = 5;
        Specified by:
        getOrderCount in interface QueryOrBuilder
      • getOrder

        public PropertyOrder getOrder​(int index)
         The order to apply to the query results (if empty, order is unspecified).
         
        repeated .google.datastore.v1.PropertyOrder order = 5;
        Specified by:
        getOrder in interface QueryOrBuilder
      • getOrderOrBuilder

        public PropertyOrderOrBuilder getOrderOrBuilder​(int index)
         The order to apply to the query results (if empty, order is unspecified).
         
        repeated .google.datastore.v1.PropertyOrder order = 5;
        Specified by:
        getOrderOrBuilder in interface QueryOrBuilder
      • getDistinctOnList

        public List<PropertyReference> getDistinctOnList()
         The properties to make distinct. The query results will contain the first
         result for each distinct combination of values for the given properties
         (if empty, all results are returned).
        
         Requires:
        
         * If `order` is specified, the set of distinct on properties must appear
         before the non-distinct on properties in `order`.
         
        repeated .google.datastore.v1.PropertyReference distinct_on = 6;
        Specified by:
        getDistinctOnList in interface QueryOrBuilder
      • getDistinctOnOrBuilderList

        public List<? extends PropertyReferenceOrBuilder> getDistinctOnOrBuilderList()
         The properties to make distinct. The query results will contain the first
         result for each distinct combination of values for the given properties
         (if empty, all results are returned).
        
         Requires:
        
         * If `order` is specified, the set of distinct on properties must appear
         before the non-distinct on properties in `order`.
         
        repeated .google.datastore.v1.PropertyReference distinct_on = 6;
        Specified by:
        getDistinctOnOrBuilderList in interface QueryOrBuilder
      • getDistinctOnCount

        public int getDistinctOnCount()
         The properties to make distinct. The query results will contain the first
         result for each distinct combination of values for the given properties
         (if empty, all results are returned).
        
         Requires:
        
         * If `order` is specified, the set of distinct on properties must appear
         before the non-distinct on properties in `order`.
         
        repeated .google.datastore.v1.PropertyReference distinct_on = 6;
        Specified by:
        getDistinctOnCount in interface QueryOrBuilder
      • getDistinctOn

        public PropertyReference getDistinctOn​(int index)
         The properties to make distinct. The query results will contain the first
         result for each distinct combination of values for the given properties
         (if empty, all results are returned).
        
         Requires:
        
         * If `order` is specified, the set of distinct on properties must appear
         before the non-distinct on properties in `order`.
         
        repeated .google.datastore.v1.PropertyReference distinct_on = 6;
        Specified by:
        getDistinctOn in interface QueryOrBuilder
      • getDistinctOnOrBuilder

        public PropertyReferenceOrBuilder getDistinctOnOrBuilder​(int index)
         The properties to make distinct. The query results will contain the first
         result for each distinct combination of values for the given properties
         (if empty, all results are returned).
        
         Requires:
        
         * If `order` is specified, the set of distinct on properties must appear
         before the non-distinct on properties in `order`.
         
        repeated .google.datastore.v1.PropertyReference distinct_on = 6;
        Specified by:
        getDistinctOnOrBuilder in interface QueryOrBuilder
      • getStartCursor

        public com.google.protobuf.ByteString getStartCursor()
         A starting point for the query results. Query cursors are
         returned in query result batches and
         [can only be used to continue the same
         query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets).
         
        bytes start_cursor = 7;
        Specified by:
        getStartCursor in interface QueryOrBuilder
        Returns:
        The startCursor.
      • getEndCursor

        public com.google.protobuf.ByteString getEndCursor()
         An ending point for the query results. Query cursors are
         returned in query result batches and
         [can only be used to limit the same
         query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets).
         
        bytes end_cursor = 8;
        Specified by:
        getEndCursor in interface QueryOrBuilder
        Returns:
        The endCursor.
      • getOffset

        public int getOffset()
         The number of results to skip. Applies before limit, but after all other
         constraints. Optional. Must be >= 0 if specified.
         
        int32 offset = 10;
        Specified by:
        getOffset in interface QueryOrBuilder
        Returns:
        The offset.
      • hasLimit

        public boolean hasLimit()
         The maximum number of results to return. Applies after all other
         constraints. Optional.
         Unspecified is interpreted as no limit.
         Must be >= 0 if specified.
         
        .google.protobuf.Int32Value limit = 12;
        Specified by:
        hasLimit in interface QueryOrBuilder
        Returns:
        Whether the limit field is set.
      • getLimit

        public com.google.protobuf.Int32Value getLimit()
         The maximum number of results to return. Applies after all other
         constraints. Optional.
         Unspecified is interpreted as no limit.
         Must be >= 0 if specified.
         
        .google.protobuf.Int32Value limit = 12;
        Specified by:
        getLimit in interface QueryOrBuilder
        Returns:
        The limit.
      • getLimitOrBuilder

        public com.google.protobuf.Int32ValueOrBuilder getLimitOrBuilder()
         The maximum number of results to return. Applies after all other
         constraints. Optional.
         Unspecified is interpreted as no limit.
         Must be >= 0 if specified.
         
        .google.protobuf.Int32Value limit = 12;
        Specified by:
        getLimitOrBuilder in interface QueryOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static Query parseFrom​(ByteBuffer data)
                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Query parseFrom​(ByteBuffer data,
                                      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Query parseFrom​(com.google.protobuf.ByteString data)
                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Query parseFrom​(com.google.protobuf.ByteString data,
                                      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Query parseFrom​(byte[] data)
                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Query parseFrom​(byte[] data,
                                      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Query parseFrom​(com.google.protobuf.CodedInputStream input,
                                      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                               throws IOException
        Throws:
        IOException
      • newBuilderForType

        public Query.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public Query.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected Query.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static Query getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<Query> parser()
      • getParserForType

        public com.google.protobuf.Parser<Query> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public Query getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder