本文整理了Java中java.util.Collections.emptyEnumeration()
方法的一些代码示例,展示了Collections.emptyEnumeration()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Collections.emptyEnumeration()
方法的具体详情如下:
包路径:java.util.Collections
类名称:Collections
方法名:emptyEnumeration
Collections.emptyEnumeration介绍
[英]Returns an enumeration containing no elements.
[中]返回不包含任何元素的枚举。
代码示例
代码示例来源:origin: javamelody/javamelody
@Override
public Enumeration getInitParameterNames() {
return Collections.emptyEnumeration();
}
};
代码示例来源:origin: wildfly/wildfly
public Enumeration elements() {
return Collections.emptyEnumeration();
}
代码示例来源:origin: org.springframework.boot/spring-boot
@Override
public Enumeration findResources(String name) throws IOException {
return Collections.emptyEnumeration();
}
代码示例来源:origin: robovm/robovm
/**
* Finds an enumeration of URLs for the resource with the specified name.
* This implementation just returns an empty {@code Enumeration}; it should
* be overridden in subclasses.
*
* @param resName
* the name of the resource to find.
* @return an enumeration of {@code URL} objects for the requested resource.
* @throws IOException
* if an I/O error occurs.
*/
@SuppressWarnings( {
"unchecked", "unused"
})
protected Enumeration findResources(String resName) throws IOException {
return Collections.emptyEnumeration();
}
代码示例来源:origin: org.apache.ant/ant
/**
* Returns an enumeration of the dependencies of this target.
*
* @return an enumeration of the dependencies of this target (enumeration of String)
*/
public Enumeration getDependencies() {
return dependencies == null ? Collections.emptyEnumeration()
: Collections.enumeration(dependencies);
}
代码示例来源:origin: org.apache.ant/ant
/**
* Returns an enumeration of all child wrappers.
* @return an enumeration of the child wrappers.
* @since Ant 1.6
*/
public synchronized Enumeration getChildren() {
return (children == null) ? Collections.emptyEnumeration()
: Collections.enumeration(children);
}
代码示例来源:origin: jenkinsci/jenkins
@Override
public Enumeration getResources(String name) throws IOException {
if (isMasked(name)) return Collections.emptyEnumeration();
return super.getResources(name);
}
代码示例来源:origin: spring-projects/spring-framework
@Override
public Enumeration getAttributeNamesInScope(int scope) {
switch (scope) {
case PAGE_SCOPE:
return getAttributeNames();
case REQUEST_SCOPE:
return this.request.getAttributeNames();
case SESSION_SCOPE:
HttpSession session = this.request.getSession(false);
return (session != null ? session.getAttributeNames() : Collections.emptyEnumeration());
case APPLICATION_SCOPE:
return this.servletContext.getAttributeNames();
default:
throw new IllegalArgumentException("Invalid scope: " + scope);
}
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public Enumeration getInitParameterNames()
{
final Map params = WebXmlUtils.getFilterInitParams( webXmlDoc, filterName );
if ( params == null || params.isEmpty() )
{
return Collections.emptyEnumeration();
}
return Collections.enumeration( params.keySet() );
}
} );
代码示例来源:origin: wildfly/wildfly
public Enumeration elements() {
return added ? Collections.enumeration(getSingletonCollection()) : Collections.emptyEnumeration();
}
代码示例来源:origin: spring-projects/spring-framework
@Override
public Enumeration getAttributeNamesInScope(int scope) {
switch (scope) {
case PAGE_SCOPE:
return getAttributeNames();
case REQUEST_SCOPE:
return this.request.getAttributeNames();
case SESSION_SCOPE:
HttpSession session = this.request.getSession(false);
return (session != null ? session.getAttributeNames() : Collections.emptyEnumeration());
case APPLICATION_SCOPE:
return this.servletContext.getAttributeNames();
default:
throw new IllegalArgumentException("Invalid scope: " + scope);
}
}
代码示例来源:origin: prestodb/presto
@Override
public Enumeration getHeaders(String name)
{
for (Map.Entry> entry : headers.asMap().entrySet()) {
if (entry.getKey().equalsIgnoreCase(name)) {
return enumeration(entry.getValue());
}
}
return emptyEnumeration();
}
代码示例来源:origin: org.apache.ant/ant
base = Collections.emptyEnumeration();
代码示例来源:origin: awslabs/aws-serverless-java-container
@Override
public Enumeration getInitParameterNames() {
return Collections.emptyEnumeration();
}
}
代码示例来源:origin: wildfly/wildfly
} else {
keyStore.load(null, null);
enumeration = Collections.emptyEnumeration();
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
@Override
public Enumeration getKeys() {
return Collections.emptyEnumeration();
}
代码示例来源:origin: wildfly/wildfly
assertFalse(immutability.test(new AtomicLong()));
assertTrue(immutability.test(null));
assertTrue(immutability.test(Collections.emptyEnumeration()));
assertTrue(immutability.test(Collections.emptyIterator()));
assertTrue(immutability.test(Collections.emptyList()));
代码示例来源:origin: apache/servicecomb-java-chassis
@Override
public Enumeration getHeaders(String name) {
List headerValues = httpHeaders.get(name);
if (headerValues == null || headerValues.isEmpty()) {
return Collections.emptyEnumeration();
}
return Collections.enumeration(headerValues);
}
代码示例来源:origin: awslabs/aws-serverless-java-container
@Override
public Enumeration getHeaderNames() {
if (request.getMultiValueHeaders() == null) {
return Collections.emptyEnumeration();
}
return Collections.enumeration(request.getMultiValueHeaders().keySet());
}
代码示例来源:origin: awslabs/aws-serverless-java-container
@Override
public Enumeration getHeaders(String s) {
if (request.getMultiValueHeaders() == null || request.getMultiValueHeaders().get(s) == null) {
return Collections.emptyEnumeration();
}
return Collections.enumeration(request.getMultiValueHeaders().get(s));
}