Tabnine Logo
String.equals
Code IndexAdd Tabnine to your IDE (free)

How to use
equals
method
in
java.lang.String

Best Java code snippets using java.lang.String.equals (Showing top 20 results out of 426,510)

origin: stackoverflow.com

 private boolean isMyServiceRunning(Class<?> serviceClass) {
  ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
  for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
    if (serviceClass.getName().equals(service.service.getClassName())) {
      return true;
    }
  }
  return false;
}
origin: stackoverflow.com

 protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  try {
    Action action = ActionFactory.getAction(request);
    String view = action.execute(request, response);

    if (view.equals(request.getPathInfo().substring(1)) {
      request.getRequestDispatcher("/WEB-INF/" + view + ".jsp").forward(request, response);
    } else {
      response.sendRedirect(view);
    }
  } catch (Exception e) {
    throw new ServletException("Executing action failed.", e);
  }
}
origin: ReactiveX/RxJava

  @Override
  public boolean test(String value) {
    return "d".equals(value);
  }
};
origin: ReactiveX/RxJava

  @Override
  public boolean test(String t1) {
    return t1.equals("two");
  }
});
origin: ReactiveX/RxJava

  @Override
  public boolean test(String t1) {
    return t1.equals("two");
  }
});
origin: ReactiveX/RxJava

  @Override
  public String apply(String s) {
    if (s.equals("x")) {
      return "xx";
    }
    return s.toUpperCase();
  }
};
origin: ReactiveX/RxJava

  @Override
  public String apply(String t1) {
    if ("b".equals(t1)) {
      throw new RuntimeException("Forced failure");
    }
    return t1 + t1;
  }
};
origin: ReactiveX/RxJava

  @Override
  public String apply(String s) {
    if (s.equals("x")) {
      return "xx";
    }
    return s.toUpperCase();
  }
};
origin: ReactiveX/RxJava

  @Override
  public String apply(String t1) {
    if ("bb".equals(t1)) {
      throw new RuntimeException("Forced failure");
    }
    return t1 + t1;
  }
};
origin: ReactiveX/RxJava

  @Override
  public String apply(String t1) {
    if ("bb".equals(t1)) {
      throw new RuntimeException("Forced failure");
    }
    return t1 + t1;
  }
};
origin: ReactiveX/RxJava

  @Override
  public void accept(String s) {
    if ("fail".equals(s)) {
      throw new RuntimeException("Forced Failure");
    }
  }
});
origin: ReactiveX/RxJava

  @Override
  public String apply(String s) {
    if ("fail".equals(s)) {
      throw new RuntimeException("Forced Failure");
    }
    System.out.println("BadMapper:" + s);
    return s;
  }
});
origin: ReactiveX/RxJava

  @Override
  public String apply(String s) {
    if ("fail".equals(s)) {
      throw new RuntimeException("Forced Failure");
    }
    System.out.println("BadMapper:" + s);
    return s;
  }
});
origin: ReactiveX/RxJava

  @Override
  public Integer apply(String t1) {
    if ("b".equals(t1)) {
      throw new RuntimeException("Forced Failure");
    }
    return t1.length();
  }
};
origin: ReactiveX/RxJava

  @Override
  public String apply(String s) {
    if ("fail".equals(s)) {
      throw new RuntimeException("Forced Failure");
    }
    System.out.println("BadMapper:" + s);
    return s;
  }
});
origin: ReactiveX/RxJava

  @Override
  public Integer apply(String t1) {
    if ("bb".equals(t1)) {
      throw new RuntimeException("Forced Failure");
    }
    return t1.length();
  }
};
origin: ReactiveX/RxJava

  @Override
  public Integer apply(String t1) {
    if ("bb".equals(t1)) {
      throw new RuntimeException("Forced Failure");
    }
    return t1.length();
  }
};
origin: ReactiveX/RxJava

  @Override
  public Integer apply(String t1) {
    if ("b".equals(t1)) {
      throw new RuntimeException("Forced Failure");
    }
    return t1.length();
  }
};
origin: stackoverflow.com

 protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  // ...
  List<Part> fileParts = request.getParts().stream().filter(part -> "file".equals(part.getName())).collect(Collectors.toList()); // Retrieves <input type="file" name="file" multiple="true">

  for (Part filePart : fileParts) {
    String fileName = Paths.get(filePart.getSubmittedFileName()).getFileName().toString(); // MSIE fix.
    InputStream fileContent = filePart.getInputStream();
    // ... (do your job here)
  }
}
origin: ReactiveX/RxJava

  @Override
  public String apply(Integer t) {
    assertTrue(Thread.currentThread().getName().equals(currentThreadName));
    return "Value_" + t + "_Thread_" + Thread.currentThread().getName();
  }
});
java.langStringequals

Javadoc

Compares this string to the specified object. The result is true if and only if the argument is not null and is a String object that represents the same sequence of characters as this object.

Popular methods of String

  • length
    Returns the number of characters in this string.
  • substring
    Returns a string containing a subsequence of characters from this string. The returned string shares
  • startsWith
    Compares the specified string to this string, starting at the specified offset, to determine if the
  • format
    Returns a formatted string, using the supplied format and arguments, localized to the given locale.
  • split
    Splits this string using the supplied regularExpression. See Pattern#split(CharSequence,int) for an
  • trim
  • valueOf
    Creates a new string containing the specified characters in the character array. Modifying the chara
  • indexOf
  • endsWith
    Compares the specified string to this string to determine if the specified string is a suffix.
  • toLowerCase
    Converts this string to lower case, using the rules of locale.Most case mappings are unaffected by t
  • contains
    Determines if this String contains the sequence of characters in the CharSequence passed.
  • getBytes
  • contains,
  • getBytes,
  • <init>,
  • equalsIgnoreCase,
  • replace,
  • isEmpty,
  • charAt,
  • hashCode,
  • lastIndexOf

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getResourceAsStream (ClassLoader)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • CodeWhisperer alternatives
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