Record Class Recognizer.RecognizerResult

java.lang.Object
java.lang.Record
chemaxon.formats.Recognizer.RecognizerResult
Record Components:
acceptedFormats - the accepted formats if recognition was successful or an empty list otherwise
rejectedFormats - the surely rejected formats if recognition was unsuccessful. This list can be empty even in the case of unsuccessful recognition, which means that the recognizer could not make a decision about the format based on the given line.
Enclosing class:
Recognizer

public static record Recognizer.RecognizerResult(List<String> acceptedFormats, List<String> rejectedFormats) extends Record
Represents the result of a format recognition attempt.
  • Constructor Details

    • RecognizerResult

      public RecognizerResult(List<String> acceptedFormats, List<String> rejectedFormats)
      Creates an instance of a RecognizerResult record class.
      Parameters:
      acceptedFormats - the value for the acceptedFormats record component
      rejectedFormats - the value for the rejectedFormats record component
  • Method Details

    • accept

      public static Recognizer.RecognizerResult accept(String... acceptedFormats)
      Creates a Recognizer.RecognizerResult object accepting the given formats.
    • accept

      public static Recognizer.RecognizerResult accept(List<String> acceptedFormats)
      Creates a Recognizer.RecognizerResult object accepting the given formats.
    • reject

      public static Recognizer.RecognizerResult reject(String... rejectedFormats)
      Creates a Recognizer.RecognizerResult object rejecting the given formats.
    • reject

      public static Recognizer.RecognizerResult reject(List<String> rejectedFormats)
      Creates a Recognizer.RecognizerResult object rejecting the given formats.
    • hasAcceptedFormats

      public boolean hasAcceptedFormats()
      Returns true if the recognition was successful and at least one format was accepted, false otherwise.
    • 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. 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.
    • acceptedFormats

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

      public List<String> rejectedFormats()
      Returns the value of the rejectedFormats record component.
      Returns:
      the value of the rejectedFormats record component