/*
 Copyright 2013-2015 Jason Leyba

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: test_proto.proto

package com.github.jsdossier.soy;

public final class TestProto {
  private TestProto() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
  }
  /**
   * Protobuf enum {@code test.Color}
   */
  public enum Color
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * <code>RED = 0;</code>
     */
    RED(0, 0),
    /**
     * <code>BLUE = 1;</code>
     */
    BLUE(1, 1),
    /**
     * <code>GREEN = 2;</code>
     */
    GREEN(2, 2),
    ;

    /**
     * <code>RED = 0;</code>
     */
    public static final int RED_VALUE = 0;
    /**
     * <code>BLUE = 1;</code>
     */
    public static final int BLUE_VALUE = 1;
    /**
     * <code>GREEN = 2;</code>
     */
    public static final int GREEN_VALUE = 2;


    public final int getNumber() { return value; }

    public static Color valueOf(int value) {
      switch (value) {
        case 0: return RED;
        case 1: return BLUE;
        case 2: return GREEN;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<Color>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static com.google.protobuf.Internal.EnumLiteMap<Color>
        internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<Color>() {
            public Color findValueByNumber(int number) {
              return Color.valueOf(number);
            }
          };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
        getValueDescriptor() {
      return getDescriptor().getValues().get(index);
    }
    public final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptorForType() {
      return getDescriptor();
    }
    public static final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptor() {
      return com.github.jsdossier.soy.TestProto.getDescriptor().getEnumTypes().get(0);
    }

    private static final Color[] VALUES = values();

    public static Color valueOf(
        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException(
          "EnumValueDescriptor is not for this type.");
      }
      return VALUES[desc.getIndex()];
    }

    private final int index;
    private final int value;

    private Color(int index, int value) {
      this.index = index;
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:test.Color)
  }

  /**
   * Protobuf enum {@code test.Fruit}
   */
  public enum Fruit
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * <code>APPLE = 1;</code>
     */
    APPLE(0, 1),
    /**
     * <code>ORANGE = 2;</code>
     */
    ORANGE(1, 2),
    ;

    /**
     * <code>APPLE = 1;</code>
     */
    public static final int APPLE_VALUE = 1;
    /**
     * <code>ORANGE = 2;</code>
     */
    public static final int ORANGE_VALUE = 2;


    public final int getNumber() { return value; }

    public static Fruit valueOf(int value) {
      switch (value) {
        case 1: return APPLE;
        case 2: return ORANGE;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<Fruit>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static com.google.protobuf.Internal.EnumLiteMap<Fruit>
        internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<Fruit>() {
            public Fruit findValueByNumber(int number) {
              return Fruit.valueOf(number);
            }
          };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
        getValueDescriptor() {
      return getDescriptor().getValues().get(index);
    }
    public final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptorForType() {
      return getDescriptor();
    }
    public static final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptor() {
      return com.github.jsdossier.soy.TestProto.getDescriptor().getEnumTypes().get(1);
    }

    private static final Fruit[] VALUES = values();

    public static Fruit valueOf(
        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException(
          "EnumValueDescriptor is not for this type.");
      }
      return VALUES[desc.getIndex()];
    }

    private final int index;
    private final int value;

    private Fruit(int index, int value) {
      this.index = index;
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:test.Fruit)
  }

  public interface OrderOrBuilder extends
      // @@protoc_insertion_point(interface_extends:test.Order)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <code>optional bool bool_field = 1;</code>
     */
    boolean hasBoolField();
    /**
     * <code>optional bool bool_field = 1;</code>
     */
    boolean getBoolField();

    /**
     * <code>optional int32 int_field = 2;</code>
     */
    boolean hasIntField();
    /**
     * <code>optional int32 int_field = 2;</code>
     */
    int getIntField();

    /**
     * <code>optional string string_field = 3;</code>
     */
    boolean hasStringField();
    /**
     * <code>optional string string_field = 3;</code>
     */
    java.lang.String getStringField();
    /**
     * <code>optional string string_field = 3;</code>
     */
    com.google.protobuf.ByteString
        getStringFieldBytes();

    /**
     * <code>optional .test.Fruit fruit = 4;</code>
     */
    boolean hasFruit();
    /**
     * <code>optional .test.Fruit fruit = 4;</code>
     */
    com.github.jsdossier.soy.TestProto.Fruit getFruit();

    /**
     * <code>optional .test.Color color = 5;</code>
     */
    boolean hasColor();
    /**
     * <code>optional .test.Color color = 5;</code>
     */
    com.github.jsdossier.soy.TestProto.Color getColor();

    /**
     * <code>repeated int32 repeated_int = 6;</code>
     */
    java.util.List<java.lang.Integer> getRepeatedIntList();
    /**
     * <code>repeated int32 repeated_int = 6;</code>
     */
    int getRepeatedIntCount();
    /**
     * <code>repeated int32 repeated_int = 6;</code>
     */
    int getRepeatedInt(int index);

    /**
     * <code>repeated .test.Color repeated_color = 7;</code>
     */
    java.util.List<com.github.jsdossier.soy.TestProto.Color> getRepeatedColorList();
    /**
     * <code>repeated .test.Color repeated_color = 7;</code>
     */
    int getRepeatedColorCount();
    /**
     * <code>repeated .test.Color repeated_color = 7;</code>
     */
    com.github.jsdossier.soy.TestProto.Color getRepeatedColor(int index);

    /**
     * <code>optional string html_field = 8;</code>
     */
    boolean hasHtmlField();
    /**
     * <code>optional string html_field = 8;</code>
     */
    java.lang.String getHtmlField();
    /**
     * <code>optional string html_field = 8;</code>
     */
    com.google.protobuf.ByteString
        getHtmlFieldBytes();
  }
  /**
   * Protobuf type {@code test.Order}
   */
  public static final class Order extends
      com.google.protobuf.GeneratedMessage implements
      // @@protoc_insertion_point(message_implements:test.Order)
      OrderOrBuilder {
    // Use Order.newBuilder() to construct.
    private Order(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private Order(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final Order defaultInstance;
    public static Order getDefaultInstance() {
      return defaultInstance;
    }

    public Order getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private Order(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 8: {
              bitField0_ |= 0x00000001;
              boolField_ = input.readBool();
              break;
            }
            case 16: {
              bitField0_ |= 0x00000002;
              intField_ = input.readInt32();
              break;
            }
            case 26: {
              com.google.protobuf.ByteString bs = input.readBytes();
              bitField0_ |= 0x00000004;
              stringField_ = bs;
              break;
            }
            case 32: {
              int rawValue = input.readEnum();
              com.github.jsdossier.soy.TestProto.Fruit value = com.github.jsdossier.soy.TestProto.Fruit.valueOf(rawValue);
              if (value == null) {
                unknownFields.mergeVarintField(4, rawValue);
              } else {
                bitField0_ |= 0x00000008;
                fruit_ = value;
              }
              break;
            }
            case 40: {
              int rawValue = input.readEnum();
              com.github.jsdossier.soy.TestProto.Color value = com.github.jsdossier.soy.TestProto.Color.valueOf(rawValue);
              if (value == null) {
                unknownFields.mergeVarintField(5, rawValue);
              } else {
                bitField0_ |= 0x00000010;
                color_ = value;
              }
              break;
            }
            case 48: {
              if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
                repeatedInt_ = new java.util.ArrayList<java.lang.Integer>();
                mutable_bitField0_ |= 0x00000020;
              }
              repeatedInt_.add(input.readInt32());
              break;
            }
            case 50: {
              int length = input.readRawVarint32();
              int limit = input.pushLimit(length);
              if (!((mutable_bitField0_ & 0x00000020) == 0x00000020) && input.getBytesUntilLimit() > 0) {
                repeatedInt_ = new java.util.ArrayList<java.lang.Integer>();
                mutable_bitField0_ |= 0x00000020;
              }
              while (input.getBytesUntilLimit() > 0) {
                repeatedInt_.add(input.readInt32());
              }
              input.popLimit(limit);
              break;
            }
            case 56: {
              int rawValue = input.readEnum();
              com.github.jsdossier.soy.TestProto.Color value = com.github.jsdossier.soy.TestProto.Color.valueOf(rawValue);
              if (value == null) {
                unknownFields.mergeVarintField(7, rawValue);
                } else {
                if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
                  repeatedColor_ = new java.util.ArrayList<com.github.jsdossier.soy.TestProto.Color>();
                  mutable_bitField0_ |= 0x00000040;
                }
                repeatedColor_.add(value);
              }
              break;
            }
            case 58: {
              int length = input.readRawVarint32();
              int oldLimit = input.pushLimit(length);
              while(input.getBytesUntilLimit() > 0) {
                int rawValue = input.readEnum();
                com.github.jsdossier.soy.TestProto.Color value = com.github.jsdossier.soy.TestProto.Color.valueOf(rawValue);
                if (value == null) {
                  unknownFields.mergeVarintField(7, rawValue);
                  } else {
                  if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
                    repeatedColor_ = new java.util.ArrayList<com.github.jsdossier.soy.TestProto.Color>();
                    mutable_bitField0_ |= 0x00000040;
                  }
                  repeatedColor_.add(value);
                }
              }
              input.popLimit(oldLimit);
              break;
            }
            case 66: {
              com.google.protobuf.ByteString bs = input.readBytes();
              bitField0_ |= 0x00000020;
              htmlField_ = bs;
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
          repeatedInt_ = java.util.Collections.unmodifiableList(repeatedInt_);
        }
        if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
          repeatedColor_ = java.util.Collections.unmodifiableList(repeatedColor_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.github.jsdossier.soy.TestProto.internal_static_test_Order_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.github.jsdossier.soy.TestProto.internal_static_test_Order_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.github.jsdossier.soy.TestProto.Order.class, com.github.jsdossier.soy.TestProto.Order.Builder.class);
    }

    public static com.google.protobuf.Parser<Order> PARSER =
        new com.google.protobuf.AbstractParser<Order>() {
      public Order parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new Order(input, extensionRegistry);
      }
    };

    @java.lang.Override
    public com.google.protobuf.Parser<Order> getParserForType() {
      return PARSER;
    }

    private int bitField0_;
    public static final int BOOL_FIELD_FIELD_NUMBER = 1;
    private boolean boolField_;
    /**
     * <code>optional bool bool_field = 1;</code>
     */
    public boolean hasBoolField() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>optional bool bool_field = 1;</code>
     */
    public boolean getBoolField() {
      return boolField_;
    }

    public static final int INT_FIELD_FIELD_NUMBER = 2;
    private int intField_;
    /**
     * <code>optional int32 int_field = 2;</code>
     */
    public boolean hasIntField() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional int32 int_field = 2;</code>
     */
    public int getIntField() {
      return intField_;
    }

    public static final int STRING_FIELD_FIELD_NUMBER = 3;
    private java.lang.Object stringField_;
    /**
     * <code>optional string string_field = 3;</code>
     */
    public boolean hasStringField() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional string string_field = 3;</code>
     */
    public java.lang.String getStringField() {
      java.lang.Object ref = stringField_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          stringField_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string string_field = 3;</code>
     */
    public com.google.protobuf.ByteString
        getStringFieldBytes() {
      java.lang.Object ref = stringField_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        stringField_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int FRUIT_FIELD_NUMBER = 4;
    private com.github.jsdossier.soy.TestProto.Fruit fruit_;
    /**
     * <code>optional .test.Fruit fruit = 4;</code>
     */
    public boolean hasFruit() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    /**
     * <code>optional .test.Fruit fruit = 4;</code>
     */
    public com.github.jsdossier.soy.TestProto.Fruit getFruit() {
      return fruit_;
    }

    public static final int COLOR_FIELD_NUMBER = 5;
    private com.github.jsdossier.soy.TestProto.Color color_;
    /**
     * <code>optional .test.Color color = 5;</code>
     */
    public boolean hasColor() {
      return ((bitField0_ & 0x00000010) == 0x00000010);
    }
    /**
     * <code>optional .test.Color color = 5;</code>
     */
    public com.github.jsdossier.soy.TestProto.Color getColor() {
      return color_;
    }

    public static final int REPEATED_INT_FIELD_NUMBER = 6;
    private java.util.List<java.lang.Integer> repeatedInt_;
    /**
     * <code>repeated int32 repeated_int = 6;</code>
     */
    public java.util.List<java.lang.Integer>
        getRepeatedIntList() {
      return repeatedInt_;
    }
    /**
     * <code>repeated int32 repeated_int = 6;</code>
     */
    public int getRepeatedIntCount() {
      return repeatedInt_.size();
    }
    /**
     * <code>repeated int32 repeated_int = 6;</code>
     */
    public int getRepeatedInt(int index) {
      return repeatedInt_.get(index);
    }

    public static final int REPEATED_COLOR_FIELD_NUMBER = 7;
    private java.util.List<com.github.jsdossier.soy.TestProto.Color> repeatedColor_;
    /**
     * <code>repeated .test.Color repeated_color = 7;</code>
     */
    public java.util.List<com.github.jsdossier.soy.TestProto.Color> getRepeatedColorList() {
      return repeatedColor_;
    }
    /**
     * <code>repeated .test.Color repeated_color = 7;</code>
     */
    public int getRepeatedColorCount() {
      return repeatedColor_.size();
    }
    /**
     * <code>repeated .test.Color repeated_color = 7;</code>
     */
    public com.github.jsdossier.soy.TestProto.Color getRepeatedColor(int index) {
      return repeatedColor_.get(index);
    }

    public static final int HTML_FIELD_FIELD_NUMBER = 8;
    private java.lang.Object htmlField_;
    /**
     * <code>optional string html_field = 8;</code>
     */
    public boolean hasHtmlField() {
      return ((bitField0_ & 0x00000020) == 0x00000020);
    }
    /**
     * <code>optional string html_field = 8;</code>
     */
    public java.lang.String getHtmlField() {
      java.lang.Object ref = htmlField_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          htmlField_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string html_field = 8;</code>
     */
    public com.google.protobuf.ByteString
        getHtmlFieldBytes() {
      java.lang.Object ref = htmlField_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        htmlField_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    private void initFields() {
      boolField_ = false;
      intField_ = 0;
      stringField_ = "";
      fruit_ = com.github.jsdossier.soy.TestProto.Fruit.APPLE;
      color_ = com.github.jsdossier.soy.TestProto.Color.RED;
      repeatedInt_ = java.util.Collections.emptyList();
      repeatedColor_ = java.util.Collections.emptyList();
      htmlField_ = "";
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBool(1, boolField_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeInt32(2, intField_);
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeBytes(3, getStringFieldBytes());
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeEnum(4, fruit_.getNumber());
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        output.writeEnum(5, color_.getNumber());
      }
      for (int i = 0; i < repeatedInt_.size(); i++) {
        output.writeInt32(6, repeatedInt_.get(i));
      }
      for (int i = 0; i < repeatedColor_.size(); i++) {
        output.writeEnum(7, repeatedColor_.get(i).getNumber());
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        output.writeBytes(8, getHtmlFieldBytes());
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(1, boolField_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(2, intField_);
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(3, getStringFieldBytes());
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeEnumSize(4, fruit_.getNumber());
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        size += com.google.protobuf.CodedOutputStream
          .computeEnumSize(5, color_.getNumber());
      }
      {
        int dataSize = 0;
        for (int i = 0; i < repeatedInt_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
            .computeInt32SizeNoTag(repeatedInt_.get(i));
        }
        size += dataSize;
        size += 1 * getRepeatedIntList().size();
      }
      {
        int dataSize = 0;
        for (int i = 0; i < repeatedColor_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
            .computeEnumSizeNoTag(repeatedColor_.get(i).getNumber());
        }
        size += dataSize;
        size += 1 * repeatedColor_.size();
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(8, getHtmlFieldBytes());
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static com.github.jsdossier.soy.TestProto.Order parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.github.jsdossier.soy.TestProto.Order parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.github.jsdossier.soy.TestProto.Order parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.github.jsdossier.soy.TestProto.Order parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.github.jsdossier.soy.TestProto.Order parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static com.github.jsdossier.soy.TestProto.Order parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static com.github.jsdossier.soy.TestProto.Order parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static com.github.jsdossier.soy.TestProto.Order parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static com.github.jsdossier.soy.TestProto.Order parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static com.github.jsdossier.soy.TestProto.Order parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(com.github.jsdossier.soy.TestProto.Order prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code test.Order}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:test.Order)
        com.github.jsdossier.soy.TestProto.OrderOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.github.jsdossier.soy.TestProto.internal_static_test_Order_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.github.jsdossier.soy.TestProto.internal_static_test_Order_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.github.jsdossier.soy.TestProto.Order.class, com.github.jsdossier.soy.TestProto.Order.Builder.class);
      }

      // Construct using com.github.jsdossier.soy.TestProto.Order.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        boolField_ = false;
        bitField0_ = (bitField0_ & ~0x00000001);
        intField_ = 0;
        bitField0_ = (bitField0_ & ~0x00000002);
        stringField_ = "";
        bitField0_ = (bitField0_ & ~0x00000004);
        fruit_ = com.github.jsdossier.soy.TestProto.Fruit.APPLE;
        bitField0_ = (bitField0_ & ~0x00000008);
        color_ = com.github.jsdossier.soy.TestProto.Color.RED;
        bitField0_ = (bitField0_ & ~0x00000010);
        repeatedInt_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000020);
        repeatedColor_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000040);
        htmlField_ = "";
        bitField0_ = (bitField0_ & ~0x00000080);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return com.github.jsdossier.soy.TestProto.internal_static_test_Order_descriptor;
      }

      public com.github.jsdossier.soy.TestProto.Order getDefaultInstanceForType() {
        return com.github.jsdossier.soy.TestProto.Order.getDefaultInstance();
      }

      public com.github.jsdossier.soy.TestProto.Order build() {
        com.github.jsdossier.soy.TestProto.Order result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public com.github.jsdossier.soy.TestProto.Order buildPartial() {
        com.github.jsdossier.soy.TestProto.Order result = new com.github.jsdossier.soy.TestProto.Order(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.boolField_ = boolField_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.intField_ = intField_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        result.stringField_ = stringField_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000008;
        }
        result.fruit_ = fruit_;
        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
          to_bitField0_ |= 0x00000010;
        }
        result.color_ = color_;
        if (((bitField0_ & 0x00000020) == 0x00000020)) {
          repeatedInt_ = java.util.Collections.unmodifiableList(repeatedInt_);
          bitField0_ = (bitField0_ & ~0x00000020);
        }
        result.repeatedInt_ = repeatedInt_;
        if (((bitField0_ & 0x00000040) == 0x00000040)) {
          repeatedColor_ = java.util.Collections.unmodifiableList(repeatedColor_);
          bitField0_ = (bitField0_ & ~0x00000040);
        }
        result.repeatedColor_ = repeatedColor_;
        if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
          to_bitField0_ |= 0x00000020;
        }
        result.htmlField_ = htmlField_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.github.jsdossier.soy.TestProto.Order) {
          return mergeFrom((com.github.jsdossier.soy.TestProto.Order)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.github.jsdossier.soy.TestProto.Order other) {
        if (other == com.github.jsdossier.soy.TestProto.Order.getDefaultInstance()) return this;
        if (other.hasBoolField()) {
          setBoolField(other.getBoolField());
        }
        if (other.hasIntField()) {
          setIntField(other.getIntField());
        }
        if (other.hasStringField()) {
          bitField0_ |= 0x00000004;
          stringField_ = other.stringField_;
          onChanged();
        }
        if (other.hasFruit()) {
          setFruit(other.getFruit());
        }
        if (other.hasColor()) {
          setColor(other.getColor());
        }
        if (!other.repeatedInt_.isEmpty()) {
          if (repeatedInt_.isEmpty()) {
            repeatedInt_ = other.repeatedInt_;
            bitField0_ = (bitField0_ & ~0x00000020);
          } else {
            ensureRepeatedIntIsMutable();
            repeatedInt_.addAll(other.repeatedInt_);
          }
          onChanged();
        }
        if (!other.repeatedColor_.isEmpty()) {
          if (repeatedColor_.isEmpty()) {
            repeatedColor_ = other.repeatedColor_;
            bitField0_ = (bitField0_ & ~0x00000040);
          } else {
            ensureRepeatedColorIsMutable();
            repeatedColor_.addAll(other.repeatedColor_);
          }
          onChanged();
        }
        if (other.hasHtmlField()) {
          bitField0_ |= 0x00000080;
          htmlField_ = other.htmlField_;
          onChanged();
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.github.jsdossier.soy.TestProto.Order parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (com.github.jsdossier.soy.TestProto.Order) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      private boolean boolField_ ;
      /**
       * <code>optional bool bool_field = 1;</code>
       */
      public boolean hasBoolField() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>optional bool bool_field = 1;</code>
       */
      public boolean getBoolField() {
        return boolField_;
      }
      /**
       * <code>optional bool bool_field = 1;</code>
       */
      public Builder setBoolField(boolean value) {
        bitField0_ |= 0x00000001;
        boolField_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional bool bool_field = 1;</code>
       */
      public Builder clearBoolField() {
        bitField0_ = (bitField0_ & ~0x00000001);
        boolField_ = false;
        onChanged();
        return this;
      }

      private int intField_ ;
      /**
       * <code>optional int32 int_field = 2;</code>
       */
      public boolean hasIntField() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>optional int32 int_field = 2;</code>
       */
      public int getIntField() {
        return intField_;
      }
      /**
       * <code>optional int32 int_field = 2;</code>
       */
      public Builder setIntField(int value) {
        bitField0_ |= 0x00000002;
        intField_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional int32 int_field = 2;</code>
       */
      public Builder clearIntField() {
        bitField0_ = (bitField0_ & ~0x00000002);
        intField_ = 0;
        onChanged();
        return this;
      }

      private java.lang.Object stringField_ = "";
      /**
       * <code>optional string string_field = 3;</code>
       */
      public boolean hasStringField() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>optional string string_field = 3;</code>
       */
      public java.lang.String getStringField() {
        java.lang.Object ref = stringField_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          if (bs.isValidUtf8()) {
            stringField_ = s;
          }
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string string_field = 3;</code>
       */
      public com.google.protobuf.ByteString
          getStringFieldBytes() {
        java.lang.Object ref = stringField_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          stringField_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string string_field = 3;</code>
       */
      public Builder setStringField(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        stringField_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string string_field = 3;</code>
       */
      public Builder clearStringField() {
        bitField0_ = (bitField0_ & ~0x00000004);
        stringField_ = getDefaultInstance().getStringField();
        onChanged();
        return this;
      }
      /**
       * <code>optional string string_field = 3;</code>
       */
      public Builder setStringFieldBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        stringField_ = value;
        onChanged();
        return this;
      }

      private com.github.jsdossier.soy.TestProto.Fruit fruit_ = com.github.jsdossier.soy.TestProto.Fruit.APPLE;
      /**
       * <code>optional .test.Fruit fruit = 4;</code>
       */
      public boolean hasFruit() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      /**
       * <code>optional .test.Fruit fruit = 4;</code>
       */
      public com.github.jsdossier.soy.TestProto.Fruit getFruit() {
        return fruit_;
      }
      /**
       * <code>optional .test.Fruit fruit = 4;</code>
       */
      public Builder setFruit(com.github.jsdossier.soy.TestProto.Fruit value) {
        if (value == null) {
          throw new NullPointerException();
        }
        bitField0_ |= 0x00000008;
        fruit_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional .test.Fruit fruit = 4;</code>
       */
      public Builder clearFruit() {
        bitField0_ = (bitField0_ & ~0x00000008);
        fruit_ = com.github.jsdossier.soy.TestProto.Fruit.APPLE;
        onChanged();
        return this;
      }

      private com.github.jsdossier.soy.TestProto.Color color_ = com.github.jsdossier.soy.TestProto.Color.RED;
      /**
       * <code>optional .test.Color color = 5;</code>
       */
      public boolean hasColor() {
        return ((bitField0_ & 0x00000010) == 0x00000010);
      }
      /**
       * <code>optional .test.Color color = 5;</code>
       */
      public com.github.jsdossier.soy.TestProto.Color getColor() {
        return color_;
      }
      /**
       * <code>optional .test.Color color = 5;</code>
       */
      public Builder setColor(com.github.jsdossier.soy.TestProto.Color value) {
        if (value == null) {
          throw new NullPointerException();
        }
        bitField0_ |= 0x00000010;
        color_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional .test.Color color = 5;</code>
       */
      public Builder clearColor() {
        bitField0_ = (bitField0_ & ~0x00000010);
        color_ = com.github.jsdossier.soy.TestProto.Color.RED;
        onChanged();
        return this;
      }

      private java.util.List<java.lang.Integer> repeatedInt_ = java.util.Collections.emptyList();
      private void ensureRepeatedIntIsMutable() {
        if (!((bitField0_ & 0x00000020) == 0x00000020)) {
          repeatedInt_ = new java.util.ArrayList<java.lang.Integer>(repeatedInt_);
          bitField0_ |= 0x00000020;
         }
      }
      /**
       * <code>repeated int32 repeated_int = 6;</code>
       */
      public java.util.List<java.lang.Integer>
          getRepeatedIntList() {
        return java.util.Collections.unmodifiableList(repeatedInt_);
      }
      /**
       * <code>repeated int32 repeated_int = 6;</code>
       */
      public int getRepeatedIntCount() {
        return repeatedInt_.size();
      }
      /**
       * <code>repeated int32 repeated_int = 6;</code>
       */
      public int getRepeatedInt(int index) {
        return repeatedInt_.get(index);
      }
      /**
       * <code>repeated int32 repeated_int = 6;</code>
       */
      public Builder setRepeatedInt(
          int index, int value) {
        ensureRepeatedIntIsMutable();
        repeatedInt_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated int32 repeated_int = 6;</code>
       */
      public Builder addRepeatedInt(int value) {
        ensureRepeatedIntIsMutable();
        repeatedInt_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated int32 repeated_int = 6;</code>
       */
      public Builder addAllRepeatedInt(
          java.lang.Iterable<? extends java.lang.Integer> values) {
        ensureRepeatedIntIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, repeatedInt_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated int32 repeated_int = 6;</code>
       */
      public Builder clearRepeatedInt() {
        repeatedInt_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000020);
        onChanged();
        return this;
      }

      private java.util.List<com.github.jsdossier.soy.TestProto.Color> repeatedColor_ =
        java.util.Collections.emptyList();
      private void ensureRepeatedColorIsMutable() {
        if (!((bitField0_ & 0x00000040) == 0x00000040)) {
          repeatedColor_ = new java.util.ArrayList<com.github.jsdossier.soy.TestProto.Color>(repeatedColor_);
          bitField0_ |= 0x00000040;
        }
      }
      /**
       * <code>repeated .test.Color repeated_color = 7;</code>
       */
      public java.util.List<com.github.jsdossier.soy.TestProto.Color> getRepeatedColorList() {
        return java.util.Collections.unmodifiableList(repeatedColor_);
      }
      /**
       * <code>repeated .test.Color repeated_color = 7;</code>
       */
      public int getRepeatedColorCount() {
        return repeatedColor_.size();
      }
      /**
       * <code>repeated .test.Color repeated_color = 7;</code>
       */
      public com.github.jsdossier.soy.TestProto.Color getRepeatedColor(int index) {
        return repeatedColor_.get(index);
      }
      /**
       * <code>repeated .test.Color repeated_color = 7;</code>
       */
      public Builder setRepeatedColor(
          int index, com.github.jsdossier.soy.TestProto.Color value) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureRepeatedColorIsMutable();
        repeatedColor_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated .test.Color repeated_color = 7;</code>
       */
      public Builder addRepeatedColor(com.github.jsdossier.soy.TestProto.Color value) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureRepeatedColorIsMutable();
        repeatedColor_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated .test.Color repeated_color = 7;</code>
       */
      public Builder addAllRepeatedColor(
          java.lang.Iterable<? extends com.github.jsdossier.soy.TestProto.Color> values) {
        ensureRepeatedColorIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, repeatedColor_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated .test.Color repeated_color = 7;</code>
       */
      public Builder clearRepeatedColor() {
        repeatedColor_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000040);
        onChanged();
        return this;
      }

      private java.lang.Object htmlField_ = "";
      /**
       * <code>optional string html_field = 8;</code>
       */
      public boolean hasHtmlField() {
        return ((bitField0_ & 0x00000080) == 0x00000080);
      }
      /**
       * <code>optional string html_field = 8;</code>
       */
      public java.lang.String getHtmlField() {
        java.lang.Object ref = htmlField_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          if (bs.isValidUtf8()) {
            htmlField_ = s;
          }
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string html_field = 8;</code>
       */
      public com.google.protobuf.ByteString
          getHtmlFieldBytes() {
        java.lang.Object ref = htmlField_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          htmlField_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string html_field = 8;</code>
       */
      public Builder setHtmlField(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000080;
        htmlField_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string html_field = 8;</code>
       */
      public Builder clearHtmlField() {
        bitField0_ = (bitField0_ & ~0x00000080);
        htmlField_ = getDefaultInstance().getHtmlField();
        onChanged();
        return this;
      }
      /**
       * <code>optional string html_field = 8;</code>
       */
      public Builder setHtmlFieldBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000080;
        htmlField_ = value;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:test.Order)
    }

    static {
      defaultInstance = new Order(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:test.Order)
  }

  public interface TopOrBuilder extends
      // @@protoc_insertion_point(interface_extends:test.Top)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <code>optional .test.Top.NestedEnum nested_enum = 1;</code>
     */
    boolean hasNestedEnum();
    /**
     * <code>optional .test.Top.NestedEnum nested_enum = 1;</code>
     */
    com.github.jsdossier.soy.TestProto.Top.NestedEnum getNestedEnum();

    /**
     * <code>repeated .test.Order order = 2;</code>
     */
    java.util.List<com.github.jsdossier.soy.TestProto.Order> 
        getOrderList();
    /**
     * <code>repeated .test.Order order = 2;</code>
     */
    com.github.jsdossier.soy.TestProto.Order getOrder(int index);
    /**
     * <code>repeated .test.Order order = 2;</code>
     */
    int getOrderCount();
    /**
     * <code>repeated .test.Order order = 2;</code>
     */
    java.util.List<? extends com.github.jsdossier.soy.TestProto.OrderOrBuilder> 
        getOrderOrBuilderList();
    /**
     * <code>repeated .test.Order order = 2;</code>
     */
    com.github.jsdossier.soy.TestProto.OrderOrBuilder getOrderOrBuilder(
        int index);
  }
  /**
   * Protobuf type {@code test.Top}
   */
  public static final class Top extends
      com.google.protobuf.GeneratedMessage implements
      // @@protoc_insertion_point(message_implements:test.Top)
      TopOrBuilder {
    // Use Top.newBuilder() to construct.
    private Top(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private Top(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final Top defaultInstance;
    public static Top getDefaultInstance() {
      return defaultInstance;
    }

    public Top getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private Top(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 8: {
              int rawValue = input.readEnum();
              com.github.jsdossier.soy.TestProto.Top.NestedEnum value = com.github.jsdossier.soy.TestProto.Top.NestedEnum.valueOf(rawValue);
              if (value == null) {
                unknownFields.mergeVarintField(1, rawValue);
              } else {
                bitField0_ |= 0x00000001;
                nestedEnum_ = value;
              }
              break;
            }
            case 18: {
              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
                order_ = new java.util.ArrayList<com.github.jsdossier.soy.TestProto.Order>();
                mutable_bitField0_ |= 0x00000002;
              }
              order_.add(input.readMessage(com.github.jsdossier.soy.TestProto.Order.PARSER, extensionRegistry));
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
          order_ = java.util.Collections.unmodifiableList(order_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.github.jsdossier.soy.TestProto.internal_static_test_Top_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.github.jsdossier.soy.TestProto.internal_static_test_Top_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.github.jsdossier.soy.TestProto.Top.class, com.github.jsdossier.soy.TestProto.Top.Builder.class);
    }

    public static com.google.protobuf.Parser<Top> PARSER =
        new com.google.protobuf.AbstractParser<Top>() {
      public Top parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new Top(input, extensionRegistry);
      }
    };

    @java.lang.Override
    public com.google.protobuf.Parser<Top> getParserForType() {
      return PARSER;
    }

    /**
     * Protobuf enum {@code test.Top.NestedEnum}
     */
    public enum NestedEnum
        implements com.google.protobuf.ProtocolMessageEnum {
      /**
       * <code>VALUE = 0;</code>
       */
      VALUE(0, 0),
      ;

      /**
       * <code>VALUE = 0;</code>
       */
      public static final int VALUE_VALUE = 0;


      public final int getNumber() { return value; }

      public static NestedEnum valueOf(int value) {
        switch (value) {
          case 0: return VALUE;
          default: return null;
        }
      }

      public static com.google.protobuf.Internal.EnumLiteMap<NestedEnum>
          internalGetValueMap() {
        return internalValueMap;
      }
      private static com.google.protobuf.Internal.EnumLiteMap<NestedEnum>
          internalValueMap =
            new com.google.protobuf.Internal.EnumLiteMap<NestedEnum>() {
              public NestedEnum findValueByNumber(int number) {
                return NestedEnum.valueOf(number);
              }
            };

      public final com.google.protobuf.Descriptors.EnumValueDescriptor
          getValueDescriptor() {
        return getDescriptor().getValues().get(index);
      }
      public final com.google.protobuf.Descriptors.EnumDescriptor
          getDescriptorForType() {
        return getDescriptor();
      }
      public static final com.google.protobuf.Descriptors.EnumDescriptor
          getDescriptor() {
        return com.github.jsdossier.soy.TestProto.Top.getDescriptor().getEnumTypes().get(0);
      }

      private static final NestedEnum[] VALUES = values();

      public static NestedEnum valueOf(
          com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
        if (desc.getType() != getDescriptor()) {
          throw new java.lang.IllegalArgumentException(
            "EnumValueDescriptor is not for this type.");
        }
        return VALUES[desc.getIndex()];
      }

      private final int index;
      private final int value;

      private NestedEnum(int index, int value) {
        this.index = index;
        this.value = value;
      }

      // @@protoc_insertion_point(enum_scope:test.Top.NestedEnum)
    }

    public interface NestedMessageOrBuilder extends
        // @@protoc_insertion_point(interface_extends:test.Top.NestedMessage)
        com.google.protobuf.MessageOrBuilder {

      /**
       * <code>optional bool item = 1;</code>
       */
      boolean hasItem();
      /**
       * <code>optional bool item = 1;</code>
       */
      boolean getItem();
    }
    /**
     * Protobuf type {@code test.Top.NestedMessage}
     */
    public static final class NestedMessage extends
        com.google.protobuf.GeneratedMessage implements
        // @@protoc_insertion_point(message_implements:test.Top.NestedMessage)
        NestedMessageOrBuilder {
      // Use NestedMessage.newBuilder() to construct.
      private NestedMessage(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
        super(builder);
        this.unknownFields = builder.getUnknownFields();
      }
      private NestedMessage(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

      private static final NestedMessage defaultInstance;
      public static NestedMessage getDefaultInstance() {
        return defaultInstance;
      }

      public NestedMessage getDefaultInstanceForType() {
        return defaultInstance;
      }

      private final com.google.protobuf.UnknownFieldSet unknownFields;
      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet
          getUnknownFields() {
        return this.unknownFields;
      }
      private NestedMessage(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        initFields();
        int mutable_bitField0_ = 0;
        com.google.protobuf.UnknownFieldSet.Builder unknownFields =
            com.google.protobuf.UnknownFieldSet.newBuilder();
        try {
          boolean done = false;
          while (!done) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                done = true;
                break;
              default: {
                if (!parseUnknownField(input, unknownFields,
                                       extensionRegistry, tag)) {
                  done = true;
                }
                break;
              }
              case 8: {
                bitField0_ |= 0x00000001;
                item_ = input.readBool();
                break;
              }
            }
          }
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.setUnfinishedMessage(this);
        } catch (java.io.IOException e) {
          throw new com.google.protobuf.InvalidProtocolBufferException(
              e.getMessage()).setUnfinishedMessage(this);
        } finally {
          this.unknownFields = unknownFields.build();
          makeExtensionsImmutable();
        }
      }
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.github.jsdossier.soy.TestProto.internal_static_test_Top_NestedMessage_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.github.jsdossier.soy.TestProto.internal_static_test_Top_NestedMessage_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.github.jsdossier.soy.TestProto.Top.NestedMessage.class, com.github.jsdossier.soy.TestProto.Top.NestedMessage.Builder.class);
      }

      public static com.google.protobuf.Parser<NestedMessage> PARSER =
          new com.google.protobuf.AbstractParser<NestedMessage>() {
        public NestedMessage parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new NestedMessage(input, extensionRegistry);
        }
      };

      @java.lang.Override
      public com.google.protobuf.Parser<NestedMessage> getParserForType() {
        return PARSER;
      }

      private int bitField0_;
      public static final int ITEM_FIELD_NUMBER = 1;
      private boolean item_;
      /**
       * <code>optional bool item = 1;</code>
       */
      public boolean hasItem() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>optional bool item = 1;</code>
       */
      public boolean getItem() {
        return item_;
      }

      private void initFields() {
        item_ = false;
      }
      private byte memoizedIsInitialized = -1;
      public final boolean isInitialized() {
        byte isInitialized = memoizedIsInitialized;
        if (isInitialized == 1) return true;
        if (isInitialized == 0) return false;

        memoizedIsInitialized = 1;
        return true;
      }

      public void writeTo(com.google.protobuf.CodedOutputStream output)
                          throws java.io.IOException {
        getSerializedSize();
        if (((bitField0_ & 0x00000001) == 0x00000001)) {
          output.writeBool(1, item_);
        }
        getUnknownFields().writeTo(output);
      }

      private int memoizedSerializedSize = -1;
      public int getSerializedSize() {
        int size = memoizedSerializedSize;
        if (size != -1) return size;

        size = 0;
        if (((bitField0_ & 0x00000001) == 0x00000001)) {
          size += com.google.protobuf.CodedOutputStream
            .computeBoolSize(1, item_);
        }
        size += getUnknownFields().getSerializedSize();
        memoizedSerializedSize = size;
        return size;
      }

      private static final long serialVersionUID = 0L;
      @java.lang.Override
      protected java.lang.Object writeReplace()
          throws java.io.ObjectStreamException {
        return super.writeReplace();
      }

      public static com.github.jsdossier.soy.TestProto.Top.NestedMessage parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.github.jsdossier.soy.TestProto.Top.NestedMessage parseFrom(
          com.google.protobuf.ByteString data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static com.github.jsdossier.soy.TestProto.Top.NestedMessage parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.github.jsdossier.soy.TestProto.Top.NestedMessage parseFrom(
          byte[] data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static com.github.jsdossier.soy.TestProto.Top.NestedMessage parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return PARSER.parseFrom(input);
      }
      public static com.github.jsdossier.soy.TestProto.Top.NestedMessage parseFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return PARSER.parseFrom(input, extensionRegistry);
      }
      public static com.github.jsdossier.soy.TestProto.Top.NestedMessage parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        return PARSER.parseDelimitedFrom(input);
      }
      public static com.github.jsdossier.soy.TestProto.Top.NestedMessage parseDelimitedFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return PARSER.parseDelimitedFrom(input, extensionRegistry);
      }
      public static com.github.jsdossier.soy.TestProto.Top.NestedMessage parseFrom(
          com.google.protobuf.CodedInputStream input)
          throws java.io.IOException {
        return PARSER.parseFrom(input);
      }
      public static com.github.jsdossier.soy.TestProto.Top.NestedMessage parseFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return PARSER.parseFrom(input, extensionRegistry);
      }

      public static Builder newBuilder() { return Builder.create(); }
      public Builder newBuilderForType() { return newBuilder(); }
      public static Builder newBuilder(com.github.jsdossier.soy.TestProto.Top.NestedMessage prototype) {
        return newBuilder().mergeFrom(prototype);
      }
      public Builder toBuilder() { return newBuilder(this); }

      @java.lang.Override
      protected Builder newBuilderForType(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        Builder builder = new Builder(parent);
        return builder;
      }
      /**
       * Protobuf type {@code test.Top.NestedMessage}
       */
      public static final class Builder extends
          com.google.protobuf.GeneratedMessage.Builder<Builder> implements
          // @@protoc_insertion_point(builder_implements:test.Top.NestedMessage)
          com.github.jsdossier.soy.TestProto.Top.NestedMessageOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor
            getDescriptor() {
          return com.github.jsdossier.soy.TestProto.internal_static_test_Top_NestedMessage_descriptor;
        }

        protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
            internalGetFieldAccessorTable() {
          return com.github.jsdossier.soy.TestProto.internal_static_test_Top_NestedMessage_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.github.jsdossier.soy.TestProto.Top.NestedMessage.class, com.github.jsdossier.soy.TestProto.Top.NestedMessage.Builder.class);
        }

        // Construct using com.github.jsdossier.soy.TestProto.Top.NestedMessage.newBuilder()
        private Builder() {
          maybeForceBuilderInitialization();
        }

        private Builder(
            com.google.protobuf.GeneratedMessage.BuilderParent parent) {
          super(parent);
          maybeForceBuilderInitialization();
        }
        private void maybeForceBuilderInitialization() {
          if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          }
        }
        private static Builder create() {
          return new Builder();
        }

        public Builder clear() {
          super.clear();
          item_ = false;
          bitField0_ = (bitField0_ & ~0x00000001);
          return this;
        }

        public Builder clone() {
          return create().mergeFrom(buildPartial());
        }

        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return com.github.jsdossier.soy.TestProto.internal_static_test_Top_NestedMessage_descriptor;
        }

        public com.github.jsdossier.soy.TestProto.Top.NestedMessage getDefaultInstanceForType() {
          return com.github.jsdossier.soy.TestProto.Top.NestedMessage.getDefaultInstance();
        }

        public com.github.jsdossier.soy.TestProto.Top.NestedMessage build() {
          com.github.jsdossier.soy.TestProto.Top.NestedMessage result = buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }

        public com.github.jsdossier.soy.TestProto.Top.NestedMessage buildPartial() {
          com.github.jsdossier.soy.TestProto.Top.NestedMessage result = new com.github.jsdossier.soy.TestProto.Top.NestedMessage(this);
          int from_bitField0_ = bitField0_;
          int to_bitField0_ = 0;
          if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
            to_bitField0_ |= 0x00000001;
          }
          result.item_ = item_;
          result.bitField0_ = to_bitField0_;
          onBuilt();
          return result;
        }

        public Builder mergeFrom(com.google.protobuf.Message other) {
          if (other instanceof com.github.jsdossier.soy.TestProto.Top.NestedMessage) {
            return mergeFrom((com.github.jsdossier.soy.TestProto.Top.NestedMessage)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }

        public Builder mergeFrom(com.github.jsdossier.soy.TestProto.Top.NestedMessage other) {
          if (other == com.github.jsdossier.soy.TestProto.Top.NestedMessage.getDefaultInstance()) return this;
          if (other.hasItem()) {
            setItem(other.getItem());
          }
          this.mergeUnknownFields(other.getUnknownFields());
          return this;
        }

        public final boolean isInitialized() {
          return true;
        }

        public Builder mergeFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
          com.github.jsdossier.soy.TestProto.Top.NestedMessage parsedMessage = null;
          try {
            parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            parsedMessage = (com.github.jsdossier.soy.TestProto.Top.NestedMessage) e.getUnfinishedMessage();
            throw e;
          } finally {
            if (parsedMessage != null) {
              mergeFrom(parsedMessage);
            }
          }
          return this;
        }
        private int bitField0_;

        private boolean item_ ;
        /**
         * <code>optional bool item = 1;</code>
         */
        public boolean hasItem() {
          return ((bitField0_ & 0x00000001) == 0x00000001);
        }
        /**
         * <code>optional bool item = 1;</code>
         */
        public boolean getItem() {
          return item_;
        }
        /**
         * <code>optional bool item = 1;</code>
         */
        public Builder setItem(boolean value) {
          bitField0_ |= 0x00000001;
          item_ = value;
          onChanged();
          return this;
        }
        /**
         * <code>optional bool item = 1;</code>
         */
        public Builder clearItem() {
          bitField0_ = (bitField0_ & ~0x00000001);
          item_ = false;
          onChanged();
          return this;
        }

        // @@protoc_insertion_point(builder_scope:test.Top.NestedMessage)
      }

      static {
        defaultInstance = new NestedMessage(true);
        defaultInstance.initFields();
      }

      // @@protoc_insertion_point(class_scope:test.Top.NestedMessage)
    }

    private int bitField0_;
    public static final int NESTED_ENUM_FIELD_NUMBER = 1;
    private com.github.jsdossier.soy.TestProto.Top.NestedEnum nestedEnum_;
    /**
     * <code>optional .test.Top.NestedEnum nested_enum = 1;</code>
     */
    public boolean hasNestedEnum() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>optional .test.Top.NestedEnum nested_enum = 1;</code>
     */
    public com.github.jsdossier.soy.TestProto.Top.NestedEnum getNestedEnum() {
      return nestedEnum_;
    }

    public static final int ORDER_FIELD_NUMBER = 2;
    private java.util.List<com.github.jsdossier.soy.TestProto.Order> order_;
    /**
     * <code>repeated .test.Order order = 2;</code>
     */
    public java.util.List<com.github.jsdossier.soy.TestProto.Order> getOrderList() {
      return order_;
    }
    /**
     * <code>repeated .test.Order order = 2;</code>
     */
    public java.util.List<? extends com.github.jsdossier.soy.TestProto.OrderOrBuilder> 
        getOrderOrBuilderList() {
      return order_;
    }
    /**
     * <code>repeated .test.Order order = 2;</code>
     */
    public int getOrderCount() {
      return order_.size();
    }
    /**
     * <code>repeated .test.Order order = 2;</code>
     */
    public com.github.jsdossier.soy.TestProto.Order getOrder(int index) {
      return order_.get(index);
    }
    /**
     * <code>repeated .test.Order order = 2;</code>
     */
    public com.github.jsdossier.soy.TestProto.OrderOrBuilder getOrderOrBuilder(
        int index) {
      return order_.get(index);
    }

    private void initFields() {
      nestedEnum_ = com.github.jsdossier.soy.TestProto.Top.NestedEnum.VALUE;
      order_ = java.util.Collections.emptyList();
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeEnum(1, nestedEnum_.getNumber());
      }
      for (int i = 0; i < order_.size(); i++) {
        output.writeMessage(2, order_.get(i));
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeEnumSize(1, nestedEnum_.getNumber());
      }
      for (int i = 0; i < order_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(2, order_.get(i));
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static com.github.jsdossier.soy.TestProto.Top parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.github.jsdossier.soy.TestProto.Top parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.github.jsdossier.soy.TestProto.Top parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.github.jsdossier.soy.TestProto.Top parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.github.jsdossier.soy.TestProto.Top parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static com.github.jsdossier.soy.TestProto.Top parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static com.github.jsdossier.soy.TestProto.Top parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static com.github.jsdossier.soy.TestProto.Top parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static com.github.jsdossier.soy.TestProto.Top parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static com.github.jsdossier.soy.TestProto.Top parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(com.github.jsdossier.soy.TestProto.Top prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code test.Top}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:test.Top)
        com.github.jsdossier.soy.TestProto.TopOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.github.jsdossier.soy.TestProto.internal_static_test_Top_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.github.jsdossier.soy.TestProto.internal_static_test_Top_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.github.jsdossier.soy.TestProto.Top.class, com.github.jsdossier.soy.TestProto.Top.Builder.class);
      }

      // Construct using com.github.jsdossier.soy.TestProto.Top.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getOrderFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        nestedEnum_ = com.github.jsdossier.soy.TestProto.Top.NestedEnum.VALUE;
        bitField0_ = (bitField0_ & ~0x00000001);
        if (orderBuilder_ == null) {
          order_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          orderBuilder_.clear();
        }
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return com.github.jsdossier.soy.TestProto.internal_static_test_Top_descriptor;
      }

      public com.github.jsdossier.soy.TestProto.Top getDefaultInstanceForType() {
        return com.github.jsdossier.soy.TestProto.Top.getDefaultInstance();
      }

      public com.github.jsdossier.soy.TestProto.Top build() {
        com.github.jsdossier.soy.TestProto.Top result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public com.github.jsdossier.soy.TestProto.Top buildPartial() {
        com.github.jsdossier.soy.TestProto.Top result = new com.github.jsdossier.soy.TestProto.Top(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.nestedEnum_ = nestedEnum_;
        if (orderBuilder_ == null) {
          if (((bitField0_ & 0x00000002) == 0x00000002)) {
            order_ = java.util.Collections.unmodifiableList(order_);
            bitField0_ = (bitField0_ & ~0x00000002);
          }
          result.order_ = order_;
        } else {
          result.order_ = orderBuilder_.build();
        }
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.github.jsdossier.soy.TestProto.Top) {
          return mergeFrom((com.github.jsdossier.soy.TestProto.Top)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.github.jsdossier.soy.TestProto.Top other) {
        if (other == com.github.jsdossier.soy.TestProto.Top.getDefaultInstance()) return this;
        if (other.hasNestedEnum()) {
          setNestedEnum(other.getNestedEnum());
        }
        if (orderBuilder_ == null) {
          if (!other.order_.isEmpty()) {
            if (order_.isEmpty()) {
              order_ = other.order_;
              bitField0_ = (bitField0_ & ~0x00000002);
            } else {
              ensureOrderIsMutable();
              order_.addAll(other.order_);
            }
            onChanged();
          }
        } else {
          if (!other.order_.isEmpty()) {
            if (orderBuilder_.isEmpty()) {
              orderBuilder_.dispose();
              orderBuilder_ = null;
              order_ = other.order_;
              bitField0_ = (bitField0_ & ~0x00000002);
              orderBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getOrderFieldBuilder() : null;
            } else {
              orderBuilder_.addAllMessages(other.order_);
            }
          }
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.github.jsdossier.soy.TestProto.Top parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (com.github.jsdossier.soy.TestProto.Top) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      private com.github.jsdossier.soy.TestProto.Top.NestedEnum nestedEnum_ = com.github.jsdossier.soy.TestProto.Top.NestedEnum.VALUE;
      /**
       * <code>optional .test.Top.NestedEnum nested_enum = 1;</code>
       */
      public boolean hasNestedEnum() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>optional .test.Top.NestedEnum nested_enum = 1;</code>
       */
      public com.github.jsdossier.soy.TestProto.Top.NestedEnum getNestedEnum() {
        return nestedEnum_;
      }
      /**
       * <code>optional .test.Top.NestedEnum nested_enum = 1;</code>
       */
      public Builder setNestedEnum(com.github.jsdossier.soy.TestProto.Top.NestedEnum value) {
        if (value == null) {
          throw new NullPointerException();
        }
        bitField0_ |= 0x00000001;
        nestedEnum_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional .test.Top.NestedEnum nested_enum = 1;</code>
       */
      public Builder clearNestedEnum() {
        bitField0_ = (bitField0_ & ~0x00000001);
        nestedEnum_ = com.github.jsdossier.soy.TestProto.Top.NestedEnum.VALUE;
        onChanged();
        return this;
      }

      private java.util.List<com.github.jsdossier.soy.TestProto.Order> order_ =
        java.util.Collections.emptyList();
      private void ensureOrderIsMutable() {
        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
          order_ = new java.util.ArrayList<com.github.jsdossier.soy.TestProto.Order>(order_);
          bitField0_ |= 0x00000002;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          com.github.jsdossier.soy.TestProto.Order, com.github.jsdossier.soy.TestProto.Order.Builder, com.github.jsdossier.soy.TestProto.OrderOrBuilder> orderBuilder_;

      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public java.util.List<com.github.jsdossier.soy.TestProto.Order> getOrderList() {
        if (orderBuilder_ == null) {
          return java.util.Collections.unmodifiableList(order_);
        } else {
          return orderBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public int getOrderCount() {
        if (orderBuilder_ == null) {
          return order_.size();
        } else {
          return orderBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public com.github.jsdossier.soy.TestProto.Order getOrder(int index) {
        if (orderBuilder_ == null) {
          return order_.get(index);
        } else {
          return orderBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public Builder setOrder(
          int index, com.github.jsdossier.soy.TestProto.Order value) {
        if (orderBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureOrderIsMutable();
          order_.set(index, value);
          onChanged();
        } else {
          orderBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public Builder setOrder(
          int index, com.github.jsdossier.soy.TestProto.Order.Builder builderForValue) {
        if (orderBuilder_ == null) {
          ensureOrderIsMutable();
          order_.set(index, builderForValue.build());
          onChanged();
        } else {
          orderBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public Builder addOrder(com.github.jsdossier.soy.TestProto.Order value) {
        if (orderBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureOrderIsMutable();
          order_.add(value);
          onChanged();
        } else {
          orderBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public Builder addOrder(
          int index, com.github.jsdossier.soy.TestProto.Order value) {
        if (orderBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureOrderIsMutable();
          order_.add(index, value);
          onChanged();
        } else {
          orderBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public Builder addOrder(
          com.github.jsdossier.soy.TestProto.Order.Builder builderForValue) {
        if (orderBuilder_ == null) {
          ensureOrderIsMutable();
          order_.add(builderForValue.build());
          onChanged();
        } else {
          orderBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public Builder addOrder(
          int index, com.github.jsdossier.soy.TestProto.Order.Builder builderForValue) {
        if (orderBuilder_ == null) {
          ensureOrderIsMutable();
          order_.add(index, builderForValue.build());
          onChanged();
        } else {
          orderBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public Builder addAllOrder(
          java.lang.Iterable<? extends com.github.jsdossier.soy.TestProto.Order> values) {
        if (orderBuilder_ == null) {
          ensureOrderIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(
              values, order_);
          onChanged();
        } else {
          orderBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public Builder clearOrder() {
        if (orderBuilder_ == null) {
          order_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000002);
          onChanged();
        } else {
          orderBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public Builder removeOrder(int index) {
        if (orderBuilder_ == null) {
          ensureOrderIsMutable();
          order_.remove(index);
          onChanged();
        } else {
          orderBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public com.github.jsdossier.soy.TestProto.Order.Builder getOrderBuilder(
          int index) {
        return getOrderFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public com.github.jsdossier.soy.TestProto.OrderOrBuilder getOrderOrBuilder(
          int index) {
        if (orderBuilder_ == null) {
          return order_.get(index);  } else {
          return orderBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public java.util.List<? extends com.github.jsdossier.soy.TestProto.OrderOrBuilder> 
           getOrderOrBuilderList() {
        if (orderBuilder_ != null) {
          return orderBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(order_);
        }
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public com.github.jsdossier.soy.TestProto.Order.Builder addOrderBuilder() {
        return getOrderFieldBuilder().addBuilder(
            com.github.jsdossier.soy.TestProto.Order.getDefaultInstance());
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public com.github.jsdossier.soy.TestProto.Order.Builder addOrderBuilder(
          int index) {
        return getOrderFieldBuilder().addBuilder(
            index, com.github.jsdossier.soy.TestProto.Order.getDefaultInstance());
      }
      /**
       * <code>repeated .test.Order order = 2;</code>
       */
      public java.util.List<com.github.jsdossier.soy.TestProto.Order.Builder> 
           getOrderBuilderList() {
        return getOrderFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          com.github.jsdossier.soy.TestProto.Order, com.github.jsdossier.soy.TestProto.Order.Builder, com.github.jsdossier.soy.TestProto.OrderOrBuilder> 
          getOrderFieldBuilder() {
        if (orderBuilder_ == null) {
          orderBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              com.github.jsdossier.soy.TestProto.Order, com.github.jsdossier.soy.TestProto.Order.Builder, com.github.jsdossier.soy.TestProto.OrderOrBuilder>(
                  order_,
                  ((bitField0_ & 0x00000002) == 0x00000002),
                  getParentForChildren(),
                  isClean());
          order_ = null;
        }
        return orderBuilder_;
      }

      // @@protoc_insertion_point(builder_scope:test.Top)
    }

    static {
      defaultInstance = new Top(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:test.Top)
  }

  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_test_Order_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_test_Order_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_test_Top_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_test_Top_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_test_Top_NestedMessage_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_test_Top_NestedMessage_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n\020test_proto.proto\022\004test\032\rdossier.proto\"" +
      "\323\001\n\005Order\022\022\n\nbool_field\030\001 \001(\010\022\021\n\tint_fie" +
      "ld\030\002 \001(\005\022\024\n\014string_field\030\003 \001(\t\022\032\n\005fruit\030" +
      "\004 \001(\0162\013.test.Fruit\022\032\n\005color\030\005 \001(\0162\013.test" +
      ".Color\022\024\n\014repeated_int\030\006 \003(\005\022#\n\016repeated" +
      "_color\030\007 \003(\0162\013.test.Color\022\032\n\nhtml_field\030" +
      "\010 \001(\tB\006\362\201\031\002\020\001\"\204\001\n\003Top\022)\n\013nested_enum\030\001 \001" +
      "(\0162\024.test.Top.NestedEnum\022\032\n\005order\030\002 \003(\0132" +
      "\013.test.Order\032\035\n\rNestedMessage\022\014\n\004item\030\001 " +
      "\001(\010\"\027\n\nNestedEnum\022\t\n\005VALUE\020\000*%\n\005Color\022\007\n",
      "\003RED\020\000\022\010\n\004BLUE\020\001\022\t\n\005GREEN\020\002*\036\n\005Fruit\022\t\n\005" +
      "APPLE\020\001\022\n\n\006ORANGE\020\002B\032\n\030com.github.jsdoss" +
      "ier.soy"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
        new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
          public com.google.protobuf.ExtensionRegistry assignDescriptors(
              com.google.protobuf.Descriptors.FileDescriptor root) {
            descriptor = root;
            return null;
          }
        };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
          com.github.jsdossier.proto.Dossier.getDescriptor(),
        }, assigner);
    internal_static_test_Order_descriptor =
      getDescriptor().getMessageTypes().get(0);
    internal_static_test_Order_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
        internal_static_test_Order_descriptor,
        new java.lang.String[] { "BoolField", "IntField", "StringField", "Fruit", "Color", "RepeatedInt", "RepeatedColor", "HtmlField", });
    internal_static_test_Top_descriptor =
      getDescriptor().getMessageTypes().get(1);
    internal_static_test_Top_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
        internal_static_test_Top_descriptor,
        new java.lang.String[] { "NestedEnum", "Order", });
    internal_static_test_Top_NestedMessage_descriptor =
      internal_static_test_Top_descriptor.getNestedTypes().get(0);
    internal_static_test_Top_NestedMessage_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
        internal_static_test_Top_NestedMessage_descriptor,
        new java.lang.String[] { "Item", });
    com.google.protobuf.ExtensionRegistry registry =
        com.google.protobuf.ExtensionRegistry.newInstance();
    registry.add(com.github.jsdossier.proto.Dossier.sanitized);
    com.google.protobuf.Descriptors.FileDescriptor
        .internalUpdateFileDescriptor(descriptor, registry);
    com.github.jsdossier.proto.Dossier.getDescriptor();
  }

  // @@protoc_insertion_point(outer_class_scope)
}
