com.wix.accord

combinators

package combinators

Aggregates all implemented combinators for use by the DSL. Can, though not intended to, be used directly by end-user code.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. combinators
  2. BooleanCombinators
  3. OrderingCombinators
  4. StringCombinators
  5. CollectionCombinators
  6. GeneralPurposeCombinators
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. class AnInstanceOf[T <: AnyRef] extends NullSafeValidator[AnyRef]

    A validator that succeeds only if the validated object is an instance of the specified type.

  2. class And[T] extends Validator[T]

    A combinator that takes a chain of predicates and implements logical AND between them.

  3. trait BooleanCombinators extends AnyRef

    Simple boolean combinators.

  4. trait CollectionCombinators extends AnyRef

    Combinators that operate on collections and collection-like structures.

  5. class Conditional[T] extends Validator[T]

    A validator that branches at runtime based on the value of the object under validation.

  6. class Empty[T <: AnyRef] extends NullSafeValidator[T]

    A validator that operates on objects that can be empty, and succeeds only if the provided instance is empty.

  7. class EndsWith extends NullSafeValidator[String]

    A validator that succeeds only if the provided string starts with the specified suffix.

  8. class EqualTo[T] extends Validator[T]

    A validator that succeeds only if the validated object is equal to the specified value.

  9. case class EquivalentTo[T](other: T, prefix: String)(implicit ev: Ordering[T]) extends BaseValidator[T] with Product with Serializable

    A validator that succeeds only for value equivalent (as determined by scala.math.Ordering.equiv) to the specified bound.

  10. class Fail[T] extends Validator[T]

    A validator that always fails with a specific violation.

  11. trait GeneralPurposeCombinators extends AnyRef

    Non type-specific combinators.

  12. case class GreaterThan[T](bound: T, prefix: String)(implicit ev: Ordering[T]) extends BaseValidator[T] with Product with Serializable

    A validator that succeeds only for values greater than the specified bound.

  13. case class GreaterThanOrEqual[T](bound: T, prefix: String)(implicit ev: Ordering[T]) extends BaseValidator[T] with Product with Serializable

    A validator that succeeds only for values greater than, or equal to, the specified bound.

  14. type HasEmpty = AnyRef { def isEmpty: Boolean }

    A structural type representing any object that can be empty.

    A structural type representing any object that can be empty.

    Definition Classes
    CollectionCombinators
  15. case class In[T](set: Set[T], prefix: String) extends BaseValidator[T] with Product with Serializable

    A validator that succeeds only if the object exists in the target collection.

  16. sealed trait InRange[T] extends Validator[T]

    A base trait for a validator that succeeds only for values between the specified bounds, and may be inclusive or exclusive.

  17. case class InRangeExclusive[T](lowerBound: T, upperBound: T, prefix: String)(implicit ev: Ordering[T]) extends BaseValidator[T] with InRange[T] with Product with Serializable

    A validator that succeeds only for values between the specified bounds (exclusive of the upper bound).

  18. case class InRangeInclusive[T](lowerBound: T, upperBound: T, prefix: String)(implicit ev: Ordering[T]) extends BaseValidator[T] with InRange[T] with Product with Serializable

    A validator that succeeds only for values between the specified bounds (both bounds are inclusive).

  19. class IsFalse extends BaseValidator[Boolean]

    A boolean validator that matches only on false.

  20. class IsNotNull extends BaseValidator[AnyRef]

    A validator that succeeds only if the provided object is not null.

  21. class IsNull extends BaseValidator[AnyRef]

    A validator that succeeds only if the provided object is null.

  22. class IsTrue extends BaseValidator[Boolean]

    A boolean validator that matches only on true.

  23. case class LesserThan[T](bound: T, prefix: String)(implicit ev: Ordering[T]) extends BaseValidator[T] with Product with Serializable

    A validator that succeeds only for values lesser than the specified bound.

  24. case class LesserThanOrEqual[T](bound: T, prefix: String)(implicit ev: Ordering[T]) extends BaseValidator[T] with Product with Serializable

    A validator that succeeds only for values less than, or equal to, the specified bound.

  25. class MatchesRegex extends NullSafeValidator[String]

    A validator that succeeds only if the provided string matches the specified pattern.

  26. class NilValidator[T] extends Validator[T]

    A validator that always succeeds.

  27. class NotAnInstanceOf[T <: AnyRef] extends NullSafeValidator[AnyRef]

    A validator that fails only if the validated object is an instance of the specified type.

  28. class NotEmpty[T <: AnyRef] extends NullSafeValidator[T]

    A validator that operates on objects that can be empty, and succeeds only if the provided instance is not empty.

  29. class NotEqualTo[T] extends Validator[T]

    A validator that succeeds only if the validated object is not equal to the specified value.

  30. class Or[T] extends Validator[T]

    A combinator that takes a chain of predicates and implements logical OR between them.

  31. trait OrderingCombinators extends AnyRef

    Provides combinators over objects implementing scala.math.Ordering.

  32. class StartsWith extends NullSafeValidator[String]

    A validator that succeeds only if the provided string starts with the specified prefix.

  33. trait StringCombinators extends AnyRef

    Combinators that operate specifically on strings.

  34. class Valid[T] extends Validator[T]

    A validator which merely delegates to another, implicitly available validator.

Value Members

  1. object Distinct extends Validator[Traversable[_]]

    A validator that succeeds only if the provided collection has no duplicate elements.

  2. implicit def genericTraversableOnce2HasEmpty[T](gto: T)(implicit ev: (T) ⇒ GenTraversableOnce[_]): HasEmpty

    An implicit conversion to enable any collection-like object (e.

    An implicit conversion to enable any collection-like object (e.g. strings, options) to be handled by the com.wix.accord.combinators.CollectionCombinators.Empty and com.wix.accord.combinators.CollectionCombinators.NotEmpty combinators.

    java.lang.String does not directly implement isEmpty (in practice it is implemented in scala.collection.IndexedSeqOptimized, via an implicit conversion and an inheritance stack), and this is a case where the Scala compiler does not always infer structural types correctly. By requiring a view bound from T to scala.collection.GenTraversableOnce we can force any collection-like structure to conform to the structural type com.wix.accord.combinators.HasEmpty, and by requiring a view bound from T to com.wix.accord.combinators.HasEmpty at the call site (e.g. com.wix.accord.dsl.empty) we additionally support any class that directly conforms to the structural type as well.

    T

    The type that conforms, directly or implicitly, to com.wix.accord.combinators.HasEmpty.

    gto

    An object that is, or is implicitly convertible to, scala.collection.GenTraversableOnce.

    returns

    The specified object, strictly-typed as com.wix.accord.combinators.HasEmpty.

    Definition Classes
    CollectionCombinators

Inherited from BooleanCombinators

Inherited from OrderingCombinators

Inherited from StringCombinators

Inherited from CollectionCombinators

Inherited from GeneralPurposeCombinators

Inherited from AnyRef

Inherited from Any

Ungrouped