final class UniversalOps[A] extends AnyVal

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. UniversalOps
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new UniversalOps(a: A)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. def applyIf[A0 >: A](predicate: (A) ⇒ Boolean)(f: (A) ⇒ A0): A0
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def checkNotNull(msg: String): A
  7. def debugMacro: A
  8. def discard: Unit

    Explicit syntax to discard the value of a side-effecting expression.

    Explicit syntax to discard the value of a side-effecting expression. Useful when -Ywarn-value-discard compiler option is enabled.

    Annotations
    @silent()
  9. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. def matchOpt[B](pf: PartialFunction[A, B]): commons.Opt[B]
  12. def opt: commons.Opt[A]
  13. def option: Option[A]
  14. def setup(code: (A) ⇒ Any): A

    Alternative syntax for applying some side effects on a value before returning it, without having to declare an intermediate variable.

    Alternative syntax for applying some side effects on a value before returning it, without having to declare an intermediate variable. Also, using setup confines the "setting-up" code in a separate code block which has more clarity and avoids polluting outer scope.

    Example:
    1. import javax.swing._
      // this entire expression returns the panel
      new JPanel().setup { p =>
        p.setEnabled(true)
        p.setSize(100, 100)
      }
  15. macro def showAst: A

    Prints AST of the prefix in a compilation error.

    Prints AST of the prefix in a compilation error. Useful for debugging macros.

  16. macro def showRawAst: A

    Prints raw AST of the prefix in a compilation error.

    Prints raw AST of the prefix in a compilation error. Useful for debugging macros.

  17. macro def showRawType: A
  18. macro def showSymbol: A
  19. macro def showSymbolFullName: A
  20. macro def showType: A
  21. macro def showTypeSymbol: A
  22. macro def showTypeSymbolFullName: A
  23. macro def sourceCode: String

    Returns source code of the prefix expression as string, exactly as in the source file.

    Returns source code of the prefix expression as string, exactly as in the source file. Strips common indentation. Requires -Yrangepos enabled.

  24. def thenReturn[T](value: T): T
  25. def toString(): String
    Definition Classes
    Any
  26. def unboxedOpt[B](implicit unboxing: Unboxing[B, A]): commons.Opt[B]

    Converts a boxed primitive type into an Opt of its corresponding primitive type, converting null into Opt.Empty.

    Converts a boxed primitive type into an Opt of its corresponding primitive type, converting null into Opt.Empty. For example, calling .unboxedOpt on a java.lang.Integer will convert it to Opt[Int].

  27. def uncheckedMatch[B](pf: PartialFunction[A, B]): B

    To be used instead of normal match keyword in pattern matching in order to suppress non-exhaustive match checking.

    To be used instead of normal match keyword in pattern matching in order to suppress non-exhaustive match checking.

    Example:
    1. Option(42) uncheckedMatch {
        case Some(int) => println(int)
      }
  28. macro def withSourceCode: (A, String)
  29. def |>[B](f: (A) ⇒ B): B

    The "pipe" operator.

    The "pipe" operator. Alternative syntax to apply a function on an argument. Useful for fluent expressions and avoiding intermediate variables.

    Example:
    1. someVeryLongExpression() |> (v => if(condition(v)) something(v) else somethingElse(v))

Inherited from AnyVal

Inherited from Any

Ungrouped