forked from microsoft/kiota-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParseNode.java
More file actions
189 lines (162 loc) · 5.81 KB
/
ParseNode.java
File metadata and controls
189 lines (162 loc) · 5.81 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
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
package com.microsoft.kiota.serialization;
import com.microsoft.kiota.PeriodAndDuration;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.OffsetDateTime;
import java.util.EnumSet;
import java.util.List;
import java.util.UUID;
import java.util.function.Consumer;
/**
* Interface for a deserialization node in a parse tree. This interface provides an abstraction layer over serialization formats, libraries and implementations.
*/
public interface ParseNode {
/**
* Gets a new parse node for the given identifier.
* @param identifier the identifier of the current node property.
* @return a new parse node for the given identifier.
*/
@Nullable ParseNode getChildNode(@Nonnull final String identifier);
/**
* Gets the string value of the node.
* @return the string value of the node.
*/
@Nullable String getStringValue();
/**
* Gets the boolean value of the node.
* @return the boolean value of the node.
*/
@Nullable Boolean getBooleanValue();
/**
* Gets the byte value of the node.
* @return the byte value of the node.
*/
@Nullable Byte getByteValue();
/**
* Gets the short value of the node.
* @return the short value of the node.
*/
@Nullable Short getShortValue();
/**
* Gets the BigDecimal value of the node.
* @return the BigDecimal value of the node.
*/
@Nullable BigDecimal getBigDecimalValue();
/**
* Gets the Integer value of the node.
* @return the Integer value of the node.
*/
@Nullable Integer getIntegerValue();
/**
* Gets the Float value of the node.
* @return the Float value of the node.
*/
@Nullable Float getFloatValue();
/**
* Gets the Double value of the node.
* @return the Double value of the node.
*/
@Nullable Double getDoubleValue();
/**
* Gets the Long value of the node.
* @return the Long value of the node.
*/
@Nullable Long getLongValue();
/**
* Gets the UUID value of the node.
* @return the UUID value of the node.
*/
@Nullable UUID getUUIDValue();
/**
* Gets the OffsetDateTime value of the node.
* @return the OffsetDateTime value of the node.
*/
@Nullable OffsetDateTime getOffsetDateTimeValue();
/**
* Gets the LocalDate value of the node.
* @return the LocalDate value of the node.
*/
@Nullable LocalDate getLocalDateValue();
/**
* Gets the LocalTime value of the node.
* @return the LocalTime value of the node.
*/
@Nullable LocalTime getLocalTimeValue();
/**
* Gets the Period value of the node.
* @return the Period value of the node.
*/
@Nullable PeriodAndDuration getPeriodAndDurationValue();
/**
* Gets the Enum value of the node.
* @return the Enum value of the node.
* @param enumParser the parser for Enums
* @param <T> the type of the enum.
*/
@Nullable <T extends Enum<T>> T getEnumValue(@Nonnull final ValuedEnumParser<T> enumParser);
/**
* Gets the EnumSet value of the node.
* @return the EnumSet value of the node.
* @param enumParser the parser for Enums
* @param <T> the type of the enum.
*/
@Nullable <T extends Enum<T>> EnumSet<T> getEnumSetValue(@Nonnull final ValuedEnumParser<T> enumParser);
/**
* Gets the collection of primitive values of the node.
* @return the collection of primitive values of the node.
* @param targetClass the class of the class.
* @param <T> the type of the primitive.
*/
@Nullable <T> List<T> getCollectionOfPrimitiveValues(@Nonnull final Class<T> targetClass);
/**
* Gets the collection of object values of the node.
* @param factory the factory to use to create the model object.
* @return the collection of object values of the node.
* @param <T> the type of the model object.
*/
@Nullable <T extends Parsable> List<T> getCollectionOfObjectValues(
@Nonnull final ParsableFactory<T> factory);
/**
* Gets the collection of Enum values of the node.
* @return the collection of Enum values of the node.
* @param <T> the type of the enum.
* @param enumParser the parser for Enums
*/
@Nullable <T extends Enum<T>> List<T> getCollectionOfEnumValues(
@Nonnull final ValuedEnumParser<T> enumParser);
/**
* Gets the model object value of the node.
* @param factory the factory to use to create the model object.
* @return the model object value of the node.
* @param <T> the type of the model object.
*/
@Nonnull <T extends Parsable> T getObjectValue(@Nonnull final ParsableFactory<T> factory);
/**
* Gets the callback called before the node is deserialized.
* @return the callback called before the node is deserialized.
*/
@Nullable Consumer<Parsable> getOnBeforeAssignFieldValues();
/**
* Gets the callback called after the node is deserialized.
* @return the callback called after the node is deserialized.
*/
@Nullable Consumer<Parsable> getOnAfterAssignFieldValues();
/**
* Sets the callback called before the node is deserialized.
* @param value the callback called before the node is deserialized.
*/
void setOnBeforeAssignFieldValues(@Nullable final Consumer<Parsable> value);
/**
* Sets the callback called after the node is deserialized.
* @param value the callback called after the node is deserialized.
*/
void setOnAfterAssignFieldValues(@Nullable final Consumer<Parsable> value);
/**
* Gets the byte array value of the node.
* @return The byte array value of the node.
*/
@Nullable byte[] getByteArrayValue();
}