@@ -105,7 +105,7 @@ public void extendTypeMapping(Map<String, OpenSearchDataType> typeMapping) {
105
105
106
106
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper ();
107
107
108
- private final Map <ExprType , BiFunction <Content , ExprType , ExprValue >> typeActionMap =
108
+ private static final Map <ExprType , BiFunction <Content , ExprType , ExprValue >> typeActionMap =
109
109
new ImmutableMap .Builder <ExprType , BiFunction <Content , ExprType , ExprValue >>()
110
110
.put (OpenSearchDataType .of (OpenSearchDataType .MappingType .Integer ),
111
111
(c , dt ) -> new ExprIntegerValue (c .intValue ()))
@@ -126,10 +126,12 @@ public void extendTypeMapping(Map<String, OpenSearchDataType> typeMapping) {
126
126
.put (OpenSearchDataType .of (OpenSearchDataType .MappingType .Boolean ),
127
127
(c , dt ) -> ExprBooleanValue .of (c .booleanValue ()))
128
128
//Handles the creation of DATE, TIME & DATETIME
129
- .put (OpenSearchDateType .of (TIME ), this ::createOpenSearchDateType )
130
- .put (OpenSearchDateType .of (DATE ), this ::createOpenSearchDateType )
131
- .put (OpenSearchDateType .of (TIMESTAMP ), this ::createOpenSearchDateType )
132
- .put (OpenSearchDateType .of (DATETIME ), this ::createOpenSearchDateType )
129
+ .put (OpenSearchDateType .of (TIME ), OpenSearchExprValueFactory ::createOpenSearchDateType )
130
+ .put (OpenSearchDateType .of (DATE ), OpenSearchExprValueFactory ::createOpenSearchDateType )
131
+ .put (OpenSearchDateType .of (TIMESTAMP ),
132
+ OpenSearchExprValueFactory ::createOpenSearchDateType )
133
+ .put (OpenSearchDateType .of (DATETIME ),
134
+ OpenSearchExprValueFactory ::createOpenSearchDateType )
133
135
.put (OpenSearchDataType .of (OpenSearchDataType .MappingType .Ip ),
134
136
(c , dt ) -> new OpenSearchExprIpValue (c .stringValue ()))
135
137
.put (OpenSearchDataType .of (OpenSearchDataType .MappingType .GeoPoint ),
@@ -222,7 +224,7 @@ private Optional<ExprType> type(String field) {
222
224
* @param dataType - field data type
223
225
* @return Parsed value
224
226
*/
225
- private ExprValue parseDateTimeString (String value , OpenSearchDateType dataType ) {
227
+ private static ExprValue parseDateTimeString (String value , OpenSearchDateType dataType ) {
226
228
List <DateFormatter > formatters = dataType .getAllNamedFormatters ();
227
229
formatters .addAll (dataType .getAllCustomFormatters ());
228
230
ExprCoreType returnFormat = (ExprCoreType ) dataType .getExprType ();
@@ -262,7 +264,7 @@ private ExprValue parseDateTimeString(String value, OpenSearchDateType dataType)
262
264
"Construct %s from \" %s\" failed, unsupported format." , returnFormat , value ));
263
265
}
264
266
265
- private ExprValue createOpenSearchDateType (Content value , ExprType type ) {
267
+ private static ExprValue createOpenSearchDateType (Content value , ExprType type ) {
266
268
OpenSearchDateType dt = (OpenSearchDateType ) type ;
267
269
ExprType returnFormat = dt .getExprType ();
268
270
0 commit comments