Package com.theoryinpractise.halbuilder.api

Examples of com.theoryinpractise.halbuilder.api.ReadableRepresentation


    String hal = HalHmacResourceFactory.INSTANCE
      .newClientResource(locale, path)
      .get(String.class);

    // Read the HAL
    ReadableRepresentation rr = unmarshalHal(hal);

    // Extract the list of items
    List<ItemDto> clientItems = Lists.newArrayList();
    for (Map.Entry<String, ReadableRepresentation> itemResource : rr.getResources()) {

      List<Link> links = itemResource.getValue().getLinks();

      ItemDto clientItem = ClientItemHandler.buildClientItem(itemResource.getValue().getProperties(), links);
View Full Code Here


    String hal = HalHmacResourceFactory.INSTANCE
      .newUserResource(locale, path, clientUser)
      .get(String.class);

    // Read the HAL
    ReadableRepresentation rr = unmarshalHal(hal);

    Map<String, Object> properties = rr.getProperties();

    return buildClientCartNoItems(properties);
  }
View Full Code Here

    String hal = HalHmacResourceFactory.INSTANCE
      .newUserResource(locale, path, clientUser)
      .get(String.class);

    // Read the HAL
    ReadableRepresentation rr = unmarshalHal(hal);

    Map<String, Object> properties = rr.getProperties();

    return buildClientCart(rr, properties);
  }
View Full Code Here

      .newUserResource(locale, path, clientUser)
      .entity(updateCartRequest, MediaType.APPLICATION_JSON_TYPE)
      .put(String.class);

    // Read the HAL
    ReadableRepresentation rr = unmarshalHal(hal);

    Map<String, Object> properties = rr.getProperties();

    return buildClientCart(rr, properties);
  }
View Full Code Here

    String hal = HalHmacResourceFactory.INSTANCE
      .newClientResource(locale, path)
      .get(String.class);

    // Read the HAL
    ReadableRepresentation rr = unmarshalHal(hal);

    Map<String, Object> properties = rr.getProperties();
    List<Link> links = rr.getLinks();

    ItemDto item = buildClientItem(properties, links);

    return Optional.of(item);
  }
View Full Code Here

      .newClientResource(locale, path)
      .entity(entity, HalMediaType.APPLICATION_JSON_TYPE)
      .post(String.class);

    // Read the HAL
    ReadableRepresentation rr = unmarshalHal(hal);

    Map<String, Object> properties = rr.getProperties();

    UserDto clientUser = new UserDto();
    String apiKey = (String) properties.get("api_key");
    String secretKey = (String) properties.get("secret_key");
View Full Code Here

    String hal = HalHmacResourceFactory.INSTANCE
      .newClientResource(locale, path)
      .post(String.class);

    // Read the HAL
    ReadableRepresentation rr = unmarshalHal(hal);

    Map<String, Object> properties = rr.getProperties();

    UserDto clientUser = new UserDto();
    String apiKey = (String) properties.get("api_key");
    String secretKey = (String) properties.get("secret_key");
View Full Code Here

      .newClientResource(locale, path)
      .entity(entity, HalMediaType.APPLICATION_JSON_TYPE)
      .post(String.class);

    // Read the HAL
    ReadableRepresentation rr = unmarshalHal(hal);

    Map<String, Object> properties = rr.getProperties();

    UserDto clientUser = new UserDto();
    String apiKey = (String) properties.get("api_key");
    String secretKey = (String) properties.get("secret_key");
View Full Code Here

    String hal = HalHmacResourceFactory.INSTANCE
      .newUserResource(locale, path, clientUser)
      .get(String.class);

    // Read the HAL
    ReadableRepresentation rr = unmarshalHal(hal);

    Map<String, Object> properties = rr.getProperties();

    CustomerUserDto customerUser = new CustomerUserDto();
    // Mandatory properties (will cause IllegalStateException if not present)
    // Optional direct properties
    // Optional properties
View Full Code Here

      .newClientResource(locale, path)
      .entity(entity, HalMediaType.APPLICATION_JSON_TYPE)
      .post(String.class);

    // Read the HAL
    ReadableRepresentation rr = unmarshalHal(hal);

    Map<String, Object> properties = rr.getProperties();

    UserDto clientUser = new UserDto();
    String apiKey = (String) properties.get("api_key");
    String secretKey = (String) properties.get("secret_key");
View Full Code Here

TOP

Related Classes of com.theoryinpractise.halbuilder.api.ReadableRepresentation

Copyright © 2018 www.massapicom. 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.