List of usage examples for com.google.common.base Predicates notNull
@GwtCompatible(serializable = true) public static <T> Predicate<T> notNull()
From source file:org.androidtransfuse.model.r.RResourceComposite.java
public RResourceComposite(RResource... resources) { this.resources = FluentIterable.from(Arrays.asList(resources)).filter(Predicates.notNull()).toList(); }
From source file:com.tinspx.util.collect.NotNull.java
/** * Wraps {@code collection} as a {@code Collection} that doe not allow * {@code null} elements to be added./*from w w w . j a v a 2s . co m*/ * * @throws NullPointerException if any existing element in * {@code collection} is {@code null} */ public static <E> Collection<E> collection(Collection<E> collection) { CollectUtils.checkAllNotNull(collection); return Predicated.collection(collection, Predicates.notNull()); }
From source file:org.apache.druid.query.filter.DimFilters.java
public static List<DimFilter> filterNulls(List<DimFilter> optimized) { return Lists.newArrayList(Iterables.filter(optimized, Predicates.notNull())); }
From source file:de.cosmocode.commons.concurrent.ChainedRunnable.java
public ChainedRunnable(Iterable<Runnable> runnables) { this.runnables = Preconditions.checkNotNull(runnables, "Runnables"); Preconditions.checkArgument(Iterables.all(runnables, Predicates.notNull()), "Found null in %s", runnables); }
From source file:ec.nbdemetra.ui.tssave.TsSaveAction.java
private static List<ITsSavable> getAll(Node[] activatedNodes) { return Nodes.asIterable(activatedNodes).transform(Jdk6Functions.lookupNode(ITsSavable.class)) .filter(Predicates.notNull()).toList(); }
From source file:ec.nbdemetra.ui.interchange.ExportAction.java
private static List<Exportable> getExportables(Node[] activatedNodes) { return Nodes.asIterable(activatedNodes).transform(Jdk6Functions.lookupNode(Exportable.class)) .filter(Predicates.notNull()).toList(); }
From source file:com.eviware.loadui.impl.layout.LayoutComponentImpl.java
public LayoutComponentImpl(Map<String, ?> args) { properties = ImmutableMap.copyOf(Maps.filterKeys(args, Predicates.notNull())); }
From source file:org.apache.druid.query.QueryRunnerHelper.java
public static <T> Sequence<Result<T>> makeCursorBasedQuery(final StorageAdapter adapter, List<Interval> queryIntervals, Filter filter, VirtualColumns virtualColumns, boolean descending, Granularity granularity, final Function<Cursor, Result<T>> mapFn) { Preconditions.checkArgument(queryIntervals.size() == 1, "Can only handle a single interval, got[%s]", queryIntervals);/*from w w w . java 2 s. c o m*/ return Sequences.filter(Sequences.map( adapter.makeCursors(filter, queryIntervals.get(0), virtualColumns, granularity, descending, null), new Function<Cursor, Result<T>>() { @Override public Result<T> apply(Cursor input) { return mapFn.apply(input); } }), Predicates.notNull()); }
From source file:org.robotframework.ide.eclipse.main.plugin.tableeditor.settings.GeneralSettingsModel.java
public static List<RobotElement> findGeneralSettingsList(final RobotSettingsSection section) { if (section == null) { return newArrayList(); }/*from w w w . ja v a 2 s .com*/ return newArrayList( Iterables.filter(newArrayList(fillSettingsMapping(section).values()), Predicates.notNull())); }
From source file:io.druid.timeline.UnionTimeLineLookup.java
public UnionTimeLineLookup(Iterable<TimelineLookup<VersionType, ObjectType>> delegates) { // delegate can be null in case there is no segment loaded for the dataSource on this node this.delegates = Iterables.filter(delegates, Predicates.notNull()); }