1 18 19 20 package sync4j.framework.core; 21 22 import java.util.*; 23 24 34 public final class Search 35 extends AbstractCommand 36 implements java.io.Serializable { 37 38 40 public static String COMMAND_NAME = "Search"; 41 42 44 private Boolean noResults; 45 private Target target ; 46 private ArrayList sources = new ArrayList(); 47 private String lang ; 48 private Data data ; 49 50 52 55 protected Search() {} 56 57 73 public Search( 74 final CmdID cmdID , 75 final boolean noResp , 76 final boolean noResults, 77 final Cred cred , 78 final Target target , 79 final Source[] sources , 80 final String lang , 81 final Meta meta , 82 final Data data ) { 83 super(cmdID, noResp); 84 85 setCred(cred); 86 setMeta(meta); 87 setSources(sources); 88 setData(data); 89 90 this.noResults = (noResults) ? new Boolean (noResults) : null; 91 this.target = target; 92 this.lang = lang ; 93 } 94 95 97 103 public boolean isNoResults() { 104 return (noResults != null); 105 } 106 107 112 public void setNoResults(Boolean noResults) { 113 this.noResults = (noResults.booleanValue()) ? noResults : null; 114 } 115 116 121 public Boolean getNoResults() { 122 if (!noResults.booleanValue()) { 123 return null; 124 } 125 return noResults; 126 } 127 128 132 public Target getTarget() { 133 return target; 134 } 135 136 141 public void setTarget(Target target) { 142 this.target = target; 143 } 144 145 149 public ArrayList getSources() { 150 return sources; 151 } 152 153 160 public void setSources(Source[] sources) { 161 if (sources == null) { 162 throw new IllegalArgumentException ("sources cannot be null"); 163 } 164 this.sources.clear(); 165 this.sources.addAll(Arrays.asList(sources)); 166 } 167 168 174 public String getLang() { 175 return lang; 176 } 177 178 183 public void setLang(String lang) { 184 this.lang = lang; 185 } 186 187 193 public Data getData() { 194 return data; 195 } 196 197 204 public void setData(Data data) { 205 if (data == null) { 206 throw new IllegalArgumentException ("data cannot be null"); 207 } 208 this.data = data; 209 } 210 211 216 public String getName() { 217 return Search.COMMAND_NAME; 218 } 219 } 220 | Popular Tags |