Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java key/value pair object, that isn't an array/map

I want a key value pair object. Just two strings

so Object<String, String>

is there an existing object in java to facilitate this before I reinvent the wheel?

The only reason I didn't immediately gravitate to Hash/Map this time is because that one object is made to store multiple key/value pairs. Is there one designed to hold just a single key/value pair, that I can turn into an array if I feel inclined to do so?

like image 731
CQM Avatar asked Dec 22 '25 23:12

CQM


1 Answers

You will need to create your own. This is done (AFAIK) to facilitate a better semantic meaning from the class name, than a general Pair<> or KeyValuePair<> would

like image 136
Attila Avatar answered Dec 24 '25 13:12

Attila



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!