当前位置: 首页>>代码示例>>Java>>正文


Java Assert.notEmpty方法代码示例

本文整理汇总了Java中org.springframework.util.Assert.notEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java Assert.notEmpty方法的具体用法?Java Assert.notEmpty怎么用?Java Assert.notEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.util.Assert的用法示例。


在下文中一共展示了Assert.notEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getStringObjectMap

import org.springframework.util.Assert; //导入方法依赖的package包/类
private Map<String, Object> getStringObjectMap(Map jsonMap) {
	Assert.notNull(jsonMap, "Failed to parse the Tweet json!");

	String tweetText = (String) jsonMap.get(TWEET_TEXT_TAG);

	if (isEmpty(tweetText)) {
		logger.warn("Tweet with out text: " + jsonMap.get(TWEET_ID_TAG));
		tweetText = "";
	}

	int[][] tweetVector = wordVocabulary.vectorizeSentence(tweetText);

	Assert.notEmpty(tweetVector, "Failed to vectorize the tweet text: " + tweetText);

	Map<String, Object> response = new HashMap<>();
	response.put(DATA_IN, tweetVector);
	response.put(DROPOUT_KEEP_PROB, DROPOUT_KEEP_PROB_VALUE);

	return response;
}
 
开发者ID:spring-cloud-stream-app-starters,项目名称:tensorflow,代码行数:21,代码来源:TwitterSentimentTensorflowInputConverter.java

示例2: orContains

import org.springframework.util.Assert; //导入方法依赖的package包/类
/**
 * Return a ExpressionList specifying propertyNames contains value.
 *
 * @param expressionList the ExpressionList to add contains expression
 * @param propertyNames  the property name of entity bean.
 * @param value          contains value.
 * @param <T>            the type of entity.
 * @return the ExpressionList specifying propertyNames contains value.
 */
public static <T> ExpressionList<T> orContains(ExpressionList<T> expressionList,
                                               List<String> propertyNames,
                                               String value) {
  Assert.notNull(expressionList, "expressionList must not null");
  Assert.notEmpty(propertyNames, "propertyNames must not empty");
  if (StringUtils.hasText(value)) {
    Junction<T> junction = expressionList
        .or();
    ExpressionList<T> exp = null;
    for (String propertyName : propertyNames) {
      if (exp == null) {
        exp = junction.contains(propertyName, value);
      } else {
        exp = exp.contains(propertyName, value);
      }
    }
    if (exp != null) {
      exp.endOr();
      return exp;
    }
  }
  return expressionList;
}
 
开发者ID:hexagonframework,项目名称:spring-data-ebean,代码行数:33,代码来源:EbeanQueryChannelService.java

示例3: initRocketMQPushConsumer

import org.springframework.util.Assert; //导入方法依赖的package包/类
private void initRocketMQPushConsumer() throws MQClientException {

        Assert.notNull(getConsumerGroup(), "Property 'consumerGroup' is required");
        Assert.notEmpty(subscribeTopicTags(), "subscribeTopicTags method can't be empty");

        consumer = new DefaultMQPushConsumer(getConsumerGroup());
        if (consumeThreadMax != null) {
            consumer.setConsumeThreadMax(consumeThreadMax);
        }
        if (consumeThreadMax != null && consumeThreadMax < consumer.getConsumeThreadMin()) {
            consumer.setConsumeThreadMin(consumeThreadMax);
        }

        consumer.setConsumeFromWhere(consumeFromWhere);
        consumer.setMessageModel(messageModel);

        switch (consumeMode) {
            case Orderly:
                consumer.setMessageListener(new DefaultMessageListenerOrderly());
                break;
            case CONCURRENTLY:
                consumer.setMessageListener(new DefaultMessageListenerConcurrently());
                break;
            default:
                throw new IllegalArgumentException("Property 'consumeMode' was wrong.");
        }

    }
 
开发者ID:rhwayfun,项目名称:spring-boot-rocketmq-starter,代码行数:29,代码来源:AbstractRocketMqConsumer.java

示例4: initApplicationContext

import org.springframework.util.Assert; //导入方法依赖的package包/类
@Override
public void initApplicationContext() throws BeansException {
    Collection<ValidatorController> validatorControllers = getApplicationContext()
            .getBeansOfType(ValidatorController.class).values();
    Assert.notEmpty(validatorControllers, "No Validator Controller bean definition found.");
    ValidatorController validatorController = validatorControllers.iterator().next();
    validatorController.setupUrlMapping(this);
    super.initApplicationContext();
}
 
开发者ID:devefx,项目名称:validator-web,代码行数:10,代码来源:ValidatorHandlerMapping.java

示例5: AnnotationTransactionAttributeSource

import org.springframework.util.Assert; //导入方法依赖的package包/类
/**
 * Create a custom AnnotationTransactionAttributeSource.
 * @param annotationParsers the TransactionAnnotationParsers to use
 */
