Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /java /eclipse-basyx_basyx-java-server-sdk /basyx.submodelservice /basyx.submodelservice-feature-operation-dispatching /test /wrongsyntax /TestOperation.java
| import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; | |
| import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; | |
| import org.eclipse.digitaltwin.aas4j.v3.model.Property; | |
| import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; | |
| import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; | |
| public class TestOperation { | |
| public OperationVariable[] invoke(OperationVariable[] vars) { | |
| Property prop = (Property) vars[0].getValue(); | |
| // can't assign int to string | |
| String value = Integer.parseInt(prop.getValue()); | |
| int result = value * value; | |
| Property toReturn = new DefaultProperty.Builder().value(String.valueOf(result)).valueType(DataTypeDefXsd.INT).build(); | |
| return new OperationVariable[] {new DefaultOperationVariable.Builder().value(toReturn).build()}; | |
| } | |
| } | |
Xet Storage Details
- Size:
- 813 Bytes
- Xet hash:
- a461e49d7d1cda342ee9838f5e60acf4b7df6d2439c40f14c1a8774005c9e867
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.