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- */
1+ // Licensed to the Apache Software Foundation (ASF) under one
2+ // or more contributor license agreements. See the NOTICE file
3+ // distributed with this work for additional information
4+ // regarding copyright ownership. The ASF licenses this file
5+ // to you under the Apache License, Version 2.0 (the
6+ // "License"); you may not use this file except in compliance
7+ // with the License. You may obtain a copy of the License at
8+ //
9+ // https://www.apache.org/licenses/LICENSE-2.0
10+ //
11+ // Unless required by applicable law or agreed to in writing,
12+ // software distributed under the License is distributed on an
13+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+ // KIND, either express or implied. See the License for the
15+ // specific language governing permissions and limitations
16+ // under the License.
1917package org .apache .plc4x .java .opcua .readwrite ;
2018
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-
19+ import org .apache .plc4x .java .spi .buffers .api .Message ;
20+ import org .apache .plc4x .java .spi .buffers .api .ReadBuffer ;
21+ import org .apache .plc4x .java .spi .buffers .api .WithOption ;
22+ import org .apache .plc4x .java .spi .buffers .api .WriteBuffer ;
23+ import org .apache .plc4x .java .spi .buffers .api .exceptions .BufferException ;
24+ import org .apache .plc4x .java .spi .fields .data .reader .DataReaderFactory ;
25+ import org .apache .plc4x .java .spi .fields .data .writer .DataWriterFactory ;
26+ import org .apache .plc4x .java .spi .fields .fields .reader .FieldReaderFactory ;
27+ import org .apache .plc4x .java .spi .fields .fields .writer .FieldWriterFactory ;
28+ import org .apache .plc4x .java .spi .fields .utils .ThreadLocalHelper ;
29+
30+ /**
31+ * Code generated by code-generation. DO NOT EDIT.
32+ */
3833public class AliasCategoryUpdateDataType extends ExtensionObjectDefinition implements Message {
39-
40- // Accessors for discriminator values.
41- public Integer getExtensionId () {
42- return (int ) 24054 ;
43- }
44-
45- // Properties.
4634 protected final PortableNodeId category ;
35+
4736 protected final long lastChange ;
4837
49- public AliasCategoryUpdateDataType (PortableNodeId category , long lastChange ) {
50- super ();
38+ public AliasCategoryUpdateDataType (PortableNodeId category , Long lastChange ) {
5139 this .category = category ;
5240 this .lastChange = lastChange ;
5341 }
5442
43+ /**
44+ * Discriminator field extensionId
45+ */
46+ @ Override
47+ public int getExtensionId () {
48+ return (int ) 24054 ;
49+ }
50+
51+ /**
52+ * Property field category
53+ */
5554 public PortableNodeId getCategory () {
5655 return category ;
5756 }
5857
58+ /**
59+ * Property field lastChange
60+ */
5961 public long getLastChange () {
6062 return lastChange ;
6163 }
6264
63- @ Override
64- protected void serializeExtensionObjectDefinitionChild ( WriteBuffer writeBuffer )
65- throws SerializationException {
66- PositionAware positionAware = writeBuffer ;
65+ public static ExtensionObjectDefinitionBuilder staticParseExtensionObjectDefinitionBuilder (
66+ ReadBuffer readBuffer , int extensionId ) throws BufferException {
67+ readBuffer . pushContext ( WithOption . WithName ( "AliasCategoryUpdateDataType" ), WithOption . WithFloatEncoding ( "IEEE754" ), WithOption . WithSignedIntegerEncoding ( "twos-complement" ), WithOption . WithUnsignedIntegerEncoding ( "unsigned-binary" ), WithOption . WithStringEncoding ( "UTF8" ));
68+ int startPos = readBuffer . getPositionInBits () ;
6769 boolean _lastItem = ThreadLocalHelper .lastItemThreadLocal .get ();
68- writeBuffer .pushContext ("AliasCategoryUpdateDataType" );
70+ // Simple Field: category
71+ PortableNodeId category = FieldReaderFactory .readSimpleField (DataReaderFactory .readComplex (() -> (PortableNodeId ) PortableNodeId .staticParse (readBuffer , (int ) (24108 )), readBuffer ), WithOption .WithName ("category" ), WithOption .WithFloatEncoding ("IEEE754" ), WithOption .WithSignedIntegerEncoding ("twos-complement" ), WithOption .WithUnsignedIntegerEncoding ("unsigned-binary" ), WithOption .WithStringEncoding ("UTF8" ));
6972
70- // Simple Field (category)
71- writeSimpleField ( "category" , category , writeComplex ( writeBuffer ));
73+ // Simple Field: lastChange
74+ long lastChange = FieldReaderFactory . readSimpleField ( DataReaderFactory . readUnsignedLong ( readBuffer , 32 ), WithOption . WithName ( "lastChange" ), WithOption . WithFloatEncoding ( "IEEE754" ), WithOption . WithSignedIntegerEncoding ( "twos-complement" ), WithOption . WithUnsignedIntegerEncoding ( "unsigned-binary" ), WithOption . WithStringEncoding ( "UTF8" ));
7275
73- // Simple Field (lastChange)
74- writeSimpleField ("lastChange" , lastChange , writeUnsignedLong (writeBuffer , 32 ));
76+ readBuffer .popContext ();
77+ return new ExtensionObjectDefinitionBuilderImpl (category , lastChange );
78+ }
79+
80+ protected void serializeExtensionObjectDefinitionChild (WriteBuffer writeBuffer ) throws
81+ BufferException {
82+ writeBuffer .pushContext (WithOption .WithName ("AliasCategoryUpdateDataType" ), WithOption .WithFloatEncoding ("IEEE754" ), WithOption .WithSignedIntegerEncoding ("twos-complement" ), WithOption .WithUnsignedIntegerEncoding ("unsigned-binary" ), WithOption .WithStringEncoding ("UTF8" ));
83+ int startPos = writeBuffer .getPositionInBits ();
84+ boolean _lastItem = ThreadLocalHelper .lastItemThreadLocal .get ();
85+ // Simple Field: category
86+ FieldWriterFactory .writeSimpleField ((PortableNodeId ) category , DataWriterFactory .writeComplex (writeBuffer ), WithOption .WithName ("category" ), WithOption .WithFloatEncoding ("IEEE754" ), WithOption .WithSignedIntegerEncoding ("twos-complement" ), WithOption .WithUnsignedIntegerEncoding ("unsigned-binary" ), WithOption .WithStringEncoding ("UTF8" ));
7587
76- writeBuffer .popContext ("AliasCategoryUpdateDataType" );
88+ // Simple Field: lastChange
89+ FieldWriterFactory .writeSimpleField ((long ) lastChange , DataWriterFactory .writeUnsignedLong (writeBuffer , 32 ), WithOption .WithName ("lastChange" ), WithOption .WithFloatEncoding ("IEEE754" ), WithOption .WithSignedIntegerEncoding ("twos-complement" ), WithOption .WithUnsignedIntegerEncoding ("unsigned-binary" ), WithOption .WithStringEncoding ("UTF8" ));
90+
91+ writeBuffer .popContext ();
7792 }
7893
7994 @ Override
@@ -86,83 +101,27 @@ public int getLengthInBits() {
86101 int lengthInBits = super .getLengthInBits ();
87102 AliasCategoryUpdateDataType _value = this ;
88103 boolean _lastItem = ThreadLocalHelper .lastItemThreadLocal .get ();
89-
90- // Simple field (category)
104+ // Simple Field: category
91105 lengthInBits += category .getLengthInBits ();
92106
93- // Simple field ( lastChange)
107+ // Simple Field: lastChange
94108 lengthInBits += 32 ;
95109
96110 return lengthInBits ;
97111 }
98112
99- public static ExtensionObjectDefinitionBuilder staticParseExtensionObjectDefinitionBuilder (
100- ReadBuffer readBuffer , Integer extensionId ) throws ParseException {
101- readBuffer .pullContext ("AliasCategoryUpdateDataType" );
102- PositionAware positionAware = readBuffer ;
103- boolean _lastItem = ThreadLocalHelper .lastItemThreadLocal .get ();
104-
105- PortableNodeId category =
106- readSimpleField (
107- "category" ,
108- readComplex (
109- () ->
110- (PortableNodeId )
111- ExtensionObjectDefinition .staticParse (readBuffer , (int ) (24108 )),
112- readBuffer ));
113-
114- long lastChange = readSimpleField ("lastChange" , readUnsignedLong (readBuffer , 32 ));
115-
116- readBuffer .closeContext ("AliasCategoryUpdateDataType" );
117- // Create the instance
118- return new AliasCategoryUpdateDataTypeBuilderImpl (category , lastChange );
119- }
120-
121- public static class AliasCategoryUpdateDataTypeBuilderImpl
122- implements ExtensionObjectDefinition .ExtensionObjectDefinitionBuilder {
113+ public static class ExtensionObjectDefinitionBuilderImpl implements ExtensionObjectDefinition .ExtensionObjectDefinitionBuilder {
123114 private final PortableNodeId category ;
115+
124116 private final long lastChange ;
125117
126- public AliasCategoryUpdateDataTypeBuilderImpl (PortableNodeId category , long lastChange ) {
118+ public ExtensionObjectDefinitionBuilderImpl (PortableNodeId category , long lastChange ) {
127119 this .category = category ;
128120 this .lastChange = lastChange ;
129121 }
130122
131- public AliasCategoryUpdateDataType build () {
132- AliasCategoryUpdateDataType aliasCategoryUpdateDataType =
133- new AliasCategoryUpdateDataType (category , lastChange );
134- return aliasCategoryUpdateDataType ;
135- }
136- }
137-
138- @ Override
139- public boolean equals (Object o ) {
140- if (this == o ) {
141- return true ;
142- }
143- if (!(o instanceof AliasCategoryUpdateDataType )) {
144- return false ;
145- }
146- AliasCategoryUpdateDataType that = (AliasCategoryUpdateDataType ) o ;
147- return (getCategory () == that .getCategory ())
148- && (getLastChange () == that .getLastChange ())
149- && super .equals (that )
150- && true ;
151- }
152-
153- @ Override
154- public int hashCode () {
155- return Objects .hash (super .hashCode (), getCategory (), getLastChange ());
156- }
157-
158- @ Override
159- public String toString () {
160- WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased (true , true );
161- try {
162- writeBufferBoxBased .writeSerializable (this );
163- } catch (SerializationException e ) {
164- throw new RuntimeException (e );
123+ public ExtensionObjectDefinition build () {
124+ return new AliasCategoryUpdateDataType (category , lastChange );
165125 }
166- return "\n " + writeBufferBoxBased .getBox ().toString () + "\n " ;
167126 }
168127}
0 commit comments