1   package com.trendmicro.grid.acl.ds.jpa.util;
2   
3   import com.trendmicro.grid.acl.l0.datatypes.FileDetails;
4   import com.trendmicro.grid.acl.l0.datatypes.FileIdentifier;
5   
6   import java.util.HashMap;
7   
8   /**
9    * Maps file details against their identifiers using SHA1 keys.
10   *
11   * @author juergen_kellerer, 2010-07-01
12   * @version 1.0
13   */
14  public class FileDetailsMap<V extends FileDetails> extends HashMap<FileIdentifier, V> {
15  
16  	private static final long serialVersionUID = 9219387060561633036L;
17  
18  	public FileDetailsMap(int initialCapacity) {
19  		super(initialCapacity);
20  	}
21  
22  	public FileDetailsMap() {
23  	}
24  
25  	public V get(FileIdentifier key) {
26  		return super.get(key == null ? null : key.toSHA1OnlyIdentifier());
27  	}
28  
29  	@Override
30  	public V put(FileIdentifier key, V value) {
31  		return super.put(key == null ? null : key.toSHA1OnlyIdentifier(), value);
32  	}
33  
34  	public FileDetailsMap clone() {
35  		return (FileDetailsMap) super.clone();
36  	}
37  }