1 17 package org.apache.geronimo.naming.deployment.jsr88; 18 19 import java.io.Serializable ; 20 21 28 public class Pattern implements Serializable { 29 private String groupId; 30 private String artifactId; 31 private String version; 32 private String module; 33 private String name; 34 private String type; 35 36 public String getGroupId() { 37 return groupId; 38 } 39 40 public void setGroupId(String groupId) { 41 this.groupId = groupId; 42 } 43 44 public String getArtifactId() { 45 return artifactId; 46 } 47 48 public void setArtifactId(String artifactId) { 49 this.artifactId = artifactId; 50 } 51 52 public String getVersion() { 53 return version; 54 } 55 56 public void setVersion(String version) { 57 this.version = version; 58 } 59 60 public String getModule() { 61 return module; 62 } 63 64 public void setModule(String module) { 65 this.module = module; 66 } 67 68 public String getName() { 69 return name; 70 } 71 72 public void setName(String name) { 73 this.name = name; 74 } 75 76 77 public String getType() { 78 return type; 79 } 80 81 public void setType(String type) { 82 this.type = type; 83 } 84 85 public boolean empty() { 86 return (groupId == null || groupId.trim().equals("")) && 87 (artifactId == null || artifactId.trim().equals("")) && 88 (version == null || version.trim().equals("")) && 89 (module == null || module.trim().equals("")) && 90 (name == null || name.trim().equals("")) && 91 (type == null || type.trim().equals("")); 92 } 93 94 public boolean equals(Object o) { 95 if (this == o) return true; 96 if (o == null || getClass() != o.getClass()) return false; 97 98 final Pattern pattern = (Pattern) o; 99 100 if (artifactId != null ? !artifactId.equals(pattern.artifactId) : pattern.artifactId != null) return false; 101 if (groupId != null ? !groupId.equals(pattern.groupId) : pattern.groupId != null) return false; 102 if (module != null ? !module.equals(pattern.module) : pattern.module != null) return false; 103 if (name != null ? !name.equals(pattern.name) : pattern.name != null) return false; 104 if (type != null ? !type.equals(pattern.type) : pattern.type != null) return false; 105 if (version != null ? !version.equals(pattern.version) : pattern.version != null) return false; 106 107 return true; 108 } 109 110 public int hashCode() { 111 int result; 112 result = (groupId != null ? groupId.hashCode() : 0); 113 result = 29 * result + (artifactId != null ? artifactId.hashCode() : 0); 114 result = 29 * result + (version != null ? version.hashCode() : 0); 115 result = 29 * result + (module != null ? module.hashCode() : 0); 116 result = 29 * result + (name != null ? name.hashCode() : 0); 117 result = 29 * result + (type != null ? type.hashCode() : 0); 118 return result; 119 } 120 } 121 | Popular Tags |