Package org.springframework.hateoas

Examples of org.springframework.hateoas.Resources


      Page<Object> page = (Page<Object>) result;
      return entitiesToResources(page, assembler, baseLink);
    } else if (result instanceof Iterable) {
      return entitiesToResources((Iterable<Object>) result, assembler);
    } else if (null == result) {
      return new Resources(EMPTY_RESOURCE_LIST);
    } else {
      Resource<Object> resource = assembler.toFullResource(result);
      return new Resources(Collections.singletonList(resource));
    }
  }
View Full Code Here


        if (result instanceof Iterable) {
            return entitiesToResources((Iterable<Object>) result, assembler);
        }

        if (null == result) {
            return new Resources(EMPTY_RESOURCE_LIST);
        }

        Resource<Object> resource = assembler.toResource(result);
        return new Resources(singletonList(resource));
    }
View Full Code Here

    protected Resources<Resource<Object>> entitiesToResources(Iterable<Object> entities, PersistentEntityResourceAssembler assembler) {
        List<Resource<Object>> resources = newArrayList();
        for (Object obj : entities) {
            resources.add(obj == null ? null : assembler.toResource(obj));
        }
        return new Resources(resources);
    }
View Full Code Here

TOP

Related Classes of org.springframework.hateoas.Resources

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.