The three values of java uniquely determine one value.

does java have this data structure:
use three string as key to determine only one string as value?.

Aug.14,2021

pseudo code

map = Map<string, string>;

set(strArr: []string, value) {
 key = ['a', 'b', 'c'].sort().join(','); // 'a,b,c'
 map.set(key, value);
}

get(strArr: []string) {
  return map.get(strArr.sort().join(','));
}
The Table of

Guava can take a look.
https://github.com/google/guava


using a HashMap,key is an object with three String attributes, and value is a String.

public class Entity{
    String a;
    String b;
    String c;
    public Entity(String a,String b,String c){
        this.a=a;
        this.b=b;
        this.c=c;
    }
    
    public static void main(String args[]){
        HashMap<Entity,String> map=new HashMap<>();
        map.put(new Entity("a","b","c"),"value");
    }
}

Menu