Tabnine Logo
Assertion.getType
Code IndexAdd Tabnine to your IDE (free)

How to use
getType
method
in
org.batfish.datamodel.questions.Assertion

Best Java code snippets using org.batfish.datamodel.questions.Assertion.getType (Showing top 2 results out of 315)

origin: batfish/batfish

@Override
public boolean equals(Object o) {
 if (!(o instanceof Assertion)) {
  return false;
 }
 Assertion other = (Assertion) o;
 return Objects.equals(_assertionType, other.getType())
   && Objects.equals(_expect, other.getExpect());
}
origin: batfish/batfish

/**
 * Evaluates the assertion over the rows
 *
 * @return The results of the evaluation
 */
public boolean evaluateAssertion(Assertion assertion) {
 if (assertion == null) {
  throw new IllegalArgumentException("Provided assertion object cannot be null");
 }
 switch (assertion.getType()) {
  case countequals:
   return _rows.size() == assertion.getExpect().asInt();
  case countlessthan:
   return _rows.size() < assertion.getExpect().asInt();
  case countmorethan:
   return _rows.size() > assertion.getExpect().asInt();
  case equals:
   Rows expectedEntries;
   try {
    expectedEntries =
      BatfishObjectMapper.mapper().readValue(assertion.getExpect().toString(), Rows.class);
   } catch (IOException e) {
    throw new BatfishException("Could not recover Rows object from expect", e);
   }
   return _rows.equals(expectedEntries);
  default:
   throw new BatfishException("Unhandled assertion type: " + assertion.getType());
 }
}
org.batfish.datamodel.questionsAssertiongetType

Popular methods of Assertion

  • <init>
  • getExpect

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • ImageIO (javax.imageio)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Option (scala)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now