001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or (at your option) any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * Created on Jan 23, 2004
017: */
018: package org.geotools.validation.dto;
019:
020: /**
021: * ArgumentConfig purpose.
022: *
023: * <p>
024: * Description of ArgumentConfig ...
025: * </p>
026: *
027: * @author dzwiers, Refractions Research, Inc.
028: * @author $Author: dmzwiers $ (last modification)
029: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/validation/src/main/java/org/geotools/validation/dto/ArgumentDTO.java $
030: * @version $Id: ArgumentDTO.java 20884 2006-08-07 14:10:46Z jgarnett $
031: */
032: public class ArgumentDTO {
033: private String name;
034: private boolean _final;
035: private Object value;
036:
037: /**
038: * ArgumentConfig constructor.
039: *
040: * <p>
041: * Description
042: * </p>
043: */
044: public ArgumentDTO() {
045: }
046:
047: public ArgumentDTO(ArgumentDTO dto) {
048: name = dto.getName();
049: _final = isFinal();
050: value = dto.getValue();
051: }
052:
053: public Object clone() {
054: return new ArgumentDTO(this );
055: }
056:
057: public boolean equals(Object obj) {
058: boolean r = true;
059:
060: if ((obj == null) || !(obj instanceof ArgumentDTO)) {
061: return false;
062: }
063:
064: ArgumentDTO dto = (ArgumentDTO) obj;
065: r = r && (dto.isFinal() == _final);
066:
067: if (name != null) {
068: r = r && (name.equals(dto.getName()));
069: } else if (dto.getName() != null) {
070: return false;
071: }
072:
073: if (value != null) {
074: r = r && (value.equals(dto.getValue()));
075: } else if (dto.getValue() != null) {
076: return false;
077: }
078:
079: return r;
080: }
081:
082: public int hashCode() {
083: int r = 1;
084:
085: if (name != null) {
086: r *= name.hashCode();
087: }
088:
089: if (value != null) {
090: r *= value.hashCode();
091: }
092:
093: return r;
094: }
095:
096: /**
097: * Access _final property.
098: *
099: * @return Returns the _final.
100: */
101: public boolean isFinal() {
102: return _final;
103: }
104:
105: /**
106: * Set _final to _final.
107: *
108: * @param _final The _final to set.
109: */
110: public void setFinal(boolean _final) {
111: this ._final = _final;
112: }
113:
114: /**
115: * Access name property.
116: *
117: * @return Returns the name.
118: */
119: public String getName() {
120: return name;
121: }
122:
123: /**
124: * Set name to name.
125: *
126: * @param name The name to set.
127: */
128: public void setName(String name) {
129: this .name = name;
130: }
131:
132: /**
133: * Access value property.
134: *
135: * @return Returns the value.
136: */
137: public Object getValue() {
138: return value;
139: }
140:
141: /**
142: * Set value to value.
143: *
144: * @param value The value to set.
145: */
146: public void setValue(Object value) {
147: this.value = value;
148: }
149: }
|