本文整理汇总了Java中org.immutables.value.Value.Check类的典型用法代码示例。如果您正苦于以下问题:Java Check类的具体用法?Java Check怎么用?Java Check使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Check类属于org.immutables.value.Value包,在下文中一共展示了Check类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: check
import org.immutables.value.Value.Check; //导入依赖的package包/类
@Check
protected void check() {
ImmutableList<String> names = propertyNames();
ImmutableSet<String> asSet = ImmutableSet.copyOf(names);
Preconditions.checkArgument(names.size()==asSet.size(),"property used more than once: %s",names);
int indexOfPageProperty = names.indexOf(PAGE);
Preconditions.checkArgument(indexOfPageProperty==-1 || indexOfPageProperty==(names.size()-1),"page property is not last in path: %s",names);
}
示例2: validate
import org.immutables.value.Value.Check; //导入依赖的package包/类
@Check
protected void validate() {
checkState(projectName().trim().length() > 0, "ProjectName must not be blank.");
checkState(validCharacters(),
"ProjectName '%s' not allowed, please use lowercase letters and numbers only.", projectName());
}
示例3: check
import org.immutables.value.Value.Check; //导入依赖的package包/类
@Check
protected void check() {
Preconditions.checkState(!getKeepAliveTimeout().orElse(Duration.ofSeconds(1)).isZero(),
"keepAliveTimeout must not be zero; use Optional.empty() to disable keepalive");
}