/// Generated by the Protocol Buffers 3.6.0 compiler.  DO NOT EDIT!
/// Protobuf-swift version: 4.0.0
/// Source file "unittest_no_field_presence.proto"
/// Syntax "Proto3"

import Foundation
import ProtocolBuffers


public struct Proto2NofieldpresenceUnittest { }

public extension Proto2NofieldpresenceUnittest {
    public struct UnittestNoFieldPresenceRoot {
        public static let `default` = UnittestNoFieldPresenceRoot()
        public var extensionRegistry:ExtensionRegistry

        init() {
            extensionRegistry = ExtensionRegistry()
            registerAllExtensions(registry: extensionRegistry)
            ProtobufUnittest.UnittestRoot.default.registerAllExtensions(registry: extensionRegistry)
        }
        public func registerAllExtensions(registry: ExtensionRegistry) {
        }
    }



    //Enum type declaration start 

    public enum ForeignEnum:Int32, GeneratedEnum {
        case foreignFoo = 0
        case foreignBar = 1
        case foreignBaz = 2
        public func toString() -> String {
            switch self {
            case .foreignFoo: return "FOREIGN_FOO"
            case .foreignBar: return "FOREIGN_BAR"
            case .foreignBaz: return "FOREIGN_BAZ"
            }
        }
        public static func fromString(_ str:String) throws -> Proto2NofieldpresenceUnittest.ForeignEnum {
            switch str {
            case "FOREIGN_FOO":    return .foreignFoo
            case "FOREIGN_BAR":    return .foreignBar
            case "FOREIGN_BAZ":    return .foreignBaz
            default: throw ProtocolBuffersError.invalidProtocolBuffer("Conversion failed.")
            }
        }
        public var debugDescription:String { return getDescription() }
        public var description:String { return getDescription() }
        private func getDescription() -> String { 
            switch self {
            case .foreignFoo: return ".foreignFoo"
            case .foreignBar: return ".foreignBar"
            case .foreignBaz: return ".foreignBaz"
            }
        }
        public var hashValue:Int {
            return self.rawValue.hashValue
        }
        public static func ==(lhs:ForeignEnum, rhs:ForeignEnum) -> Bool {
            return lhs.hashValue == rhs.hashValue
        }
    }

    //Enum type declaration end 

    /// This proto includes every type of field in both singular and repeated
    /// forms.
    final public class TestAllTypes : GeneratedMessage {
        public typealias BuilderType = Proto2NofieldpresenceUnittest.TestAllTypes.Builder

        public static func == (lhs: Proto2NofieldpresenceUnittest.TestAllTypes, rhs: Proto2NofieldpresenceUnittest.TestAllTypes) -> Bool {
            if lhs === rhs {
                return true
            }
            var fieldCheck:Bool = (lhs.hashValue == rhs.hashValue)
            fieldCheck = fieldCheck && (lhs.hasOptionalInt32 == rhs.hasOptionalInt32) && (!lhs.hasOptionalInt32 || lhs.optionalInt32 == rhs.optionalInt32)
            fieldCheck = fieldCheck && (lhs.hasOptionalInt64 == rhs.hasOptionalInt64) && (!lhs.hasOptionalInt64 || lhs.optionalInt64 == rhs.optionalInt64)
            fieldCheck = fieldCheck && (lhs.hasOptionalUint32 == rhs.hasOptionalUint32) && (!lhs.hasOptionalUint32 || lhs.optionalUint32 == rhs.optionalUint32)
            fieldCheck = fieldCheck && (lhs.hasOptionalUint64 == rhs.hasOptionalUint64) && (!lhs.hasOptionalUint64 || lhs.optionalUint64 == rhs.optionalUint64)
            fieldCheck = fieldCheck && (lhs.hasOptionalSint32 == rhs.hasOptionalSint32) && (!lhs.hasOptionalSint32 || lhs.optionalSint32 == rhs.optionalSint32)
            fieldCheck = fieldCheck && (lhs.hasOptionalSint64 == rhs.hasOptionalSint64) && (!lhs.hasOptionalSint64 || lhs.optionalSint64 == rhs.optionalSint64)
            fieldCheck = fieldCheck && (lhs.hasOptionalFixed32 == rhs.hasOptionalFixed32) && (!lhs.hasOptionalFixed32 || lhs.optionalFixed32 == rhs.optionalFixed32)
            fieldCheck = fieldCheck && (lhs.hasOptionalFixed64 == rhs.hasOptionalFixed64) && (!lhs.hasOptionalFixed64 || lhs.optionalFixed64 == rhs.optionalFixed64)
            fieldCheck = fieldCheck && (lhs.hasOptionalSfixed32 == rhs.hasOptionalSfixed32) && (!lhs.hasOptionalSfixed32 || lhs.optionalSfixed32 == rhs.optionalSfixed32)
            fieldCheck = fieldCheck && (lhs.hasOptionalSfixed64 == rhs.hasOptionalSfixed64) && (!lhs.hasOptionalSfixed64 || lhs.optionalSfixed64 == rhs.optionalSfixed64)
            fieldCheck = fieldCheck && (lhs.hasOptionalFloat == rhs.hasOptionalFloat) && (!lhs.hasOptionalFloat || lhs.optionalFloat == rhs.optionalFloat)
            fieldCheck = fieldCheck && (lhs.hasOptionalDouble == rhs.hasOptionalDouble) && (!lhs.hasOptionalDouble || lhs.optionalDouble == rhs.optionalDouble)
            fieldCheck = fieldCheck && (lhs.hasOptionalBool == rhs.hasOptionalBool) && (!lhs.hasOptionalBool || lhs.optionalBool == rhs.optionalBool)
            fieldCheck = fieldCheck && (lhs.hasOptionalString == rhs.hasOptionalString) && (!lhs.hasOptionalString || lhs.optionalString == rhs.optionalString)
            fieldCheck = fieldCheck && (lhs.hasOptionalBytes == rhs.hasOptionalBytes) && (!lhs.hasOptionalBytes || lhs.optionalBytes == rhs.optionalBytes)
            fieldCheck = fieldCheck && (lhs.hasOptionalNestedMessage == rhs.hasOptionalNestedMessage) && (!lhs.hasOptionalNestedMessage || lhs.optionalNestedMessage == rhs.optionalNestedMessage)
            fieldCheck = fieldCheck && (lhs.hasOptionalForeignMessage == rhs.hasOptionalForeignMessage) && (!lhs.hasOptionalForeignMessage || lhs.optionalForeignMessage == rhs.optionalForeignMessage)
            fieldCheck = fieldCheck && (lhs.hasOptionalProto2Message == rhs.hasOptionalProto2Message) && (!lhs.hasOptionalProto2Message || lhs.optionalProto2Message == rhs.optionalProto2Message)
            fieldCheck = fieldCheck && (lhs.hasOptionalNestedEnum == rhs.hasOptionalNestedEnum) && (!lhs.hasOptionalNestedEnum || lhs.optionalNestedEnum == rhs.optionalNestedEnum)
            fieldCheck = fieldCheck && (lhs.hasOptionalForeignEnum == rhs.hasOptionalForeignEnum) && (!lhs.hasOptionalForeignEnum || lhs.optionalForeignEnum == rhs.optionalForeignEnum)
            fieldCheck = fieldCheck && (lhs.hasOptionalStringPiece == rhs.hasOptionalStringPiece) && (!lhs.hasOptionalStringPiece || lhs.optionalStringPiece == rhs.optionalStringPiece)
            fieldCheck = fieldCheck && (lhs.hasOptionalCord == rhs.hasOptionalCord) && (!lhs.hasOptionalCord || lhs.optionalCord == rhs.optionalCord)
            fieldCheck = fieldCheck && (lhs.hasOptionalLazyMessage == rhs.hasOptionalLazyMessage) && (!lhs.hasOptionalLazyMessage || lhs.optionalLazyMessage == rhs.optionalLazyMessage)
            fieldCheck = fieldCheck && (lhs.repeatedInt32 == rhs.repeatedInt32)
            fieldCheck = fieldCheck && (lhs.repeatedInt64 == rhs.repeatedInt64)
            fieldCheck = fieldCheck && (lhs.repeatedUint32 == rhs.repeatedUint32)
            fieldCheck = fieldCheck && (lhs.repeatedUint64 == rhs.repeatedUint64)
            fieldCheck = fieldCheck && (lhs.repeatedSint32 == rhs.repeatedSint32)
            fieldCheck = fieldCheck && (lhs.repeatedSint64 == rhs.repeatedSint64)
            fieldCheck = fieldCheck && (lhs.repeatedFixed32 == rhs.repeatedFixed32)
            fieldCheck = fieldCheck && (lhs.repeatedFixed64 == rhs.repeatedFixed64)
            fieldCheck = fieldCheck && (lhs.repeatedSfixed32 == rhs.repeatedSfixed32)
            fieldCheck = fieldCheck && (lhs.repeatedSfixed64 == rhs.repeatedSfixed64)
            fieldCheck = fieldCheck && (lhs.repeatedFloat == rhs.repeatedFloat)
            fieldCheck = fieldCheck && (lhs.repeatedDouble == rhs.repeatedDouble)
            fieldCheck = fieldCheck && (lhs.repeatedBool == rhs.repeatedBool)
            fieldCheck = fieldCheck && (lhs.repeatedString == rhs.repeatedString)
            fieldCheck = fieldCheck && (lhs.repeatedBytes == rhs.repeatedBytes)
            fieldCheck = fieldCheck && (lhs.repeatedNestedMessage == rhs.repeatedNestedMessage)
            fieldCheck = fieldCheck && (lhs.repeatedForeignMessage == rhs.repeatedForeignMessage)
            fieldCheck = fieldCheck && (lhs.repeatedProto2Message == rhs.repeatedProto2Message)
            fieldCheck = fieldCheck && (lhs.repeatedNestedEnum == rhs.repeatedNestedEnum)
            fieldCheck = fieldCheck && (lhs.repeatedForeignEnum == rhs.repeatedForeignEnum)
            fieldCheck = fieldCheck && (lhs.repeatedStringPiece == rhs.repeatedStringPiece)
            fieldCheck = fieldCheck && (lhs.repeatedCord == rhs.repeatedCord)
            fieldCheck = fieldCheck && (lhs.repeatedLazyMessage == rhs.repeatedLazyMessage)
            fieldCheck = fieldCheck && (lhs.hasOneofUint32 == rhs.hasOneofUint32) && (!lhs.hasOneofUint32 || lhs.oneofUint32 == rhs.oneofUint32)
            fieldCheck = fieldCheck && (lhs.hasOneofNestedMessage == rhs.hasOneofNestedMessage) && (!lhs.hasOneofNestedMessage || lhs.oneofNestedMessage == rhs.oneofNestedMessage)
            fieldCheck = fieldCheck && (lhs.hasOneofString == rhs.hasOneofString) && (!lhs.hasOneofString || lhs.oneofString == rhs.oneofString)
            fieldCheck = fieldCheck && (lhs.hasOneofEnum == rhs.hasOneofEnum) && (!lhs.hasOneofEnum || lhs.oneofEnum == rhs.oneofEnum)
            fieldCheck = (fieldCheck && (lhs.unknownFields == rhs.unknownFields))
            return fieldCheck
        }



        //Nested type declaration start

        final public class NestedMessage : GeneratedMessage {
            public typealias BuilderType = Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder

            public static func == (lhs: Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage, rhs: Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage) -> Bool {
                if lhs === rhs {
                    return true
                }
                var fieldCheck:Bool = (lhs.hashValue == rhs.hashValue)
                fieldCheck = fieldCheck && (lhs.hasBb == rhs.hasBb) && (!lhs.hasBb || lhs.bb == rhs.bb)
                fieldCheck = (fieldCheck && (lhs.unknownFields == rhs.unknownFields))
                return fieldCheck
            }

            public fileprivate(set) var bb:Int32! = nil
            public fileprivate(set) var hasBb:Bool = false

