Files

60 lines
1.9 KiB
Objective-C
Raw Permalink Normal View History

2017-05-15 12:27:07 -07:00
/*
* Copyright 2017 Google
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Foundation/Foundation.h>
2019-08-05 13:27:47 -07:00
@protocol FIndex
, FNodeFilter, FNode;
2017-05-15 12:27:07 -07:00
@interface FQueryParams : NSObject <NSCopying>
2019-08-05 13:27:47 -07:00
@property(nonatomic, readonly) BOOL limitSet;
@property(nonatomic, readonly) NSInteger limit;
2017-05-15 12:27:07 -07:00
2019-08-05 13:27:47 -07:00
@property(nonatomic, strong, readonly) NSString *viewFrom;
@property(nonatomic, strong, readonly) id<FNode> indexStartValue;
@property(nonatomic, strong, readonly) NSString *indexStartKey;
@property(nonatomic, strong, readonly) id<FNode> indexEndValue;
@property(nonatomic, strong, readonly) NSString *indexEndKey;
2017-05-15 12:27:07 -07:00
2019-08-05 13:27:47 -07:00
@property(nonatomic, strong, readonly) id<FIndex> index;
2017-05-15 12:27:07 -07:00
- (BOOL)loadsAllData;
- (BOOL)isDefault;
- (BOOL)isValid;
- (BOOL)hasAnchoredLimit;
2019-08-05 13:27:47 -07:00
- (FQueryParams *)limitTo:(NSInteger)limit;
- (FQueryParams *)limitToFirst:(NSInteger)newLimit;
- (FQueryParams *)limitToLast:(NSInteger)newLimit;
2017-05-15 12:27:07 -07:00
2019-08-05 13:27:47 -07:00
- (FQueryParams *)startAt:(id<FNode>)indexValue childKey:(NSString *)key;
- (FQueryParams *)startAt:(id<FNode>)indexValue;
- (FQueryParams *)endAt:(id<FNode>)indexValue childKey:(NSString *)key;
- (FQueryParams *)endAt:(id<FNode>)indexValue;
2017-05-15 12:27:07 -07:00
2019-08-05 13:27:47 -07:00
- (FQueryParams *)orderBy:(id<FIndex>)index;
2017-05-15 12:27:07 -07:00
2019-08-05 13:27:47 -07:00
+ (FQueryParams *)defaultInstance;
+ (FQueryParams *)fromQueryObject:(NSDictionary *)dict;
2017-05-15 12:27:07 -07:00
- (BOOL)hasStart;
- (BOOL)hasEnd;
2019-08-05 13:27:47 -07:00
- (NSDictionary *)wireProtocolParams;
- (BOOL)isViewFromLeft;
- (id<FNodeFilter>)nodeFilter;
2017-05-15 12:27:07 -07:00
@end