Tabnine Logo
SetTaxCategory
Code IndexAdd Tabnine to your IDE (free)

How to use
SetTaxCategory
in
io.sphere.sdk.products.commands.updateactions

Best Java code snippets using io.sphere.sdk.products.commands.updateactions.SetTaxCategory (Showing top 20 results out of 315)

origin: io.sphere.sdk.jvm/products

  public static SetTaxCategory to(final Referenceable<TaxCategory> taxCategory) {
    return of(taxCategory);
  }
}
origin: commercetools/commercetools-jvm-sdk

public static SetTaxCategory unset() {
  return new SetTaxCategory(null);
}
origin: io.sphere.sdk.jvm/sphere-models

  public static SetTaxCategory to(final Referenceable<TaxCategory> taxCategory) {
    return of(taxCategory);
  }
}
origin: io.sphere.sdk.jvm/products

public static SetTaxCategory of(final Optional<Reference<TaxCategory>> taxCategory) {
  return new SetTaxCategory(taxCategory);
}
origin: io.sphere.sdk.jvm/models

  public static SetTaxCategory to(final Referenceable<TaxCategory> taxCategory) {
    return of(taxCategory);
  }
}
origin: com.commercetools.sdk.jvm.core/commercetools-models

public static SetTaxCategory unset() {
  return new SetTaxCategory(null);
}
origin: com.commercetools.sdk.jvm.core/commercetools-models

public static SetTaxCategory to(final Referenceable<TaxCategory> taxCategory) {
  return of(taxCategory);
}
origin: io.sphere.sdk.jvm/models

public static SetTaxCategory of(final Optional<Reference<TaxCategory>> taxCategory) {
  return new SetTaxCategory(taxCategory);
}
origin: io.sphere.sdk.jvm/sphere-models

public static SetTaxCategory unset() {
  return of(null);
}
origin: com.commercetools.sdk.jvm.core/commercetools-models

public static SetTaxCategory of(@Nullable final Referenceable<TaxCategory> taxCategory) {
  return new SetTaxCategory(Optional.ofNullable(taxCategory).map(Referenceable::toResourceIdentifier).orElse(null));
}
origin: commercetools/commercetools-jvm-sdk

public static SetTaxCategory to(final Referenceable<TaxCategory> taxCategory) {
  return of(taxCategory);
}
origin: commercetools/commercetools-jvm-sdk

public static SetTaxCategory of(@Nullable final Referenceable<TaxCategory> taxCategory) {
  return new SetTaxCategory(Optional.ofNullable(taxCategory).map(Referenceable::toResourceIdentifier).orElse(null));
}
origin: io.sphere.sdk.jvm/products

public static SetTaxCategory unset() {
  return of(Optional.<Reference<TaxCategory>>empty());
}
origin: io.sphere.sdk.jvm/sphere-models

public static SetTaxCategory of(@Nullable final Referenceable<TaxCategory> taxCategory) {
  return new SetTaxCategory(Optional.ofNullable(taxCategory).map(t -> t.toReference()).orElse(null));
}
origin: io.sphere.sdk.jvm/models

public static SetTaxCategory unset() {
  return of(Optional.<Reference<TaxCategory>>empty());
}
origin: io.sphere.sdk.jvm/models

public static SetTaxCategory of(final Referenceable<TaxCategory> taxCategory) {
  return of(Optional.of(taxCategory.toReference()));
}
origin: io.sphere.sdk.jvm/products

public static SetTaxCategory of(final Referenceable<TaxCategory> taxCategory) {
  return of(Optional.of(taxCategory.toReference()));
}
origin: commercetools/commercetools-jvm-sdk

private static ProductUpdateCommand createSetTaxesCommand(final TaxCategory taxCategory, final Product product) {
  return ProductUpdateCommand.of(product, asList(AddPrice.of(MASTER_VARIANT_ID, PRICE), SetTaxCategory.of(taxCategory), Publish.of()));
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void setTaxCategory() throws Exception {
  TaxCategoryFixtures.withTransientTaxCategory(client(), taxCategory ->
      withUpdateableProduct(client(), product -> {
        assertThat(product.getTaxCategory()).isNotEqualTo(taxCategory);
        final ProductUpdateCommand command = ProductUpdateCommand.of(product, SetTaxCategory.of(taxCategory));
        final Product updatedProduct = client().executeBlocking(command);
        assertThat(updatedProduct.getTaxCategory()).isEqualTo(taxCategory.toReference());
        return updatedProduct;
      })
  );
}
origin: commercetools/commercetools-jvm-sdk

  private static void withTaxedAndPricedProduct(final BlockingSphereClient client, final long centAmount,
                         final double taxRate, final boolean taxIncluded, final Consumer<Product> operator) {
    final List<TaxRateDraft> taxRateDrafts = singletonList(TaxRateDraftBuilder.of(randomKey(), taxRate, taxIncluded, CountryCode.DE).build());
    final TaxCategoryDraft taxCategoryDraft = TaxCategoryDraft.of(randomString(), taxRateDrafts);
    withTaxCategory(client, taxCategoryDraft, taxCategory ->
        withProduct(client, product -> {
          final PriceDraft priceDraft = PriceDraft.of(MoneyImpl.ofCents(centAmount, EUR)).withCountry(DE);
          final ProductUpdateCommand setPricesCmd = ProductUpdateCommand.of(product, asList(
              AddPrice.of(MASTER_VARIANT_ID, priceDraft),
              SetTaxCategory.of(taxCategory),
              Publish.of()));
          final Product productWithPrice = client.executeBlocking(setPricesCmd);
          operator.accept(productWithPrice);
        })
    );
  }
}
io.sphere.sdk.products.commands.updateactionsSetTaxCategory

Javadoc

Adds, changes or removes a product's tax category. This change can never be staged and is thus immediately visible in published products. intro io.sphere.sdk.products.commands.ProductUpdateCommandIntegrationTest#setTaxCategory()

Most used methods

  • of
  • <init>

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now