Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /java /eclipse-basyx_basyx-java-server-sdk /basyx.submodelservice /basyx.submodelservice.component /example /sources /SquareOperation.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 SquareOperation { | |
| public OperationVariable[] invoke(OperationVariable[] vars) { | |
| Property prop = (Property) vars[0].getValue(); | |
| int 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:
- 780 Bytes
- Xet hash:
- 105c2532765305bc06e0ab009da166e521dc47842add2366354ba9334c19b939
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.