Tabnine Logo
PropertyExtractor.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
ch.lambdaj.function.convert.PropertyExtractor
constructor

Best Java code snippets using ch.lambdaj.function.convert.PropertyExtractor.<init> (Showing top 2 results out of 315)

origin: mariofusco/lambdaj

/**
 * Converts all the object in the iterable extracting the named property.
 * Actually it handles also Maps, Arrays and Iterator by collecting their values.
 * Note that this method accepts an Object in order to be used in conjunction with the {@link Lambda#forEach(Iterable)}.
 * @param iterable The iterable containing the objects to be converted
 * @param propertyName The name of the item's property on which the item must have no duplicated value
 * @return A list containing the property's value extracted from the object in the given iterable
 */
public static <F, T> List<T> extractProperty(Object iterable, String propertyName) {
  return convert(iterable, new PropertyExtractor<F, T>(propertyName));
}

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;
}
ch.lambdaj.function.convertPropertyExtractor<init>

Javadoc

Creates a PropertyExtractor

Popular methods of PropertyExtractor

  • convert

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getContentResolver (Context)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Option (scala)
  • 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