本文整理了Java中scala.collection.immutable.List.isEmpty()
方法的一些代码示例,展示了List.isEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。List.isEmpty()
方法的具体详情如下:
包路径:scala.collection.immutable.List
类名称:List
方法名:isEmpty
暂无
代码示例来源:origin: org.apache.kafka/kafka_2.10
if (!adminClient.describeConsumerGroup(groupId).consumers().get().isEmpty()) {
throw new IllegalStateException("Consumer group '" + groupId + "' is still active. " +
"Make sure to stop all running application instances before running the reset tool.");
代码示例来源:origin: kframework/k-legacy
@Override
public boolean hasNext() {
return !l.isEmpty();
}
代码示例来源:origin: kframework/k
@Override
public boolean hasNext() {
return !l.isEmpty();
}
代码示例来源:origin: confluentinc/kafka-streams-examples
while (!adminClient.describeConsumerGroup(applicationId, 0).consumers().get().isEmpty()) {
Utils.sleep(50);
while (!adminClient.describeConsumerGroup(applicationId, 0).consumers().get().isEmpty()) {
Utils.sleep(50);
代码示例来源:origin: kframework/k
if (rewrites.size() == 1 && rewrites.get(0).getLeft().isEmpty()) {
return rewrites.get(0).getRight().substituteAndEvaluate(substitution, context);
代码示例来源:origin: kframework/k
/**
* goes down the path on the subject to find the rewrite place, does the substitution, and reconstructs the term
* on its way up
*/
private Term buildRHS(Term subject, Substitution<Variable, Term> substitution, scala.collection.immutable.List<Pair<Integer, Integer>> path, Term rhs, TermContext context) {
if (path.isEmpty()) {
return rhs.substituteAndEvaluate(substitution, context);
} else {
if (subject instanceof KItem) {
KItem kItemSubject = (KItem) subject;
List<Term> newContents = new ArrayList<>(((KList) kItemSubject.kList()).getContents());
//noinspection RedundantCast
newContents.set(path.head().getLeft(), buildRHS(newContents.get(path.head().getLeft()), substitution,
(scala.collection.immutable.List<Pair<Integer, Integer>>) path.tail(), rhs, context));
return KItem.of(kItemSubject.kLabel(), KList.concatenate(newContents), context.global()).applyAnywhereRules(context);
} else if (subject instanceof BuiltinList) {
BuiltinList builtinListSubject = (BuiltinList) subject;
List<Term> newContents = new ArrayList<>(builtinListSubject.children);
//noinspection RedundantCast
newContents.set(path.head().getLeft(), buildRHS(newContents.get(path.head().getLeft()), substitution,
(scala.collection.immutable.List<Pair<Integer, Integer>>) path.tail(), rhs, context));
return BuiltinList
.builder(builtinListSubject.sort, builtinListSubject.operatorKLabel, builtinListSubject.unitKLabel, builtinListSubject.globalContext())
.addAll(newContents)
.build();
} else {
throw new AssertionError("unexpected rewrite in subject: " + subject);
}
}
}
代码示例来源:origin: com.twitter/util-core_2.12
/**
* Creates a new `Spool` of given `elems`.
*/
@SuppressWarnings("unchecked")
public static <T> Spool<T> newSpool(Collection<T> elems) {
List<T> buffer = (List<T>)List.empty();
for (T item : elems) {
buffer = buffer.$colon$colon(item);
}
Spool<T> result = (Spool<T>)EMPTY;
while(!buffer.isEmpty()){
result = new Spool.Cons<T>(buffer.head(), Future.value(result));
buffer = (List<T>)buffer.tail();
}
return result;
}
代码示例来源:origin: wkennedy/swagger4spring-web
private Map<String, ApiListing> processControllers(Set<Class<?>> controllerClasses) {
//Loop over end points (controllers)
for (Class<?> controllerClass : controllerClasses) {
if (ApiDocumentationController.class.isAssignableFrom(controllerClass)) {
continue;
}
Set<Method> requestMappingMethods = AnnotationUtils.getAnnotatedMethods(controllerClass, RequestMapping.class);
ApiListing apiListing = processControllerApi(controllerClass);
String description = "";
Api controllerApi = controllerClass.getAnnotation(Api.class);
if (controllerApi != null) {
description = controllerApi.description();
}
if (apiListing.apis().size() == 0) {
apiListing = processMethods(requestMappingMethods, controllerClass, apiListing, description);
}
//Allow for multiple controllers having the same resource path.
ApiListing existingApiListing = apiListingMap.get(apiListing.resourcePath());
if (existingApiListing != null) {
apiListing = ApiListingUtil.mergeApiListing(existingApiListing, apiListing);
}
// controllers without any operations are excluded from the apiListingMap list
if (apiListing.apis() != null && !apiListing.apis().isEmpty()) {
apiListingMap.put(apiListing.resourcePath(), apiListing);
}
}
return apiListingMap;
}
代码示例来源:origin: com.twitter/util-core_2.11
/**
* Creates a new `Spool` of given `elems`.
*/
@SuppressWarnings("unchecked")
public static <T> Spool<T> newSpool(Collection<T> elems) {
List<T> buffer = (List<T>)List.empty();
for (T item : elems) {
buffer = buffer.$colon$colon(item);
}
Spool<T> result = (Spool<T>)EMPTY;
while(!buffer.isEmpty()){
result = new Spool.Cons<T>(buffer.head(), Future.value(result));
buffer = (List<T>)buffer.tail();
}
return result;
}
代码示例来源:origin: vakinge/jeesuite-libs
if(consumers.isEmpty()){
System.out.println("Consumer group ["+group+"] does not exist or is rebalancing.");
return null;
代码示例来源:origin: org.apache.activemq/apollo-mqtt
if (!route.targets().isEmpty()) {
Delivery delivery = new Delivery();
delivery.message_$eq(new RawMessage(publish.payload()));
内容来源于网络,如有侵权,请联系作者删除!