Example usage for com.google.common.base Predicates and

List of usage examples for com.google.common.base Predicates and

Introduction

In this page you can find the example usage for com.google.common.base Predicates and.

Prototype

public static <T> Predicate<T> and(Predicate<? super T>... components) 

Source Link

Document

Returns a predicate that evaluates to true if each of its components evaluates to true .

Usage

From source file:org.jon.ivmark.graphit.core.properties.filter.AndFilter.java

public AndFilter(List<Map<String, Object>> conditions) {
    super(conditions);
    this.filter = Predicates.and(filters);
}

From source file:org.metaeffekt.dcc.controller.commands.ProvisionRestrictionPredicateFactory.java

public static Predicate<ConfigurationUnit> createPredicate(List<ProvisionRestriction> restrictions,
        ConfigurationUnit commandUnit, ExecutionContext executionContext) {
    final List<Predicate<ConfigurationUnit>> predicates = new ArrayList<>();
    predicates.add(createNotTheSamePredicate(commandUnit));

    if (!CollectionUtils.isEmpty(restrictions)) {
        for (ProvisionRestriction restriction : restrictions) {
            predicates.add(createPredicate(restriction, commandUnit, executionContext));
        }/*from   w w  w  . j a va2 s. c om*/
    }

    return Predicates.and(predicates);
}

From source file:com.google.devtools.moe.client.Utils.java

/** @return a Predicate that's true iff a CharSequence doesn't match any of the given regexes */
public static Predicate<CharSequence> nonMatchingPredicateFromRes(List<String> excludeRes) {
    ImmutableList.Builder<Predicate<CharSequence>> rePredicateBuilder = ImmutableList.builder();
    for (String excludeRe : excludeRes) {
        rePredicateBuilder.add(Predicates.not(Predicates.containsPattern(excludeRe)));
    }/*w  w  w  . j  a  v a  2s . c o m*/
    return Predicates.and(rePredicateBuilder.build());
}

From source file:org.lightadmin.core.config.domain.field.FieldMetadataUtils.java

public static Set<FieldMetadata> selectFields(Set<FieldMetadata> fieldMetadatas,
        Predicate<FieldMetadata>... predicates) {
    return newLinkedHashSet(Collections2.filter(fieldMetadatas, Predicates.and(predicates)));
}

From source file:org.apache.curator.x.discovery.details.FilteredInstanceProvider.java

FilteredInstanceProvider(InstanceProvider<T> instanceProvider, List<InstanceFilter<T>> filters) {
    this.instanceProvider = instanceProvider;
    predicates = Predicates.and(filters);
}

From source file:org.jon.ivmark.graphit.core.properties.filter.PropertiesFilterBuilder.java

public Predicate<Properties> build() {
    return Predicates.and(filters);
}

From source file:brooklyn.location.jclouds.pool.MachinePoolPredicates.java

public static Predicate<NodeMetadata> compose(final Predicate<NodeMetadata>... predicates) {
    return Predicates.and(predicates);
}

From source file:org.jon.ivmark.graphit.core.properties.filter.PropertiesFilter.java

public PropertiesFilter(List<PropertyFilterSettings> filterSettings) {
    if (filterSettings == null) {
        this.composite = Predicates.alwaysTrue();
        return;/*  w  w w.  ja va2  s.  co  m*/
    }
    List<PropertyFilter> filters = new ArrayList<PropertyFilter>();
    for (PropertyFilterSettings propertyFilterSettings : filterSettings) {
        String key = propertyFilterSettings.getKey();
        for (FilterCondition fc : propertyFilterSettings.getConditions()) {
            Predicate<Object> filter = fc.filter();
            filters.add(new PropertyFilter(key, filter));
        }

    }
    this.composite = Predicates.and(filters);
}

From source file:de.javakaffee.sandbox.getfj.ListDemoGuava.java

public List<Person> getMenOfFullAgeAsList() {
    return new ArrayList<Person>(filter(persons, Predicates.and(Arrays.asList(ofFullAge, male))));
    // return new ArrayList<Person>(filter(filter(persons, ofFullAge), male));
}

From source file:org.blockartistry.DynSurround.entity.ai.EntityAIVillagerFleeChat.java

protected boolean villagerThreatened() {
    final AxisAlignedBB bbox = this.theEntity.getEntityBoundingBox().expand((double) 8.0, 3.0D, (double) 8.0);
    return !this.theEntity.world
            .<EntityZombie>getEntitiesWithinAABB(EntityZombie.class, bbox, Predicates.and(this.preds))
            .isEmpty();/*w ww  .j a  v  a2 s  .c o  m*/
}