/** Creates a command object to create a {@link ProductType}. @param draft template to create the new object @return a new create command */ static ProductTypeCreateCommand of(final ProductTypeDraft draft) { return new ProductTypeCreateCommandImpl(draft); }
/** Creates a command object to delete a {@link ProductType} by ID. @param versioned the object to delete (so directly a {@link ProductType}) or just the version/ID information of it @return delete command */ static ProductTypeDeleteCommand of(final Versioned<ProductType> versioned) { return new ProductTypeDeleteCommandImpl(versioned,false); }
/** Creates a command to update a ProductType selected by its ID using several update actions. @param versioned the object to update (so directly a {@link ProductType}) or just the version/ID information of it @param updateActions the updates @return the update command for ProductType */ static ProductTypeUpdateCommand of(final Versioned<ProductType> versioned, final List<? extends UpdateAction<ProductType>> updateActions) { return new ProductTypeUpdateCommandImpl(versioned, updateActions); }
static ProductTypeDeleteCommand ofKey(final String key, final Long version) { final Versioned<ProductType> versioned = Versioned.of("key=" + key, version);//hack for simple reuse return of(versioned); } }
static ProductTypeUpdateCommand ofKey(final String key, final Long version, final UpdateAction<ProductType> updateAction) { return ofKey(key, version, Collections.singletonList(updateAction)); } }
@Override public ProductTypeCreateCommand withDraft(final ProductTypeDraft draft) { return new ProductTypeCreateCommandImpl(copyBuilder().draft(draft)); } }
public static ProductTypeCreateCommand of(final ProductTypeDraft draft) { return new ProductTypeCreateCommand(draft); } }
public static DeleteCommand<ProductType> of(final Versioned<ProductType> versioned) { return new ProductTypeDeleteCommand(versioned); } }
private ProductTypeDraft getDraft() { return new TShirtProductTypeDraftSupplier(getProductTypeName()).get(); }
/** Creates a command object to delete a {@link ProductType} by its key. @param key the key of the ProductType to delete, see {@link ProductType#getKey()} @param version `the current version of the ProductType, see {@link ProductType#getVersion()} @return delete command */ static ProductTypeDeleteCommand ofKey(final String key, final Long version) { final Versioned<ProductType> versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse return of(versioned); }
static ProductTypeUpdateCommand of(final Versioned<ProductType> versioned, final List<? extends UpdateAction<ProductType>> updateActions) { return new ProductTypeUpdateCommandImpl(versioned, updateActions); }
/** Creates a command to update a ProductType selected by its key using one update action. @param key the key of the ProductType to update, see {@link ProductType#getKey()} @param version the current version of the ProductType, see {@link ProductType#getVersion()} @param updateAction the update to perform @return the update command for ProductType */ static ProductTypeUpdateCommand ofKey(final String key, final Long version, final UpdateAction<ProductType> updateAction) { return ofKey(key, version, Collections.singletonList(updateAction)); }
static ProductTypeCreateCommand of(final ProductTypeDraft draft) { return new ProductTypeCreateCommandImpl(draft); } }
static ProductTypeDeleteCommand of(final Versioned<ProductType> versioned) { return new ProductTypeDeleteCommandImpl(versioned); }
public static void deleteProductType(final BlockingSphereClient client, final ProductType productType) { try { client.executeBlocking(ProductTypeDeleteCommand.of(productType)); } catch (Exception e) { getLogger("test.fixtures").debug(() -> "no product type to delete"); } }
/** Creates a command to update a ProductType selected by its ID using one update action. @param versioned the object to update (so directly a {@link ProductType}) or just the version/ID information of it @param updateAction the update to perform @return the update command for ProductType */ static ProductTypeUpdateCommand of(final Versioned<ProductType> versioned, final UpdateAction<ProductType> updateAction) { return new ProductTypeUpdateCommandImpl(versioned, Collections.singletonList(updateAction)); }
public static void removeProductTypeByKey(final BlockingSphereClient client, final String productTypeKey) { final ProductType productType = client.executeBlocking(ProductTypeByKeyGet.of(productTypeKey)); if (productType != null) { client.executeBlocking(ProductTypeDeleteCommand.of(productType)); } } }
static ProductTypeUpdateCommand of(final Versioned<ProductType> versioned, final UpdateAction<ProductType> updateAction) { return new ProductTypeUpdateCommandImpl(versioned, Collections.singletonList(updateAction)); }
static ProductTypeUpdateCommand ofKey(final String key, final Long version, final List<? extends UpdateAction<ProductType>> updateActions) { final Versioned<ProductType> versioned = Versioned.of("key=" + key, version);//hack for simple reuse return new ProductTypeUpdateCommandImpl(versioned, updateActions); }
/** Creates a command to update a ProductType selected by its key using several update actions. @param key the key of the ProductType to update, see {@link ProductType#getKey()} @param version the current version of the ProductType, see {@link ProductType#getVersion()} @param updateActions the updates @return the update command for ProductType */ static ProductTypeUpdateCommand ofKey(final String key, final Long version, final List<? extends UpdateAction<ProductType>> updateActions) { final Versioned<ProductType> versioned = Versioned.of("key=" + urlEncode(key), version);//hack for simple reuse return new ProductTypeUpdateCommandImpl(versioned, updateActions); }