Codota Logo
FieldValidator
Code IndexAdd Codota to your IDE (free)

How to use
FieldValidator
in
org.apache.metron.common.configuration

Best Java code snippets using org.apache.metron.common.configuration.FieldValidator (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: apache/metron

@Override
public boolean equals(Object o) {
 if (this == o) return true;
 if (o == null || getClass() != o.getClass()) return false;
 FieldValidator that = (FieldValidator) o;
 if (getValidation() != null ? !getValidation().equals(that.getValidation()) : that.getValidation() != null)
  return false;
 if (getInput() != null ? !getInput().equals(that.getInput()) : that.getInput() != null) return false;
 return getConfig() != null ? getConfig().equals(that.getConfig()) : that.getConfig() == null;
}
origin: apache/metron

 private List<FieldValidator> getFailedValidators(JSONObject message, ParserConfigurations parserConfigurations) {
  List<FieldValidator> fieldValidations = parserConfigurations.getFieldValidations();
  List<FieldValidator> failedValidators = new ArrayList<>();
  for(FieldValidator validator : fieldValidations) {
   if(!validator.isValid(message, parserConfigurations.getGlobalConfig(), stellarContext)) {
    failedValidators.add(validator);
   }
  }
  return failedValidators;
 }
}
origin: apache/metron

public static List<FieldValidator> readValidations(Map<String, Object> globalConfig) {
 List<FieldValidator> validators = new ArrayList<>();
 List<Object> validations = (List<Object>) Config.FIELD_VALIDATIONS.get(globalConfig, List.class);
 if(validations != null) {
  for (Object o : validations) {
   FieldValidator f = new FieldValidator(o);
   f.getValidation().initialize(f.getConfig(), globalConfig);
   validators.add(new FieldValidator(o));
  }
 }
 return validators;
}
origin: apache/metron

    .addRawMessage(message);
Set<String> errorFields = failedValidators == null ? null : failedValidators.stream()
    .flatMap(fieldValidator -> fieldValidator.getInput().stream())
    .collect(Collectors.toSet());
if (errorFields != null && !errorFields.isEmpty()) {
origin: apache/metron

public void updateGlobalConfig(Map<String, Object> globalConfig) {
 if(globalConfig != null) {
  getConfigurations().put(ConfigurationType.GLOBAL.getTypeName(), globalConfig);
  validations = FieldValidator.readValidations(getGlobalConfig());
 }
}
origin: apache/metron

FieldValidator l = sampleConfigurations.getFieldValidations().get(i);
FieldValidator r = configuredBoltConfigs.getFieldValidations().get(i);
if(!l.equals(r)) {
 System.out.println(l + " != " + r);
origin: apache/metron

@Test
public void testValidConfiguration() throws IOException {
 {
  Configurations configurations = getConfiguration(validValidationConfigWithStringInput);
  Assert.assertNotNull(configurations.getFieldValidations());
  Assert.assertEquals(1, configurations.getFieldValidations().size());
  Assert.assertEquals(ImmutableList.of("field1"), configurations.getFieldValidations().get(0).getInput());
 }
 {
  Configurations configurations = getConfiguration(validValidationConfigWithListInput);
  Assert.assertNotNull(configurations.getFieldValidations());
  Assert.assertEquals(1, configurations.getFieldValidations().size());
  Assert.assertEquals(ImmutableList.of("field1", "field2"), configurations.getFieldValidations().get(0).getInput());
 }
}
origin: apache/metron

@Override
public int hashCode() {
 int result = getValidation() != null ? getValidation().hashCode() : 0;
 result = 31 * result + (getInput() != null ? getInput().hashCode() : 0);
 result = 31 * result + (getConfig() != null ? getConfig().hashCode() : 0);
 return result;
}
origin: apache/metron

 public boolean execute(String config, Map<String, Object> input) throws IOException {
  Configurations configurations = getConfiguration(config);

  FieldValidator validator = getValidator(configurations);
  return validator.isValid(new JSONObject(input)
              ,configurations.getGlobalConfig()
              , Context.EMPTY_CONTEXT()

              );
 }
}
org.apache.metron.common.configurationFieldValidator

Most used methods

  • getInput
  • isValid
  • <init>
  • equals
  • getConfig
  • getValidation
  • readValidations

Popular in Java

  • Updating database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now