01: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software
10: * distributed under the License is distributed on an "AS IS" BASIS,
11: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: * See the License for the specific language governing permissions and
13: * limitations under the License.
14: */
15:
16: package org.acegisecurity;
17:
18: /**
19: * Stores a {@link ConfigAttribute} as a <code>String</code>.
20: *
21: * @author <A HREF="mailto:ben.alex@fremerx.com">Ben Alex</A>
22: * @version $Id: SecurityConfig.java 1669 2006-09-15 03:09:05Z benalex $
23: */
24: public class SecurityConfig implements ConfigAttribute {
25: //~ Instance fields ================================================================================================
26:
27: private String attrib;
28:
29: //~ Constructors ===================================================================================================
30:
31: public SecurityConfig(String config) {
32: this .attrib = config;
33: }
34:
35: //~ Methods ========================================================================================================
36:
37: public boolean equals(Object obj) {
38: if (obj instanceof ConfigAttribute) {
39: ConfigAttribute attr = (ConfigAttribute) obj;
40:
41: return this .attrib.equals(attr.getAttribute());
42: }
43:
44: return false;
45: }
46:
47: public String getAttribute() {
48: return this .attrib;
49: }
50:
51: public int hashCode() {
52: return this .attrib.hashCode();
53: }
54:
55: public String toString() {
56: return this.attrib;
57: }
58: }
|