class CheckingEqualizer[L] extends AnyRef
Class used via an implicit conversion to enable two objects to be compared with
===
and !==
with a Boolean
result and an enforced type constraint between
two object types. For example:
assert(a === b) assert(c !== d)
You can also check numeric values against another with a tolerance. Here are some examples:
assert(a === (2.0 +- 0.1)) assert(c !== (2.0 +- 0.1))
- Alphabetic
- By Inheritance
- CheckingEqualizer
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
CheckingEqualizer(leftSide: L)
- leftSide
An object to convert to
Equalizer
, which represents the value on the left side of a===
or!==
invocation.
Value Members
-
def
!==(spread: Spread[L]): Boolean
Determine whether a numeric object is outside the passed
Spread
, returning aBoolean
.Determine whether a numeric object is outside the passed
Spread
, returning aBoolean
.- spread
the
Spread
against which to compare the value passed to the constructor asleftSide
- returns
true if the value passed to the constructor as
leftSide
is not within theSpread
passed to this method.
-
def
!==[R](rightSide: R)(implicit constraint: CanEqual[L, R]): Boolean
Compare two objects for inequality, returning a
Boolean
, using theConstraint
instance passed asconstraint
.Compare two objects for inequality, returning a
Boolean
, using theConstraint
instance passed asconstraint
.- rightSide
the object to compare for inequality with
leftSide
, passed to the constructor- constraint
an implicit
Constraint
instance that enforces a relationship between typesL
andR
and defines a way of calculating equality for objects of typeL
- returns
true if the
leftSide
andrightSide
objects are not equal according to the passedConstraint
instance.
-
def
===(spread: Spread[L]): Boolean
Determine whether a numeric object is within the passed
Spread
, returning aBoolean
.Determine whether a numeric object is within the passed
Spread
, returning aBoolean
.- spread
the
Spread
against which to compare the value passed to the constructor asleftSide
- returns
true if the value passed to the constructor as
leftSide
is not within theSpread
passed to this method.
-
def
===[R](rightSide: R)(implicit constraint: CanEqual[L, R]): Boolean
Compare two objects for equality, returning a
Boolean
, using theConstraint
instance passed asconstraint
.Compare two objects for equality, returning a
Boolean
, using theConstraint
instance passed asconstraint
.- rightSide
the object to compare for equality with
leftSide
, passed to the constructor- constraint
an implicit
Constraint
instance that enforces a relationship between typesL
andR
and defines a way of calculating equality for objects of typeL
- returns
true if the
leftSide
andrightSide
objects are equal according to the passedConstraint
instance.
- val leftSide: L