Search in sources :

Example 1 with PackageDataAttributes

use of org.folio.rest.jaxrs.model.PackageDataAttributes in project mod-kb-ebsco-java by folio-org.

the class PackageCollectionItemConverter method convert.

@Override
public PackageCollectionItem convert(@NonNull PackageData packageData) {
    Integer providerId = packageData.getVendorId();
    String providerName = packageData.getVendorName();
    Integer packageId = packageData.getPackageId();
    return new PackageCollectionItem().withId(providerId + "-" + packageId).withType(PACKAGES_TYPE).withAttributes(new PackageDataAttributes().withContentType(contentTypes.get(packageData.getContentType().toLowerCase())).withCustomCoverage(new Coverage().withBeginCoverage(packageData.getCustomCoverage().getBeginCoverage()).withEndCoverage(packageData.getCustomCoverage().getEndCoverage())).withIsCustom(packageData.getIsCustom()).withIsSelected(packageData.getIsSelected()).withName(packageData.getPackageName()).withPackageId(packageId).withPackageType(packageData.getPackageType()).withProviderId(providerId).withProviderName(providerName).withSelectedCount(packageData.getSelectedCount()).withTitleCount(packageData.getTitleCount()).withAllowKbToAddTitles(packageData.getAllowEbscoToAddTitles()).withVisibilityData(new VisibilityData().withIsHidden(packageData.getVisibilityData().getIsHidden()).withReason(packageData.getVisibilityData().getReason().equals("Hidden by EP") ? "Set by system" : ""))).withRelationships(createEmptyPackageRelationship());
}
Also used : PackageCollectionItem(org.folio.rest.jaxrs.model.PackageCollectionItem) PackageDataAttributes(org.folio.rest.jaxrs.model.PackageDataAttributes) Coverage(org.folio.rest.jaxrs.model.Coverage) VisibilityData(org.folio.rest.jaxrs.model.VisibilityData)

Aggregations

Coverage (org.folio.rest.jaxrs.model.Coverage)1 PackageCollectionItem (org.folio.rest.jaxrs.model.PackageCollectionItem)1 PackageDataAttributes (org.folio.rest.jaxrs.model.PackageDataAttributes)1 VisibilityData (org.folio.rest.jaxrs.model.VisibilityData)1