Example usage for java.util Collections emptyEnumeration

List of usage examples for java.util Collections emptyEnumeration

Introduction

In this page you can find the example usage for java.util Collections emptyEnumeration.

Prototype

@SuppressWarnings("unchecked")
public static <T> Enumeration<T> emptyEnumeration() 

Source Link

Document

Returns an enumeration that has no elements.

Usage

From source file:Main.java

public static Enumeration getMy() {
    String nullFlag = null;// w w w. ja v a2  s .  c o m
    if (nullFlag == null) {
        return Collections.emptyEnumeration();
    }
    return null;
}

From source file:org.talend.dataprep.http.HttpRequestContext.java

public static Enumeration<String> parameters() {
    final RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
    if (attributes != null && attributes instanceof ServletRequestAttributes) {
        return ((ServletRequestAttributes) attributes).getRequest().getParameterNames();
    }//from w  ww.j a v a 2s  .  c o  m
    return Collections.emptyEnumeration();
}

From source file:org.talend.daikon.http.HttpRequestContext.java

/**
 * @return All the current HTTP parameters in current HTTP request or empty enumeration if not in an HTTP context.
 *///from   w w w.  j  ava  2  s.c  om
public static Enumeration<String> parameters() {
    final RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
    if (attributes != null && attributes instanceof ServletRequestAttributes) {
        return ((ServletRequestAttributes) attributes).getRequest().getParameterNames();
    }
    return Collections.emptyEnumeration();
}

From source file:org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.java

@Override
public Enumeration<URL> findResources(String name) throws IOException {
    return Collections.emptyEnumeration();
}

From source file:spring.travel.site.request.RequestInfoInterceptorTest.java

@Test
public void shouldSetRequestInfoAttributeWithIpAddressIfNoCookiePresent() throws Exception {
    Enumeration<String> cookieHeaders = Collections.emptyEnumeration();
    when(request.getHeaders("Cookie")).thenReturn(cookieHeaders);

    assertTrue(interceptor.preHandle(request, response, new Object()));

    verify(request, times(1)).setAttribute(eq(attributeName), requestCaptor.capture());
    Request requestInfo = requestCaptor.getValue();

    assertEquals(Optional.empty(), requestInfo.getCookieValue());
    assertEquals(ipAddress, requestInfo.getRemoteAddress());
    assertEquals(Optional.empty(), requestInfo.getUser());
}

From source file:org.wso2.carbon.identity.auth.service.AuthenticationRequest.java

public Enumeration<String> getHeaders(String name) {
    String headerValue = headers.get(name);
    if (headerValue != null) {
        String[] multiValuedHeader = headerValue.split(",");
        return Collections.enumeration(Arrays.asList(multiValuedHeader));
    } else {/*from   www  .  j  a  va 2s. co m*/
        return Collections.emptyEnumeration();
    }
}

From source file:org.wso2.carbon.identity.gateway.api.request.GatewayRequest.java

public Enumeration<String> getHeaders(String name) {
    String headerValue = (String) headers.get(name);
    if (StringUtils.isNotEmpty(headerValue)) {
        String[] multiValuedHeader = headerValue.split(",");
        return Collections.enumeration(Arrays.asList(multiValuedHeader));
    }/*w ww  .j  a  v  a2  s  . c o  m*/
    return Collections.emptyEnumeration();
}

From source file:io.nebo.container.NettyEmbeddedContext.java

@Override
public Enumeration<Servlet> getServlets() {
    return Collections.emptyEnumeration();
}

From source file:io.nebo.container.NettyEmbeddedContext.java

@Override
public Enumeration<String> getServletNames() {
    return Collections.emptyEnumeration();
}

From source file:io.nebo.container.NettyEmbeddedContext.java

@Override
public Enumeration<String> getInitParameterNames() {
    return Collections.emptyEnumeration();
}