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());
}
Aggregations