summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/common-yang/openroadm-pm-types/src/main/java
diff options
context:
space:
mode:
authorMichael DÜrre <michael.duerre@highstreet-technologies.com>2021-06-30 08:26:04 +0200
committerMichael DÜrre <michael.duerre@highstreet-technologies.com>2021-06-30 08:26:22 +0200
commitfa0febc0614b1f9afb4be3c5dd3446f4a554a232 (patch)
treed048ac676d1ea48a9cb00afbc84ed668772d0e4a /sdnr/wt/common-yang/openroadm-pm-types/src/main/java
parent6360ba16069370151019865c504e1bec1d896e8c (diff)
fix sdnr features startup
source out multiple used yang file due resolving conflict Issue-ID: CCSDK-3359 Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com> Change-Id: I59d863e43a7e29e98d104d20371226ef59837e61 Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/common-yang/openroadm-pm-types/src/main/java')
-rw-r--r--sdnr/wt/common-yang/openroadm-pm-types/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev191129/PmDataTypeBuilder.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/sdnr/wt/common-yang/openroadm-pm-types/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev191129/PmDataTypeBuilder.java b/sdnr/wt/common-yang/openroadm-pm-types/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev191129/PmDataTypeBuilder.java
new file mode 100644
index 000000000..f89197b82
--- /dev/null
+++ b/sdnr/wt/common-yang/openroadm-pm-types/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev191129/PmDataTypeBuilder.java
@@ -0,0 +1,58 @@
+package org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129;
+
+import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
+import java.math.BigDecimal;
+import org.opendaylight.yangtools.yang.common.Uint64;
+
+/**
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string
+ * representation. In some cases it is very difficult to automate it since there can be unions such as (uint32 -
+ * uint16), or (string - uint32).
+ *
+ * The reason behind putting it under src/main/java is: This class is generated in form of a stub and needs to be
+ * finished by the user. This class is generated only once to prevent loss of user code.
+ *
+ */
+@JsonPOJOBuilder(buildMethodName = "build", withPrefix = "set")
+public class PmDataTypeBuilder {
+ private Uint64 _uint64;
+ private Long _int64;
+ private BigDecimal _decimal64;
+
+ public PmDataTypeBuilder() {}
+
+ //Aluminium uses constructor
+ public PmDataTypeBuilder(String v) {
+ this.setUint64(v);
+ }
+
+ public PmDataTypeBuilder setUint64(String v) {
+ _uint64 = Uint64.valueOf(v);
+ return this;
+ }
+
+ public PmDataTypeBuilder setInt64(String v) {
+ _int64 = Long.valueOf(v);
+ return this;
+ }
+
+ public PmDataTypeBuilder setDecimal64(String v) {
+ _decimal64 = new BigDecimal(v);
+ return this;
+ }
+
+ public PmDataType build() {
+ if (_uint64 != null) {
+ return new PmDataType(_uint64);
+ } else if (_int64 != null) {
+ return new PmDataType(_int64);
+ } else {
+ return new PmDataType(_decimal64);
+ }
+ }
+
+ public static PmDataType getDefaultInstance(String defaultValue) {
+ return new PmDataTypeBuilder().setUint64(defaultValue).build();
+ }
+
+}