org.springframework.util.Assert.notEmpty()

Here are the examples of the java api org.springframework.util.Assert.notEmpty() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

267 Examples 7

19 View Source File : AutoConfigurationImportSelector.java
License : Apache License 2.0
Project Creator : yuanmabiji

/**
 * Return the auto-configuration clreplaced names that should be considered. By default
 * this method will load candidates using {@link SpringFactoriesLoader} with
 * {@link #getSpringFactoriesLoaderFactoryClreplaced()}.
 * @param metadata the source metadata
 * @param attributes the {@link #getAttributes(AnnotationMetadata) annotation
 * attributes}
 * @return a list of candidate configurations
 */
protected List<String> getCandidateConfigurations(AnnotationMetadata metadata, AnnotationAttributes attributes) {
    List<String> configurations = // 得到所有自动配置类
    SpringFactoriesLoader.loadFactoryNames(getSpringFactoriesLoaderFactoryClreplaced(), // getSpringFactoriesLoaderFactoryClreplaced()返回EnableAutoConfiguration.clreplaced
    getBeanClreplacedLoader());
    replacedert.notEmpty(configurations, "No auto configuration clreplacedes found in META-INF/spring.factories. If you " + "are using a custom packaging, make sure that file is correct.");
    return configurations;
}

19 View Source File : EncodedResourceResolver.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Configure the supported content codings in order of preference. The first
 * coding that is present in the {@literal "Accept-Encoding"} header for a
 * given request, and that has a file present with the replacedociated extension,
 * is used.
 * <p><strong>Note:</strong> Each coding must be replacedociated with a file
 * extension via {@link #registerExtension} or {@link #setExtensions}. Also
 * customizations to the list of codings here should be matched by
 * customizations to the same list in {@link CachingResourceResolver} to
 * ensure encoded variants of a resource are cached under separate keys.
 * <p>By default this property is set to {@literal ["br", "gzip"]}.
 * @param codings one or more supported content codings
 */
public void setContentCodings(List<String> codings) {
    replacedert.notEmpty(codings, "At least one content coding expected");
    this.contentCodings.clear();
    this.contentCodings.addAll(codings);
}

19 View Source File : CachingResourceResolver.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Configure the supported content codings from the
 * {@literal "Accept-Encoding"} header for which to cache resource variations.
 * <p>The codings configured here are generally expected to match those
 * configured on {@link EncodedResourceResolver#setContentCodings(List)}.
 * <p>By default this property is set to {@literal ["br", "gzip"]} based on
 * the value of {@link EncodedResourceResolver#DEFAULT_CODINGS}.
 * @param codings one or more supported content codings
 * @since 5.1
 */
public void setContentCodings(List<String> codings) {
    replacedert.notEmpty(codings, "At least one content coding expected");
    this.contentCodings.clear();
    this.contentCodings.addAll(codings);
}

19 View Source File : ViewResolverSupport.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Set the supported media types for this view.
 * Default is "text/html;charset=UTF-8".
 */
public void setSupportedMediaTypes(List<MediaType> supportedMediaTypes) {
    replacedert.notEmpty(supportedMediaTypes, "MediaType List must not be empty");
    this.mediaTypes.clear();
    this.mediaTypes.addAll(supportedMediaTypes);
}

19 View Source File : MockHttpServletRequest.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Set the list of preferred locales, in descending order, effectively replacing
 * any existing locales.
 * @since 3.2
 * @see #addPreferredLocale
 */
public void setPreferredLocales(List<Locale> locales) {
    replacedert.notEmpty(locales, "Locale list must not be empty");
    this.locales.clear();
    this.locales.addAll(locales);
    updateAcceptLanguageHeader();
}

19 View Source File : RestTemplate.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Set the message body converters to use.
 * <p>These converters are used to convert from and to HTTP requests and responses.
 */
public void setMessageConverters(List<HttpMessageConverter<?>> messageConverters) {
    replacedert.notEmpty(messageConverters, "At least one HttpMessageConverter required");
    // Take getMessageConverters() List as-is when preplaceded in here
    if (this.messageConverters != messageConverters) {
        this.messageConverters.clear();
        this.messageConverters.addAll(messageConverters);
    }
}

19 View Source File : FormHttpMessageConverter.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Set the message body converters to use. These converters are used to
 * convert objects to MIME parts.
 */
public void setPartConverters(List<HttpMessageConverter<?>> partConverters) {
    replacedert.notEmpty(partConverters, "'partConverters' must not be empty");
    this.partConverters = partConverters;
}

19 View Source File : AbstractHttpMessageConverter.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Set the list of {@link MediaType} objects supported by this converter.
 */
public void setSupportedMediaTypes(List<MediaType> supportedMediaTypes) {
    replacedert.notEmpty(supportedMediaTypes, "MediaType List must not be empty");
    this.supportedMediaTypes = new ArrayList<>(supportedMediaTypes);
}

19 View Source File : MockHttpServletRequestBuilder.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Set flash attributes.
 * @param flashAttributes the flash attributes
 */
public MockHttpServletRequestBuilder flashAttrs(Map<String, Object> flashAttributes) {
    replacedert.notEmpty(flashAttributes, "'flashAttributes' must not be empty");
    flashAttributes.forEach(this::flashAttr);
    return this;
}

19 View Source File : MockHttpServletRequestBuilder.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Set session attributes.
 * @param sessionAttributes the session attributes
 */
public MockHttpServletRequestBuilder sessionAttrs(Map<String, Object> sessionAttributes) {
    replacedert.notEmpty(sessionAttributes, "'sessionAttributes' must not be empty");
    sessionAttributes.forEach(this::sessionAttr);
    return this;
}

19 View Source File : MockHttpServletRequestBuilder.java
License : MIT License
Project Creator : Vip-Augus

private static <T> void addToMultiValueMap(MultiValueMap<String, T> map, String name, T[] values) {
    replacedert.hasLength(name, "'name' must not be empty");
    replacedert.notEmpty(values, "'values' must not be empty");
    for (T value : values) {
        map.add(name, value);
    }
}

19 View Source File : Jaxb2Marshaller.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Set multiple JAXB context paths. The given array of context paths gets
 * converted to a colon-delimited string, as supported by JAXB.
 */
public void setContextPaths(String... contextPaths) {
    replacedert.notEmpty(contextPaths, "'contextPaths' must not be empty");
    this.contextPath = StringUtils.arrayToDelimitedString(contextPaths, ":");
}

19 View Source File : Jaxb2Marshaller.java
License : MIT License
Project Creator : Vip-Augus

// on JDK 9
@SuppressWarnings("deprecation")
private Schema loadSchema(Resource[] resources, String schemaLanguage) throws IOException, SAXException {
    if (logger.isDebugEnabled()) {
        logger.debug("Setting validation schema to " + StringUtils.arrayToCommaDelimitedString(this.schemaResources));
    }
    replacedert.notEmpty(resources, "No resources given");
    replacedert.hasLength(schemaLanguage, "No schema language provided");
    Source[] schemaSources = new Source[resources.length];
    XMLReader xmlReader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
    xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
    for (int i = 0; i < resources.length; i++) {
        Resource resource = resources[i];
        replacedert.isTrue(resource != null && resource.exists(), () -> "Resource does not exist: " + resource);
        InputSource inputSource = SaxResourceUtils.createInputSource(resource);
        schemaSources[i] = new SAXSource(xmlReader, inputSource);
    }
    SchemaFactory schemaFactory = SchemaFactory.newInstance(schemaLanguage);
    if (this.schemaResourceResolver != null) {
        schemaFactory.setResourceResolver(this.schemaResourceResolver);
    }
    return schemaFactory.newSchema(schemaSources);
}

19 View Source File : ProfilesParser.java
License : MIT License
Project Creator : Vip-Augus

static Profiles parse(String... expressions) {
    replacedert.notEmpty(expressions, "Must specify at least one profile");
    Profiles[] parsed = new Profiles[expressions.length];
    for (int i = 0; i < expressions.length; i++) {
        parsed[i] = parseExpression(expressions[i]);
    }
    return new ParsedProfiles(expressions, parsed);
}

19 View Source File : AnnotationConfigApplicationContext.java
License : MIT License
Project Creator : Vip-Augus

// ---------------------------------------------------------------------
// Implementation of AnnotationConfigRegistry
// ---------------------------------------------------------------------
/**
 * Register one or more annotated clreplacedes to be processed.
 * <p>Note that {@link #refresh()} must be called in order for the context
 * to fully process the new clreplacedes.
 * @param annotatedClreplacedes one or more annotated clreplacedes,
 * e.g. {@link Configuration @Configuration} clreplacedes
 * @see #scan(String...)
 * @see #refresh()
 */
public void register(Clreplaced<?>... annotatedClreplacedes) {
    replacedert.notEmpty(annotatedClreplacedes, "At least one annotated clreplaced must be specified");
    this.reader.register(annotatedClreplacedes);
}

19 View Source File : AnnotationConfigApplicationContext.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Perform a scan within the specified base packages.
 * <p>Note that {@link #refresh()} must be called in order for the context
 * to fully process the new clreplacedes.
 * @param basePackages the packages to check for annotated clreplacedes
 * @see #register(Clreplaced...)
 * @see #refresh()
 */
public void scan(String... basePackages) {
    replacedert.notEmpty(basePackages, "At least one base package must be specified");
    this.scanner.scan(basePackages);
}

19 View Source File : CacheAspectSupport.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Set one or more cache operation sources which are used to find the cache
 * attributes. If more than one source is provided, they will be aggregated
 * using a {@link CompositeCacheOperationSource}.
 * @see #setCacheOperationSource
 */
public void setCacheOperationSources(CacheOperationSource... cacheOperationSources) {
    replacedert.notEmpty(cacheOperationSources, "At least 1 CacheOperationSource needs to be specified");
    this.cacheOperationSource = (cacheOperationSources.length > 1 ? new CompositeCacheOperationSource(cacheOperationSources) : cacheOperationSources[0]);
}

19 View Source File : AutowiredAnnotationBeanPostProcessor.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Set the 'autowired' annotation types, to be used on constructors, fields,
 * setter methods and arbitrary config methods.
 * <p>The default autowired annotation type is the Spring-provided {@link Autowired}
 * annotation, as well as {@link Value}.
 * <p>This setter property exists so that developers can provide their own
 * (non-Spring-specific) annotation types to indicate that a member is supposed
 * to be autowired.
 */
public void setAutowiredAnnotationTypes(Set<Clreplaced<? extends Annotation>> autowiredAnnotationTypes) {
    replacedert.notEmpty(autowiredAnnotationTypes, "'autowiredAnnotationTypes' must not be empty");
    this.autowiredAnnotationTypes.clear();
    this.autowiredAnnotationTypes.addAll(autowiredAnnotationTypes);
}

19 View Source File : AbstractRegexpMethodPointcut.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Set the regular expressions defining methods to match.
 * Matching will be the union of all these; if any match, the pointcut matches.
 * @see #setPattern
 */
public void setPatterns(String... patterns) {
    replacedert.notEmpty(patterns, "'patterns' must not be empty");
    this.patterns = new String[patterns.length];
    for (int i = 0; i < patterns.length; i++) {
        this.patterns[i] = StringUtils.trimWhitespace(patterns[i]);
    }
    initPatternRepresentation(this.patterns);
}

19 View Source File : AbstractRegexpMethodPointcut.java
License : MIT License
Project Creator : Vip-Augus

/**
 * Set the regular expressions defining methods to match for exclusion.
 * Matching will be the union of all these; if any match, the pointcut matches.
 * @see #setExcludedPattern
 */
public void setExcludedPatterns(String... excludedPatterns) {
    replacedert.notEmpty(excludedPatterns, "'excludedPatterns' must not be empty");
    this.excludedPatterns = new String[excludedPatterns.length];
    for (int i = 0; i < excludedPatterns.length; i++) {
        this.excludedPatterns[i] = StringUtils.trimWhitespace(excludedPatterns[i]);
    }
    initExcludedPatternRepresentation(this.excludedPatterns);
}

19 View Source File : FastJsonJsonView.java
License : Apache License 2.0
Project Creator : uavorg

/**
 * Set JSONP request parameter names. Each time a request has one of those
 * parameters, the resulting JSON will be wrapped into a function named as
 * specified by the JSONP request parameter value.
 * <p>The parameter names configured by default are "jsonp" and "callback".
 * @since 4.1
 * @see <a href="http://en.wikipedia.org/wiki/JSONP">JSONP Wikipedia article</a>
 */
public void setJsonpParameterNames(Set<String> jsonpParameterNames) {
    replacedert.notEmpty(jsonpParameterNames, "jsonpParameterName cannot be empty");
    this.jsonpParameterNames = jsonpParameterNames.toArray(new String[jsonpParameterNames.size()]);
}

19 View Source File : AbstractView.java
License : Apache License 2.0
Project Creator : SourceHot

/**
 * Set the supported media types for this view.
 * <p>Default is {@code "text/html;charset=UTF-8"}.
 */
public void setSupportedMediaTypes(List<MediaType> supportedMediaTypes) {
    replacedert.notEmpty(supportedMediaTypes, "MediaType List must not be empty");
    this.mediaTypes.clear();
    this.mediaTypes.addAll(supportedMediaTypes);
}

19 View Source File : RestTemplate.java
License : Apache License 2.0
Project Creator : SourceHot

private void validateConverters(List<HttpMessageConverter<?>> messageConverters) {
    replacedert.notEmpty(messageConverters, "At least one HttpMessageConverter is required");
    replacedert.noNullElements(messageConverters, "The HttpMessageConverter list must not contain null elements");
}

19 View Source File : MockHttpServletRequestBuilder.java
License : Apache License 2.0
Project Creator : SourceHot

/**
 * Set the 'Accept' header using raw String values, possibly not even well
 * formed (for testing purposes).
 * @param mediaTypes one or more media types; internally joined as
 * comma-separated String
 */
public MockHttpServletRequestBuilder accept(String... mediaTypes) {
    replacedert.notEmpty(mediaTypes, "'mediaTypes' must not be empty");
    this.headers.set("Accept", String.join(", ", mediaTypes));
    return this;
}

19 View Source File : AutowiredAnnotationBeanPostProcessor.java
License : Apache License 2.0
Project Creator : SourceHot

/**
 * Set the 'autowired' annotation types, to be used on constructors, fields, setter methods, and
 * arbitrary config methods.
 * <p>The default autowired annotation types are the Spring-provided
 * {@link Autowired @Autowired} and {@link Value @Value} annotations as well as JSR-330's {@link
 * javax.inject.Inject @Inject} annotation, if available.
 * <p>This setter property exists so that developers can provide their own
 * (non-Spring-specific) annotation types to indicate that a member is supposed to be
 * autowired.
 */
public void setAutowiredAnnotationTypes(Set<Clreplaced<? extends Annotation>> autowiredAnnotationTypes) {
    replacedert.notEmpty(autowiredAnnotationTypes, "'autowiredAnnotationTypes' must not be empty");
    this.autowiredAnnotationTypes.clear();
    this.autowiredAnnotationTypes.addAll(autowiredAnnotationTypes);
}

19 View Source File : JwtDecoderBuilder.java
License : Apache License 2.0
Project Creator : SAP

/**
 * Allows to provide multiple xsuaa service configuration. In case you have
 * multiple Xsuaa idenreplacedy service instances and you like to accept tokens
 * issued for them as well. The configuration of the the first one (index 0) is
 * taken as main configuration.
 *
 * @param serviceConfigurations
 *            all configurations of the xsuaa service instance, e.g. the broker
 * @return this jwt decoder builder
 */
public JwtDecoderBuilder withXsuaaServiceConfigurations(List<? extends OAuth2ServiceConfiguration> serviceConfigurations) {
    replacedert.notEmpty(serviceConfigurations, "serviceConfigurations must not be empty. Expect at least one xsuaa service configuration.");
    this.xsuaaConfigurations = serviceConfigurations;
    return this;
}

19 View Source File : DefaultRedirectResolver.java
License : Apache License 2.0
Project Creator : MaxKeyTop

/**
 * Attempt to match one of the registered URIs to the that of the requested one.
 *
 * @param redirectUris the set of the registered URIs to try and find a match. This cannot be null or empty.
 * @param requestedRedirect the URI used as part of the request
 * @return the matching URI
 * @throws RedirectMismatchException if no match was found
 */
private String obtainMatchingRedirect(Set<String> redirectUris, String requestedRedirect) {
    replacedert.notEmpty(redirectUris, "Redirect URIs cannot be empty");
    if (redirectUris.size() == 1 && requestedRedirect == null) {
        return redirectUris.iterator().next();
    }
    for (String redirectUri : redirectUris) {
        if (requestedRedirect != null && redirectMatches(requestedRedirect, redirectUri)) {
            return requestedRedirect;
        }
    }
    throw new RedirectMismatchException("Invalid redirect: " + requestedRedirect + " does not match one of the registered values: " + redirectUris.toString());
}

19 View Source File : PreAuthenticationFilterFactoryBean.java
License : Apache License 2.0
Project Creator : liuminglei

public void ignoreAntPattern(Set<String> patterns) {
    replacedert.notEmpty(patterns, "patterns must be not null.");
    this.ignoreAntPatterns.addAll(patterns);
}

19 View Source File : MockHttpServletRequest.java
License : Apache License 2.0
Project Creator : langtianya

/**
 * Set the list of preferred locales, in descending order, effectively replacing
 * any existing locales.
 * @see #addPreferredLocale
 * @since 3.2
 */
public void setPreferredLocales(List<Locale> locales) {
    replacedert.notEmpty(locales, "Locale list must not be empty");
    this.locales.clear();
    this.locales.addAll(locales);
}

19 View Source File : AbstractHttpMessageConverter.java
License : Apache License 2.0
Project Creator : langtianya

/**
 * Set the list of {@link MediaType} objects supported by this converter.
 */
public void setSupportedMediaTypes(List<MediaType> supportedMediaTypes) {
    replacedert.notEmpty(supportedMediaTypes, "'supportedMediaTypes' must not be empty");
    this.supportedMediaTypes = new ArrayList<MediaType>(supportedMediaTypes);
}

19 View Source File : AbstractTestContextBootstrapper.java
License : Apache License 2.0
Project Creator : langtianya

/**
 * Resolve the {@link ContextLoader} {@linkplain Clreplaced clreplaced} to use for the supplied
 * list of {@link ContextConfigurationAttributes}.
 * <p>Beginning with the first level in the context configuration attributes hierarchy:
 * <ol>
 * <li>If the {@link ContextConfigurationAttributes#getContextLoaderClreplaced()
 * contextLoaderClreplaced} property of {@link ContextConfigurationAttributes} is
 * configured with an explicit clreplaced, that clreplaced will be returned.</li>
 * <li>If an explicit {@code ContextLoader} clreplaced is not specified at the current
 * level in the hierarchy, traverse to the next level in the hierarchy and return to
 * step #1.</li>
 * </ol>
 * @param configAttributesList the list of configuration attributes to process;
 * must not be {@code null} or <em>empty</em>; must be ordered <em>bottom-up</em>
 * (i.e., as if we were traversing up the clreplaced hierarchy)
 * @return the {@code ContextLoader} clreplaced to use for the supplied configuration
 * attributes, or {@code null} if no explicit loader is found
 * @throws IllegalArgumentException if supplied configuration attributes are
 * {@code null} or <em>empty</em>
 */
protected Clreplaced<? extends ContextLoader> resolveExplicitContextLoaderClreplaced(List<ContextConfigurationAttributes> configAttributesList) {
    replacedert.notEmpty(configAttributesList, "ContextConfigurationAttributes list must not be empty");
    for (ContextConfigurationAttributes configAttributes : configAttributesList) {
        if (logger.isTraceEnabled()) {
            logger.trace(String.format("Resolving ContextLoader for context configuration attributes %s", configAttributes));
        }
        Clreplaced<? extends ContextLoader> contextLoaderClreplaced = configAttributes.getContextLoaderClreplaced();
        if (ContextLoader.clreplaced != contextLoaderClreplaced) {
            if (logger.isDebugEnabled()) {
                logger.debug(String.format("Found explicit ContextLoader clreplaced [%s] for context configuration attributes %s", contextLoaderClreplaced.getName(), configAttributes));
            }
            return contextLoaderClreplaced;
        }
    }
    return null;
}

19 View Source File : Jaxb2Marshaller.java
License : Apache License 2.0
Project Creator : langtianya

/**
 * Set the list of Java clreplacedes to be recognized by a newly created JAXBContext.
 * <p>Setting either this property, {@link #setContextPath "contextPath"}
 * or {@link #setPackagesToScan "packagesToScan"} is required.
 */
public void setClreplacedesToBeBound(Clreplaced<?>... clreplacedesToBeBound) {
    replacedert.notEmpty(clreplacedesToBeBound, "'clreplacedesToBeBound' must not be empty");
    this.clreplacedesToBeBound = clreplacedesToBeBound;
}

19 View Source File : AnnotationConfigApplicationContext.java
License : Apache License 2.0
Project Creator : langtianya

/**
 * Register one or more annotated clreplacedes to be processed.
 * <p>Note that {@link #refresh()} must be called in order for the context
 * to fully process the new clreplacedes.
 * @param annotatedClreplacedes one or more annotated clreplacedes,
 * e.g. {@link Configuration @Configuration} clreplacedes
 * @see #scan(String...)
 * @see #refresh()
 */
public void register(Clreplaced<?>... annotatedClreplacedes) {
    replacedert.notEmpty(annotatedClreplacedes, "At least one annotated clreplaced must be specified");
    this.reader.register(annotatedClreplacedes);
}

19 View Source File : CacheAspectSupport.java
License : Apache License 2.0
Project Creator : langtianya

/**
 * Set one or more cache operation sources which are used to find the cache
 * attributes. If more than one source is provided, they will be aggregated
 * using a {@link CompositeCacheOperationSource}.
 */
public void setCacheOperationSources(CacheOperationSource... cacheOperationSources) {
    replacedert.notEmpty(cacheOperationSources, "At least 1 CacheOperationSource needs to be specified");
    this.cacheOperationSource = (cacheOperationSources.length > 1 ? new CompositeCacheOperationSource(cacheOperationSources) : cacheOperationSources[0]);
}

19 View Source File : AutowiredAnnotationBeanPostProcessor.java
License : Apache License 2.0
Project Creator : langtianya

/**
 * Set the 'autowired' annotation types, to be used on constructors, fields,
 * setter methods and arbitrary config methods.
 * <p>The default autowired annotation type is the Spring-provided
 * {@link Autowired} annotation, as well as {@link Value}.
 * <p>This setter property exists so that developers can provide their own
 * (non-Spring-specific) annotation types to indicate that a member is
 * supposed to be autowired.
 */
public void setAutowiredAnnotationTypes(Set<Clreplaced<? extends Annotation>> autowiredAnnotationTypes) {
    replacedert.notEmpty(autowiredAnnotationTypes, "'autowiredAnnotationTypes' must not be empty");
    this.autowiredAnnotationTypes.clear();
    this.autowiredAnnotationTypes.addAll(autowiredAnnotationTypes);
}

19 View Source File : BaseServiceImpl.java
License : Apache License 2.0
Project Creator : KeRan213539

/**
 * @param ids
 * @return
 * @replacedle: convertIdsString2PKArray
 * @author klw
 * @Description: 将使用逗号(, )隔开的多个ID的字符串转换为PK类型的数组
 */
private ObjectId[] convertIdsString2PKArray(String ids) {
    replacedert.hasText(ids, "ids不能为空!");
    String[] strIds = ids.split(",");
    replacedert.notEmpty(strIds, "ids不能为空!");
    ObjectId[] objectIds = new ObjectId[strIds.length];
    for (int i = 0; i < strIds.length; i++) {
        String strId = strIds[i];
        objectIds[i] = new ObjectId(strId);
    }
    return objectIds;
}

19 View Source File : MongoSpringDataBaseDao.java
License : Apache License 2.0
Project Creator : KeRan213539

@Override
public Mono<List<T>> batchSave(List<T> list) {
    replacedert.notEmpty(list, "要新增的集合不能为空");
    processNotPersistence4Save(list);
    processTextIndexField(list);
    return mongoTemplate.insertAll(list).collectList();
}

19 View Source File : MongoSpringDataBaseDao.java
License : Apache License 2.0
Project Creator : KeRan213539

@Override
public Mono<List<T>> findByIdsWithRefQuery(ObjectId[] ids, String... excludeFields) {
    replacedert.notEmpty(ids, "ids不能为空");
    Query query = Query.query(Criteria.where(MongoDBConstant.ID_KEY).in((Object[]) ids));
    excludeFields(query, excludeFields);
    List<T> rList = notReactiveMongoTemplate.find(query, this.enreplacedyClazz);
    if (CollectionUtils.isEmpty(rList)) {
        return Mono.empty();
    }
    return Mono.just(rList);
}

19 View Source File : AutoConfigurationImportSelector.java
License : Apache License 2.0
Project Creator : hello-shf

/**
 * Return the auto-configuration clreplaced names that should be considered. By default
 * this method will load candidates using {@link SpringFactoriesLoader} with
 * {@link #getSpringFactoriesLoaderFactoryClreplaced()}.
 *
 * @param metadata   the source metadata
 * @param attributes the {@link #getAttributes(AnnotationMetadata) annotation
 *                   attributes}
 * @return a list of candidate configurations
 */
protected List<String> getCandidateConfigurations(AnnotationMetadata metadata, AnnotationAttributes attributes) {
    List<String> configurations = SpringFactoriesLoader.loadFactoryNames(getSpringFactoriesLoaderFactoryClreplaced(), getBeanClreplacedLoader());
    replacedert.notEmpty(configurations, "No auto configuration clreplacedes found in META-INF/spring.factories. If you " + "are using a custom packaging, make sure that file is correct.");
    return configurations;
}

19 View Source File : PostCategoryServiceImpl.java
License : GNU General Public License v3.0
Project Creator : halo-dev

@Override
public List<PostCategory> listByCategoryIdList(List<Integer> categoryIdList) {
    replacedert.notEmpty(categoryIdList, "category id list not empty");
    return postCategoryRepository.findAllByCategoryIdList(categoryIdList);
}

19 View Source File : FastJsonJsonView.java
License : Apache License 2.0
Project Creator : fangjinuo

/**
 * Set JSONP request parameter names. Each time a request has one of those
 * parameters, the resulting JSON will be wrapped into a function named as
 * specified by the JSONP request parameter value.
 * <p>The parameter names configured by default are "jsonp" and "callback".
 *
 * @see <a href="http://en.wikipedia.org/wiki/JSONP">JSONP Wikipedia article</a>
 * @since 4.1
 */
public void setJsonpParameterNames(Set<String> jsonpParameterNames) {
    replacedert.notEmpty(jsonpParameterNames, "jsonpParameterName cannot be empty");
    this.jsonpParameterNames = jsonpParameterNames.toArray(new String[jsonpParameterNames.size()]);
}

19 View Source File : EntityGraphUtils.java
License : MIT License
Project Creator : Cosium

/**
 * @param attributePaths The attribute paths to be present in the result
 * @return A {@link DynamicEnreplacedyGraph} with the path attributes preplaceded in as arguments.
 */
public static EnreplacedyGraph fromAttributePaths(String... attributePaths) {
    replacedert.notEmpty(attributePaths, "At least one attribute path is required.");
    return new DynamicEnreplacedyGraph(Arrays.asList(attributePaths));
}

19 View Source File : EntityGraphUtils.java
License : MIT License
Project Creator : Cosium

/**
 * @param type A {@link EnreplacedyGraphType} to use
 * @param attributePaths The attribute paths to be present in the result
 * @return A {@link DynamicEnreplacedyGraph} with the path attributes preplaceded in as arguments.
 */
public static EnreplacedyGraph fromAttributePaths(EnreplacedyGraphType type, String... attributePaths) {
    replacedert.notEmpty(attributePaths, "At least one attribute path is required.");
    return new DynamicEnreplacedyGraph(type, Arrays.asList(attributePaths));
}

19 View Source File : SimulatorFixture.java
License : MIT License
Project Creator : carsonluuu

public void setGpsSimulatorRequests(List<GpsSimulatorRequest> gpsSimulatorRequests) {
    replacedert.notEmpty(gpsSimulatorRequests, "gpsSimulatorRequests must not be empty.");
    this.gpsSimulatorRequests = gpsSimulatorRequests;
}

19 View Source File : AnnotationBeanDefinitionRegistryPostProcessor.java
License : Apache License 2.0
Project Creator : alibaba

public void addSupportedAnnotationType(Clreplaced<? extends Annotation>... annotationTypes) {
    replacedert.notEmpty(annotationTypes, "The argument of annotation types can't be empty");
    replacedert.noNullElements(annotationTypes, "Any element of annotation types can't be null");
    this.supportedAnnotationTypes.addAll(asList(annotationTypes));
}

19 View Source File : SysRoleController.java
License : Apache License 2.0
Project Creator : 734839030

@RequiresPermissions("sys:role:update")
@PostMapping("/addUser.do")
public ResponeModel addUser(@RequestParam List<String> userIds, String roleId) {
    replacedert.notEmpty(userIds, "移除用户为空");
    int cnt = sysRoleService.addUsersByRoleId(roleId, userIds);
    return ResponeModel.ok(cnt);
}

19 View Source File : SysRoleController.java
License : Apache License 2.0
Project Creator : 734839030

@RequiresPermissions("sys:role:update")
@PostMapping("/removeUser.do")
public ResponeModel removeUser(@RequestParam List<String> userIds, String roleId) {
    replacedert.notEmpty(userIds, "移除用户为空");
    int cnt = sysRoleService.removeUsersByRoleId(roleId, userIds);
    return ResponeModel.ok(cnt);
}

18 View Source File : AbstractDefaultRepository.java
License : Apache License 2.0
Project Creator : yuanweiquan-007

@Override
public Integer update(List<? extends Serializable> ids, Map<String, Object> data) {
    replacedert.notEmpty(ids, "修改主键值为空");
    return update((Update) commandFactory.update().checkPrimaryKey().from(data).whereIn(ids));
}

18 View Source File : AbstractDefaultRepository.java
License : Apache License 2.0
Project Creator : yuanweiquan-007

@Override
public Integer delete(List<? extends Serializable> ids) {
    replacedert.notEmpty(ids, "删除主键值为空");
    return delete((Delete) commandFactory.delete().checkPrimaryKey().whereIn(ids));
}

18 View Source File : AbstractDefaultRepository.java
License : Apache License 2.0
Project Creator : yuanweiquan-007

@Override
public Integer update(List<? extends Serializable> ids, String key, Object value) {
    replacedert.notEmpty(ids, "修改主键值为空");
    return update((Update) commandFactory.update().checkPrimaryKey().set(key, value).whereIn(ids));
}

See More Examples