1 22 23 package org.objectweb.petals.tools.jbicommon.descriptor; 24 25 import org.apache.commons.lang.builder.EqualsBuilder; 26 import org.apache.commons.lang.builder.HashCodeBuilder; 27 import org.apache.commons.lang.builder.ToStringBuilder; 28 29 37 public class ServiceUnit extends ExtensibleJbiElement { 38 39 42 private Identification identification; 43 44 47 private String targetArtifactsZip; 49 52 private String targetComponentName; 54 57 public ServiceUnit() { super(); 59 } 60 61 @Override 62 public boolean equals(final Object other) { 63 if (!(other instanceof ServiceUnit)) { 64 return false; } 66 ServiceUnit castOther = (ServiceUnit) other; 67 return new EqualsBuilder().append(identification, 68 castOther.identification).append(targetArtifactsZip, 69 castOther.targetArtifactsZip).append(targetComponentName, 70 castOther.targetComponentName).isEquals(); 71 } 72 73 78 public Identification getIdentification() { 79 return identification; 80 } 81 82 88 public String getTargetArtifactsZip() { 89 return targetArtifactsZip; 90 } 91 92 96 102 public String getTargetComponentName() { 103 return targetComponentName; 104 } 105 106 @Override 107 public int hashCode() { 108 return new HashCodeBuilder().append(identification).append( 109 targetArtifactsZip).append(targetComponentName).toHashCode(); 110 } 111 112 @Override 113 public String toString() { 114 return new ToStringBuilder(this).append("identification", 115 identification) 116 .append("targetArtifactsZip", targetArtifactsZip).append( 117 "targetComponentName", targetComponentName).toString(); 118 } 119 120 126 protected void setIdentification(final Identification identification) { 127 this.identification = identification; 128 } 129 130 136 protected void setTargetArtifactsZip(final String targetZip) { 137 this.targetArtifactsZip = targetZip; 138 } 139 140 147 protected void setTargetComponentName(final String targetCompName) { 148 this.targetComponentName = targetCompName; 149 } 150 151 } 152 | Popular Tags |