001    //
002    // Generated by protoc, do not edit by hand.
003    //
004    package com.google.protobuf.test;
005    
006    public class UnittestImport {
007    
008       public static enum ImportEnum {
009    
010          IMPORT_FOO("IMPORT_FOO", 7),
011          IMPORT_BAR("IMPORT_BAR", 8),
012          IMPORT_BAZ("IMPORT_BAZ", 9);
013    
014          private final String name;
015          private final int value;
016    
017          private ImportEnum(String name, int value) {
018             this.name = name;
019             this.value = value;
020          }
021    
022          public final int getNumber() {
023             return value;
024          }
025    
026          public final String toString() {
027             return name;
028          }
029    
030          public static ImportEnum valueOf(int value) {
031             switch (value) {
032             case 7:
033                return IMPORT_FOO;
034             case 8:
035                return IMPORT_BAR;
036             case 9:
037                return IMPORT_BAZ;
038             default:
039                return null;
040             }
041          }
042    
043       }
044    
045    
046       static public final class ImportMessage extends ImportMessageBase<ImportMessage> {
047    
048          public java.util.ArrayList<String> missingFields() {
049             java.util.ArrayList<String> missingFields = super.missingFields();
050             return missingFields;
051          }
052    
053          public void clear() {
054             super.clear();
055             clearD();
056          }
057    
058          public ImportMessage clone() {
059             return new ImportMessage().mergeFrom(this);
060          }
061    
062          public ImportMessage mergeFrom(ImportMessage other) {
063             if (other.hasD()) {
064                setD(other.getD());
065             }
066             return this;
067          }
068    
069          public int serializedSizeUnframed() {
070             if (memoizedSerializedSize != -1)
071                return memoizedSerializedSize;
072    
073             int size = 0;
074             if (hasD()) {
075                size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(1, getD());
076             }
077             memoizedSerializedSize = size;
078             return size;
079          }
080    
081          public ImportMessage mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException {
082             while (true) {
083                int tag = input.readTag();
084                if ((tag & 0x07) == 4) {
085                   return this;
086                }
087                switch (tag) {
088                case 0:
089                   return this;
090                default: {
091                   break;
092                }
093                case 8:
094                   setD(input.readInt32());
095                   break;
096                }
097             }
098          }
099          public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
100             if (hasD()) {
101                output.writeInt32(1, getD());
102             }
103          }
104    
105          public static ImportMessage parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
106             return new ImportMessage().mergeUnframed(data).checktInitialized();
107          }
108    
109          public static ImportMessage parseUnframed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
110             return new ImportMessage().mergeUnframed(data).checktInitialized();
111          }
112    
113          public static ImportMessage parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
114             return new ImportMessage().mergeUnframed(data).checktInitialized();
115          }
116    
117          public static ImportMessage parseUnframed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
118             return new ImportMessage().mergeUnframed(data).checktInitialized();
119          }
120    
121          public static ImportMessage parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
122             return new ImportMessage().mergeFramed(data).checktInitialized();
123          }
124    
125          public static ImportMessage parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
126             return new ImportMessage().mergeFramed(data).checktInitialized();
127          }
128    
129          public static ImportMessage parseFramed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException {
130             return new ImportMessage().mergeFramed(data).checktInitialized();
131          }
132    
133          public static ImportMessage parseFramed(java.io.InputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException {
134             return new ImportMessage().mergeFramed(data).checktInitialized();
135          }
136    
137          public String toString() {
138             return toString(new java.lang.StringBuilder(), "").toString();
139          }
140    
141          public java.lang.StringBuilder toString(java.lang.StringBuilder sb, String prefix) {
142             if(  hasD() ) {
143                sb.append(prefix+"d: ");
144                sb.append(getD());
145                sb.append("\n");
146             }
147             return sb;
148          }
149    
150          public boolean equals(Object obj) {
151             if( obj==this )
152                return true;
153             
154             if( obj==null || obj.getClass()!=ImportMessage.class )
155                return false;
156             
157             return equals((ImportMessage)obj);
158          }
159          
160          public boolean equals(ImportMessage obj) {
161             if (hasD() ^ obj.hasD() ) 
162                return false;
163             if (hasD() && ( getD()!=obj.getD() ))
164                return false;
165             return true;
166          }
167          
168          public int hashCode() {
169             int rc=244048002;
170             if (hasD()) {
171                rc ^= ( 68^getD() );
172             }
173             return rc;
174          }
175          
176       }
177    
178       static abstract class ImportMessageBase<T> extends org.apache.activemq.protobuf.BaseMessage<T> {
179    
180          // optional int32 d = 1;
181          private int f_d = 0;
182          private boolean b_d;
183    
184          public boolean hasD() {
185             return this.b_d;
186          }
187    
188          public int getD() {
189             return this.f_d;
190          }
191    
192          public T setD(int d) {
193             loadAndClear();
194             this.b_d = true;
195             this.f_d = d;
196             return (T)this;
197          }
198    
199          public void clearD() {
200             loadAndClear();
201             this.b_d = false;
202             this.f_d = 0;
203          }
204    
205       }
206    
207    }