001 002package com.commercetools.api.models.inventory; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009 010import com.commercetools.api.models.common.ResourceIdentifier; 011import com.fasterxml.jackson.annotation.*; 012import com.fasterxml.jackson.databind.annotation.*; 013 014import io.vrap.rmf.base.client.utils.Generated; 015 016/** 017 * <p>ResourceIdentifier to an InventoryEntry.</p> 018 * 019 * <hr> 020 * Example to create an instance using the builder pattern 021 * <div class=code-example> 022 * <pre><code class='java'> 023 * InventoryEntryResourceIdentifier inventoryEntryResourceIdentifier = InventoryEntryResourceIdentifier.builder() 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 = InventoryEntryResourceIdentifierImpl.class) 030public interface InventoryEntryResourceIdentifier 031 extends ResourceIdentifier, com.commercetools.api.models.Identifiable<InventoryEntry> { 032 033 /** 034 * discriminator value for InventoryEntryResourceIdentifier 035 */ 036 String INVENTORY_ENTRY = "inventory-entry"; 037 038 /** 039 * <p>Unique identifier of the referenced InventoryEntry. Either <code>id</code> or <code>key</code> is required.</p> 040 * @return id 041 */ 042 043 @JsonProperty("id") 044 public String getId(); 045 046 /** 047 * <p>User-defined unique identifier of the referenced InventoryEntry. Either <code>id</code> or <code>key</code> is required.</p> 048 * @return key 049 */ 050 051 @JsonProperty("key") 052 public String getKey(); 053 054 /** 055 * <p>Unique identifier of the referenced InventoryEntry. Either <code>id</code> or <code>key</code> is required.</p> 056 * @param id value to be set 057 */ 058 059 public void setId(final String id); 060 061 /** 062 * <p>User-defined unique identifier of the referenced InventoryEntry. Either <code>id</code> or <code>key</code> is required.</p> 063 * @param key value to be set 064 */ 065 066 public void setKey(final String key); 067 068 /** 069 * factory method 070 * @return instance of InventoryEntryResourceIdentifier 071 */ 072 public static InventoryEntryResourceIdentifier of() { 073 return new InventoryEntryResourceIdentifierImpl(); 074 } 075 076 /** 077 * factory method to create a shallow copy InventoryEntryResourceIdentifier 078 * @param template instance to be copied 079 * @return copy instance 080 */ 081 public static InventoryEntryResourceIdentifier of(final InventoryEntryResourceIdentifier template) { 082 InventoryEntryResourceIdentifierImpl instance = new InventoryEntryResourceIdentifierImpl(); 083 instance.setId(template.getId()); 084 instance.setKey(template.getKey()); 085 return instance; 086 } 087 088 /** 089 * factory method to create a deep copy of InventoryEntryResourceIdentifier 090 * @param template instance to be copied 091 * @return copy instance 092 */ 093 @Nullable 094 public static InventoryEntryResourceIdentifier deepCopy(@Nullable final InventoryEntryResourceIdentifier template) { 095 if (template == null) { 096 return null; 097 } 098 InventoryEntryResourceIdentifierImpl instance = new InventoryEntryResourceIdentifierImpl(); 099 instance.setId(template.getId()); 100 instance.setKey(template.getKey()); 101 return instance; 102 } 103 104 /** 105 * builder factory method for InventoryEntryResourceIdentifier 106 * @return builder 107 */ 108 public static InventoryEntryResourceIdentifierBuilder builder() { 109 return InventoryEntryResourceIdentifierBuilder.of(); 110 } 111 112 /** 113 * create builder for InventoryEntryResourceIdentifier instance 114 * @param template instance with prefilled values for the builder 115 * @return builder 116 */ 117 public static InventoryEntryResourceIdentifierBuilder builder(final InventoryEntryResourceIdentifier template) { 118 return InventoryEntryResourceIdentifierBuilder.of(template); 119 } 120 121 /** 122 * accessor map function 123 * @param <T> mapped type 124 * @param helper function to map the object 125 * @return mapped value 126 */ 127 default <T> T withInventoryEntryResourceIdentifier(Function<InventoryEntryResourceIdentifier, T> helper) { 128 return helper.apply(this); 129 } 130 131 /** 132 * gives a TypeReference for usage with Jackson DataBind 133 * @return TypeReference 134 */ 135 public static com.fasterxml.jackson.core.type.TypeReference<InventoryEntryResourceIdentifier> typeReference() { 136 return new com.fasterxml.jackson.core.type.TypeReference<InventoryEntryResourceIdentifier>() { 137 @Override 138 public String toString() { 139 return "TypeReference<InventoryEntryResourceIdentifier>"; 140 } 141 }; 142 } 143}