Class DataValidationRules
java.lang.Object
com.intellij.internal.statistic.eventLog.validator.rules.beans.DataValidationRules
- All Implemented Interfaces:
com.intellij.internal.statistic.eventLog.validator.IDataValidationRules
- Direct Known Subclasses:
EventGroupRules
public class DataValidationRules
extends Object
implements com.intellij.internal.statistic.eventLog.validator.IDataValidationRules
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDataValidationRules(@NotNull ValidationSimpleRuleFactory factory, Map<String, ? extends Set<String>> eventDataRules, @NotNull EventGroupContextData contextData, @NotNull List<String> excludedFields) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic @NotNull DataValidationRulescreate(@Nullable Map<String, Set<String>> eventDataRules, @NotNull com.intellij.internal.statistic.eventLog.validator.storage.GlobalRulesHolder globalRulesHolder, @NotNull ValidationSimpleRuleFactory factory, @NotNull List<String> excludedFields, @Nullable com.intellij.internal.statistic.eventLog.validator.DictionaryStorage dictionaryStorage) @NotNull List<com.intellij.internal.statistic.eventLog.validator.rules.impl.beans.EventDataField> replaceRejectedValuesWithDefaultValues(@NotNull Map<String, Object> eventData, @NotNull com.intellij.internal.statistic.eventLog.validator.IEventContext context) @NotNull com.intellij.internal.statistic.eventLog.validator.rules.impl.beans.EventDataFieldvalidateData(@NotNull String key, @Nullable Object data, @NotNull com.intellij.internal.statistic.eventLog.validator.IEventContext context, @NotNull String jsonPath) Validates the data inside log event.@NotNull com.intellij.internal.statistic.eventLog.validator.rules.impl.beans.EventDataFieldvalidateEventData(@NotNull String key, @Nullable Object data, @NotNull com.intellij.internal.statistic.eventLog.validator.IEventContext context) Validates the data for a given event field.@NotNull List<com.intellij.internal.statistic.eventLog.validator.rules.impl.beans.EventDataField> validateRequiredFields(@NotNull Map<String, Object> eventData, @NotNull com.intellij.internal.statistic.eventLog.validator.IEventContext context)
-
Field Details
-
EMPTY
-
eventDataRules
-
requiredFieldsRules
-
defaultValuesRules
-
myExcludedFields
-
-
Constructor Details
-
DataValidationRules
protected DataValidationRules(@NotNull @NotNull ValidationSimpleRuleFactory factory, Map<String, ? extends Set<String>> eventDataRules, @NotNull @NotNull EventGroupContextData contextData, @NotNull @NotNull List<String> excludedFields)
-
-
Method Details
-
create
@NotNull public static @NotNull DataValidationRules create(@Nullable @Nullable Map<String, Set<String>> eventDataRules, @NotNull @NotNull com.intellij.internal.statistic.eventLog.validator.storage.GlobalRulesHolder globalRulesHolder, @NotNull @NotNull ValidationSimpleRuleFactory factory, @NotNull @NotNull List<String> excludedFields, @Nullable @Nullable com.intellij.internal.statistic.eventLog.validator.DictionaryStorage dictionaryStorage) -
validateEventData
@NotNull public @NotNull com.intellij.internal.statistic.eventLog.validator.rules.impl.beans.EventDataField validateEventData(@NotNull @NotNull String key, @Nullable @Nullable Object data, @NotNull @NotNull com.intellij.internal.statistic.eventLog.validator.IEventContext context) Validates the data for a given event field.- Specified by:
validateEventDatain interfacecom.intellij.internal.statistic.eventLog.validator.IDataValidationRules- Parameters:
key- The name of event field.data- The data to be validated.context- The event context to store errors.- Returns:
- validated event data field, incorrect values are replaced with
ValidationResultType.getDescription().
-
validateData
@NotNull public @NotNull com.intellij.internal.statistic.eventLog.validator.rules.impl.beans.EventDataField validateData(@NotNull @NotNull String key, @Nullable @Nullable Object data, @NotNull @NotNull com.intellij.internal.statistic.eventLog.validator.IEventContext context, @NotNull @NotNull String jsonPath) Validates the data inside log event.- Specified by:
validateDatain interfacecom.intellij.internal.statistic.eventLog.validator.IDataValidationRules- Parameters:
key- The key used to get the validation rules.data- The data to be validated.context- The event context to store errors.jsonPath- JSON path to validated field inside event, e.g "event.data", "client_data", "system_data", "ids", etc. Used to distinguish error in context.- Returns:
- validated data, incorrect values are replaced with
ValidationResultType.getDescription()
-
areEventDataRulesDefined
public boolean areEventDataRulesDefined() -
getEventDataRules
@NotNull public @NotNull Map<String,com.intellij.internal.statistic.eventLog.validator.rules.FUSRule[]> getEventDataRules()- Specified by:
getEventDataRulesin interfacecom.intellij.internal.statistic.eventLog.validator.IDataValidationRules
-
validateRequiredFields
@NotNull public @NotNull List<com.intellij.internal.statistic.eventLog.validator.rules.impl.beans.EventDataField> validateRequiredFields(@NotNull @NotNull Map<String, Object> eventData, @NotNull @NotNull com.intellij.internal.statistic.eventLog.validator.IEventContext context) - Specified by:
validateRequiredFieldsin interfacecom.intellij.internal.statistic.eventLog.validator.IDataValidationRules
-
replaceRejectedValuesWithDefaultValues
@NotNull public @NotNull List<com.intellij.internal.statistic.eventLog.validator.rules.impl.beans.EventDataField> replaceRejectedValuesWithDefaultValues(@NotNull @NotNull Map<String, Object> eventData, @NotNull @NotNull com.intellij.internal.statistic.eventLog.validator.IEventContext context) - Specified by:
replaceRejectedValuesWithDefaultValuesin interfacecom.intellij.internal.statistic.eventLog.validator.IDataValidationRules
-