Tabnine Logo
PartialFunction.isDefinedAt
Code IndexAdd Tabnine to your IDE (free)

How to use
isDefinedAt
method
in
scala.PartialFunction

Best Java code snippets using scala.PartialFunction.isDefinedAt (Showing top 4 results out of 315)

origin: com.typesafe.play/play-test_2.10

public static Result routeAndCall(Class<? extends Router> router, RequestBuilder requestBuilder, long timeout) {
  try {
    Request request = requestBuilder.build();
    Router routes = (Router) router.getClassLoader().loadClass(router.getName() + "$").getDeclaredField("MODULE$").get(null);
    if(routes.routes().isDefinedAt(request._underlyingRequest())) {
      return invokeHandler(routes.routes().apply(request._underlyingRequest()), request, timeout);
    } else {
      return null;
    }
  } catch(RuntimeException e) {
    throw e;
  } catch(Throwable t) {
    throw new RuntimeException(t);
  }
}
origin: com.typesafe.play/play-test_2.10

public static Result routeAndCall(Router router, RequestBuilder requestBuilder, long timeout) {
  try {
    Request request = requestBuilder.build();
    if(router.routes().isDefinedAt(request._underlyingRequest())) {
      return invokeHandler(router.routes().apply(request._underlyingRequest()), request, timeout);
    } else {
      return null;
    }
  } catch(RuntimeException e) {
    throw e;
  } catch(Throwable t) {
    throw new RuntimeException(t);
  }
}
origin: play/play-test

/**
 * Use the Router to determine the Action to call for this request and executes it.
 * @deprecated
 * @see #route instead
 */
public static Result routeAndCall(Class<? extends play.core.Router.Routes> router, FakeRequest fakeRequest) {
  try {
    play.core.Router.Routes routes = (play.core.Router.Routes)router.getClassLoader().loadClass(router.getName() + "$").getDeclaredField("MODULE$").get(null);
    if(routes.routes().isDefinedAt(fakeRequest.getWrappedRequest())) {
      return invokeHandler(routes.routes().apply(fakeRequest.getWrappedRequest()), fakeRequest);
    } else {
      return null;
    }
  } catch(RuntimeException e) {
    throw e;
  } catch(Throwable t) {
    throw new RuntimeException(t);
  }
}
origin: eclipse/ditto

private Receive lockBehavior(final Receive receive) {
  checkNotNull(receive, "actor's message handler");
  return ReceiveBuilder.create()
      .matchEquals(Control.UNLOCK, unlock -> {
        locked = false;
        cancelLockTimeout();
        unstashAll();
      })
      .matchAny(message -> {
        final PartialFunction<Object, ?> handler = receive.onMessage();
        if (locked) {
          stash();
        } else if (handler.isDefinedAt(message)) {
          handler.apply(message);
        } else {
          unhandled(message);
        }
      })
      .build();
}
scalaPartialFunctionisDefinedAt

Popular methods of PartialFunction

  • apply
  • orElse
  • andThen

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getContentResolver (Context)
  • onRequestPermissionsResult (Fragment)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now