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