Equalizer
Class used via an implicit conversion to enable any two objects to be compared with ===
and !==
with a Boolean
result and no 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))
Value parameters
- leftSide
-
An object to convert to
Equalizer
, which represents the value on the left side of a===
or!==
invocation.
Attributes
- Source
- TripleEqualsSupport.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Compare two objects for inequality, returning a Boolean
, using the Equality
type class passed as equality
.
Compare two objects for inequality, returning a Boolean
, using the Equality
type class passed as equality
.
Value parameters
- equality
-
an implicit
Equality
type class that defines a way of calculating equality for objects of typeL
- rightSide
-
the object to compare for inequality with
leftSide
, passed to the constructor
Attributes
- Returns
-
true if the
leftSide
andrightSide
objects are not equal according to the passedEquality
type class. - Source
- TripleEqualsSupport.scala
Determine whether a numeric object is outside the passed Spread
, returning a Boolean
.
Determine whether a numeric object is outside the passed Spread
, returning a Boolean
.
Value parameters
- spread
-
the
Spread
against which to compare the value passed to the constructor asleftSide
Attributes
- Returns
-
true if the value passed to the constructor as
leftSide
is not within theSpread
passed to this method. - Source
- TripleEqualsSupport.scala
Determines whether an object reference is non-null
.
Determines whether an object reference is non-null
.
Value parameters
- literalNull
-
a
null
value against which to compare the value passed to the constructor asleftSide
for inequality
Attributes
- Returns
-
true if the value passed to the constructor as
leftSide
is non-null
. - Source
- TripleEqualsSupport.scala
Compare two objects for equality, returning a Boolean
, using the Equality
type class passed as equality
.
Compare two objects for equality, returning a Boolean
, using the Equality
type class passed as equality
.
Value parameters
- equality
-
an implicit
Equality
type class that defines a way of calculating equality for objects of typeL
- rightSide
-
the object to compare for equality with
leftSide
, passed to the constructor
Attributes
- Returns
-
true if the
leftSide
andrightSide
objects are equal according to the passedEquality
type class. - Source
- TripleEqualsSupport.scala
Determine whether a numeric object is within the passed Spread
, returning a Boolean
.
Determine whether a numeric object is within the passed Spread
, returning a Boolean
.
Value parameters
- spread
-
the
Spread
against which to compare the value passed to the constructor asleftSide
Attributes
- Returns
-
true if the value passed to the constructor as
leftSide
is within theSpread
passed to this method. - Source
- TripleEqualsSupport.scala
Determine whether an object reference is null
.
Determine whether an object reference is null
.
Value parameters
- literalNull
-
a
null
value against which to compare the value passed to the constructor asleftSide
for equality
Attributes
- Returns
-
true if the value passed to the constructor as
leftSide
isnull
. - Source
- TripleEqualsSupport.scala
Concrete fields
Attributes
- Source
- TripleEqualsSupport.scala