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

import Foundation
import ProtocolBuffers


public extension ProtobufUnittest{}

public var TestMessageSetExtension1messageSetExtension:ConcreateExtensionField {
    get {
        return ProtobufUnittest.UnittestMsetRoot.default.TestMessageSetExtension1messageSetExtensionStatic
    }
}
public var TestMessageSetExtension2messageSetExtension:ConcreateExtensionField {
    get {
        return ProtobufUnittest.UnittestMsetRoot.default.TestMessageSetExtension2messageSetExtensionStatic
    }
}
public extension ProtobufUnittest {
    public struct UnittestMsetRoot {
        public static let `default` = UnittestMsetRoot()
        var TestMessageSetExtension1messageSetExtensionStatic:ConcreateExtensionField
        var TestMessageSetExtension2messageSetExtensionStatic:ConcreateExtensionField
        public var extensionRegistry:ExtensionRegistry

        init() {
            TestMessageSetExtension1messageSetExtensionStatic = ConcreateExtensionField(type:ExtensionType.extensionTypeMessage, extendedClass:ProtobufUnittest.TestMessageSet.self, fieldNumber: 1545008, defaultValue:ProtobufUnittest.TestMessageSetExtension1(), messageOrGroupClass:ProtobufUnittest.TestMessageSetExtension1.self, isRepeated:false, isPacked:false, isMessageSetWireFormat:true)
            TestMessageSetExtension2messageSetExtensionStatic = ConcreateExtensionField(type:ExtensionType.extensionTypeMessage, extendedClass:ProtobufUnittest.TestMessageSet.self, fieldNumber: 1547769, defaultValue:ProtobufUnittest.TestMessageSetExtension2(), messageOrGroupClass:ProtobufUnittest.TestMessageSetExtension2.self, isRepeated:false, isPacked:false, isMessageSetWireFormat:true)
            extensionRegistry = ExtensionRegistry()
            registerAllExtensions(registry: extensionRegistry)
        }
        public func registerAllExtensions(registry: ExtensionRegistry) {
            registry.addExtension(extensions: TestMessageSetExtension1messageSetExtensionStatic)
            registry.addExtension(extensions: TestMessageSetExtension2messageSetExtensionStatic)
        }
    }

    /// A message with message_set_wire_format.
    final public class TestMessageSet : ExtendableMessage {
        public typealias BuilderType = ProtobufUnittest.TestMessageSet.Builder

        public static func == (lhs: ProtobufUnittest.TestMessageSet, rhs: ProtobufUnittest.TestMessageSet) -> Bool {
            if lhs === rhs {
                return true
            }
            var fieldCheck:Bool = (lhs.hashValue == rhs.hashValue)
            fieldCheck = fieldCheck && lhs.isEqualExtensionsInOther(otherMessage: rhs, startInclusive:4, endExclusive:2147483647)
            fieldCheck = (fieldCheck && (lhs.unknownFields == rhs.unknownFields))
            return fieldCheck
        }

        required public init() {
            super.init()
        }
        override public func isInitialized() throws {
            try extensionsAreInitialized()}
        override public func writeTo(codedOutputStream: CodedOutputStream) throws {
            try writeExtensionsTo(codedOutputStream: codedOutputStream, startInclusive:4, endExclusive:2147483647)
            try unknownFields.writeAsMessageSetTo(codedOutputStream: codedOutputStream)
        }
        override public func serializedSize() -> Int32 {
            var serialize_size:Int32 = memoizedSerializedSize
            if serialize_size != -1 {
             return serialize_size
            }

            serialize_size = 0
            serialize_size += extensionsSerializedSize()
            serialize_size += unknownFields.serializedSizeAsMessageSet()
            memoizedSerializedSize = serialize_size
            return serialize_size
        }
        public class func getBuilder() -> ProtobufUnittest.TestMessageSet.Builder {
            return ProtobufUnittest.TestMessageSet.classBuilder() as! ProtobufUnittest.TestMessageSet.Builder
        }
        public func getBuilder() -> ProtobufUnittest.TestMessageSet.Builder {
            return classBuilder() as! ProtobufUnittest.TestMessageSet.Builder
        }
        override public class func classBuilder() -> ProtocolBuffersMessageBuilder {
            return ProtobufUnittest.TestMessageSet.Builder()
        }
        override public func classBuilder() -> ProtocolBuffersMessageBuilder {
            return ProtobufUnittest.TestMessageSet.Builder()
        }
        public func toBuilder() throws -> ProtobufUnittest.TestMessageSet.Builder {
            return try ProtobufUnittest.TestMessageSet.builderWithPrototype(prototype:self)
        }
        public class func builderWithPrototype(prototype:ProtobufUnittest.TestMessageSet) throws -> ProtobufUnittest.TestMessageSet.Builder {
            return try ProtobufUnittest.TestMessageSet.Builder().mergeFrom(other:prototype)
        }
        override public func encode() throws -> Dictionary<String,Any> {
            try isInitialized()
            let jsonMap:Dictionary<String,Any> = Dictionary<String,Any>()
            return jsonMap
        }
        override class public func decode(jsonMap:Dictionary<String,Any>) throws -> ProtobufUnittest.TestMessageSet {
            return try ProtobufUnittest.TestMessageSet.Builder.decodeToBuilder(jsonMap:jsonMap).build()
        }
        override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSet {
            return try ProtobufUnittest.TestMessageSet.Builder.fromJSONToBuilder(data:data, options:options).build()
        }
        override public func getDescription(indent:String) throws -> String {
            var output = ""
            output += try getExtensionDescription(startInclusive:4, endExclusive:2147483647, indent:indent)
            output += unknownFields.getDescription(indent: indent)
            return output
        }
        override public var hashValue:Int {
            get {
                var hashCode:Int = 7
                hashCode = (hashCode &* 31) &+ Int(hashExtensionsFrom(startInclusive: 4, endExclusive:2147483647))
                hashCode = (hashCode &* 31) &+  unknownFields.hashValue
                return hashCode
            }
        }


        //Meta information declaration start

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

        final public class Builder : ExtendableMessageBuilder {
            fileprivate var builderResult:ProtobufUnittest.TestMessageSet = ProtobufUnittest.TestMessageSet()
            public func getMessage() -> ProtobufUnittest.TestMessageSet {
                return builderResult
            }

            required override public init () {
                super.init()
            }
            override public var internalGetResult:ExtendableMessage {
                get {
                    return builderResult
                }
            }
            @discardableResult
            override public func clear() -> ProtobufUnittest.TestMessageSet.Builder {
                builderResult = ProtobufUnittest.TestMessageSet()
                return self
            }
            override public func clone() throws -> ProtobufUnittest.TestMessageSet.Builder {
                return try ProtobufUnittest.TestMessageSet.builderWithPrototype(prototype:builderResult)
            }
            override public func build() throws -> ProtobufUnittest.TestMessageSet {
                try checkInitialized()
                return buildPartial()
            }
            public func buildPartial() -> ProtobufUnittest.TestMessageSet {
                let returnMe:ProtobufUnittest.TestMessageSet = builderResult
                return returnMe
            }
            @discardableResult
            public func mergeFrom(other:ProtobufUnittest.TestMessageSet) throws -> ProtobufUnittest.TestMessageSet.Builder {
                if other == ProtobufUnittest.TestMessageSet() {
                    return self
                }
                try mergeExtensionFields(other: other)
                try merge(unknownField: other.unknownFields)
                return self
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream) throws -> ProtobufUnittest.TestMessageSet.Builder {
                return try mergeFrom(codedInputStream: codedInputStream, extensionRegistry:ExtensionRegistry())
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSet.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

                    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 -> ProtobufUnittest.TestMessageSet.Builder {
                let resultDecodedBuilder = ProtobufUnittest.TestMessageSet.Builder()
                return resultDecodedBuilder
            }
            override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSet.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 ProtobufUnittest.TestMessageSet.Builder.decodeToBuilder(jsonMap:jsDataCast)
            }
        }

    }

