1 // This file was automatically generated by protocompiler
3 // Compiled from OTPairingMessage.proto
5 #import "OTSupportSOSMessage.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 OTSupportSOSMessage
16 @synthesize supported = _supported;
17 - (OTSupportType)supported
19 return _has.supported ? _supported : OTSupportType_unknown;
21 - (void)setSupported:(OTSupportType)v
26 - (void)setHasSupported:(BOOL)f
32 return _has.supported != 0;
34 - (NSString *)supportedAsString:(OTSupportType)value
36 return OTSupportTypeAsString(value);
38 - (OTSupportType)StringAsSupported:(NSString *)str
40 return StringAsOTSupportType(str);
43 - (NSString *)description
45 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
48 - (NSDictionary *)dictionaryRepresentation
50 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
51 if (self->_has.supported)
53 [dict setObject:OTSupportTypeAsString(self->_supported) forKey:@"supported"];
58 BOOL OTSupportSOSMessageReadFrom(__unsafe_unretained OTSupportSOSMessage *self, __unsafe_unretained PBDataReader *reader) {
59 while (PBReaderHasMoreData(reader)) {
63 PBReaderReadTag32AndType(reader, &tag, &aType);
65 if (PBReaderHasError(reader))
68 if (aType == TYPE_END_GROUP) {
74 case 1 /* supported */:
76 self->_has.supported = YES;
77 self->_supported = PBReaderReadInt32(reader);
81 if (!PBReaderSkipValueWithTag(reader, tag, aType))
86 return !PBReaderHasError(reader);
89 - (BOOL)readFrom:(PBDataReader *)reader
91 return OTSupportSOSMessageReadFrom(self, reader);
93 - (void)writeTo:(PBDataWriter *)writer
97 if (self->_has.supported)
99 PBDataWriterWriteInt32Field(writer, self->_supported, 1);
104 - (void)copyTo:(OTSupportSOSMessage *)other
106 if (self->_has.supported)
108 other->_supported = _supported;
109 other->_has.supported = YES;
113 - (id)copyWithZone:(NSZone *)zone
115 OTSupportSOSMessage *copy = [[[self class] allocWithZone:zone] init];
116 if (self->_has.supported)
118 copy->_supported = _supported;
119 copy->_has.supported = YES;
124 - (BOOL)isEqual:(id)object
126 OTSupportSOSMessage *other = (OTSupportSOSMessage *)object;
127 return [other isMemberOfClass:[self class]]
129 ((self->_has.supported && other->_has.supported && self->_supported == other->_supported) || (!self->_has.supported && !other->_has.supported))
137 (self->_has.supported ? PBHashInt((NSUInteger)self->_supported) : 0)
141 - (void)mergeFrom:(OTSupportSOSMessage *)other
143 if (other->_has.supported)
145 self->_supported = other->_supported;
146 self->_has.supported = YES;