|
| 1 | +/* |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + * or more contributor license agreements. See the NOTICE file |
| 4 | + * distributed with this work for additional information |
| 5 | + * regarding copyright ownership. The ASF licenses this file |
| 6 | + * to you under the Apache License, Version 2.0 (the |
| 7 | + * "License"); you may not use this file except in compliance |
| 8 | + * with the License. You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, |
| 13 | + * software distributed under the License is distributed on an |
| 14 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + * KIND, either express or implied. See the License for the |
| 16 | + * specific language governing permissions and limitations |
| 17 | + * under the License. |
| 18 | + */ |
| 19 | +package org.apache.plc4x.java.umas.readwrite; |
| 20 | + |
| 21 | +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; |
| 22 | +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; |
| 23 | +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; |
| 24 | +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; |
| 25 | +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; |
| 26 | + |
| 27 | +import java.time.*; |
| 28 | +import java.util.*; |
| 29 | +import org.apache.plc4x.java.api.exceptions.*; |
| 30 | +import org.apache.plc4x.java.api.value.*; |
| 31 | +import org.apache.plc4x.java.spi.codegen.*; |
| 32 | +import org.apache.plc4x.java.spi.codegen.fields.*; |
| 33 | +import org.apache.plc4x.java.spi.codegen.io.*; |
| 34 | +import org.apache.plc4x.java.spi.generation.*; |
| 35 | + |
| 36 | +// Code generated by code-generation. DO NOT EDIT. |
| 37 | + |
| 38 | +/** |
| 39 | + * Read current values for all registered variables. Returns concatenated raw values in the response |
| 40 | + * — the driver must know each variable's data type to parse the byte stream. |
| 41 | + */ |
| 42 | +public class MonitorPlcReadAll extends MonitorPlcSubOperation implements Message { |
| 43 | + |
| 44 | + // Accessors for discriminator values. |
| 45 | + public Short getOperationType() { |
| 46 | + return (short) 0x07; |
| 47 | + } |
| 48 | + |
| 49 | + public MonitorPlcReadAll() { |
| 50 | + super(); |
| 51 | + } |
| 52 | + |
| 53 | + @Override |
| 54 | + protected void serializeMonitorPlcSubOperationChild(WriteBuffer writeBuffer) |
| 55 | + throws SerializationException { |
| 56 | + PositionAware positionAware = writeBuffer; |
| 57 | + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); |
| 58 | + writeBuffer.pushContext("MonitorPlcReadAll"); |
| 59 | + |
| 60 | + writeBuffer.popContext("MonitorPlcReadAll"); |
| 61 | + } |
| 62 | + |
| 63 | + @Override |
| 64 | + public int getLengthInBytes() { |
| 65 | + return (int) Math.ceil((float) getLengthInBits() / 8.0); |
| 66 | + } |
| 67 | + |
| 68 | + @Override |
| 69 | + public int getLengthInBits() { |
| 70 | + int lengthInBits = super.getLengthInBits(); |
| 71 | + MonitorPlcReadAll _value = this; |
| 72 | + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); |
| 73 | + |
| 74 | + return lengthInBits; |
| 75 | + } |
| 76 | + |
| 77 | + public static MonitorPlcSubOperationBuilder staticParseMonitorPlcSubOperationBuilder( |
| 78 | + ReadBuffer readBuffer) throws ParseException { |
| 79 | + readBuffer.pullContext("MonitorPlcReadAll"); |
| 80 | + PositionAware positionAware = readBuffer; |
| 81 | + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); |
| 82 | + |
| 83 | + readBuffer.closeContext("MonitorPlcReadAll"); |
| 84 | + // Create the instance |
| 85 | + return new MonitorPlcReadAllBuilderImpl(); |
| 86 | + } |
| 87 | + |
| 88 | + public static class MonitorPlcReadAllBuilderImpl |
| 89 | + implements MonitorPlcSubOperation.MonitorPlcSubOperationBuilder { |
| 90 | + |
| 91 | + public MonitorPlcReadAllBuilderImpl() {} |
| 92 | + |
| 93 | + public MonitorPlcReadAll build() { |
| 94 | + MonitorPlcReadAll monitorPlcReadAll = new MonitorPlcReadAll(); |
| 95 | + return monitorPlcReadAll; |
| 96 | + } |
| 97 | + } |
| 98 | + |
| 99 | + @Override |
| 100 | + public boolean equals(Object o) { |
| 101 | + if (this == o) { |
| 102 | + return true; |
| 103 | + } |
| 104 | + if (!(o instanceof MonitorPlcReadAll)) { |
| 105 | + return false; |
| 106 | + } |
| 107 | + MonitorPlcReadAll that = (MonitorPlcReadAll) o; |
| 108 | + return super.equals(that) && true; |
| 109 | + } |
| 110 | + |
| 111 | + @Override |
| 112 | + public int hashCode() { |
| 113 | + return Objects.hash(super.hashCode()); |
| 114 | + } |
| 115 | + |
| 116 | + @Override |
| 117 | + public String toString() { |
| 118 | + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); |
| 119 | + try { |
| 120 | + writeBufferBoxBased.writeSerializable(this); |
| 121 | + } catch (SerializationException e) { |
| 122 | + throw new RuntimeException(e); |
| 123 | + } |
| 124 | + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; |
| 125 | + } |
| 126 | +} |
0 commit comments