Package de.gebit.integrity.comparator

## Class SimpleComparisonResult

- java.lang.Object
- - de.gebit.integrity.comparator.SimpleComparisonResult

- All Implemented Interfaces:
    `ComparisonResult`
  Direct Known Subclasses:
    `MapComparisonResult`

      public class SimpleComparisonResult
      extends Object
      implements ComparisonResult

  The most basic comparison result. This is just a boolean yes/no, without any additional information.
  Author:
    Rene Schneider - initial API and implementation

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static SimpleComparisonResult` | `EQUAL` | The result value for "equality".
    `static SimpleComparisonResult` | `NOT_EQUAL` | The result value for "inequality".

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SimpleComparisonResult​(boolean anEqualityFlag)` | Creates a new instance.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `equals​(Object anOther)` |
    `int` | `hashCode()` |
    `boolean` | `isSuccessful()` | Whether this result documents a successful comparison.
    `static SimpleComparisonResult` | `valueOf​(boolean aValue)` | Returns the matching `SimpleComparisonResult` for a given boolean value.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EQUAL

          public static final SimpleComparisonResult EQUAL

      The result value for "equality". Can be used to prevent allocation of new objects.

    - #### NOT_EQUAL

          public static final SimpleComparisonResult NOT_EQUAL

      The result value for "inequality". Can be used to prevent allocation of new objects.

  - ### Constructor Detail

    - #### SimpleComparisonResult

          public SimpleComparisonResult​(boolean anEqualityFlag)

      Creates a new instance.
      Parameters:
        `anEqualityFlag` - whether the result should represent equality or inequality

  - ### Method Detail

    - #### valueOf

          public static SimpleComparisonResult valueOf​(boolean aValue)

      Returns the matching `SimpleComparisonResult` for a given boolean value.
      Parameters:
        `aValue` - the value
      Returns:
        the `SimpleComparisonResult`

    - #### isSuccessful

          public boolean isSuccessful()

      Description copied from interface: `ComparisonResult`
      Whether this result documents a successful comparison. Most of the time, this boils down to whether the result equals the expected value, but custom comparator fixtures may override this.
      Specified by:
        `isSuccessful` in interface `ComparisonResult`
      Returns:

    - #### equals

          public boolean equals​(Object anOther)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`