Class

com.avsystem.commons.SharedExtensions

UniversalOps

Related Doc: package SharedExtensions

Permalink

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)

    Permalink

Value Members

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

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

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

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

    Permalink
    Definition Classes
    Any
  5. def checkNotNull(msg: String): A

    Permalink
  6. def discard: Unit

    Permalink

    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()
  7. def getClass(): Class[_ <: AnyVal]

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

    Permalink
    Definition Classes
    Any
  9. def matchOpt[B](pf: PartialFunction[A, B]): commons.Opt[B]

    Permalink
  10. def opt: commons.Opt[A]

    Permalink
  11. def option: Option[A]

    Permalink
  12. def setup(code: (A) ⇒ Any): A

    Permalink

    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)
      }
  13. macro def showAst: A

    Permalink

    Prints AST of the prefix in a compilation error.

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

  14. macro def showRawAst: A

    Permalink

    Prints raw AST of the prefix in a compilation error.

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

  15. macro def showRawType: A

    Permalink
  16. macro def showSymbol: A

    Permalink
  17. macro def showSymbolFullName: A

    Permalink
  18. macro def showType: A

    Permalink
  19. macro def showTypeSymbol: A

    Permalink
  20. macro def showTypeSymbolFullName: A

    Permalink
  21. def toString(): String

    Permalink
    Definition Classes
    Any
  22. def unboxedOpt[B](implicit unboxing: Unboxing[B, A]): commons.Opt[B]

    Permalink

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

  23. def |>[B](f: (A) ⇒ B): B

    Permalink

    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