congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
StringStartsWith
Code IndexAdd Tabnine to your IDE (free)

How to use
StringStartsWith
in
org.hamcrest.text

Best Java code snippets using org.hamcrest.text.StringStartsWith (Showing top 6 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: org.hamcrest/com.springsource.org.hamcrest

@Factory
public static Matcher<String> startsWith(String substring) {
  return new StringStartsWith(substring);
}
origin: org.nakedobjects/metamodel

@Override
public boolean matchesSafely(final String actual) {
  return super.matchesSafely(StringUtils.stripNewLines(actual));
}
origin: org.nakedobjects.core/metamodel

@Override
public boolean matchesSafely(final String actual) {
  return super.matchesSafely(StringUtils.stripNewLines(actual));
}
origin: org.apache.isis.core/commons

@Override
public boolean matchesSafely(final String actual) {
  return super.matchesSafely(StringUtils.stripNewLines(actual));
}
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.textStringStartsWith

Javadoc

Tests if the argument is a string that contains a substring.

Most used methods

  • matchesSafely
  • startsWith
  • <init>

Popular in Java

  • Making http post requests using okhttp
  • runOnUiThread (Activity)
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • Kernel (java.awt.image)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • PhpStorm for WordPress
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