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


Java Preconditions.checkArgument方法代码示例

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


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

示例1: MetricIdentity

import com.stackify.api.common.util.Preconditions; //导入方法依赖的package包/类
/**
 * Constructor
 * @param category Metric category
 * @param name Metric name
 * @param type Metric monitor type
 */
public MetricIdentity(final String category, final String name, final MetricMonitorType type) {
	Preconditions.checkNotNull(category);
	Preconditions.checkArgument(!category.isEmpty());
	Preconditions.checkNotNull(name);
	Preconditions.checkArgument(!name.isEmpty());
	Preconditions.checkNotNull(type);
	
	this.category = category;
	this.name = name;
	this.type = type;
}
 
开发者ID:stackify,项目名称:stackify-metrics,代码行数:18,代码来源:MetricIdentity.java

示例2: MetricAggregator

import com.stackify.api.common.util.Preconditions; //导入方法依赖的package包/类
/**
 * Constructor
 * @param currentMinute Current minute
 * @param lastValues Last values for the metrics
 */
public MetricAggregator(final long currentMinute, final Map<MetricIdentity, Double> lastValues) {
	Preconditions.checkArgument(0 < currentMinute);
	Preconditions.checkNotNull(lastValues);
	this.currentMinute = currentMinute;
	this.lastValues = lastValues;
}
 
开发者ID:stackify,项目名称:stackify-metrics,代码行数:12,代码来源:MetricAggregator.java

示例3: SynchronizedEvictingQueue

import com.stackify.api.common.util.Preconditions; //导入方法依赖的package包/类
/**
 * Constructor
 * @param maxSize Maximum size of the queue
 */
public SynchronizedEvictingQueue(final int maxSize) {
	Preconditions.checkArgument(0 < maxSize);
	this.maxSize = maxSize;
	this.deque = new ArrayDeque<E>(maxSize);
}
 
开发者ID:stackify,项目名称:stackify-api-java,代码行数:10,代码来源:SynchronizedEvictingQueue.java

示例4: activate

import com.stackify.api.common.util.Preconditions; //导入方法依赖的package包/类
/**
 * Activates the appender
 * @param apiConfig API configuration
 */
public void activate(final ApiConfiguration apiConfig) {
	Preconditions.checkNotNull(apiConfig);
	Preconditions.checkNotNull(apiConfig.getApiUrl());
	Preconditions.checkArgument(!apiConfig.getApiUrl().isEmpty());
	Preconditions.checkNotNull(apiConfig.getApiKey());
	Preconditions.checkArgument(!apiConfig.getApiKey().isEmpty());

	// Single JSON object mapper for all services

	ObjectMapper objectMapper = new ObjectMapper();

	// build the app identity service

	AppIdentityService appIdentityService = new AppIdentityService(apiConfig, objectMapper);

	// build the services for collecting and sending log messages

	this.collector = new LogCollector(logger, apiConfig.getEnvDetail(), appIdentityService);

	LogSender sender = new LogSender(apiConfig, objectMapper, this.masker, this.skipJson);

	// set allowComDotStackify
	
	if (Boolean.TRUE.equals(apiConfig.getAllowComDotStackify())) {
		this.allowComDotStackify = true;
	}
	
	// build the background service to asynchronously post errors to Stackify
	// startup the background service

	this.backgroundService = new LogBackgroundService(collector, sender);
	this.backgroundService.start();
}
 
开发者ID:stackify,项目名称:stackify-api-java,代码行数:38,代码来源:LogAppender.java


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