1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package org.kuali.rice.kew.api.document.attribute;
17  
18  import javax.xml.bind.annotation.XmlAccessType;
19  import javax.xml.bind.annotation.XmlAccessorType;
20  import javax.xml.bind.annotation.XmlElement;
21  import javax.xml.bind.annotation.XmlRootElement;
22  import javax.xml.bind.annotation.XmlType;
23  import java.math.BigInteger;
24  
25  
26  
27  
28  
29  
30  
31  @XmlRootElement(name = DocumentAttributeInteger.Constants.ROOT_ELEMENT_NAME)
32  @XmlAccessorType(XmlAccessType.NONE)
33  @XmlType(name = DocumentAttributeInteger.Constants.TYPE_NAME, propOrder = {
34      DocumentAttributeInteger.Elements.VALUE
35  })
36  public final class DocumentAttributeInteger extends DocumentAttribute {
37  
38      @XmlElement(name = Elements.VALUE, required = false)
39      private final BigInteger value;
40  
41      @SuppressWarnings("unused")
42      private DocumentAttributeInteger() {
43          this.value = null;
44      }
45  
46      private DocumentAttributeInteger(Builder builder) {
47          super(builder.getName());
48          this.value = builder.getValue();
49      }
50  
51      @Override
52      public BigInteger getValue() {
53          return value;
54      }
55  
56      @Override
57      public DocumentAttributeDataType getDataType() {
58          return DocumentAttributeDataType.INTEGER;
59      }
60  
61      
62  
63  
64      public static final class Builder extends AbstractBuilder<BigInteger> {
65  
66          private Builder(String name) {
67              super(name);
68          }
69  
70          
71  
72  
73  
74  
75  
76  
77          public static Builder create(String name) {
78              return new Builder(name);
79          }
80  
81          @Override
82          public DocumentAttributeDataType getDataType() {
83              return DocumentAttributeDataType.INTEGER;
84          }
85  
86          @Override
87          public DocumentAttributeInteger build() {
88              return new DocumentAttributeInteger(this);
89          }
90  
91      }
92  
93      
94  
95  
96      static class Constants {
97          final static String ROOT_ELEMENT_NAME = "documentAttributeInteger";
98          final static String TYPE_NAME = "DocumentAttributeIntegerType";
99      }
100 
101     
102 
103 
104     static class Elements {
105         final static String VALUE = "value";
106     }
107 
108 }