本文整理匯總了Java中org.springframework.hateoas.Resources.getContent方法的典型用法代碼示例。如果您正苦於以下問題:Java Resources.getContent方法的具體用法?Java Resources.getContent怎麽用?Java Resources.getContent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.hateoas.Resources
的用法示例。
在下文中一共展示了Resources.getContent方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: list
import org.springframework.hateoas.Resources; //導入方法依賴的package包/類
@ShellMethod(key = "repo list", value = "List package repositories")
public Table list() {
Resources<Repository> repositoryResources = this.skipperClient.listRepositories();
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
headers.put("name", "Name");
headers.put("url", "URL");
headers.put("local", "Local");
headers.put("repoOrder", "Order");
TableModel model = new BeanListTableModel<>(repositoryResources.getContent(), headers);
TableBuilder tableBuilder = new TableBuilder(model);
return TableUtils.applyStyle(tableBuilder).build();
}
示例2: list
import org.springframework.hateoas.Resources; //導入方法依賴的package包/類
@ShellMethod(key = "platform list", value = "List platforms")
public Table list() {
Resources<Deployer> repositoryResources = this.skipperClient.listDeployers();
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
headers.put("name", "Name");
headers.put("type", "Type");
headers.put("description", "Description");
TableModel model = new BeanListTableModel<>(repositoryResources.getContent(), headers);
TableBuilder tableBuilder = new TableBuilder(model);
return TableUtils.applyStyle(tableBuilder).build();
}
示例3: getAllIncidents
import org.springframework.hateoas.Resources; //導入方法依賴的package包/類
@Override
public List<IncidentBean> getAllIncidents() {
LOG.info("Performing get {} web service", applicationProperties.getIncidentApiUrl() +"/incidents");
final String restUri = applicationProperties.getIncidentApiUrl() +"/incidents";
ResponseEntity<Resources<IncidentBean>> response = restTemplate.exchange(restUri, HttpMethod.GET, null,
new ParameterizedTypeReference<Resources<IncidentBean>>() {});
// LOG.info("Total Incidents {}", response.getBody().size());
Resources<IncidentBean> beanResources = response.getBody();
Collection<IncidentBean> beanCol = beanResources.getContent();
ArrayList<IncidentBean> beanList= new ArrayList<IncidentBean>(beanCol);
return beanList;
}
示例4: getAllIncidents
import org.springframework.hateoas.Resources; //導入方法依賴的package包/類
@Override
public List<IncidentBean> getAllIncidents() {
LOG.info("Performing get {} web service", applicationProperties.getIncidentApiUrl() +"/incidents");
final String restUri = applicationProperties.getIncidentApiUrl() +"/incidents";
ResponseEntity<Resources<IncidentBean>> response = restTemplate.exchange(restUri, HttpMethod.GET, null,
new ParameterizedTypeReference<Resources<IncidentBean>>() {});
Resources<IncidentBean> beanResources = response.getBody();
Collection<IncidentBean> beanCol = beanResources.getContent();
ArrayList<IncidentBean> beanList= new ArrayList<IncidentBean>(beanCol);
LOG.info("Total Incidents {}", beanList.size());
return beanList;
}
示例5: serialize
import org.springframework.hateoas.Resources; //導入方法依賴的package包/類
@Override
public void serialize(
Resources value, JsonGenerator jgen, SerializerProvider provider)
throws IOException, JsonProcessingException
{
// Extracted the actual data inside of the Resources object that we care about
Object content = value.getContent();
// Instead of all of the Resources member variables, etc.
// Just mashall the actual content into the JSON
JsonSerializer<Object> s = provider.findValueSerializer(content.getClass(), null);
s.serialize(content, jgen, provider);
}
示例6: serialize
import org.springframework.hateoas.Resources; //導入方法依賴的package包/類
@Override
public void serialize(Resources value, JsonGenerator jgen,
SerializerProvider provider) throws IOException,
JsonProcessingException {
// Extracted the actual data inside of the Resources object
// that we care about (e.g., the list of Video objects)
Object content = value.getContent();
// Instead of all of the Resources member variables, etc.
// Just mashall the actual content (Videos) into the JSON
JsonSerializer<Object> s = provider.findValueSerializer(
content.getClass(), null);
s.serialize(content, jgen, provider);
}
示例7: thenAllCreatedTestDecisionsCanBeDeserialized
import org.springframework.hateoas.Resources; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void thenAllCreatedTestDecisionsCanBeDeserialized() {
Resources<AbTestDecision> body = (Resources<AbTestDecision>) response.getBody();
Collection<AbTestDecision> respondedDecisions = body.getContent();
assertThat(respondedDecisions,
contains(
abTestDecisionWithSsoIdAndVariant(FIRST_USER_SSO_ID, FIRST_USER_VARIANT),
abTestDecisionWithSsoIdAndVariant(SECOND_USER_SSO_ID, SECOND_USER_VARIANT)));
}
示例8: refreshPhotoList
import org.springframework.hateoas.Resources; //導入方法依賴的package包/類
private void refreshPhotoList(Resources resources) {
if (resources != null) {
List<ItemResource> photos = new ArrayList<ItemResource>(resources.getContent());
if (null != this.photoListFragmentListener) {
this.photoListFragmentListener.onDownloadPhotosComplete(photos);
}
listAdapter = new PhotoListAdapter(getActivity(), photos);
listView.setAdapter(listAdapter);
}
}
示例9: refreshPhotoList
import org.springframework.hateoas.Resources; //導入方法依賴的package包/類
private void refreshPhotoList(Resources resources) {
List<ItemResource> photos = new ArrayList<ItemResource>(resources.getContent());
if (null != this.galleryPhotoListFragmentListener) {
this.galleryPhotoListFragmentListener.onDownloadGalleryPhotosComplete(photos);
}
listAdapter = new PhotoListAdapter(getActivity(), photos);
listView.setAdapter(listAdapter);
}
示例10: refreshGalleryList
import org.springframework.hateoas.Resources; //導入方法依賴的package包/類
private void refreshGalleryList(Resources resources) {
if (resources != null) {
List<GalleryResource> galleries = new ArrayList<GalleryResource>(resources.getContent());
if (null != this.galleryListFragmentListener) {
this.galleryListFragmentListener.onDownloadGalleriesComplete(galleries);
}
ListAdapter listAdapter = new GalleryListAdapter(getActivity(), galleries);
setListAdapter(listAdapter);
}
}
示例11: addLinks
import org.springframework.hateoas.Resources; //導入方法依賴的package包/類
private void addLinks(UUID planUuid, Resources<EventFilterResource> resources) throws PlanNotFoundException, EventFilterNotFoundException {
resources.add(linkTo(methodOn(PlansEventFiltersController.class).getEventFilters(planUuid)).withSelfRel());
for (EventFilterResource resource : resources.getContent()) {
addLinks(planUuid, resource);
}
}
示例12: addLinks
import org.springframework.hateoas.Resources; //導入方法依賴的package包/類
private void addLinks(Resources<PlanResource> resources) throws PlanNotFoundException, ActionNotFoundException, EventFilterNotFoundException, StateFilterNotFoundException {
resources.add(entityLinks.linkToCollectionResource(PlanResource.class));
for (PlanResource resource : resources.getContent()) {
addLinks(resource);
}
}
示例13: addLinks
import org.springframework.hateoas.Resources; //導入方法依賴的package包/類
private void addLinks(UUID planUuid, Resources<StateFilterResource> resources) throws StateFilterNotFoundException, PlanNotFoundException {
resources.add(linkTo(methodOn(PlansStateFiltersController.class).getStateFilters(planUuid)).withSelfRel());
for (StateFilterResource resource : resources.getContent()) {
addLinks(planUuid, resource);
}
}
示例14: addLinks
import org.springframework.hateoas.Resources; //導入方法依賴的package包/類
private void addLinks(Resources<ActionResource> resources) throws ActionNotFoundException {
resources.add(linkTo(methodOn(ActionsController.class).getActions()).withSelfRel());
for (ActionResource resource : resources.getContent()) {
addLinks(resource);
}
}