001 package net.sf.tacos.model; 002 003 import java.io.Serializable; 004 005 /** 006 * Default IKeyProvider implementation that uses the object's identity hash. 007 * This only works if the object instances are the same across requests (ie. 008 * static). 009 * 010 * @author phraktle 011 */ 012 public class IdentityKeyProvider implements IKeyProvider { 013 014 /** 015 * 016 * {@inheritDoc} 017 */ 018 public Serializable getKey(Object value) 019 { 020 return new Integer(System.identityHashCode(value)); 021 } 022 023 }