6

Is there any generic name value pair kind of stuff in java? i need something like

Queue<NameValuePair<String,String>> to store queue of name value pair of string values.

Tudor
  • 61,523
  • 12
  • 102
  • 142
Eldhose M Babu
  • 14,382
  • 8
  • 39
  • 44
  • Have you come across Hashtable ? http://docs.oracle.com/javase/6/docs/api/java/util/Hashtable.html – AurA Sep 10 '12 at 06:06
  • 2
    Possible duplicate of http://stackoverflow.com/questions/156275/what-is-the-equivalent-of-the-c-pairl-r-in-java – Tudor Sep 10 '12 at 06:06

1 Answers1

5

commons-lang provide a Pair.

see http://commons.apache.org/proper/commons-lang/javadocs/api-3.1/org/apache/commons/lang3/tuple/Pair.html

EDIT: updated url as it was broken

  • @EldhoseMBabu, don't forget to accept the answer if it completely suits your needs. – Vitaliy Sep 10 '12 at 06:14
  • @Peerke thanks for the downvote, I assume you was not able to find the updated URL by yourself so I updated the answer. Cheers –  Mar 31 '13 at 19:17