FQueryParams.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. @protocol FIndex, FNodeFilter, FNode;
  18. @interface FQueryParams : NSObject <NSCopying>
  19. @property (nonatomic, readonly) BOOL limitSet;
  20. @property (nonatomic, readonly) NSInteger limit;
  21. @property (nonatomic, strong, readonly) NSString *viewFrom;
  22. @property (nonatomic, strong, readonly) id<FNode> indexStartValue;
  23. @property (nonatomic, strong, readonly) NSString *indexStartKey;
  24. @property (nonatomic, strong, readonly) id<FNode> indexEndValue;
  25. @property (nonatomic, strong, readonly) NSString *indexEndKey;
  26. @property (nonatomic, strong, readonly) id<FIndex> index;
  27. - (BOOL)loadsAllData;
  28. - (BOOL)isDefault;
  29. - (BOOL)isValid;
  30. - (BOOL)hasAnchoredLimit;
  31. - (FQueryParams *) limitTo:(NSInteger) limit;
  32. - (FQueryParams *) limitToFirst:(NSInteger) newLimit;
  33. - (FQueryParams *) limitToLast:(NSInteger) newLimit;
  34. - (FQueryParams *) startAt:(id<FNode>)indexValue childKey:(NSString *)key;
  35. - (FQueryParams *) startAt:(id<FNode>)indexValue;
  36. - (FQueryParams *) endAt:(id<FNode>)indexValue childKey:(NSString *)key;
  37. - (FQueryParams *) endAt:(id<FNode>)indexValue;
  38. - (FQueryParams *) orderBy:(id<FIndex>) index;
  39. + (FQueryParams *) defaultInstance;
  40. + (FQueryParams *) fromQueryObject:(NSDictionary *)dict;
  41. - (BOOL)hasStart;
  42. - (BOOL)hasEnd;
  43. - (NSDictionary *) wireProtocolParams;
  44. - (BOOL) isViewFromLeft;
  45. - (id<FNodeFilter>) nodeFilter;
  46. @end