1 22 package org.objectweb.petals.jbi.management.systemstate; 23 24 import org.objectweb.petals.util.StringHelper; 25 26 31 public class ComponentState { 32 private String archiveURL; 33 34 private String installState; 35 36 private String installURL; 37 38 private String lifecycleState; 39 40 private String name; 41 42 public ComponentState() { 43 super(); 44 } 45 46 public ComponentState(String name, String installURL, String zipURL, 47 String installState, String lifecycleState) { 48 super(); 49 this.name = name; 50 this.installURL = installURL; 51 this.archiveURL = zipURL; 52 this.installState = installState; 53 this.lifecycleState = lifecycleState; 54 } 55 56 public boolean equals(Object o) { 57 if (o instanceof ComponentState) { 58 ComponentState cc = (ComponentState) o; 59 60 return StringHelper.equal(name, cc.name) 61 && StringHelper.equal(installURL, cc.installURL) 62 && StringHelper.equal(archiveURL, cc.archiveURL) 63 && StringHelper.equal(installState, cc.installState) 64 && StringHelper.equal(lifecycleState, cc.lifecycleState); 65 } else { 66 return false; 67 } 68 } 69 70 public String getArchiveURL() { 71 return archiveURL; 72 } 73 74 public String getInstallState() { 75 return installState; 76 } 77 78 public String getInstallURL() { 79 return installURL; 80 } 81 82 public String getLifecycleState() { 83 return lifecycleState; 84 } 85 86 public String getName() { 87 return name; 88 } 89 90 public int hashCode() { 91 int hashCode = 0; 92 if (archiveURL != null) { 93 hashCode += archiveURL.hashCode(); 94 } 95 if (installState != null) { 96 hashCode += installState.hashCode(); 97 } 98 if (installURL != null) { 99 hashCode += installURL.hashCode(); 100 } 101 if (lifecycleState != null) { 102 hashCode += lifecycleState.hashCode(); 103 } 104 if (name != null) { 105 hashCode += name.hashCode(); 106 } 107 return hashCode; 108 } 109 110 public void setArchiveURL(String zipURL) { 111 this.archiveURL = zipURL; 112 } 113 114 public void setInstallState(String installState) { 115 this.installState = installState; 116 } 117 118 public void setInstallURL(String installURL) { 119 this.installURL = installURL; 120 } 121 122 public void setLifecycleState(String lifecycleState) { 123 this.lifecycleState = lifecycleState; 124 } 125 126 public void setName(String name) { 127 this.name = name; 128 } 129 } 130 | Popular Tags |