]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org/argeo/slc/primitive/PrimitiveSpecAttribute.java
1 package org
.argeo
.slc
.primitive
;
3 import org
.argeo
.slc
.SlcException
;
4 import org
.argeo
.slc
.execution
.AbstractSpecAttribute
;
7 * A spec attribute wrapping a primitive value.
9 * @see PrimitiveAccessor
11 public class PrimitiveSpecAttribute
extends AbstractSpecAttribute
implements
13 private static final long serialVersionUID
= -566676381839825483L;
14 private String type
= "string";
15 private Object value
= null;
17 public PrimitiveSpecAttribute() {
20 public PrimitiveSpecAttribute(String type
, Object value
) {
25 public Object
getValue() {
29 public void setValue(Object value
) {
33 public String
getType() {
37 public void setType(String type
) {
38 // check whether type is recognized.
39 if (PrimitiveUtils
.typeAsClass(type
) == null)
40 throw new SlcException("Unrecognized type " + type
);
46 public String
toString() {
47 return "Primitive spec attribute [" + type
+ "]"
48 + (value
!= null ?
"=" + value
: "");