akka.util.Helpers

Requiring

implicit final class Requiring[A] extends AnyVal

Implicit class providing requiring methods. This class is based on Predef.ensuring in the Scala standard library. The difference is that this class's methods throw IllegalArgumentExceptions rather than AssertionErrors.

An example adapted from Predef's documentation:

import akka.util.Helpers.Requiring

def addNaturals(nats: List[Int]): Int = {
  require(nats forall (_ >= 0), "List contains negative numbers")
  nats.foldLeft(0)(_ + _)
} requiring(_ >= 0)
Annotations
@inline()
Linear Supertypes
AnyVal, NotNull, Any
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Requiring
  2. AnyVal
  3. NotNull
  4. Any
Implicitly
  1. by Requiring
  2. by any2stringadd
  3. by any2stringfmt
  4. by any2ArrowAssoc
  5. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Requiring(value: A)

    value

    The value to check.

Value Members

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

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

    Definition Classes
    Any
  3. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  4. def ->[B](y: B): (Requiring[A], B)

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to ArrowAssoc[Requiring[A]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

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

    Definition Classes
    Any
  7. def ensuring(cond: (Requiring[A]) ⇒ Boolean, msg: ⇒ Any): Requiring[A]

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to Ensuring[Requiring[A]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  8. def ensuring(cond: (Requiring[A]) ⇒ Boolean): Requiring[A]

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to Ensuring[Requiring[A]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: Boolean, msg: ⇒ Any): Requiring[A]

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to Ensuring[Requiring[A]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean): Requiring[A]

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to Ensuring[Requiring[A]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  12. def getClass(): Class[_ <: AnyVal]

    Definition Classes
    AnyVal → Any
  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. def requiring(cond: (A) ⇒ Boolean, msg: ⇒ Any): A

    Check that a condition is true for the value.

    Check that a condition is true for the value. If true, return value, otherwise throw an IllegalArgumentException with the given message.

    cond

    The function used to check the value.

    msg

    The message to report if the condition isn't met.

    Annotations
    @inline()
  15. def requiring(cond: Boolean, msg: ⇒ Any): A

    Check that a condition is true.

    Check that a condition is true. If true, return value, otherwise throw an IllegalArgumentException with the given message.

    cond

    The condition to check.

    msg

    The message to report if the condition isn't met.

    Annotations
    @inline()
  16. def toString(): String

    Definition Classes
    Any
  17. val value: A

    The value to check.

  18. def [B](y: B): (Requiring[A], B)

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to ArrowAssoc[Requiring[A]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. def requiring(cond: (Requiring[A]) ⇒ Boolean, msg: ⇒ Any): Requiring[A]

    Check that a condition is true for the value.

    Check that a condition is true for the value. If true, return value, otherwise throw an IllegalArgumentException with the given message.

    cond

    The function used to check the value.

    msg

    The message to report if the condition isn't met.

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to Requiring[Requiring[A]] performed by method Requiring in akka.util.Helpers.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (requiring: Requiring[Requiring[A]]).requiring(cond, msg)
    Annotations
    @inline()
  2. def requiring(cond: Boolean, msg: ⇒ Any): Requiring[A]

    Check that a condition is true.

    Check that a condition is true. If true, return value, otherwise throw an IllegalArgumentException with the given message.

    cond

    The condition to check.

    msg

    The message to report if the condition isn't met.

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to Requiring[Requiring[A]] performed by method Requiring in akka.util.Helpers.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (requiring: Requiring[Requiring[A]]).requiring(cond, msg)
    Annotations
    @inline()
  3. val self: Any

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (requiring: StringAdd).self
    Definition Classes
    StringAdd
  4. val self: Any

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (requiring: StringFormat).self
    Definition Classes
    StringFormat
  5. val value: Requiring[A]

    The value to check.

    The value to check.

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to Requiring[Requiring[A]] performed by method Requiring in akka.util.Helpers.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (requiring: Requiring[Requiring[A]]).value

Deprecated Value Members

  1. def x: Requiring[A]

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to ArrowAssoc[Requiring[A]] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (requiring: ArrowAssoc[Requiring[A]]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: Requiring[A]

    Implicit information
    This member is added by an implicit conversion from Requiring[A] to Ensuring[Requiring[A]] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (requiring: Ensuring[Requiring[A]]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from AnyVal

Inherited from NotNull

Inherited from Any

Inherited by implicit conversion Requiring from Requiring[A] to Requiring[Requiring[A]]

Inherited by implicit conversion any2stringadd from Requiring[A] to StringAdd

Inherited by implicit conversion any2stringfmt from Requiring[A] to StringFormat

Inherited by implicit conversion any2ArrowAssoc from Requiring[A] to ArrowAssoc[Requiring[A]]

Inherited by implicit conversion any2Ensuring from Requiring[A] to Ensuring[Requiring[A]]

Ungrouped