List of usage examples for com.google.common.base Predicates not
public static <T> Predicate<T> not(Predicate<T> predicate)
From source file:org.c4sg.config.SwaggerConfig.java
@Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2).useDefaultResponseMessages(false).apiInfo(apiInfo()).select() .apis(RequestHandlerSelectors.any()).paths(Predicates.not(PathSelectors.regex("/error.*"))).build(); }
From source file:com.threerings.tools.gxlate.spreadsheet.Folder.java
/** * Queries the contents of the given google doc folder and returns a new folder instance. */// w w w. j a va 2s .c o m public static Folder open(String appName, String user, String password, String folderId) throws AuthenticationException, ServiceException, IOException { DocsService docs = new DocsService(appName); docs.setUserCredentials(user, password); DocumentListFeed documentListFeed = docs.getFeed( new URL("https://docs.google.com/feeds/default/private/full/folder%3A" + folderId + "/contents"), DocumentListFeed.class); Iterable<DocumentListEntry> contents = documentListFeed.getEntries(); SpreadsheetService spreadsheets = new SpreadsheetService(appName); spreadsheets.setUserCredentials(user, password); return new Folder(Iterables.filter(contents, Predicates.not(DELETED)), spreadsheets); }
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))); }//from w ww .jav a 2 s . c om return Predicates.and(rePredicateBuilder.build()); }
From source file:org.jclouds.logging.LoggingModules.java
/** * the first available {@link LoggingModule}s from * {@link java.util.ServiceLoader} or {@link JDKLoggingModule} *///ww w .ja v a 2s .c o m public static LoggingModule firstOrJDKLoggingModule() { try { return find(ServiceLoader.load(LoggingModule.class), Predicates.not(Predicates.instanceOf(JDKLoggingModule.class))); } catch (NoSuchElementException e) { return new JDKLoggingModule(); } }
From source file:ecoo.ws.security.config.SwaggerConfig.java
@SuppressWarnings("Guava") @Bean// w w w . jav a2 s . c o m public Docket api() { return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any()) .paths(Predicates.not(PathSelectors.regex("/error"))).build().apiInfo(apiInfo()); }
From source file:org.richfaces.cdk.util.MorePredicates.java
public static <S, D> Predicate<D> none(Iterable<S> options, Function<S, Predicate<D>> function) { if (options == null || Iterables.isEmpty(options)) { return Predicates.alwaysTrue(); }//from w w w . j a v a 2 s . c o m Predicate<D> compositePredicate = Predicates.or(Iterables.transform(options, function)); return Predicates.not(compositePredicate); }
From source file:de.cosmocode.palava.util.qa.DescriptionFilterModule.java
@Override protected void configure() { filter(Predicates.not(Commands.annotatedWith(Description.class))).through(DescriptionFilter.class); }
From source file:eu.numberfour.n4js.n4mf.utils.ProjectTypePredicate.java
/** * Sugar for negating the predicate with type-safety. * * @param predicate//w w w . j a v a2s . c om * the predicate to negate. * @return the negated predicate. */ public static ProjectTypePredicate not(ProjectTypePredicate predicate) { return new ProjectTypePredicate(Predicates.not(predicate)); }
From source file:topic7.SwaggerConfig.java
@Bean public Docket newsApi() { return new Docket(DocumentationType.SWAGGER_2).groupName("topic7").apiInfo(apiInfo()).select() .apis(Predicates.not(RequestHandlerSelectors.basePackage("org.springframework.boot"))) .paths(regex("/.*")).build(); }
From source file:com.quick.jwt.config.SwaggerConfig.java
@Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2)// .select()// .apis(RequestHandlerSelectors.any())// .paths(Predicates.not(PathSelectors.regex("/error")))// .build()// .apiInfo(metadata())// .useDefaultResponseMessages(false)// .securitySchemes(/* www .j a va 2s .c om*/ new ArrayList<>(Arrays.asList(new ApiKey("Bearer %token", "Authorization", "Header"))))// .tags(new Tag("users", "Operations about users"))// .tags(new Tag("ping", "Just a ping"))// .genericModelSubstitutes(Optional.class); }