01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent.xml.elements;
19:
20: public class PackageImportElement {
21: private String order = "1";
22:
23: private String fileName;
24:
25: public void setOrder(final String order) {
26: this .order = order;
27: }
28:
29: public String getOrder() {
30: return order;
31: }
32:
33: public Integer getOrderNumber() {
34: try {
35: return new Integer(getOrder());
36: } catch (NumberFormatException e) {
37: return new Integer(1);
38: }
39: }
40:
41: public void setFileName(String fileName) {
42: this .fileName = fileName;
43: }
44:
45: public String getFileName() {
46: return fileName;
47: }
48:
49: public boolean equals(Object obj) {
50: if (obj.getClass() != getClass()) {
51: return false;
52: }
53: PackageImportElement types = (PackageImportElement) obj;
54: return types.getFileName().equals(getFileName())
55: & (types.getOrder().equals(getOrder()));
56: }
57:
58: public int hashCode() {
59: return getFileName().hashCode() + getOrderNumber().intValue();
60: }
61:
62: public String toString() {
63: return ("[PackageImportElement order=" + order + ", fileName="
64: + fileName + "]");
65: }
66: }
|