Tabnine Logo
Command.getName
Code IndexAdd Tabnine to your IDE (free)

How to use
getName
method
in
net.sergeych.farcall.Command

Best Java code snippets using net.sergeych.farcall.Command.getName (Showing top 8 results out of 315)

origin: UniversaBlockchain/universa

  @Override
  public Object onCommand(Command command) throws Exception {
    if (command.is("ping")) {
      return "pong";
    } else if (command.is("echoargs")) {
      HashMap<String, Object> res = new HashMap<>();
      res.put("simple", command.getParams());
      res.put("key", command.getKeyParams());
      return res;
    }
    throw new IllegalArgumentException("unknown command: " + command.getName());
  }
});
origin: UniversaBlockchain/universa

  /**
   * The handshake and transport command processing
   *
   * @param command
   *
   * @return
   *
   * @throws Exception
   */
  @Override
  public Object onCommand(Command command) throws Exception {
//        log.d(toString()+" cmd "+command.getName());
    switch (command.getName()) {
      case "hello":
        return onHello(Binder.from(command.getKeyParams()));
      case "block":
        return decryptBlock(command);
    }
    return null;
  }

origin: UniversaBlockchain/universa

if (command.getName().equals("fast")) {
  counts[0]++;
  Thread.sleep(1);
  return "fast done";
} else if (command.getName().equals("slow")) {
  Thread.sleep(3);
  counts[1]++;
origin: UniversaBlockchain/universa

if (command.getName().equals("fast")) {
  counts[0]++;
  return "fast done";
} else if (command.getName().equals("slow")) {
  Thread.sleep(3);
  counts[1]++;
origin: UniversaBlockchain/universa

Farcall f = new Farcall(bc);
f.start(cmd -> {
  switch (cmd.getName()) {
    case "ping":
      return "pong";
origin: UniversaBlockchain/universa

if (command.getName().equals("fast")) {
  counts[0]++;
  return "fast done";
} else if (command.getName().equals("slow")) {
  Thread.sleep(3);
  counts[1]++;
origin: UniversaBlockchain/universa

if (command.getName().equals("fast")) {
  counts[0]++;
  return "fast done";
} else if (command.getName().equals("slow")) {
  Thread.sleep(3);
  counts[1]++;
  return "slow done";
} else if (command.getName().equals("stop")) {
  sca.close();
  System.out.println("closed!");
origin: UniversaBlockchain/universa

a.asyncCommands();
a.start(command -> {
  switch (command.getName()) {
    case "wait":
      synchronized (lock) {
net.sergeych.farcallCommandgetName

Popular methods of Command

  • getKeyParams
  • <init>
  • getParam
  • getParams
  • is
    Check the command name

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Option (scala)
  • Top plugins for Android Studio
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