Package org.elasticsearch.index.mapper
Class MapperTestCase.ParameterChecker
java.lang.Object
org.elasticsearch.index.mapper.MapperTestCase.ParameterChecker
- Enclosing class:
MapperTestCase
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAsserts that every parameter returned by the given builder'sFieldMapper.Builder.getParameters()has been registered with either an update check or a conflict check.voidregisterConflictCheck(String param, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> update) Register a check that a parameter update will cause a conflict, using the minimal mapping as a basevoidregisterConflictCheck(String param, org.elasticsearch.xcontent.XContentBuilder init, org.elasticsearch.xcontent.XContentBuilder update) Register a check that a parameter update will cause a conflictvoidregisterIgnoredParameter(String param) Register a parameter returned from getParameters() that cannot actually be configured, for example script parameters on NumberFieldMapper for numeric types that don't implement scripting.voidregisterUpdateCheck(String param, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> update, Consumer<FieldMapper> check) Register a check that a parameter can be updated, using the minimal mapping as a basevoidregisterUpdateCheck(String param, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> init, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> update, Consumer<FieldMapper> check) Register a check that a parameter can be updated
-
Constructor Details
-
ParameterChecker
public ParameterChecker()
-
-
Method Details
-
registerUpdateCheck
public void registerUpdateCheck(String param, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> update, Consumer<FieldMapper> check) throws IOExceptionRegister a check that a parameter can be updated, using the minimal mapping as a base- Parameters:
param- the parameter nameupdate- a field builder applied on top of the minimal mappingcheck- a check that the updated parameter has been applied to the FieldMapper- Throws:
IOException
-
registerUpdateCheck
public void registerUpdateCheck(String param, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> init, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, throws IOExceptionIOException> update, Consumer<FieldMapper> check) Register a check that a parameter can be updated- Parameters:
param- the parameter nameinit- the initial mappingupdate- the updated mappingcheck- a check that the updated parameter has been applied to the FieldMapper- Throws:
IOException
-
registerConflictCheck
public void registerConflictCheck(String param, org.elasticsearch.core.CheckedConsumer<org.elasticsearch.xcontent.XContentBuilder, IOException> update) throws IOExceptionRegister a check that a parameter update will cause a conflict, using the minimal mapping as a base- Parameters:
param- the parameter name, expected to appear in the error messageupdate- a field builder applied on top of the minimal mapping- Throws:
IOException
-
registerConflictCheck
public void registerConflictCheck(String param, org.elasticsearch.xcontent.XContentBuilder init, org.elasticsearch.xcontent.XContentBuilder update) Register a check that a parameter update will cause a conflict- Parameters:
param- the parameter name, expected to appear in the error messageinit- the initial mappingupdate- the updated mapping
-
registerIgnoredParameter
Register a parameter returned from getParameters() that cannot actually be configured, for example script parameters on NumberFieldMapper for numeric types that don't implement scripting.- Parameters:
param- the parameter name
-
ensureAllParametersAreCovered
Asserts that every parameter returned by the given builder'sFieldMapper.Builder.getParameters()has been registered with either an update check or a conflict check.
-