Interface CNumberState<N extends java.lang.Number & java.lang.Comparable<N>>

  • All Superinterfaces:
    CBaseState<N>, CObjectState<N>, java.io.Serializable
    All Known Implementing Classes:
    CDynamicNumberExtension, CStaticNumberExtension

    public interface CNumberState<N extends java.lang.Number & java.lang.Comparable<N>>
    extends CObjectState<N>

    CNumberState is an interface for Boolean state related methods.

    We need this interface to have possibility of adding state to any exists objects with the minimum change in the code.

    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default boolean betweenExclusive​(N lowerBound, N higherBound)
      Check if actual value is between lower and higher bound values (exclusive).
      default boolean betweenInclusive​(N lowerBound, N higherBound)
      Check if actual value is between lower and higher bound values (Inclusive).
      default boolean greater​(N expected)
      Check if actual has value greater than expected.
      default boolean greaterOrEqual​(N expected)
      Check if actual has value greater or equal to expected.
      default boolean isEqual​(N expected)
      Check if actual and expected have the exact same value.
      default boolean isEqual​(N expected, N precision)
      Check if actual and expected have the exact same value or their difference is less than precision value.
      default boolean less​(N expected)
      Check if actual has value less than expected.
      default boolean lessOrEqual​(N expected)
      Check if actual has value less or equal than expected.
      default boolean notBetweenExclusive​(N lowerBound, N higherBound)
      Check if actual value is NOT between lower and higher bound values (Exclusive).
      default boolean notBetweenInclusive​(N lowerBound, N higherBound)
      Check if actual value is NOT between lower and higher bound values (Inclusive).
      default boolean notEquals​(N expected)
      Check if actual and expected do not have the exact same value.
      default boolean notEquals​(N expected, N precision)
      Check if actual and expected have different value greater than precision value.
    • Method Detail

      • betweenExclusive

        default boolean betweenExclusive​(N lowerBound,
                                         N higherBound)
        Check if actual value is between lower and higher bound values (exclusive).
        Parameters:
        lowerBound - lower bound inclusive
        higherBound - higher bound inclusive
        Returns:
        execution boolean result
      • betweenInclusive

        default boolean betweenInclusive​(N lowerBound,
                                         N higherBound)
        Check if actual value is between lower and higher bound values (Inclusive).
        Parameters:
        lowerBound - lower bound inclusive
        higherBound - higher bound inclusive
        Returns:
        execution boolean result
      • isEqual

        default boolean isEqual​(N expected)
        Check if actual and expected have the exact same value.
        Specified by:
        isEqual in interface CObjectState<N extends java.lang.Number & java.lang.Comparable<N>>
        Parameters:
        expected - value to compare
        Returns:
        execution boolean result
      • notEquals

        default boolean notEquals​(N expected)
        Check if actual and expected do not have the exact same value.
        Specified by:
        notEquals in interface CObjectState<N extends java.lang.Number & java.lang.Comparable<N>>
        Parameters:
        expected - value to compare
        Returns:
        execution boolean result
      • isEqual

        default boolean isEqual​(N expected,
                                N precision)
        Check if actual and expected have the exact same value or their difference is less than precision value.
        Parameters:
        expected - value to compare
        precision - the acceptable precision
        Returns:
        execution boolean result
      • greater

        default boolean greater​(N expected)
        Check if actual has value greater than expected.
        Parameters:
        expected - value to compare
        Returns:
        execution boolean result
      • greaterOrEqual

        default boolean greaterOrEqual​(N expected)
        Check if actual has value greater or equal to expected.
        Parameters:
        expected - value to compare
        Returns:
        execution boolean result
      • less

        default boolean less​(N expected)
        Check if actual has value less than expected.
        Parameters:
        expected - value to compare
        Returns:
        execution boolean result
      • lessOrEqual

        default boolean lessOrEqual​(N expected)
        Check if actual has value less or equal than expected.
        Parameters:
        expected - value to compare
        Returns:
        execution boolean result
      • notBetweenExclusive

        default boolean notBetweenExclusive​(N lowerBound,
                                            N higherBound)
        Check if actual value is NOT between lower and higher bound values (Exclusive).
        Parameters:
        lowerBound - lower bound inclusive
        higherBound - higher bound inclusive
        Returns:
        execution boolean result
      • notBetweenInclusive

        default boolean notBetweenInclusive​(N lowerBound,
                                            N higherBound)
        Check if actual value is NOT between lower and higher bound values (Inclusive).
        Parameters:
        lowerBound - lower bound inclusive
        higherBound - higher bound inclusive
        Returns:
        execution boolean result
      • notEquals

        default boolean notEquals​(N expected,
                                  N precision)
        Check if actual and expected have different value greater than precision value.

        Please note that verification consider as passe if one value is null

        Parameters:
        expected - value to compare
        precision - the acceptable precision
        Returns:
        execution boolean result