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