    final public class TestMessageSetContainer : GeneratedMessage {
        public typealias BuilderType = ProtobufUnittest.TestMessageSetContainer.Builder

        public static func == (lhs: ProtobufUnittest.TestMessageSetContainer, rhs: ProtobufUnittest.TestMessageSetContainer) -> Bool {
            if lhs === rhs {
                return true
            }
            var fieldCheck:Bool = (lhs.hashValue == rhs.hashValue)
            fieldCheck = fieldCheck && (lhs.hasMessageSet == rhs.hasMessageSet) && (!lhs.hasMessageSet || lhs.messageSet == rhs.messageSet)
            fieldCheck = (fieldCheck && (lhs.unknownFields == rhs.unknownFields))
            return fieldCheck
        }

        public fileprivate(set) var messageSet:ProtobufUnittest.TestMessageSet!
        public fileprivate(set) var hasMessageSet:Bool = false
        required public init() {
            super.init()
        }
        override public func isInitialized() throws {
            if hasMessageSet {
                try messageSet.isInitialized()
            }
        }
        override public func writeTo(codedOutputStream: CodedOutputStream) throws {
            if hasMessageSet {
                try codedOutputStream.writeMessage(fieldNumber: 1, value:messageSet)
            }
            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 hasMessageSet {
                if let varSizemessageSet = messageSet?.computeMessageSize(fieldNumber: 1) {
                    serialize_size += varSizemessageSet
                }
            }
            serialize_size += unknownFields.serializedSize()
            memoizedSerializedSize = serialize_size
            return serialize_size
        }
        public class func getBuilder() -> ProtobufUnittest.TestMessageSetContainer.Builder {
            return ProtobufUnittest.TestMessageSetContainer.classBuilder() as! ProtobufUnittest.TestMessageSetContainer.Builder
        }
        public func getBuilder() -> ProtobufUnittest.TestMessageSetContainer.Builder {
            return classBuilder() as! ProtobufUnittest.TestMessageSetContainer.Builder
        }
        override public class func classBuilder() -> ProtocolBuffersMessageBuilder {
            return ProtobufUnittest.TestMessageSetContainer.Builder()
        }
        override public func classBuilder() -> ProtocolBuffersMessageBuilder {
            return ProtobufUnittest.TestMessageSetContainer.Builder()
        }
        public func toBuilder() throws -> ProtobufUnittest.TestMessageSetContainer.Builder {
            return try ProtobufUnittest.TestMessageSetContainer.builderWithPrototype(prototype:self)
        }
        public class func builderWithPrototype(prototype:ProtobufUnittest.TestMessageSetContainer) throws -> ProtobufUnittest.TestMessageSetContainer.Builder {
            return try ProtobufUnittest.TestMessageSetContainer.Builder().mergeFrom(other:prototype)
        }
        override public func encode() throws -> Dictionary<String,Any> {
            try isInitialized()
            var jsonMap:Dictionary<String,Any> = Dictionary<String,Any>()
            if hasMessageSet {
                jsonMap["messageSet"] = try messageSet.encode()
            }
            return jsonMap
        }
        override class public func decode(jsonMap:Dictionary<String,Any>) throws -> ProtobufUnittest.TestMessageSetContainer {
            return try ProtobufUnittest.TestMessageSetContainer.Builder.decodeToBuilder(jsonMap:jsonMap).build()
        }
        override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSetContainer {
            return try ProtobufUnittest.TestMessageSetContainer.Builder.fromJSONToBuilder(data:data, options:options).build()
        }
        override public func getDescription(indent:String) throws -> String {
            var output = ""
            if hasMessageSet {
                output += "\(indent) messageSet {\n"
                if let outDescMessageSet = messageSet {
                    output += try outDescMessageSet.getDescription(indent: "\(indent)  ")
                }
                output += "\(indent) }\n"
            }
            output += unknownFields.getDescription(indent: indent)
            return output
        }
        override public var hashValue:Int {
            get {
                var hashCode:Int = 7
                if hasMessageSet {
                    if let hashValuemessageSet = messageSet?.hashValue {
                        hashCode = (hashCode &* 31) &+ hashValuemessageSet
                    }
                }
                hashCode = (hashCode &* 31) &+  unknownFields.hashValue
                return hashCode
            }
        }


        //Meta information declaration start

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

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

