01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: OrdrdUnknown.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.cmf.dam;
09:
10: import com.uwyn.rife.site.ConstrainedBean;
11: import com.uwyn.rife.site.ConstrainedProperty;
12: import com.uwyn.rife.site.Validation;
13:
14: public class OrdrdUnknown extends
15: Validation<ConstrainedBean, ConstrainedProperty> {
16: private int mId = -1;
17: private String mName = null;
18: private int mPriority = -1;
19:
20: public OrdrdUnknown() {
21: mPriority = 0;
22: }
23:
24: protected void activateValidation() {
25: addConstraint(new ConstrainedProperty("name").maxLength(64)
26: .notNull(true).notEmpty(true));
27: addConstraint(new ConstrainedProperty("unknown").rangeBegin(0)
28: .ordinal(true));
29: }
30:
31: public void setId(int id) {
32: mId = id;
33: }
34:
35: public int getId() {
36: return mId;
37: }
38:
39: public void setPriority(int priority) {
40: mPriority = priority;
41: }
42:
43: public int getPriority() {
44: return mPriority;
45: }
46:
47: public OrdrdUnknown priority(int priority) {
48: mPriority = priority;
49:
50: return this ;
51: }
52:
53: public void setName(String name) {
54: mName = name;
55: }
56:
57: public String getName() {
58: return mName;
59: }
60:
61: public OrdrdUnknown name(String name) {
62: mName = name;
63:
64: return this;
65: }
66: }
|