com.wix.accord.dsl

CollectionOps

trait CollectionOps extends AnyRef

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

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CollectionOps
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

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

    A structural type representing any object that has a size.

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

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

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

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

    Specifies a validator that fails on collections with duplicate elements.

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

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

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

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

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

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

    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 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.

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

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

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

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

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

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

  18. final def isInstanceOf[T0]: Boolean

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

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

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

  21. final def notify(): Unit

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

    Definition Classes
    AnyRef
  23. def prefix: String

    Attributes
    protected
  24. val size: OrderingOps

    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.

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

    Definition Classes
    AnyRef
  26. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped