forked from kherud/java-llama.cpp
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPair.java
More file actions
64 lines (51 loc) · 983 Bytes
/
Copy pathPair.java
File metadata and controls
64 lines (51 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package net.ladenthin.llama;
import java.util.Objects;
/**
* A generic immutable key-value pair.
*
* @param <K> the key type
* @param <V> the value type
*/
public class Pair<K, V> {
private final K key;
private final V value;
/**
* @param key the key
* @param value the value
*/
public Pair(K key, V value) {
this.key = key;
this.value = value;
}
/**
* @return the key
*/
public K getKey() {
return key;
}
/**
* @return the value
*/
public V getValue() {
return value;
}
@Override
public int hashCode() {
return Objects.hash(key, value);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Pair other = (Pair) obj;
return Objects.equals(key, other.key) && Objects.equals(value, other.value);
}
@Override
public String toString() {
return "Pair [key=" + key + ", value=" + value + "]";
}
}