Tabnine Logo
StringStartsWith.startsWith
Code IndexAdd Tabnine to your IDE (free)

How to use
startsWith
method
in
org.hamcrest.text.StringStartsWith

Best Java code snippets using org.hamcrest.text.StringStartsWith.startsWith (Showing top 2 results out of 315)

origin: org.hamcrest/com.springsource.org.hamcrest

public static org.hamcrest.Matcher<java.lang.String> startsWith(java.lang.String substring) {
 return org.hamcrest.text.StringStartsWith.startsWith(substring);
}
origin: nerdammer/spash

@Override
public int complete(String buffer, int cursor, List<CharSequence> candidates) {
  Preconditions.checkNotNull(candidates);
  String text = contextualBuffer(buffer, cursor);
  List<String> commands = Lambda.filter(StringStartsWith.startsWith(text), this.commands);
  if(commands.size()>0) {
    candidates.addAll(commands);
    if(candidates.size()==1) {
      candidates.set(0, candidates.get(0) + " ");
    }
    return candidates.isEmpty() ? -1 : 0;
  } else if(text.contains(" ")) {
    int insertion = text.lastIndexOf(" ") + 1;
    String tailBuffer = text.substring(insertion);
    List<String> files = Lambda.convert(Lambda.convert(SpashFileSystem.get().ls(this.session.getWorkingDir()).collect(), new PropertyExtractor<Object, Path>("fileName")), new DefaultStringConverter());
    files = Lambda.filter(StringStartsWith.startsWith(tailBuffer), files);
    candidates.addAll(files);
    if(candidates.size()==1) {
      candidates.set(0, candidates.get(0) + " ");
    }
    return candidates.isEmpty() ? -1 : insertion;
  }
  return -1;
}
org.hamcrest.textStringStartsWithstartsWith

Popular methods of StringStartsWith

  • matchesSafely
  • <init>

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Table (org.hibernate.mapping)
    A relational table
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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