-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathKeyValuePair.java
More file actions
59 lines (46 loc) · 1.21 KB
/
KeyValuePair.java
File metadata and controls
59 lines (46 loc) · 1.21 KB
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
package org.utplsql.api;
import java.sql.SQLData;
import java.sql.SQLException;
import java.sql.SQLInput;
import java.sql.SQLOutput;
/**
* Created by Vinicius on 22/07/2017.
*/
public class KeyValuePair implements SQLData {
private String key;
private String value;
public KeyValuePair(String key, String value) {
this.key = key;
this.value = value;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Override
public String getSQLTypeName() throws SQLException {
return CustomTypes.UT_KEY_VALUE_PAIR;
}
@Override
public void readSQL(SQLInput stream, String typeName) throws SQLException {
setKey(stream.readString());
setValue(stream.readString());
}
@Override
public void writeSQL(SQLOutput stream) throws SQLException {
stream.writeString(getKey());
stream.writeString(getValue());
}
@Override
public String toString() {
return String.format("%s => %s", getKey(), getValue());
}
}