Record Class CaptureGenerationReport.OpenApiCoverage

java.lang.Object
java.lang.Record
com.shaft.capture.generate.CaptureGenerationReport.OpenApiCoverage
Record Components:
loadable - whether the provided spec could be read and parsed
loadFailureReason - safe reason loadable is false; empty otherwise
coveredOperations - METHOD normalized-path operations recorded AND declared
missingOperations - METHOD normalized-path operations declared but never recorded
undeclaredOperations - METHOD normalized-path operations recorded but not declared
totalDeclaredOperations - total number of operations declared by the spec
coverageRatio - coveredOperations.size() / totalDeclaredOperations
Enclosing class:
CaptureGenerationReport

public static record CaptureGenerationReport.OpenApiCoverage(boolean loadable, String loadFailureReason, List<String> coveredOperations, List<String> missingOperations, List<String> undeclaredOperations, int totalDeclaredOperations, double coverageRatio) extends Record
Deterministic OpenAPI coverage cross-report (see OpenApiCoverageReporter in com.shaft.capture.generate.api.internal, which this record mirrors so the report can live in this module without an API-codegen-specific dependency).
  • Constructor Details

    • OpenApiCoverage

      public OpenApiCoverage(boolean loadable, String loadFailureReason, List<String> coveredOperations, List<String> missingOperations, List<String> undeclaredOperations, int totalDeclaredOperations, double coverageRatio)
      Creates an instance of a OpenApiCoverage record class.
      Parameters:
      loadable - the value for the loadable record component
      loadFailureReason - the value for the loadFailureReason record component
      coveredOperations - the value for the coveredOperations record component
      missingOperations - the value for the missingOperations record component
      undeclaredOperations - the value for the undeclaredOperations record component
      totalDeclaredOperations - the value for the totalDeclaredOperations record component
      coverageRatio - the value for the coverageRatio record component
  • Method Details

    • notRequested

      public static CaptureGenerationReport.OpenApiCoverage notRequested()
      Returns the default state when no OpenAPI spec was provided.
      Returns:
      not-requested coverage
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • loadable

      public boolean loadable()
      Returns the value of the loadable record component.
      Returns:
      the value of the loadable record component
    • loadFailureReason

      public String loadFailureReason()
      Returns the value of the loadFailureReason record component.
      Returns:
      the value of the loadFailureReason record component
    • coveredOperations

      public List<String> coveredOperations()
      Returns the value of the coveredOperations record component.
      Returns:
      the value of the coveredOperations record component
    • missingOperations

      public List<String> missingOperations()
      Returns the value of the missingOperations record component.
      Returns:
      the value of the missingOperations record component
    • undeclaredOperations

      public List<String> undeclaredOperations()
      Returns the value of the undeclaredOperations record component.
      Returns:
      the value of the undeclaredOperations record component
    • totalDeclaredOperations

      public int totalDeclaredOperations()
      Returns the value of the totalDeclaredOperations record component.
      Returns:
      the value of the totalDeclaredOperations record component
    • coverageRatio

      public double coverageRatio()
      Returns the value of the coverageRatio record component.
      Returns:
      the value of the coverageRatio record component