01: /*
02: * JBoss, Home of Professional Open Source
03: * Copyright 2005, JBoss Inc., and individual contributors as indicated
04: * by the @authors tag. See the copyright.txt in the distribution for a
05: * full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.portal.cms.security;
23:
24: import java.io.Serializable;
25:
26: /** @author Sohil Shah - sohil.shah@jboss.com - Nov 29, 2006 */
27: public class Criteria implements Serializable {
28: /**
29: *
30: */
31: private long id = 0;
32: private String name = null;
33: private String value = null;
34:
35: /**
36: *
37: *
38: */
39: public Criteria() {
40:
41: }
42:
43: /**
44: *
45: *
46: */
47: public Criteria(String name, String value) {
48: this ();
49: this .name = name;
50: this .value = value;
51: }
52:
53: /** @return */
54: public long getId() {
55: return this .id;
56: }
57:
58: /** @param key */
59: public void setId(long id) {
60: this .id = id;
61: }
62:
63: /** @return Returns the context. */
64: public String getName() {
65: return name;
66: }
67:
68: /** @param context The context to set. */
69: public void setName(String name) {
70: this .name = name;
71: }
72:
73: /** @return Returns the value. */
74: public String getValue() {
75: return value;
76: }
77:
78: /** @param value The value to set. */
79: public void setValue(String value) {
80: this .value = value;
81: }
82:
83: /**
84: *
85: */
86: public boolean equals(Object obj) {
87: boolean equals = false;
88: if (obj instanceof Criteria) {
89: Criteria input = (Criteria) obj;
90: if (input.name.equals(this .name)
91: && input.value.equals(this .value)) {
92: equals = true;
93: }
94: }
95: return equals;
96: }
97: }
|