Package org.springframework.hateoas

Examples of org.springframework.hateoas.LinkBuilder.slash()


      for (ParameterMetadata metadata : mapping.getParametersMetadata()) {
        variables = variables.concat(new TemplateVariable(metadata.getName(), VariableType.REQUEST_PARAM));
      }

      String href = builder.slash(mapping.getPath()).toString().concat(variables.toString());

      Link link = new Link(href, mapping.getRel());

      if (mapping.isPagingResource()) {
        link = assembler.appendPaginationParameterTemplates(link);
View Full Code Here


    List<PersonResource> result = assembler.toResources(Arrays.asList(first, second));

    LinkBuilder builder = linkTo(PersonController.class);

    PersonResource firstResource = new PersonResource();
    firstResource.add(builder.slash(1L).withSelfRel());

    PersonResource secondResource = new PersonResource();
    secondResource.add(builder.slash(1L).withSelfRel());

    assertThat(result.size(), is(2));
View Full Code Here

    PersonResource firstResource = new PersonResource();
    firstResource.add(builder.slash(1L).withSelfRel());

    PersonResource secondResource = new PersonResource();
    secondResource.add(builder.slash(1L).withSelfRel());

    assertThat(result.size(), is(2));
    assertThat(result, hasItems(firstResource, secondResource));
  }
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.