OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / hardware / ril / mock-ril / src / generated / java / com / android / internal / communication / MsgHeader.java
1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2
3 package com.android.internal.communication;
4
5 public  final class MsgHeader extends
6     com.google.protobuf.micro.MessageMicro {
7   public MsgHeader() {}
8   
9   // required uint32 cmd = 1;
10   public static final int CMD_FIELD_NUMBER = 1;
11   private boolean hasCmd;
12   private int cmd_ = 0;
13   public int getCmd() { return cmd_; }
14   public boolean hasCmd() { return hasCmd; }
15   public MsgHeader setCmd(int value) {
16     hasCmd = true;
17     cmd_ = value;
18     return this;
19   }
20   public MsgHeader clearCmd() {
21     hasCmd = false;
22     cmd_ = 0;
23     return this;
24   }
25   
26   // required uint32 length_data = 2;
27   public static final int LENGTH_DATA_FIELD_NUMBER = 2;
28   private boolean hasLengthData;
29   private int lengthData_ = 0;
30   public int getLengthData() { return lengthData_; }
31   public boolean hasLengthData() { return hasLengthData; }
32   public MsgHeader setLengthData(int value) {
33     hasLengthData = true;
34     lengthData_ = value;
35     return this;
36   }
37   public MsgHeader clearLengthData() {
38     hasLengthData = false;
39     lengthData_ = 0;
40     return this;
41   }
42   
43   // optional uint32 status = 3;
44   public static final int STATUS_FIELD_NUMBER = 3;
45   private boolean hasStatus;
46   private int status_ = 0;
47   public int getStatus() { return status_; }
48   public boolean hasStatus() { return hasStatus; }
49   public MsgHeader setStatus(int value) {
50     hasStatus = true;
51     status_ = value;
52     return this;
53   }
54   public MsgHeader clearStatus() {
55     hasStatus = false;
56     status_ = 0;
57     return this;
58   }
59   
60   // optional uint64 token = 4;
61   public static final int TOKEN_FIELD_NUMBER = 4;
62   private boolean hasToken;
63   private long token_ = 0L;
64   public long getToken() { return token_; }
65   public boolean hasToken() { return hasToken; }
66   public MsgHeader setToken(long value) {
67     hasToken = true;
68     token_ = value;
69     return this;
70   }
71   public MsgHeader clearToken() {
72     hasToken = false;
73     token_ = 0L;
74     return this;
75   }
76   
77   public final MsgHeader clear() {
78     clearCmd();
79     clearLengthData();
80     clearStatus();
81     clearToken();
82     cachedSize = -1;
83     return this;
84   }
85   
86   public final boolean isInitialized() {
87     if (!hasCmd) return false;
88     if (!hasLengthData) return false;
89     return true;
90   }
91   
92   public void writeTo(com.google.protobuf.micro.CodedOutputStreamMicro output)
93                       throws java.io.IOException {
94     if (hasCmd()) {
95       output.writeUInt32(1, getCmd());
96     }
97     if (hasLengthData()) {
98       output.writeUInt32(2, getLengthData());
99     }
100     if (hasStatus()) {
101       output.writeUInt32(3, getStatus());
102     }
103     if (hasToken()) {
104       output.writeUInt64(4, getToken());
105     }
106   }
107   
108   private int cachedSize = -1;
109   public int getCachedSize() {
110     if (cachedSize < 0) {
111       // getSerializedSize sets cachedSize
112       getSerializedSize();
113     }
114     return cachedSize;
115   }
116   
117   public int getSerializedSize() {
118     int size = 0;
119     if (hasCmd()) {
120       size += com.google.protobuf.micro.CodedOutputStreamMicro
121         .computeUInt32Size(1, getCmd());
122     }
123     if (hasLengthData()) {
124       size += com.google.protobuf.micro.CodedOutputStreamMicro
125         .computeUInt32Size(2, getLengthData());
126     }
127     if (hasStatus()) {
128       size += com.google.protobuf.micro.CodedOutputStreamMicro
129         .computeUInt32Size(3, getStatus());
130     }
131     if (hasToken()) {
132       size += com.google.protobuf.micro.CodedOutputStreamMicro
133         .computeUInt64Size(4, getToken());
134     }
135     cachedSize = size;
136     return size;
137   }
138   
139   public MsgHeader mergeFrom(
140       com.google.protobuf.micro.CodedInputStreamMicro input)
141       throws java.io.IOException {
142     while (true) {
143       int tag = input.readTag();
144       switch (tag) {
145         case 0:
146           return this;
147         default: {
148           if (!parseUnknownField(input, tag)) {
149             return this;
150           }
151           break;
152         }
153         case 8: {
154           setCmd(input.readUInt32());
155           break;
156         }
157         case 16: {
158           setLengthData(input.readUInt32());
159           break;
160         }
161         case 24: {
162           setStatus(input.readUInt32());
163           break;
164         }
165         case 32: {
166           setToken(input.readUInt64());
167           break;
168         }
169       }
170     }
171   }
172   
173   public static MsgHeader parseFrom(byte[] data)
174       throws com.google.protobuf.micro.InvalidProtocolBufferMicroException {
175     return (MsgHeader) (new MsgHeader().mergeFrom(data));
176   }
177   
178   public static MsgHeader parseFrom(
179           com.google.protobuf.micro.CodedInputStreamMicro input)
180       throws java.io.IOException {
181     return (MsgHeader) (new MsgHeader().mergeFrom(input));
182   }
183   
184 }
185