]> git.saurik.com Git - apple/security.git/blob - tests/secdmockaks/generated_source/MockAKSOptionalParameters.m
Security-59754.80.3.tar.gz
[apple/security.git] / tests / secdmockaks / generated_source / MockAKSOptionalParameters.m
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from MockAKSOptionalParameters.proto
4
5 #import "MockAKSOptionalParameters.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
9
10 #if !__has_feature(objc_arc)
11 # error This generated file depends on ARC but it is not enabled; turn on ARC, or use 'objc_use_arc' option to generate non-ARC code.
12 #endif
13
14 @implementation MockAKSOptionalParameters
15
16 - (BOOL)hasAccessGroups
17 {
18 return _accessGroups != nil;
19 }
20 @synthesize accessGroups = _accessGroups;
21 - (BOOL)hasExternalData
22 {
23 return _externalData != nil;
24 }
25 @synthesize externalData = _externalData;
26 - (BOOL)hasAcmHandle
27 {
28 return _acmHandle != nil;
29 }
30 @synthesize acmHandle = _acmHandle;
31
32 - (NSString *)description
33 {
34 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
35 }
36
37 - (NSDictionary *)dictionaryRepresentation
38 {
39 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
40 if (self->_accessGroups)
41 {
42 [dict setObject:self->_accessGroups forKey:@"access_groups"];
43 }
44 if (self->_externalData)
45 {
46 [dict setObject:self->_externalData forKey:@"external_data"];
47 }
48 if (self->_acmHandle)
49 {
50 [dict setObject:self->_acmHandle forKey:@"acm_handle"];
51 }
52 return dict;
53 }
54
55 BOOL MockAKSOptionalParametersReadFrom(__unsafe_unretained MockAKSOptionalParameters *self, __unsafe_unretained PBDataReader *reader) {
56 while (PBReaderHasMoreData(reader)) {
57 uint32_t tag = 0;
58 uint8_t aType = 0;
59
60 PBReaderReadTag32AndType(reader, &tag, &aType);
61
62 if (PBReaderHasError(reader))
63 break;
64
65 if (aType == TYPE_END_GROUP) {
66 break;
67 }
68
69 switch (tag) {
70
71 case 1 /* accessGroups */:
72 {
73 NSData *new_accessGroups = PBReaderReadData(reader);
74 self->_accessGroups = new_accessGroups;
75 }
76 break;
77 case 2 /* externalData */:
78 {
79 NSData *new_externalData = PBReaderReadData(reader);
80 self->_externalData = new_externalData;
81 }
82 break;
83 case 3 /* acmHandle */:
84 {
85 NSData *new_acmHandle = PBReaderReadData(reader);
86 self->_acmHandle = new_acmHandle;
87 }
88 break;
89 default:
90 if (!PBReaderSkipValueWithTag(reader, tag, aType))
91 return NO;
92 break;
93 }
94 }
95 return !PBReaderHasError(reader);
96 }
97
98 - (BOOL)readFrom:(PBDataReader *)reader
99 {
100 return MockAKSOptionalParametersReadFrom(self, reader);
101 }
102 - (void)writeTo:(PBDataWriter *)writer
103 {
104 /* accessGroups */
105 {
106 if (self->_accessGroups)
107 {
108 PBDataWriterWriteDataField(writer, self->_accessGroups, 1);
109 }
110 }
111 /* externalData */
112 {
113 if (self->_externalData)
114 {
115 PBDataWriterWriteDataField(writer, self->_externalData, 2);
116 }
117 }
118 /* acmHandle */
119 {
120 if (self->_acmHandle)
121 {
122 PBDataWriterWriteDataField(writer, self->_acmHandle, 3);
123 }
124 }
125 }
126
127 - (void)copyTo:(MockAKSOptionalParameters *)other
128 {
129 if (_accessGroups)
130 {
131 other.accessGroups = _accessGroups;
132 }
133 if (_externalData)
134 {
135 other.externalData = _externalData;
136 }
137 if (_acmHandle)
138 {
139 other.acmHandle = _acmHandle;
140 }
141 }
142
143 - (id)copyWithZone:(NSZone *)zone
144 {
145 MockAKSOptionalParameters *copy = [[[self class] allocWithZone:zone] init];
146 copy->_accessGroups = [_accessGroups copyWithZone:zone];
147 copy->_externalData = [_externalData copyWithZone:zone];
148 copy->_acmHandle = [_acmHandle copyWithZone:zone];
149 return copy;
150 }
151
152 - (BOOL)isEqual:(id)object
153 {
154 MockAKSOptionalParameters *other = (MockAKSOptionalParameters *)object;
155 return [other isMemberOfClass:[self class]]
156 &&
157 ((!self->_accessGroups && !other->_accessGroups) || [self->_accessGroups isEqual:other->_accessGroups])
158 &&
159 ((!self->_externalData && !other->_externalData) || [self->_externalData isEqual:other->_externalData])
160 &&
161 ((!self->_acmHandle && !other->_acmHandle) || [self->_acmHandle isEqual:other->_acmHandle])
162 ;
163 }
164
165 - (NSUInteger)hash
166 {
167 return 0
168 ^
169 [self->_accessGroups hash]
170 ^
171 [self->_externalData hash]
172 ^
173 [self->_acmHandle hash]
174 ;
175 }
176
177 - (void)mergeFrom:(MockAKSOptionalParameters *)other
178 {
179 if (other->_accessGroups)
180 {
181 [self setAccessGroups:other->_accessGroups];
182 }
183 if (other->_externalData)
184 {
185 [self setExternalData:other->_externalData];
186 }
187 if (other->_acmHandle)
188 {
189 [self setAcmHandle:other->_acmHandle];
190 }
191 }
192
193 @end
194