1 4 package com.tc.object.lockmanager.api; 5 6 import java.io.Serializable ; 7 8 import com.tc.util.Assert; 9 10 15 public class LockID implements Serializable { 16 public final static LockID NULL_ID = new LockID("null id"); 17 private final String id; 18 19 public LockID(String id) { 20 Assert.eval(id != null); 21 this.id = id; 22 } 23 24 public boolean isNull() { 25 return this == NULL_ID; 26 } 27 28 public String getIdentifierType() { 29 return "LockID"; 30 } 31 32 public String asString() { 33 return id; 34 } 35 36 public String toString() { 37 return getIdentifierType() + "(" + id + ")"; 38 } 39 40 public int hashCode() { 41 return id.hashCode(); 42 } 43 44 public boolean equals(Object obj) { 45 if (obj instanceof LockID) { 46 LockID lid = (LockID) obj; 47 return this.id.equals(lid.id); 48 } 49 return false; 50 } 51 } 52 | Popular Tags |