public AnnotationTransactionAttributeSource(TransactionAnnotationParser... annotationParsers) {
	this.publicMethodsOnly = true;
	Assert.notEmpty(annotationParsers, "At least one TransactionAnnotationParser needs to be specified");
	Set<TransactionAnnotationParser> parsers = new LinkedHashSet<TransactionAnnotationParser>(annotationParsers.length);
	Collections.addAll(parsers, annotationParsers);
	this.annotationParsers = parsers;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:AnnotationTransactionAttributeSource.java

示例6: setCacheNames

import org.springframework.util.Assert; //导入方法依赖的package包/类
public void setCacheNames(String[] cacheNames) {
	Assert.notEmpty(cacheNames);
	this.cacheNames = new LinkedHashSet<String>(cacheNames.length);
	for (String string : cacheNames) {
		this.cacheNames.add(string);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:CacheOperation.java

示例7: insert

import org.springframework.util.Assert; //导入方法依赖的package包/类
/**
 * 新增
 */
public void insert() {
    Assert.notEmpty(columns, "没有可以插入的行数据");
    Map<String, String[]> mapping = getColumnsMapping();
    String sql = new SQL()
            .INSERT_INTO(table)
            .INTO_COLUMNS(mapping.get("columns"))
            .INTO_VALUES(mapping.get("values"))
            .toString();

    executeUpdate(sql, values);
}
 
开发者ID:Martion2017,项目名称:ApplicationDetection,代码行数:15,代码来源:ActiveRecord.java

示例8: ContentNegotiationManager

import org.springframework.util.Assert; //导入方法依赖的package包/类
/**
 * Create an instance with the given ContentNegotiationStrategy instances.
 * <p>Each instance is checked to see if it is also an implementation of
 * MediaTypeFileExtensionResolver, and if so it is registered as such.
 * @param strategies one more more ContentNegotiationStrategy instances
 */
public ContentNegotiationManager(ContentNegotiationStrategy... strategies) {
	Assert.notEmpty(strategies, "At least one ContentNegotiationStrategy is expected");
	this.contentNegotiationStrategies.addAll(Arrays.asList(strategies));
	for (ContentNegotiationStrategy strategy : this.contentNegotiationStrategies) {
		if (strategy instanceof MediaTypeFileExtensionResolver) {
			this.fileExtensionResolvers.add((MediaTypeFileExtensionResolver) strategy);
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:ContentNegotiationManager.java

示例9: RequestConfigMapping

import org.springframework.util.Assert; //导入方法依赖的package包/类
public RequestConfigMapping(RequestMatcher matcher, Collection<ConfigAttribute> attributes) {
    if (matcher == null) {
        throw new IllegalArgumentException("matcher cannot be null");
    }
    Assert.notEmpty(attributes, "attributes cannot be null or emtpy");

    this.matcher = matcher;
    this.attributes = attributes;
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:10,代码来源:RequestConfigMapping.java

示例10: registerAnnotationClasses

import org.springframework.util.Assert; //导入方法依赖的package包/类
public void registerAnnotationClasses(Class<?>... annotatedClasses) {
    Assert.notEmpty(annotatedClasses, "At least one annotated class must be specified");
    this.annotatedBeanReader.register(annotatedClasses);
}
 
开发者ID:profullstack,项目名称:spring-seed,代码行数:5,代码来源:SpringBatchApplicationContext.java

示例11: AnnotationCacheOperationSource

import org.springframework.util.Assert; //导入方法依赖的package包/类
/**
 * Create a custom AnnotationCacheOperationSource.
 * @param annotationParsers the CacheAnnotationParser to use
 */
public AnnotationCacheOperationSource(Set<CacheAnnotationParser> annotationParsers) {
	this.publicMethodsOnly = true;
	Assert.notEmpty(annotationParsers, "At least one CacheAnnotationParser needs to be specified");
	this.annotationParsers = annotationParsers;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:AnnotationCacheOperationSource.java

示例12: PropertyBatchUpdateException

import org.springframework.util.Assert; //导入方法依赖的package包/类
/**
 * Create a new PropertyBatchUpdateException.
 * @param propertyAccessExceptions the List of PropertyAccessExceptions
 */
public PropertyBatchUpdateException(PropertyAccessException[] propertyAccessExceptions) {
	super(null);
	Assert.notEmpty(propertyAccessExceptions, "At least 1 PropertyAccessException required");
	this.propertyAccessExceptions = propertyAccessExceptions;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:PropertyBatchUpdateException.java

示例13: CompositeCacheOperationSource

import org.springframework.util.Assert; //导入方法依赖的package包/类
/**
 * Create a new CompositeCacheOperationSource for the given sources.
 * @param cacheOperationSources the CacheOperationSource instances to combine
 */
public CompositeCacheOperationSource(CacheOperationSource... cacheOperationSources) {
	Assert.notEmpty(cacheOperationSources, "cacheOperationSources array must not be empty");
	this.cacheOperationSources = cacheOperationSources;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:CompositeCacheOperationSource.java

示例14: OpPlus

import org.springframework.util.Assert; //导入方法依赖的package包/类
public OpPlus(int pos, SpelNodeImpl... operands) {
	super("+", pos, operands);
	Assert.notEmpty(operands);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:OpPlus.java

示例15: CompositeGraphMetadataDaoImpl

import org.springframework.util.Assert; //导入方法依赖的package包/类
public CompositeGraphMetadataDaoImpl(List<IWayGraphVersionMetadataDao> writeDaos) {
	Assert.notEmpty(writeDaos, "no write daos set!");
	Assert.isTrue(writeDaos.size() < 2, "at least 2 write daos expected");
	this.writeDaos = writeDaos;
	log.info("using first write dao (" + writeDaos.get(0).getClass() + ") as primary dao for reads ");
}
 
开发者ID:graphium-project,项目名称:graphium,代码行数:7,代码来源:CompositeGraphMetadataDaoImpl.java


注:本文中的org.springframework.util.Assert.notEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。