A Java collection of value pairs? (tuples?)

后端 未结 19 2584
名媛妹妹
名媛妹妹 2020-11-22 05:43

I like how Java has a Map where you can define the types of each entry in the map, for example .

What I\'m looking for is a type

19条回答
  •  野性不改
    2020-11-22 05:57

    Spring has a Pair type in the Data Utils package org.springframework.data.util

    Pair pair = Pair.of("Test", 123);
    System.out.println(pair.getFirst());
    System.out.println(pair.getSecond());
    

提交回复
热议问题