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 * <p>Returned when the requested feature was removed.</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 * GraphQLFeatureRemovedError graphQLFeatureRemovedError = GraphQLFeatureRemovedError.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 = GraphQLFeatureRemovedErrorImpl.class) 030public interface GraphQLFeatureRemovedError extends GraphQLErrorObject { 031 032 /** 033 * discriminator value for GraphQLFeatureRemovedError 034 */ 035 String FEATURE_REMOVED = "FeatureRemoved"; 036 037 /** 038 * 039 * @return code 040 */ 041 @NotNull 042 @JsonProperty("code") 043 public String getCode(); 044 045 /** 046 * factory method 047 * @return instance of GraphQLFeatureRemovedError 048 */ 049 public static GraphQLFeatureRemovedError of() { 050 return new GraphQLFeatureRemovedErrorImpl(); 051 } 052 053 /** 054 * factory method to create a shallow copy GraphQLFeatureRemovedError 055 * @param template instance to be copied 056 * @return copy instance 057 */ 058 public static GraphQLFeatureRemovedError of(final GraphQLFeatureRemovedError template) { 059 GraphQLFeatureRemovedErrorImpl instance = new GraphQLFeatureRemovedErrorImpl(); 060 Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue)); 061 return instance; 062 } 063 064 /** 065 * factory method to create a deep copy of GraphQLFeatureRemovedError 066 * @param template instance to be copied 067 * @return copy instance 068 */ 069 @Nullable 070 public static GraphQLFeatureRemovedError deepCopy(@Nullable final GraphQLFeatureRemovedError template) { 071 if (template == null) { 072 return null; 073 } 074 GraphQLFeatureRemovedErrorImpl instance = new GraphQLFeatureRemovedErrorImpl(); 075 Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue)); 076 return instance; 077 } 078 079 /** 080 * builder factory method for GraphQLFeatureRemovedError 081 * @return builder 082 */ 083 public static GraphQLFeatureRemovedErrorBuilder builder() { 084 return GraphQLFeatureRemovedErrorBuilder.of(); 085 } 086 087 /** 088 * create builder for GraphQLFeatureRemovedError instance 089 * @param template instance with prefilled values for the builder 090 * @return builder 091 */ 092 public static GraphQLFeatureRemovedErrorBuilder builder(final GraphQLFeatureRemovedError template) { 093 return GraphQLFeatureRemovedErrorBuilder.of(template); 094 } 095 096 /** 097 * accessor map function 098 * @param <T> mapped type 099 * @param helper function to map the object 100 * @return mapped value 101 */ 102 default <T> T withGraphQLFeatureRemovedError(Function<GraphQLFeatureRemovedError, T> helper) { 103 return helper.apply(this); 104 } 105 106 /** 107 * gives a TypeReference for usage with Jackson DataBind 108 * @return TypeReference 109 */ 110 public static com.fasterxml.jackson.core.type.TypeReference<GraphQLFeatureRemovedError> typeReference() { 111 return new com.fasterxml.jackson.core.type.TypeReference<GraphQLFeatureRemovedError>() { 112 @Override 113 public String toString() { 114 return "TypeReference<GraphQLFeatureRemovedError>"; 115 } 116 }; 117 } 118}