1 18 19 20 package sync4j.framework.core; 21 22 30 public final class CmdID 31 implements java.io.Serializable { 32 33 private String cmdID; 35 36 38 protected CmdID() {} 39 40 46 public CmdID(final String cmdID) { 47 if ((cmdID == null) || (cmdID.length() == 0)) { 48 throw new IllegalArgumentException ("cmdID cannot be empty"); 49 } 50 this.cmdID = cmdID; 51 } 52 53 59 public CmdID(final long cmdID) { 60 this(String.valueOf(cmdID)); 61 } 62 63 65 70 public String getCmdID() { 71 return this.cmdID; 72 } 73 74 83 public boolean equals(Object object) { 84 String cmdID = null; 85 86 if (object instanceof String ) { 87 cmdID = (String )object; 88 } else if (object instanceof CmdID) { 89 cmdID = ((CmdID)object).getCmdID(); 90 } 91 92 return (cmdID == null) ? false : cmdID.equals(cmdID); 93 } 94 } | Popular Tags |