001 002package com.commercetools.api.models.error; 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 * ErrorByExtension 018 * 019 * <hr> 020 * Example to create an instance using the builder pattern 021 * <div class=code-example> 022 * <pre><code class='java'> 023 * ErrorByExtension errorByExtension = ErrorByExtension.builder() 024 * .id("{id}") 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 = ErrorByExtensionImpl.class) 031public interface ErrorByExtension { 032 033 /** 034 * <p>Unique identifier of the Extension.</p> 035 * @return id 036 */ 037 @NotNull 038 @JsonProperty("id") 039 public String getId(); 040 041 /** 042 * <p>User-defined unique identifier of the Extension.</p> 043 * @return key 044 */ 045 046 @JsonProperty("key") 047 public String getKey(); 048 049 /** 050 * <p>Unique identifier of the Extension.</p> 051 * @param id value to be set 052 */ 053 054 public void setId(final String id); 055 056 /** 057 * <p>User-defined unique identifier of the Extension.</p> 058 * @param key value to be set 059 */ 060 061 public void setKey(final String key); 062 063 /** 064 * factory method 065 * @return instance of ErrorByExtension 066 */ 067 public static ErrorByExtension of() { 068 return new ErrorByExtensionImpl(); 069 } 070 071 /** 072 * factory method to create a shallow copy ErrorByExtension 073 * @param template instance to be copied 074 * @return copy instance 075 */ 076 public static ErrorByExtension of(final ErrorByExtension template) { 077 ErrorByExtensionImpl instance = new ErrorByExtensionImpl(); 078 instance.setId(template.getId()); 079 instance.setKey(template.getKey()); 080 return instance; 081 } 082 083 /** 084 * factory method to create a deep copy of ErrorByExtension 085 * @param template instance to be copied 086 * @return copy instance 087 */ 088 @Nullable 089 public static ErrorByExtension deepCopy(@Nullable final ErrorByExtension template) { 090 if (template == null) { 091 return null; 092 } 093 ErrorByExtensionImpl instance = new ErrorByExtensionImpl(); 094 instance.setId(template.getId()); 095 instance.setKey(template.getKey()); 096 return instance; 097 } 098 099 /** 100 * builder factory method for ErrorByExtension 101 * @return builder 102 */ 103 public static ErrorByExtensionBuilder builder() { 104 return ErrorByExtensionBuilder.of(); 105 } 106 107 /** 108 * create builder for ErrorByExtension instance 109 * @param template instance with prefilled values for the builder 110 * @return builder 111 */ 112 public static ErrorByExtensionBuilder builder(final ErrorByExtension template) { 113 return ErrorByExtensionBuilder.of(template); 114 } 115 116 /** 117 * accessor map function 118 * @param <T> mapped type 119 * @param helper function to map the object 120 * @return mapped value 121 */ 122 default <T> T withErrorByExtension(Function<ErrorByExtension, T> helper) { 123 return helper.apply(this); 124 } 125 126 /** 127 * gives a TypeReference for usage with Jackson DataBind 128 * @return TypeReference 129 */ 130 public static com.fasterxml.jackson.core.type.TypeReference<ErrorByExtension> typeReference() { 131 return new com.fasterxml.jackson.core.type.TypeReference<ErrorByExtension>() { 132 @Override 133 public String toString() { 134 return "TypeReference<ErrorByExtension>"; 135 } 136 }; 137 } 138}