blob: abf9fed1961e586623450a5ccf64b9df88eb28eb [file] [log] [blame]
Jonathan Hart23701d12014-04-03 10:45:48 -07001package net.onrc.onos.core.util;
Pavlin Radoslavov9f9d5492013-12-04 18:21:48 -08002
3/**
4 * A generic class representing a pair of two values.
5 */
Pavlin Radoslavov4535bc12013-12-05 10:43:49 -08006public class Pair<F, S> {
Ray Milkey269ffb92014-04-03 14:43:30 -07007 public F first; // The first value in the pair
8 public S second; // The second value in the pair
Pavlin Radoslavov9f9d5492013-12-04 18:21:48 -08009
10 /**
11 * Constructor for a pair of two values.
12 *
Ray Milkey269ffb92014-04-03 14:43:30 -070013 * @param first the first value in the pair.
Pavlin Radoslavov4535bc12013-12-05 10:43:49 -080014 * @param second the second value in the pair.
Pavlin Radoslavov9f9d5492013-12-04 18:21:48 -080015 */
Pavlin Radoslavov4535bc12013-12-05 10:43:49 -080016 public Pair(F first, S second) {
Ray Milkey269ffb92014-04-03 14:43:30 -070017 this.first = first;
18 this.second = second;
Pavlin Radoslavov9f9d5492013-12-04 18:21:48 -080019 }
Toshio Koided7476d02014-02-22 15:59:04 -080020
21 @Override
22 public String toString() {
Ray Milkey269ffb92014-04-03 14:43:30 -070023 return String.format("<%s, %s>", first, second);
Toshio Koided7476d02014-02-22 15:59:04 -080024 }
Pavlin Radoslavov9f9d5492013-12-04 18:21:48 -080025}