Examples of replaceMatrixParam()


Examples of javax.ws.rs.core.UriBuilder.replaceMatrixParam()

   {
      URI bu = UriBuilder.fromUri("http://localhost:8080/a/b/c;a=x;b=y").
              replaceMatrix("x=a;y=b").build();
      Assert.assertEquals(URI.create("http://localhost:8080/a/b/c;x=a;y=b"), bu);
      UriBuilder builder = UriBuilder.fromUri("http://localhost:8080/a").path("/{b:A{0:10}}/c;a=x;b=y");
      builder.replaceMatrixParam("a", "1", "2");
      bu = builder.build("b");
      Assert.assertEquals(URI.create("http://localhost:8080/a/b/c;b=y;a=1;a=2"), bu);
   }

   @Test
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.replaceMatrixParam()

        for (Map.Entry<String, Object> p : queryParams.entrySet()) {
            uriBuilder.replaceQueryParam(p.getKey(), p.getValue());
        }
        for (Map.Entry<String, Object> p : matrixParams.entrySet()) {
            uriBuilder.replaceMatrixParam(p.getKey(), p.getValue());
        }

        uri = uriBuilder.buildFromMap(pathParams);
        Resource resource = restClient.resource(uri);
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.replaceMatrixParam()

        public WebTarget matrixParam(String name, Object... values) {
            checkNullValues(name, values);
           
            UriBuilder thebuilder = getUriBuilder();
            if (values == null || values.length == 1 && values[0] == null) {
                thebuilder.replaceMatrixParam(name, (Object[])null);
            } else {
                thebuilder.matrixParam(name, values);
            }
            return newWebTarget(thebuilder);
        }
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.replaceMatrixParam()

        builder.matrixParam("{matvar1}", "{var1}");
        uriString = builder.build("val2", "mat1").toString();
        assertEquals("path1;mat1=val1;mat2=val2;mat1=val2", uriString);

        builder.replaceMatrixParam("mat1", "val5");
        uriString = builder.build("val2", "mat1").toString();
        assertEquals("path1;mat1=val5;mat2=val2;mat1=val2", uriString);
    }

    public void testQuery() throws Exception {
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.replaceMatrixParam()

        for (Map.Entry<String, Object> p : queryParams.entrySet()) {
            uriBuilder.replaceQueryParam(p.getKey(), p.getValue());
        }
        for (Map.Entry<String, Object> p : matrixParams.entrySet()) {
            uriBuilder.replaceMatrixParam(p.getKey(), p.getValue());
        }

        uri = uriBuilder.buildFromMap(pathParams);
        Resource resource = restClient.resource(uri);
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.replaceMatrixParam()

        for (Map.Entry<String, Object> p : queryParams.entrySet()) {
            uriBuilder.replaceQueryParam(p.getKey(), p.getValue());
        }
        for (Map.Entry<String, Object> p : matrixParams.entrySet()) {
            uriBuilder.replaceMatrixParam(p.getKey(), p.getValue());
        }

        uri = uriBuilder.buildFromMap(pathParams);
        Resource resource = restClient.resource(uri);
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.replaceMatrixParam()

        builder.matrixParam("{matvar1}", "{var1}");
        uriString = builder.build("val2", "mat1").toString();
        assertEquals("path1;mat1=val1;mat2=val2;mat1=val2", uriString);

        builder.replaceMatrixParam("mat1", "val5");
        uriString = builder.build("val2", "mat1").toString();
        assertEquals("path1;mat1=val5;mat2=val2;mat1=val2", uriString);
    }

    public void testQuery() throws Exception {
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.replaceMatrixParam()

    }

    @Test
    public void testReplaceMatrixParamWithNull() {
        UriBuilder builder = new UriBuilderImpl().matrixParam("matrix", "param1", "param2");
        builder.replaceMatrixParam("matrix", (Object[]) null);
        assertEquals(builder.build().toString(), "");
    }

    @Test
    public void testReplaceNullMatrixParam() {
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.replaceMatrixParam()

        builder.matrixParam("{matvar1}", "{var1}");
        uriString = builder.build("val2", "mat1").toString();
        assertEquals("path1;mat1=val1;mat2=val2;mat1=val2", uriString);

        builder.replaceMatrixParam("mat1", "val5");
        uriString = builder.build("val2", "mat1").toString();
        assertEquals("path1;mat1=val5;mat2=val2;mat1=val2", uriString);
    }

    public void testQuery() throws Exception {
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.replaceMatrixParam()

        public WebTarget matrixParam(String name, Object... values) {
            checkNullValues(name, values);
           
            UriBuilder thebuilder = getUriBuilder();
            if (values == null || values.length == 1 && values[0] == null) {
                thebuilder.replaceMatrixParam(name, (Object[])null);
            } else {
                thebuilder.matrixParam(name, values);
            }
            return newWebTarget(thebuilder);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.