001 002package com.commercetools.importapi.models.common; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009 010import com.fasterxml.jackson.annotation.*; 011import com.fasterxml.jackson.databind.annotation.*; 012 013import io.vrap.rmf.base.client.utils.Generated; 014 015/** 016 * <p>References a price by key.</p> 017 * 018 * <hr> 019 * Example to create an instance using the builder pattern 020 * <div class=code-example> 021 * <pre><code class='java'> 022 * PriceKeyReference priceKeyReference = PriceKeyReference.builder() 023 * .key("{key}") 024 * .build() 025 * </code></pre> 026 * </div> 027 */ 028@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 029@JsonDeserialize(as = PriceKeyReferenceImpl.class) 030public interface PriceKeyReference extends KeyReference { 031 032 /** 033 * discriminator value for PriceKeyReference 034 */ 035 String PRICE = "price"; 036 037 /** 038 * factory method 039 * @return instance of PriceKeyReference 040 */ 041 public static PriceKeyReference of() { 042 return new PriceKeyReferenceImpl(); 043 } 044 045 /** 046 * factory method to create a shallow copy PriceKeyReference 047 * @param template instance to be copied 048 * @return copy instance 049 */ 050 public static PriceKeyReference of(final PriceKeyReference template) { 051 PriceKeyReferenceImpl instance = new PriceKeyReferenceImpl(); 052 instance.setKey(template.getKey()); 053 return instance; 054 } 055 056 /** 057 * factory method to create a deep copy of PriceKeyReference 058 * @param template instance to be copied 059 * @return copy instance 060 */ 061 @Nullable 062 public static PriceKeyReference deepCopy(@Nullable final PriceKeyReference template) { 063 if (template == null) { 064 return null; 065 } 066 PriceKeyReferenceImpl instance = new PriceKeyReferenceImpl(); 067 instance.setKey(template.getKey()); 068 return instance; 069 } 070 071 /** 072 * builder factory method for PriceKeyReference 073 * @return builder 074 */ 075 public static PriceKeyReferenceBuilder builder() { 076 return PriceKeyReferenceBuilder.of(); 077 } 078 079 /** 080 * create builder for PriceKeyReference instance 081 * @param template instance with prefilled values for the builder 082 * @return builder 083 */ 084 public static PriceKeyReferenceBuilder builder(final PriceKeyReference template) { 085 return PriceKeyReferenceBuilder.of(template); 086 } 087 088 /** 089 * accessor map function 090 * @param <T> mapped type 091 * @param helper function to map the object 092 * @return mapped value 093 */ 094 default <T> T withPriceKeyReference(Function<PriceKeyReference, T> helper) { 095 return helper.apply(this); 096 } 097 098 /** 099 * gives a TypeReference for usage with Jackson DataBind 100 * @return TypeReference 101 */ 102 public static com.fasterxml.jackson.core.type.TypeReference<PriceKeyReference> typeReference() { 103 return new com.fasterxml.jackson.core.type.TypeReference<PriceKeyReference>() { 104 @Override 105 public String toString() { 106 return "TypeReference<PriceKeyReference>"; 107 } 108 }; 109 } 110}