1 18 19 20 package sync4j.framework.core; 21 22 import java.util.*; 23 24 33 public final class Map 34 extends AbstractCommand 35 implements java.io.Serializable { 36 37 39 public static String COMMAND_NAME = "Map"; 40 41 43 private Target target; 44 private Source source; 45 private ArrayList mapItems = new ArrayList(); 46 47 49 52 protected Map() {} 53 54 65 public Map(final CmdID cmdID, 66 final Target target, 67 final Source source, 68 final Cred cred, 69 final Meta meta, 70 final MapItem[] mapItems) { 71 72 super(cmdID); 73 setMeta(meta); 74 setCred(cred); 75 76 setTarget (target ); 77 setSource (source ); 78 setMapItems(mapItems); 79 } 80 81 83 88 public Target getTarget() { 89 return target; 90 } 91 92 99 public void setTarget(Target target) { 100 if (target == null) { 101 throw new IllegalArgumentException ("target cannot be null"); 102 } 103 this.target = target; 104 } 105 106 111 public Source getSource() { 112 return source; 113 } 114 115 122 public void setSource(Source source) { 123 if (source == null) { 124 throw new IllegalArgumentException ("source cannot be null"); 125 } 126 this.source = source; 127 } 128 129 135 public ArrayList getMapItems() { 136 return mapItems; 137 } 138 139 146 public void setMapItems(MapItem[] mapItems) { 147 if (mapItems == null) { 148 throw new IllegalArgumentException ("mapItems cannot be null"); 149 } 150 this.mapItems.clear(); 151 this.mapItems.addAll(Arrays.asList(mapItems)); 152 } 153 154 159 public String getName() { 160 return Map.COMMAND_NAME; 161 } 162 } 163 | Popular Tags |