1 // This file was automatically generated by protocompiler
3 // Compiled from MockAKSOptionalParameters.proto
5 #import "MockAKSOptionalParameters.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
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.
14 @implementation MockAKSOptionalParameters
16 - (BOOL)hasAccessGroups
18 return _accessGroups != nil;
20 @synthesize accessGroups = _accessGroups;
21 - (BOOL)hasExternalData
23 return _externalData != nil;
25 @synthesize externalData = _externalData;
28 return _acmHandle != nil;
30 @synthesize acmHandle = _acmHandle;
32 - (NSString *)description
34 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
37 - (NSDictionary *)dictionaryRepresentation
39 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
40 if (self->_accessGroups)
42 [dict setObject:self->_accessGroups forKey:@"access_groups"];
44 if (self->_externalData)
46 [dict setObject:self->_externalData forKey:@"external_data"];
50 [dict setObject:self->_acmHandle forKey:@"acm_handle"];
55 BOOL MockAKSOptionalParametersReadFrom(__unsafe_unretained MockAKSOptionalParameters *self, __unsafe_unretained PBDataReader *reader) {
56 while (PBReaderHasMoreData(reader)) {
60 PBReaderReadTag32AndType(reader, &tag, &aType);
62 if (PBReaderHasError(reader))
65 if (aType == TYPE_END_GROUP) {
71 case 1 /* accessGroups */:
73 NSData *new_accessGroups = PBReaderReadData(reader);
74 self->_accessGroups = new_accessGroups;
77 case 2 /* externalData */:
79 NSData *new_externalData = PBReaderReadData(reader);
80 self->_externalData = new_externalData;
83 case 3 /* acmHandle */:
85 NSData *new_acmHandle = PBReaderReadData(reader);
86 self->_acmHandle = new_acmHandle;
90 if (!PBReaderSkipValueWithTag(reader, tag, aType))
95 return !PBReaderHasError(reader);
98 - (BOOL)readFrom:(PBDataReader *)reader
100 return MockAKSOptionalParametersReadFrom(self, reader);
102 - (void)writeTo:(PBDataWriter *)writer
106 if (self->_accessGroups)
108 PBDataWriterWriteDataField(writer, self->_accessGroups, 1);
113 if (self->_externalData)
115 PBDataWriterWriteDataField(writer, self->_externalData, 2);
120 if (self->_acmHandle)
122 PBDataWriterWriteDataField(writer, self->_acmHandle, 3);
127 - (void)copyTo:(MockAKSOptionalParameters *)other
131 other.accessGroups = _accessGroups;
135 other.externalData = _externalData;
139 other.acmHandle = _acmHandle;
143 - (id)copyWithZone:(NSZone *)zone
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];
152 - (BOOL)isEqual:(id)object
154 MockAKSOptionalParameters *other = (MockAKSOptionalParameters *)object;
155 return [other isMemberOfClass:[self class]]
157 ((!self->_accessGroups && !other->_accessGroups) || [self->_accessGroups isEqual:other->_accessGroups])
159 ((!self->_externalData && !other->_externalData) || [self->_externalData isEqual:other->_externalData])
161 ((!self->_acmHandle && !other->_acmHandle) || [self->_acmHandle isEqual:other->_acmHandle])
169 [self->_accessGroups hash]
171 [self->_externalData hash]
173 [self->_acmHandle hash]
177 - (void)mergeFrom:(MockAKSOptionalParameters *)other
179 if (other->_accessGroups)
181 [self setAccessGroups:other->_accessGroups];
183 if (other->_externalData)
185 [self setExternalData:other->_externalData];
187 if (other->_acmHandle)
189 [self setAcmHandle:other->_acmHandle];