Record Class CheckResult

java.lang.Object
java.lang.Record
com.codeborne.selenide.CheckResult

@ParametersAreNonnullByDefault public record CheckResult(CheckResult.Verdict verdict, @Nullable String message, @Nullable Object actualValue, LocalDateTime timestamp) extends Record
Since:
6.0.0
  • Constructor Details

    • CheckResult

      public CheckResult(CheckResult.Verdict verdict, @Nullable Object actualValue)
    • CheckResult

      public CheckResult(boolean checkSucceeded, @Nullable Object actualValue)
    • CheckResult

      public CheckResult(CheckResult.Verdict verdict, @Nullable String message, @Nullable Object actualValue, LocalDateTime timestamp)
      Creates an instance of a CheckResult record class.
      Parameters:
      verdict - the value for the verdict record component
      message - the value for the message record component
      actualValue - the value for the actualValue record component
      timestamp - the value for the timestamp record component
  • Method Details

    • rejected

      public static CheckResult rejected(String message, @Nullable Object actualValue)
    • accepted

      public static CheckResult accepted()
    • accepted

      public static CheckResult accepted(@Nullable Object actualValue)
    • toString

      public 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
    • getMessageOrElse

      @Nonnull @CheckReturnValue public String getMessageOrElse(Supplier<String> defaultMessage)
    • getActualValue

      @Nullable @CheckReturnValue public <T> T getActualValue()
    • getActualValueOrElse

      @Nonnull @CheckReturnValue public <T> T getActualValueOrElse(T defaultValue)
    • requireActualValue

      @Nonnull @CheckReturnValue public <T> T requireActualValue()
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • verdict

      public CheckResult.Verdict verdict()
      Returns the value of the verdict record component.
      Returns:
      the value of the verdict record component
    • message

      @Nullable public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • actualValue

      @Nullable public Object actualValue()
      Returns the value of the actualValue record component.
      Returns:
      the value of the actualValue record component
    • timestamp

      public LocalDateTime timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component