public boolean equals(Object obj) { if (this == obj) return true; if (super.equals(obj)) return true; if (obj == null || !(obj instanceof ITouchpointType)) return false; ITouchpointType other = (ITouchpointType) obj; return id.equals(other.getId()) && version.equals(other.getVersion()); }
private static ITouchpointType getCachedTouchpointType(String id, Version version) { for (int i = 0; i < typeCache.length; i++) { if (typeCache[i] != null && typeCache[i].getId().equals(id) && typeCache[i].getVersion().equals(version)) return typeCache[i]; } return null; }
public synchronized Touchpoint getTouchpoint(ITouchpointType type) { if (type == null) throw new IllegalArgumentException(Messages.TouchpointManager_Null_Touchpoint_Type_Argument); return getTouchpoint(type.getId(), type.getVersion().toString()); }
public synchronized Touchpoint getTouchpoint(ITouchpointType type) { if (type == null) throw new IllegalArgumentException(Messages.TouchpointManager_Null_Touchpoint_Type_Argument); return getTouchpoint(type.getId(), type.getVersion().toString()); }
/** * Returns a {@link TouchpointType} with the given id and version. * * @param id The touchpoint id * @param version The touchpoint version * @return A touchpoint type instance with the given id and version */ public static ITouchpointType createTouchpointType(String id, Version version) { Assert.isNotNull(id); Assert.isNotNull(version); if (id.equals(ITouchpointType.NONE.getId()) && version.equals(ITouchpointType.NONE.getVersion())) return ITouchpointType.NONE; synchronized (typeCache) { ITouchpointType result = getCachedTouchpointType(id, version); if (result != null) return result; result = new TouchpointType(id, version); putCachedTouchpointType(result); return result; } }
protected void writeTouchpointType(ITouchpointType touchpointType) { start(TOUCHPOINT_TYPE_ELEMENT); attribute(ID_ATTRIBUTE, touchpointType.getId()); attribute(VERSION_ATTRIBUTE, touchpointType.getVersion()); end(TOUCHPOINT_TYPE_ELEMENT); }
protected void writeTouchpointType(ITouchpointType touchpointType) { start(TOUCHPOINT_TYPE_ELEMENT); attribute(ID_ATTRIBUTE, touchpointType.getId()); attribute(VERSION_ATTRIBUTE, touchpointType.getVersion()); end(TOUCHPOINT_TYPE_ELEMENT); }
protected void writeTouchpointType(ITouchpointType touchpointType) { start(TOUCHPOINT_TYPE_ELEMENT); attribute(ID_ATTRIBUTE, touchpointType.getId()); attribute(VERSION_ATTRIBUTE, touchpointType.getVersion()); end(TOUCHPOINT_TYPE_ELEMENT); }