Class DataValidationRules
java.lang.Object
com.intellij.internal.statistic.eventLog.validator.rules.beans.DataValidationRules
- Direct Known Subclasses:
EventGroupRules
-
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) com.intellij.internal.statistic.eventLog.validator.rules.impl.beans.EventDataFieldvalidateData(@NotNull String key, @Nullable Object data, @NotNull EventContext context, @NotNull String jsonPath) Validates the data inside log event.com.intellij.internal.statistic.eventLog.validator.rules.impl.beans.EventDataFieldvalidateEventData(@NotNull String key, @Nullable Object data, @NotNull EventContext context) Validates the data for a given event field.
-
Field Details
-
EMPTY
-
eventDataRules
-
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) -
validateEventData
public com.intellij.internal.statistic.eventLog.validator.rules.impl.beans.EventDataField validateEventData(@NotNull @NotNull String key, @Nullable @Nullable Object data, @NotNull @NotNull EventContext context) Validates the data for a given event field.- 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
public com.intellij.internal.statistic.eventLog.validator.rules.impl.beans.EventDataField validateData(@NotNull @NotNull String key, @Nullable @Nullable Object data, @NotNull @NotNull EventContext context, @NotNull @NotNull String jsonPath) Validates the data inside log event.- 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
-