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:dk.dma.nogoservice.Application.java

@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any())
            .paths(Predicates.not(PathSelectors.regex("/error"))).build();
}

From source file:org.eclipse.sirius.diagram.sequence.ui.tool.internal.edit.validator.DefaultMessageCreationValidator.java

private boolean checkTargetLifelineNotExplicitlyDestroyedAtLowerTime() {
    boolean valid = true;

    SequenceDiagram sequenceDiagram = sequenceElementSource.getDiagram();
    SequenceDiagramQuery sequenceDiagramQuery = new SequenceDiagramQuery(sequenceDiagram);

    for (ISequenceEvent sequenceEvent : Iterables.filter(
            sequenceDiagramQuery.getAllSequenceEventsLowerThan(firstClickLocation.y),
            Predicates.not(Predicates.instanceOf(Lifeline.class)))) {
        if (isDestroyMessageFor(sequenceEvent, sequenceElementTarget.getLifeline().get().getInstanceRole())) {
            valid = false;//from  www.  ja  v a  2 s .  c  o m
            break;
        }
    }
    return valid;
}

From source file:com.google.gerrit.server.account.CapabilityControl.java

/** @return true if the user can email reviewers. */
public boolean canEmailReviewers() {
    if (canEmailReviewers == null) {
        canEmailReviewers = matchAny(capabilities.emailReviewers, ALLOWED_RULE)
                || !matchAny(capabilities.emailReviewers, Predicates.not(ALLOWED_RULE));

    }//from   w  ww. java2 s  .  c o  m
    return canEmailReviewers;
}

From source file:org.jclouds.packet.compute.functions.DeviceToNodeMetadata.java

private Iterable<String> getPrivateIpAddresses(List<IpAddress> input) {
    return filterAndTransformIpAddresses(input, Predicates.not(new IsPublicIpAddress()));
}

From source file:org.nickelproject.util.testUtil.ClasspathUtil.java

/**
 * Gets all of the resources on the class path.
 *
 * @return An iterable of the names of all resources on the classpath
 */// w  w w  . j  a  v a2  s  .c o m
public static Iterable<String> getResourcesOnClassPath() {
    if (kAllResources == null) {
        kAllResources = Iterables.concat(
                // Get all the resources from files
                Iterables.concat(Iterables.transform(
                        Iterables.filter(getClassPath(), Predicates.not(getHasExtension("jar"))),
                        new GetFileFunction())),
                // Get all the resources from JARs
                Iterables.concat(Iterables.transform(Iterables.filter(getClassPath(), getHasExtension("jar")),
                        new GetJarEntries())));
    }
    return kAllResources;
}

From source file:org.gradle.model.internal.manage.schema.extract.CandidateMethods.java

/**
 * @param methodName Method name//from   w  ww  . j  av  a 2 s.  c  om
 * @param excludes Signature equivalences to exclude from the returned index
 * @return Overloaded candidate methods named {@literal methodName} indexed by signature equivalence except thoses
 * matching any of the signature equivalence provided in {@literal excludes} or {@literal null} if none
 */
public Map<Equivalence.Wrapper<Method>, Collection<Method>> overloadedMethodsNamed(String methodName,
        Collection<Equivalence.Wrapper<Method>> excludes) {
    return Maps.filterKeys(overloadedMethodsNamed(methodName), Predicates.not(Predicates.in(excludes)));
}

From source file:org.jclouds.vagrant.internal.MachineConfig.java

public void save(Map<String, Object> config) {
    File parent = configPath.getParentFile();
    if (!parent.exists() && !parent.mkdirs()) {
        if (!parent.exists()) {
            throw new IllegalStateException("Failure creating folder " + parent.getAbsolutePath());
        }/*from w ww  . ja va2 s  .c o  m*/
    }

    Map<String, Object> configWithoutVersion = Maps.filterKeys(config,
            Predicates.not(Predicates.equalTo(VagrantConstants.CONFIG_JCLOUDS_VERSION)));
    String version = VagrantConstants.CONFIG_JCLOUDS_VERSION + ": " + JcloudsVersion.get().toString() + "\n";
    String output = version + Joiner.on("\n").withKeyValueSeparator(": ").join(configWithoutVersion);

    FileOutputStream fileOut = null;
    BufferedWriter out = null;

    try {
        fileOut = new FileOutputStream(configPath);
        out = new BufferedWriter(new OutputStreamWriter(fileOut, Charsets.UTF_8));
        out.write(output);
    } catch (IOException e) {
        throw new IllegalStateException("Failed writing to machine config file " + configPath.getAbsolutePath(),
                e);
    } finally {
        if (out != null) {
            Closeables2.closeQuietly(out);
        } else if (fileOut != null) {
            Closeables2.closeQuietly(fileOut);
        }
    }
}

From source file:com.eucalyptus.cloudformation.config.CloudFormationServiceBuilder.java

@SuppressWarnings("unchecked")
private boolean noOtherEnabled(final ServiceConfiguration config) {
    return Iterables.isEmpty(ServiceConfigurations.filter(CloudFormation.class,
            Predicates.and(ServiceConfigurations.filterHostLocal(), ServiceConfigurations.filterEnabled(),
                    Predicates.not(Predicates.equalTo(config)))));
}

From source file:app.App.java

@Bean
public Docket newsApi() {
    return new Docket(DocumentationType.SWAGGER_2).groupName("test").apiInfo(apiInfo()).select()
            .apis(RequestHandlerSelectors.any()) //
            .paths(Predicates.not(PathSelectors.regex("/error.*"))).build();
}

From source file:org.mustbe.consulo.roots.ContentFolderScopes.java

@NotNull
public static Predicate<ContentFolderTypeProvider> all(final boolean withExclude) {
    return cacheScope(withExclude ? ALL : ALL_WITHOUT_EXCLUDE,
            new NotNullFactory<Predicate<ContentFolderTypeProvider>>() {
                @NotNull/*from w  w w  . java  2s.  c  o m*/
                @Override
                public Predicate<ContentFolderTypeProvider> create() {
                    return withExclude ? Predicates.<ContentFolderTypeProvider>alwaysTrue()
                            : Predicates.not(Predicates.<ContentFolderTypeProvider>equalTo(
                                    ExcludedContentFolderTypeProvider.getInstance()));
                }
            });
}