src/runtime/Tests/UnittestImportLite.pb.m
// Generated by the protocol buffer compiler.  DO NOT EDIT!

#import "UnittestImportLite.pb.h"

@implementation UnittestImportLiteRoot
static PBExtensionRegistry* extensionRegistry = nil;
+ (PBExtensionRegistry*) extensionRegistry {
  return extensionRegistry;
}

+ (void) initialize {
  if (self == [UnittestImportLiteRoot class]) {
    PBMutableExtensionRegistry* registry = [PBMutableExtensionRegistry registry];
    [self registerAllExtensions:registry];
    extensionRegistry = [registry retain];
  }
}
+ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry {
}
@end

BOOL ImportEnumLiteIsValidValue(ImportEnumLite value) {
  switch (value) {
    case ImportEnumLiteImportLiteFoo:
    case ImportEnumLiteImportLiteBar:
    case ImportEnumLiteImportLiteBaz:
      return YES;
    default:
      return NO;
  }
}
@interface ImportMessageLite ()
@property int32_t d;
@end

@implementation ImportMessageLite

- (BOOL) hasD {
  return !!hasD_;
}
- (void) setHasD:(BOOL) value {
  hasD_ = !!value;
}
@synthesize d;
- (void) dealloc {
  [super dealloc];
}
- (id) init {
  if ((self = [super init])) {
    self.d = 0;
  }
  return self;
}
static ImportMessageLite* defaultImportMessageLiteInstance = nil;
+ (void) initialize {
  if (self == [ImportMessageLite class]) {
    defaultImportMessageLiteInstance = [[ImportMessageLite alloc] init];
  }
}
+ (ImportMessageLite*) defaultInstance {
  return defaultImportMessageLiteInstance;
}
- (ImportMessageLite*) defaultInstance {
  return defaultImportMessageLiteInstance;
}
- (BOOL) isInitialized {
  return YES;
}
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output {
  if (self.hasD) {
    [output writeInt32:1 value:self.d];
  }
  [self.unknownFields writeToCodedOutputStream:output];
}
- (int32_t) serializedSize {
  int32_t size = memoizedSerializedSize;
  if (size != -1) {
    return size;
  }

  size = 0;
  if (self.hasD) {
    size += computeInt32Size(1, self.d);
  }
  size += self.unknownFields.serializedSize;
  memoizedSerializedSize = size;
  return size;
}
+ (ImportMessageLite*) parseFromData:(NSData*) data {
  return (ImportMessageLite*)[[[ImportMessageLite builder] mergeFromData:data] build];
}
+ (ImportMessageLite*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  return (ImportMessageLite*)[[[ImportMessageLite builder] mergeFromData:data extensionRegistry:extensionRegistry] build];
}
+ (ImportMessageLite*) parseFromInputStream:(NSInputStream*) input {
  return (ImportMessageLite*)[[[ImportMessageLite builder] mergeFromInputStream:input] build];
}
+ (ImportMessageLite*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  return (ImportMessageLite*)[[[ImportMessageLite builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build];
}
+ (ImportMessageLite*) parseFromCodedInputStream:(PBCodedInputStream*) input {
  return (ImportMessageLite*)[[[ImportMessageLite builder] mergeFromCodedInputStream:input] build];
}
+ (ImportMessageLite*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  return (ImportMessageLite*)[[[ImportMessageLite builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build];
}
+ (ImportMessageLite_Builder*) builder {
  return [[[ImportMessageLite_Builder alloc] init] autorelease];
}
+ (ImportMessageLite_Builder*) builderWithPrototype:(ImportMessageLite*) prototype {
  return [[ImportMessageLite builder] mergeFrom:prototype];
}
- (ImportMessageLite_Builder*) builder {
  return [ImportMessageLite builder];
}
- (ImportMessageLite_Builder*) toBuilder {
  return [ImportMessageLite builderWithPrototype:self];
}
- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent {
  if (self.hasD) {
    [output appendFormat:@"%@%@: %@\n", indent, @"d", [NSNumber numberWithInt:self.d]];
  }
  [self.unknownFields writeDescriptionTo:output withIndent:indent];
}
- (BOOL) isEqual:(id)other {
  if (other == self) {
    return YES;
  }
  if (![other isKindOfClass:[ImportMessageLite class]]) {
    return NO;
  }
  ImportMessageLite *otherMessage = other;
  return
      self.hasD == otherMessage.hasD &&
      (!self.hasD || self.d == otherMessage.d) &&
      
      (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields]));
}
- (NSUInteger) hash {
  NSUInteger hashCode = 7;
  if (self.hasD) {
    hashCode = hashCode * 31 + [[NSNumber numberWithInt:self.d] hash];
  }
  hashCode = hashCode * 31 + [self.unknownFields hash];
  return hashCode;
}
@end

@interface ImportMessageLite_Builder()
@property (retain) ImportMessageLite* result;
@end

@implementation ImportMessageLite_Builder
@synthesize result;
- (void) dealloc {
  self.result = nil;
  [super dealloc];
}
- (id) init {
  if ((self = [super init])) {
    self.result = [[[ImportMessageLite alloc] init] autorelease];
  }
  return self;
}
- (PBGeneratedMessage*) internalGetResult {
  return result;
}
- (ImportMessageLite_Builder*) clear {
  self.result = [[[ImportMessageLite alloc] init] autorelease];
  return self;
}
- (ImportMessageLite_Builder*) clone {
  return [ImportMessageLite builderWithPrototype:result];
}
- (ImportMessageLite*) defaultInstance {
  return [ImportMessageLite defaultInstance];
}
- (ImportMessageLite*) build {
  [self checkInitialized];
  return [self buildPartial];
}
- (ImportMessageLite*) buildPartial {
  ImportMessageLite* returnMe = [[result retain] autorelease];
  self.result = nil;
  return returnMe;
}
- (ImportMessageLite_Builder*) mergeFrom:(ImportMessageLite*) other {
  if (other == [ImportMessageLite defaultInstance]) {
    return self;
  }
  if (other.hasD) {
    [self setD:other.d];
  }
  [self mergeUnknownFields:other.unknownFields];
  return self;
}
- (ImportMessageLite_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input {
  return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]];
}
- (ImportMessageLite_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  PBUnknownFieldSet_Builder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields];
  while (YES) {
    int32_t tag = [input readTag];
    switch (tag) {
      case 0:
        [self setUnknownFields:[unknownFields build]];
        return self;
      default: {
        if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) {
          [self setUnknownFields:[unknownFields build]];
          return self;
        }
        break;
      }
      case 8: {
        [self setD:[input readInt32]];
        break;
      }
    }
  }
}
- (BOOL) hasD {
  return result.hasD;
}
- (int32_t) d {
  return result.d;
}
- (ImportMessageLite_Builder*) setD:(int32_t) value {
  result.hasD = YES;
  result.d = value;
  return self;
}
- (ImportMessageLite_Builder*) clearD {
  result.hasD = NO;
  result.d = 0;
  return self;
}
@end

