-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
73 changed files
with
11,872 additions
and
299 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
162 changes: 162 additions & 0 deletions
162
.../opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/ActionMethodDataType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.plc4x.java.opcua.readwrite; | ||
|
||
import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; | ||
import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; | ||
import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; | ||
import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; | ||
import static org.apache.plc4x.java.spi.generation.StaticHelper.*; | ||
|
||
import java.time.*; | ||
import java.util.*; | ||
import org.apache.plc4x.java.api.exceptions.*; | ||
import org.apache.plc4x.java.api.value.*; | ||
import org.apache.plc4x.java.spi.codegen.*; | ||
import org.apache.plc4x.java.spi.codegen.fields.*; | ||
import org.apache.plc4x.java.spi.codegen.io.*; | ||
import org.apache.plc4x.java.spi.generation.*; | ||
|
||
// Code generated by code-generation. DO NOT EDIT. | ||
|
||
public class ActionMethodDataType extends ExtensionObjectDefinition implements Message { | ||
|
||
// Accessors for discriminator values. | ||
public Integer getExtensionId() { | ||
return (int) 18599; | ||
} | ||
|
||
// Properties. | ||
protected final NodeId objectId; | ||
protected final NodeId methodId; | ||
|
||
public ActionMethodDataType(NodeId objectId, NodeId methodId) { | ||
super(); | ||
this.objectId = objectId; | ||
this.methodId = methodId; | ||
} | ||
|
||
public NodeId getObjectId() { | ||
return objectId; | ||
} | ||
|
||
public NodeId getMethodId() { | ||
return methodId; | ||
} | ||
|
||
@Override | ||
protected void serializeExtensionObjectDefinitionChild(WriteBuffer writeBuffer) | ||
throws SerializationException { | ||
PositionAware positionAware = writeBuffer; | ||
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); | ||
writeBuffer.pushContext("ActionMethodDataType"); | ||
|
||
// Simple Field (objectId) | ||
writeSimpleField("objectId", objectId, writeComplex(writeBuffer)); | ||
|
||
// Simple Field (methodId) | ||
writeSimpleField("methodId", methodId, writeComplex(writeBuffer)); | ||
|
||
writeBuffer.popContext("ActionMethodDataType"); | ||
} | ||
|
||
@Override | ||
public int getLengthInBytes() { | ||
return (int) Math.ceil((float) getLengthInBits() / 8.0); | ||
} | ||
|
||
@Override | ||
public int getLengthInBits() { | ||
int lengthInBits = super.getLengthInBits(); | ||
ActionMethodDataType _value = this; | ||
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); | ||
|
||
// Simple field (objectId) | ||
lengthInBits += objectId.getLengthInBits(); | ||
|
||
// Simple field (methodId) | ||
lengthInBits += methodId.getLengthInBits(); | ||
|
||
return lengthInBits; | ||
} | ||
|
||
public static ExtensionObjectDefinitionBuilder staticParseExtensionObjectDefinitionBuilder( | ||
ReadBuffer readBuffer, Integer extensionId) throws ParseException { | ||
readBuffer.pullContext("ActionMethodDataType"); | ||
PositionAware positionAware = readBuffer; | ||
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); | ||
|
||
NodeId objectId = | ||
readSimpleField("objectId", readComplex(() -> NodeId.staticParse(readBuffer), readBuffer)); | ||
|
||
NodeId methodId = | ||
readSimpleField("methodId", readComplex(() -> NodeId.staticParse(readBuffer), readBuffer)); | ||
|
||
readBuffer.closeContext("ActionMethodDataType"); | ||
// Create the instance | ||
return new ActionMethodDataTypeBuilderImpl(objectId, methodId); | ||
} | ||
|
||
public static class ActionMethodDataTypeBuilderImpl | ||
implements ExtensionObjectDefinition.ExtensionObjectDefinitionBuilder { | ||
private final NodeId objectId; | ||
private final NodeId methodId; | ||
|
||
public ActionMethodDataTypeBuilderImpl(NodeId objectId, NodeId methodId) { | ||
this.objectId = objectId; | ||
this.methodId = methodId; | ||
} | ||
|
||
public ActionMethodDataType build() { | ||
ActionMethodDataType actionMethodDataType = new ActionMethodDataType(objectId, methodId); | ||
return actionMethodDataType; | ||
} | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (!(o instanceof ActionMethodDataType)) { | ||
return false; | ||
} | ||
ActionMethodDataType that = (ActionMethodDataType) o; | ||
return (getObjectId() == that.getObjectId()) | ||
&& (getMethodId() == that.getMethodId()) | ||
&& super.equals(that) | ||
&& true; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(super.hashCode(), getObjectId(), getMethodId()); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); | ||
try { | ||
writeBufferBoxBased.writeSerializable(this); | ||
} catch (SerializationException e) { | ||
throw new RuntimeException(e); | ||
} | ||
return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
...j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/ActionState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.plc4x.java.opcua.readwrite; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
// Code generated by code-generation. DO NOT EDIT. | ||
|
||
public enum ActionState { | ||
actionStateIdle((long) 0L), | ||
actionStateExecuting((long) 1L), | ||
actionStateDone((long) 2L); | ||
private static final Map<Long, ActionState> map; | ||
|
||
static { | ||
map = new HashMap<>(); | ||
for (ActionState value : ActionState.values()) { | ||
map.put((long) value.getValue(), value); | ||
} | ||
} | ||
|
||
private final long value; | ||
|
||
ActionState(long value) { | ||
this.value = value; | ||
} | ||
|
||
public long getValue() { | ||
return value; | ||
} | ||
|
||
public static ActionState enumForValue(long value) { | ||
return map.get(value); | ||
} | ||
|
||
public static Boolean isDefined(long value) { | ||
return map.containsKey(value); | ||
} | ||
} |
Oops, something went wrong.