| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kew.api.rule; |
| 17 | |
|
| 18 | |
import java.io.Serializable; |
| 19 | |
import java.util.Collection; |
| 20 | |
import javax.xml.bind.annotation.XmlAccessType; |
| 21 | |
import javax.xml.bind.annotation.XmlAccessorType; |
| 22 | |
import javax.xml.bind.annotation.XmlAnyElement; |
| 23 | |
import javax.xml.bind.annotation.XmlElement; |
| 24 | |
import javax.xml.bind.annotation.XmlRootElement; |
| 25 | |
import javax.xml.bind.annotation.XmlType; |
| 26 | |
import org.kuali.rice.core.api.CoreConstants; |
| 27 | |
import org.kuali.rice.core.api.mo.AbstractDataTransferObject; |
| 28 | |
import org.kuali.rice.core.api.mo.ModelBuilder; |
| 29 | |
import org.w3c.dom.Element; |
| 30 | |
|
| 31 | |
@XmlRootElement(name = RuleTemplateOption.Constants.ROOT_ELEMENT_NAME) |
| 32 | |
@XmlAccessorType(XmlAccessType.NONE) |
| 33 | |
@XmlType(name = RuleTemplateOption.Constants.TYPE_NAME, propOrder = { |
| 34 | |
RuleTemplateOption.Elements.VALUE, |
| 35 | |
RuleTemplateOption.Elements.RULE_TEMPLATE_ID, |
| 36 | |
RuleTemplateOption.Elements.CODE, |
| 37 | |
RuleTemplateOption.Elements.ID, |
| 38 | |
CoreConstants.CommonElements.VERSION_NUMBER, |
| 39 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS |
| 40 | |
}) |
| 41 | 0 | public final class RuleTemplateOption |
| 42 | |
extends AbstractDataTransferObject |
| 43 | |
implements RuleTemplateOptionContract |
| 44 | |
{ |
| 45 | |
|
| 46 | |
@XmlElement(name = Elements.VALUE, required = false) |
| 47 | |
private final String value; |
| 48 | |
@XmlElement(name = Elements.RULE_TEMPLATE_ID, required = false) |
| 49 | |
private final String ruleTemplateId; |
| 50 | |
@XmlElement(name = Elements.CODE, required = false) |
| 51 | |
private final String code; |
| 52 | |
@XmlElement(name = Elements.ID, required = false) |
| 53 | |
private final String id; |
| 54 | |
@XmlElement(name = CoreConstants.CommonElements.VERSION_NUMBER, required = false) |
| 55 | |
private final Long versionNumber; |
| 56 | 0 | @SuppressWarnings("unused") |
| 57 | |
@XmlAnyElement |
| 58 | |
private final Collection<Element> _futureElements = null; |
| 59 | |
|
| 60 | |
|
| 61 | |
|
| 62 | |
|
| 63 | |
|
| 64 | 0 | private RuleTemplateOption() { |
| 65 | 0 | this.value = null; |
| 66 | 0 | this.ruleTemplateId = null; |
| 67 | 0 | this.code = null; |
| 68 | 0 | this.id = null; |
| 69 | 0 | this.versionNumber = null; |
| 70 | 0 | } |
| 71 | |
|
| 72 | 0 | private RuleTemplateOption(Builder builder) { |
| 73 | 0 | this.value = builder.getValue(); |
| 74 | 0 | this.ruleTemplateId = builder.getRuleTemplateId(); |
| 75 | 0 | this.code = builder.getCode(); |
| 76 | 0 | this.id = builder.getId(); |
| 77 | 0 | this.versionNumber = builder.getVersionNumber(); |
| 78 | 0 | } |
| 79 | |
|
| 80 | |
@Override |
| 81 | |
public String getValue() { |
| 82 | 0 | return this.value; |
| 83 | |
} |
| 84 | |
|
| 85 | |
@Override |
| 86 | |
public String getRuleTemplateId() { |
| 87 | 0 | return this.ruleTemplateId; |
| 88 | |
} |
| 89 | |
|
| 90 | |
@Override |
| 91 | |
public String getCode() { |
| 92 | 0 | return this.code; |
| 93 | |
} |
| 94 | |
|
| 95 | |
@Override |
| 96 | |
public String getId() { |
| 97 | 0 | return this.id; |
| 98 | |
} |
| 99 | |
|
| 100 | |
@Override |
| 101 | |
public Long getVersionNumber() { |
| 102 | 0 | return this.versionNumber; |
| 103 | |
} |
| 104 | |
|
| 105 | |
|
| 106 | |
|
| 107 | |
|
| 108 | |
|
| 109 | |
|
| 110 | 0 | public final static class Builder |
| 111 | |
implements Serializable, ModelBuilder, RuleTemplateOptionContract |
| 112 | |
{ |
| 113 | |
|
| 114 | |
private String value; |
| 115 | |
private String ruleTemplateId; |
| 116 | |
private String code; |
| 117 | |
private String id; |
| 118 | |
private Long versionNumber; |
| 119 | |
|
| 120 | 0 | private Builder() { |
| 121 | |
|
| 122 | 0 | } |
| 123 | |
|
| 124 | |
public static Builder create() { |
| 125 | |
|
| 126 | 0 | return new Builder(); |
| 127 | |
} |
| 128 | |
|
| 129 | |
public static Builder create(RuleTemplateOptionContract contract) { |
| 130 | 0 | if (contract == null) { |
| 131 | 0 | throw new IllegalArgumentException("contract was null"); |
| 132 | |
} |
| 133 | |
|
| 134 | 0 | Builder builder = create(); |
| 135 | 0 | builder.setValue(contract.getValue()); |
| 136 | 0 | builder.setRuleTemplateId(contract.getRuleTemplateId()); |
| 137 | 0 | builder.setCode(contract.getCode()); |
| 138 | 0 | builder.setId(contract.getId()); |
| 139 | 0 | builder.setVersionNumber(contract.getVersionNumber()); |
| 140 | 0 | return builder; |
| 141 | |
} |
| 142 | |
|
| 143 | |
public RuleTemplateOption build() { |
| 144 | 0 | return new RuleTemplateOption(this); |
| 145 | |
} |
| 146 | |
|
| 147 | |
@Override |
| 148 | |
public String getValue() { |
| 149 | 0 | return this.value; |
| 150 | |
} |
| 151 | |
|
| 152 | |
@Override |
| 153 | |
public String getRuleTemplateId() { |
| 154 | 0 | return this.ruleTemplateId; |
| 155 | |
} |
| 156 | |
|
| 157 | |
@Override |
| 158 | |
public String getCode() { |
| 159 | 0 | return this.code; |
| 160 | |
} |
| 161 | |
|
| 162 | |
@Override |
| 163 | |
public String getId() { |
| 164 | 0 | return this.id; |
| 165 | |
} |
| 166 | |
|
| 167 | |
@Override |
| 168 | |
public Long getVersionNumber() { |
| 169 | 0 | return this.versionNumber; |
| 170 | |
} |
| 171 | |
|
| 172 | |
public void setValue(String value) { |
| 173 | |
|
| 174 | 0 | this.value = value; |
| 175 | 0 | } |
| 176 | |
|
| 177 | |
public void setRuleTemplateId(String ruleTemplateId) { |
| 178 | |
|
| 179 | 0 | this.ruleTemplateId = ruleTemplateId; |
| 180 | 0 | } |
| 181 | |
|
| 182 | |
public void setCode(String code) { |
| 183 | |
|
| 184 | 0 | this.code = code; |
| 185 | 0 | } |
| 186 | |
|
| 187 | |
public void setId(String id) { |
| 188 | |
|
| 189 | 0 | this.id = id; |
| 190 | 0 | } |
| 191 | |
|
| 192 | |
public void setVersionNumber(Long versionNumber) { |
| 193 | |
|
| 194 | 0 | this.versionNumber = versionNumber; |
| 195 | 0 | } |
| 196 | |
|
| 197 | |
} |
| 198 | |
|
| 199 | |
|
| 200 | |
|
| 201 | |
|
| 202 | |
|
| 203 | |
|
| 204 | 0 | static class Constants { |
| 205 | |
|
| 206 | |
final static String ROOT_ELEMENT_NAME = "ruleTemplateOption"; |
| 207 | |
final static String TYPE_NAME = "RuleTemplateOptionType"; |
| 208 | |
|
| 209 | |
} |
| 210 | |
|
| 211 | |
|
| 212 | |
|
| 213 | |
|
| 214 | |
|
| 215 | |
|
| 216 | 0 | static class Elements { |
| 217 | |
|
| 218 | |
final static String VALUE = "value"; |
| 219 | |
final static String RULE_TEMPLATE_ID = "ruleTemplateId"; |
| 220 | |
final static String CODE = "code"; |
| 221 | |
final static String ID = "id"; |
| 222 | |
|
| 223 | |
} |
| 224 | |
|
| 225 | |
} |