/** * 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 TaxCategoryDraftDsl of(final TaxCategoryDraft template) { return new TaxCategoryDraftDsl(template.getDescription(), template.getKey(), template.getName(), template.getTaxRates()); } }
/** * 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 TaxCategoryDraftBuilder of(final TaxCategoryDraft template) { return new TaxCategoryDraftBuilder(template.getDescription(), template.getKey(), template.getName(), template.getTaxRates()); } }
public static TaxCategoryBuilder of(final TaxCategoryDraft taxCategoryDraft) { return of(taxCategoryDraft.getName(), taxCategoryDraft.getTaxRates()).description(taxCategoryDraft.getDescription()); }
public static TaxCategoryBuilder of(final TaxCategoryDraft taxCategoryDraft) { return of(taxCategoryDraft.getName(), taxCategoryDraft.getTaxRates()).description(taxCategoryDraft.getDescription()); }
public static void withTaxCategory(final BlockingSphereClient client, final TaxCategoryDraft draft, final Consumer<TaxCategory> user) { requireNonNull(draft, "draft should not be null"); final PagedQueryResult<TaxCategory> results = client.executeBlocking(TaxCategoryQuery.of().byName(draft.getName())); results.getResults().forEach(tc -> client.executeBlocking(TaxCategoryDeleteCommand.of(tc))); final TaxCategory taxCategory = client.executeBlocking(TaxCategoryCreateCommand.of(draft)); user.accept(taxCategory); client.executeBlocking(TaxCategoryDeleteCommand.of(taxCategory)); }
public static void withUpdateableTaxCategory(final BlockingSphereClient client, final UnaryOperator<TaxCategory> testApplicationFunction) { final TaxCategoryDraft draft = TaxCategoryDraft.of(randomKey(), singletonList(TaxRateDraftBuilder.of("de19", 0.19, true, CountryCode.DE).build())); final PagedQueryResult<TaxCategory> results = client.executeBlocking(TaxCategoryQuery.of().byName(draft.getName())); results.getResults().forEach(tc -> client.executeBlocking(TaxCategoryDeleteCommand.of(tc))); final TaxCategory taxCategory = client.executeBlocking(TaxCategoryCreateCommand.of(draft)); final TaxCategory updated = testApplicationFunction.apply(taxCategory); client.executeBlocking(TaxCategoryDeleteCommand.of(updated)); } }