Java - Maps inside a Map or Key Object?
<p>Hi I am having 3 attributes (String) that are needed to identify a certain Object.</p>

<p>What is the better solution:</p>

<p>using a key object as those post by <a href="http://stackoverflow.com/questions/1190049/using-two-or-more-objects-as-a-hashmap-key">Pierre</a> and <a href="http://stackoverflow.com/questions/635014/any-disadvantage-to-using-arbitrary-objects-as-map-keys-in-java">Joachim Sauer</a> like this:</p>

<pre><code>public class MyKey{

private String one;
private String two;
private String three;

public MyKey(Sting one,String two, String three){
    this.one=one;
    this.two=two;
    this.three=three;
}

//getter only

@Override
public int hashcode(){
// creating Hashcode
}

@Override
public boolean equals(Object o){
// comparing
}
}
</code></pre>

<p>=> <code>Map&lt;MyKey, Object&gt;</code></p>

<p>or using a Map inside a Map inside a Map:</p>

<p>=> <code>Map&lt;String, Map&lt;String, Map&lt;String, Object&gt;&gt;&gt;</code></p>
