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");
    }
}

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c74d-2b67a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c74d-2b67a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?