public static PriceDraftDsl of(final Price template) { return PriceDraftBuilder.of(template.getValue()) .country(template.getCountry()) .customerGroup(template.getCustomerGroup()) .channel(template.getChannel()) .validFrom(template.getValidFrom()) .validUntil(template.getValidUntil()) .custom(customFieldsDraftOrNull(template)) .build(); }
/** * Creates a new object initialized with the fields of the template parameter. * * @param template the template * @return a new object initialized from the template */ public static ProductVariantDraftBuilder of(final ProductVariant template) { return new ProductVariantDraftBuilder(copyAssets(template.getAssets()), copyAttributes(template.getAttributes()), template.getImages(), template.getKey(), copyPrices(template.getPrices()), template.getSku()); } }
/** * Creates a new object initialized with the fields of the template parameter. * * @param template the template * @return a new object initialized from the template */ public static ProductVariantDraftBuilder of(final ProductVariantDraft template) { return new ProductVariantDraftBuilder(template.getAssets(), template.getAttributes(), template.getImages(), template.getKey(), template.getPrices(), template.getSku()); }
public static PriceBuilder of(final Price template) { return of(template.getValue()) .country(template.getCountry()) .customerGroup(template.getCustomerGroup()) .channel(template.getChannel()) .discounted(template.getDiscounted()) .validFrom(template.getValidFrom()) .validUntil(template.getValidUntil()) .id(template.getId()); }
public static PriceBuilder of(final Price template) { return of(template.getValue()) .country(template.getCountry()) .customerGroup(template.getCustomerGroup()) .channel(template.getChannel()) .discounted(template.getDiscounted()); }
/** * Creates a new object initialized with the fields of the template parameter. * * @param template the template * @return a new object initialized from the template */ public static PriceBuilder of(final Price template) { return new PriceBuilder(template.getChannel(), template.getCountry(), template.getCustom(), template.getCustomerGroup(), template.getDiscounted(), template.getId(), template.getTiers(), template.getValidFrom(), template.getValidUntil(), template.getValue()); } }
public static PriceDraftBuilder of(final PriceDraft template) { return of(template.getValue()) .country(template.getCountry()) .customerGroup(template.getCustomerGroup()) .channel(template.getChannel()) .validFrom(template.getValidFrom()) .validUntil(template.getValidUntil()) .custom(template.getCustom()); }
/** * Creates a new object initialized with the fields of the template parameter. * * @param template the template * @return a new object initialized from the template */ public static ProductDraftBuilder of(final ProductDraft template) { return new ProductDraftBuilder(template.getCategories(), template.getCategoryOrderHints(), template.getDescription(), template.getKey(), template.getMasterVariant(), template.getMetaDescription(), template.getMetaKeywords(), template.getMetaTitle(), template.getName(), template.getProductType(), template.isPublish(), template.getSearchKeywords(), template.getSlug(), template.getState(), template.getTaxCategory(), template.getVariants()); } }
private String getSku(final Product product) { return product.getMasterData().getStaged().getMasterVariant().getSku(); } }
private Attribute attribute(final String attributeName) { return product.getMasterData().getStaged().getMasterVariant().getAttribute(attributeName); } }
private Optional<LocalizedEnumValue> extractAttribute(final Product product, final NamedAttributeAccess<LocalizedEnumValue> namesAccess) { return product.getMasterData().getStaged().getMasterVariant().findAttribute(namesAccess); } }
@Override public boolean isPublished() { return product.getMasterData().isPublished(); } }
ProductToProductProjectionWrapper(final Product product, final ProductProjectionType productProjectionType) { this.product = product; this.productData = product.getMasterData().get(productProjectionType); }
/** * Creates a new object initialized with the fields of the template parameter. * * @param template the template * @return a new object initialized from the template */ public static ProductVariantDraftDsl of(final ProductVariantDraft template) { return new ProductVariantDraftDsl(template.getAssets(), template.getAttributes(), template.getImages(), template.getKey(), template.getPrices(), template.getSku()); } }
/** * Creates a new object initialized with the fields of the template parameter. * * @param template the template * @return a new object initialized from the template */ public static PriceTierBuilder of(final PriceTier template) { return new PriceTierBuilder(template.getMinimumQuantity(), template.getValue()); } }
public static PriceBuilder of(final Price template) { return of(template.getValue()) .country(template.getCountry()) .customerGroup(template.getCustomerGroup()) .channel(template.getChannel()) .discounted(template.getDiscounted()); }
public static PriceDraftBuilder of(final PriceDraft template) { return of(template.getValue()) .country(template.getCountry()) .customerGroup(template.getCustomerGroup()) .channel(template.getChannel()) .validFrom(template.getValidFrom()) .validUntil(template.getValidUntil()) .custom(template.getCustom()); }
/** * Creates a new object initialized with the fields of the template parameter. * * @param template the template * @return a new object initialized from the template */ public static ProductDraftDsl of(final ProductDraft template) { return new ProductDraftDsl(template.getCategories(), template.getCategoryOrderHints(), template.getDescription(), template.getKey(), template.getMasterVariant(), template.getMetaDescription(), template.getMetaKeywords(), template.getMetaTitle(), template.getName(), template.getProductType(), template.isPublish(), template.getSearchKeywords(), template.getSlug(), template.getState(), template.getTaxCategory(), template.getVariants()); } }
public static PriceDraftBuilder of(final PriceDraft template) { return of(template.getValue()) .country(template.getCountry()) .customerGroup(template.getCustomerGroup()) .channel(template.getChannel()) .validFrom(template.getValidFrom()) .validUntil(template.getValidUntil()) .custom(template.getCustom()); }