Module org.elasticsearch.xcore
Class XContentObjectTransformer<T extends org.elasticsearch.xcontent.ToXContentObject>
java.lang.Object
org.elasticsearch.xpack.core.ml.utils.XContentObjectTransformer<T>
- Type Parameters:
T- The type of the object that we will be transforming to/from
public class XContentObjectTransformer<T extends org.elasticsearch.xcontent.ToXContentObject>
extends Object
This is a utility class that allows simple one-to-one transformations between an ToXContentObject type
to and from other supported objects.
-
Method Summary
Modifier and TypeMethodDescriptionaggregatorTransformer(org.elasticsearch.xcontent.NamedXContentRegistry registry) Parses the map into the type T with the previously supplied parserFunction All deprecation warnings are ignoredParses the map into the type T with the previously supplied parserFunction All deprecation warnings are added to the passed deprecationWarnings list.queryBuilderTransformer(org.elasticsearch.xcontent.NamedXContentRegistry registry)
-
Method Details
-
aggregatorTransformer
public static XContentObjectTransformer<AggregatorFactories.Builder> aggregatorTransformer(org.elasticsearch.xcontent.NamedXContentRegistry registry) -
queryBuilderTransformer
public static XContentObjectTransformer<QueryBuilder> queryBuilderTransformer(org.elasticsearch.xcontent.NamedXContentRegistry registry) -
fromMap
Parses the map into the type T with the previously supplied parserFunction All deprecation warnings are ignored- Parameters:
stringObjectMap- The Map to parse into the Object- Returns:
- parsed object T
- Throws:
IOException- When there is an unforeseen parsing issue
-
fromMap
public T fromMap(Map<String, Object> stringObjectMap, List<String> deprecationWarnings) throws IOExceptionParses the map into the type T with the previously supplied parserFunction All deprecation warnings are added to the passed deprecationWarnings list.- Parameters:
stringObjectMap- The Map to parse into the ObjectdeprecationWarnings- The list to which to add all deprecation warnings- Returns:
- parsed object T
- Throws:
IOException- When there is an unforeseen parsing issue
-
toMap
- Throws:
IOException
-