Class Behavior.BehaviorDecorators<T>

  • Enclosing class:
    Behavior<T>

    public static final class Behavior.BehaviorDecorators<T>
    extends scala.AnyVal
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Behavior<T> behavior()  
      boolean equals​(java.lang.Object x$1)  
      int hashCode()  
      <U> Behavior<U> widen​(scala.PartialFunction<U,​T> matcher)
      Widen the wrapped Behavior by placing a funnel in front of it: the supplied PartialFunction decides which message to pull in (those that it is defined at) and may transform the incoming message to place them into the wrapped Behavior&rsquo;s type hierarchy.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BehaviorDecorators

        public BehaviorDecorators​(Behavior<T> behavior)
    • Method Detail

      • widen

        public <U> Behavior<U> widen​(scala.PartialFunction<U,​T> matcher)
        Widen the wrapped Behavior by placing a funnel in front of it: the supplied PartialFunction decides which message to pull in (those that it is defined at) and may transform the incoming message to place them into the wrapped Behavior&rsquo;s type hierarchy. Signals are not transformed.

        Example:

        
         receive[String] { (ctx, msg) => println(msg); same }.widen[Number] {
           case b: BigDecimal => s"BigDecimal(&dollar;b)"
           case i: BigInteger => s"BigInteger(&dollar;i)"
           // all other kinds of Number will be `unhandled`
         }
         

        Scheduled messages via TimerScheduler can currently not be used together with widen, see issue #25318.

        Parameters:
        matcher - (undocumented)
        Returns:
        (undocumented)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object x$1)
        Overrides:
        equals in class java.lang.Object