001 002package com.commercetools.api.models.product_discount; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.constraints.NotNull; 010 011import com.fasterxml.jackson.annotation.*; 012import com.fasterxml.jackson.databind.annotation.*; 013 014import io.vrap.rmf.base.client.utils.Generated; 015 016/** 017 * ProductDiscountChangePredicateAction 018 * 019 * <hr> 020 * Example to create an instance using the builder pattern 021 * <div class=code-example> 022 * <pre><code class='java'> 023 * ProductDiscountChangePredicateAction productDiscountChangePredicateAction = ProductDiscountChangePredicateAction.builder() 024 * .predicate("{predicate}") 025 * .build() 026 * </code></pre> 027 * </div> 028 */ 029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 030@JsonDeserialize(as = ProductDiscountChangePredicateActionImpl.class) 031public interface ProductDiscountChangePredicateAction extends ProductDiscountUpdateAction { 032 033 /** 034 * discriminator value for ProductDiscountChangePredicateAction 035 */ 036 String CHANGE_PREDICATE = "changePredicate"; 037 038 /** 039 * <p>New value to set. Must be a valid ProductDiscount predicate.</p> 040 * @return predicate 041 */ 042 @NotNull 043 @JsonProperty("predicate") 044 public String getPredicate(); 045 046 /** 047 * <p>New value to set. Must be a valid ProductDiscount predicate.</p> 048 * @param predicate value to be set 049 */ 050 051 public void setPredicate(final String predicate); 052 053 /** 054 * factory method 055 * @return instance of ProductDiscountChangePredicateAction 056 */ 057 public static ProductDiscountChangePredicateAction of() { 058 return new ProductDiscountChangePredicateActionImpl(); 059 } 060 061 /** 062 * factory method to create a shallow copy ProductDiscountChangePredicateAction 063 * @param template instance to be copied 064 * @return copy instance 065 */ 066 public static ProductDiscountChangePredicateAction of(final ProductDiscountChangePredicateAction template) { 067 ProductDiscountChangePredicateActionImpl instance = new ProductDiscountChangePredicateActionImpl(); 068 instance.setPredicate(template.getPredicate()); 069 return instance; 070 } 071 072 /** 073 * factory method to create a deep copy of ProductDiscountChangePredicateAction 074 * @param template instance to be copied 075 * @return copy instance 076 */ 077 @Nullable 078 public static ProductDiscountChangePredicateAction deepCopy( 079 @Nullable final ProductDiscountChangePredicateAction template) { 080 if (template == null) { 081 return null; 082 } 083 ProductDiscountChangePredicateActionImpl instance = new ProductDiscountChangePredicateActionImpl(); 084 instance.setPredicate(template.getPredicate()); 085 return instance; 086 } 087 088 /** 089 * builder factory method for ProductDiscountChangePredicateAction 090 * @return builder 091 */ 092 public static ProductDiscountChangePredicateActionBuilder builder() { 093 return ProductDiscountChangePredicateActionBuilder.of(); 094 } 095 096 /** 097 * create builder for ProductDiscountChangePredicateAction instance 098 * @param template instance with prefilled values for the builder 099 * @return builder 100 */ 101 public static ProductDiscountChangePredicateActionBuilder builder( 102 final ProductDiscountChangePredicateAction template) { 103 return ProductDiscountChangePredicateActionBuilder.of(template); 104 } 105 106 /** 107 * accessor map function 108 * @param <T> mapped type 109 * @param helper function to map the object 110 * @return mapped value 111 */ 112 default <T> T withProductDiscountChangePredicateAction(Function<ProductDiscountChangePredicateAction, T> helper) { 113 return helper.apply(this); 114 } 115 116 /** 117 * gives a TypeReference for usage with Jackson DataBind 118 * @return TypeReference 119 */ 120 public static com.fasterxml.jackson.core.type.TypeReference<ProductDiscountChangePredicateAction> typeReference() { 121 return new com.fasterxml.jackson.core.type.TypeReference<ProductDiscountChangePredicateAction>() { 122 @Override 123 public String toString() { 124 return "TypeReference<ProductDiscountChangePredicateAction>"; 125 } 126 }; 127 } 128}