            required public init() {
                super.init()
            }
            override public func isInitialized() throws {
            }
            override public func writeTo(codedOutputStream: CodedOutputStream) throws {
                if hasBb {
                    try codedOutputStream.writeInt32(fieldNumber: 1, value:bb)
                }
                try unknownFields.writeTo(codedOutputStream: codedOutputStream)
            }
            override public func serializedSize() -> Int32 {
                var serialize_size:Int32 = memoizedSerializedSize
                if serialize_size != -1 {
                 return serialize_size
                }

                serialize_size = 0
                if hasBb {
                    serialize_size += bb.computeInt32Size(fieldNumber: 1)
                }
                serialize_size += unknownFields.serializedSize()
                memoizedSerializedSize = serialize_size
                return serialize_size
            }
            public class func getBuilder() -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                return Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.classBuilder() as! Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder
            }
            public func getBuilder() -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                return classBuilder() as! Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder
            }
            override public class func classBuilder() -> ProtocolBuffersMessageBuilder {
                return Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder()
            }
            override public func classBuilder() -> ProtocolBuffersMessageBuilder {
                return Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder()
            }
            public func toBuilder() throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.builderWithPrototype(prototype:self)
            }
            public class func builderWithPrototype(prototype:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder().mergeFrom(other:prototype)
            }
            override public func encode() throws -> Dictionary<String,Any> {
                try isInitialized()
                var jsonMap:Dictionary<String,Any> = Dictionary<String,Any>()
                if hasBb {
                    jsonMap["bb"] = Int(bb)
                }
                return jsonMap
            }
            override class public func decode(jsonMap:Dictionary<String,Any>) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage {
                return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build()
            }
            override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage {
                return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder.fromJSONToBuilder(data:data, options:options).build()
            }
            override public func getDescription(indent:String) throws -> String {
                var output = ""
                if hasBb {
                    output += "\(indent) bb: \(String(describing: bb)) \n"
                }
                output += unknownFields.getDescription(indent: indent)
                return output
            }
            override public var hashValue:Int {
                get {
                    var hashCode:Int = 7
                    if hasBb {
                        hashCode = (hashCode &* 31) &+ bb.hashValue
                    }
                    hashCode = (hashCode &* 31) &+  unknownFields.hashValue
                    return hashCode
                }
            }


            //Meta information declaration start

            override public class func className() -> String {
                return "Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage"
            }
            override public func className() -> String {
                return "Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage"
            }
            //Meta information declaration end

            final public class Builder : GeneratedMessageBuilder {
                fileprivate var builderResult:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage = Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage()
                public func getMessage() -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage {
                    return builderResult
                }

                required override public init () {
                    super.init()
                }
                public var bb:Int32 {
                    get {
                        return builderResult.bb
                    }
                    set (value) {
                        builderResult.hasBb = true
                        builderResult.bb = value
                    }
                }
                public var hasBb:Bool {
                    get {
                        return builderResult.hasBb
                    }
                }
                @discardableResult
                public func setBb(_ value:Int32) -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                    self.bb = value
                    return self
                }
                @discardableResult
                public func clearBb() -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder{
                    builderResult.hasBb = false
                    builderResult.bb = nil
                    return self
                }
                override public var internalGetResult:GeneratedMessage {
                    get {
                        return builderResult
                    }
                }
                @discardableResult
                override public func clear() -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                    builderResult = Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage()
                    return self
                }
                override public func clone() throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                    return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.builderWithPrototype(prototype:builderResult)
                }
                override public func build() throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage {
                    try checkInitialized()
                    return buildPartial()
                }
                public func buildPartial() -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage {
                    let returnMe:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage = builderResult
                    return returnMe
                }
                @discardableResult
                public func mergeFrom(other:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                    if other == Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage() {
                        return self
                    }
                    if other.hasBb {
                        bb = other.bb
                    }
                    try merge(unknownField: other.unknownFields)
                    return self
                }
                @discardableResult
                override public func mergeFrom(codedInputStream: CodedInputStream) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                    return try mergeFrom(codedInputStream: codedInputStream, extensionRegistry:ExtensionRegistry())
                }
                @discardableResult
                override public func mergeFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                    let unknownFieldsBuilder:UnknownFieldSet.Builder = try UnknownFieldSet.builderWithUnknownFields(copyFrom:self.unknownFields)
                    while (true) {
                        let protobufTag = try codedInputStream.readTag()
                        switch protobufTag {
                        case 0: 
                            self.unknownFields = try unknownFieldsBuilder.build()
                            return self

                        case 8:
                            bb = try codedInputStream.readInt32()

                        default:
                            if (!(try parse(codedInputStream:codedInputStream, unknownFields:unknownFieldsBuilder, extensionRegistry:extensionRegistry, tag:protobufTag))) {
                                unknownFields = try unknownFieldsBuilder.build()
                                return self
                            }
                        }
                    }
                }
                class override public func decodeToBuilder(jsonMap:Dictionary<String,Any>) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                    let resultDecodedBuilder = Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder()
                    if let jsonValueBb = jsonMap["bb"] as? Int {
                        resultDecodedBuilder.bb = Int32(jsonValueBb)
                    } else if let jsonValueBb = jsonMap["bb"] as? String {
                        resultDecodedBuilder.bb = Int32(jsonValueBb)!
                    }
                    return resultDecodedBuilder
                }
                override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                    let jsonData = try JSONSerialization.jsonObject(with:data, options: options)
                    guard let jsDataCast = jsonData as? Dictionary<String,Any> else {
                      throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data")
                    }
                    return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder.decodeToBuilder(jsonMap:jsDataCast)
                }
            }

        }

        //Nested type declaration end



        //OneOf declaration start

        public enum OneofField {
            case oneOfOneofFieldNotSet

            public func checkOneOfIsSet() -> Bool {
                switch self {
                case .oneOfOneofFieldNotSet: return false
                default: return true
                }
            }
            case oneofUint32(UInt32)

            public static func getOneofUint32(_ value:OneofField) -> UInt32? {
                switch value {
                case .oneofUint32(let otherValue): return otherValue
                default: return nil
                }
            }
            public func getOneofUint32() -> UInt32? {
                switch self {
                case .oneofUint32(let otherValue): return otherValue
                default: return nil
                }
            }
            case oneofNestedMessage(Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage)

            public static func getOneofNestedMessage(_ value:OneofField) -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage? {
                switch value {
                case .oneofNestedMessage(let messageValue): return messageValue
                default: return nil
                }
            }
            public func getOneofNestedMessage() -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage? {
                switch self {
                case .oneofNestedMessage(let messageValue): return messageValue
                default: return nil
                }
            }
            case oneofString(String)

            public static func getOneofString(_ value:OneofField) -> String? {
                switch value {
                case .oneofString(let otherValue): return otherValue
                default: return nil
                }
            }
            public func getOneofString() -> String? {
                switch self {
                case .oneofString(let otherValue): return otherValue
                default: return nil
                }
            }
            case oneofEnum(Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum)

            public static func getOneofEnum(_ value:OneofField) -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum? {
                switch value {
                case .oneofEnum(let enumValue): return enumValue
                default: return nil
                }
            }
            public func getOneofEnum() -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum? {
                switch self {
                case .oneofEnum(let enumValue): return enumValue
                default: return nil
                }
            }
        }
        //OneOf declaration end

        fileprivate var storageOneofField:TestAllTypes.OneofField =  TestAllTypes.OneofField.oneOfOneofFieldNotSet
        public func getOneOfOneofField() ->  TestAllTypes.OneofField {
            let copyObjectOneofField = storageOneofField
            return copyObjectOneofField
        }


            //Enum type declaration start 

            public enum NestedEnum:Int32, GeneratedEnum {
                case foo = 0
                case bar = 1
                case baz = 2
                public func toString() -> String {
                    switch self {
                    case .foo: return "FOO"
                    case .bar: return "BAR"
                    case .baz: return "BAZ"
                    }
                }
                public static func fromString(_ str:String) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum {
                    switch str {
                    case "FOO":    return .foo
                    case "BAR":    return .bar
                    case "BAZ":    return .baz
                    default: throw ProtocolBuffersError.invalidProtocolBuffer("Conversion failed.")
                    }
                }
                public var debugDescription:String { return getDescription() }
                public var description:String { return getDescription() }
                private func getDescription() -> String { 
                    switch self {
                    case .foo: return ".foo"
                    case .bar: return ".bar"
                    case .baz: return ".baz"
                    }
                }
                public var hashValue:Int {
                    return self.rawValue.hashValue
                }
                public static func ==(lhs:NestedEnum, rhs:NestedEnum) -> Bool {
                    return lhs.hashValue == rhs.hashValue
                }
            }

            //Enum type declaration end 

        /// Singular
        /// TODO: remove 'optional' labels as soon as CL 69188077 is LGTM'd to make
        /// 'optional' optional.
        public fileprivate(set) var optionalInt32:Int32! = nil
        public fileprivate(set) var hasOptionalInt32:Bool = false

        public fileprivate(set) var optionalInt64:Int64! = nil
        public fileprivate(set) var hasOptionalInt64:Bool = false

        public fileprivate(set) var optionalUint32:UInt32! = nil
        public fileprivate(set) var hasOptionalUint32:Bool = false

        public fileprivate(set) var optionalUint64:UInt64! = nil
        public fileprivate(set) var hasOptionalUint64:Bool = false

        public fileprivate(set) var optionalSint32:Int32! = nil
        public fileprivate(set) var hasOptionalSint32:Bool = false

        public fileprivate(set) var optionalSint64:Int64! = nil
        public fileprivate(set) var hasOptionalSint64:Bool = false

        public fileprivate(set) var optionalFixed32:UInt32! = nil
        public fileprivate(set) var hasOptionalFixed32:Bool = false

        public fileprivate(set) var optionalFixed64:UInt64! = nil
        public fileprivate(set) var hasOptionalFixed64:Bool = false

        public fileprivate(set) var optionalSfixed32:Int32! = nil
        public fileprivate(set) var hasOptionalSfixed32:Bool = false

        public fileprivate(set) var optionalSfixed64:Int64! = nil
        public fileprivate(set) var hasOptionalSfixed64:Bool = false

        public fileprivate(set) var optionalFloat:Float! = nil
        public fileprivate(set) var hasOptionalFloat:Bool = false

        public fileprivate(set) var optionalDouble:Double! = nil
        public fileprivate(set) var hasOptionalDouble:Bool = false

        public fileprivate(set) var optionalBool:Bool! = nil
        public fileprivate(set) var hasOptionalBool:Bool = false

        public fileprivate(set) var optionalString:String! = nil
        public fileprivate(set) var hasOptionalString:Bool = false

        public fileprivate(set) var optionalBytes:Data! = nil
        public fileprivate(set) var hasOptionalBytes:Bool = false

        public fileprivate(set) var optionalNestedMessage:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage!
        public fileprivate(set) var hasOptionalNestedMessage:Bool = false
        public fileprivate(set) var optionalForeignMessage:Proto2NofieldpresenceUnittest.ForeignMessage!
        public fileprivate(set) var hasOptionalForeignMessage:Bool = false
        public fileprivate(set) var optionalProto2Message:ProtobufUnittest.TestAllTypes!
        public fileprivate(set) var hasOptionalProto2Message:Bool = false
        public fileprivate(set) var optionalNestedEnum:Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum = Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum.foo
        public fileprivate(set) var hasOptionalNestedEnum:Bool = false
        public fileprivate(set) var optionalForeignEnum:Proto2NofieldpresenceUnittest.ForeignEnum = Proto2NofieldpresenceUnittest.ForeignEnum.foreignFoo
        public fileprivate(set) var hasOptionalForeignEnum:Bool = false
        public fileprivate(set) var optionalStringPiece:String! = nil
        public fileprivate(set) var hasOptionalStringPiece:Bool = false

        public fileprivate(set) var optionalCord:String! = nil
        public fileprivate(set) var hasOptionalCord:Bool = false

        public fileprivate(set) var optionalLazyMessage:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage!
        public fileprivate(set) var hasOptionalLazyMessage:Bool = false
        /// Repeated
        public fileprivate(set) var repeatedInt32:Array<Int32> = Array<Int32>()
        private var repeatedInt32MemoizedSerializedSize:Int32 = -1
        public fileprivate(set) var repeatedInt64:Array<Int64> = Array<Int64>()
        private var repeatedInt64MemoizedSerializedSize:Int32 = -1
        public fileprivate(set) var repeatedUint32:Array<UInt32> = Array<UInt32>()
        private var repeatedUint32MemoizedSerializedSize:Int32 = -1
        public fileprivate(set) var repeatedUint64:Array<UInt64> = Array<UInt64>()
        private var repeatedUint64MemoizedSerializedSize:Int32 = -1
        public fileprivate(set) var repeatedSint32:Array<Int32> = Array<Int32>()
        private var repeatedSint32MemoizedSerializedSize:Int32 = -1
        public fileprivate(set) var repeatedSint64:Array<Int64> = Array<Int64>()
        private var repeatedSint64MemoizedSerializedSize:Int32 = -1
        public fileprivate(set) var repeatedFixed32:Array<UInt32> = Array<UInt32>()
        private var repeatedFixed32MemoizedSerializedSize:Int32 = -1
        public fileprivate(set) var repeatedFixed64:Array<UInt64> = Array<UInt64>()
        private var repeatedFixed64MemoizedSerializedSize:Int32 = -1
        public fileprivate(set) var repeatedSfixed32:Array<Int32> = Array<Int32>()
        private var repeatedSfixed32MemoizedSerializedSize:Int32 = -1
        public fileprivate(set) var repeatedSfixed64:Array<Int64> = Array<Int64>()
        private var repeatedSfixed64MemoizedSerializedSize:Int32 = -1
        public fileprivate(set) var repeatedFloat:Array<Float> = Array<Float>()
        private var repeatedFloatMemoizedSerializedSize:Int32 = -1
        public fileprivate(set) var repeatedDouble:Array<Double> = Array<Double>()
        private var repeatedDoubleMemoizedSerializedSize:Int32 = -1
        public fileprivate(set) var repeatedBool:Array<Bool> = Array<Bool>()
        private var repeatedBoolMemoizedSerializedSize:Int32 = -1
        public fileprivate(set) var repeatedString:Array<String> = Array<String>()
        public fileprivate(set) var repeatedBytes:Array<Data> = Array<Data>()
        public fileprivate(set) var repeatedNestedMessage:Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage>  = Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage>()
        public fileprivate(set) var repeatedForeignMessage:Array<Proto2NofieldpresenceUnittest.ForeignMessage>  = Array<Proto2NofieldpresenceUnittest.ForeignMessage>()
        public fileprivate(set) var repeatedProto2Message:Array<ProtobufUnittest.TestAllTypes>  = Array<ProtobufUnittest.TestAllTypes>()
        private var repeatedNestedEnumMemoizedSerializedSize:Int32 = 0
        public fileprivate(set) var repeatedNestedEnum:Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum> = Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum>()
        private var repeatedForeignEnumMemoizedSerializedSize:Int32 = 0
        public fileprivate(set) var repeatedForeignEnum:Array<Proto2NofieldpresenceUnittest.ForeignEnum> = Array<Proto2NofieldpresenceUnittest.ForeignEnum>()
        public fileprivate(set) var repeatedStringPiece:Array<String> = Array<String>()
        public fileprivate(set) var repeatedCord:Array<String> = Array<String>()
        public fileprivate(set) var repeatedLazyMessage:Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage>  = Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage>()
        public fileprivate(set) var oneofUint32:UInt32!{
            get {
                return TestAllTypes.OneofField.getOneofUint32(storageOneofField)
            }
            set (newvalue) {
                storageOneofField = TestAllTypes.OneofField.oneofUint32(newvalue)
            }
        }
        public fileprivate(set) var hasOneofUint32:Bool {
            get {
                return TestAllTypes.OneofField.getOneofUint32(storageOneofField) != nil
            }
            set(newValue) {
            }
        }
        public fileprivate(set) var oneofNestedMessage:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage!{
            get {
                return TestAllTypes.OneofField.getOneofNestedMessage(storageOneofField)
            }
            set (newvalue) {
                storageOneofField = TestAllTypes.OneofField.oneofNestedMessage(newvalue)
            }
        }
        public fileprivate(set) var hasOneofNestedMessage:Bool {
            get {
                return TestAllTypes.OneofField.getOneofNestedMessage(storageOneofField) != nil
            }
            set(newValue) {
            }
        }
        public fileprivate(set) var oneofString:String!{
            get {
                return TestAllTypes.OneofField.getOneofString(storageOneofField)
            }
            set (newvalue) {
                storageOneofField = TestAllTypes.OneofField.oneofString(newvalue)
            }
        }
        public fileprivate(set) var hasOneofString:Bool {
            get {
                return TestAllTypes.OneofField.getOneofString(storageOneofField) != nil
            }
            set(newValue) {
            }
        }
        public fileprivate(set) var oneofEnum:Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum!{
            get {
                return TestAllTypes.OneofField.getOneofEnum(storageOneofField)
            }
            set (newvalue) {
                storageOneofField = TestAllTypes.OneofField.oneofEnum(newvalue)
            }
        }
        public fileprivate(set) var hasOneofEnum:Bool {
            get {
                return TestAllTypes.OneofField.getOneofEnum(storageOneofField) != nil
            }
            set(newValue) {
            }
        }
        required public init() {
            super.init()
        }
        override public func isInitialized() throws {
        }
        override public func writeTo(codedOutputStream: CodedOutputStream) throws {
            if hasOptionalInt32 {
                try codedOutputStream.writeInt32(fieldNumber: 1, value:optionalInt32)
            }
            if hasOptionalInt64 {
                try codedOutputStream.writeInt64(fieldNumber: 2, value:optionalInt64)
            }
            if hasOptionalUint32 {
                try codedOutputStream.writeUInt32(fieldNumber: 3, value:optionalUint32)
            }
            if hasOptionalUint64 {
                try codedOutputStream.writeUInt64(fieldNumber: 4, value:optionalUint64)
            }
            if hasOptionalSint32 {
                try codedOutputStream.writeSInt32(fieldNumber: 5, value:optionalSint32)
            }
            if hasOptionalSint64 {
                try codedOutputStream.writeSInt64(fieldNumber: 6, value:optionalSint64)
            }
            if hasOptionalFixed32 {
                try codedOutputStream.writeFixed32(fieldNumber: 7, value:optionalFixed32)
            }
            if hasOptionalFixed64 {
                try codedOutputStream.writeFixed64(fieldNumber: 8, value:optionalFixed64)
            }
            if hasOptionalSfixed32 {
                try codedOutputStream.writeSFixed32(fieldNumber: 9, value:optionalSfixed32)
            }
            if hasOptionalSfixed64 {
                try codedOutputStream.writeSFixed64(fieldNumber: 10, value:optionalSfixed64)
            }
            if hasOptionalFloat {
                try codedOutputStream.writeFloat(fieldNumber: 11, value:optionalFloat)
            }
            if hasOptionalDouble {
                try codedOutputStream.writeDouble(fieldNumber: 12, value:optionalDouble)
            }
            if hasOptionalBool {
                try codedOutputStream.writeBool(fieldNumber: 13, value:optionalBool)
            }
            if hasOptionalString {
                try codedOutputStream.writeString(fieldNumber: 14, value:optionalString)
            }
            if hasOptionalBytes {
                try codedOutputStream.writeData(fieldNumber: 15, value:optionalBytes)
            }
            if hasOptionalNestedMessage {
                try codedOutputStream.writeMessage(fieldNumber: 18, value:optionalNestedMessage)
            }
            if hasOptionalForeignMessage {
                try codedOutputStream.writeMessage(fieldNumber: 19, value:optionalForeignMessage)
            }
            if hasOptionalProto2Message {
                try codedOutputStream.writeMessage(fieldNumber: 20, value:optionalProto2Message)
            }
            if hasOptionalNestedEnum {
                try codedOutputStream.writeEnum(fieldNumber: 21, value:optionalNestedEnum.rawValue)
            }
            if hasOptionalForeignEnum {
                try codedOutputStream.writeEnum(fieldNumber: 22, value:optionalForeignEnum.rawValue)
            }
            if hasOptionalStringPiece {
                try codedOutputStream.writeString(fieldNumber: 24, value:optionalStringPiece)
            }
            if hasOptionalCord {
                try codedOutputStream.writeString(fieldNumber: 25, value:optionalCord)
            }
            if hasOptionalLazyMessage {
                try codedOutputStream.writeMessage(fieldNumber: 30, value:optionalLazyMessage)
            }
            if !repeatedInt32.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 250)
                try codedOutputStream.writeRawVarint32(value: repeatedInt32MemoizedSerializedSize)
                for oneValuerepeatedInt32 in repeatedInt32 {
                    try codedOutputStream.writeInt32NoTag(value: oneValuerepeatedInt32)
                }
            }
            if !repeatedInt64.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 258)
                try codedOutputStream.writeRawVarint32(value: repeatedInt64MemoizedSerializedSize)
                for oneValuerepeatedInt64 in repeatedInt64 {
                    try codedOutputStream.writeInt64NoTag(value: oneValuerepeatedInt64)
                }
            }
            if !repeatedUint32.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 266)
                try codedOutputStream.writeRawVarint32(value: repeatedUint32MemoizedSerializedSize)
                for oneValuerepeatedUint32 in repeatedUint32 {
                    try codedOutputStream.writeUInt32NoTag(value: oneValuerepeatedUint32)
                }
            }
            if !repeatedUint64.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 274)
                try codedOutputStream.writeRawVarint32(value: repeatedUint64MemoizedSerializedSize)
                for oneValuerepeatedUint64 in repeatedUint64 {
                    try codedOutputStream.writeUInt64NoTag(value: oneValuerepeatedUint64)
                }
            }
            if !repeatedSint32.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 282)
                try codedOutputStream.writeRawVarint32(value: repeatedSint32MemoizedSerializedSize)
                for oneValuerepeatedSint32 in repeatedSint32 {
                    try codedOutputStream.writeSInt32NoTag(value: oneValuerepeatedSint32)
                }
            }
            if !repeatedSint64.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 290)
                try codedOutputStream.writeRawVarint32(value: repeatedSint64MemoizedSerializedSize)
                for oneValuerepeatedSint64 in repeatedSint64 {
                    try codedOutputStream.writeSInt64NoTag(value: oneValuerepeatedSint64)
                }
            }
            if !repeatedFixed32.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 298)
                try codedOutputStream.writeRawVarint32(value: repeatedFixed32MemoizedSerializedSize)
                for oneValuerepeatedFixed32 in repeatedFixed32 {
                    try codedOutputStream.writeFixed32NoTag(value: oneValuerepeatedFixed32)
                }
            }
            if !repeatedFixed64.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 306)
                try codedOutputStream.writeRawVarint32(value: repeatedFixed64MemoizedSerializedSize)
                for oneValuerepeatedFixed64 in repeatedFixed64 {
                    try codedOutputStream.writeFixed64NoTag(value: oneValuerepeatedFixed64)
                }
            }
            if !repeatedSfixed32.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 314)
                try codedOutputStream.writeRawVarint32(value: repeatedSfixed32MemoizedSerializedSize)
                for oneValuerepeatedSfixed32 in repeatedSfixed32 {
                    try codedOutputStream.writeSFixed32NoTag(value: oneValuerepeatedSfixed32)
                }
            }
            if !repeatedSfixed64.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 322)
                try codedOutputStream.writeRawVarint32(value: repeatedSfixed64MemoizedSerializedSize)
                for oneValuerepeatedSfixed64 in repeatedSfixed64 {
                    try codedOutputStream.writeSFixed64NoTag(value: oneValuerepeatedSfixed64)
                }
            }
            if !repeatedFloat.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 330)
                try codedOutputStream.writeRawVarint32(value: repeatedFloatMemoizedSerializedSize)
                for oneValuerepeatedFloat in repeatedFloat {
                    try codedOutputStream.writeFloatNoTag(value: oneValuerepeatedFloat)
                }
            }
            if !repeatedDouble.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 338)
                try codedOutputStream.writeRawVarint32(value: repeatedDoubleMemoizedSerializedSize)
                for oneValuerepeatedDouble in repeatedDouble {
                    try codedOutputStream.writeDoubleNoTag(value: oneValuerepeatedDouble)
                }
            }
            if !repeatedBool.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 346)
                try codedOutputStream.writeRawVarint32(value: repeatedBoolMemoizedSerializedSize)
                for oneValuerepeatedBool in repeatedBool {
                    try codedOutputStream.writeBoolNoTag(value: oneValuerepeatedBool)
                }
            }
            if !repeatedString.isEmpty {
                for oneValuerepeatedString in repeatedString {
                    try codedOutputStream.writeString(fieldNumber: 44, value:oneValuerepeatedString)
                }
            }
            if !repeatedBytes.isEmpty {
                for oneValuerepeatedBytes in repeatedBytes {
                    try codedOutputStream.writeData(fieldNumber: 45, value:oneValuerepeatedBytes)
                }
            }
            for oneElementRepeatedNestedMessage in repeatedNestedMessage {
                  try codedOutputStream.writeMessage(fieldNumber: 48, value:oneElementRepeatedNestedMessage)
            }
            for oneElementRepeatedForeignMessage in repeatedForeignMessage {
                  try codedOutputStream.writeMessage(fieldNumber: 49, value:oneElementRepeatedForeignMessage)
            }
            for oneElementRepeatedProto2Message in repeatedProto2Message {
                  try codedOutputStream.writeMessage(fieldNumber: 50, value:oneElementRepeatedProto2Message)
            }
            if !repeatedNestedEnum.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 410)
                try codedOutputStream.writeRawVarint32(value: repeatedNestedEnumMemoizedSerializedSize)
            }
            for oneValueOfrepeatedNestedEnum in repeatedNestedEnum {
                  try codedOutputStream.writeEnumNoTag(value: oneValueOfrepeatedNestedEnum.rawValue)
            }
            if !repeatedForeignEnum.isEmpty {
                try codedOutputStream.writeRawVarint32(value: 418)
                try codedOutputStream.writeRawVarint32(value: repeatedForeignEnumMemoizedSerializedSize)
            }
            for oneValueOfrepeatedForeignEnum in repeatedForeignEnum {
                  try codedOutputStream.writeEnumNoTag(value: oneValueOfrepeatedForeignEnum.rawValue)
            }
            if !repeatedStringPiece.isEmpty {
                for oneValuerepeatedStringPiece in repeatedStringPiece {
                    try codedOutputStream.writeString(fieldNumber: 54, value:oneValuerepeatedStringPiece)
                }
            }
            if !repeatedCord.isEmpty {
                for oneValuerepeatedCord in repeatedCord {
                    try codedOutputStream.writeString(fieldNumber: 55, value:oneValuerepeatedCord)
                }
            }
            for oneElementRepeatedLazyMessage in repeatedLazyMessage {
                  try codedOutputStream.writeMessage(fieldNumber: 57, value:oneElementRepeatedLazyMessage)
            }
            if hasOneofUint32 {
                try codedOutputStream.writeUInt32(fieldNumber: 111, value:oneofUint32)
            }
            if hasOneofNestedMessage {
                try codedOutputStream.writeMessage(fieldNumber: 112, value:oneofNestedMessage)
            }
            if hasOneofString {
                try codedOutputStream.writeString(fieldNumber: 113, value:oneofString)
            }
            if hasOneofEnum {
                try codedOutputStream.writeEnum(fieldNumber: 114, value:oneofEnum.rawValue)
            }
            try unknownFields.writeTo(codedOutputStream: codedOutputStream)
        }
        override public func serializedSize() -> Int32 {
            var serialize_size:Int32 = memoizedSerializedSize
            if serialize_size != -1 {
             return serialize_size
            }

            serialize_size = 0
            if hasOptionalInt32 {
                serialize_size += optionalInt32.computeInt32Size(fieldNumber: 1)
            }
            if hasOptionalInt64 {
                serialize_size += optionalInt64.computeInt64Size(fieldNumber: 2)
            }
            if hasOptionalUint32 {
                serialize_size += optionalUint32.computeUInt32Size(fieldNumber: 3)
            }
            if hasOptionalUint64 {
                serialize_size += optionalUint64.computeUInt64Size(fieldNumber: 4)
            }
            if hasOptionalSint32 {
                serialize_size += optionalSint32.computeSInt32Size(fieldNumber: 5)
            }
            if hasOptionalSint64 {
                serialize_size += optionalSint64.computeSInt64Size(fieldNumber: 6)
            }
            if hasOptionalFixed32 {
                serialize_size += optionalFixed32.computeFixed32Size(fieldNumber: 7)
            }
            if hasOptionalFixed64 {
                serialize_size += optionalFixed64.computeFixed64Size(fieldNumber: 8)
            }
            if hasOptionalSfixed32 {
                serialize_size += optionalSfixed32.computeSFixed32Size(fieldNumber: 9)
            }
            if hasOptionalSfixed64 {
                serialize_size += optionalSfixed64.computeSFixed64Size(fieldNumber: 10)
            }
            if hasOptionalFloat {
                serialize_size += optionalFloat.computeFloatSize(fieldNumber: 11)
            }
            if hasOptionalDouble {
                serialize_size += optionalDouble.computeDoubleSize(fieldNumber: 12)
            }
            if hasOptionalBool {
                serialize_size += optionalBool.computeBoolSize(fieldNumber: 13)
            }
            if hasOptionalString {
                serialize_size += optionalString.computeStringSize(fieldNumber: 14)
            }
            if hasOptionalBytes {
                serialize_size += optionalBytes.computeDataSize(fieldNumber: 15)
            }
            if hasOptionalNestedMessage {
                if let varSizeoptionalNestedMessage = optionalNestedMessage?.computeMessageSize(fieldNumber: 18) {
                    serialize_size += varSizeoptionalNestedMessage
                }
            }
            if hasOptionalForeignMessage {
                if let varSizeoptionalForeignMessage = optionalForeignMessage?.computeMessageSize(fieldNumber: 19) {
                    serialize_size += varSizeoptionalForeignMessage
                }
            }
            if hasOptionalProto2Message {
                if let varSizeoptionalProto2Message = optionalProto2Message?.computeMessageSize(fieldNumber: 20) {
                    serialize_size += varSizeoptionalProto2Message
                }
            }
            if (hasOptionalNestedEnum) {
                serialize_size += optionalNestedEnum.rawValue.computeEnumSize(fieldNumber: 21)
            }
            if (hasOptionalForeignEnum) {
                serialize_size += optionalForeignEnum.rawValue.computeEnumSize(fieldNumber: 22)
            }
            if hasOptionalStringPiece {
                serialize_size += optionalStringPiece.computeStringSize(fieldNumber: 24)
            }
            if hasOptionalCord {
                serialize_size += optionalCord.computeStringSize(fieldNumber: 25)
            }
            if hasOptionalLazyMessage {
                if let varSizeoptionalLazyMessage = optionalLazyMessage?.computeMessageSize(fieldNumber: 30) {
                    serialize_size += varSizeoptionalLazyMessage
                }
            }
            var dataSizeRepeatedInt32:Int32 = 0
            for oneValuerepeatedInt32 in repeatedInt32 {
                dataSizeRepeatedInt32 += oneValuerepeatedInt32.computeInt32SizeNoTag()
            }
            serialize_size += dataSizeRepeatedInt32
            if !repeatedInt32.isEmpty {
                serialize_size += 2
                serialize_size += dataSizeRepeatedInt32.computeInt32SizeNoTag()
            }
            repeatedInt32MemoizedSerializedSize = dataSizeRepeatedInt32
            var dataSizeRepeatedInt64:Int32 = 0
            for oneValuerepeatedInt64 in repeatedInt64 {
                dataSizeRepeatedInt64 += oneValuerepeatedInt64.computeInt64SizeNoTag()
            }
            serialize_size += dataSizeRepeatedInt64
            if !repeatedInt64.isEmpty {
                serialize_size += 2
                serialize_size += dataSizeRepeatedInt64.computeInt32SizeNoTag()
            }
            repeatedInt64MemoizedSerializedSize = dataSizeRepeatedInt64
            var dataSizeRepeatedUint32:Int32 = 0
            for oneValuerepeatedUint32 in repeatedUint32 {
                dataSizeRepeatedUint32 += oneValuerepeatedUint32.computeUInt32SizeNoTag()
            }
            serialize_size += dataSizeRepeatedUint32
            if !repeatedUint32.isEmpty {
                serialize_size += 2
                serialize_size += dataSizeRepeatedUint32.computeInt32SizeNoTag()
            }
            repeatedUint32MemoizedSerializedSize = dataSizeRepeatedUint32
            var dataSizeRepeatedUint64:Int32 = 0
            for oneValuerepeatedUint64 in repeatedUint64 {
                dataSizeRepeatedUint64 += oneValuerepeatedUint64.computeUInt64SizeNoTag()
            }
            serialize_size += dataSizeRepeatedUint64
            if !repeatedUint64.isEmpty {
                serialize_size += 2
                serialize_size += dataSizeRepeatedUint64.computeInt32SizeNoTag()
            }
            repeatedUint64MemoizedSerializedSize = dataSizeRepeatedUint64
            var dataSizeRepeatedSint32:Int32 = 0
            for oneValuerepeatedSint32 in repeatedSint32 {
                dataSizeRepeatedSint32 += oneValuerepeatedSint32.computeSInt32SizeNoTag()
            }
            serialize_size += dataSizeRepeatedSint32
            if !repeatedSint32.isEmpty {
                serialize_size += 2
                serialize_size += dataSizeRepeatedSint32.computeInt32SizeNoTag()
            }
            repeatedSint32MemoizedSerializedSize = dataSizeRepeatedSint32
            var dataSizeRepeatedSint64:Int32 = 0
            for oneValuerepeatedSint64 in repeatedSint64 {
                dataSizeRepeatedSint64 += oneValuerepeatedSint64.computeSInt64SizeNoTag()
            }
            serialize_size += dataSizeRepeatedSint64
            if !repeatedSint64.isEmpty {
                serialize_size += 2
                serialize_size += dataSizeRepeatedSint64.computeInt32SizeNoTag()
            }
            repeatedSint64MemoizedSerializedSize = dataSizeRepeatedSint64
            var dataSizeRepeatedFixed32:Int32 = 0
            dataSizeRepeatedFixed32 = 4 * Int32(repeatedFixed32.count)
            serialize_size += dataSizeRepeatedFixed32
            if !repeatedFixed32.isEmpty {
                serialize_size += 2
                serialize_size += dataSizeRepeatedFixed32.computeInt32SizeNoTag()
            }
            repeatedFixed32MemoizedSerializedSize = dataSizeRepeatedFixed32
            var dataSizeRepeatedFixed64:Int32 = 0
            dataSizeRepeatedFixed64 = 8 * Int32(repeatedFixed64.count)
            serialize_size += dataSizeRepeatedFixed64
            if !repeatedFixed64.isEmpty {
                serialize_size += 2
                serialize_size += dataSizeRepeatedFixed64.computeInt32SizeNoTag()
            }
            repeatedFixed64MemoizedSerializedSize = dataSizeRepeatedFixed64
            var dataSizeRepeatedSfixed32:Int32 = 0
            dataSizeRepeatedSfixed32 = 4 * Int32(repeatedSfixed32.count)
            serialize_size += dataSizeRepeatedSfixed32
            if !repeatedSfixed32.isEmpty {
                serialize_size += 2
                serialize_size += dataSizeRepeatedSfixed32.computeInt32SizeNoTag()
            }
            repeatedSfixed32MemoizedSerializedSize = dataSizeRepeatedSfixed32
            var dataSizeRepeatedSfixed64:Int32 = 0
            dataSizeRepeatedSfixed64 = 8 * Int32(repeatedSfixed64.count)
            serialize_size += dataSizeRepeatedSfixed64
            if !repeatedSfixed64.isEmpty {
                serialize_size += 2
                serialize_size += dataSizeRepeatedSfixed64.computeInt32SizeNoTag()
            }
            repeatedSfixed64MemoizedSerializedSize = dataSizeRepeatedSfixed64
            var dataSizeRepeatedFloat:Int32 = 0
            dataSizeRepeatedFloat = 4 * Int32(repeatedFloat.count)
            serialize_size += dataSizeRepeatedFloat
            if !repeatedFloat.isEmpty {
                serialize_size += 2
                serialize_size += dataSizeRepeatedFloat.computeInt32SizeNoTag()
            }
            repeatedFloatMemoizedSerializedSize = dataSizeRepeatedFloat
            var dataSizeRepeatedDouble:Int32 = 0
            dataSizeRepeatedDouble = 8 * Int32(repeatedDouble.count)
            serialize_size += dataSizeRepeatedDouble
            if !repeatedDouble.isEmpty {
                serialize_size += 2
                serialize_size += dataSizeRepeatedDouble.computeInt32SizeNoTag()
            }
            repeatedDoubleMemoizedSerializedSize = dataSizeRepeatedDouble
            var dataSizeRepeatedBool:Int32 = 0
            dataSizeRepeatedBool = 1 * Int32(repeatedBool.count)
            serialize_size += dataSizeRepeatedBool
            if !repeatedBool.isEmpty {
                serialize_size += 2
                serialize_size += dataSizeRepeatedBool.computeInt32SizeNoTag()
            }
            repeatedBoolMemoizedSerializedSize = dataSizeRepeatedBool
            var dataSizeRepeatedString:Int32 = 0
            for oneValuerepeatedString in repeatedString {
                dataSizeRepeatedString += oneValuerepeatedString.computeStringSizeNoTag()
            }
            serialize_size += dataSizeRepeatedString
            serialize_size += 2 * Int32(repeatedString.count)
            var dataSizeRepeatedBytes:Int32 = 0
            for oneValuerepeatedBytes in repeatedBytes {
                dataSizeRepeatedBytes += oneValuerepeatedBytes.computeDataSizeNoTag()
            }
            serialize_size += dataSizeRepeatedBytes
            serialize_size += 2 * Int32(repeatedBytes.count)
            for oneElementRepeatedNestedMessage in repeatedNestedMessage {
                serialize_size += oneElementRepeatedNestedMessage.computeMessageSize(fieldNumber: 48)
            }
            for oneElementRepeatedForeignMessage in repeatedForeignMessage {
                serialize_size += oneElementRepeatedForeignMessage.computeMessageSize(fieldNumber: 49)
            }
            for oneElementRepeatedProto2Message in repeatedProto2Message {
                serialize_size += oneElementRepeatedProto2Message.computeMessageSize(fieldNumber: 50)
            }
            var dataSizerepeatedNestedEnum:Int32 = 0
            for oneValueOfrepeatedNestedEnum in repeatedNestedEnum {
                dataSizerepeatedNestedEnum += oneValueOfrepeatedNestedEnum.rawValue.computeEnumSizeNoTag()
            }
            serialize_size += dataSizerepeatedNestedEnum
            if !repeatedNestedEnum.isEmpty {
                serialize_size += 2
                serialize_size += dataSizerepeatedNestedEnum.computeRawVarint32Size()
            }
            repeatedNestedEnumMemoizedSerializedSize = dataSizerepeatedNestedEnum
            var dataSizerepeatedForeignEnum:Int32 = 0
            for oneValueOfrepeatedForeignEnum in repeatedForeignEnum {
                dataSizerepeatedForeignEnum += oneValueOfrepeatedForeignEnum.rawValue.computeEnumSizeNoTag()
            }
            serialize_size += dataSizerepeatedForeignEnum
            if !repeatedForeignEnum.isEmpty {
                serialize_size += 2
                serialize_size += dataSizerepeatedForeignEnum.computeRawVarint32Size()
            }
            repeatedForeignEnumMemoizedSerializedSize = dataSizerepeatedForeignEnum
            var dataSizeRepeatedStringPiece:Int32 = 0
            for oneValuerepeatedStringPiece in repeatedStringPiece {
                dataSizeRepeatedStringPiece += oneValuerepeatedStringPiece.computeStringSizeNoTag()
            }
            serialize_size += dataSizeRepeatedStringPiece
            serialize_size += 2 * Int32(repeatedStringPiece.count)
            var dataSizeRepeatedCord:Int32 = 0
            for oneValuerepeatedCord in repeatedCord {
                dataSizeRepeatedCord += oneValuerepeatedCord.computeStringSizeNoTag()
            }
            serialize_size += dataSizeRepeatedCord
            serialize_size += 2 * Int32(repeatedCord.count)
            for oneElementRepeatedLazyMessage in repeatedLazyMessage {
                serialize_size += oneElementRepeatedLazyMessage.computeMessageSize(fieldNumber: 57)
            }
            if hasOneofUint32 {
                serialize_size += oneofUint32.computeUInt32Size(fieldNumber: 111)
            }
            if hasOneofNestedMessage {
                if let varSizeoneofNestedMessage = oneofNestedMessage?.computeMessageSize(fieldNumber: 112) {
                    serialize_size += varSizeoneofNestedMessage
                }
            }
            if hasOneofString {
                serialize_size += oneofString.computeStringSize(fieldNumber: 113)
            }
            if (hasOneofEnum) {
                serialize_size += oneofEnum.rawValue.computeEnumSize(fieldNumber: 114)
            }
            serialize_size += unknownFields.serializedSize()
            memoizedSerializedSize = serialize_size
            return serialize_size
        }
        public class func getBuilder() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
            return Proto2NofieldpresenceUnittest.TestAllTypes.classBuilder() as! Proto2NofieldpresenceUnittest.TestAllTypes.Builder
        }
        public func getBuilder() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
            return classBuilder() as! Proto2NofieldpresenceUnittest.TestAllTypes.Builder
        }
        override public class func classBuilder() -> ProtocolBuffersMessageBuilder {
            return Proto2NofieldpresenceUnittest.TestAllTypes.Builder()
        }
        override public func classBuilder() -> ProtocolBuffersMessageBuilder {
            return Proto2NofieldpresenceUnittest.TestAllTypes.Builder()
        }
        public func toBuilder() throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
            return try Proto2NofieldpresenceUnittest.TestAllTypes.builderWithPrototype(prototype:self)
        }
        public class func builderWithPrototype(prototype:Proto2NofieldpresenceUnittest.TestAllTypes) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
            return try Proto2NofieldpresenceUnittest.TestAllTypes.Builder().mergeFrom(other:prototype)
        }
        override public func encode() throws -> Dictionary<String,Any> {
            try isInitialized()
            var jsonMap:Dictionary<String,Any> = Dictionary<String,Any>()
            if hasOptionalInt32 {
                jsonMap["optionalInt32"] = Int(optionalInt32)
            }
            if hasOptionalInt64 {
                jsonMap["optionalInt64"] = "\(optionalInt64!)"
            }
            if hasOptionalUint32 {
                jsonMap["optionalUint32"] = UInt(optionalUint32)
            }
            if hasOptionalUint64 {
                jsonMap["optionalUint64"] = "\(optionalUint64!)"
            }
            if hasOptionalSint32 {
                jsonMap["optionalSint32"] = Int(optionalSint32)
            }
            if hasOptionalSint64 {
                jsonMap["optionalSint64"] = "\(optionalSint64!)"
            }
            if hasOptionalFixed32 {
                jsonMap["optionalFixed32"] = UInt(optionalFixed32)
            }
            if hasOptionalFixed64 {
                jsonMap["optionalFixed64"] = "\(optionalFixed64!)"
            }
            if hasOptionalSfixed32 {
                jsonMap["optionalSfixed32"] = Int(optionalSfixed32)
            }
            if hasOptionalSfixed64 {
                jsonMap["optionalSfixed64"] = "\(optionalSfixed64!)"
            }
            if hasOptionalFloat {
                jsonMap["optionalFloat"] = Float(optionalFloat)
            }
            if hasOptionalDouble {
                jsonMap["optionalDouble"] = Double(optionalDouble)
            }
            if hasOptionalBool {
                jsonMap["optionalBool"] = optionalBool
            }
            if hasOptionalString {
                jsonMap["optionalString"] = optionalString
            }
            if hasOptionalBytes {
                jsonMap["optionalBytes"] = optionalBytes.base64EncodedString(options: Data.Base64EncodingOptions(rawValue: 0))
            }
            if hasOptionalNestedMessage {
                jsonMap["optionalNestedMessage"] = try optionalNestedMessage.encode()
            }
            if hasOptionalForeignMessage {
                jsonMap["optionalForeignMessage"] = try optionalForeignMessage.encode()
            }
            if hasOptionalProto2Message {
                jsonMap["optionalProto2Message"] = try optionalProto2Message.encode()
            }
            if hasOptionalNestedEnum {
                jsonMap["optionalNestedEnum"] = optionalNestedEnum.toString()
            }
            if hasOptionalForeignEnum {
                jsonMap["optionalForeignEnum"] = optionalForeignEnum.toString()
            }
            if hasOptionalStringPiece {
                jsonMap["optionalStringPiece"] = optionalStringPiece
            }
            if hasOptionalCord {
                jsonMap["optionalCord"] = optionalCord
            }
            if hasOptionalLazyMessage {
                jsonMap["optionalLazyMessage"] = try optionalLazyMessage.encode()
            }
            if !repeatedInt32.isEmpty {
                var jsonArrayRepeatedInt32:Array<Int> = []
                for oneValueRepeatedInt32 in repeatedInt32 {
                    jsonArrayRepeatedInt32.append(Int(oneValueRepeatedInt32))
                }
                jsonMap["repeatedInt32"] = jsonArrayRepeatedInt32
            }
            if !repeatedInt64.isEmpty {
                var jsonArrayRepeatedInt64:Array<String> = []
                for oneValueRepeatedInt64 in repeatedInt64 {
                    jsonArrayRepeatedInt64.append("\(oneValueRepeatedInt64)")
                }
                jsonMap["repeatedInt64"] = jsonArrayRepeatedInt64
            }
            if !repeatedUint32.isEmpty {
                var jsonArrayRepeatedUint32:Array<UInt> = []
                for oneValueRepeatedUint32 in repeatedUint32 {
                    jsonArrayRepeatedUint32.append(UInt(oneValueRepeatedUint32))
                }
                jsonMap["repeatedUint32"] = jsonArrayRepeatedUint32
            }
            if !repeatedUint64.isEmpty {
                var jsonArrayRepeatedUint64:Array<String> = []
                for oneValueRepeatedUint64 in repeatedUint64 {
                    jsonArrayRepeatedUint64.append("\(oneValueRepeatedUint64)")
                }
                jsonMap["repeatedUint64"] = jsonArrayRepeatedUint64
            }
            if !repeatedSint32.isEmpty {
                var jsonArrayRepeatedSint32:Array<Int> = []
                for oneValueRepeatedSint32 in repeatedSint32 {
                    jsonArrayRepeatedSint32.append(Int(oneValueRepeatedSint32))
                }
                jsonMap["repeatedSint32"] = jsonArrayRepeatedSint32
            }
            if !repeatedSint64.isEmpty {
                var jsonArrayRepeatedSint64:Array<String> = []
                for oneValueRepeatedSint64 in repeatedSint64 {
                    jsonArrayRepeatedSint64.append("\(oneValueRepeatedSint64)")
                }
                jsonMap["repeatedSint64"] = jsonArrayRepeatedSint64
            }
            if !repeatedFixed32.isEmpty {
                var jsonArrayRepeatedFixed32:Array<UInt> = []
                for oneValueRepeatedFixed32 in repeatedFixed32 {
                    jsonArrayRepeatedFixed32.append(UInt(oneValueRepeatedFixed32))
                }
                jsonMap["repeatedFixed32"] = jsonArrayRepeatedFixed32
            }
            if !repeatedFixed64.isEmpty {
                var jsonArrayRepeatedFixed64:Array<String> = []
                for oneValueRepeatedFixed64 in repeatedFixed64 {
                    jsonArrayRepeatedFixed64.append("\(oneValueRepeatedFixed64)")
                }
                jsonMap["repeatedFixed64"] = jsonArrayRepeatedFixed64
            }
            if !repeatedSfixed32.isEmpty {
                var jsonArrayRepeatedSfixed32:Array<Int> = []
                for oneValueRepeatedSfixed32 in repeatedSfixed32 {
                    jsonArrayRepeatedSfixed32.append(Int(oneValueRepeatedSfixed32))
                }
                jsonMap["repeatedSfixed32"] = jsonArrayRepeatedSfixed32
            }
            if !repeatedSfixed64.isEmpty {
                var jsonArrayRepeatedSfixed64:Array<String> = []
                for oneValueRepeatedSfixed64 in repeatedSfixed64 {
                    jsonArrayRepeatedSfixed64.append("\(oneValueRepeatedSfixed64)")
                }
                jsonMap["repeatedSfixed64"] = jsonArrayRepeatedSfixed64
            }
            if !repeatedFloat.isEmpty {
                var jsonArrayRepeatedFloat:Array<Float> = []
                for oneValueRepeatedFloat in repeatedFloat {
                    jsonArrayRepeatedFloat.append(Float(oneValueRepeatedFloat))
                }
                jsonMap["repeatedFloat"] = jsonArrayRepeatedFloat
            }
            if !repeatedDouble.isEmpty {
                var jsonArrayRepeatedDouble:Array<Double> = []
                for oneValueRepeatedDouble in repeatedDouble {
                    jsonArrayRepeatedDouble.append(Double(oneValueRepeatedDouble))
                }
                jsonMap["repeatedDouble"] = jsonArrayRepeatedDouble
            }
            if !repeatedBool.isEmpty {
                var jsonArrayRepeatedBool:Array<Bool> = []
                for oneValueRepeatedBool in repeatedBool {
                    jsonArrayRepeatedBool.append(oneValueRepeatedBool)
                }
                jsonMap["repeatedBool"] = jsonArrayRepeatedBool
            }
            if !repeatedString.isEmpty {
                var jsonArrayRepeatedString:Array<String> = []
                for oneValueRepeatedString in repeatedString {
                    jsonArrayRepeatedString.append(oneValueRepeatedString)
                }
                jsonMap["repeatedString"] = jsonArrayRepeatedString
            }
            if !repeatedBytes.isEmpty {
                var jsonArrayRepeatedBytes:Array<String> = []
                for oneValueRepeatedBytes in repeatedBytes {
                    jsonArrayRepeatedBytes.append(oneValueRepeatedBytes.base64EncodedString(options: Data.Base64EncodingOptions(rawValue: 0)))
                }
                jsonMap["repeatedBytes"] = jsonArrayRepeatedBytes
            }
            if !repeatedNestedMessage.isEmpty {
                var jsonArrayRepeatedNestedMessage:Array<Dictionary<String,Any>> = []
                for oneValueRepeatedNestedMessage in repeatedNestedMessage {
                    let ecodedMessageRepeatedNestedMessage = try oneValueRepeatedNestedMessage.encode()
                    jsonArrayRepeatedNestedMessage.append(ecodedMessageRepeatedNestedMessage)
                }
                jsonMap["repeatedNestedMessage"] = jsonArrayRepeatedNestedMessage
            }
            if !repeatedForeignMessage.isEmpty {
                var jsonArrayRepeatedForeignMessage:Array<Dictionary<String,Any>> = []
                for oneValueRepeatedForeignMessage in repeatedForeignMessage {
                    let ecodedMessageRepeatedForeignMessage = try oneValueRepeatedForeignMessage.encode()
                    jsonArrayRepeatedForeignMessage.append(ecodedMessageRepeatedForeignMessage)
                }
                jsonMap["repeatedForeignMessage"] = jsonArrayRepeatedForeignMessage
            }
            if !repeatedProto2Message.isEmpty {
                var jsonArrayRepeatedProto2Message:Array<Dictionary<String,Any>> = []
                for oneValueRepeatedProto2Message in repeatedProto2Message {
                    let ecodedMessageRepeatedProto2Message = try oneValueRepeatedProto2Message.encode()
                    jsonArrayRepeatedProto2Message.append(ecodedMessageRepeatedProto2Message)
                }
                jsonMap["repeatedProto2Message"] = jsonArrayRepeatedProto2Message
            }
            if !repeatedNestedEnum.isEmpty {
                var jsonArrayRepeatedNestedEnum:Array<String> = []
                for oneValueRepeatedNestedEnum in repeatedNestedEnum {
                    jsonArrayRepeatedNestedEnum.append(oneValueRepeatedNestedEnum.toString())
                }
                jsonMap["repeatedNestedEnum"] = jsonArrayRepeatedNestedEnum
            }
            if !repeatedForeignEnum.isEmpty {
                var jsonArrayRepeatedForeignEnum:Array<String> = []
                for oneValueRepeatedForeignEnum in repeatedForeignEnum {
                    jsonArrayRepeatedForeignEnum.append(oneValueRepeatedForeignEnum.toString())
                }
                jsonMap["repeatedForeignEnum"] = jsonArrayRepeatedForeignEnum
            }
            if !repeatedStringPiece.isEmpty {
                var jsonArrayRepeatedStringPiece:Array<String> = []
                for oneValueRepeatedStringPiece in repeatedStringPiece {
                    jsonArrayRepeatedStringPiece.append(oneValueRepeatedStringPiece)
                }
                jsonMap["repeatedStringPiece"] = jsonArrayRepeatedStringPiece
            }
            if !repeatedCord.isEmpty {
                var jsonArrayRepeatedCord:Array<String> = []
                for oneValueRepeatedCord in repeatedCord {
                    jsonArrayRepeatedCord.append(oneValueRepeatedCord)
                }
                jsonMap["repeatedCord"] = jsonArrayRepeatedCord
            }
            if !repeatedLazyMessage.isEmpty {
                var jsonArrayRepeatedLazyMessage:Array<Dictionary<String,Any>> = []
                for oneValueRepeatedLazyMessage in repeatedLazyMessage {
                    let ecodedMessageRepeatedLazyMessage = try oneValueRepeatedLazyMessage.encode()
                    jsonArrayRepeatedLazyMessage.append(ecodedMessageRepeatedLazyMessage)
                }
                jsonMap["repeatedLazyMessage"] = jsonArrayRepeatedLazyMessage
            }
            if hasOneofUint32 {
                jsonMap["oneofUint32"] = UInt(oneofUint32)
            }
            if hasOneofNestedMessage {
                jsonMap["oneofNestedMessage"] = try oneofNestedMessage.encode()
            }
            if hasOneofString {
                jsonMap["oneofString"] = oneofString
            }
            if hasOneofEnum {
                jsonMap["oneofEnum"] = oneofEnum.toString()
            }
            return jsonMap
        }
        override class public func decode(jsonMap:Dictionary<String,Any>) throws -> Proto2NofieldpresenceUnittest.TestAllTypes {
            return try Proto2NofieldpresenceUnittest.TestAllTypes.Builder.decodeToBuilder(jsonMap:jsonMap).build()
        }
        override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.TestAllTypes {
            return try Proto2NofieldpresenceUnittest.TestAllTypes.Builder.fromJSONToBuilder(data:data, options:options).build()
        }
        override public func getDescription(indent:String) throws -> String {
            var output = ""
            if hasOptionalInt32 {
                output += "\(indent) optionalInt32: \(String(describing: optionalInt32)) \n"
            }
            if hasOptionalInt64 {
                output += "\(indent) optionalInt64: \(String(describing: optionalInt64)) \n"
            }
            if hasOptionalUint32 {
                output += "\(indent) optionalUint32: \(String(describing: optionalUint32)) \n"
            }
            if hasOptionalUint64 {
                output += "\(indent) optionalUint64: \(String(describing: optionalUint64)) \n"
            }
            if hasOptionalSint32 {
                output += "\(indent) optionalSint32: \(String(describing: optionalSint32)) \n"
            }
            if hasOptionalSint64 {
                output += "\(indent) optionalSint64: \(String(describing: optionalSint64)) \n"
            }
            if hasOptionalFixed32 {
                output += "\(indent) optionalFixed32: \(String(describing: optionalFixed32)) \n"
            }
            if hasOptionalFixed64 {
                output += "\(indent) optionalFixed64: \(String(describing: optionalFixed64)) \n"
            }
            if hasOptionalSfixed32 {
                output += "\(indent) optionalSfixed32: \(String(describing: optionalSfixed32)) \n"
            }
            if hasOptionalSfixed64 {
                output += "\(indent) optionalSfixed64: \(String(describing: optionalSfixed64)) \n"
            }
            if hasOptionalFloat {
                output += "\(indent) optionalFloat: \(String(describing: optionalFloat)) \n"
            }
            if hasOptionalDouble {
                output += "\(indent) optionalDouble: \(String(describing: optionalDouble)) \n"
            }
            if hasOptionalBool {
                output += "\(indent) optionalBool: \(String(describing: optionalBool)) \n"
            }
            if hasOptionalString {
                output += "\(indent) optionalString: \(String(describing: optionalString)) \n"
            }
            if hasOptionalBytes {
                output += "\(indent) optionalBytes: \(String(describing: optionalBytes)) \n"
            }
            if hasOptionalNestedMessage {
                output += "\(indent) optionalNestedMessage {\n"
                if let outDescOptionalNestedMessage = optionalNestedMessage {
                    output += try outDescOptionalNestedMessage.getDescription(indent: "\(indent)  ")
                }
                output += "\(indent) }\n"
            }
            if hasOptionalForeignMessage {
                output += "\(indent) optionalForeignMessage {\n"
                if let outDescOptionalForeignMessage = optionalForeignMessage {
                    output += try outDescOptionalForeignMessage.getDescription(indent: "\(indent)  ")
                }
                output += "\(indent) }\n"
            }
            if hasOptionalProto2Message {
                output += "\(indent) optionalProto2Message {\n"
                if let outDescOptionalProto2Message = optionalProto2Message {
                    output += try outDescOptionalProto2Message.getDescription(indent: "\(indent)  ")
                }
                output += "\(indent) }\n"
            }
            if (hasOptionalNestedEnum) {
                output += "\(indent) optionalNestedEnum: \(optionalNestedEnum.description)\n"
            }
            if (hasOptionalForeignEnum) {
                output += "\(indent) optionalForeignEnum: \(optionalForeignEnum.description)\n"
            }
            if hasOptionalStringPiece {
                output += "\(indent) optionalStringPiece: \(String(describing: optionalStringPiece)) \n"
            }
            if hasOptionalCord {
                output += "\(indent) optionalCord: \(String(describing: optionalCord)) \n"
            }
            if hasOptionalLazyMessage {
                output += "\(indent) optionalLazyMessage {\n"
                if let outDescOptionalLazyMessage = optionalLazyMessage {
                    output += try outDescOptionalLazyMessage.getDescription(indent: "\(indent)  ")
                }
                output += "\(indent) }\n"
            }
            var repeatedInt32ElementIndex:Int = 0
            for oneValueRepeatedInt32 in repeatedInt32  {
                output += "\(indent) repeatedInt32[\(repeatedInt32ElementIndex)]: \(oneValueRepeatedInt32)\n"
                repeatedInt32ElementIndex += 1
            }
            var repeatedInt64ElementIndex:Int = 0
            for oneValueRepeatedInt64 in repeatedInt64  {
                output += "\(indent) repeatedInt64[\(repeatedInt64ElementIndex)]: \(oneValueRepeatedInt64)\n"
                repeatedInt64ElementIndex += 1
            }
            var repeatedUint32ElementIndex:Int = 0
            for oneValueRepeatedUint32 in repeatedUint32  {
                output += "\(indent) repeatedUint32[\(repeatedUint32ElementIndex)]: \(oneValueRepeatedUint32)\n"
                repeatedUint32ElementIndex += 1
            }
            var repeatedUint64ElementIndex:Int = 0
            for oneValueRepeatedUint64 in repeatedUint64  {
                output += "\(indent) repeatedUint64[\(repeatedUint64ElementIndex)]: \(oneValueRepeatedUint64)\n"
                repeatedUint64ElementIndex += 1
            }
            var repeatedSint32ElementIndex:Int = 0
            for oneValueRepeatedSint32 in repeatedSint32  {
                output += "\(indent) repeatedSint32[\(repeatedSint32ElementIndex)]: \(oneValueRepeatedSint32)\n"
                repeatedSint32ElementIndex += 1
            }
            var repeatedSint64ElementIndex:Int = 0
            for oneValueRepeatedSint64 in repeatedSint64  {
                output += "\(indent) repeatedSint64[\(repeatedSint64ElementIndex)]: \(oneValueRepeatedSint64)\n"
                repeatedSint64ElementIndex += 1
            }
            var repeatedFixed32ElementIndex:Int = 0
            for oneValueRepeatedFixed32 in repeatedFixed32  {
                output += "\(indent) repeatedFixed32[\(repeatedFixed32ElementIndex)]: \(oneValueRepeatedFixed32)\n"
                repeatedFixed32ElementIndex += 1
            }
            var repeatedFixed64ElementIndex:Int = 0
            for oneValueRepeatedFixed64 in repeatedFixed64  {
                output += "\(indent) repeatedFixed64[\(repeatedFixed64ElementIndex)]: \(oneValueRepeatedFixed64)\n"
                repeatedFixed64ElementIndex += 1
            }
            var repeatedSfixed32ElementIndex:Int = 0
            for oneValueRepeatedSfixed32 in repeatedSfixed32  {
                output += "\(indent) repeatedSfixed32[\(repeatedSfixed32ElementIndex)]: \(oneValueRepeatedSfixed32)\n"
                repeatedSfixed32ElementIndex += 1
            }
            var repeatedSfixed64ElementIndex:Int = 0
            for oneValueRepeatedSfixed64 in repeatedSfixed64  {
                output += "\(indent) repeatedSfixed64[\(repeatedSfixed64ElementIndex)]: \(oneValueRepeatedSfixed64)\n"
                repeatedSfixed64ElementIndex += 1
            }
            var repeatedFloatElementIndex:Int = 0
            for oneValueRepeatedFloat in repeatedFloat  {
                output += "\(indent) repeatedFloat[\(repeatedFloatElementIndex)]: \(oneValueRepeatedFloat)\n"
                repeatedFloatElementIndex += 1
            }
            var repeatedDoubleElementIndex:Int = 0
            for oneValueRepeatedDouble in repeatedDouble  {
                output += "\(indent) repeatedDouble[\(repeatedDoubleElementIndex)]: \(oneValueRepeatedDouble)\n"
                repeatedDoubleElementIndex += 1
            }
            var repeatedBoolElementIndex:Int = 0
            for oneValueRepeatedBool in repeatedBool  {
                output += "\(indent) repeatedBool[\(repeatedBoolElementIndex)]: \(oneValueRepeatedBool)\n"
                repeatedBoolElementIndex += 1
            }
            var repeatedStringElementIndex:Int = 0
            for oneValueRepeatedString in repeatedString  {
                output += "\(indent) repeatedString[\(repeatedStringElementIndex)]: \(oneValueRepeatedString)\n"
                repeatedStringElementIndex += 1
            }
            var repeatedBytesElementIndex:Int = 0
            for oneValueRepeatedBytes in repeatedBytes  {
                output += "\(indent) repeatedBytes[\(repeatedBytesElementIndex)]: \(oneValueRepeatedBytes)\n"
                repeatedBytesElementIndex += 1
            }
            var repeatedNestedMessageElementIndex:Int = 0
            for oneElementRepeatedNestedMessage in repeatedNestedMessage {
                output += "\(indent) repeatedNestedMessage[\(repeatedNestedMessageElementIndex)] {\n"
                output += try oneElementRepeatedNestedMessage.getDescription(indent: "\(indent)  ")
                output += "\(indent)}\n"
                repeatedNestedMessageElementIndex += 1
            }
            var repeatedForeignMessageElementIndex:Int = 0
            for oneElementRepeatedForeignMessage in repeatedForeignMessage {
                output += "\(indent) repeatedForeignMessage[\(repeatedForeignMessageElementIndex)] {\n"
                output += try oneElementRepeatedForeignMessage.getDescription(indent: "\(indent)  ")
                output += "\(indent)}\n"
                repeatedForeignMessageElementIndex += 1
            }
            var repeatedProto2MessageElementIndex:Int = 0
            for oneElementRepeatedProto2Message in repeatedProto2Message {
                output += "\(indent) repeatedProto2Message[\(repeatedProto2MessageElementIndex)] {\n"
                output += try oneElementRepeatedProto2Message.getDescription(indent: "\(indent)  ")
                output += "\(indent)}\n"
                repeatedProto2MessageElementIndex += 1
            }
            var repeatedNestedEnumElementIndex:Int = 0
            for oneValueOfrepeatedNestedEnum in repeatedNestedEnum {
                output += "\(indent) repeatedNestedEnum[\(repeatedNestedEnumElementIndex)]: \(oneValueOfrepeatedNestedEnum.description)\n"
                repeatedNestedEnumElementIndex += 1
            }
            var repeatedForeignEnumElementIndex:Int = 0
            for oneValueOfrepeatedForeignEnum in repeatedForeignEnum {
                output += "\(indent) repeatedForeignEnum[\(repeatedForeignEnumElementIndex)]: \(oneValueOfrepeatedForeignEnum.description)\n"
                repeatedForeignEnumElementIndex += 1
            }
            var repeatedStringPieceElementIndex:Int = 0
            for oneValueRepeatedStringPiece in repeatedStringPiece  {
                output += "\(indent) repeatedStringPiece[\(repeatedStringPieceElementIndex)]: \(oneValueRepeatedStringPiece)\n"
                repeatedStringPieceElementIndex += 1
            }
            var repeatedCordElementIndex:Int = 0
            for oneValueRepeatedCord in repeatedCord  {
                output += "\(indent) repeatedCord[\(repeatedCordElementIndex)]: \(oneValueRepeatedCord)\n"
                repeatedCordElementIndex += 1
            }
            var repeatedLazyMessageElementIndex:Int = 0
            for oneElementRepeatedLazyMessage in repeatedLazyMessage {
                output += "\(indent) repeatedLazyMessage[\(repeatedLazyMessageElementIndex)] {\n"
                output += try oneElementRepeatedLazyMessage.getDescription(indent: "\(indent)  ")
                output += "\(indent)}\n"
                repeatedLazyMessageElementIndex += 1
            }
            if hasOneofUint32 {
                output += "\(indent) oneofUint32: \(String(describing: oneofUint32)) \n"
            }
            if hasOneofNestedMessage {
                output += "\(indent) oneofNestedMessage {\n"
                if let outDescOneofNestedMessage = oneofNestedMessage {
                    output += try outDescOneofNestedMessage.getDescription(indent: "\(indent)  ")
                }
                output += "\(indent) }\n"
            }
            if hasOneofString {
                output += "\(indent) oneofString: \(String(describing: oneofString)) \n"
            }
            if (hasOneofEnum) {
                output += "\(indent) oneofEnum: \(oneofEnum.description)\n"
            }
            output += unknownFields.getDescription(indent: indent)
            return output
        }
        override public var hashValue:Int {
            get {
                var hashCode:Int = 7
                if hasOptionalInt32 {
                    hashCode = (hashCode &* 31) &+ optionalInt32.hashValue
                }
                if hasOptionalInt64 {
                    hashCode = (hashCode &* 31) &+ optionalInt64.hashValue
                }
                if hasOptionalUint32 {
                    hashCode = (hashCode &* 31) &+ optionalUint32.hashValue
                }
                if hasOptionalUint64 {
                    hashCode = (hashCode &* 31) &+ optionalUint64.hashValue
                }
                if hasOptionalSint32 {
                    hashCode = (hashCode &* 31) &+ optionalSint32.hashValue
                }
                if hasOptionalSint64 {
                    hashCode = (hashCode &* 31) &+ optionalSint64.hashValue
                }
                if hasOptionalFixed32 {
                    hashCode = (hashCode &* 31) &+ optionalFixed32.hashValue
                }
                if hasOptionalFixed64 {
                    hashCode = (hashCode &* 31) &+ optionalFixed64.hashValue
                }
                if hasOptionalSfixed32 {
                    hashCode = (hashCode &* 31) &+ optionalSfixed32.hashValue
                }
                if hasOptionalSfixed64 {
                    hashCode = (hashCode &* 31) &+ optionalSfixed64.hashValue
                }
                if hasOptionalFloat {
                    hashCode = (hashCode &* 31) &+ optionalFloat.hashValue
                }
                if hasOptionalDouble {
                    hashCode = (hashCode &* 31) &+ optionalDouble.hashValue
                }
                if hasOptionalBool {
                    hashCode = (hashCode &* 31) &+ optionalBool.hashValue
                }
                if hasOptionalString {
                    hashCode = (hashCode &* 31) &+ optionalString.hashValue
                }
                if hasOptionalBytes {
                    hashCode = (hashCode &* 31) &+ optionalBytes.hashValue
                }
                if hasOptionalNestedMessage {
                    if let hashValueoptionalNestedMessage = optionalNestedMessage?.hashValue {
                        hashCode = (hashCode &* 31) &+ hashValueoptionalNestedMessage
                    }
                }
                if hasOptionalForeignMessage {
                    if let hashValueoptionalForeignMessage = optionalForeignMessage?.hashValue {
                        hashCode = (hashCode &* 31) &+ hashValueoptionalForeignMessage
                    }
                }
                if hasOptionalProto2Message {
                    if let hashValueoptionalProto2Message = optionalProto2Message?.hashValue {
                        hashCode = (hashCode &* 31) &+ hashValueoptionalProto2Message
                    }
                }
                if hasOptionalNestedEnum {
                     hashCode = (hashCode &* 31) &+ optionalNestedEnum.hashValue
                }
                if hasOptionalForeignEnum {
                     hashCode = (hashCode &* 31) &+ optionalForeignEnum.hashValue
                }
                if hasOptionalStringPiece {
                    hashCode = (hashCode &* 31) &+ optionalStringPiece.hashValue
                }
                if hasOptionalCord {
                    hashCode = (hashCode &* 31) &+ optionalCord.hashValue
                }
                if hasOptionalLazyMessage {
                    if let hashValueoptionalLazyMessage = optionalLazyMessage?.hashValue {
                        hashCode = (hashCode &* 31) &+ hashValueoptionalLazyMessage
                    }
                }
                for oneValueRepeatedInt32 in repeatedInt32 {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedInt32.hashValue
                }
                for oneValueRepeatedInt64 in repeatedInt64 {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedInt64.hashValue
                }
                for oneValueRepeatedUint32 in repeatedUint32 {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedUint32.hashValue
                }
                for oneValueRepeatedUint64 in repeatedUint64 {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedUint64.hashValue
                }
                for oneValueRepeatedSint32 in repeatedSint32 {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedSint32.hashValue
                }
                for oneValueRepeatedSint64 in repeatedSint64 {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedSint64.hashValue
                }
                for oneValueRepeatedFixed32 in repeatedFixed32 {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedFixed32.hashValue
                }
                for oneValueRepeatedFixed64 in repeatedFixed64 {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedFixed64.hashValue
                }
                for oneValueRepeatedSfixed32 in repeatedSfixed32 {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedSfixed32.hashValue
                }
                for oneValueRepeatedSfixed64 in repeatedSfixed64 {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedSfixed64.hashValue
                }
                for oneValueRepeatedFloat in repeatedFloat {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedFloat.hashValue
                }
                for oneValueRepeatedDouble in repeatedDouble {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedDouble.hashValue
                }
                for oneValueRepeatedBool in repeatedBool {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedBool.hashValue
                }
                for oneValueRepeatedString in repeatedString {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedString.hashValue
                }
                for oneValueRepeatedBytes in repeatedBytes {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedBytes.hashValue
                }
                for oneElementRepeatedNestedMessage in repeatedNestedMessage {
                    hashCode = (hashCode &* 31) &+ oneElementRepeatedNestedMessage.hashValue
                }
                for oneElementRepeatedForeignMessage in repeatedForeignMessage {
                    hashCode = (hashCode &* 31) &+ oneElementRepeatedForeignMessage.hashValue
                }
                for oneElementRepeatedProto2Message in repeatedProto2Message {
                    hashCode = (hashCode &* 31) &+ oneElementRepeatedProto2Message.hashValue
                }
                for oneValueOfrepeatedNestedEnum in repeatedNestedEnum {
                    hashCode = (hashCode &* 31) &+ oneValueOfrepeatedNestedEnum.hashValue
                }
                for oneValueOfrepeatedForeignEnum in repeatedForeignEnum {
                    hashCode = (hashCode &* 31) &+ oneValueOfrepeatedForeignEnum.hashValue
                }
                for oneValueRepeatedStringPiece in repeatedStringPiece {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedStringPiece.hashValue
                }
                for oneValueRepeatedCord in repeatedCord {
                    hashCode = (hashCode &* 31) &+ oneValueRepeatedCord.hashValue
                }
                for oneElementRepeatedLazyMessage in repeatedLazyMessage {
                    hashCode = (hashCode &* 31) &+ oneElementRepeatedLazyMessage.hashValue
                }
                if hasOneofUint32 {
                    hashCode = (hashCode &* 31) &+ oneofUint32.hashValue
                }
                if hasOneofNestedMessage {
                    if let hashValueoneofNestedMessage = oneofNestedMessage?.hashValue {
                        hashCode = (hashCode &* 31) &+ hashValueoneofNestedMessage
                    }
                }
                if hasOneofString {
                    hashCode = (hashCode &* 31) &+ oneofString.hashValue
                }
                if hasOneofEnum {
                     hashCode = (hashCode &* 31) &+ oneofEnum.hashValue
                }
                hashCode = (hashCode &* 31) &+  unknownFields.hashValue
                return hashCode
            }
        }


        //Meta information declaration start

        override public class func className() -> String {
            return "Proto2NofieldpresenceUnittest.TestAllTypes"
        }
        override public func className() -> String {
            return "Proto2NofieldpresenceUnittest.TestAllTypes"
        }
        //Meta information declaration end

        final public class Builder : GeneratedMessageBuilder {
            fileprivate var builderResult:Proto2NofieldpresenceUnittest.TestAllTypes = Proto2NofieldpresenceUnittest.TestAllTypes()
            public func getMessage() -> Proto2NofieldpresenceUnittest.TestAllTypes {
                return builderResult
            }

            required override public init () {
                super.init()
            }
            public func setOneofField(_ oneOf:TestAllTypes.OneofField) ->  Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.storageOneofField = oneOf
                return self
            }
            /// Singular
            /// TODO: remove 'optional' labels as soon as CL 69188077 is LGTM'd to make
            /// 'optional' optional.
            public var optionalInt32:Int32 {
                get {
                    return builderResult.optionalInt32
                }
                set (value) {
                    builderResult.hasOptionalInt32 = true
                    builderResult.optionalInt32 = value
                }
            }
            public var hasOptionalInt32:Bool {
                get {
                    return builderResult.hasOptionalInt32
                }
            }
            @discardableResult
            public func setOptionalInt32(_ value:Int32) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalInt32 = value
                return self
            }
            @discardableResult
            public func clearOptionalInt32() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalInt32 = false
                builderResult.optionalInt32 = nil
                return self
            }
            public var optionalInt64:Int64 {
                get {
                    return builderResult.optionalInt64
                }
                set (value) {
                    builderResult.hasOptionalInt64 = true
                    builderResult.optionalInt64 = value
                }
            }
            public var hasOptionalInt64:Bool {
                get {
                    return builderResult.hasOptionalInt64
                }
            }
            @discardableResult
            public func setOptionalInt64(_ value:Int64) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalInt64 = value
                return self
            }
            @discardableResult
            public func clearOptionalInt64() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalInt64 = false
                builderResult.optionalInt64 = nil
                return self
            }
            public var optionalUint32:UInt32 {
                get {
                    return builderResult.optionalUint32
                }
                set (value) {
                    builderResult.hasOptionalUint32 = true
                    builderResult.optionalUint32 = value
                }
            }
            public var hasOptionalUint32:Bool {
                get {
                    return builderResult.hasOptionalUint32
                }
            }
            @discardableResult
            public func setOptionalUint32(_ value:UInt32) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalUint32 = value
                return self
            }
            @discardableResult
            public func clearOptionalUint32() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalUint32 = false
                builderResult.optionalUint32 = nil
                return self
            }
            public var optionalUint64:UInt64 {
                get {
                    return builderResult.optionalUint64
                }
                set (value) {
                    builderResult.hasOptionalUint64 = true
                    builderResult.optionalUint64 = value
                }
            }
            public var hasOptionalUint64:Bool {
                get {
                    return builderResult.hasOptionalUint64
                }
            }
            @discardableResult
            public func setOptionalUint64(_ value:UInt64) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalUint64 = value
                return self
            }
            @discardableResult
            public func clearOptionalUint64() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalUint64 = false
                builderResult.optionalUint64 = nil
                return self
            }
            public var optionalSint32:Int32 {
                get {
                    return builderResult.optionalSint32
                }
                set (value) {
                    builderResult.hasOptionalSint32 = true
                    builderResult.optionalSint32 = value
                }
            }
            public var hasOptionalSint32:Bool {
                get {
                    return builderResult.hasOptionalSint32
                }
            }
            @discardableResult
            public func setOptionalSint32(_ value:Int32) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalSint32 = value
                return self
            }
            @discardableResult
            public func clearOptionalSint32() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalSint32 = false
                builderResult.optionalSint32 = nil
                return self
            }
            public var optionalSint64:Int64 {
                get {
                    return builderResult.optionalSint64
                }
                set (value) {
                    builderResult.hasOptionalSint64 = true
                    builderResult.optionalSint64 = value
                }
            }
            public var hasOptionalSint64:Bool {
                get {
                    return builderResult.hasOptionalSint64
                }
            }
            @discardableResult
            public func setOptionalSint64(_ value:Int64) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalSint64 = value
                return self
            }
            @discardableResult
            public func clearOptionalSint64() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalSint64 = false
                builderResult.optionalSint64 = nil
                return self
            }
            public var optionalFixed32:UInt32 {
                get {
                    return builderResult.optionalFixed32
                }
                set (value) {
                    builderResult.hasOptionalFixed32 = true
                    builderResult.optionalFixed32 = value
                }
            }
            public var hasOptionalFixed32:Bool {
                get {
                    return builderResult.hasOptionalFixed32
                }
            }
            @discardableResult
            public func setOptionalFixed32(_ value:UInt32) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalFixed32 = value
                return self
            }
            @discardableResult
            public func clearOptionalFixed32() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalFixed32 = false
                builderResult.optionalFixed32 = nil
                return self
            }
            public var optionalFixed64:UInt64 {
                get {
                    return builderResult.optionalFixed64
                }
                set (value) {
                    builderResult.hasOptionalFixed64 = true
                    builderResult.optionalFixed64 = value
                }
            }
            public var hasOptionalFixed64:Bool {
                get {
                    return builderResult.hasOptionalFixed64
                }
            }
            @discardableResult
            public func setOptionalFixed64(_ value:UInt64) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalFixed64 = value
                return self
            }
            @discardableResult
            public func clearOptionalFixed64() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalFixed64 = false
                builderResult.optionalFixed64 = nil
                return self
            }
            public var optionalSfixed32:Int32 {
                get {
                    return builderResult.optionalSfixed32
                }
                set (value) {
                    builderResult.hasOptionalSfixed32 = true
                    builderResult.optionalSfixed32 = value
                }
            }
            public var hasOptionalSfixed32:Bool {
                get {
                    return builderResult.hasOptionalSfixed32
                }
            }
            @discardableResult
            public func setOptionalSfixed32(_ value:Int32) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalSfixed32 = value
                return self
            }
            @discardableResult
            public func clearOptionalSfixed32() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalSfixed32 = false
                builderResult.optionalSfixed32 = nil
                return self
            }
            public var optionalSfixed64:Int64 {
                get {
                    return builderResult.optionalSfixed64
                }
                set (value) {
                    builderResult.hasOptionalSfixed64 = true
                    builderResult.optionalSfixed64 = value
                }
            }
            public var hasOptionalSfixed64:Bool {
                get {
                    return builderResult.hasOptionalSfixed64
                }
            }
            @discardableResult
            public func setOptionalSfixed64(_ value:Int64) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalSfixed64 = value
                return self
            }
            @discardableResult
            public func clearOptionalSfixed64() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalSfixed64 = false
                builderResult.optionalSfixed64 = nil
                return self
            }
            public var optionalFloat:Float {
                get {
                    return builderResult.optionalFloat
                }
                set (value) {
                    builderResult.hasOptionalFloat = true
                    builderResult.optionalFloat = value
                }
            }
            public var hasOptionalFloat:Bool {
                get {
                    return builderResult.hasOptionalFloat
                }
            }
            @discardableResult
            public func setOptionalFloat(_ value:Float) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalFloat = value
                return self
            }
            @discardableResult
            public func clearOptionalFloat() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalFloat = false
                builderResult.optionalFloat = nil
                return self
            }
            public var optionalDouble:Double {
                get {
                    return builderResult.optionalDouble
                }
                set (value) {
                    builderResult.hasOptionalDouble = true
                    builderResult.optionalDouble = value
                }
            }
            public var hasOptionalDouble:Bool {
                get {
                    return builderResult.hasOptionalDouble
                }
            }
            @discardableResult
            public func setOptionalDouble(_ value:Double) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalDouble = value
                return self
            }
            @discardableResult
            public func clearOptionalDouble() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalDouble = false
                builderResult.optionalDouble = nil
                return self
            }
            public var optionalBool:Bool {
                get {
                    return builderResult.optionalBool
                }
                set (value) {
                    builderResult.hasOptionalBool = true
                    builderResult.optionalBool = value
                }
            }
            public var hasOptionalBool:Bool {
                get {
                    return builderResult.hasOptionalBool
                }
            }
            @discardableResult
            public func setOptionalBool(_ value:Bool) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalBool = value
                return self
            }
            @discardableResult
            public func clearOptionalBool() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalBool = false
                builderResult.optionalBool = nil
                return self
            }
            public var optionalString:String {
                get {
                    return builderResult.optionalString
                }
                set (value) {
                    builderResult.hasOptionalString = true
                    builderResult.optionalString = value
                }
            }
            public var hasOptionalString:Bool {
                get {
                    return builderResult.hasOptionalString
                }
            }
            @discardableResult
            public func setOptionalString(_ value:String) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalString = value
                return self
            }
            @discardableResult
            public func clearOptionalString() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalString = false
                builderResult.optionalString = nil
                return self
            }
            public var optionalBytes:Data {
                get {
                    return builderResult.optionalBytes
                }
                set (value) {
                    builderResult.hasOptionalBytes = true
                    builderResult.optionalBytes = value
                }
            }
            public var hasOptionalBytes:Bool {
                get {
                    return builderResult.hasOptionalBytes
                }
            }
            @discardableResult
            public func setOptionalBytes(_ value:Data) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalBytes = value
                return self
            }
            @discardableResult
            public func clearOptionalBytes() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalBytes = false
                builderResult.optionalBytes = nil
                return self
            }
            public var optionalNestedMessage:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage! {
                get {
                    if optionalNestedMessageBuilder_ != nil {
                        builderResult.optionalNestedMessage = optionalNestedMessageBuilder_.getMessage()
                    }
                    return builderResult.optionalNestedMessage
                }
                set (value) {
                    builderResult.hasOptionalNestedMessage = value != nil
                    builderResult.optionalNestedMessage = value
                }
            }
            public var hasOptionalNestedMessage:Bool {
                get {
                    return builderResult.hasOptionalNestedMessage
                }
            }
            fileprivate var optionalNestedMessageBuilder_:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder! {
                didSet {
                    builderResult.hasOptionalNestedMessage = true
                }
            }
            public func getOptionalNestedMessageBuilder() -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                if optionalNestedMessageBuilder_ == nil {
                    optionalNestedMessageBuilder_ = Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder()
                    builderResult.optionalNestedMessage = optionalNestedMessageBuilder_.getMessage()
                    if optionalNestedMessage != nil {
                        try! optionalNestedMessageBuilder_.mergeFrom(other: optionalNestedMessage)
                    }
                }
                return optionalNestedMessageBuilder_
            }
            @discardableResult
            public func setOptionalNestedMessage(_ value:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage!) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalNestedMessage = value
                return self
            }
            @discardableResult
            public func mergeOptionalNestedMessage(value:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                if builderResult.hasOptionalNestedMessage {
                    builderResult.optionalNestedMessage = try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.builderWithPrototype(prototype:builderResult.optionalNestedMessage).mergeFrom(other: value).buildPartial()
                } else {
                    builderResult.optionalNestedMessage = value
                }
                builderResult.hasOptionalNestedMessage = true
                return self
            }
            @discardableResult
            public func clearOptionalNestedMessage() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                optionalNestedMessageBuilder_ = nil
                builderResult.hasOptionalNestedMessage = false
                builderResult.optionalNestedMessage = nil
                return self
            }
            public var optionalForeignMessage:Proto2NofieldpresenceUnittest.ForeignMessage! {
                get {
                    if optionalForeignMessageBuilder_ != nil {
                        builderResult.optionalForeignMessage = optionalForeignMessageBuilder_.getMessage()
                    }
                    return builderResult.optionalForeignMessage
                }
                set (value) {
                    builderResult.hasOptionalForeignMessage = value != nil
                    builderResult.optionalForeignMessage = value
                }
            }
            public var hasOptionalForeignMessage:Bool {
                get {
                    return builderResult.hasOptionalForeignMessage
                }
            }
            fileprivate var optionalForeignMessageBuilder_:Proto2NofieldpresenceUnittest.ForeignMessage.Builder! {
                didSet {
                    builderResult.hasOptionalForeignMessage = true
                }
            }
            public func getOptionalForeignMessageBuilder() -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder {
                if optionalForeignMessageBuilder_ == nil {
                    optionalForeignMessageBuilder_ = Proto2NofieldpresenceUnittest.ForeignMessage.Builder()
                    builderResult.optionalForeignMessage = optionalForeignMessageBuilder_.getMessage()
                    if optionalForeignMessage != nil {
                        try! optionalForeignMessageBuilder_.mergeFrom(other: optionalForeignMessage)
                    }
                }
                return optionalForeignMessageBuilder_
            }
            @discardableResult
            public func setOptionalForeignMessage(_ value:Proto2NofieldpresenceUnittest.ForeignMessage!) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalForeignMessage = value
                return self
            }
            @discardableResult
            public func mergeOptionalForeignMessage(value:Proto2NofieldpresenceUnittest.ForeignMessage) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                if builderResult.hasOptionalForeignMessage {
                    builderResult.optionalForeignMessage = try Proto2NofieldpresenceUnittest.ForeignMessage.builderWithPrototype(prototype:builderResult.optionalForeignMessage).mergeFrom(other: value).buildPartial()
                } else {
                    builderResult.optionalForeignMessage = value
                }
                builderResult.hasOptionalForeignMessage = true
                return self
            }
            @discardableResult
            public func clearOptionalForeignMessage() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                optionalForeignMessageBuilder_ = nil
                builderResult.hasOptionalForeignMessage = false
                builderResult.optionalForeignMessage = nil
                return self
            }
            public var optionalProto2Message:ProtobufUnittest.TestAllTypes! {
                get {
                    if optionalProto2MessageBuilder_ != nil {
                        builderResult.optionalProto2Message = optionalProto2MessageBuilder_.getMessage()
                    }
                    return builderResult.optionalProto2Message
                }
                set (value) {
                    builderResult.hasOptionalProto2Message = value != nil
                    builderResult.optionalProto2Message = value
                }
            }
            public var hasOptionalProto2Message:Bool {
                get {
                    return builderResult.hasOptionalProto2Message
                }
            }
            fileprivate var optionalProto2MessageBuilder_:ProtobufUnittest.TestAllTypes.Builder! {
                didSet {
                    builderResult.hasOptionalProto2Message = true
                }
            }
            public func getOptionalProto2MessageBuilder() -> ProtobufUnittest.TestAllTypes.Builder {
                if optionalProto2MessageBuilder_ == nil {
                    optionalProto2MessageBuilder_ = ProtobufUnittest.TestAllTypes.Builder()
                    builderResult.optionalProto2Message = optionalProto2MessageBuilder_.getMessage()
                    if optionalProto2Message != nil {
                        try! optionalProto2MessageBuilder_.mergeFrom(other: optionalProto2Message)
                    }
                }
                return optionalProto2MessageBuilder_
            }
            @discardableResult
            public func setOptionalProto2Message(_ value:ProtobufUnittest.TestAllTypes!) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalProto2Message = value
                return self
            }
            @discardableResult
            public func mergeOptionalProto2Message(value:ProtobufUnittest.TestAllTypes) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                if builderResult.hasOptionalProto2Message {
                    builderResult.optionalProto2Message = try ProtobufUnittest.TestAllTypes.builderWithPrototype(prototype:builderResult.optionalProto2Message).mergeFrom(other: value).buildPartial()
                } else {
                    builderResult.optionalProto2Message = value
                }
                builderResult.hasOptionalProto2Message = true
                return self
            }
            @discardableResult
            public func clearOptionalProto2Message() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                optionalProto2MessageBuilder_ = nil
                builderResult.hasOptionalProto2Message = false
                builderResult.optionalProto2Message = nil
                return self
            }
                public var optionalNestedEnum:Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum {
                    get {
                        return builderResult.optionalNestedEnum
                    }
                    set (value) {
                        builderResult.hasOptionalNestedEnum = true
                        builderResult.optionalNestedEnum = value
                    }
                }
                public var hasOptionalNestedEnum:Bool{
                    get {
                        return builderResult.hasOptionalNestedEnum
                    }
                }
            @discardableResult
                public func setOptionalNestedEnum(_ value:Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                  self.optionalNestedEnum = value
                  return self
                }
            @discardableResult
                public func clearOptionalNestedEnum() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                   builderResult.hasOptionalNestedEnum = false
                   builderResult.optionalNestedEnum = .foo
                   return self
                }
            /// N.B.: proto2-enum-type fields not allowed, because their default values
            /// might not be zero.
            ///optional protobuf_unittest.ForeignEnum          optional_proto2_enum     = 23;
                public var optionalForeignEnum:Proto2NofieldpresenceUnittest.ForeignEnum {
                    get {
                        return builderResult.optionalForeignEnum
                    }
                    set (value) {
                        builderResult.hasOptionalForeignEnum = true
                        builderResult.optionalForeignEnum = value
                    }
                }
                public var hasOptionalForeignEnum:Bool{
                    get {
                        return builderResult.hasOptionalForeignEnum
                    }
                }
            @discardableResult
                public func setOptionalForeignEnum(_ value:Proto2NofieldpresenceUnittest.ForeignEnum) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                  self.optionalForeignEnum = value
                  return self
                }
            @discardableResult
                public func clearOptionalForeignEnum() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                   builderResult.hasOptionalForeignEnum = false
                   builderResult.optionalForeignEnum = .foreignFoo
                   return self
                }
            public var optionalStringPiece:String {
                get {
                    return builderResult.optionalStringPiece
                }
                set (value) {
                    builderResult.hasOptionalStringPiece = true
                    builderResult.optionalStringPiece = value
                }
            }
            public var hasOptionalStringPiece:Bool {
                get {
                    return builderResult.hasOptionalStringPiece
                }
            }
            @discardableResult
            public func setOptionalStringPiece(_ value:String) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalStringPiece = value
                return self
            }
            @discardableResult
            public func clearOptionalStringPiece() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalStringPiece = false
                builderResult.optionalStringPiece = nil
                return self
            }
            public var optionalCord:String {
                get {
                    return builderResult.optionalCord
                }
                set (value) {
                    builderResult.hasOptionalCord = true
                    builderResult.optionalCord = value
                }
            }
            public var hasOptionalCord:Bool {
                get {
                    return builderResult.hasOptionalCord
                }
            }
            @discardableResult
            public func setOptionalCord(_ value:String) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalCord = value
                return self
            }
            @discardableResult
            public func clearOptionalCord() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOptionalCord = false
                builderResult.optionalCord = nil
                return self
            }
            public var optionalLazyMessage:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage! {
                get {
                    if optionalLazyMessageBuilder_ != nil {
                        builderResult.optionalLazyMessage = optionalLazyMessageBuilder_.getMessage()
                    }
                    return builderResult.optionalLazyMessage
                }
                set (value) {
                    builderResult.hasOptionalLazyMessage = value != nil
                    builderResult.optionalLazyMessage = value
                }
            }
            public var hasOptionalLazyMessage:Bool {
                get {
                    return builderResult.hasOptionalLazyMessage
                }
            }
            fileprivate var optionalLazyMessageBuilder_:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder! {
                didSet {
                    builderResult.hasOptionalLazyMessage = true
                }
            }
            public func getOptionalLazyMessageBuilder() -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                if optionalLazyMessageBuilder_ == nil {
                    optionalLazyMessageBuilder_ = Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder()
                    builderResult.optionalLazyMessage = optionalLazyMessageBuilder_.getMessage()
                    if optionalLazyMessage != nil {
                        try! optionalLazyMessageBuilder_.mergeFrom(other: optionalLazyMessage)
                    }
                }
                return optionalLazyMessageBuilder_
            }
            @discardableResult
            public func setOptionalLazyMessage(_ value:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage!) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.optionalLazyMessage = value
                return self
            }
            @discardableResult
            public func mergeOptionalLazyMessage(value:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                if builderResult.hasOptionalLazyMessage {
                    builderResult.optionalLazyMessage = try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.builderWithPrototype(prototype:builderResult.optionalLazyMessage).mergeFrom(other: value).buildPartial()
                } else {
                    builderResult.optionalLazyMessage = value
                }
                builderResult.hasOptionalLazyMessage = true
                return self
            }
            @discardableResult
            public func clearOptionalLazyMessage() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                optionalLazyMessageBuilder_ = nil
                builderResult.hasOptionalLazyMessage = false
                builderResult.optionalLazyMessage = nil
                return self
            }
            /// Repeated
            public var repeatedInt32:Array<Int32> {
                get {
                    return builderResult.repeatedInt32
                }
                set (array) {
                    builderResult.repeatedInt32 = array
                }
            }
            @discardableResult
            public func setRepeatedInt32(_ value:Array<Int32>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedInt32 = value
                return self
            }
            @discardableResult
            public func clearRepeatedInt32() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedInt32.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedInt64:Array<Int64> {
                get {
                    return builderResult.repeatedInt64
                }
                set (array) {
                    builderResult.repeatedInt64 = array
                }
            }
            @discardableResult
            public func setRepeatedInt64(_ value:Array<Int64>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedInt64 = value
                return self
            }
            @discardableResult
            public func clearRepeatedInt64() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedInt64.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedUint32:Array<UInt32> {
                get {
                    return builderResult.repeatedUint32
                }
                set (array) {
                    builderResult.repeatedUint32 = array
                }
            }
            @discardableResult
            public func setRepeatedUint32(_ value:Array<UInt32>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedUint32 = value
                return self
            }
            @discardableResult
            public func clearRepeatedUint32() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedUint32.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedUint64:Array<UInt64> {
                get {
                    return builderResult.repeatedUint64
                }
                set (array) {
                    builderResult.repeatedUint64 = array
                }
            }
            @discardableResult
            public func setRepeatedUint64(_ value:Array<UInt64>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedUint64 = value
                return self
            }
            @discardableResult
            public func clearRepeatedUint64() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedUint64.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedSint32:Array<Int32> {
                get {
                    return builderResult.repeatedSint32
                }
                set (array) {
                    builderResult.repeatedSint32 = array
                }
            }
            @discardableResult
            public func setRepeatedSint32(_ value:Array<Int32>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedSint32 = value
                return self
            }
            @discardableResult
            public func clearRepeatedSint32() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedSint32.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedSint64:Array<Int64> {
                get {
                    return builderResult.repeatedSint64
                }
                set (array) {
                    builderResult.repeatedSint64 = array
                }
            }
            @discardableResult
            public func setRepeatedSint64(_ value:Array<Int64>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedSint64 = value
                return self
            }
            @discardableResult
            public func clearRepeatedSint64() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedSint64.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedFixed32:Array<UInt32> {
                get {
                    return builderResult.repeatedFixed32
                }
                set (array) {
                    builderResult.repeatedFixed32 = array
                }
            }
            @discardableResult
            public func setRepeatedFixed32(_ value:Array<UInt32>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedFixed32 = value
                return self
            }
            @discardableResult
            public func clearRepeatedFixed32() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedFixed32.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedFixed64:Array<UInt64> {
                get {
                    return builderResult.repeatedFixed64
                }
                set (array) {
                    builderResult.repeatedFixed64 = array
                }
            }
            @discardableResult
            public func setRepeatedFixed64(_ value:Array<UInt64>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedFixed64 = value
                return self
            }
            @discardableResult
            public func clearRepeatedFixed64() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedFixed64.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedSfixed32:Array<Int32> {
                get {
                    return builderResult.repeatedSfixed32
                }
                set (array) {
                    builderResult.repeatedSfixed32 = array
                }
            }
            @discardableResult
            public func setRepeatedSfixed32(_ value:Array<Int32>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedSfixed32 = value
                return self
            }
            @discardableResult
            public func clearRepeatedSfixed32() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedSfixed32.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedSfixed64:Array<Int64> {
                get {
                    return builderResult.repeatedSfixed64
                }
                set (array) {
                    builderResult.repeatedSfixed64 = array
                }
            }
            @discardableResult
            public func setRepeatedSfixed64(_ value:Array<Int64>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedSfixed64 = value
                return self
            }
            @discardableResult
            public func clearRepeatedSfixed64() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedSfixed64.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedFloat:Array<Float> {
                get {
                    return builderResult.repeatedFloat
                }
                set (array) {
                    builderResult.repeatedFloat = array
                }
            }
            @discardableResult
            public func setRepeatedFloat(_ value:Array<Float>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedFloat = value
                return self
            }
            @discardableResult
            public func clearRepeatedFloat() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedFloat.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedDouble:Array<Double> {
                get {
                    return builderResult.repeatedDouble
                }
                set (array) {
                    builderResult.repeatedDouble = array
                }
            }
            @discardableResult
            public func setRepeatedDouble(_ value:Array<Double>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedDouble = value
                return self
            }
            @discardableResult
            public func clearRepeatedDouble() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedDouble.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedBool:Array<Bool> {
                get {
                    return builderResult.repeatedBool
                }
                set (array) {
                    builderResult.repeatedBool = array
                }
            }
            @discardableResult
            public func setRepeatedBool(_ value:Array<Bool>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedBool = value
                return self
            }
            @discardableResult
            public func clearRepeatedBool() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedBool.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedString:Array<String> {
                get {
                    return builderResult.repeatedString
                }
                set (array) {
                    builderResult.repeatedString = array
                }
            }
            @discardableResult
            public func setRepeatedString(_ value:Array<String>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedString = value
                return self
            }
            @discardableResult
            public func clearRepeatedString() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedString.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedBytes:Array<Data> {
                get {
                    return builderResult.repeatedBytes
                }
                set (array) {
                    builderResult.repeatedBytes = array
                }
            }
            @discardableResult
            public func setRepeatedBytes(_ value:Array<Data>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedBytes = value
                return self
            }
            @discardableResult
            public func clearRepeatedBytes() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedBytes.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedNestedMessage:Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage> {
                get {
                    return builderResult.repeatedNestedMessage
                }
                set (value) {
                    builderResult.repeatedNestedMessage = value
                }
            }
            @discardableResult
            public func setRepeatedNestedMessage(_ value:Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedNestedMessage = value
                return self
            }
            @discardableResult
            public func clearRepeatedNestedMessage() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedNestedMessage.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedForeignMessage:Array<Proto2NofieldpresenceUnittest.ForeignMessage> {
                get {
                    return builderResult.repeatedForeignMessage
                }
                set (value) {
                    builderResult.repeatedForeignMessage = value
                }
            }
            @discardableResult
            public func setRepeatedForeignMessage(_ value:Array<Proto2NofieldpresenceUnittest.ForeignMessage>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedForeignMessage = value
                return self
            }
            @discardableResult
            public func clearRepeatedForeignMessage() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedForeignMessage.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedProto2Message:Array<ProtobufUnittest.TestAllTypes> {
                get {
                    return builderResult.repeatedProto2Message
                }
                set (value) {
                    builderResult.repeatedProto2Message = value
                }
            }
            @discardableResult
            public func setRepeatedProto2Message(_ value:Array<ProtobufUnittest.TestAllTypes>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedProto2Message = value
                return self
            }
            @discardableResult
            public func clearRepeatedProto2Message() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedProto2Message.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedNestedEnum:Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum> {
                get {
                    return builderResult.repeatedNestedEnum
                }
                set (value) {
                    builderResult.repeatedNestedEnum = value
                }
            }
            @discardableResult
            public func setRepeatedNestedEnum(_ value:Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedNestedEnum = value
                return self
            }
            @discardableResult
            public func clearRepeatedNestedEnum() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedNestedEnum.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedForeignEnum:Array<Proto2NofieldpresenceUnittest.ForeignEnum> {
                get {
                    return builderResult.repeatedForeignEnum
                }
                set (value) {
                    builderResult.repeatedForeignEnum = value
                }
            }
            @discardableResult
            public func setRepeatedForeignEnum(_ value:Array<Proto2NofieldpresenceUnittest.ForeignEnum>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedForeignEnum = value
                return self
            }
            @discardableResult
            public func clearRepeatedForeignEnum() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedForeignEnum.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedStringPiece:Array<String> {
                get {
                    return builderResult.repeatedStringPiece
                }
                set (array) {
                    builderResult.repeatedStringPiece = array
                }
            }
            @discardableResult
            public func setRepeatedStringPiece(_ value:Array<String>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedStringPiece = value
                return self
            }
            @discardableResult
            public func clearRepeatedStringPiece() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedStringPiece.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedCord:Array<String> {
                get {
                    return builderResult.repeatedCord
                }
                set (array) {
                    builderResult.repeatedCord = array
                }
            }
            @discardableResult
            public func setRepeatedCord(_ value:Array<String>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedCord = value
                return self
            }
            @discardableResult
            public func clearRepeatedCord() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedCord.removeAll(keepingCapacity: false)
                return self
            }
            public var repeatedLazyMessage:Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage> {
                get {
                    return builderResult.repeatedLazyMessage
                }
                set (value) {
                    builderResult.repeatedLazyMessage = value
                }
            }
            @discardableResult
            public func setRepeatedLazyMessage(_ value:Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage>) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.repeatedLazyMessage = value
                return self
            }
            @discardableResult
            public func clearRepeatedLazyMessage() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult.repeatedLazyMessage.removeAll(keepingCapacity: false)
                return self
            }
            public var oneofUint32:UInt32 {
                get {
                    return builderResult.oneofUint32
                }
                set (value) {
                    builderResult.hasOneofUint32 = true
                    builderResult.oneofUint32 = value
                }
            }
            public var hasOneofUint32:Bool {
                get {
                    return builderResult.hasOneofUint32
                }
            }
            @discardableResult
            public func setOneofUint32(_ value:UInt32) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.oneofUint32 = value
                return self
            }
            @discardableResult
            public func clearOneofUint32() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOneofUint32 = false
                builderResult.oneofUint32 = nil
                return self
            }
            public var oneofNestedMessage:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage! {
                get {
                    if oneofNestedMessageBuilder_ != nil {
                        builderResult.oneofNestedMessage = oneofNestedMessageBuilder_.getMessage()
                    }
                    return builderResult.oneofNestedMessage
                }
                set (value) {
                    builderResult.hasOneofNestedMessage = value != nil
                    builderResult.oneofNestedMessage = value
                }
            }
            public var hasOneofNestedMessage:Bool {
                get {
                    return builderResult.hasOneofNestedMessage
                }
            }
            fileprivate var oneofNestedMessageBuilder_:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder! {
                didSet {
                    builderResult.hasOneofNestedMessage = true
                }
            }
            public func getOneofNestedMessageBuilder() -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder {
                if oneofNestedMessageBuilder_ == nil {
                    oneofNestedMessageBuilder_ = Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder()
                    builderResult.oneofNestedMessage = oneofNestedMessageBuilder_.getMessage()
                    if oneofNestedMessage != nil {
                        try! oneofNestedMessageBuilder_.mergeFrom(other: oneofNestedMessage)
                    }
                }
                return oneofNestedMessageBuilder_
            }
            @discardableResult
            public func setOneofNestedMessage(_ value:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage!) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.oneofNestedMessage = value
                return self
            }
            @discardableResult
            public func mergeOneofNestedMessage(value:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                if builderResult.hasOneofNestedMessage {
                    builderResult.oneofNestedMessage = try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.builderWithPrototype(prototype:builderResult.oneofNestedMessage).mergeFrom(other: value).buildPartial()
                } else {
                    builderResult.oneofNestedMessage = value
                }
                builderResult.hasOneofNestedMessage = true
                return self
            }
            @discardableResult
            public func clearOneofNestedMessage() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                oneofNestedMessageBuilder_ = nil
                builderResult.hasOneofNestedMessage = false
                builderResult.oneofNestedMessage = nil
                return self
            }
            public var oneofString:String {
                get {
                    return builderResult.oneofString
                }
                set (value) {
                    builderResult.hasOneofString = true
                    builderResult.oneofString = value
                }
            }
            public var hasOneofString:Bool {
                get {
                    return builderResult.hasOneofString
                }
            }
            @discardableResult
            public func setOneofString(_ value:String) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                self.oneofString = value
                return self
            }
            @discardableResult
            public func clearOneofString() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder{
                builderResult.hasOneofString = false
                builderResult.oneofString = nil
                return self
            }
                public var oneofEnum:Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum {
                    get {
                        return builderResult.oneofEnum
                    }
                    set (value) {
                        builderResult.hasOneofEnum = true
                        builderResult.oneofEnum = value
                    }
                }
                public var hasOneofEnum:Bool{
                    get {
                        return builderResult.hasOneofEnum
                    }
                }
            @discardableResult
                public func setOneofEnum(_ value:Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum) -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                  self.oneofEnum = value
                  return self
                }
            @discardableResult
                public func clearOneofEnum() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                   builderResult.hasOneofEnum = false
                   builderResult.oneofEnum = .foo
                   return self
                }
            override public var internalGetResult:GeneratedMessage {
                get {
                    return builderResult
                }
            }
            @discardableResult
            override public func clear() -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                builderResult = Proto2NofieldpresenceUnittest.TestAllTypes()
                return self
            }
            override public func clone() throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                return try Proto2NofieldpresenceUnittest.TestAllTypes.builderWithPrototype(prototype:builderResult)
            }
            override public func build() throws -> Proto2NofieldpresenceUnittest.TestAllTypes {
                try checkInitialized()
                return buildPartial()
            }
            public func buildPartial() -> Proto2NofieldpresenceUnittest.TestAllTypes {
                let returnMe:Proto2NofieldpresenceUnittest.TestAllTypes = builderResult
                return returnMe
            }
            @discardableResult
            public func mergeFrom(other:Proto2NofieldpresenceUnittest.TestAllTypes) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                if other == Proto2NofieldpresenceUnittest.TestAllTypes() {
                    return self
                }
                if other.hasOptionalInt32 {
                    optionalInt32 = other.optionalInt32
                }
                if other.hasOptionalInt64 {
                    optionalInt64 = other.optionalInt64
                }
                if other.hasOptionalUint32 {
                    optionalUint32 = other.optionalUint32
                }
                if other.hasOptionalUint64 {
                    optionalUint64 = other.optionalUint64
                }
                if other.hasOptionalSint32 {
                    optionalSint32 = other.optionalSint32
                }
                if other.hasOptionalSint64 {
                    optionalSint64 = other.optionalSint64
                }
                if other.hasOptionalFixed32 {
                    optionalFixed32 = other.optionalFixed32
                }
                if other.hasOptionalFixed64 {
                    optionalFixed64 = other.optionalFixed64
                }
                if other.hasOptionalSfixed32 {
                    optionalSfixed32 = other.optionalSfixed32
                }
                if other.hasOptionalSfixed64 {
                    optionalSfixed64 = other.optionalSfixed64
                }
                if other.hasOptionalFloat {
                    optionalFloat = other.optionalFloat
                }
                if other.hasOptionalDouble {
                    optionalDouble = other.optionalDouble
                }
                if other.hasOptionalBool {
                    optionalBool = other.optionalBool
                }
                if other.hasOptionalString {
                    optionalString = other.optionalString
                }
                if other.hasOptionalBytes {
                    optionalBytes = other.optionalBytes
                }
                if (other.hasOptionalNestedMessage) {
                    try mergeOptionalNestedMessage(value: other.optionalNestedMessage)
                }
                if (other.hasOptionalForeignMessage) {
                    try mergeOptionalForeignMessage(value: other.optionalForeignMessage)
                }
                if (other.hasOptionalProto2Message) {
                    try mergeOptionalProto2Message(value: other.optionalProto2Message)
                }
                if other.hasOptionalNestedEnum {
                    optionalNestedEnum = other.optionalNestedEnum
                }
                if other.hasOptionalForeignEnum {
                    optionalForeignEnum = other.optionalForeignEnum
                }
                if other.hasOptionalStringPiece {
                    optionalStringPiece = other.optionalStringPiece
                }
                if other.hasOptionalCord {
                    optionalCord = other.optionalCord
                }
                if (other.hasOptionalLazyMessage) {
                    try mergeOptionalLazyMessage(value: other.optionalLazyMessage)
                }
                if !other.repeatedInt32.isEmpty {
                    builderResult.repeatedInt32 += other.repeatedInt32
                }
                if !other.repeatedInt64.isEmpty {
                    builderResult.repeatedInt64 += other.repeatedInt64
                }
                if !other.repeatedUint32.isEmpty {
                    builderResult.repeatedUint32 += other.repeatedUint32
                }
                if !other.repeatedUint64.isEmpty {
                    builderResult.repeatedUint64 += other.repeatedUint64
                }
                if !other.repeatedSint32.isEmpty {
                    builderResult.repeatedSint32 += other.repeatedSint32
                }
                if !other.repeatedSint64.isEmpty {
                    builderResult.repeatedSint64 += other.repeatedSint64
                }
                if !other.repeatedFixed32.isEmpty {
                    builderResult.repeatedFixed32 += other.repeatedFixed32
                }
                if !other.repeatedFixed64.isEmpty {
                    builderResult.repeatedFixed64 += other.repeatedFixed64
                }
                if !other.repeatedSfixed32.isEmpty {
                    builderResult.repeatedSfixed32 += other.repeatedSfixed32
                }
                if !other.repeatedSfixed64.isEmpty {
                    builderResult.repeatedSfixed64 += other.repeatedSfixed64
                }
                if !other.repeatedFloat.isEmpty {
                    builderResult.repeatedFloat += other.repeatedFloat
                }
                if !other.repeatedDouble.isEmpty {
                    builderResult.repeatedDouble += other.repeatedDouble
                }
                if !other.repeatedBool.isEmpty {
                    builderResult.repeatedBool += other.repeatedBool
                }
                if !other.repeatedString.isEmpty {
                    builderResult.repeatedString += other.repeatedString
                }
                if !other.repeatedBytes.isEmpty {
                    builderResult.repeatedBytes += other.repeatedBytes
                }
                if !other.repeatedNestedMessage.isEmpty  {
                     builderResult.repeatedNestedMessage += other.repeatedNestedMessage
                }
                if !other.repeatedForeignMessage.isEmpty  {
                     builderResult.repeatedForeignMessage += other.repeatedForeignMessage
                }
                if !other.repeatedProto2Message.isEmpty  {
                     builderResult.repeatedProto2Message += other.repeatedProto2Message
                }
                if !other.repeatedNestedEnum.isEmpty {
                     builderResult.repeatedNestedEnum += other.repeatedNestedEnum
                }
                if !other.repeatedForeignEnum.isEmpty {
                     builderResult.repeatedForeignEnum += other.repeatedForeignEnum
                }
                if !other.repeatedStringPiece.isEmpty {
                    builderResult.repeatedStringPiece += other.repeatedStringPiece
                }
                if !other.repeatedCord.isEmpty {
                    builderResult.repeatedCord += other.repeatedCord
                }
                if !other.repeatedLazyMessage.isEmpty  {
                     builderResult.repeatedLazyMessage += other.repeatedLazyMessage
                }
                if other.hasOneofUint32 {
                    oneofUint32 = other.oneofUint32
                }
                if (other.hasOneofNestedMessage) {
                    try mergeOneofNestedMessage(value: other.oneofNestedMessage)
                }
                if other.hasOneofString {
                    oneofString = other.oneofString
                }
                if other.hasOneofEnum {
                    oneofEnum = other.oneofEnum
                }
                try merge(unknownField: other.unknownFields)
                return self
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                return try mergeFrom(codedInputStream: codedInputStream, extensionRegistry:ExtensionRegistry())
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                let unknownFieldsBuilder:UnknownFieldSet.Builder = try UnknownFieldSet.builderWithUnknownFields(copyFrom:self.unknownFields)
                while (true) {
                    let protobufTag = try codedInputStream.readTag()
                    switch protobufTag {
                    case 0: 
                        self.unknownFields = try unknownFieldsBuilder.build()
                        return self

                    case 8:
                        optionalInt32 = try codedInputStream.readInt32()

                    case 16:
                        optionalInt64 = try codedInputStream.readInt64()

                    case 24:
                        optionalUint32 = try codedInputStream.readUInt32()

                    case 32:
                        optionalUint64 = try codedInputStream.readUInt64()

                    case 40:
                        optionalSint32 = try codedInputStream.readSInt32()

                    case 48:
                        optionalSint64 = try codedInputStream.readSInt64()

                    case 61:
                        optionalFixed32 = try codedInputStream.readFixed32()

                    case 65:
                        optionalFixed64 = try codedInputStream.readFixed64()

                    case 77:
                        optionalSfixed32 = try codedInputStream.readSFixed32()

                    case 81:
                        optionalSfixed64 = try codedInputStream.readSFixed64()

                    case 93:
                        optionalFloat = try codedInputStream.readFloat()

                    case 97:
                        optionalDouble = try codedInputStream.readDouble()

                    case 104:
                        optionalBool = try codedInputStream.readBool()

                    case 114:
                        optionalString = try codedInputStream.readString()

                    case 122:
                        optionalBytes = try codedInputStream.readData()

                    case 146:
                        let subBuilder:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder = Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder()
                        if hasOptionalNestedMessage {
                            try subBuilder.mergeFrom(other: optionalNestedMessage)
                        }
                        try codedInputStream.readMessage(builder: subBuilder, extensionRegistry:extensionRegistry)
                        optionalNestedMessage = subBuilder.buildPartial()

                    case 154:
                        let subBuilder:Proto2NofieldpresenceUnittest.ForeignMessage.Builder = Proto2NofieldpresenceUnittest.ForeignMessage.Builder()
                        if hasOptionalForeignMessage {
                            try subBuilder.mergeFrom(other: optionalForeignMessage)
                        }
                        try codedInputStream.readMessage(builder: subBuilder, extensionRegistry:extensionRegistry)
                        optionalForeignMessage = subBuilder.buildPartial()

                    case 162:
                        let subBuilder:ProtobufUnittest.TestAllTypes.Builder = ProtobufUnittest.TestAllTypes.Builder()
                        if hasOptionalProto2Message {
                            try subBuilder.mergeFrom(other: optionalProto2Message)
                        }
                        try codedInputStream.readMessage(builder: subBuilder, extensionRegistry:extensionRegistry)
                        optionalProto2Message = subBuilder.buildPartial()

                    case 168:
                        let valueIntoptionalNestedEnum = try codedInputStream.readEnum()
                        if let enumsoptionalNestedEnum = Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum(rawValue:valueIntoptionalNestedEnum){
                            optionalNestedEnum = enumsoptionalNestedEnum
                        } else {
                            try unknownFieldsBuilder.mergeVarintField(fieldNumber: 21, value:Int64(valueIntoptionalNestedEnum))
                        }

                    case 176:
                        let valueIntoptionalForeignEnum = try codedInputStream.readEnum()
                        if let enumsoptionalForeignEnum = Proto2NofieldpresenceUnittest.ForeignEnum(rawValue:valueIntoptionalForeignEnum){
                            optionalForeignEnum = enumsoptionalForeignEnum
                        } else {
                            try unknownFieldsBuilder.mergeVarintField(fieldNumber: 22, value:Int64(valueIntoptionalForeignEnum))
                        }

                    case 194:
                        optionalStringPiece = try codedInputStream.readString()

                    case 202:
                        optionalCord = try codedInputStream.readString()

                    case 242:
                        let subBuilder:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder = Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder()
                        if hasOptionalLazyMessage {
                            try subBuilder.mergeFrom(other: optionalLazyMessage)
                        }
                        try codedInputStream.readMessage(builder: subBuilder, extensionRegistry:extensionRegistry)
                        optionalLazyMessage = subBuilder.buildPartial()

                    case 250:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let limit = try codedInputStream.pushLimit(byteLimit: length)
                        while (codedInputStream.bytesUntilLimit() > 0) {
                            builderResult.repeatedInt32.append(try codedInputStream.readInt32())
                        }
                        codedInputStream.popLimit(oldLimit: limit)

                    case 258:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let limit = try codedInputStream.pushLimit(byteLimit: length)
                        while (codedInputStream.bytesUntilLimit() > 0) {
                            builderResult.repeatedInt64.append(try codedInputStream.readInt64())
                        }
                        codedInputStream.popLimit(oldLimit: limit)

                    case 266:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let limit = try codedInputStream.pushLimit(byteLimit: length)
                        while (codedInputStream.bytesUntilLimit() > 0) {
                            builderResult.repeatedUint32.append(try codedInputStream.readUInt32())
                        }
                        codedInputStream.popLimit(oldLimit: limit)

                    case 274:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let limit = try codedInputStream.pushLimit(byteLimit: length)
                        while (codedInputStream.bytesUntilLimit() > 0) {
                            builderResult.repeatedUint64.append(try codedInputStream.readUInt64())
                        }
                        codedInputStream.popLimit(oldLimit: limit)

                    case 282:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let limit = try codedInputStream.pushLimit(byteLimit: length)
                        while (codedInputStream.bytesUntilLimit() > 0) {
                            builderResult.repeatedSint32.append(try codedInputStream.readSInt32())
                        }
                        codedInputStream.popLimit(oldLimit: limit)

                    case 290:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let limit = try codedInputStream.pushLimit(byteLimit: length)
                        while (codedInputStream.bytesUntilLimit() > 0) {
                            builderResult.repeatedSint64.append(try codedInputStream.readSInt64())
                        }
                        codedInputStream.popLimit(oldLimit: limit)

                    case 298:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let limit = try codedInputStream.pushLimit(byteLimit: length)
                        while (codedInputStream.bytesUntilLimit() > 0) {
                            builderResult.repeatedFixed32.append(try codedInputStream.readFixed32())
                        }
                        codedInputStream.popLimit(oldLimit: limit)

                    case 306:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let limit = try codedInputStream.pushLimit(byteLimit: length)
                        while (codedInputStream.bytesUntilLimit() > 0) {
                            builderResult.repeatedFixed64.append(try codedInputStream.readFixed64())
                        }
                        codedInputStream.popLimit(oldLimit: limit)

                    case 314:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let limit = try codedInputStream.pushLimit(byteLimit: length)
                        while (codedInputStream.bytesUntilLimit() > 0) {
                            builderResult.repeatedSfixed32.append(try codedInputStream.readSFixed32())
                        }
                        codedInputStream.popLimit(oldLimit: limit)

                    case 322:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let limit = try codedInputStream.pushLimit(byteLimit: length)
                        while (codedInputStream.bytesUntilLimit() > 0) {
                            builderResult.repeatedSfixed64.append(try codedInputStream.readSFixed64())
                        }
                        codedInputStream.popLimit(oldLimit: limit)

                    case 330:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let limit = try codedInputStream.pushLimit(byteLimit: length)
                        while (codedInputStream.bytesUntilLimit() > 0) {
                            builderResult.repeatedFloat.append(try codedInputStream.readFloat())
                        }
                        codedInputStream.popLimit(oldLimit: limit)

                    case 338:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let limit = try codedInputStream.pushLimit(byteLimit: length)
                        while (codedInputStream.bytesUntilLimit() > 0) {
                            builderResult.repeatedDouble.append(try codedInputStream.readDouble())
                        }
                        codedInputStream.popLimit(oldLimit: limit)

                    case 346:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let limit = try codedInputStream.pushLimit(byteLimit: length)
                        while (codedInputStream.bytesUntilLimit() > 0) {
                            builderResult.repeatedBool.append(try codedInputStream.readBool())
                        }
                        codedInputStream.popLimit(oldLimit: limit)

                    case 354:
                        repeatedString += [try codedInputStream.readString()]

                    case 362:
                        repeatedBytes += [try codedInputStream.readData()]

                    case 386:
                        let subBuilder = Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder()
                        try codedInputStream.readMessage(builder: subBuilder,extensionRegistry:extensionRegistry)
                        repeatedNestedMessage.append(subBuilder.buildPartial())

                    case 394:
                        let subBuilder = Proto2NofieldpresenceUnittest.ForeignMessage.Builder()
                        try codedInputStream.readMessage(builder: subBuilder,extensionRegistry:extensionRegistry)
                        repeatedForeignMessage.append(subBuilder.buildPartial())

                    case 402:
                        let subBuilder = ProtobufUnittest.TestAllTypes.Builder()
                        try codedInputStream.readMessage(builder: subBuilder,extensionRegistry:extensionRegistry)
                        repeatedProto2Message.append(subBuilder.buildPartial())

                    case 410:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let oldLimit = try codedInputStream.pushLimit(byteLimit: length)
                        while codedInputStream.bytesUntilLimit() > 0 {
                        let valueIntrepeatedNestedEnum = try codedInputStream.readEnum()
                        if let enumsrepeatedNestedEnum = Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum(rawValue:valueIntrepeatedNestedEnum) {
                            builderResult.repeatedNestedEnum.append(enumsrepeatedNestedEnum)
                        } else {
                            try unknownFieldsBuilder.mergeVarintField(fieldNumber: 51, value:Int64(valueIntrepeatedNestedEnum))
                        }
                        }
                        codedInputStream.popLimit(oldLimit: oldLimit)

                    case 418:
                        let length = Int(try codedInputStream.readRawVarint32())
                        let oldLimit = try codedInputStream.pushLimit(byteLimit: length)
                        while codedInputStream.bytesUntilLimit() > 0 {
                        let valueIntrepeatedForeignEnum = try codedInputStream.readEnum()
                        if let enumsrepeatedForeignEnum = Proto2NofieldpresenceUnittest.ForeignEnum(rawValue:valueIntrepeatedForeignEnum) {
                            builderResult.repeatedForeignEnum.append(enumsrepeatedForeignEnum)
                        } else {
                            try unknownFieldsBuilder.mergeVarintField(fieldNumber: 52, value:Int64(valueIntrepeatedForeignEnum))
                        }
                        }
                        codedInputStream.popLimit(oldLimit: oldLimit)

                    case 434:
                        repeatedStringPiece += [try codedInputStream.readString()]

                    case 442:
                        repeatedCord += [try codedInputStream.readString()]

                    case 458:
                        let subBuilder = Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder()
                        try codedInputStream.readMessage(builder: subBuilder,extensionRegistry:extensionRegistry)
                        repeatedLazyMessage.append(subBuilder.buildPartial())

                    case 888:
                        oneofUint32 = try codedInputStream.readUInt32()

                    case 898:
                        let subBuilder:Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder = Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder()
                        if hasOneofNestedMessage {
                            try subBuilder.mergeFrom(other: oneofNestedMessage)
                        }
                        try codedInputStream.readMessage(builder: subBuilder, extensionRegistry:extensionRegistry)
                        oneofNestedMessage = subBuilder.buildPartial()

                    case 906:
                        oneofString = try codedInputStream.readString()

                    case 912:
                        let valueIntoneofEnum = try codedInputStream.readEnum()
                        if let enumsoneofEnum = Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum(rawValue:valueIntoneofEnum){
                            oneofEnum = enumsoneofEnum
                        } else {
                            try unknownFieldsBuilder.mergeVarintField(fieldNumber: 114, value:Int64(valueIntoneofEnum))
                        }

                    default:
                        if (!(try parse(codedInputStream:codedInputStream, unknownFields:unknownFieldsBuilder, extensionRegistry:extensionRegistry, tag:protobufTag))) {
                            unknownFields = try unknownFieldsBuilder.build()
                            return self
                        }
                    }
                }
            }
            class override public func decodeToBuilder(jsonMap:Dictionary<String,Any>) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                let resultDecodedBuilder = Proto2NofieldpresenceUnittest.TestAllTypes.Builder()
                if let jsonValueOptionalInt32 = jsonMap["optionalInt32"] as? Int {
                    resultDecodedBuilder.optionalInt32 = Int32(jsonValueOptionalInt32)
                } else if let jsonValueOptionalInt32 = jsonMap["optionalInt32"] as? String {
                    resultDecodedBuilder.optionalInt32 = Int32(jsonValueOptionalInt32)!
                }
                if let jsonValueOptionalInt64 = jsonMap["optionalInt64"] as? String {
                    resultDecodedBuilder.optionalInt64 = Int64(jsonValueOptionalInt64)!
                } else if let jsonValueOptionalInt64 = jsonMap["optionalInt64"] as? Int {
                    resultDecodedBuilder.optionalInt64 = Int64(jsonValueOptionalInt64)
                }
                if let jsonValueOptionalUint32 = jsonMap["optionalUint32"] as? UInt {
                    resultDecodedBuilder.optionalUint32 = UInt32(jsonValueOptionalUint32)
                } else if let jsonValueOptionalUint32 = jsonMap["optionalUint32"] as? String {
                    resultDecodedBuilder.optionalUint32 = UInt32(jsonValueOptionalUint32)!
                }
                if let jsonValueOptionalUint64 = jsonMap["optionalUint64"] as? String {
                    resultDecodedBuilder.optionalUint64 = UInt64(jsonValueOptionalUint64)!
                } else if let jsonValueOptionalUint64 = jsonMap["optionalUint64"] as? UInt {
                    resultDecodedBuilder.optionalUint64 = UInt64(jsonValueOptionalUint64)
                }
                if let jsonValueOptionalSint32 = jsonMap["optionalSint32"] as? Int {
                    resultDecodedBuilder.optionalSint32 = Int32(jsonValueOptionalSint32)
                } else if let jsonValueOptionalSint32 = jsonMap["optionalSint32"] as? String {
                    resultDecodedBuilder.optionalSint32 = Int32(jsonValueOptionalSint32)!
                }
                if let jsonValueOptionalSint64 = jsonMap["optionalSint64"] as? String {
                    resultDecodedBuilder.optionalSint64 = Int64(jsonValueOptionalSint64)!
                } else if let jsonValueOptionalSint64 = jsonMap["optionalSint64"] as? Int {
                    resultDecodedBuilder.optionalSint64 = Int64(jsonValueOptionalSint64)
                }
                if let jsonValueOptionalFixed32 = jsonMap["optionalFixed32"] as? UInt {
                    resultDecodedBuilder.optionalFixed32 = UInt32(jsonValueOptionalFixed32)
                } else if let jsonValueOptionalFixed32 = jsonMap["optionalFixed32"] as? String {
                    resultDecodedBuilder.optionalFixed32 = UInt32(jsonValueOptionalFixed32)!
                }
                if let jsonValueOptionalFixed64 = jsonMap["optionalFixed64"] as? String {
                    resultDecodedBuilder.optionalFixed64 = UInt64(jsonValueOptionalFixed64)!
                } else if let jsonValueOptionalFixed64 = jsonMap["optionalFixed64"] as? UInt {
                    resultDecodedBuilder.optionalFixed64 = UInt64(jsonValueOptionalFixed64)
                }
                if let jsonValueOptionalSfixed32 = jsonMap["optionalSfixed32"] as? Int {
                    resultDecodedBuilder.optionalSfixed32 = Int32(jsonValueOptionalSfixed32)
                } else if let jsonValueOptionalSfixed32 = jsonMap["optionalSfixed32"] as? String {
                    resultDecodedBuilder.optionalSfixed32 = Int32(jsonValueOptionalSfixed32)!
                }
                if let jsonValueOptionalSfixed64 = jsonMap["optionalSfixed64"] as? String {
                    resultDecodedBuilder.optionalSfixed64 = Int64(jsonValueOptionalSfixed64)!
                } else if let jsonValueOptionalSfixed64 = jsonMap["optionalSfixed64"] as? Int {
                    resultDecodedBuilder.optionalSfixed64 = Int64(jsonValueOptionalSfixed64)
                }
                if let jsonValueOptionalFloat = jsonMap["optionalFloat"] as? Float {
                    resultDecodedBuilder.optionalFloat = Float(jsonValueOptionalFloat)
                } else if let jsonValueOptionalFloat = jsonMap["optionalFloat"] as? String {
                    resultDecodedBuilder.optionalFloat = Float(jsonValueOptionalFloat)!
                }
                if let jsonValueOptionalDouble = jsonMap["optionalDouble"] as? Double {
                    resultDecodedBuilder.optionalDouble = Double(jsonValueOptionalDouble)
                } else if let jsonValueOptionalDouble = jsonMap["optionalDouble"] as? String {
                    resultDecodedBuilder.optionalDouble = Double(jsonValueOptionalDouble)!
                }
                if let jsonValueOptionalBool = jsonMap["optionalBool"] as? Bool {
                    resultDecodedBuilder.optionalBool = jsonValueOptionalBool
                }
                if let jsonValueOptionalString = jsonMap["optionalString"] as? String {
                    resultDecodedBuilder.optionalString = jsonValueOptionalString
                }
                if let jsonValueOptionalBytes = jsonMap["optionalBytes"] as? String {
                    resultDecodedBuilder.optionalBytes = Data(base64Encoded:jsonValueOptionalBytes, options: Data.Base64DecodingOptions(rawValue:0))!
                }
                if let jsonValueOptionalNestedMessage = jsonMap["optionalNestedMessage"] as? Dictionary<String,Any> {
                    resultDecodedBuilder.optionalNestedMessage = try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonValueOptionalNestedMessage).build()

                }
                if let jsonValueOptionalForeignMessage = jsonMap["optionalForeignMessage"] as? Dictionary<String,Any> {
                    resultDecodedBuilder.optionalForeignMessage = try Proto2NofieldpresenceUnittest.ForeignMessage.Builder.decodeToBuilder(jsonMap:jsonValueOptionalForeignMessage).build()

                }
                if let jsonValueOptionalProto2Message = jsonMap["optionalProto2Message"] as? Dictionary<String,Any> {
                    resultDecodedBuilder.optionalProto2Message = try ProtobufUnittest.TestAllTypes.Builder.decodeToBuilder(jsonMap:jsonValueOptionalProto2Message).build()

                }
                if let jsonValueOptionalNestedEnum = jsonMap["optionalNestedEnum"] as? String {
                    resultDecodedBuilder.optionalNestedEnum = try Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum.fromString(jsonValueOptionalNestedEnum)
                }
                if let jsonValueOptionalForeignEnum = jsonMap["optionalForeignEnum"] as? String {
                    resultDecodedBuilder.optionalForeignEnum = try Proto2NofieldpresenceUnittest.ForeignEnum.fromString(jsonValueOptionalForeignEnum)
                }
                if let jsonValueOptionalStringPiece = jsonMap["optionalStringPiece"] as? String {
                    resultDecodedBuilder.optionalStringPiece = jsonValueOptionalStringPiece
                }
                if let jsonValueOptionalCord = jsonMap["optionalCord"] as? String {
                    resultDecodedBuilder.optionalCord = jsonValueOptionalCord
                }
                if let jsonValueOptionalLazyMessage = jsonMap["optionalLazyMessage"] as? Dictionary<String,Any> {
                    resultDecodedBuilder.optionalLazyMessage = try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonValueOptionalLazyMessage).build()

                }
                if let jsonValueRepeatedInt32 = jsonMap["repeatedInt32"] as? Array<Int> {
                    var jsonArrayRepeatedInt32:Array<Int32> = []
                    for oneValueRepeatedInt32 in jsonValueRepeatedInt32 {
                        jsonArrayRepeatedInt32.append(Int32(oneValueRepeatedInt32))
                    }
                    resultDecodedBuilder.repeatedInt32 = jsonArrayRepeatedInt32
                }
                if let jsonValueRepeatedInt64 = jsonMap["repeatedInt64"] as? Array<String> {
                    var jsonArrayRepeatedInt64:Array<Int64> = []
                    for oneValueRepeatedInt64 in jsonValueRepeatedInt64 {
                        jsonArrayRepeatedInt64.append(Int64(oneValueRepeatedInt64)!)
                    }
                    resultDecodedBuilder.repeatedInt64 = jsonArrayRepeatedInt64
                }
                if let jsonValueRepeatedUint32 = jsonMap["repeatedUint32"] as? Array<UInt> {
                    var jsonArrayRepeatedUint32:Array<UInt32> = []
                    for oneValueRepeatedUint32 in jsonValueRepeatedUint32 {
                        jsonArrayRepeatedUint32.append(UInt32(oneValueRepeatedUint32))
                    }
                    resultDecodedBuilder.repeatedUint32 = jsonArrayRepeatedUint32
                }
                if let jsonValueRepeatedUint64 = jsonMap["repeatedUint64"] as? Array<String> {
                    var jsonArrayRepeatedUint64:Array<UInt64> = []
                    for oneValueRepeatedUint64 in jsonValueRepeatedUint64 {
                        jsonArrayRepeatedUint64.append(UInt64(oneValueRepeatedUint64)!)
                    }
                    resultDecodedBuilder.repeatedUint64 = jsonArrayRepeatedUint64
                }
                if let jsonValueRepeatedSint32 = jsonMap["repeatedSint32"] as? Array<Int> {
                    var jsonArrayRepeatedSint32:Array<Int32> = []
                    for oneValueRepeatedSint32 in jsonValueRepeatedSint32 {
                        jsonArrayRepeatedSint32.append(Int32(oneValueRepeatedSint32))
                    }
                    resultDecodedBuilder.repeatedSint32 = jsonArrayRepeatedSint32
                }
                if let jsonValueRepeatedSint64 = jsonMap["repeatedSint64"] as? Array<String> {
                    var jsonArrayRepeatedSint64:Array<Int64> = []
                    for oneValueRepeatedSint64 in jsonValueRepeatedSint64 {
                        jsonArrayRepeatedSint64.append(Int64(oneValueRepeatedSint64)!)
                    }
                    resultDecodedBuilder.repeatedSint64 = jsonArrayRepeatedSint64
                }
                if let jsonValueRepeatedFixed32 = jsonMap["repeatedFixed32"] as? Array<UInt> {
                    var jsonArrayRepeatedFixed32:Array<UInt32> = []
                    for oneValueRepeatedFixed32 in jsonValueRepeatedFixed32 {
                        jsonArrayRepeatedFixed32.append(UInt32(oneValueRepeatedFixed32))
                    }
                    resultDecodedBuilder.repeatedFixed32 = jsonArrayRepeatedFixed32
                }
                if let jsonValueRepeatedFixed64 = jsonMap["repeatedFixed64"] as? Array<String> {
                    var jsonArrayRepeatedFixed64:Array<UInt64> = []
                    for oneValueRepeatedFixed64 in jsonValueRepeatedFixed64 {
                        jsonArrayRepeatedFixed64.append(UInt64(oneValueRepeatedFixed64)!)
                    }
                    resultDecodedBuilder.repeatedFixed64 = jsonArrayRepeatedFixed64
                }
                if let jsonValueRepeatedSfixed32 = jsonMap["repeatedSfixed32"] as? Array<Int> {
                    var jsonArrayRepeatedSfixed32:Array<Int32> = []
                    for oneValueRepeatedSfixed32 in jsonValueRepeatedSfixed32 {
                        jsonArrayRepeatedSfixed32.append(Int32(oneValueRepeatedSfixed32))
                    }
                    resultDecodedBuilder.repeatedSfixed32 = jsonArrayRepeatedSfixed32
                }
                if let jsonValueRepeatedSfixed64 = jsonMap["repeatedSfixed64"] as? Array<String> {
                    var jsonArrayRepeatedSfixed64:Array<Int64> = []
                    for oneValueRepeatedSfixed64 in jsonValueRepeatedSfixed64 {
                        jsonArrayRepeatedSfixed64.append(Int64(oneValueRepeatedSfixed64)!)
                    }
                    resultDecodedBuilder.repeatedSfixed64 = jsonArrayRepeatedSfixed64
                }
                if let jsonValueRepeatedFloat = jsonMap["repeatedFloat"] as? Array<Float> {
                    var jsonArrayRepeatedFloat:Array<Float> = []
                    for oneValueRepeatedFloat in jsonValueRepeatedFloat {
                        jsonArrayRepeatedFloat.append(Float(oneValueRepeatedFloat))
                    }
                    resultDecodedBuilder.repeatedFloat = jsonArrayRepeatedFloat
                }
                if let jsonValueRepeatedDouble = jsonMap["repeatedDouble"] as? Array<Double> {
                    var jsonArrayRepeatedDouble:Array<Double> = []
                    for oneValueRepeatedDouble in jsonValueRepeatedDouble {
                        jsonArrayRepeatedDouble.append(Double(oneValueRepeatedDouble))
                    }
                    resultDecodedBuilder.repeatedDouble = jsonArrayRepeatedDouble
                }
                if let jsonValueRepeatedBool = jsonMap["repeatedBool"] as? Array<Bool> {
                    var jsonArrayRepeatedBool:Array<Bool> = []
                    for oneValueRepeatedBool in jsonValueRepeatedBool {
                        jsonArrayRepeatedBool.append(oneValueRepeatedBool)
                    }
                    resultDecodedBuilder.repeatedBool = jsonArrayRepeatedBool
                }
                if let jsonValueRepeatedString = jsonMap["repeatedString"] as? Array<String> {
                    var jsonArrayRepeatedString:Array<String> = []
                    for oneValueRepeatedString in jsonValueRepeatedString {
                        jsonArrayRepeatedString.append(oneValueRepeatedString)
                    }
                    resultDecodedBuilder.repeatedString = jsonArrayRepeatedString
                }
                if let jsonValueRepeatedBytes = jsonMap["repeatedBytes"] as? Array<String> {
                    var jsonArrayRepeatedBytes:Array<Data> = []
                    for oneValueRepeatedBytes in jsonValueRepeatedBytes {
                        jsonArrayRepeatedBytes.append(Data(base64Encoded:oneValueRepeatedBytes, options: Data.Base64DecodingOptions(rawValue:0))!)
                    }
                    resultDecodedBuilder.repeatedBytes = jsonArrayRepeatedBytes
                }
                if let jsonValueRepeatedNestedMessage = jsonMap["repeatedNestedMessage"] as? Array<Dictionary<String,Any>> {
                    var jsonArrayRepeatedNestedMessage:Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage> = []
                    for oneValueRepeatedNestedMessage in jsonValueRepeatedNestedMessage {
                        let messageFromStringRepeatedNestedMessage = try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder.decodeToBuilder(jsonMap:oneValueRepeatedNestedMessage).build()

                        jsonArrayRepeatedNestedMessage.append(messageFromStringRepeatedNestedMessage)
                    }
                    resultDecodedBuilder.repeatedNestedMessage = jsonArrayRepeatedNestedMessage
                }
                if let jsonValueRepeatedForeignMessage = jsonMap["repeatedForeignMessage"] as? Array<Dictionary<String,Any>> {
                    var jsonArrayRepeatedForeignMessage:Array<Proto2NofieldpresenceUnittest.ForeignMessage> = []
                    for oneValueRepeatedForeignMessage in jsonValueRepeatedForeignMessage {
                        let messageFromStringRepeatedForeignMessage = try Proto2NofieldpresenceUnittest.ForeignMessage.Builder.decodeToBuilder(jsonMap:oneValueRepeatedForeignMessage).build()

                        jsonArrayRepeatedForeignMessage.append(messageFromStringRepeatedForeignMessage)
                    }
                    resultDecodedBuilder.repeatedForeignMessage = jsonArrayRepeatedForeignMessage
                }
                if let jsonValueRepeatedProto2Message = jsonMap["repeatedProto2Message"] as? Array<Dictionary<String,Any>> {
                    var jsonArrayRepeatedProto2Message:Array<ProtobufUnittest.TestAllTypes> = []
                    for oneValueRepeatedProto2Message in jsonValueRepeatedProto2Message {
                        let messageFromStringRepeatedProto2Message = try ProtobufUnittest.TestAllTypes.Builder.decodeToBuilder(jsonMap:oneValueRepeatedProto2Message).build()

                        jsonArrayRepeatedProto2Message.append(messageFromStringRepeatedProto2Message)
                    }
                    resultDecodedBuilder.repeatedProto2Message = jsonArrayRepeatedProto2Message
                }
                if let jsonValueRepeatedNestedEnum = jsonMap["repeatedNestedEnum"] as? Array<String> {
                    var jsonArrayRepeatedNestedEnum:Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum> = []
                    for oneValueRepeatedNestedEnum in jsonValueRepeatedNestedEnum {
                        let enumFromStringRepeatedNestedEnum = try Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum.fromString(oneValueRepeatedNestedEnum)
                        jsonArrayRepeatedNestedEnum.append(enumFromStringRepeatedNestedEnum)
                    }
                    resultDecodedBuilder.repeatedNestedEnum = jsonArrayRepeatedNestedEnum
                }
                if let jsonValueRepeatedForeignEnum = jsonMap["repeatedForeignEnum"] as? Array<String> {
                    var jsonArrayRepeatedForeignEnum:Array<Proto2NofieldpresenceUnittest.ForeignEnum> = []
                    for oneValueRepeatedForeignEnum in jsonValueRepeatedForeignEnum {
                        let enumFromStringRepeatedForeignEnum = try Proto2NofieldpresenceUnittest.ForeignEnum.fromString(oneValueRepeatedForeignEnum)
                        jsonArrayRepeatedForeignEnum.append(enumFromStringRepeatedForeignEnum)
                    }
                    resultDecodedBuilder.repeatedForeignEnum = jsonArrayRepeatedForeignEnum
                }
                if let jsonValueRepeatedStringPiece = jsonMap["repeatedStringPiece"] as? Array<String> {
                    var jsonArrayRepeatedStringPiece:Array<String> = []
                    for oneValueRepeatedStringPiece in jsonValueRepeatedStringPiece {
                        jsonArrayRepeatedStringPiece.append(oneValueRepeatedStringPiece)
                    }
                    resultDecodedBuilder.repeatedStringPiece = jsonArrayRepeatedStringPiece
                }
                if let jsonValueRepeatedCord = jsonMap["repeatedCord"] as? Array<String> {
                    var jsonArrayRepeatedCord:Array<String> = []
                    for oneValueRepeatedCord in jsonValueRepeatedCord {
                        jsonArrayRepeatedCord.append(oneValueRepeatedCord)
                    }
                    resultDecodedBuilder.repeatedCord = jsonArrayRepeatedCord
                }
                if let jsonValueRepeatedLazyMessage = jsonMap["repeatedLazyMessage"] as? Array<Dictionary<String,Any>> {
                    var jsonArrayRepeatedLazyMessage:Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage> = []
                    for oneValueRepeatedLazyMessage in jsonValueRepeatedLazyMessage {
                        let messageFromStringRepeatedLazyMessage = try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder.decodeToBuilder(jsonMap:oneValueRepeatedLazyMessage).build()

                        jsonArrayRepeatedLazyMessage.append(messageFromStringRepeatedLazyMessage)
                    }
                    resultDecodedBuilder.repeatedLazyMessage = jsonArrayRepeatedLazyMessage
                }
                if let jsonValueOneofUint32 = jsonMap["oneofUint32"] as? UInt {
                    resultDecodedBuilder.oneofUint32 = UInt32(jsonValueOneofUint32)
                } else if let jsonValueOneofUint32 = jsonMap["oneofUint32"] as? String {
                    resultDecodedBuilder.oneofUint32 = UInt32(jsonValueOneofUint32)!
                }
                if let jsonValueOneofNestedMessage = jsonMap["oneofNestedMessage"] as? Dictionary<String,Any> {
                    resultDecodedBuilder.oneofNestedMessage = try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder.decodeToBuilder(jsonMap:jsonValueOneofNestedMessage).build()

                }
                if let jsonValueOneofString = jsonMap["oneofString"] as? String {
                    resultDecodedBuilder.oneofString = jsonValueOneofString
                }
                if let jsonValueOneofEnum = jsonMap["oneofEnum"] as? String {
                    resultDecodedBuilder.oneofEnum = try Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum.fromString(jsonValueOneofEnum)
                }
                return resultDecodedBuilder
            }
            override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.Builder {
                let jsonData = try JSONSerialization.jsonObject(with:data, options: options)
                guard let jsDataCast = jsonData as? Dictionary<String,Any> else {
                  throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data")
                }
                return try Proto2NofieldpresenceUnittest.TestAllTypes.Builder.decodeToBuilder(jsonMap:jsDataCast)
            }
        }

    }

    final public class TestProto2Required : GeneratedMessage {
        public typealias BuilderType = Proto2NofieldpresenceUnittest.TestProto2Required.Builder

        public static func == (lhs: Proto2NofieldpresenceUnittest.TestProto2Required, rhs: Proto2NofieldpresenceUnittest.TestProto2Required) -> Bool {
            if lhs === rhs {
                return true
            }
            var fieldCheck:Bool = (lhs.hashValue == rhs.hashValue)
            fieldCheck = fieldCheck && (lhs.hasProto2 == rhs.hasProto2) && (!lhs.hasProto2 || lhs.proto2 == rhs.proto2)
            fieldCheck = (fieldCheck && (lhs.unknownFields == rhs.unknownFields))
            return fieldCheck
        }

        public fileprivate(set) var proto2:ProtobufUnittest.TestRequired!
        public fileprivate(set) var hasProto2:Bool = false
        required public init() {
            super.init()
        }
        override public func isInitialized() throws {
            if hasProto2 {
                try proto2.isInitialized()
            }
        }
        override public func writeTo(codedOutputStream: CodedOutputStream) throws {
            if hasProto2 {
                try codedOutputStream.writeMessage(fieldNumber: 1, value:proto2)
            }
            try unknownFields.writeTo(codedOutputStream: codedOutputStream)
        }
        override public func serializedSize() -> Int32 {
            var serialize_size:Int32 = memoizedSerializedSize
            if serialize_size != -1 {
             return serialize_size
            }

            serialize_size = 0
            if hasProto2 {
                if let varSizeproto2 = proto2?.computeMessageSize(fieldNumber: 1) {
                    serialize_size += varSizeproto2
                }
            }
            serialize_size += unknownFields.serializedSize()
            memoizedSerializedSize = serialize_size
            return serialize_size
        }
        public class func getBuilder() -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder {
            return Proto2NofieldpresenceUnittest.TestProto2Required.classBuilder() as! Proto2NofieldpresenceUnittest.TestProto2Required.Builder
        }
        public func getBuilder() -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder {
            return classBuilder() as! Proto2NofieldpresenceUnittest.TestProto2Required.Builder
        }
        override public class func classBuilder() -> ProtocolBuffersMessageBuilder {
            return Proto2NofieldpresenceUnittest.TestProto2Required.Builder()
        }
        override public func classBuilder() -> ProtocolBuffersMessageBuilder {
            return Proto2NofieldpresenceUnittest.TestProto2Required.Builder()
        }
        public func toBuilder() throws -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder {
            return try Proto2NofieldpresenceUnittest.TestProto2Required.builderWithPrototype(prototype:self)
        }
        public class func builderWithPrototype(prototype:Proto2NofieldpresenceUnittest.TestProto2Required) throws -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder {
            return try Proto2NofieldpresenceUnittest.TestProto2Required.Builder().mergeFrom(other:prototype)
        }
        override public func encode() throws -> Dictionary<String,Any> {
            try isInitialized()
            var jsonMap:Dictionary<String,Any> = Dictionary<String,Any>()
            if hasProto2 {
                jsonMap["proto2"] = try proto2.encode()
            }
            return jsonMap
        }
        override class public func decode(jsonMap:Dictionary<String,Any>) throws -> Proto2NofieldpresenceUnittest.TestProto2Required {
            return try Proto2NofieldpresenceUnittest.TestProto2Required.Builder.decodeToBuilder(jsonMap:jsonMap).build()
        }
        override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.TestProto2Required {
            return try Proto2NofieldpresenceUnittest.TestProto2Required.Builder.fromJSONToBuilder(data:data, options:options).build()
        }
        override public func getDescription(indent:String) throws -> String {
            var output = ""
            if hasProto2 {
                output += "\(indent) proto2 {\n"
                if let outDescProto2 = proto2 {
                    output += try outDescProto2.getDescription(indent: "\(indent)  ")
                }
                output += "\(indent) }\n"
            }
            output += unknownFields.getDescription(indent: indent)
            return output
        }
        override public var hashValue:Int {
            get {
                var hashCode:Int = 7
                if hasProto2 {
                    if let hashValueproto2 = proto2?.hashValue {
                        hashCode = (hashCode &* 31) &+ hashValueproto2
                    }
                }
                hashCode = (hashCode &* 31) &+  unknownFields.hashValue
                return hashCode
            }
        }


        //Meta information declaration start

        override public class func className() -> String {
            return "Proto2NofieldpresenceUnittest.TestProto2Required"
        }
        override public func className() -> String {
            return "Proto2NofieldpresenceUnittest.TestProto2Required"
        }
        //Meta information declaration end

        final public class Builder : GeneratedMessageBuilder {
            fileprivate var builderResult:Proto2NofieldpresenceUnittest.TestProto2Required = Proto2NofieldpresenceUnittest.TestProto2Required()
            public func getMessage() -> Proto2NofieldpresenceUnittest.TestProto2Required {
                return builderResult
            }

            required override public init () {
                super.init()
            }
            public var proto2:ProtobufUnittest.TestRequired! {
                get {
                    if proto2Builder_ != nil {
                        builderResult.proto2 = proto2Builder_.getMessage()
                    }
                    return builderResult.proto2
                }
                set (value) {
                    builderResult.hasProto2 = value != nil
                    builderResult.proto2 = value
                }
            }
            public var hasProto2:Bool {
                get {
                    return builderResult.hasProto2
                }
            }
            fileprivate var proto2Builder_:ProtobufUnittest.TestRequired.Builder! {
                didSet {
                    builderResult.hasProto2 = true
                }
            }
            public func getProto2Builder() -> ProtobufUnittest.TestRequired.Builder {
                if proto2Builder_ == nil {
                    proto2Builder_ = ProtobufUnittest.TestRequired.Builder()
                    builderResult.proto2 = proto2Builder_.getMessage()
                    if proto2 != nil {
                        try! proto2Builder_.mergeFrom(other: proto2)
                    }
                }
                return proto2Builder_
            }
            @discardableResult
            public func setProto2(_ value:ProtobufUnittest.TestRequired!) -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder {
                self.proto2 = value
                return self
            }
            @discardableResult
            public func mergeProto2(value:ProtobufUnittest.TestRequired) throws -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder {
                if builderResult.hasProto2 {
                    builderResult.proto2 = try ProtobufUnittest.TestRequired.builderWithPrototype(prototype:builderResult.proto2).mergeFrom(other: value).buildPartial()
                } else {
                    builderResult.proto2 = value
                }
                builderResult.hasProto2 = true
                return self
            }
            @discardableResult
            public func clearProto2() -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder {
                proto2Builder_ = nil
                builderResult.hasProto2 = false
                builderResult.proto2 = nil
                return self
            }
            override public var internalGetResult:GeneratedMessage {
                get {
                    return builderResult
                }
            }
            @discardableResult
            override public func clear() -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder {
                builderResult = Proto2NofieldpresenceUnittest.TestProto2Required()
                return self
            }
            override public func clone() throws -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder {
                return try Proto2NofieldpresenceUnittest.TestProto2Required.builderWithPrototype(prototype:builderResult)
            }
            override public func build() throws -> Proto2NofieldpresenceUnittest.TestProto2Required {
                try checkInitialized()
                return buildPartial()
            }
            public func buildPartial() -> Proto2NofieldpresenceUnittest.TestProto2Required {
                let returnMe:Proto2NofieldpresenceUnittest.TestProto2Required = builderResult
                return returnMe
            }
            @discardableResult
            public func mergeFrom(other:Proto2NofieldpresenceUnittest.TestProto2Required) throws -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder {
                if other == Proto2NofieldpresenceUnittest.TestProto2Required() {
                    return self
                }
                if (other.hasProto2) {
                    try mergeProto2(value: other.proto2)
                }
                try merge(unknownField: other.unknownFields)
                return self
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream) throws -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder {
                return try mergeFrom(codedInputStream: codedInputStream, extensionRegistry:ExtensionRegistry())
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder {
                let unknownFieldsBuilder:UnknownFieldSet.Builder = try UnknownFieldSet.builderWithUnknownFields(copyFrom:self.unknownFields)
                while (true) {
                    let protobufTag = try codedInputStream.readTag()
                    switch protobufTag {
                    case 0: 
                        self.unknownFields = try unknownFieldsBuilder.build()
                        return self

                    case 10:
                        let subBuilder:ProtobufUnittest.TestRequired.Builder = ProtobufUnittest.TestRequired.Builder()
                        if hasProto2 {
                            try subBuilder.mergeFrom(other: proto2)
                        }
                        try codedInputStream.readMessage(builder: subBuilder, extensionRegistry:extensionRegistry)
                        proto2 = subBuilder.buildPartial()

                    default:
                        if (!(try parse(codedInputStream:codedInputStream, unknownFields:unknownFieldsBuilder, extensionRegistry:extensionRegistry, tag:protobufTag))) {
                            unknownFields = try unknownFieldsBuilder.build()
                            return self
                        }
                    }
                }
            }
            class override public func decodeToBuilder(jsonMap:Dictionary<String,Any>) throws -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder {
                let resultDecodedBuilder = Proto2NofieldpresenceUnittest.TestProto2Required.Builder()
                if let jsonValueProto2 = jsonMap["proto2"] as? Dictionary<String,Any> {
                    resultDecodedBuilder.proto2 = try ProtobufUnittest.TestRequired.Builder.decodeToBuilder(jsonMap:jsonValueProto2).build()

                }
                return resultDecodedBuilder
            }
            override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.TestProto2Required.Builder {
                let jsonData = try JSONSerialization.jsonObject(with:data, options: options)
                guard let jsDataCast = jsonData as? Dictionary<String,Any> else {
                  throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data")
                }
                return try Proto2NofieldpresenceUnittest.TestProto2Required.Builder.decodeToBuilder(jsonMap:jsDataCast)
            }
        }

    }

    /// Define these after TestAllTypes to make sure the compiler can handle
    /// that.
    final public class ForeignMessage : GeneratedMessage {
        public typealias BuilderType = Proto2NofieldpresenceUnittest.ForeignMessage.Builder

        public static func == (lhs: Proto2NofieldpresenceUnittest.ForeignMessage, rhs: Proto2NofieldpresenceUnittest.ForeignMessage) -> Bool {
            if lhs === rhs {
                return true
            }
            var fieldCheck:Bool = (lhs.hashValue == rhs.hashValue)
            fieldCheck = fieldCheck && (lhs.hasC == rhs.hasC) && (!lhs.hasC || lhs.c == rhs.c)
            fieldCheck = (fieldCheck && (lhs.unknownFields == rhs.unknownFields))
            return fieldCheck
        }

        public fileprivate(set) var c:Int32! = nil
        public fileprivate(set) var hasC:Bool = false

        required public init() {
            super.init()
        }
        override public func isInitialized() throws {
        }
        override public func writeTo(codedOutputStream: CodedOutputStream) throws {
            if hasC {
                try codedOutputStream.writeInt32(fieldNumber: 1, value:c)
            }
            try unknownFields.writeTo(codedOutputStream: codedOutputStream)
        }
        override public func serializedSize() -> Int32 {
            var serialize_size:Int32 = memoizedSerializedSize
            if serialize_size != -1 {
             return serialize_size
            }

            serialize_size = 0
            if hasC {
                serialize_size += c.computeInt32Size(fieldNumber: 1)
            }
            serialize_size += unknownFields.serializedSize()
            memoizedSerializedSize = serialize_size
            return serialize_size
        }
        public class func getBuilder() -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder {
            return Proto2NofieldpresenceUnittest.ForeignMessage.classBuilder() as! Proto2NofieldpresenceUnittest.ForeignMessage.Builder
        }
        public func getBuilder() -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder {
            return classBuilder() as! Proto2NofieldpresenceUnittest.ForeignMessage.Builder
        }
        override public class func classBuilder() -> ProtocolBuffersMessageBuilder {
            return Proto2NofieldpresenceUnittest.ForeignMessage.Builder()
        }
        override public func classBuilder() -> ProtocolBuffersMessageBuilder {
            return Proto2NofieldpresenceUnittest.ForeignMessage.Builder()
        }
        public func toBuilder() throws -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder {
            return try Proto2NofieldpresenceUnittest.ForeignMessage.builderWithPrototype(prototype:self)
        }
        public class func builderWithPrototype(prototype:Proto2NofieldpresenceUnittest.ForeignMessage) throws -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder {
            return try Proto2NofieldpresenceUnittest.ForeignMessage.Builder().mergeFrom(other:prototype)
        }
        override public func encode() throws -> Dictionary<String,Any> {
            try isInitialized()
            var jsonMap:Dictionary<String,Any> = Dictionary<String,Any>()
            if hasC {
                jsonMap["c"] = Int(c)
            }
            return jsonMap
        }
        override class public func decode(jsonMap:Dictionary<String,Any>) throws -> Proto2NofieldpresenceUnittest.ForeignMessage {
            return try Proto2NofieldpresenceUnittest.ForeignMessage.Builder.decodeToBuilder(jsonMap:jsonMap).build()
        }
        override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.ForeignMessage {
            return try Proto2NofieldpresenceUnittest.ForeignMessage.Builder.fromJSONToBuilder(data:data, options:options).build()
        }
        override public func getDescription(indent:String) throws -> String {
            var output = ""
            if hasC {
                output += "\(indent) c: \(String(describing: c)) \n"
            }
            output += unknownFields.getDescription(indent: indent)
            return output
        }
        override public var hashValue:Int {
            get {
                var hashCode:Int = 7
                if hasC {
                    hashCode = (hashCode &* 31) &+ c.hashValue
                }
                hashCode = (hashCode &* 31) &+  unknownFields.hashValue
                return hashCode
            }
        }


        //Meta information declaration start

        override public class func className() -> String {
            return "Proto2NofieldpresenceUnittest.ForeignMessage"
        }
        override public func className() -> String {
            return "Proto2NofieldpresenceUnittest.ForeignMessage"
        }
        //Meta information declaration end

        final public class Builder : GeneratedMessageBuilder {
            fileprivate var builderResult:Proto2NofieldpresenceUnittest.ForeignMessage = Proto2NofieldpresenceUnittest.ForeignMessage()
            public func getMessage() -> Proto2NofieldpresenceUnittest.ForeignMessage {
                return builderResult
            }

            required override public init () {
                super.init()
            }
            public var c:Int32 {
                get {
                    return builderResult.c
                }
                set (value) {
                    builderResult.hasC = true
                    builderResult.c = value
                }
            }
            public var hasC:Bool {
                get {
                    return builderResult.hasC
                }
            }
            @discardableResult
            public func setC(_ value:Int32) -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder {
                self.c = value
                return self
            }
            @discardableResult
            public func clearC() -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder{
                builderResult.hasC = false
                builderResult.c = nil
                return self
            }
            override public var internalGetResult:GeneratedMessage {
                get {
                    return builderResult
                }
            }
            @discardableResult
            override public func clear() -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder {
                builderResult = Proto2NofieldpresenceUnittest.ForeignMessage()
                return self
            }
            override public func clone() throws -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder {
                return try Proto2NofieldpresenceUnittest.ForeignMessage.builderWithPrototype(prototype:builderResult)
            }
            override public func build() throws -> Proto2NofieldpresenceUnittest.ForeignMessage {
                try checkInitialized()
                return buildPartial()
            }
            public func buildPartial() -> Proto2NofieldpresenceUnittest.ForeignMessage {
                let returnMe:Proto2NofieldpresenceUnittest.ForeignMessage = builderResult
                return returnMe
            }
            @discardableResult
            public func mergeFrom(other:Proto2NofieldpresenceUnittest.ForeignMessage) throws -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder {
                if other == Proto2NofieldpresenceUnittest.ForeignMessage() {
                    return self
                }
                if other.hasC {
                    c = other.c
                }
                try merge(unknownField: other.unknownFields)
                return self
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream) throws -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder {
                return try mergeFrom(codedInputStream: codedInputStream, extensionRegistry:ExtensionRegistry())
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder {
                let unknownFieldsBuilder:UnknownFieldSet.Builder = try UnknownFieldSet.builderWithUnknownFields(copyFrom:self.unknownFields)
                while (true) {
                    let protobufTag = try codedInputStream.readTag()
                    switch protobufTag {
                    case 0: 
                        self.unknownFields = try unknownFieldsBuilder.build()
                        return self

                    case 8:
                        c = try codedInputStream.readInt32()

                    default:
                        if (!(try parse(codedInputStream:codedInputStream, unknownFields:unknownFieldsBuilder, extensionRegistry:extensionRegistry, tag:protobufTag))) {
                            unknownFields = try unknownFieldsBuilder.build()
                            return self
                        }
                    }
                }
            }
            class override public func decodeToBuilder(jsonMap:Dictionary<String,Any>) throws -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder {
                let resultDecodedBuilder = Proto2NofieldpresenceUnittest.ForeignMessage.Builder()
                if let jsonValueC = jsonMap["c"] as? Int {
                    resultDecodedBuilder.c = Int32(jsonValueC)
                } else if let jsonValueC = jsonMap["c"] as? String {
                    resultDecodedBuilder.c = Int32(jsonValueC)!
                }
                return resultDecodedBuilder
            }
            override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> Proto2NofieldpresenceUnittest.ForeignMessage.Builder {
                let jsonData = try JSONSerialization.jsonObject(with:data, options: options)
                guard let jsDataCast = jsonData as? Dictionary<String,Any> else {
                  throw ProtocolBuffersError.invalidProtocolBuffer("Invalid JSON data")
                }
                return try Proto2NofieldpresenceUnittest.ForeignMessage.Builder.decodeToBuilder(jsonMap:jsDataCast)
            }
        }

    }

}
extension Proto2NofieldpresenceUnittest.TestAllTypes: GeneratedMessageProtocol {
    public class func parseArrayDelimitedFrom(inputStream: InputStream) throws -> Array<Proto2NofieldpresenceUnittest.TestAllTypes> {
        var mergedArray = Array<Proto2NofieldpresenceUnittest.TestAllTypes>()
        while let value = try parseDelimitedFrom(inputStream: inputStream) {
          mergedArray.append(value)
        }
        return mergedArray
    }
    public class func parseDelimitedFrom(inputStream: InputStream) throws -> Proto2NofieldpresenceUnittest.TestAllTypes? {
        return try Proto2NofieldpresenceUnittest.TestAllTypes.Builder().mergeDelimitedFrom(inputStream: inputStream)?.build()
    }
    public class func parseFrom(data: Data) throws -> Proto2NofieldpresenceUnittest.TestAllTypes {
        return try Proto2NofieldpresenceUnittest.TestAllTypes.Builder().mergeFrom(data: data, extensionRegistry:Proto2NofieldpresenceUnittest.UnittestNoFieldPresenceRoot.default.extensionRegistry).build()
    }
    public class func parseFrom(data: Data, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.TestAllTypes {
        return try Proto2NofieldpresenceUnittest.TestAllTypes.Builder().mergeFrom(data: data, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(inputStream: InputStream) throws -> Proto2NofieldpresenceUnittest.TestAllTypes {
        return try Proto2NofieldpresenceUnittest.TestAllTypes.Builder().mergeFrom(inputStream: inputStream).build()
    }
    public class func parseFrom(inputStream: InputStream, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.TestAllTypes {
        return try Proto2NofieldpresenceUnittest.TestAllTypes.Builder().mergeFrom(inputStream: inputStream, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream) throws -> Proto2NofieldpresenceUnittest.TestAllTypes {
        return try Proto2NofieldpresenceUnittest.TestAllTypes.Builder().mergeFrom(codedInputStream: codedInputStream).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.TestAllTypes {
        return try Proto2NofieldpresenceUnittest.TestAllTypes.Builder().mergeFrom(codedInputStream: codedInputStream, extensionRegistry:extensionRegistry).build()
    }
    public subscript(key: String) -> Any? {
        switch key {
        case "optionalInt32": return self.optionalInt32
        case "optionalInt64": return self.optionalInt64
        case "optionalUint32": return self.optionalUint32
        case "optionalUint64": return self.optionalUint64
        case "optionalSint32": return self.optionalSint32
        case "optionalSint64": return self.optionalSint64
        case "optionalFixed32": return self.optionalFixed32
        case "optionalFixed64": return self.optionalFixed64
        case "optionalSfixed32": return self.optionalSfixed32
        case "optionalSfixed64": return self.optionalSfixed64
        case "optionalFloat": return self.optionalFloat
        case "optionalDouble": return self.optionalDouble
        case "optionalBool": return self.optionalBool
        case "optionalString": return self.optionalString
        case "optionalBytes": return self.optionalBytes
        case "optionalNestedMessage": return self.optionalNestedMessage
        case "optionalForeignMessage": return self.optionalForeignMessage
        case "optionalProto2Message": return self.optionalProto2Message
        case "optionalNestedEnum": return self.optionalNestedEnum
        case "optionalForeignEnum": return self.optionalForeignEnum
        case "optionalStringPiece": return self.optionalStringPiece
        case "optionalCord": return self.optionalCord
        case "optionalLazyMessage": return self.optionalLazyMessage
        case "repeatedInt32": return self.repeatedInt32
        case "repeatedInt64": return self.repeatedInt64
        case "repeatedUint32": return self.repeatedUint32
        case "repeatedUint64": return self.repeatedUint64
        case "repeatedSint32": return self.repeatedSint32
        case "repeatedSint64": return self.repeatedSint64
        case "repeatedFixed32": return self.repeatedFixed32
        case "repeatedFixed64": return self.repeatedFixed64
        case "repeatedSfixed32": return self.repeatedSfixed32
        case "repeatedSfixed64": return self.repeatedSfixed64
        case "repeatedFloat": return self.repeatedFloat
        case "repeatedDouble": return self.repeatedDouble
        case "repeatedBool": return self.repeatedBool
        case "repeatedString": return self.repeatedString
        case "repeatedBytes": return self.repeatedBytes
        case "repeatedNestedMessage": return self.repeatedNestedMessage
        case "repeatedForeignMessage": return self.repeatedForeignMessage
        case "repeatedProto2Message": return self.repeatedProto2Message
        case "repeatedNestedEnum": return self.repeatedNestedEnum
        case "repeatedForeignEnum": return self.repeatedForeignEnum
        case "repeatedStringPiece": return self.repeatedStringPiece
        case "repeatedCord": return self.repeatedCord
        case "repeatedLazyMessage": return self.repeatedLazyMessage
        case "oneofUint32": return self.oneofUint32
        case "oneofNestedMessage": return self.oneofNestedMessage
        case "oneofString": return self.oneofString
        case "oneofEnum": return self.oneofEnum
        default: return nil
        }
    }
}
extension Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage: GeneratedMessageProtocol {
    public class func parseArrayDelimitedFrom(inputStream: InputStream) throws -> Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage> {
        var mergedArray = Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage>()
        while let value = try parseDelimitedFrom(inputStream: inputStream) {
          mergedArray.append(value)
        }
        return mergedArray
    }
    public class func parseDelimitedFrom(inputStream: InputStream) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage? {
        return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder().mergeDelimitedFrom(inputStream: inputStream)?.build()
    }
    public class func parseFrom(data: Data) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage {
        return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder().mergeFrom(data: data, extensionRegistry:Proto2NofieldpresenceUnittest.UnittestNoFieldPresenceRoot.default.extensionRegistry).build()
    }
    public class func parseFrom(data: Data, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage {
        return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder().mergeFrom(data: data, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(inputStream: InputStream) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage {
        return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder().mergeFrom(inputStream: inputStream).build()
    }
    public class func parseFrom(inputStream: InputStream, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage {
        return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder().mergeFrom(inputStream: inputStream, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage {
        return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder().mergeFrom(codedInputStream: codedInputStream).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage {
        return try Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder().mergeFrom(codedInputStream: codedInputStream, extensionRegistry:extensionRegistry).build()
    }
    public subscript(key: String) -> Any? {
        switch key {
        case "bb": return self.bb
        default: return nil
        }
    }
}
extension Proto2NofieldpresenceUnittest.TestAllTypes.Builder: GeneratedMessageBuilderProtocol {
    public typealias GeneratedMessageType = Proto2NofieldpresenceUnittest.TestAllTypes
    public subscript(key: String) -> Any? {
        get { 
            switch key {
            case "optionalInt32": return self.optionalInt32
            case "optionalInt64": return self.optionalInt64
            case "optionalUint32": return self.optionalUint32
            case "optionalUint64": return self.optionalUint64
            case "optionalSint32": return self.optionalSint32
            case "optionalSint64": return self.optionalSint64
            case "optionalFixed32": return self.optionalFixed32
            case "optionalFixed64": return self.optionalFixed64
            case "optionalSfixed32": return self.optionalSfixed32
            case "optionalSfixed64": return self.optionalSfixed64
            case "optionalFloat": return self.optionalFloat
            case "optionalDouble": return self.optionalDouble
            case "optionalBool": return self.optionalBool
            case "optionalString": return self.optionalString
            case "optionalBytes": return self.optionalBytes
            case "optionalNestedMessage": return self.optionalNestedMessage
            case "optionalForeignMessage": return self.optionalForeignMessage
            case "optionalProto2Message": return self.optionalProto2Message
            case "optionalNestedEnum": return self.optionalNestedEnum
            case "optionalForeignEnum": return self.optionalForeignEnum
            case "optionalStringPiece": return self.optionalStringPiece
            case "optionalCord": return self.optionalCord
            case "optionalLazyMessage": return self.optionalLazyMessage
            case "repeatedInt32": return self.repeatedInt32
            case "repeatedInt64": return self.repeatedInt64
            case "repeatedUint32": return self.repeatedUint32
            case "repeatedUint64": return self.repeatedUint64
            case "repeatedSint32": return self.repeatedSint32
            case "repeatedSint64": return self.repeatedSint64
            case "repeatedFixed32": return self.repeatedFixed32
            case "repeatedFixed64": return self.repeatedFixed64
            case "repeatedSfixed32": return self.repeatedSfixed32
            case "repeatedSfixed64": return self.repeatedSfixed64
            case "repeatedFloat": return self.repeatedFloat
            case "repeatedDouble": return self.repeatedDouble
            case "repeatedBool": return self.repeatedBool
            case "repeatedString": return self.repeatedString
            case "repeatedBytes": return self.repeatedBytes
            case "repeatedNestedMessage": return self.repeatedNestedMessage
            case "repeatedForeignMessage": return self.repeatedForeignMessage
            case "repeatedProto2Message": return self.repeatedProto2Message
            case "repeatedNestedEnum": return self.repeatedNestedEnum
            case "repeatedForeignEnum": return self.repeatedForeignEnum
            case "repeatedStringPiece": return self.repeatedStringPiece
            case "repeatedCord": return self.repeatedCord
            case "repeatedLazyMessage": return self.repeatedLazyMessage
            case "oneofUint32": return self.oneofUint32
            case "oneofNestedMessage": return self.oneofNestedMessage
            case "oneofString": return self.oneofString
            case "oneofEnum": return self.oneofEnum
            default: return nil
            }
        }
        set (newSubscriptValue) { 
            switch key {
            case "optionalInt32":
                guard let newSubscriptValue = newSubscriptValue as? Int32 else {
                    return
                }
                self.optionalInt32 = newSubscriptValue
            case "optionalInt64":
                guard let newSubscriptValue = newSubscriptValue as? Int64 else {
                    return
                }
                self.optionalInt64 = newSubscriptValue
            case "optionalUint32":
                guard let newSubscriptValue = newSubscriptValue as? UInt32 else {
                    return
                }
                self.optionalUint32 = newSubscriptValue
            case "optionalUint64":
                guard let newSubscriptValue = newSubscriptValue as? UInt64 else {
                    return
                }
                self.optionalUint64 = newSubscriptValue
            case "optionalSint32":
                guard let newSubscriptValue = newSubscriptValue as? Int32 else {
                    return
                }
                self.optionalSint32 = newSubscriptValue
            case "optionalSint64":
                guard let newSubscriptValue = newSubscriptValue as? Int64 else {
                    return
                }
                self.optionalSint64 = newSubscriptValue
            case "optionalFixed32":
                guard let newSubscriptValue = newSubscriptValue as? UInt32 else {
                    return
                }
                self.optionalFixed32 = newSubscriptValue
            case "optionalFixed64":
                guard let newSubscriptValue = newSubscriptValue as? UInt64 else {
                    return
                }
                self.optionalFixed64 = newSubscriptValue
            case "optionalSfixed32":
                guard let newSubscriptValue = newSubscriptValue as? Int32 else {
                    return
                }
                self.optionalSfixed32 = newSubscriptValue
            case "optionalSfixed64":
                guard let newSubscriptValue = newSubscriptValue as? Int64 else {
                    return
                }
                self.optionalSfixed64 = newSubscriptValue
            case "optionalFloat":
                guard let newSubscriptValue = newSubscriptValue as? Float else {
                    return
                }
                self.optionalFloat = newSubscriptValue
            case "optionalDouble":
                guard let newSubscriptValue = newSubscriptValue as? Double else {
                    return
                }
                self.optionalDouble = newSubscriptValue
            case "optionalBool":
                guard let newSubscriptValue = newSubscriptValue as? Bool else {
                    return
                }
                self.optionalBool = newSubscriptValue
            case "optionalString":
                guard let newSubscriptValue = newSubscriptValue as? String else {
                    return
                }
                self.optionalString = newSubscriptValue
            case "optionalBytes":
                guard let newSubscriptValue = newSubscriptValue as? Data else {
                    return
                }
                self.optionalBytes = newSubscriptValue
            case "optionalNestedMessage":
                guard let newSubscriptValue = newSubscriptValue as? Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage else {
                    return
                }
                self.optionalNestedMessage = newSubscriptValue
            case "optionalForeignMessage":
                guard let newSubscriptValue = newSubscriptValue as? Proto2NofieldpresenceUnittest.ForeignMessage else {
                    return
                }
                self.optionalForeignMessage = newSubscriptValue
            case "optionalProto2Message":
                guard let newSubscriptValue = newSubscriptValue as? ProtobufUnittest.TestAllTypes else {
                    return
                }
                self.optionalProto2Message = newSubscriptValue
            case "optionalNestedEnum":
                guard let newSubscriptValue = newSubscriptValue as? Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum else {
                    return
                }
                self.optionalNestedEnum = newSubscriptValue
            case "optionalForeignEnum":
                guard let newSubscriptValue = newSubscriptValue as? Proto2NofieldpresenceUnittest.ForeignEnum else {
                    return
                }
                self.optionalForeignEnum = newSubscriptValue
            case "optionalStringPiece":
                guard let newSubscriptValue = newSubscriptValue as? String else {
                    return
                }
                self.optionalStringPiece = newSubscriptValue
            case "optionalCord":
                guard let newSubscriptValue = newSubscriptValue as? String else {
                    return
                }
                self.optionalCord = newSubscriptValue
            case "optionalLazyMessage":
                guard let newSubscriptValue = newSubscriptValue as? Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage else {
                    return
                }
                self.optionalLazyMessage = newSubscriptValue
            case "repeatedInt32":
                guard let newSubscriptValue = newSubscriptValue as? Array<Int32> else {
                    return
                }
                self.repeatedInt32 = newSubscriptValue
            case "repeatedInt64":
                guard let newSubscriptValue = newSubscriptValue as? Array<Int64> else {
                    return
                }
                self.repeatedInt64 = newSubscriptValue
            case "repeatedUint32":
                guard let newSubscriptValue = newSubscriptValue as? Array<UInt32> else {
                    return
                }
                self.repeatedUint32 = newSubscriptValue
            case "repeatedUint64":
                guard let newSubscriptValue = newSubscriptValue as? Array<UInt64> else {
                    return
                }
                self.repeatedUint64 = newSubscriptValue
            case "repeatedSint32":
                guard let newSubscriptValue = newSubscriptValue as? Array<Int32> else {
                    return
                }
                self.repeatedSint32 = newSubscriptValue
            case "repeatedSint64":
                guard let newSubscriptValue = newSubscriptValue as? Array<Int64> else {
                    return
                }
                self.repeatedSint64 = newSubscriptValue
            case "repeatedFixed32":
                guard let newSubscriptValue = newSubscriptValue as? Array<UInt32> else {
                    return
                }
                self.repeatedFixed32 = newSubscriptValue
            case "repeatedFixed64":
                guard let newSubscriptValue = newSubscriptValue as? Array<UInt64> else {
                    return
                }
                self.repeatedFixed64 = newSubscriptValue
            case "repeatedSfixed32":
                guard let newSubscriptValue = newSubscriptValue as? Array<Int32> else {
                    return
                }
                self.repeatedSfixed32 = newSubscriptValue
            case "repeatedSfixed64":
                guard let newSubscriptValue = newSubscriptValue as? Array<Int64> else {
                    return
                }
                self.repeatedSfixed64 = newSubscriptValue
            case "repeatedFloat":
                guard let newSubscriptValue = newSubscriptValue as? Array<Float> else {
                    return
                }
                self.repeatedFloat = newSubscriptValue
            case "repeatedDouble":
                guard let newSubscriptValue = newSubscriptValue as? Array<Double> else {
                    return
                }
                self.repeatedDouble = newSubscriptValue
            case "repeatedBool":
                guard let newSubscriptValue = newSubscriptValue as? Array<Bool> else {
                    return
                }
                self.repeatedBool = newSubscriptValue
            case "repeatedString":
                guard let newSubscriptValue = newSubscriptValue as? Array<String> else {
                    return
                }
                self.repeatedString = newSubscriptValue
            case "repeatedBytes":
                guard let newSubscriptValue = newSubscriptValue as? Array<Data> else {
                    return
                }
                self.repeatedBytes = newSubscriptValue
            case "repeatedNestedMessage":
                guard let newSubscriptValue = newSubscriptValue as? Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage> else {
                    return
                }
                self.repeatedNestedMessage = newSubscriptValue
            case "repeatedForeignMessage":
                guard let newSubscriptValue = newSubscriptValue as? Array<Proto2NofieldpresenceUnittest.ForeignMessage> else {
                    return
                }
                self.repeatedForeignMessage = newSubscriptValue
            case "repeatedProto2Message":
                guard let newSubscriptValue = newSubscriptValue as? Array<ProtobufUnittest.TestAllTypes> else {
                    return
                }
                self.repeatedProto2Message = newSubscriptValue
            case "repeatedNestedEnum":
                guard let newSubscriptValue = newSubscriptValue as? Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum> else {
                    return
                }
                self.repeatedNestedEnum = newSubscriptValue
            case "repeatedForeignEnum":
                guard let newSubscriptValue = newSubscriptValue as? Array<Proto2NofieldpresenceUnittest.ForeignEnum> else {
                    return
                }
                self.repeatedForeignEnum = newSubscriptValue
            case "repeatedStringPiece":
                guard let newSubscriptValue = newSubscriptValue as? Array<String> else {
                    return
                }
                self.repeatedStringPiece = newSubscriptValue
            case "repeatedCord":
                guard let newSubscriptValue = newSubscriptValue as? Array<String> else {
                    return
                }
                self.repeatedCord = newSubscriptValue
            case "repeatedLazyMessage":
                guard let newSubscriptValue = newSubscriptValue as? Array<Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage> else {
                    return
                }
                self.repeatedLazyMessage = newSubscriptValue
            case "oneofUint32":
                guard let newSubscriptValue = newSubscriptValue as? UInt32 else {
                    return
                }
                self.oneofUint32 = newSubscriptValue
            case "oneofNestedMessage":
                guard let newSubscriptValue = newSubscriptValue as? Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage else {
                    return
                }
                self.oneofNestedMessage = newSubscriptValue
            case "oneofString":
                guard let newSubscriptValue = newSubscriptValue as? String else {
                    return
                }
                self.oneofString = newSubscriptValue
            case "oneofEnum":
                guard let newSubscriptValue = newSubscriptValue as? Proto2NofieldpresenceUnittest.TestAllTypes.NestedEnum else {
                    return
                }
                self.oneofEnum = newSubscriptValue
            default: return
            }
        }
    }
}
extension Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage.Builder: GeneratedMessageBuilderProtocol {
    public typealias GeneratedMessageType = Proto2NofieldpresenceUnittest.TestAllTypes.NestedMessage
    public subscript(key: String) -> Any? {
        get { 
            switch key {
            case "bb": return self.bb
            default: return nil
            }
        }
        set (newSubscriptValue) { 
            switch key {
            case "bb":
                guard let newSubscriptValue = newSubscriptValue as? Int32 else {
                    return
                }
                self.bb = newSubscriptValue
            default: return
            }
        }
    }
}
extension Proto2NofieldpresenceUnittest.TestProto2Required: GeneratedMessageProtocol {
    public class func parseArrayDelimitedFrom(inputStream: InputStream) throws -> Array<Proto2NofieldpresenceUnittest.TestProto2Required> {
        var mergedArray = Array<Proto2NofieldpresenceUnittest.TestProto2Required>()
        while let value = try parseDelimitedFrom(inputStream: inputStream) {
          mergedArray.append(value)
        }
        return mergedArray
    }
    public class func parseDelimitedFrom(inputStream: InputStream) throws -> Proto2NofieldpresenceUnittest.TestProto2Required? {
        return try Proto2NofieldpresenceUnittest.TestProto2Required.Builder().mergeDelimitedFrom(inputStream: inputStream)?.build()
    }
    public class func parseFrom(data: Data) throws -> Proto2NofieldpresenceUnittest.TestProto2Required {
        return try Proto2NofieldpresenceUnittest.TestProto2Required.Builder().mergeFrom(data: data, extensionRegistry:Proto2NofieldpresenceUnittest.UnittestNoFieldPresenceRoot.default.extensionRegistry).build()
    }
    public class func parseFrom(data: Data, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.TestProto2Required {
        return try Proto2NofieldpresenceUnittest.TestProto2Required.Builder().mergeFrom(data: data, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(inputStream: InputStream) throws -> Proto2NofieldpresenceUnittest.TestProto2Required {
        return try Proto2NofieldpresenceUnittest.TestProto2Required.Builder().mergeFrom(inputStream: inputStream).build()
    }
    public class func parseFrom(inputStream: InputStream, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.TestProto2Required {
        return try Proto2NofieldpresenceUnittest.TestProto2Required.Builder().mergeFrom(inputStream: inputStream, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream) throws -> Proto2NofieldpresenceUnittest.TestProto2Required {
        return try Proto2NofieldpresenceUnittest.TestProto2Required.Builder().mergeFrom(codedInputStream: codedInputStream).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.TestProto2Required {
        return try Proto2NofieldpresenceUnittest.TestProto2Required.Builder().mergeFrom(codedInputStream: codedInputStream, extensionRegistry:extensionRegistry).build()
    }
    public subscript(key: String) -> Any? {
        switch key {
        case "proto2": return self.proto2
        default: return nil
        }
    }
}
extension Proto2NofieldpresenceUnittest.TestProto2Required.Builder: GeneratedMessageBuilderProtocol {
    public typealias GeneratedMessageType = Proto2NofieldpresenceUnittest.TestProto2Required
    public subscript(key: String) -> Any? {
        get { 
            switch key {
            case "proto2": return self.proto2
            default: return nil
            }
        }
        set (newSubscriptValue) { 
            switch key {
            case "proto2":
                guard let newSubscriptValue = newSubscriptValue as? ProtobufUnittest.TestRequired else {
                    return
                }
                self.proto2 = newSubscriptValue
            default: return
            }
        }
    }
}
extension Proto2NofieldpresenceUnittest.ForeignMessage: GeneratedMessageProtocol {
    public class func parseArrayDelimitedFrom(inputStream: InputStream) throws -> Array<Proto2NofieldpresenceUnittest.ForeignMessage> {
        var mergedArray = Array<Proto2NofieldpresenceUnittest.ForeignMessage>()
        while let value = try parseDelimitedFrom(inputStream: inputStream) {
          mergedArray.append(value)
        }
        return mergedArray
    }
    public class func parseDelimitedFrom(inputStream: InputStream) throws -> Proto2NofieldpresenceUnittest.ForeignMessage? {
        return try Proto2NofieldpresenceUnittest.ForeignMessage.Builder().mergeDelimitedFrom(inputStream: inputStream)?.build()
    }
    public class func parseFrom(data: Data) throws -> Proto2NofieldpresenceUnittest.ForeignMessage {
        return try Proto2NofieldpresenceUnittest.ForeignMessage.Builder().mergeFrom(data: data, extensionRegistry:Proto2NofieldpresenceUnittest.UnittestNoFieldPresenceRoot.default.extensionRegistry).build()
    }
    public class func parseFrom(data: Data, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.ForeignMessage {
        return try Proto2NofieldpresenceUnittest.ForeignMessage.Builder().mergeFrom(data: data, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(inputStream: InputStream) throws -> Proto2NofieldpresenceUnittest.ForeignMessage {
        return try Proto2NofieldpresenceUnittest.ForeignMessage.Builder().mergeFrom(inputStream: inputStream).build()
    }
    public class func parseFrom(inputStream: InputStream, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.ForeignMessage {
        return try Proto2NofieldpresenceUnittest.ForeignMessage.Builder().mergeFrom(inputStream: inputStream, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream) throws -> Proto2NofieldpresenceUnittest.ForeignMessage {
        return try Proto2NofieldpresenceUnittest.ForeignMessage.Builder().mergeFrom(codedInputStream: codedInputStream).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> Proto2NofieldpresenceUnittest.ForeignMessage {
        return try Proto2NofieldpresenceUnittest.ForeignMessage.Builder().mergeFrom(codedInputStream: codedInputStream, extensionRegistry:extensionRegistry).build()
    }
    public subscript(key: String) -> Any? {
        switch key {
        case "c": return self.c
        default: return nil
        }
    }
}
extension Proto2NofieldpresenceUnittest.ForeignMessage.Builder: GeneratedMessageBuilderProtocol {
    public typealias GeneratedMessageType = Proto2NofieldpresenceUnittest.ForeignMessage
    public subscript(key: String) -> Any? {
        get { 
            switch key {
            case "c": return self.c
            default: return nil
            }
        }
        set (newSubscriptValue) { 
            switch key {
            case "c":
                guard let newSubscriptValue = newSubscriptValue as? Int32 else {
                    return
                }
                self.c = newSubscriptValue
            default: return
            }
        }
    }
}

// @@protoc_insertion_point(global_scope)
