I'm translating some code from standard C++ to Java. Several places utilize
std::pair<T1,T2>
more specifically
std::pair<Date,double>
Is there a standard idiomatic way to express a parameterized pair type in Java? As one example, I'm having to use a custom type
class Observation {
LocalDate date;
double value;
}
I have other cases as well where two or three things need to be returned from a function. In other languages, I would likely use pairs, triples, and other tuple entities.
I do not really mind making the needed little classes, but would like to know if I'm somewhere missing out on a Java feature.
Thanks in advance for your comments.
(P.S. I'm pretty sure that this is my first question ever posed on S.O.)