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

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

Introduction

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

Prototype

public static <T> Predicate<T> not(Predicate<T> predicate) 

Source Link

Document

Returns a predicate that evaluates to true if the given predicate evaluates to false .

Usage

From source file:com.ssm.config.SwaggerConfig.java

private Predicate<String> paths() {
    return Predicates.and(PathSelectors.regex("/.*"), Predicates.not(PathSelectors.regex("/error")));
}

From source file:org.trancecode.collection.TcMaps.java

public static <K, V> Map<K, V> copyAndPut(final Map<K, V> map, final K key, final V value) {
    Preconditions.checkNotNull(map);//w  w  w .ja  va2 s.co  m
    Preconditions.checkNotNull(key);
    if (map instanceof ImmutableMap && TcObjects.equals(map.get(key), value)) {
        return map;
    }

    final Builder<K, V> builder = ImmutableMap.builder();
    final Map<K, V> mapWithoutKey = Maps.filterKeys(map, Predicates.not(Predicates.equalTo(key)));
    return builder.putAll(mapWithoutKey).put(key, value).build();
}

From source file:org.trustedanalytics.kafka.adminapi.config.SwaggerConfig.java

@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2).select()
            .apis(Predicates.not(RequestHandlerSelectors.basePackage("org.springframework.boot")))
            .paths(PathSelectors.any()).build().apiInfo(apiInfo());
}

From source file:com.griddynamics.jagger.jaas.config.SwaggerConfig.java

/**
 * Docket object for swagger configuration.
 *
 * @return Docket object./*from   w  ww . j av a  2 s.co  m*/
 */
@Bean
public Docket docket() {
    return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select()
            .apis(RequestHandlerSelectors.any()).paths(Predicates.not(PathSelectors.regex("/error"))).build()
            .useDefaultResponseMessages(false).globalResponseMessage(RequestMethod.GET, responseMessages());
}

From source file:cz.jkuchar.easyminerscorer.SwaggerConfig.java

/**
 * Swagger configuration// w  w w.j ava  2  s .  c  om
 * @return Docket configuration object 
 */
@Bean
public Docket getApi() {
    return new Docket(DocumentationType.SWAGGER_2).useDefaultResponseMessages(false)
            .groupName("easyminer-scorer").apiInfo(apiInfo()).select()
            .paths(Predicates.not(PathSelectors.regex("/error.*"))).build();
}

From source file:org.opentestsystem.delivery.testreg.domain.ARTHelpers.java

protected static final List<ImplicitEligibilityRule> getImplicitEligibilityRules(
        final ImplicitEligibilityRule[] implicitEligibilityRuleArray,
        final ImplicitEligibilityRule.RuleType ruleType) {
    return Lists.newArrayList(Iterables.filter(Lists.newArrayList(implicitEligibilityRuleArray),
            ImplicitEligibilityRule.RuleType.ENABLER == ruleType ? IER_ENABLER : Predicates.not(IER_ENABLER)));
}

From source file:org.eclipse.viatra.query.patternlanguage.emf.util.internal.PatternParserResourceDescriptions.java

@Override
public Iterable<IResourceDescription> getAllResourceDescriptions() {
    return Iterables.filter(super.getAllResourceDescriptions(),
            Predicates.not(rd -> rd.getURI().toString().contains(PatternParser.SYNTHETIC_URI_PREFIX)));
}

From source file:org.trancecode.collection.TcSets.java

public static <T> ImmutableSet<T> immutableSetWithout(final Iterable<T> elements, final T element) {
    Preconditions.checkNotNull(elements);
    Preconditions.checkNotNull(element);

    if (elements instanceof Set && !((Set<?>) elements).contains(element)) {
        return ImmutableSet.copyOf(elements);
    }/*from   w  w w .ja  v a  2 s .c o m*/

    return ImmutableSet.copyOf(Iterables.filter(elements, Predicates.not(Predicates.equalTo(element))));
}

From source file:org.jclouds.abiquo.predicates.cloud.VolumePredicates.java

public static Predicate<Volume> lesserThanOrEquals(final long sizeInMb) {
    return Predicates.not(greaterThan(sizeInMb));
}

From source file:suneido.database.immudb.ForeignKeyTargets.java

ForeignKeyTargets without(ForeignKey source, ForeignKeyTarget target) {
    Set<ForeignKeyTarget> cur = targets.get(source);
    ImmutableSet<ForeignKeyTarget> wo = ImmutableSet
            .copyOf(Iterables.filter(cur, Predicates.not(Predicates.equalTo(target))));
    return new ForeignKeyTargets(targets.with(source, wo));
}