blob: 2e9400b0eb878ed79fb6191dd04b00f69cf54198 [file] [log] [blame]
slowr13fa5b02017-08-08 16:32:31 -07001/**
2 * This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org)
3 */
4
5package org.onosproject.xran.codecs.api;
6
slowr60d4d102017-08-16 18:33:58 -07007import com.fasterxml.jackson.annotation.JsonIgnore;
8import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
9import org.onosproject.xran.codecs.ber.BerLength;
10import org.onosproject.xran.codecs.ber.BerTag;
11import org.onosproject.xran.codecs.ber.types.BerBoolean;
12import org.onosproject.xran.codecs.ber.types.BerEnum;
13import org.onosproject.xran.codecs.ber.types.BerInteger;
slowr13fa5b02017-08-08 16:32:31 -070014
15import java.io.IOException;
16import java.io.InputStream;
17import java.io.Serializable;
18
19
20public class PropScell implements Serializable {
21
22 private static final long serialVersionUID = 1L;
23
24 public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
25
slowr60d4d102017-08-16 18:33:58 -070026 @JsonIgnore
slowr13fa5b02017-08-08 16:32:31 -070027 public byte[] code = null;
28 private PCIARFCN pciArfcn = null;
29 private BerBoolean crossCarrierSchedEnable = null;
30 private BerEnum caDirection = null;
31 private BerInteger deactTimer = null;
32
33 public PropScell() {
34 }
35
36 public PropScell(byte[] code) {
37 this.code = code;
38 }
39
40 public void setPciArfcn(PCIARFCN pciArfcn) {
41 this.pciArfcn = pciArfcn;
42 }
43
44 public PCIARFCN getPciArfcn() {
45 return pciArfcn;
46 }
47
48 public void setCrossCarrierSchedEnable(BerBoolean crossCarrierSchedEnable) {
49 this.crossCarrierSchedEnable = crossCarrierSchedEnable;
50 }
51
52 public BerBoolean getCrossCarrierSchedEnable() {
53 return crossCarrierSchedEnable;
54 }
55
56 public void setCaDirection(BerEnum caDirection) {
57 this.caDirection = caDirection;
58 }
59
60 public BerEnum getCaDirection() {
61 return caDirection;
62 }
63
64 public void setDeactTimer(BerInteger deactTimer) {
65 this.deactTimer = deactTimer;
66 }
67
68 public BerInteger getDeactTimer() {
69 return deactTimer;
70 }
71
72 public int encode(BerByteArrayOutputStream os) throws IOException {
73 return encode(os, true);
74 }
75
76 public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
77
78 if (code != null) {
79 for (int i = code.length - 1; i >= 0; i--) {
80 os.write(code[i]);
81 }
82 if (withTag) {
83 return tag.encode(os) + code.length;
84 }
85 return code.length;
86 }
87
88 int codeLength = 0;
89 codeLength += deactTimer.encode(os, false);
90 // write tag: CONTEXT_CLASS, PRIMITIVE, 3
91 os.write(0x83);
92 codeLength += 1;
93
94 codeLength += caDirection.encode(os, false);
95 // write tag: CONTEXT_CLASS, PRIMITIVE, 2
96 os.write(0x82);
97 codeLength += 1;
98
99 codeLength += crossCarrierSchedEnable.encode(os, false);
100 // write tag: CONTEXT_CLASS, PRIMITIVE, 1
101 os.write(0x81);
102 codeLength += 1;
103
104 codeLength += pciArfcn.encode(os, false);
105 // write tag: CONTEXT_CLASS, CONSTRUCTED, 0
106 os.write(0xA0);
107 codeLength += 1;
108
109 codeLength += BerLength.encodeLength(os, codeLength);
110
111 if (withTag) {
112 codeLength += tag.encode(os);
113 }
114
115 return codeLength;
116
117 }
118
119 public int decode(InputStream is) throws IOException {
120 return decode(is, true);
121 }
122
123 public int decode(InputStream is, boolean withTag) throws IOException {
124 int codeLength = 0;
125 int subCodeLength = 0;
126 BerTag berTag = new BerTag();
127
128 if (withTag) {
129 codeLength += tag.decodeAndCheck(is);
130 }
131
132 BerLength length = new BerLength();
133 codeLength += length.decode(is);
134
135 int totalLength = length.val;
136 codeLength += totalLength;
137
138 subCodeLength += berTag.decode(is);
139 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
140 pciArfcn = new PCIARFCN();
141 subCodeLength += pciArfcn.decode(is, false);
142 subCodeLength += berTag.decode(is);
143 }
144 else {
145 throw new IOException("Tag does not match the mandatory sequence element tag.");
146 }
147
148 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
149 crossCarrierSchedEnable = new BerBoolean();
150 subCodeLength += crossCarrierSchedEnable.decode(is, false);
151 subCodeLength += berTag.decode(is);
152 }
153 else {
154 throw new IOException("Tag does not match the mandatory sequence element tag.");
155 }
156
157 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
158 caDirection = new BerEnum();
159 subCodeLength += caDirection.decode(is, false);
160 subCodeLength += berTag.decode(is);
161 }
162 else {
163 throw new IOException("Tag does not match the mandatory sequence element tag.");
164 }
165
166 if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
167 deactTimer = new BerInteger();
168 subCodeLength += deactTimer.decode(is, false);
169 if (subCodeLength == totalLength) {
170 return codeLength;
171 }
172 }
173 throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
174
175
176 }
177
178 public void encodeAndSave(int encodingSizeGuess) throws IOException {
179 BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
180 encode(os, false);
181 code = os.getArray();
182 }
183
184 public String toString() {
185 StringBuilder sb = new StringBuilder();
186 appendAsString(sb, 0);
187 return sb.toString();
188 }
189
190 public void appendAsString(StringBuilder sb, int indentLevel) {
191
192 sb.append("{");
193 sb.append("\n");
194 for (int i = 0; i < indentLevel + 1; i++) {
195 sb.append("\t");
196 }
197 if (pciArfcn != null) {
198 sb.append("pciArfcn: ");
199 pciArfcn.appendAsString(sb, indentLevel + 1);
200 }
201 else {
202 sb.append("pciArfcn: <empty-required-field>");
203 }
204
205 sb.append(",\n");
206 for (int i = 0; i < indentLevel + 1; i++) {
207 sb.append("\t");
208 }
209 if (crossCarrierSchedEnable != null) {
210 sb.append("crossCarrierSchedEnable: ").append(crossCarrierSchedEnable);
211 }
212 else {
213 sb.append("crossCarrierSchedEnable: <empty-required-field>");
214 }
215
216 sb.append(",\n");
217 for (int i = 0; i < indentLevel + 1; i++) {
218 sb.append("\t");
219 }
220 if (caDirection != null) {
221 sb.append("caDirection: ").append(caDirection);
222 }
223 else {
224 sb.append("caDirection: <empty-required-field>");
225 }
226
227 sb.append(",\n");
228 for (int i = 0; i < indentLevel + 1; i++) {
229 sb.append("\t");
230 }
231 if (deactTimer != null) {
232 sb.append("deactTimer: ").append(deactTimer);
233 }
234 else {
235 sb.append("deactTimer: <empty-required-field>");
236 }
237
238 sb.append("\n");
239 for (int i = 0; i < indentLevel; i++) {
240 sb.append("\t");
241 }
242 sb.append("}");
243 }
244
245}
246