Class MovAvgModel.AbstractModelParser
- java.lang.Object
-
- org.elasticsearch.search.aggregations.pipeline.MovAvgModel.AbstractModelParser
-
- Enclosing class:
- MovAvgModel
public abstract static class MovAvgModel.AbstractModelParser extends java.lang.ObjectAbstract class which also provides some concrete parsing functionality.
-
-
Constructor Summary
Constructors Constructor Description AbstractModelParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckUnrecognizedParams(java.util.Map<java.lang.String,java.lang.Object> settings)abstract MovAvgModelparse(java.util.Map<java.lang.String,java.lang.Object> settings, java.lang.String pipelineName, int windowSize)Parse a settings hash that is specific to this modelprotected booleanparseBoolParam(java.util.Map<java.lang.String,java.lang.Object> settings, java.lang.String name, boolean defaultValue)Extracts a boolean from the settings map, otherwise throws an exceptionprotected doubleparseDoubleParam(java.util.Map<java.lang.String,java.lang.Object> settings, java.lang.String name, double defaultValue)Extracts a 0-1 inclusive double from the settings map, otherwise throws an exceptionprotected intparseIntegerParam(java.util.Map<java.lang.String,java.lang.Object> settings, java.lang.String name, int defaultValue)Extracts an integer from the settings map, otherwise throws an exception
-
-
-
Method Detail
-
parse
public abstract MovAvgModel parse(@Nullable java.util.Map<java.lang.String,java.lang.Object> settings, java.lang.String pipelineName, int windowSize) throws java.text.ParseException
Parse a settings hash that is specific to this model- Parameters:
settings- Map of settings, extracted from the requestpipelineName- Name of the parent pipeline aggwindowSize- Size of the window for this moving avg- Returns:
- A fully built moving average model
- Throws:
java.text.ParseException
-
parseDoubleParam
protected double parseDoubleParam(@Nullable java.util.Map<java.lang.String,java.lang.Object> settings, java.lang.String name, double defaultValue) throws java.text.ParseException
Extracts a 0-1 inclusive double from the settings map, otherwise throws an exception- Parameters:
settings- Map of settings provided to this modelname- Name of parameter we are attempting to extractdefaultValue- Default value to be used if value does not exist in map- Returns:
- Double value extracted from settings map
- Throws:
java.text.ParseException
-
parseIntegerParam
protected int parseIntegerParam(@Nullable java.util.Map<java.lang.String,java.lang.Object> settings, java.lang.String name, int defaultValue) throws java.text.ParseException
Extracts an integer from the settings map, otherwise throws an exception- Parameters:
settings- Map of settings provided to this modelname- Name of parameter we are attempting to extractdefaultValue- Default value to be used if value does not exist in map- Returns:
- Integer value extracted from settings map
- Throws:
java.text.ParseException
-
parseBoolParam
protected boolean parseBoolParam(@Nullable java.util.Map<java.lang.String,java.lang.Object> settings, java.lang.String name, boolean defaultValue) throws java.text.ParseException
Extracts a boolean from the settings map, otherwise throws an exception- Parameters:
settings- Map of settings provided to this modelname- Name of parameter we are attempting to extractdefaultValue- Default value to be used if value does not exist in map- Returns:
- Boolean value extracted from settings map
- Throws:
java.text.ParseException
-
checkUnrecognizedParams
protected void checkUnrecognizedParams(@Nullable java.util.Map<java.lang.String,java.lang.Object> settings) throws java.text.ParseException
- Throws:
java.text.ParseException
-
-