当前位置: 首页>>代码示例>>Java>>正文


Java LinkFactory类代码示例

本文整理汇总了Java中com.mercateo.common.rest.schemagen.link.LinkFactory的典型用法代码示例。如果您正苦于以下问题:Java LinkFactory类的具体用法?Java LinkFactory怎么用?Java LinkFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LinkFactory类属于com.mercateo.common.rest.schemagen.link包,在下文中一共展示了LinkFactory类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: FactsObserver

import com.mercateo.common.rest.schemagen.link.LinkFactory; //导入依赖的package包/类
public FactsObserver(@NonNull EventOutput eventOutput,
        @NonNull LinkFactory<FactsResource> linkFatory,
        @NonNull HyperSchemaCreator hyperSchemaCreator, @NonNull URI baseURI,
        @NonNull AtomicReference<Subscription> subcription,
        @NonNull FactTransformer factTransformer, boolean fullOutputMode) {
    super();

    this.fullOutputMode = fullOutputMode;
    this.eventOutput = eventOutput;
    this.linkFatory = linkFatory;
    this.hyperSchemaCreator = hyperSchemaCreator;
    this.subcription = subcription;
    this.factTransformer = factTransformer;
    // this is need, because we are nor in requestscope anymore
    this.linkFactoryContext = new LinkFactoryContext() {

        @Override
        public MethodCheckerForLink getMethodCheckerForLink() {
            return m -> true;
        }

        @Override
        public FieldCheckerForSchema getFieldCheckerForSchema() {
            return (f, c) -> true;
        }

        @Override
        public URI getBaseUri() {
            return baseURI;
        }
    };
}
 
开发者ID:uweschaefer,项目名称:factcast,代码行数:33,代码来源:FactsObserver.java

示例2: FactsObserverFactory

import com.mercateo.common.rest.schemagen.link.LinkFactory; //导入依赖的package包/类
@VisibleForTesting
FactsObserverFactory(@NonNull LinkFactory<FactsResource> factsResourceLinkFactory,
        @NonNull HyperSchemaCreator hyperSchemaCreator,
        @NonNull FactTransformer factTransformer,
        @NonNull ScheduledExecutorService executorService, int waitSecondsForCleanUpCheck) {
    this.factsResourceLinkFactory = factsResourceLinkFactory;
    this.hyperSchemaCreator = hyperSchemaCreator;
    this.factTransformer = factTransformer;
    this.executorService = executorService;
    this.waitSecondsForCleanUpCheck = waitSecondsForCleanUpCheck;
}
 
开发者ID:uweschaefer,项目名称:factcast,代码行数:12,代码来源:FactsObserverFactory.java

示例3: getListing

import com.mercateo.common.rest.schemagen.link.LinkFactory; //导入依赖的package包/类
@SuppressWarnings("boxing")
@GET
@Produces(MediaType.APPLICATION_JSON)
public PaginatedResponse<SummaryJsonType> getListing(@BeanParam @NotNull @Valid SearchQueryBean searchQueryBean) {
	final ListingResult<SummaryJsonType> summaries = getSummaryListing(searchQueryBean);

	final LinkFactory<ImplementationType> lf = getImplementationLinkFactory();

	final List<ObjectWithSchema<SummaryJsonType>> listForResponse = summaries.getResultList().stream()
			.map(r -> getResponse(r, lf)).collect(Collectors.toList());

	List<Link> links = Lists.newArrayList();
	lf.forCall(REL_INSTANCE, r -> r.get(IdParameterBean.of(null))).ifPresent(links::add);
	int offset = searchQueryBean.getOffset();
	int limit = searchQueryBean.getLimit();
	PaginationLinkBuilder paginationLinkBuilder = PaginationLinkBuilder.of(summaries.getTotalNumberOfHits(),
			searchQueryBean.getOffset(), searchQueryBean.getLimit());
	links.addAll(paginationLinkBuilder.generateLinks((rel, off, lim) -> {
		searchQueryBean.setLimit(lim);
		searchQueryBean.setOffset(off);
		return lf.forCall(rel, r -> r.getListing(searchQueryBean));
	}));
	links.addAll(createAdditionalLinksForListing(searchQueryBean));

	return PaginatedResponse.create(listForResponse, summaries.getTotalNumberOfHits(), offset, limit,
			JsonHyperSchema.from(links));
}
 