            required override public init () {
                super.init()
            }
            public var messageSet:ProtobufUnittest.TestMessageSet! {
                get {
                    if messageSetBuilder_ != nil {
                        builderResult.messageSet = messageSetBuilder_.getMessage()
                    }
                    return builderResult.messageSet
                }
                set (value) {
                    builderResult.hasMessageSet = value != nil
                    builderResult.messageSet = value
                }
            }
            public var hasMessageSet:Bool {
                get {
                    return builderResult.hasMessageSet
                }
            }
            fileprivate var messageSetBuilder_:ProtobufUnittest.TestMessageSet.Builder! {
                didSet {
                    builderResult.hasMessageSet = true
                }
            }
            public func getMessageSetBuilder() -> ProtobufUnittest.TestMessageSet.Builder {
                if messageSetBuilder_ == nil {
                    messageSetBuilder_ = ProtobufUnittest.TestMessageSet.Builder()
                    builderResult.messageSet = messageSetBuilder_.getMessage()
                    if messageSet != nil {
                        try! messageSetBuilder_.mergeFrom(other: messageSet)
                    }
                }
                return messageSetBuilder_
            }
            @discardableResult
            public func setMessageSet(_ value:ProtobufUnittest.TestMessageSet!) -> ProtobufUnittest.TestMessageSetContainer.Builder {
                self.messageSet = value
                return self
            }
            @discardableResult
            public func mergeMessageSet(value:ProtobufUnittest.TestMessageSet) throws -> ProtobufUnittest.TestMessageSetContainer.Builder {
                if builderResult.hasMessageSet {
                    builderResult.messageSet = try ProtobufUnittest.TestMessageSet.builderWithPrototype(prototype:builderResult.messageSet).mergeFrom(other: value).buildPartial()
                } else {
                    builderResult.messageSet = value
                }
                builderResult.hasMessageSet = true
                return self
            }
            @discardableResult
            public func clearMessageSet() -> ProtobufUnittest.TestMessageSetContainer.Builder {
                messageSetBuilder_ = nil
                builderResult.hasMessageSet = false
                builderResult.messageSet = nil
                return self
            }
            override public var internalGetResult:GeneratedMessage {
                get {
                    return builderResult
                }
            }
            @discardableResult
            override public func clear() -> ProtobufUnittest.TestMessageSetContainer.Builder {
                builderResult = ProtobufUnittest.TestMessageSetContainer()
                return self
            }
            override public func clone() throws -> ProtobufUnittest.TestMessageSetContainer.Builder {
                return try ProtobufUnittest.TestMessageSetContainer.builderWithPrototype(prototype:builderResult)
            }
            override public func build() throws -> ProtobufUnittest.TestMessageSetContainer {
                try checkInitialized()
                return buildPartial()
            }
            public func buildPartial() -> ProtobufUnittest.TestMessageSetContainer {
                let returnMe:ProtobufUnittest.TestMessageSetContainer = builderResult
                return returnMe
            }
            @discardableResult
            public func mergeFrom(other:ProtobufUnittest.TestMessageSetContainer) throws -> ProtobufUnittest.TestMessageSetContainer.Builder {
                if other == ProtobufUnittest.TestMessageSetContainer() {
                    return self
                }
                if (other.hasMessageSet) {
                    try mergeMessageSet(value: other.messageSet)
                }
                try merge(unknownField: other.unknownFields)
                return self
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream) throws -> ProtobufUnittest.TestMessageSetContainer.Builder {
                return try mergeFrom(codedInputStream: codedInputStream, extensionRegistry:ExtensionRegistry())
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSetContainer.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.TestMessageSet.Builder = ProtobufUnittest.TestMessageSet.Builder()
                        if hasMessageSet {
                            try subBuilder.mergeFrom(other: messageSet)
                        }
                        try codedInputStream.readMessage(builder: subBuilder, extensionRegistry:extensionRegistry)
                        messageSet = 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 -> ProtobufUnittest.TestMessageSetContainer.Builder {
                let resultDecodedBuilder = ProtobufUnittest.TestMessageSetContainer.Builder()
                if let jsonValueMessageSet = jsonMap["messageSet"] as? Dictionary<String,Any> {
                    resultDecodedBuilder.messageSet = try ProtobufUnittest.TestMessageSet.Builder.decodeToBuilder(jsonMap:jsonValueMessageSet).build()

                }
                return resultDecodedBuilder
            }
            override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSetContainer.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 ProtobufUnittest.TestMessageSetContainer.Builder.decodeToBuilder(jsonMap:jsDataCast)
            }
        }

    }

    final public class TestMessageSetExtension1 : GeneratedMessage {
        public typealias BuilderType = ProtobufUnittest.TestMessageSetExtension1.Builder

        public static func == (lhs: ProtobufUnittest.TestMessageSetExtension1, rhs: ProtobufUnittest.TestMessageSetExtension1) -> Bool {
            if lhs === rhs {
                return true
            }
            var fieldCheck:Bool = (lhs.hashValue == rhs.hashValue)
            fieldCheck = fieldCheck && (lhs.hasI == rhs.hasI) && (!lhs.hasI || lhs.i == rhs.i)
            fieldCheck = (fieldCheck && (lhs.unknownFields == rhs.unknownFields))
            return fieldCheck
        }

        public fileprivate(set) var i:Int32! = nil
        public fileprivate(set) var hasI:Bool = false

        public class func messageSetExtension() -> ConcreateExtensionField {
               return TestMessageSetExtension1messageSetExtension
        }
        required public init() {
            super.init()
        }
        override public func isInitialized() throws {
        }
        override public func writeTo(codedOutputStream: CodedOutputStream) throws {
            if hasI {
                try codedOutputStream.writeInt32(fieldNumber: 15, value:i)
            }
            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 hasI {
                serialize_size += i.computeInt32Size(fieldNumber: 15)
            }
            serialize_size += unknownFields.serializedSize()
            memoizedSerializedSize = serialize_size
            return serialize_size
        }
        public class func getBuilder() -> ProtobufUnittest.TestMessageSetExtension1.Builder {
            return ProtobufUnittest.TestMessageSetExtension1.classBuilder() as! ProtobufUnittest.TestMessageSetExtension1.Builder
        }
        public func getBuilder() -> ProtobufUnittest.TestMessageSetExtension1.Builder {
            return classBuilder() as! ProtobufUnittest.TestMessageSetExtension1.Builder
        }
        override public class func classBuilder() -> ProtocolBuffersMessageBuilder {
            return ProtobufUnittest.TestMessageSetExtension1.Builder()
        }
        override public func classBuilder() -> ProtocolBuffersMessageBuilder {
            return ProtobufUnittest.TestMessageSetExtension1.Builder()
        }
        public func toBuilder() throws -> ProtobufUnittest.TestMessageSetExtension1.Builder {
            return try ProtobufUnittest.TestMessageSetExtension1.builderWithPrototype(prototype:self)
        }
        public class func builderWithPrototype(prototype:ProtobufUnittest.TestMessageSetExtension1) throws -> ProtobufUnittest.TestMessageSetExtension1.Builder {
            return try ProtobufUnittest.TestMessageSetExtension1.Builder().mergeFrom(other:prototype)
        }
        override public func encode() throws -> Dictionary<String,Any> {
            try isInitialized()
            var jsonMap:Dictionary<String,Any> = Dictionary<String,Any>()
            if hasI {
                jsonMap["i"] = Int(i)
            }
            return jsonMap
        }
        override class public func decode(jsonMap:Dictionary<String,Any>) throws -> ProtobufUnittest.TestMessageSetExtension1 {
            return try ProtobufUnittest.TestMessageSetExtension1.Builder.decodeToBuilder(jsonMap:jsonMap).build()
        }
        override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSetExtension1 {
            return try ProtobufUnittest.TestMessageSetExtension1.Builder.fromJSONToBuilder(data:data, options:options).build()
        }
        override public func getDescription(indent:String) throws -> String {
            var output = ""
            if hasI {
                output += "\(indent) i: \(String(describing: i)) \n"
            }
            output += unknownFields.getDescription(indent: indent)
            return output
        }
        override public var hashValue:Int {
            get {
                var hashCode:Int = 7
                if hasI {
                    hashCode = (hashCode &* 31) &+ i.hashValue
                }
                hashCode = (hashCode &* 31) &+  unknownFields.hashValue
                return hashCode
            }
        }


        //Meta information declaration start

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

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

            required override public init () {
                super.init()
            }
            public var i:Int32 {
                get {
                    return builderResult.i
                }
                set (value) {
                    builderResult.hasI = true
                    builderResult.i = value
                }
            }
            public var hasI:Bool {
                get {
                    return builderResult.hasI
                }
            }
            @discardableResult
            public func setI(_ value:Int32) -> ProtobufUnittest.TestMessageSetExtension1.Builder {
                self.i = value
                return self
            }
            @discardableResult
            public func clearI() -> ProtobufUnittest.TestMessageSetExtension1.Builder{
                builderResult.hasI = false
                builderResult.i = nil
                return self
            }
            override public var internalGetResult:GeneratedMessage {
                get {
                    return builderResult
                }
            }
            @discardableResult
            override public func clear() -> ProtobufUnittest.TestMessageSetExtension1.Builder {
                builderResult = ProtobufUnittest.TestMessageSetExtension1()
                return self
            }
            override public func clone() throws -> ProtobufUnittest.TestMessageSetExtension1.Builder {
                return try ProtobufUnittest.TestMessageSetExtension1.builderWithPrototype(prototype:builderResult)
            }
            override public func build() throws -> ProtobufUnittest.TestMessageSetExtension1 {
                try checkInitialized()
                return buildPartial()
            }
            public func buildPartial() -> ProtobufUnittest.TestMessageSetExtension1 {
                let returnMe:ProtobufUnittest.TestMessageSetExtension1 = builderResult
                return returnMe
            }
            @discardableResult
            public func mergeFrom(other:ProtobufUnittest.TestMessageSetExtension1) throws -> ProtobufUnittest.TestMessageSetExtension1.Builder {
                if other == ProtobufUnittest.TestMessageSetExtension1() {
                    return self
                }
                if other.hasI {
                    i = other.i
                }
                try merge(unknownField: other.unknownFields)
                return self
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream) throws -> ProtobufUnittest.TestMessageSetExtension1.Builder {
                return try mergeFrom(codedInputStream: codedInputStream, extensionRegistry:ExtensionRegistry())
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSetExtension1.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 120:
                        i = 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 -> ProtobufUnittest.TestMessageSetExtension1.Builder {
                let resultDecodedBuilder = ProtobufUnittest.TestMessageSetExtension1.Builder()
                if let jsonValueI = jsonMap["i"] as? Int {
                    resultDecodedBuilder.i = Int32(jsonValueI)
                } else if let jsonValueI = jsonMap["i"] as? String {
                    resultDecodedBuilder.i = Int32(jsonValueI)!
                }
                return resultDecodedBuilder
            }
            override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSetExtension1.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 ProtobufUnittest.TestMessageSetExtension1.Builder.decodeToBuilder(jsonMap:jsDataCast)
            }
        }

    }

    final public class TestMessageSetExtension2 : GeneratedMessage {
        public typealias BuilderType = ProtobufUnittest.TestMessageSetExtension2.Builder

        public static func == (lhs: ProtobufUnittest.TestMessageSetExtension2, rhs: ProtobufUnittest.TestMessageSetExtension2) -> Bool {
            if lhs === rhs {
                return true
            }
            var fieldCheck:Bool = (lhs.hashValue == rhs.hashValue)
            fieldCheck = fieldCheck && (lhs.hasStr == rhs.hasStr) && (!lhs.hasStr || lhs.str == rhs.str)
            fieldCheck = (fieldCheck && (lhs.unknownFields == rhs.unknownFields))
            return fieldCheck
        }

        public fileprivate(set) var str:String! = nil
        public fileprivate(set) var hasStr:Bool = false

        public class func messageSetExtension() -> ConcreateExtensionField {
               return TestMessageSetExtension2messageSetExtension
        }
        required public init() {
            super.init()
        }
        override public func isInitialized() throws {
        }
        override public func writeTo(codedOutputStream: CodedOutputStream) throws {
            if hasStr {
                try codedOutputStream.writeString(fieldNumber: 25, value:str)
            }
            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 hasStr {
                serialize_size += str.computeStringSize(fieldNumber: 25)
            }
            serialize_size += unknownFields.serializedSize()
            memoizedSerializedSize = serialize_size
            return serialize_size
        }
        public class func getBuilder() -> ProtobufUnittest.TestMessageSetExtension2.Builder {
            return ProtobufUnittest.TestMessageSetExtension2.classBuilder() as! ProtobufUnittest.TestMessageSetExtension2.Builder
        }
        public func getBuilder() -> ProtobufUnittest.TestMessageSetExtension2.Builder {
            return classBuilder() as! ProtobufUnittest.TestMessageSetExtension2.Builder
        }
        override public class func classBuilder() -> ProtocolBuffersMessageBuilder {
            return ProtobufUnittest.TestMessageSetExtension2.Builder()
        }
        override public func classBuilder() -> ProtocolBuffersMessageBuilder {
            return ProtobufUnittest.TestMessageSetExtension2.Builder()
        }
        public func toBuilder() throws -> ProtobufUnittest.TestMessageSetExtension2.Builder {
            return try ProtobufUnittest.TestMessageSetExtension2.builderWithPrototype(prototype:self)
        }
        public class func builderWithPrototype(prototype:ProtobufUnittest.TestMessageSetExtension2) throws -> ProtobufUnittest.TestMessageSetExtension2.Builder {
            return try ProtobufUnittest.TestMessageSetExtension2.Builder().mergeFrom(other:prototype)
        }
        override public func encode() throws -> Dictionary<String,Any> {
            try isInitialized()
            var jsonMap:Dictionary<String,Any> = Dictionary<String,Any>()
            if hasStr {
                jsonMap["str"] = str
            }
            return jsonMap
        }
        override class public func decode(jsonMap:Dictionary<String,Any>) throws -> ProtobufUnittest.TestMessageSetExtension2 {
            return try ProtobufUnittest.TestMessageSetExtension2.Builder.decodeToBuilder(jsonMap:jsonMap).build()
        }
        override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSetExtension2 {
            return try ProtobufUnittest.TestMessageSetExtension2.Builder.fromJSONToBuilder(data:data, options:options).build()
        }
        override public func getDescription(indent:String) throws -> String {
            var output = ""
            if hasStr {
                output += "\(indent) str: \(String(describing: str)) \n"
            }
            output += unknownFields.getDescription(indent: indent)
            return output
        }
        override public var hashValue:Int {
            get {
                var hashCode:Int = 7
                if hasStr {
                    hashCode = (hashCode &* 31) &+ str.hashValue
                }
                hashCode = (hashCode &* 31) &+  unknownFields.hashValue
                return hashCode
            }
        }


        //Meta information declaration start

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

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

            required override public init () {
                super.init()
            }
            public var str:String {
                get {
                    return builderResult.str
                }
                set (value) {
                    builderResult.hasStr = true
                    builderResult.str = value
                }
            }
            public var hasStr:Bool {
                get {
                    return builderResult.hasStr
                }
            }
            @discardableResult
            public func setStr(_ value:String) -> ProtobufUnittest.TestMessageSetExtension2.Builder {
                self.str = value
                return self
            }
            @discardableResult
            public func clearStr() -> ProtobufUnittest.TestMessageSetExtension2.Builder{
                builderResult.hasStr = false
                builderResult.str = nil
                return self
            }
            override public var internalGetResult:GeneratedMessage {
                get {
                    return builderResult
                }
            }
            @discardableResult
            override public func clear() -> ProtobufUnittest.TestMessageSetExtension2.Builder {
                builderResult = ProtobufUnittest.TestMessageSetExtension2()
                return self
            }
            override public func clone() throws -> ProtobufUnittest.TestMessageSetExtension2.Builder {
                return try ProtobufUnittest.TestMessageSetExtension2.builderWithPrototype(prototype:builderResult)
            }
            override public func build() throws -> ProtobufUnittest.TestMessageSetExtension2 {
                try checkInitialized()
                return buildPartial()
            }
            public func buildPartial() -> ProtobufUnittest.TestMessageSetExtension2 {
                let returnMe:ProtobufUnittest.TestMessageSetExtension2 = builderResult
                return returnMe
            }
            @discardableResult
            public func mergeFrom(other:ProtobufUnittest.TestMessageSetExtension2) throws -> ProtobufUnittest.TestMessageSetExtension2.Builder {
                if other == ProtobufUnittest.TestMessageSetExtension2() {
                    return self
                }
                if other.hasStr {
                    str = other.str
                }
                try merge(unknownField: other.unknownFields)
                return self
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream) throws -> ProtobufUnittest.TestMessageSetExtension2.Builder {
                return try mergeFrom(codedInputStream: codedInputStream, extensionRegistry:ExtensionRegistry())
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSetExtension2.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 202:
                        str = try codedInputStream.readString()

                    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 -> ProtobufUnittest.TestMessageSetExtension2.Builder {
                let resultDecodedBuilder = ProtobufUnittest.TestMessageSetExtension2.Builder()
                if let jsonValueStr = jsonMap["str"] as? String {
                    resultDecodedBuilder.str = jsonValueStr
                }
                return resultDecodedBuilder
            }
            override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.TestMessageSetExtension2.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 ProtobufUnittest.TestMessageSetExtension2.Builder.decodeToBuilder(jsonMap:jsDataCast)
            }
        }

    }

    /// MessageSet wire format is equivalent to this.
    final public class RawMessageSet : GeneratedMessage {
        public typealias BuilderType = ProtobufUnittest.RawMessageSet.Builder

        public static func == (lhs: ProtobufUnittest.RawMessageSet, rhs: ProtobufUnittest.RawMessageSet) -> Bool {
            if lhs === rhs {
                return true
            }
            var fieldCheck:Bool = (lhs.hashValue == rhs.hashValue)
            fieldCheck = fieldCheck && (lhs.item == rhs.item)
            fieldCheck = (fieldCheck && (lhs.unknownFields == rhs.unknownFields))
            return fieldCheck
        }



        //Nested type declaration start

        final public class Item : GeneratedMessage {
            public typealias BuilderType = ProtobufUnittest.RawMessageSet.Item.Builder

            public static func == (lhs: ProtobufUnittest.RawMessageSet.Item, rhs: ProtobufUnittest.RawMessageSet.Item) -> Bool {
                if lhs === rhs {
                    return true
                }
                var fieldCheck:Bool = (lhs.hashValue == rhs.hashValue)
                fieldCheck = fieldCheck && (lhs.hasTypeId == rhs.hasTypeId) && (!lhs.hasTypeId || lhs.typeId == rhs.typeId)
                fieldCheck = fieldCheck && (lhs.hasMessage == rhs.hasMessage) && (!lhs.hasMessage || lhs.message == rhs.message)
                fieldCheck = (fieldCheck && (lhs.unknownFields == rhs.unknownFields))
                return fieldCheck
            }

            public fileprivate(set) var typeId:Int32! = nil
            public fileprivate(set) var hasTypeId:Bool = false

            public fileprivate(set) var message:Data! = nil
            public fileprivate(set) var hasMessage:Bool = false

            required public init() {
                super.init()
            }
            override public func isInitialized() throws {
                if !hasTypeId {
                    throw ProtocolBuffersError.invalidProtocolBuffer("Uninitialized Message \(ProtobufUnittest.RawMessageSet.Item.self): field \"typeId\" mark required")
                }
                if !hasMessage {
                    throw ProtocolBuffersError.invalidProtocolBuffer("Uninitialized Message \(ProtobufUnittest.RawMessageSet.Item.self): field \"message\" mark required")
                }
            }
            override public func writeTo(codedOutputStream: CodedOutputStream) throws {
                if hasTypeId {
                    try codedOutputStream.writeInt32(fieldNumber: 2, value:typeId)
                }
                if hasMessage {
                    try codedOutputStream.writeData(fieldNumber: 3, value:message)
                }
                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 hasTypeId {
                    serialize_size += typeId.computeInt32Size(fieldNumber: 2)
                }
                if hasMessage {
                    serialize_size += message.computeDataSize(fieldNumber: 3)
                }
                serialize_size += unknownFields.serializedSize()
                memoizedSerializedSize = serialize_size
                return serialize_size
            }
            public class func getBuilder() -> ProtobufUnittest.RawMessageSet.Item.Builder {
                return ProtobufUnittest.RawMessageSet.Item.classBuilder() as! ProtobufUnittest.RawMessageSet.Item.Builder
            }
            public func getBuilder() -> ProtobufUnittest.RawMessageSet.Item.Builder {
                return classBuilder() as! ProtobufUnittest.RawMessageSet.Item.Builder
            }
            override public class func classBuilder() -> ProtocolBuffersMessageBuilder {
                return ProtobufUnittest.RawMessageSet.Item.Builder()
            }
            override public func classBuilder() -> ProtocolBuffersMessageBuilder {
                return ProtobufUnittest.RawMessageSet.Item.Builder()
            }
            public func toBuilder() throws -> ProtobufUnittest.RawMessageSet.Item.Builder {
                return try ProtobufUnittest.RawMessageSet.Item.builderWithPrototype(prototype:self)
            }
            public class func builderWithPrototype(prototype:ProtobufUnittest.RawMessageSet.Item) throws -> ProtobufUnittest.RawMessageSet.Item.Builder {
                return try ProtobufUnittest.RawMessageSet.Item.Builder().mergeFrom(other:prototype)
            }
            override public func encode() throws -> Dictionary<String,Any> {
                try isInitialized()
                var jsonMap:Dictionary<String,Any> = Dictionary<String,Any>()
                if hasTypeId {
                    jsonMap["typeId"] = Int(typeId)
                }
                if hasMessage {
                    jsonMap["message"] = message.base64EncodedString(options: Data.Base64EncodingOptions(rawValue: 0))
                }
                return jsonMap
            }
            override class public func decode(jsonMap:Dictionary<String,Any>) throws -> ProtobufUnittest.RawMessageSet.Item {
                return try ProtobufUnittest.RawMessageSet.Item.Builder.decodeToBuilder(jsonMap:jsonMap).build()
            }
            override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.RawMessageSet.Item {
                return try ProtobufUnittest.RawMessageSet.Item.Builder.fromJSONToBuilder(data:data, options:options).build()
            }
            override public func getDescription(indent:String) throws -> String {
                var output = ""
                if hasTypeId {
                    output += "\(indent) typeId: \(String(describing: typeId)) \n"
                }
                if hasMessage {
                    output += "\(indent) message: \(String(describing: message)) \n"
                }
                output += unknownFields.getDescription(indent: indent)
                return output
            }
            override public var hashValue:Int {
                get {
                    var hashCode:Int = 7
                    if hasTypeId {
                        hashCode = (hashCode &* 31) &+ typeId.hashValue
                    }
                    if hasMessage {
                        hashCode = (hashCode &* 31) &+ message.hashValue
                    }
                    hashCode = (hashCode &* 31) &+  unknownFields.hashValue
                    return hashCode
                }
            }


            //Meta information declaration start

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

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

                required override public init () {
                    super.init()
                }
                public var typeId:Int32 {
                    get {
                        return builderResult.typeId
                    }
                    set (value) {
                        builderResult.hasTypeId = true
                        builderResult.typeId = value
                    }
                }
                public var hasTypeId:Bool {
                    get {
                        return builderResult.hasTypeId
                    }
                }
                @discardableResult
                public func setTypeId(_ value:Int32) -> ProtobufUnittest.RawMessageSet.Item.Builder {
                    self.typeId = value
                    return self
                }
                @discardableResult
                public func clearTypeId() -> ProtobufUnittest.RawMessageSet.Item.Builder{
                    builderResult.hasTypeId = false
                    builderResult.typeId = nil
                    return self
                }
                public var message:Data {
                    get {
                        return builderResult.message
                    }
                    set (value) {
                        builderResult.hasMessage = true
                        builderResult.message = value
                    }
                }
                public var hasMessage:Bool {
                    get {
                        return builderResult.hasMessage
                    }
                }
                @discardableResult
                public func setMessage(_ value:Data) -> ProtobufUnittest.RawMessageSet.Item.Builder {
                    self.message = value
                    return self
                }
                @discardableResult
                public func clearMessage() -> ProtobufUnittest.RawMessageSet.Item.Builder{
                    builderResult.hasMessage = false
                    builderResult.message = nil
                    return self
                }
                override public var internalGetResult:GeneratedMessage {
                    get {
                        return builderResult
                    }
                }
                @discardableResult
                override public func clear() -> ProtobufUnittest.RawMessageSet.Item.Builder {
                    builderResult = ProtobufUnittest.RawMessageSet.Item()
                    return self
                }
                override public func clone() throws -> ProtobufUnittest.RawMessageSet.Item.Builder {
                    return try ProtobufUnittest.RawMessageSet.Item.builderWithPrototype(prototype:builderResult)
                }
                override public func build() throws -> ProtobufUnittest.RawMessageSet.Item {
                    try checkInitialized()
                    return buildPartial()
                }
                public func buildPartial() -> ProtobufUnittest.RawMessageSet.Item {
                    let returnMe:ProtobufUnittest.RawMessageSet.Item = builderResult
                    return returnMe
                }
                @discardableResult
                public func mergeFrom(other:ProtobufUnittest.RawMessageSet.Item) throws -> ProtobufUnittest.RawMessageSet.Item.Builder {
                    if other == ProtobufUnittest.RawMessageSet.Item() {
                        return self
                    }
                    if other.hasTypeId {
                        typeId = other.typeId
                    }
                    if other.hasMessage {
                        message = other.message
                    }
                    try merge(unknownField: other.unknownFields)
                    return self
                }
                @discardableResult
                override public func mergeFrom(codedInputStream: CodedInputStream) throws -> ProtobufUnittest.RawMessageSet.Item.Builder {
                    return try mergeFrom(codedInputStream: codedInputStream, extensionRegistry:ExtensionRegistry())
                }
                @discardableResult
                override public func mergeFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.RawMessageSet.Item.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 16:
                            typeId = try codedInputStream.readInt32()

                        case 26:
                            message = try codedInputStream.readData()

                        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 -> ProtobufUnittest.RawMessageSet.Item.Builder {
                    let resultDecodedBuilder = ProtobufUnittest.RawMessageSet.Item.Builder()
                    if let jsonValueTypeId = jsonMap["typeId"] as? Int {
                        resultDecodedBuilder.typeId = Int32(jsonValueTypeId)
                    } else if let jsonValueTypeId = jsonMap["typeId"] as? String {
                        resultDecodedBuilder.typeId = Int32(jsonValueTypeId)!
                    }
                    if let jsonValueMessage = jsonMap["message"] as? String {
                        resultDecodedBuilder.message = Data(base64Encoded:jsonValueMessage, options: Data.Base64DecodingOptions(rawValue:0))!
                    }
                    return resultDecodedBuilder
                }
                override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.RawMessageSet.Item.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 ProtobufUnittest.RawMessageSet.Item.Builder.decodeToBuilder(jsonMap:jsDataCast)
                }
            }

        }

        //Nested type declaration end

        public fileprivate(set) var item:Array<ProtobufUnittest.RawMessageSet.Item>  = Array<ProtobufUnittest.RawMessageSet.Item>()
        required public init() {
            super.init()
        }
        override public func isInitialized() throws {
            for oneElementItem in item {
                try oneElementItem.isInitialized()
            }
        }
        override public func writeTo(codedOutputStream: CodedOutputStream) throws {
            for oneElementItem in item {
                  try codedOutputStream.writeGroup(fieldNumber: 1, value:oneElementItem)
            }
            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
            for oneElementItem in item {
                serialize_size += oneElementItem.computeGroupSize(fieldNumber: 1)
            }
            serialize_size += unknownFields.serializedSize()
            memoizedSerializedSize = serialize_size
            return serialize_size
        }
        public class func getBuilder() -> ProtobufUnittest.RawMessageSet.Builder {
            return ProtobufUnittest.RawMessageSet.classBuilder() as! ProtobufUnittest.RawMessageSet.Builder
        }
        public func getBuilder() -> ProtobufUnittest.RawMessageSet.Builder {
            return classBuilder() as! ProtobufUnittest.RawMessageSet.Builder
        }
        override public class func classBuilder() -> ProtocolBuffersMessageBuilder {
            return ProtobufUnittest.RawMessageSet.Builder()
        }
        override public func classBuilder() -> ProtocolBuffersMessageBuilder {
            return ProtobufUnittest.RawMessageSet.Builder()
        }
        public func toBuilder() throws -> ProtobufUnittest.RawMessageSet.Builder {
            return try ProtobufUnittest.RawMessageSet.builderWithPrototype(prototype:self)
        }
        public class func builderWithPrototype(prototype:ProtobufUnittest.RawMessageSet) throws -> ProtobufUnittest.RawMessageSet.Builder {
            return try ProtobufUnittest.RawMessageSet.Builder().mergeFrom(other:prototype)
        }
        override public func encode() throws -> Dictionary<String,Any> {
            try isInitialized()
            var jsonMap:Dictionary<String,Any> = Dictionary<String,Any>()
            if !item.isEmpty {
                var jsonArrayItem:Array<Dictionary<String,Any>> = []
                for oneValueItem in item {
                    let ecodedMessageItem = try oneValueItem.encode()
                    jsonArrayItem.append(ecodedMessageItem)
                }
                jsonMap["item"] = jsonArrayItem
            }
            return jsonMap
        }
        override class public func decode(jsonMap:Dictionary<String,Any>) throws -> ProtobufUnittest.RawMessageSet {
            return try ProtobufUnittest.RawMessageSet.Builder.decodeToBuilder(jsonMap:jsonMap).build()
        }
        override class public func fromJSON(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.RawMessageSet {
            return try ProtobufUnittest.RawMessageSet.Builder.fromJSONToBuilder(data:data, options:options).build()
        }
        override public func getDescription(indent:String) throws -> String {
            var output = ""
            var itemElementIndex:Int = 0
            for oneElementItem in item {
                output += "\(indent) item[\(itemElementIndex)] {\n"
                output += try oneElementItem.getDescription(indent: "\(indent)  ")
                output += "\(indent)}\n"
                itemElementIndex += 1
            }
            output += unknownFields.getDescription(indent: indent)
            return output
        }
        override public var hashValue:Int {
            get {
                var hashCode:Int = 7
                for oneElementItem in item {
                    hashCode = (hashCode &* 31) &+ oneElementItem.hashValue
                }
                hashCode = (hashCode &* 31) &+  unknownFields.hashValue
                return hashCode
            }
        }


        //Meta information declaration start

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

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

            required override public init () {
                super.init()
            }
            public var item:Array<ProtobufUnittest.RawMessageSet.Item> {
                get {
                    return builderResult.item
                }
                set (value) {
                    builderResult.item = value
                }
            }
            @discardableResult
            public func setItem(_ value:Array<ProtobufUnittest.RawMessageSet.Item>) -> ProtobufUnittest.RawMessageSet.Builder {
                self.item = value
                return self
            }
            @discardableResult
            public func clearItem() -> ProtobufUnittest.RawMessageSet.Builder {
                builderResult.item.removeAll(keepingCapacity: false)
                return self
            }
            override public var internalGetResult:GeneratedMessage {
                get {
                    return builderResult
                }
            }
            @discardableResult
            override public func clear() -> ProtobufUnittest.RawMessageSet.Builder {
                builderResult = ProtobufUnittest.RawMessageSet()
                return self
            }
            override public func clone() throws -> ProtobufUnittest.RawMessageSet.Builder {
                return try ProtobufUnittest.RawMessageSet.builderWithPrototype(prototype:builderResult)
            }
            override public func build() throws -> ProtobufUnittest.RawMessageSet {
                try checkInitialized()
                return buildPartial()
            }
            public func buildPartial() -> ProtobufUnittest.RawMessageSet {
                let returnMe:ProtobufUnittest.RawMessageSet = builderResult
                return returnMe
            }
            @discardableResult
            public func mergeFrom(other:ProtobufUnittest.RawMessageSet) throws -> ProtobufUnittest.RawMessageSet.Builder {
                if other == ProtobufUnittest.RawMessageSet() {
                    return self
                }
                if !other.item.isEmpty  {
                     builderResult.item += other.item
                }
                try merge(unknownField: other.unknownFields)
                return self
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream) throws -> ProtobufUnittest.RawMessageSet.Builder {
                return try mergeFrom(codedInputStream: codedInputStream, extensionRegistry:ExtensionRegistry())
            }
            @discardableResult
            override public func mergeFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.RawMessageSet.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 11:
                        let subBuilder = ProtobufUnittest.RawMessageSet.Item.Builder()
                        try codedInputStream.readGroup(fieldNumber:1, builder:subBuilder,extensionRegistry:extensionRegistry)
                        item.append(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 -> ProtobufUnittest.RawMessageSet.Builder {
                let resultDecodedBuilder = ProtobufUnittest.RawMessageSet.Builder()
                if let jsonValueItem = jsonMap["item"] as? Array<Dictionary<String,Any>> {
                    var jsonArrayItem:Array<ProtobufUnittest.RawMessageSet.Item> = []
                    for oneValueItem in jsonValueItem {
                        let messageFromStringItem = try ProtobufUnittest.RawMessageSet.Item.Builder.decodeToBuilder(jsonMap:oneValueItem).build()

                        jsonArrayItem.append(messageFromStringItem)
                    }
                    resultDecodedBuilder.item = jsonArrayItem
                }
                return resultDecodedBuilder
            }
            override class public func fromJSONToBuilder(data:Data, options: JSONSerialization.ReadingOptions = []) throws -> ProtobufUnittest.RawMessageSet.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 ProtobufUnittest.RawMessageSet.Builder.decodeToBuilder(jsonMap:jsDataCast)
            }
        }

    }

}
extension ProtobufUnittest.TestMessageSet: GeneratedMessageProtocol {
    public class func parseArrayDelimitedFrom(inputStream: InputStream) throws -> Array<ProtobufUnittest.TestMessageSet> {
        var mergedArray = Array<ProtobufUnittest.TestMessageSet>()
        while let value = try parseDelimitedFrom(inputStream: inputStream) {
          mergedArray.append(value)
        }
        return mergedArray
    }
    public class func parseDelimitedFrom(inputStream: InputStream) throws -> ProtobufUnittest.TestMessageSet? {
        return try ProtobufUnittest.TestMessageSet.Builder().mergeDelimitedFrom(inputStream: inputStream)?.build()
    }
    public class func parseFrom(data: Data) throws -> ProtobufUnittest.TestMessageSet {
        return try ProtobufUnittest.TestMessageSet.Builder().mergeFrom(data: data, extensionRegistry:ProtobufUnittest.UnittestMsetRoot.default.extensionRegistry).build()
    }
    public class func parseFrom(data: Data, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSet {
        return try ProtobufUnittest.TestMessageSet.Builder().mergeFrom(data: data, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(inputStream: InputStream) throws -> ProtobufUnittest.TestMessageSet {
        return try ProtobufUnittest.TestMessageSet.Builder().mergeFrom(inputStream: inputStream).build()
    }
    public class func parseFrom(inputStream: InputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSet {
        return try ProtobufUnittest.TestMessageSet.Builder().mergeFrom(inputStream: inputStream, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream) throws -> ProtobufUnittest.TestMessageSet {
        return try ProtobufUnittest.TestMessageSet.Builder().mergeFrom(codedInputStream: codedInputStream).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSet {
        return try ProtobufUnittest.TestMessageSet.Builder().mergeFrom(codedInputStream: codedInputStream, extensionRegistry:extensionRegistry).build()
    }
    public subscript(key: String) -> Any? {
        return nil
    }
}
extension ProtobufUnittest.TestMessageSet.Builder: GeneratedMessageBuilderProtocol {
    public typealias GeneratedMessageType = ProtobufUnittest.TestMessageSet
    public subscript(key: String) -> Any? {
        get { return nil }
        set { }
    }
}
extension ProtobufUnittest.TestMessageSetContainer: GeneratedMessageProtocol {
    public class func parseArrayDelimitedFrom(inputStream: InputStream) throws -> Array<ProtobufUnittest.TestMessageSetContainer> {
        var mergedArray = Array<ProtobufUnittest.TestMessageSetContainer>()
        while let value = try parseDelimitedFrom(inputStream: inputStream) {
          mergedArray.append(value)
        }
        return mergedArray
    }
    public class func parseDelimitedFrom(inputStream: InputStream) throws -> ProtobufUnittest.TestMessageSetContainer? {
        return try ProtobufUnittest.TestMessageSetContainer.Builder().mergeDelimitedFrom(inputStream: inputStream)?.build()
    }
    public class func parseFrom(data: Data) throws -> ProtobufUnittest.TestMessageSetContainer {
        return try ProtobufUnittest.TestMessageSetContainer.Builder().mergeFrom(data: data, extensionRegistry:ProtobufUnittest.UnittestMsetRoot.default.extensionRegistry).build()
    }
    public class func parseFrom(data: Data, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSetContainer {
        return try ProtobufUnittest.TestMessageSetContainer.Builder().mergeFrom(data: data, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(inputStream: InputStream) throws -> ProtobufUnittest.TestMessageSetContainer {
        return try ProtobufUnittest.TestMessageSetContainer.Builder().mergeFrom(inputStream: inputStream).build()
    }
    public class func parseFrom(inputStream: InputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSetContainer {
        return try ProtobufUnittest.TestMessageSetContainer.Builder().mergeFrom(inputStream: inputStream, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream) throws -> ProtobufUnittest.TestMessageSetContainer {
        return try ProtobufUnittest.TestMessageSetContainer.Builder().mergeFrom(codedInputStream: codedInputStream).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSetContainer {
        return try ProtobufUnittest.TestMessageSetContainer.Builder().mergeFrom(codedInputStream: codedInputStream, extensionRegistry:extensionRegistry).build()
    }
    public subscript(key: String) -> Any? {
        switch key {
        case "messageSet": return self.messageSet
        default: return nil
        }
    }
}
extension ProtobufUnittest.TestMessageSetContainer.Builder: GeneratedMessageBuilderProtocol {
    public typealias GeneratedMessageType = ProtobufUnittest.TestMessageSetContainer
    public subscript(key: String) -> Any? {
        get { 
            switch key {
            case "messageSet": return self.messageSet
            default: return nil
            }
        }
        set (newSubscriptValue) { 
            switch key {
            case "messageSet":
                guard let newSubscriptValue = newSubscriptValue as? ProtobufUnittest.TestMessageSet else {
                    return
                }
                self.messageSet = newSubscriptValue
            default: return
            }
        }
    }
}
extension ProtobufUnittest.TestMessageSetExtension1: GeneratedMessageProtocol {
    public class func parseArrayDelimitedFrom(inputStream: InputStream) throws -> Array<ProtobufUnittest.TestMessageSetExtension1> {
        var mergedArray = Array<ProtobufUnittest.TestMessageSetExtension1>()
        while let value = try parseDelimitedFrom(inputStream: inputStream) {
          mergedArray.append(value)
        }
        return mergedArray
    }
    public class func parseDelimitedFrom(inputStream: InputStream) throws -> ProtobufUnittest.TestMessageSetExtension1? {
        return try ProtobufUnittest.TestMessageSetExtension1.Builder().mergeDelimitedFrom(inputStream: inputStream)?.build()
    }
    public class func parseFrom(data: Data) throws -> ProtobufUnittest.TestMessageSetExtension1 {
        return try ProtobufUnittest.TestMessageSetExtension1.Builder().mergeFrom(data: data, extensionRegistry:ProtobufUnittest.UnittestMsetRoot.default.extensionRegistry).build()
    }
    public class func parseFrom(data: Data, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSetExtension1 {
        return try ProtobufUnittest.TestMessageSetExtension1.Builder().mergeFrom(data: data, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(inputStream: InputStream) throws -> ProtobufUnittest.TestMessageSetExtension1 {
        return try ProtobufUnittest.TestMessageSetExtension1.Builder().mergeFrom(inputStream: inputStream).build()
    }
    public class func parseFrom(inputStream: InputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSetExtension1 {
        return try ProtobufUnittest.TestMessageSetExtension1.Builder().mergeFrom(inputStream: inputStream, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream) throws -> ProtobufUnittest.TestMessageSetExtension1 {
        return try ProtobufUnittest.TestMessageSetExtension1.Builder().mergeFrom(codedInputStream: codedInputStream).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSetExtension1 {
        return try ProtobufUnittest.TestMessageSetExtension1.Builder().mergeFrom(codedInputStream: codedInputStream, extensionRegistry:extensionRegistry).build()
    }
    public subscript(key: String) -> Any? {
        switch key {
        case "i": return self.i
        default: return nil
        }
    }
}
extension ProtobufUnittest.TestMessageSetExtension1.Builder: GeneratedMessageBuilderProtocol {
    public typealias GeneratedMessageType = ProtobufUnittest.TestMessageSetExtension1
    public subscript(key: String) -> Any? {
        get { 
            switch key {
            case "i": return self.i
            default: return nil
            }
        }
        set (newSubscriptValue) { 
            switch key {
            case "i":
                guard let newSubscriptValue = newSubscriptValue as? Int32 else {
                    return
                }
                self.i = newSubscriptValue
            default: return
            }
        }
    }
}
extension ProtobufUnittest.TestMessageSetExtension2: GeneratedMessageProtocol {
    public class func parseArrayDelimitedFrom(inputStream: InputStream) throws -> Array<ProtobufUnittest.TestMessageSetExtension2> {
        var mergedArray = Array<ProtobufUnittest.TestMessageSetExtension2>()
        while let value = try parseDelimitedFrom(inputStream: inputStream) {
          mergedArray.append(value)
        }
        return mergedArray
    }
    public class func parseDelimitedFrom(inputStream: InputStream) throws -> ProtobufUnittest.TestMessageSetExtension2? {
        return try ProtobufUnittest.TestMessageSetExtension2.Builder().mergeDelimitedFrom(inputStream: inputStream)?.build()
    }
    public class func parseFrom(data: Data) throws -> ProtobufUnittest.TestMessageSetExtension2 {
        return try ProtobufUnittest.TestMessageSetExtension2.Builder().mergeFrom(data: data, extensionRegistry:ProtobufUnittest.UnittestMsetRoot.default.extensionRegistry).build()
    }
    public class func parseFrom(data: Data, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSetExtension2 {
        return try ProtobufUnittest.TestMessageSetExtension2.Builder().mergeFrom(data: data, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(inputStream: InputStream) throws -> ProtobufUnittest.TestMessageSetExtension2 {
        return try ProtobufUnittest.TestMessageSetExtension2.Builder().mergeFrom(inputStream: inputStream).build()
    }
    public class func parseFrom(inputStream: InputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSetExtension2 {
        return try ProtobufUnittest.TestMessageSetExtension2.Builder().mergeFrom(inputStream: inputStream, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream) throws -> ProtobufUnittest.TestMessageSetExtension2 {
        return try ProtobufUnittest.TestMessageSetExtension2.Builder().mergeFrom(codedInputStream: codedInputStream).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.TestMessageSetExtension2 {
        return try ProtobufUnittest.TestMessageSetExtension2.Builder().mergeFrom(codedInputStream: codedInputStream, extensionRegistry:extensionRegistry).build()
    }
    public subscript(key: String) -> Any? {
        switch key {
        case "str": return self.str
        default: return nil
        }
    }
}
extension ProtobufUnittest.TestMessageSetExtension2.Builder: GeneratedMessageBuilderProtocol {
    public typealias GeneratedMessageType = ProtobufUnittest.TestMessageSetExtension2
    public subscript(key: String) -> Any? {
        get { 
            switch key {
            case "str": return self.str
            default: return nil
            }
        }
        set (newSubscriptValue) { 
            switch key {
            case "str":
                guard let newSubscriptValue = newSubscriptValue as? String else {
                    return
                }
                self.str = newSubscriptValue
            default: return
            }
        }
    }
}
extension ProtobufUnittest.RawMessageSet: GeneratedMessageProtocol {
    public class func parseArrayDelimitedFrom(inputStream: InputStream) throws -> Array<ProtobufUnittest.RawMessageSet> {
        var mergedArray = Array<ProtobufUnittest.RawMessageSet>()
        while let value = try parseDelimitedFrom(inputStream: inputStream) {
          mergedArray.append(value)
        }
        return mergedArray
    }
    public class func parseDelimitedFrom(inputStream: InputStream) throws -> ProtobufUnittest.RawMessageSet? {
        return try ProtobufUnittest.RawMessageSet.Builder().mergeDelimitedFrom(inputStream: inputStream)?.build()
    }
    public class func parseFrom(data: Data) throws -> ProtobufUnittest.RawMessageSet {
        return try ProtobufUnittest.RawMessageSet.Builder().mergeFrom(data: data, extensionRegistry:ProtobufUnittest.UnittestMsetRoot.default.extensionRegistry).build()
    }
    public class func parseFrom(data: Data, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.RawMessageSet {
        return try ProtobufUnittest.RawMessageSet.Builder().mergeFrom(data: data, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(inputStream: InputStream) throws -> ProtobufUnittest.RawMessageSet {
        return try ProtobufUnittest.RawMessageSet.Builder().mergeFrom(inputStream: inputStream).build()
    }
    public class func parseFrom(inputStream: InputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.RawMessageSet {
        return try ProtobufUnittest.RawMessageSet.Builder().mergeFrom(inputStream: inputStream, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream) throws -> ProtobufUnittest.RawMessageSet {
        return try ProtobufUnittest.RawMessageSet.Builder().mergeFrom(codedInputStream: codedInputStream).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.RawMessageSet {
        return try ProtobufUnittest.RawMessageSet.Builder().mergeFrom(codedInputStream: codedInputStream, extensionRegistry:extensionRegistry).build()
    }
    public subscript(key: String) -> Any? {
        switch key {
        case "item": return self.item
        default: return nil
        }
    }
}
extension ProtobufUnittest.RawMessageSet.Item: GeneratedMessageProtocol {
    public class func parseArrayDelimitedFrom(inputStream: InputStream) throws -> Array<ProtobufUnittest.RawMessageSet.Item> {
        var mergedArray = Array<ProtobufUnittest.RawMessageSet.Item>()
        while let value = try parseDelimitedFrom(inputStream: inputStream) {
          mergedArray.append(value)
        }
        return mergedArray
    }
    public class func parseDelimitedFrom(inputStream: InputStream) throws -> ProtobufUnittest.RawMessageSet.Item? {
        return try ProtobufUnittest.RawMessageSet.Item.Builder().mergeDelimitedFrom(inputStream: inputStream)?.build()
    }
    public class func parseFrom(data: Data) throws -> ProtobufUnittest.RawMessageSet.Item {
        return try ProtobufUnittest.RawMessageSet.Item.Builder().mergeFrom(data: data, extensionRegistry:ProtobufUnittest.UnittestMsetRoot.default.extensionRegistry).build()
    }
    public class func parseFrom(data: Data, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.RawMessageSet.Item {
        return try ProtobufUnittest.RawMessageSet.Item.Builder().mergeFrom(data: data, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(inputStream: InputStream) throws -> ProtobufUnittest.RawMessageSet.Item {
        return try ProtobufUnittest.RawMessageSet.Item.Builder().mergeFrom(inputStream: inputStream).build()
    }
    public class func parseFrom(inputStream: InputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.RawMessageSet.Item {
        return try ProtobufUnittest.RawMessageSet.Item.Builder().mergeFrom(inputStream: inputStream, extensionRegistry:extensionRegistry).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream) throws -> ProtobufUnittest.RawMessageSet.Item {
        return try ProtobufUnittest.RawMessageSet.Item.Builder().mergeFrom(codedInputStream: codedInputStream).build()
    }
    public class func parseFrom(codedInputStream: CodedInputStream, extensionRegistry:ExtensionRegistry) throws -> ProtobufUnittest.RawMessageSet.Item {
        return try ProtobufUnittest.RawMessageSet.Item.Builder().mergeFrom(codedInputStream: codedInputStream, extensionRegistry:extensionRegistry).build()
    }
    public subscript(key: String) -> Any? {
        switch key {
        case "typeId": return self.typeId
        case "message": return self.message
        default: return nil
        }
    }
}
extension ProtobufUnittest.RawMessageSet.Builder: GeneratedMessageBuilderProtocol {
    public typealias GeneratedMessageType = ProtobufUnittest.RawMessageSet
    public subscript(key: String) -> Any? {
        get { 
            switch key {
            case "item": return self.item
            default: return nil
            }
        }
        set (newSubscriptValue) { 
            switch key {
            case "item":
                guard let newSubscriptValue = newSubscriptValue as? Array<ProtobufUnittest.RawMessageSet.Item> else {
                    return
                }
                self.item = newSubscriptValue
            default: return
            }
        }
    }
}
extension ProtobufUnittest.RawMessageSet.Item.Builder: GeneratedMessageBuilderProtocol {
    public typealias GeneratedMessageType = ProtobufUnittest.RawMessageSet.Item
    public subscript(key: String) -> Any? {
        get { 
            switch key {
            case "typeId": return self.typeId
            case "message": return self.message
            default: return nil
            }
        }
        set (newSubscriptValue) { 
            switch key {
            case "typeId":
                guard let newSubscriptValue = newSubscriptValue as? Int32 else {
                    return
                }
                self.typeId = newSubscriptValue
            case "message":
                guard let newSubscriptValue = newSubscriptValue as? Data else {
                    return
                }
                self.message = newSubscriptValue
            default: return
            }
        }
    }
}

// @@protoc_insertion_point(global_scope)
