csharptest | 35b6852 | 2011-05-20 12:22:21 -0500 | [diff] [blame] | 1 | // Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT!
|
Jon Skeet | 82bb0f1 | 2011-04-03 20:17:12 +0100 | [diff] [blame] | 2 |
|
| 3 | using pb = global::Google.ProtocolBuffers;
|
| 4 | using pbc = global::Google.ProtocolBuffers.Collections;
|
| 5 | using pbd = global::Google.ProtocolBuffers.Descriptors;
|
| 6 | using scg = global::System.Collections.Generic;
|
| 7 | namespace Google.ProtocolBuffers.TestProtos {
|
| 8 |
|
| 9 | public static partial class UnitTestImportLiteProtoFile {
|
| 10 |
|
| 11 | #region Extension registration
|
| 12 | public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
|
| 13 | }
|
| 14 | #endregion
|
| 15 | #region Static variables
|
| 16 | #endregion
|
| 17 | #region Extensions
|
| 18 | internal static readonly object Descriptor;
|
| 19 | static UnitTestImportLiteProtoFile() {
|
| 20 | Descriptor = null;
|
| 21 | }
|
| 22 | #endregion
|
| 23 |
|
| 24 | }
|
| 25 | #region Enums
|
| 26 | public enum ImportEnumLite {
|
| 27 | IMPORT_LITE_FOO = 7,
|
| 28 | IMPORT_LITE_BAR = 8,
|
| 29 | IMPORT_LITE_BAZ = 9,
|
| 30 | }
|
| 31 |
|
| 32 | #endregion
|
| 33 |
|
| 34 | #region Messages
|
| 35 | public sealed partial class ImportMessageLite : pb::GeneratedMessageLite<ImportMessageLite, ImportMessageLite.Builder> {
|
| 36 | private static readonly ImportMessageLite defaultInstance = new Builder().BuildPartial();
|
| 37 | public static ImportMessageLite DefaultInstance {
|
| 38 | get { return defaultInstance; }
|
| 39 | }
|
| 40 |
|
| 41 | public override ImportMessageLite DefaultInstanceForType {
|
| 42 | get { return defaultInstance; }
|
| 43 | }
|
| 44 |
|
| 45 | protected override ImportMessageLite ThisMessage {
|
| 46 | get { return this; }
|
| 47 | }
|
| 48 |
|
| 49 | public const int DFieldNumber = 1;
|
| 50 | private bool hasD;
|
| 51 | private int d_ = 0;
|
| 52 | public bool HasD {
|
| 53 | get { return hasD; }
|
| 54 | }
|
| 55 | public int D {
|
| 56 | get { return d_; }
|
| 57 | }
|
| 58 |
|
| 59 | public override bool IsInitialized {
|
| 60 | get {
|
| 61 | return true;
|
| 62 | }
|
| 63 | }
|
| 64 |
|
| 65 | public override void WriteTo(pb::CodedOutputStream output) {
|
| 66 | int size = SerializedSize;
|
| 67 | if (HasD) {
|
| 68 | output.WriteInt32(1, D);
|
| 69 | }
|
| 70 | }
|
| 71 |
|
| 72 | private int memoizedSerializedSize = -1;
|
| 73 | public override int SerializedSize {
|
| 74 | get {
|
| 75 | int size = memoizedSerializedSize;
|
| 76 | if (size != -1) return size;
|
| 77 |
|
| 78 | size = 0;
|
| 79 | if (HasD) {
|
| 80 | size += pb::CodedOutputStream.ComputeInt32Size(1, D);
|
| 81 | }
|
| 82 | memoizedSerializedSize = size;
|
| 83 | return size;
|
| 84 | }
|
| 85 | }
|
| 86 |
|
| 87 | #region Lite runtime methods
|
| 88 | public override int GetHashCode() {
|
| 89 | int hash = GetType().GetHashCode();
|
| 90 | if (hasD) hash ^= d_.GetHashCode();
|
| 91 | return hash;
|
| 92 | }
|
| 93 |
|
| 94 | public override bool Equals(object obj) {
|
| 95 | ImportMessageLite other = obj as ImportMessageLite;
|
| 96 | if (other == null) return false;
|
| 97 | if (hasD != other.hasD || (hasD && !d_.Equals(other.d_))) return false;
|
| 98 | return true;
|
| 99 | }
|
| 100 |
|
| 101 | public override void PrintTo(global::System.IO.TextWriter writer) {
|
| 102 | PrintField("d", hasD, d_, writer);
|
| 103 | }
|
| 104 | #endregion
|
| 105 |
|
| 106 | public static ImportMessageLite ParseFrom(pb::ByteString data) {
|
| 107 | return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
| 108 | }
|
| 109 | public static ImportMessageLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
|
| 110 | return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
| 111 | }
|
| 112 | public static ImportMessageLite ParseFrom(byte[] data) {
|
| 113 | return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
| 114 | }
|
| 115 | public static ImportMessageLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
|
| 116 | return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
| 117 | }
|
| 118 | public static ImportMessageLite ParseFrom(global::System.IO.Stream input) {
|
| 119 | return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
| 120 | }
|
| 121 | public static ImportMessageLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
| 122 | return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
| 123 | }
|
| 124 | public static ImportMessageLite ParseDelimitedFrom(global::System.IO.Stream input) {
|
| 125 | return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
|
| 126 | }
|
| 127 | public static ImportMessageLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
| 128 | return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
|
| 129 | }
|
| 130 | public static ImportMessageLite ParseFrom(pb::CodedInputStream input) {
|
| 131 | return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
| 132 | }
|
| 133 | public static ImportMessageLite ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
| 134 | return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
| 135 | }
|
| 136 | public static Builder CreateBuilder() { return new Builder(); }
|
| 137 | public override Builder ToBuilder() { return CreateBuilder(this); }
|
| 138 | public override Builder CreateBuilderForType() { return new Builder(); }
|
| 139 | public static Builder CreateBuilder(ImportMessageLite prototype) {
|
| 140 | return (Builder) new Builder().MergeFrom(prototype);
|
| 141 | }
|
| 142 |
|
| 143 | public sealed partial class Builder : pb::GeneratedBuilderLite<ImportMessageLite, Builder> {
|
| 144 | protected override Builder ThisBuilder {
|
| 145 | get { return this; }
|
| 146 | }
|
| 147 | public Builder() {}
|
| 148 |
|
| 149 | ImportMessageLite result = new ImportMessageLite();
|
| 150 |
|
| 151 | protected override ImportMessageLite MessageBeingBuilt {
|
| 152 | get { return result; }
|
| 153 | }
|
| 154 |
|
| 155 | public override Builder Clear() {
|
| 156 | result = new ImportMessageLite();
|
| 157 | return this;
|
| 158 | }
|
| 159 |
|
| 160 | public override Builder Clone() {
|
| 161 | return new Builder().MergeFrom(result);
|
| 162 | }
|
| 163 |
|
| 164 | public override ImportMessageLite DefaultInstanceForType {
|
| 165 | get { return global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance; }
|
| 166 | }
|
| 167 |
|
| 168 | public override ImportMessageLite BuildPartial() {
|
| 169 | if (result == null) {
|
| 170 | throw new global::System.InvalidOperationException("build() has already been called on this Builder");
|
| 171 | }
|
| 172 | ImportMessageLite returnMe = result;
|
| 173 | result = null;
|
| 174 | return returnMe;
|
| 175 | }
|
| 176 |
|
| 177 | public override Builder MergeFrom(pb::IMessageLite other) {
|
| 178 | if (other is ImportMessageLite) {
|
| 179 | return MergeFrom((ImportMessageLite) other);
|
| 180 | } else {
|
| 181 | base.MergeFrom(other);
|
| 182 | return this;
|
| 183 | }
|
| 184 | }
|
| 185 |
|
| 186 | public override Builder MergeFrom(ImportMessageLite other) {
|
| 187 | if (other == global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance) return this;
|
| 188 | if (other.HasD) {
|
| 189 | D = other.D;
|
| 190 | }
|
| 191 | return this;
|
| 192 | }
|
| 193 |
|
| 194 | public override Builder MergeFrom(pb::CodedInputStream input) {
|
| 195 | return MergeFrom(input, pb::ExtensionRegistry.Empty);
|
| 196 | }
|
| 197 |
|
| 198 | public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
| 199 | while (true) {
|
| 200 | uint tag = input.ReadTag();
|
| 201 | switch (tag) {
|
| 202 | case 0: {
|
| 203 | return this;
|
| 204 | }
|
| 205 | default: {
|
| 206 | if (pb::WireFormat.IsEndGroupTag(tag)) {
|
| 207 | return this;
|
| 208 | }
|
| 209 | ParseUnknownField(input, extensionRegistry, tag);
|
| 210 | break;
|
| 211 | }
|
| 212 | case 8: {
|
| 213 | D = input.ReadInt32();
|
| 214 | break;
|
| 215 | }
|
| 216 | }
|
| 217 | }
|
| 218 | }
|
| 219 |
|
| 220 |
|
| 221 | public bool HasD {
|
| 222 | get { return result.HasD; }
|
| 223 | }
|
| 224 | public int D {
|
| 225 | get { return result.D; }
|
| 226 | set { SetD(value); }
|
| 227 | }
|
| 228 | public Builder SetD(int value) {
|
| 229 | result.hasD = true;
|
| 230 | result.d_ = value;
|
| 231 | return this;
|
| 232 | }
|
| 233 | public Builder ClearD() {
|
| 234 | result.hasD = false;
|
| 235 | result.d_ = 0;
|
| 236 | return this;
|
| 237 | }
|
| 238 | }
|
| 239 | static ImportMessageLite() {
|
| 240 | object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestImportLiteProtoFile.Descriptor, null);
|
| 241 | }
|
| 242 | }
|
| 243 |
|
| 244 | #endregion
|
| 245 |
|
| 246 | }
|