开发者ID:Mercateo,项目名称:rest-jersey-utils,代码行数:28,代码来源:AbstractListingResource.java

示例4: 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;
}
 
开发者ID:Mercateo,项目名称:rest-jersey-utils,代码行数:15,代码来源:AbstractListingResource.java

示例5: 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);
}
 
开发者ID:Mercateo,项目名称:rest-jersey-utils,代码行数:15,代码来源:AbstractListingResource.java

示例6: rootResourceLinkFactory

import com.mercateo.common.rest.schemagen.link.LinkFactory; //导入依赖的package包/类
@Bean
LinkFactory<RootResource> rootResourceLinkFactory(LinkMetaFactory linkMetaFactory) {
    return linkMetaFactory.createFactoryFor(RootResource.class);
}
 
开发者ID:uweschaefer,项目名称:factcast,代码行数:5,代码来源:FactCastRestConfiguration.java

示例7: transactionsResourceLinkFactory

import com.mercateo.common.rest.schemagen.link.LinkFactory; //导入依赖的package包/类
@Bean
LinkFactory<FactsTransactionsResource> transactionsResourceLinkFactory(
        LinkMetaFactory linkMetaFactory) {
    return linkMetaFactory.createFactoryFor(FactsTransactionsResource.class);
}
 
开发者ID:uweschaefer,项目名称:factcast,代码行数:6,代码来源:FactCastRestConfiguration.java

示例8: factsResourceLinkFactory

import com.mercateo.common.rest.schemagen.link.LinkFactory; //导入依赖的package包/类
@Bean
LinkFactory<FactsResource> factsResourceLinkFactory(LinkMetaFactory linkMetaFactory) {
    return linkMetaFactory.createFactoryFor(FactsResource.class);
}
 
开发者ID:uweschaefer,项目名称:factcast,代码行数:5,代码来源:FactCastRestConfiguration.java

示例9: getImplementationLinkFactory

import com.mercateo.common.rest.schemagen.link.LinkFactory; //导入依赖的package包/类
protected LinkFactory<ImplementationType> getImplementationLinkFactory() {
	return linkMetaFactory.createFactoryFor(implementationClass);
}
 
开发者ID:Mercateo,项目名称:rest-jersey-utils,代码行数:4,代码来源:AbstractListingResource.java

示例10: createAdditionalLinksForSummaryType

import com.mercateo.common.rest.schemagen.link.LinkFactory; //导入依赖的package包/类
protected List<Optional<Link>> createAdditionalLinksForSummaryType(SummaryJsonType summaryJson,
		LinkFactory<ImplementationType> factoryForImplementation) {
	return new ArrayList<>();
}
 
开发者ID:Mercateo,项目名称:rest-jersey-utils,代码行数:5,代码来源:AbstractListingResource.java

示例11: createAdditionalLinksForFullType

import com.mercateo.common.rest.schemagen.link.LinkFactory; //导入依赖的package包/类
protected List<Optional<Link>> createAdditionalLinksForFullType(FullJsonType json,
		LinkFactory<ImplementationType> factoryForImplementation) {
	return new ArrayList<Optional<Link>>();
}
 
开发者ID:Mercateo,项目名称:rest-jersey-utils,代码行数:5,代码来源:AbstractListingResource.java

示例12: 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!";
}
 
开发者ID:Mercateo,项目名称:rest-schemagen,代码行数:7,代码来源:LinkFactoryResourceConfigTest.java

示例13: createLinkFactory

import com.mercateo.common.rest.schemagen.link.LinkFactory; //导入依赖的package包/类
@Benchmark
public static void createLinkFactory() {
    final LinkFactory<ResourceClass> linkFactory = linkMetaFactory.createFactoryFor(ResourceClass.class);
}
 
开发者ID:Mercateo,项目名称:rest-schemagen,代码行数:5,代码来源:Benchmarks.java


注:本文中的com.mercateo.common.rest.schemagen.link.LinkFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。