本文整理汇总了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!";
}