001
002package com.commercetools.ml.models.common;
003
004import java.util.Arrays;
005import java.util.Optional;
006
007import com.fasterxml.jackson.annotation.JsonCreator;
008import com.fasterxml.jackson.annotation.JsonValue;
009
010import io.vrap.rmf.base.client.JsonEnum;
011import io.vrap.rmf.base.client.utils.Generated;
012
013/**
014 * ReferenceTypeId
015 */
016@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
017public interface ReferenceTypeId extends JsonEnum {
018
019    ReferenceTypeId CART = ReferenceTypeIdEnum.CART;
020
021    ReferenceTypeId CART_DISCOUNT = ReferenceTypeIdEnum.CART_DISCOUNT;
022
023    ReferenceTypeId CATEGORY = ReferenceTypeIdEnum.CATEGORY;
024
025    ReferenceTypeId CHANNEL = ReferenceTypeIdEnum.CHANNEL;
026
027    ReferenceTypeId CUSTOMER = ReferenceTypeIdEnum.CUSTOMER;
028
029    ReferenceTypeId CUSTOMER_GROUP = ReferenceTypeIdEnum.CUSTOMER_GROUP;
030
031    ReferenceTypeId DISCOUNT_CODE = ReferenceTypeIdEnum.DISCOUNT_CODE;
032
033    ReferenceTypeId KEY_VALUE_DOCUMENT = ReferenceTypeIdEnum.KEY_VALUE_DOCUMENT;
034
035    ReferenceTypeId PAYMENT = ReferenceTypeIdEnum.PAYMENT;
036
037    ReferenceTypeId PRODUCT = ReferenceTypeIdEnum.PRODUCT;
038
039    ReferenceTypeId PRODUCT_TYPE = ReferenceTypeIdEnum.PRODUCT_TYPE;
040
041    ReferenceTypeId PRODUCT_DISCOUNT = ReferenceTypeIdEnum.PRODUCT_DISCOUNT;
042
043    ReferenceTypeId ORDER = ReferenceTypeIdEnum.ORDER;
044
045    ReferenceTypeId REVIEW = ReferenceTypeIdEnum.REVIEW;
046
047    ReferenceTypeId SHOPPING_LIST = ReferenceTypeIdEnum.SHOPPING_LIST;
048
049    ReferenceTypeId SHIPPING_METHOD = ReferenceTypeIdEnum.SHIPPING_METHOD;
050
051    ReferenceTypeId STATE = ReferenceTypeIdEnum.STATE;
052
053    ReferenceTypeId STORE = ReferenceTypeIdEnum.STORE;
054
055    ReferenceTypeId TAX_CATEGORY = ReferenceTypeIdEnum.TAX_CATEGORY;
056
057    ReferenceTypeId TYPE = ReferenceTypeIdEnum.TYPE;
058
059    ReferenceTypeId ZONE = ReferenceTypeIdEnum.ZONE;
060
061    ReferenceTypeId INVENTORY_ENTRY = ReferenceTypeIdEnum.INVENTORY_ENTRY;
062
063    ReferenceTypeId ORDER_EDIT = ReferenceTypeIdEnum.ORDER_EDIT;
064
065    /**
066     * possible values of ReferenceTypeId
067     */
068    enum ReferenceTypeIdEnum implements ReferenceTypeId {
069        /**
070         * cart
071         */
072        CART("cart"),
073
074        /**
075         * cart-discount
076         */
077        CART_DISCOUNT("cart-discount"),
078
079        /**
080         * category
081         */
082        CATEGORY("category"),
083
084        /**
085         * channel
086         */
087        CHANNEL("channel"),
088
089        /**
090         * customer
091         */
092        CUSTOMER("customer"),
093
094        /**
095         * customer-group
096         */
097        CUSTOMER_GROUP("customer-group"),
098
099        /**
100         * discount-code
101         */
102        DISCOUNT_CODE("discount-code"),
103
104        /**
105         * key-value-document
106         */
107        KEY_VALUE_DOCUMENT("key-value-document"),
108
109        /**
110         * payment
111         */
112        PAYMENT("payment"),
113
114        /**
115         * product
116         */
117        PRODUCT("product"),
118
119        /**
120         * product-type
121         */
122        PRODUCT_TYPE("product-type"),
123
124        /**
125         * product-discount
126         */
127        PRODUCT_DISCOUNT("product-discount"),
128
129        /**
130         * order
131         */
132        ORDER("order"),
133
134        /**
135         * review
136         */
137        REVIEW("review"),
138
139        /**
140         * shopping-list
141         */
142        SHOPPING_LIST("shopping-list"),
143
144        /**
145         * shipping-method
146         */
147        SHIPPING_METHOD("shipping-method"),
148
149        /**
150         * state
151         */
152        STATE("state"),
153
154        /**
155         * store
156         */
157        STORE("store"),
158
159        /**
160         * tax-category
161         */
162        TAX_CATEGORY("tax-category"),
163
164        /**
165         * type
166         */
167        TYPE("type"),
168
169        /**
170         * zone
171         */
172        ZONE("zone"),
173
174        /**
175         * inventory-entry
176         */
177        INVENTORY_ENTRY("inventory-entry"),
178
179        /**
180         * order-edit
181         */
182        ORDER_EDIT("order-edit");
183        private final String jsonName;
184
185        private ReferenceTypeIdEnum(final String jsonName) {
186            this.jsonName = jsonName;
187        }
188
189        public String getJsonName() {
190            return jsonName;
191        }
192
193        public String toString() {
194            return jsonName;
195        }
196    }
197
198    /**
199     * the JSON value
200     * @return json value
201     */
202    @JsonValue
203    String getJsonName();
204
205    /**
206     * the enum value
207     * @return name
208     */
209    String name();
210
211    /**
212     * convert value to string
213     * @return string representation
214     */
215    String toString();
216
217    /**
218     * factory method for a enum value of ReferenceTypeId
219     * if no enum has been found an anonymous instance will be created
220     * @param value the enum value to be wrapped
221     * @return enum instance
222     */
223    @JsonCreator
224    public static ReferenceTypeId findEnum(String value) {
225        return findEnumViaJsonName(value).orElse(new ReferenceTypeId() {
226            @Override
227            public String getJsonName() {
228                return value;
229            }
230
231            @Override
232            public String name() {
233                return value.toUpperCase();
234            }
235
236            public String toString() {
237                return value;
238            }
239        });
240    }
241
242    /**
243     * method to find enum using the JSON value
244     * @param jsonName the json value to be wrapped
245     * @return optional of enum instance
246     */
247    public static Optional<ReferenceTypeId> findEnumViaJsonName(String jsonName) {
248        return Arrays.stream(values()).filter(t -> t.getJsonName().equals(jsonName)).findFirst();
249    }
250
251    /**
252     * possible enum values
253     * @return array of possible enum values
254     */
255    public static ReferenceTypeId[] values() {
256        return ReferenceTypeIdEnum.values();
257    }
258
259}