Trait

ars.precondition.require

RequireSize

Related Doc: package require

Permalink

trait RequireSize extends RequireCore

requireXXX methods to test Iterable size.

Since

0.0.4

Linear Supertypes
RequireCore, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RequireSize
  2. RequireCore
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  8. def exception(message: String, cause: Option[RuntimeException] = None): RuntimeException

    Permalink

    Creates a new instance of exception.

    Creates a new instance of exception. Default implementation uses RequireCore.DefaultExceptionCreator exception creator.

    message

    the message (must be non-blank)

    cause

    the cause exception (must be non-null and not Some(null))

    returns

    new exception instance (non-null)

    Definition Classes
    RequireCore
    Exceptions thrown

    RuntimeException if any argument is not valid

  9. def fail(message: ⇒ Any, throwable: Option[RuntimeException] = None): Unit

    Permalink

    Fails test.

    Fails test. Must be invoked at every time when requireXXX method fails. Default implementation invokes exception() to create new exception instance with message produced by failureMessage() method and throws the result.

    message

    the String to include in the failure message (must be non-null)

    Definition Classes
    RequireCore
    Exceptions thrown

    RuntimeException at every invokation

  10. def failureMessage[T](message: ⇒ T): String

    Permalink

    Constructs the failure message.

    Constructs the failure message. Default implementation invokes toString() method of message and returns result.

    message

    the source message (must be non-null)

    returns

    the failure message (non-null)

    Definition Classes
    RequireCore
    Exceptions thrown

    RuntimeException if message is null

  11. def finalize(): Unit

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  18. implicit def pred2elem[T](predicate: RequirePredicate[T]): RequireElementFunction[T]

    Permalink

    Wraps predicate RequirePredicate to element function RequireElementFunction.

    Wraps predicate RequirePredicate to element function RequireElementFunction.

    T

    the type of element

    predicate

    the predicate (must be non-null)

    returns

    the new RequireElementFunction instance

    Definition Classes
    RequireCore
  19. implicit def pred2func[T](predicate: RequirePredicate[T]): RequireFunction[T]

    Permalink

    Wraps predicate RequirePredicate to element function RequireFunction.

    Wraps predicate RequirePredicate to element function RequireFunction.

    T

    the type of element

    predicate

    the predicate (must be non-null)

    returns

    the new RequireFunction instance

    Definition Classes
    RequireCore
  20. def require[T](requirement: ⇒ Boolean, message: ⇒ T): Unit

    Permalink

    Invokes requirement to test an expression and calls fail if it returns false.

    Invokes requirement to test an expression and calls fail if it returns false.

    requirement

    the expression to test

    message

    a String to include in the failure message (must be non-null)

    Definition Classes
    RequireCore
    Exceptions thrown

    RuntimeException if requirement invokation returns false of any argument is not valid

  21. def requireSize[T](value: Iterable[T], size: Int, name: String = NoNameParameter): Unit

    Permalink

    Tests that size of iterable value equals size, and otherwise throws RequireCore.exception().

    Tests that size of iterable value equals size, and otherwise throws RequireCore.exception().

    T

    the type of iterable elements

    value

    the iterable value (must be non-null)

    size

    the expected size (must be positive)

    name

    the name to include in the failure message (must be non-null)

    Annotations
    @inline()
    Exceptions thrown

    RuntimeException if test fails

  22. def requireSizeFrom[T](value: Iterable[T], from: Int, name: String = NoNameParameter): Unit

    Permalink

    Tests that size of iterable value is from from inclusive until Int.MaxValue inclusive, and otherwise throws RequireCore.exception().

    Tests that size of iterable value is from from inclusive until Int.MaxValue inclusive, and otherwise throws RequireCore.exception().

    T

    the type of iterable elements

    value

    the iterable value (must be non-null)

    from

    the minimum size value (inclusive)

    name

    the name to include in the failure message (must be non-null)

    Annotations
    @inline()
    Exceptions thrown

    RuntimeException if test fails

  23. def requireSizeInRange[T](value: Iterable[T], from: Int, until: Int, name: String = NoNameParameter): Unit

    Permalink

    Tests that size of iterable value is from from inclusive until until exclusive, and otherwise throws RequireCore.exception().

    Tests that size of iterable value is from from inclusive until until exclusive, and otherwise throws RequireCore.exception().

    T

    the type of iterable elements

    value

    the iterable value (must be non-null)

    from

    the minimum size value (inclusive)

    until

    the maximum size value (exclusive)

    name

    the name to include in the failure message (must be non-null)

    Annotations
    @inline()
    Exceptions thrown

    RuntimeException if test fails

  24. def requireSizeUntil[T](value: Iterable[T], until: Int, name: String = NoNameParameter): Unit

    Permalink

    Tests that size of iterable value is from 0 inclusive until until exclusive, and otherwise throws RequireCore.exception().

    Tests that size of iterable value is from 0 inclusive until until exclusive, and otherwise throws RequireCore.exception().

    T

    the type of iterable elements

    value

    the iterable value (must be non-null)

    until

    the maximum size value (exclusive)

    name

    the name to include in the failure message (must be non-null)

    Annotations
    @inline()
    Exceptions thrown

    RuntimeException if test fails

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

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

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

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

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

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

Inherited from RequireCore

Inherited from AnyRef

Inherited from Any

Ungrouped