This repository has been archived by the owner on Dec 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDocument.java
147 lines (79 loc) · 3.21 KB
/
Document.java
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
package com.github.derrop.documents;
import com.github.derrop.documents.storage.DocumentStorage;
import com.github.derrop.documents.storage.SpecificDocumentStorage;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Collection;
import java.util.Map;
import java.util.Properties;
public interface Document {
Object toPlainObjects();
JsonObject toJsonObject();
Collection<String> keys();
int size();
Document clear();
Document remove(String key);
boolean contains(String key);
<T> T toInstanceOf(Class<T> clazz);
<T> T toInstanceOf(Type type);
Document append(String key, Object value);
Document append(String key, Number value);
Document append(String key, Boolean value);
Document append(String key, String value);
Document append(String key, Character value);
Document append(String key, Document value);
Document append(Document document);
Document append(JsonObject jsonObject);
Document append(Properties properties);
Document append(String key, Properties properties);
Document append(String key, byte[] bytes);
Document append(Map<String, Object> map);
Document getDocument(String key);
Collection<Document> getDocuments(String key);
int getInt(String key);
double getDouble(String key);
float getFloat(String key);
byte getByte(String key);
short getShort(String key);
long getLong(String key);
boolean getBoolean(String key);
String getString(String key);
char getChar(String key);
BigDecimal getBigDecimal(String key);
BigInteger getBigInteger(String key);
JsonArray getJsonArray(String key);
JsonObject getJsonObject(String key);
Properties getProperties(String key);
JsonElement get(String key);
byte[] getBinary(String key);
<T> T get(String key, Class<T> clazz);
<T> T get(String key, Type type);
<T> T get(String key, Gson gson, Class<T> clazz);
<T> T get(String key, Gson gson, Type type);
Integer getInt(String key, Integer def);
Short getShort(String key, Short def);
Boolean getBoolean(String key, Boolean def);
Long getLong(String key, Long def);
Double getDouble(String key, Double def);
Float getFloat(String key, Float def);
String getString(String key, String def);
Document getDocument(String key, Document def);
Collection<Document> getDocuments(String key, Collection<Document> def);
JsonArray getJsonArray(String key, JsonArray def);
JsonObject getJsonObject(String key, JsonObject def);
byte[] getBinary(String key, byte[] def);
<T> T get(String key, Type type, T def);
<T> T get(String key, Class<T> clazz, T def);
Properties getProperties(String key, Properties def);
BigInteger getBigInteger(String key, BigInteger def);
BigDecimal getBigDecimal(String key, BigDecimal def);
Character getChar(String key, Character def);
SpecificDocumentStorage json();
SpecificDocumentStorage yaml();
SpecificDocumentStorage storage(DocumentStorage storage);
}