こんにちは、特定のオブジェクトを識別するために必要な 3 つの属性 (文字列) があります。
より良い解決策は何ですか:
ピエールとヨアヒム・ザウアーが投稿したキー オブジェクトを次のように使用します。
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
}
}
=>Map<MyKey, Object>
またはマップ内のマップ内でマップを使用する:
=>Map<String, Map<String, Map<String, Object>>>