Trait

com.wix.accord.dsl

CollectionOps

Related Doc: package dsl

Permalink

trait CollectionOps extends AnyRef

Provides a DSL for collection-like objects. Works in conjunction with com.wix.accord.dsl.DslContext.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CollectionOps
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type HasSize = Any { def size: Int }

    Permalink

    A structural type representing any object that has a size.

Value Members

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def distinct: combinators.Distinct.type

    Permalink

    Specifies a validator that fails on collections with duplicate elements.

  7. def empty[T <: AnyRef](implicit ev: (T) ⇒ combinators.HasEmpty): Validator[T]

    Permalink

    Specifies a validator that succeeds on empty instances; the object under validation must implement def isEmpty: Boolean (see com.wix.accord.combinators.HasEmpty).

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

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. implicit def genericTraversableOnce2HasSize[T](gto: T)(implicit ev: (T) ⇒ GenTraversableOnce[_]): HasSize

    Permalink

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

    An implicit conversion to enable any collection-like object (e.g. strings, options) to be handled by com.wix.accord.dsl.CollectionDslContext.

    java.lang.String does not directly implement size (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.dsl.CollectionOps.HasSize, and by requiring a view bound from T to com.wix.accord.dsl.CollectionOps.HasSize at the call site (via com.wix.accord.dsl.CollectionDslContext) 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.dsl.CollectionOps.HasSize.

    gto

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

    returns

    The specified object, strictly-typed as com.wix.accord.dsl.CollectionOps.HasSize.

  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. def in[T](items: T*): Validator[T]

    Permalink

    Specifies a validator that succeeds only if the object exists in the specified set of items.

  15. def in[T](set: Set[T]): Validator[T]

    Permalink

    Specifies a validator that succeeds only if the object exists in the specified set.

  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. def notEmpty[T <: AnyRef](implicit ev: (T) ⇒ combinators.HasEmpty): Validator[T]

    Permalink

    Specifies a validator that fails on empty instances; the object under validation must implement def isEmpty: Boolean (see com.wix.accord.combinators.HasEmpty).

  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. def prefix: String

    Permalink
    Attributes
    protected
  22. val size: OrderingOps

    Permalink

    Provides access to size-based validators (where the object under validation must implement def size: Int, see com.wix.accord.dsl.CollectionOps.HasSize).

    Provides access to size-based validators (where the object under validation must implement def size: Int, see com.wix.accord.dsl.CollectionOps.HasSize). Enables syntax such as c.students has size > 0.

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped