-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathKeyValuePair.java
More file actions
51 lines (40 loc) · 1.02 KB
/
KeyValuePair.java
File metadata and controls
51 lines (40 loc) · 1.02 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
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 String getValue() {
return value;
}
@Override
public String getSQLTypeName() {
return CustomTypes.UT_KEY_VALUE_PAIR;
}
@Override
public void readSQL(SQLInput stream, String typeName) throws SQLException {
key = stream.readString();
value = stream.readString();
}
@Override
public void writeSQL(SQLOutput stream) throws SQLException {
stream.writeString(key);
stream.writeString(value);
}
@Override
public String toString() {
return String.format("%s => %s", key, value);
}
}