@Override public boolean isEmpty(PagedResources<?> value) { return value.getContent().size() == 0; }
@Override public boolean hasSingleElement(PagedResources<?> value) { return value.getContent().size() == 1; }
@Override public boolean hasSingleElement(PagedResources<?> value) { return value.getContent().size() == 1; }
@Override public String toString() { return String.format("PagedResource { content: %s, metadata: %s, links: %s }", getContent(), metadata, getLinks()); }
@Override @JsonProperty("hydra:member") @ContextProvider public Collection<T> getContent() { return super.getContent(); }
@Override public String toString() { return String.format("PagedResource { content: %s, metadata: %s, links: %s }", getContent(), metadata, getLinks()); }
/** * Returns the resource entity data for the page currently selected by the paging parameters. The data will be * loaded lazily. * * @return a collection of data objects loaded from the currently selected page of the resource * @throws RestClientException when an error occurred while communicating with the service */ public final Collection<T> getData() throws RestClientException { loadIfNecessary(); return responseEntity.getBody().getContent(); }
public Collection<Item> findAll() { PagedResources<Item> pagedResources = restTemplate.getForObject(catalogURL(), ItemPagedResources.class); return pagedResources.getContent(); }
@ModelAttribute(name = "categories") public List<Category> initCategories() { return new ArrayList<>(categoryService.findByParentIsNull(0, 0, null).getContent()); }
public Collection<Item> findAll() { PagedResources<Item> pagedResources = restTemplate.getForObject(catalogURL(), ItemPagedResources.class); return pagedResources.getContent(); }
@HystrixCommand(fallbackMethod = "getItemsCache", commandProperties = { @HystrixProperty(name = "circuitBreaker.requestVolumeThreshold", value = "2") }) public Collection<Item> findAll() { PagedResources<Item> pagedResources = restTemplate.getForObject( catalogURL(), ItemPagedResources.class); this.itemsCache = pagedResources.getContent(); return pagedResources.getContent(); }
public Collection<Customer> findAll() { PagedResources<Customer> pagedResources = getRestTemplate() .getForObject(customerURL(), CustomerPagedResources.class); return pagedResources.getContent(); }
public Collection<Customer> findAll() { PagedResources<Customer> pagedResources = getRestTemplate().getForObject(customerURL(), CustomerPagedResources.class); return pagedResources.getContent(); }
public Collection<Customer> findAll() { PagedResources<Customer> pagedResources = getRestTemplate().getForObject(customerURL(), CustomerPagedResources.class); return pagedResources.getContent(); }
private List<AppRegistrationResource> findAllAppsByNameAndType(String appName, ApplicationType appType) { return appRegistryOperations().list().getContent().stream() .filter(a -> a.getName().equals(appName)) .filter(a -> a.getType().equals(appType.toString())) .collect(Collectors.toList()); }
private List<AppRegistrationResource> findAllAppsByNameAndType(String appName, ApplicationType appType) { return appRegistryOperations().list().getContent().stream() .filter(a -> a.getName().equals(appName)) .filter(a -> a.getType().equals(appType.toString())) .collect(Collectors.toList()); }
public <T> AlfrescoPageContentListWrapper<T> toAlfrescoContentListWrapper(PagedResources<Resource<T>> pagedResources) { Collection<Resource<T>> pagedResourceContent = pagedResources.getContent(); List<AlfrescoContentEntry<T>> baseContent = pagedResourceContent.stream() .map( resource -> new AlfrescoContentEntry<>(resource.getContent()) ).collect(Collectors.toList()); AlfrescoPageMetadata pagination = pageMetadataConverter.toAlfrescoPageMetadata(pagedResources.getMetadata(), baseContent.size()); return AlfrescoPageContentListWrapper.wrap(baseContent, pagination); } }
@CliCommand(value = UNREGISTER_ALL, help = "Unregister all applications") public String unregisterAll() { appRegistryOperations().unregisterAll(); StringBuilder msg = new StringBuilder() .append("Successfully unregistered applications."); PagedResources<AppRegistrationResource> appRegistrationResources = appRegistryOperations().list(); if (!appRegistrationResources.getContent().isEmpty()) { msg.append(" The following were not unregistered as they are associated with an existing stream:"); for(AppRegistrationResource appRegistrationResource : appRegistrationResources) { msg.append(String.format(" [%s:%s:%s]", appRegistrationResource.getName(), appRegistrationResource.getType(), appRegistrationResource.getVersion())); } } return msg.toString(); }
@HystrixCommand(fallbackMethod = "defaultUsers") Observable<Resource<User>> getUsers() { PagedResources<Resource<User>> users = traverson.create("myfeed-user").follow("users").toObject(TYPE_PAGED_USERS); return Observable.from(users.getContent()); }
public <R extends ResourceSupport> PagedResources<R> toResource(Pageable pageable, Page<T> page, ResourceAssembler<T, R> assembler) { PagedResources<R> pagedResources = toResource(page, assembler); ExtendedPageMetadata extendedPageMetadata = extendedPageMetadataConverter.toExtendedPageMetadata(pageable.getOffset(), pagedResources.getMetadata()); pagedResources = new PagedResources<>(pagedResources.getContent(), extendedPageMetadata, pagedResources.getLinks()); return pagedResources; } }