Is there any way to avoid the verbosity?, I try with a more functional
approach which was OK for IntelliJ but not for the Java 8 compiler, here is
the form that is working:
private void applyToAccount(Currency currency, BalanceOperation operation)
{
context().child(currency.code).
getOrElse(new AbstractFunction0<Option<ActorRef>>() {
@Override
public Option<ActorRef> apply() {
return Option.some(context().actorOf(balancePersistorProps(
currency), currency.code));
}
}).
get().forward(operation, context);
}
But I was hoping the following would work, but Java 8 can't infer the type,
strange IntelliJ recognizes it I guess the mix of Java and Scala drives it
crazy:
private void applyToAccount(Currency currency, BalanceOperation operation) {
context().child(currency.code).
getOrElse(() -> Option.some(context().actorOf(balancePersistorProps(
currency), currency.code))).
get().forward(operation, context);
}
Best regards.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.