FIRMaxKey.m 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright 2025 Google LLC
  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. #include "Firestore/Source/Public/FirebaseFirestore/FIRMaxKey.h"
  17. @implementation FIRMaxKey
  18. static FIRMaxKey *sharedInstance = nil;
  19. static dispatch_once_t onceToken;
  20. + (FIRMaxKey *)shared {
  21. dispatch_once(&onceToken, ^{
  22. sharedInstance = [[self alloc] init];
  23. });
  24. return sharedInstance;
  25. }
  26. - (instancetype)init {
  27. self = [super init];
  28. return self;
  29. }
  30. - (id)copyWithZone:(__unused NSZone *_Nullable)zone {
  31. return self;
  32. }
  33. - (BOOL)isEqual:(nullable id)object {
  34. if (self == object) {
  35. return YES;
  36. }
  37. if (object == nil || [self class] != [object class]) {
  38. return NO;
  39. }
  40. return YES;
  41. }
  42. - (NSString *)description {
  43. return [NSString stringWithFormat:@"<FIRMaxKey>"];
  44. }
  45. @end