52ae92c882475e9ae9028e360f39ade3f2a18d3f
[ccsdk/features.git] /
1 package org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129;
2 import java.lang.String;
3 import java.lang.UnsupportedOperationException;
4 import java.math.BigDecimal;
5
6 import javax.annotation.processing.Generated;
7
8 import org.opendaylight.yangtools.yang.common.Decimal64;
9 import org.opendaylight.yangtools.yang.common.Uint64;
10
11 import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
12
13 /**
14  * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
15  * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
16  *
17  * The reason behind putting it under src/main/java is:
18  * 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
19  * loss of user code.
20  *
21  */
22 @Generated("mdsal-binding-generator")
23 @JsonPOJOBuilder(buildMethodName = "build", withPrefix = "set")
24 public class PmDataTypeBuilder {
25          private Uint64 _uint64;
26             private Long _int64;
27             private Decimal64 _decimal64;
28
29             public PmDataTypeBuilder() {}
30
31             //Aluminium uses constructor
32             public PmDataTypeBuilder(String v) {
33                 this.setUint64(v);
34             }
35
36             public PmDataTypeBuilder setUint64(String v) {
37                 _uint64 = Uint64.valueOf(v);
38                 return this;
39             }
40
41             public PmDataTypeBuilder setInt64(String v) {
42                 _int64 = Long.valueOf(v);
43                 return this;
44             }
45
46             public PmDataTypeBuilder setDecimal64(String v) {
47                 _decimal64 = Decimal64.valueOf(v);
48                 return this;
49             }
50
51             public PmDataType build() {
52                 if (_uint64 != null) {
53                     return new PmDataType(_uint64);
54                 } else if (_int64 != null) {
55                     return new PmDataType(_int64);
56                 } else {
57                     return new PmDataType(_decimal64);
58                 }
59             }
60
61             public static PmDataType getDefaultInstance(String defaultValue) {
62                 return new PmDataTypeBuilder().setUint64(defaultValue).build();
63             }
64
65 }