List of usage examples for java.util Collections emptyList
@SuppressWarnings("unchecked") public static final <T> List<T> emptyList()
From source file:newcontroller.handler.impl.DefaultResponse.java
public DefaultResponse(HttpServletResponse response, List<HttpMessageConverter<?>> converters) { this.response = response; this.converters = (converters == null ? Collections.emptyList() : converters); }
From source file:com.gargoylesoftware.htmlunit.FailingHttpStatusCodeExceptionTest.java
/** * @throws Exception if the test fails/*w w w. j a va2 s. com*/ */ @Test public void constructorWithWebResponse() throws Exception { final List<NameValuePair> emptyList = Collections.emptyList(); final WebResponseData webResponseData = new WebResponseData(ArrayUtils.EMPTY_BYTE_ARRAY, HttpStatus.SC_NOT_FOUND, "not found", emptyList); final WebResponse webResponse = new WebResponse(webResponseData, URL_FIRST, HttpMethod.GET, 10); final FailingHttpStatusCodeException e = new FailingHttpStatusCodeException(webResponse); assertEquals(webResponse, e.getResponse()); assertEquals(webResponse.getStatusMessage(), e.getStatusMessage()); assertEquals(webResponse.getStatusCode(), e.getStatusCode()); assertTrue("message doesn't contain failing url", e.getMessage().indexOf(URL_FIRST.toExternalForm()) > -1); }
From source file:flex2.compiler.util.IteratorList.java
public Iterator toIterator() { switch (size()) { case 0:// w w w.j ava 2 s . c o m return Collections.emptyList().iterator(); case 1: return get(0); default: return new IteratorChain(this); } }
From source file:jp.xet.uncommons.spring.EmptyPage.java
@Override public List<T> getContent() { return Collections.emptyList(); }
From source file:com.warsaw.data.service.PlaceService.java
private List<Place> getAllSleepingPlaces() { sleepingPlaces = new ArrayList<>(); JSONObject json = this.getJsonFromURL( "https://api.um.warszawa.pl/api/action/wfsstore_get/?id=f019448f-951c-439e-bf37-c3268682752e&&apikey=6259fbb5-468a-476c-be8c-10da5c20ad7a"); try {/* ww w. j a va 2 s .c o m*/ sleepingPlaces = this.getAnyPlaces(json, 4, 8); } catch (Exception e) { return Collections.emptyList(); } return sleepingPlaces; }
From source file:com.haulmont.cuba.restapi.CommitRequest.java
public Collection getRemoveInstances() { return removeInstances == null ? Collections.emptyList() : removeInstances; }
From source file:org.avidj.zuul.rs.ZuulTest.java
@Test public void itShallCreateShallowReadLockOnRoot() { final Zuul zuul = createZuul(); given().standaloneSetup(zuul).param("t", "r").param("s", "s").when().put("/s/1/").then() .statusCode(HttpStatus.CREATED.value()); given().standaloneSetup(zuul).when().get("/s/1/").then().statusCode(HttpStatus.OK.value()).and() .body("key", hasItem(Collections.emptyList())).and().body("session", hasItem("1")).and() .body("type", hasItem("READ")).and().body("scope", hasItem("SHALLOW")).and() .body("count", hasItem(1)); }
From source file:com.espertech.esper.antlr.ASTUtil.java
public static List<Tree> findAllNodes(Tree parent, int type) { List<Tree> result = null; for (int i = 0; i < parent.getChildCount(); i++) { Tree child = parent.getChild(i); if (child.getType() == type) { if (result == null) { result = new ArrayList<Tree>(); }//from w w w .j a v a 2s .co m result.add(child); } } if (result == null) { return Collections.emptyList(); } return result; }
From source file:org.leandreck.endpoints.examples.abstractbase.PersonEndpoint.java
@RequestMapping(value = "/{id}/neighbours", method = GET, produces = APPLICATION_JSON_VALUE) public List<Person> neighbours(@PathVariable String id) { // do something return Collections.emptyList(); }