com.wix.accord.scalatest.ResultMatchers

RuleViolationMatcher

case class RuleViolationMatcher(value: Any = null, constraint: String = null, legacyDescription: String = null, description: Description = null) extends (ResultMatchers.this)#ViolationMatcher with Product with Serializable

A matcher over com.wix.accord.RuleViolations. To generate a violation rule "pattern", call the constructor with the required predicates, for example:

val firstNameNotEmpty = RuleViolationMatcher( description = AccessChain( "firstName" ), constraint = "must not be empty" ) val validationResult: Result = ... validationResult must failWith( firstNameNotEmpty )

value

A predicate specifying the object under validation.

constraint

A predicate specifying the constraint being violated.

legacyDescription

Retained for backwards compatibility; matches against the rendered description of the object being validated. See com.wix.accord.Descriptions.render for details of how descriptions are rendered into strings.

description

A predicate specifying the description of the object being validated.

See also

com.wix.accord.RuleViolation

Linear Supertypes
Serializable, Serializable, Product, Equals, (ResultMatchers.this)#ViolationMatcher, Matcher[Violation], (Violation) ⇒ MatchResult, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RuleViolationMatcher
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. ViolationMatcher
  7. Matcher
  8. Function1
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RuleViolationMatcher(value: Any = null, constraint: String = null, legacyDescription: String = null, description: Description = null)

    value

    A predicate specifying the object under validation.

    constraint

    A predicate specifying the constraint being violated.

    legacyDescription

    Retained for backwards compatibility; matches against the rendered description of the object being validated. See com.wix.accord.Descriptions.render for details of how descriptions are rendered into strings.

    description

    A predicate specifying the description of the object being validated.

Type Members

  1. final class AndBeWord extends AnyRef

    Definition Classes
    Matcher
  2. final class AndContainWord extends AnyRef

    Definition Classes
    Matcher
  3. final class AndEndWithWord extends AnyRef

    Definition Classes
    Matcher
  4. final class AndFullyMatchWord extends AnyRef

    Definition Classes
    Matcher
  5. final class AndHaveWord extends AnyRef

    Definition Classes
    Matcher
  6. final class AndIncludeWord extends AnyRef

    Definition Classes
    Matcher
  7. final class AndNotWord extends AnyRef

    Definition Classes
    Matcher
  8. final class AndStartWithWord extends AnyRef

    Definition Classes
    Matcher
  9. final class OrBeWord extends AnyRef

    Definition Classes
    Matcher
  10. final class OrContainWord extends AnyRef

    Definition Classes
    Matcher
  11. final class OrEndWithWord extends AnyRef

    Definition Classes
    Matcher
  12. final class OrFullyMatchWord extends AnyRef

    Definition Classes
    Matcher
  13. final class OrHaveWord extends AnyRef

    Definition Classes
    Matcher
  14. final class OrIncludeWord extends AnyRef

    Definition Classes
    Matcher
  15. final class OrNotWord extends AnyRef

    Definition Classes
    Matcher
  16. final class OrStartWithWord extends AnyRef

    Definition Classes
    Matcher

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. def and(notExist: ResultOfNotExist): MatcherFactory1[Violation, Existence]

    Definition Classes
    Matcher
  5. def and(existWord: ExistWord): MatcherFactory1[Violation, Existence]

    Definition Classes
    Matcher
  6. def and(notWord: NotWord): AndNotWord

    Definition Classes
    Matcher
  7. def and(endWithWord: EndWithWord): AndEndWithWord

    Definition Classes
    Matcher
  8. def and(startWithWord: StartWithWord): AndStartWithWord

    Definition Classes
    Matcher
  9. def and(includeWord: IncludeWord): AndIncludeWord

    Definition Classes
    Matcher
  10. def and(fullyMatchWord: FullyMatchWord): AndFullyMatchWord

    Definition Classes
    Matcher
  11. def and(beWord: BeWord): AndBeWord

    Definition Classes
    Matcher
  12. def and(containWord: ContainWord): AndContainWord

    Definition Classes
    Matcher
  13. def and(haveWord: HaveWord): AndHaveWord

    Definition Classes
    Matcher
  14. def and[U, TC1[_]](rightMatcherFactory1: MatcherFactory1[U, TC1]): MatcherFactory1[Violation with U, TC1]

    Definition Classes
    Matcher
  15. def and[U <: Violation](rightMatcher: Matcher[U]): Matcher[U]

    Definition Classes
    Matcher
  16. def andThen[A](g: (MatchResult) ⇒ A): (Violation) ⇒ A

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  17. def apply(left: Violation): MatchResult

    Definition Classes
    RuleViolationMatcher → Matcher → Function1
  18. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  19. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. def compose[U](g: (U) ⇒ Violation): Matcher[U]

    Definition Classes
    Matcher → Function1
  21. val constraint: String

    A predicate specifying the constraint being violated.

  22. val description: Description

    A predicate specifying the description of the object being validated.

  23. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  26. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  27. val legacyDescription: String

    Retained for backwards compatibility; matches against the rendered description of the object being validated.

    Retained for backwards compatibility; matches against the rendered description of the object being validated. See com.wix.accord.Descriptions.render for details of how descriptions are rendered into strings.

  28. def mapArgs(prettify: (Any) ⇒ String): Matcher[Violation]

    Definition Classes
    Matcher
  29. def mapResult(prettify: (MatchResult) ⇒ MatchResult): Matcher[Violation]

    Definition Classes
    Matcher
  30. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  31. final def notify(): Unit

    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  33. def or(notExist: ResultOfNotExist): MatcherFactory1[Violation, Existence]

    Definition Classes
    Matcher
  34. def or(existWord: ExistWord): MatcherFactory1[Violation, Existence]

    Definition Classes
    Matcher
  35. def or(notWord: NotWord): OrNotWord

    Definition Classes
    Matcher
  36. def or(endWithWord: EndWithWord): OrEndWithWord

    Definition Classes
    Matcher
  37. def or(startWithWord: StartWithWord): OrStartWithWord

    Definition Classes
    Matcher
  38. def or(includeWord: IncludeWord): OrIncludeWord

    Definition Classes
    Matcher
  39. def or(fullyMatchWord: FullyMatchWord): OrFullyMatchWord

    Definition Classes
    Matcher
  40. def or(beWord: BeWord): OrBeWord

    Definition Classes
    Matcher
  41. def or(containWord: ContainWord): OrContainWord

    Definition Classes
    Matcher
  42. def or(haveWord: HaveWord): OrHaveWord

    Definition Classes
    Matcher
  43. def or[U, TC1[_]](rightMatcherFactory1: MatcherFactory1[U, TC1]): MatcherFactory1[Violation with U, TC1]

    Definition Classes
    Matcher
  44. def or[U <: Violation](rightMatcher: Matcher[U]): Matcher[U]

    Definition Classes
    Matcher
  45. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  46. def toString(): String

    Definition Classes
    RuleViolationMatcher → Function1 → AnyRef → Any
  47. val value: Any

    A predicate specifying the object under validation.

  48. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from (ResultMatchers.this)#ViolationMatcher

Inherited from Matcher[Violation]

Inherited from (Violation) ⇒ MatchResult

Inherited from AnyRef

Inherited from Any

Ungrouped