當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。