本文整理匯總了Java中com.mercateo.common.rest.schemagen.link.LinkFactory.forCall方法的典型用法代碼示例。如果您正苦於以下問題:Java LinkFactory.forCall方法的具體用法?Java LinkFactory.forCall怎麽用?Java LinkFactory.forCall使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.mercateo.common.rest.schemagen.link.LinkFactory
的用法示例。
在下文中一共展示了LinkFactory.forCall方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createSchemaForSummary
import com.mercateo.common.rest.schemagen.link.LinkFactory; //導入方法依賴的package包/類
private List<Optional<Link>> createSchemaForSummary(SummaryJsonType summaryJson,
LinkFactory<ImplementationType> factoryForImplementation) {
final Optional<Link> selfLink = factoryForImplementation.forCall(Rel.SELF,
r -> r.getSummary(IdParameterBean.of(summaryJson.getId())));
final Optional<Link> canonicalLink = factoryForImplementation.forCall(Rel.CANONICAL,
r -> r.get(IdParameterBean.of(summaryJson.getId())));
final ArrayList<Optional<Link>> result = Lists.newArrayList(selfLink, canonicalLink);
final List<Optional<Link>> additionalLinks = createAdditionalLinksForSummaryType(summaryJson,
factoryForImplementation);
result.addAll(additionalLinks);
return result;
}
示例2: getResponse
import com.mercateo.common.rest.schemagen.link.LinkFactory; //導入方法依賴的package包/類
protected ObjectWithSchema<FullJsonType> getResponse(FullJsonType json) {
final LinkFactory<ImplementationType> factoryForImplementation = getImplementationLinkFactory();
final Optional<Link> selfLink = factoryForImplementation.forCall(Rel.SELF,
r -> r.get(IdParameterBean.of(json.getId())));
final ArrayList<Optional<Link>> result = Lists.newArrayList(selfLink);
final List<Optional<Link>> additionalLinks = createAdditionalLinksForFullType(json, factoryForImplementation);
result.addAll(additionalLinks);
final JsonHyperSchema hyperSchema = JsonHyperSchema.fromOptional(result);
return ObjectWithSchema.create(json, hyperSchema);
}
示例3: getHello
import com.mercateo.common.rest.schemagen.link.LinkFactory; //導入方法依賴的package包/類
@GET
public String getHello() {
final LinkFactory<HelloResource> linkFactory = linkMetaFactory.createFactoryFor(HelloResource.class);
linkFactory.forCall(Rel.SELF, HelloResource::getHello);
return "Hello World!";
}