final class optional extends Annotation with SymbolArity

When applied on raw method, it works almost the same way as single except that it is not required that matching real method exists in real RPC trait. If there is no matching real method, macro-materialized AsRaw implementation will implement the raw method with a code that throws an exception.

When applied on raw parameter, specifies that this raw parameter may be matched by a real parameter but this is not required. Whether a real parameter matches an optional raw parameter is determined by its type and/or tag (see paramTag for more information on param tagging).

Raw parameters marked as optional must be typed as Option[T] (or Opt[T], OptArg[T] or whatever type that has an instance of OptionLike). By default, optional raw parameters are verbatim which means that the option-wrapped type T must match exactly the type of real parameter.

In the macro generated code that translates a raw call into a real call, when the raw parameter value is absent (the Option[T] is empty) then real parameter's default value will be used as fallback. This allows introducing new parameters into RPC interfaces without breaking backwards compatibility.

optional may also be used on method metadata parameters or parameter metadata parameters. It works the same way as with single except that metadata class must be wrapped in an OptionLike type (Option, Opt, etc.).

Finally, optional may also be used for metadata parameters that hold reified annotations (see reifyAnnot). In that case it is not required that the annotation being reified is actually present on the real trait/method/param. For that to work, metadata param must be typed as Option[A], Opt[A], etc. where A is the type of annotation being reified.

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. optional
  2. SymbolArity
  3. RawParamAnnotation
  4. RawSymAnnotation
  5. StaticAnnotation
  6. Annotation
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new optional()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from SymbolArity

Inherited from RawParamAnnotation

Inherited from RawSymAnnotation

Inherited from StaticAnnotation

Inherited from Annotation

Inherited from AnyRef

Inherited from Any

Ungrouped