xref: /aosp_15_r20/external/executorch/backends/apple/coreml/runtime/sdk/ETCoreMLPair.mm (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1//
2// ETCoreMLPair.mm
3//
4// Copyright © 2024 Apple Inc. All rights reserved.
5//
6// Please refer to the license found in the LICENSE file in the root directory of the source tree.
7
8#import "ETCoreMLPair.h"
9
10@implementation ETCoreMLPair
11
12- (instancetype)initWithFirst:(id)first second:(id)second {
13    self = [super init];
14    if (self) {
15        _first = first;
16        _second = second;
17    }
18
19    return self;
20}
21
22- (instancetype)copyWithZone:(NSZone *)zone {
23    return [[ETCoreMLPair allocWithZone:zone] initWithFirst:self.first second:self.second];
24}
25
26- (BOOL)isEqual:(id)other {
27    if (other == self) {
28        return YES;
29    }
30
31    if (![other isKindOfClass:self.class]) {
32        return NO;
33    }
34
35    return [self.first isEqual:((ETCoreMLPair *)other).first] && [self.second isEqual:((ETCoreMLPair *)other).second];
36}
37
38@end
39