當前位置: 首頁>>代碼示例>>Java>>正文


Java Resources.getContent方法代碼示例

本文整理匯總了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();
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-skipper,代碼行數:13,代碼來源:RepositoryCommands.java

示例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();
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-skipper,代碼行數:12,代碼來源:PlatformCommands.java

示例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;
}
 
開發者ID:Azure,項目名稱:CityPower-Build-Sample,代碼行數:13,代碼來源:IncidentServiceImpl.java

示例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;
}
 
開發者ID:Azure,項目名稱:CityPower-Build-Sample,代碼行數:13,代碼來源:IncidentServiceImpl.java

示例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);
}
 
開發者ID:ftsakiris,項目名稱:async-engine,代碼行數:14,代碼來源:ResourcesMapper.java

示例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);
}
 
開發者ID:juleswhite,項目名稱:CSX278,代碼行數:14,代碼來源:ResourcesMapper.java

示例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)));
}
 
開發者ID:ImmobilienScout24,項目名稱:switchman,代碼行數:10,代碼來源:AbTestDecisionRestServiceIT.java

示例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);
	}
}
 
開發者ID:royclarkson,項目名稱:spring-a-gram-android,代碼行數:11,代碼來源:PhotoListFragment.java

示例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);
}
 
開發者ID:royclarkson,項目名稱:spring-a-gram-android,代碼行數:9,代碼來源:GalleryPhotoListFragment.java

示例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);
	}
}
 
開發者ID:royclarkson,項目名稱:spring-a-gram-android,代碼行數:11,代碼來源:GalleryListFragment.java

示例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);
	}
}
 
開發者ID:kmbulebu,項目名稱:NickNack,代碼行數:8,代碼來源:PlansEventFiltersController.java

示例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);
	}
}
 
開發者ID:kmbulebu,項目名稱:NickNack,代碼行數:8,代碼來源:PlansController.java

示例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);
	}
}
 
開發者ID:kmbulebu,項目名稱:NickNack,代碼行數:8,代碼來源:PlansStateFiltersController.java

示例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);
	}
}
 
開發者ID:kmbulebu,項目名稱:NickNack,代碼行數:8,代碼來源:ActionsController.java


注:本文中的org.springframework.hateoas.Resources.getContent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。