KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > jbi > management > systemstate > SharedLibraryState


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2006 EBM Websourcing, http://www.ebmwebsourcing.com/
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * -------------------------------------------------------------------------
19  * $Id: SharedLibraryState.java 154 28 avr. 2006 ofabre $
20  * -------------------------------------------------------------------------
21  */

22 package org.objectweb.petals.jbi.management.systemstate;
23
24 import org.objectweb.petals.util.StringHelper;
25
26 /**
27  *
28  * @author Olivier Fabre, Adrien LOUIS - EBM Websourcing
29  *
30  */

31 public class SharedLibraryState {
32     private String JavaDoc archiveURL;
33
34     private String JavaDoc installURL;
35
36     private String JavaDoc name;
37
38     public SharedLibraryState() {
39         super();
40     }
41
42     public SharedLibraryState(String JavaDoc name, String JavaDoc installURL, String JavaDoc zipURL) {
43         super();
44         this.name = name;
45         this.installURL = installURL;
46         this.archiveURL = zipURL;
47     }
48
49     public boolean equals(Object JavaDoc o) {
50         if (o instanceof SharedLibraryState) {
51             SharedLibraryState cc = (SharedLibraryState) o;
52
53             return StringHelper.equal(name, cc.name)
54                 && StringHelper.equal(installURL, cc.installURL)
55                 && StringHelper.equal(archiveURL, cc.archiveURL);
56         } else {
57             return false;
58         }
59     }
60
61     public String JavaDoc getArchiveURL() {
62         return archiveURL;
63     }
64
65     public String JavaDoc getInstallURL() {
66         return installURL;
67     }
68
69     public String JavaDoc getName() {
70         return name;
71     }
72
73     public int hashCode() {
74         int hashCode = 0;
75         if (archiveURL != null) {
76             hashCode += archiveURL.hashCode();
77         }
78         if (installURL != null) {
79             hashCode += installURL.hashCode();
80         }
81         if (name != null) {
82             hashCode += name.hashCode();
83         }
84         return hashCode;
85     }
86
87     public void setArchiveURL(String JavaDoc zipURL) {
88         this.archiveURL = zipURL;
89     }
90
91     public void setInstallURL(String JavaDoc installURL) {
92         this.installURL = installURL;
93     }
94
95     public void setName(String JavaDoc name) {
96         this.name = name;
97     }
98 }
99
Popular Tags