Package com.theoryinpractise.halbuilder.api

Examples of com.theoryinpractise.halbuilder.api.Representation.withLink()


        .queryParam("pn", pagination.getCurrentPage())
        .queryParam("ps",pagination.getResultsPerPage())
        .build();

      representation = factory.newRepresentation(paginatedSelf);
      representation
        .withLink("first", UriBuilder
          .fromUri(self)
          .queryParam("pn", 1)
          .queryParam("ps", pagination.getResultsPerPage())
          .build())
View Full Code Here


      representation = factory.newRepresentation(self);
    }

    // Add any links
    for (Map.Entry<String, String> entry : links.entrySet()) {
      representation.withLink(entry.getKey(), entry.getValue());
    }

    // Add the bean
    if (beanOptional.isPresent()) {
      representation.withBean(beanOptional.get());
View Full Code Here

      LocalisedText primaryDetail = itemFieldDetail.getPrimaryDetail();

      // TODO Consider how i18n will be transmitted
      // Consider filtering on Locale
      if (isLink) {
        userRepresentation.withLink(propertyName,primaryDetail.getContent());
      } else {
        userRepresentation.withProperty(propertyName, primaryDetail.getContent());
      }
      Set<LocalisedText> secondaryDetails = itemFieldDetail.getSecondaryDetails();
      // TODO Consider if a 1-based field index is the best representation here: array? sub-resource?
View Full Code Here

      Set<LocalisedText> secondaryDetails = itemFieldDetail.getSecondaryDetails();
      // TODO Consider if a 1-based field index is the best representation here: array? sub-resource?
      int index = 1;
      for (LocalisedText secondaryDetail : secondaryDetails) {
        if (isLink) {
          userRepresentation.withLink(propertyName + index,secondaryDetail.getContent());
        } else {
          userRepresentation.withProperty(propertyName + index, secondaryDetail.getContent());
        }
        index++;
      }
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.