java_mutable_features.pb.swift 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. // swiftlint:disable all
  4. //
  5. // Generated by the Swift generator plugin for the protocol buffer compiler.
  6. // Source: google/protobuf/java_mutable_features.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. import SwiftProtobuf
  11. // If the compiler emits an error on this type, it is because this file
  12. // was generated by a version of the `protoc` Swift plug-in that is
  13. // incompatible with the version of SwiftProtobuf to which you are linking.
  14. // Please ensure that you are building against the same version of the API
  15. // that was used to generate this file.
  16. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  17. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  18. typealias Version = _2
  19. }
  20. struct Pb_JavaMutableFeatures: Sendable {
  21. // SwiftProtobuf.Message conformance is added in an extension below. See the
  22. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  23. // methods supported on all messages.
  24. /// Whether to nest the generated class in the generated file class for
  25. /// Java Proto2 Mutable API. This is only available at the file level.
  26. var nestInFileClass: Pb_JavaMutableFeatures.NestInFileClassFeature.NestInFileClass {
  27. get {_nestInFileClass ?? .unknown}
  28. set {_nestInFileClass = newValue}
  29. }
  30. /// Returns true if `nestInFileClass` has been explicitly set.
  31. var hasNestInFileClass: Bool {self._nestInFileClass != nil}
  32. /// Clears the value of `nestInFileClass`. Subsequent reads from it will return its default value.
  33. mutating func clearNestInFileClass() {self._nestInFileClass = nil}
  34. var unknownFields = SwiftProtobuf.UnknownStorage()
  35. struct NestInFileClassFeature: Sendable {
  36. // SwiftProtobuf.Message conformance is added in an extension below. See the
  37. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  38. // methods supported on all messages.
  39. var unknownFields = SwiftProtobuf.UnknownStorage()
  40. enum NestInFileClass: Int, SwiftProtobuf.Enum, Swift.CaseIterable {
  41. /// Invalid default, which should never be used.
  42. case unknown = 0
  43. /// Do not nest the generated class in the file class.
  44. case no = 1
  45. /// Nest the generated class in the file class.
  46. case yes = 2
  47. /// Fall back to the `java_multiple_files` and
  48. /// `java_multiple_files_mutable_package` options. Users won't be able to
  49. /// set this option.
  50. case legacy = 3
  51. init() {
  52. self = .unknown
  53. }
  54. }
  55. init() {}
  56. }
  57. init() {}
  58. fileprivate var _nestInFileClass: Pb_JavaMutableFeatures.NestInFileClassFeature.NestInFileClass? = nil
  59. }
  60. // MARK: - Extension support defined in java_mutable_features.proto.
  61. // MARK: - Extension Properties
  62. // Swift Extensions on the extended Messages to add easy access to the declared
  63. // extension fields. The names are based on the extension field name from the proto
  64. // declaration. To avoid naming collisions, the names are prefixed with the name of
  65. // the scope where the extend directive occurs.
  66. extension SwiftProtobuf.Google_Protobuf_FeatureSet {
  67. var Pb_javaMutable: Pb_JavaMutableFeatures {
  68. get {return getExtensionValue(ext: Pb_Extensions_java_mutable) ?? Pb_JavaMutableFeatures()}
  69. set {setExtensionValue(ext: Pb_Extensions_java_mutable, value: newValue)}
  70. }
  71. /// Returns true if extension `Pb_Extensions_java_mutable`
  72. /// has been explicitly set.
  73. var hasPb_javaMutable: Bool {
  74. return hasExtensionValue(ext: Pb_Extensions_java_mutable)
  75. }
  76. /// Clears the value of extension `Pb_Extensions_java_mutable`.
  77. /// Subsequent reads from it will return its default value.
  78. mutating func clearPb_javaMutable() {
  79. clearExtensionValue(ext: Pb_Extensions_java_mutable)
  80. }
  81. }
  82. // MARK: - File's ExtensionMap: Pb_JavaMutableFeatures_Extensions
  83. /// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by
  84. /// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed
  85. /// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create
  86. /// a larger `SwiftProtobuf.SimpleExtensionMap`.
  87. let Pb_JavaMutableFeatures_Extensions: SwiftProtobuf.SimpleExtensionMap = [
  88. Pb_Extensions_java_mutable
  89. ]
  90. // Extension Objects - The only reason these might be needed is when manually
  91. // constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_
  92. // accessors for the extension fields on the messages directly.
  93. let Pb_Extensions_java_mutable = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalMessageExtensionField<Pb_JavaMutableFeatures>, SwiftProtobuf.Google_Protobuf_FeatureSet>(
  94. _protobuf_fieldNumber: 9989,
  95. fieldName: "pb.java_mutable"
  96. )
  97. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  98. fileprivate let _protobuf_package = "pb"
  99. extension Pb_JavaMutableFeatures: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  100. static let protoMessageName: String = _protobuf_package + ".JavaMutableFeatures"
  101. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{4}\u{6}nest_in_file_class\0")
  102. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  103. while let fieldNumber = try decoder.nextFieldNumber() {
  104. // The use of inline closures is to circumvent an issue where the compiler
  105. // allocates stack space for every case branch when no optimizations are
  106. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  107. switch fieldNumber {
  108. case 6: try { try decoder.decodeSingularEnumField(value: &self._nestInFileClass) }()
  109. default: break
  110. }
  111. }
  112. }
  113. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  114. // The use of inline closures is to circumvent an issue where the compiler
  115. // allocates stack space for every if/case branch local when no optimizations
  116. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  117. // https://github.com/apple/swift-protobuf/issues/1182
  118. try { if let v = self._nestInFileClass {
  119. try visitor.visitSingularEnumField(value: v, fieldNumber: 6)
  120. } }()
  121. try unknownFields.traverse(visitor: &visitor)
  122. }
  123. static func ==(lhs: Pb_JavaMutableFeatures, rhs: Pb_JavaMutableFeatures) -> Bool {
  124. if lhs._nestInFileClass != rhs._nestInFileClass {return false}
  125. if lhs.unknownFields != rhs.unknownFields {return false}
  126. return true
  127. }
  128. }
  129. extension Pb_JavaMutableFeatures.NestInFileClassFeature: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  130. static let protoMessageName: String = Pb_JavaMutableFeatures.protoMessageName + ".NestInFileClassFeature"
  131. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{c}\u{1}\u{7f}\u{7f}\u{7f}\u{7f}\u{1f}")
  132. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  133. // Load everything into unknown fields
  134. while try decoder.nextFieldNumber() != nil {}
  135. }
  136. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  137. try unknownFields.traverse(visitor: &visitor)
  138. }
  139. static func ==(lhs: Pb_JavaMutableFeatures.NestInFileClassFeature, rhs: Pb_JavaMutableFeatures.NestInFileClassFeature) -> Bool {
  140. if lhs.unknownFields != rhs.unknownFields {return false}
  141. return true
  142. }
  143. }
  144. extension Pb_JavaMutableFeatures.NestInFileClassFeature.NestInFileClass: SwiftProtobuf._ProtoNameProviding {
  145. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0NEST_IN_FILE_CLASS_UNKNOWN\0\u{1}NO\0\u{1}YES\0\u{1}LEGACY\0")
  146. }