1 package org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129;
3 import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
4 import java.math.BigDecimal;
5 import org.opendaylight.yangtools.yang.common.Uint64;
8 * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string
9 * representation. In some cases it is very difficult to automate it since there can be unions such as (uint32 -
10 * uint16), or (string - uint32).
12 * The reason behind putting it under src/main/java is: This class is generated in form of a stub and needs to be
13 * finished by the user. This class is generated only once to prevent loss of user code.
16 @JsonPOJOBuilder(buildMethodName = "build", withPrefix = "set")
17 public class PmDataTypeBuilder {
18 private Uint64 _uint64;
20 private BigDecimal _decimal64;
22 public PmDataTypeBuilder() {}
24 //Aluminium uses constructor
25 public PmDataTypeBuilder(String v) {
29 public PmDataTypeBuilder setUint64(String v) {
30 _uint64 = Uint64.valueOf(v);
34 public PmDataTypeBuilder setInt64(String v) {
35 _int64 = Long.valueOf(v);
39 public PmDataTypeBuilder setDecimal64(String v) {
40 _decimal64 = new BigDecimal(v);
44 public PmDataType build() {
45 if (_uint64 != null) {
46 return new PmDataType(_uint64);
47 } else if (_int64 != null) {
48 return new PmDataType(_int64);
50 return new PmDataType(_decimal64);
54 public static PmDataType getDefaultInstance(String defaultValue) {
55 return new PmDataTypeBuilder().setUint64(defaultValue).build();