001 002package com.commercetools.history.models.label; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.Valid; 010import javax.validation.constraints.NotNull; 011 012import com.commercetools.history.models.common.LocalizedString; 013import com.fasterxml.jackson.annotation.*; 014import com.fasterxml.jackson.databind.annotation.*; 015 016import io.vrap.rmf.base.client.utils.Generated; 017 018/** 019 * LocalizedLabel 020 * 021 * <hr> 022 * Example to create an instance using the builder pattern 023 * <div class=code-example> 024 * <pre><code class='java'> 025 * LocalizedLabel localizedLabel = LocalizedLabel.builder() 026 * .value(valueBuilder -> valueBuilder) 027 * .build() 028 * </code></pre> 029 * </div> 030 */ 031@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 032@JsonDeserialize(as = LocalizedLabelImpl.class) 033public interface LocalizedLabel extends Label { 034 035 /** 036 * discriminator value for LocalizedLabel 037 */ 038 String LOCALIZED_LABEL = "LocalizedLabel"; 039 040 /** 041 * 042 * @return type 043 */ 044 @NotNull 045 @JsonProperty("type") 046 public String getType(); 047 048 /** 049 * <p>Changed value.</p> 050 * @return value 051 */ 052 @NotNull 053 @Valid 054 @JsonProperty("value") 055 public LocalizedString getValue(); 056 057 /** 058 * <p>Changed value.</p> 059 * @param value value to be set 060 */ 061 062 public void setValue(final LocalizedString value); 063 064 /** 065 * factory method 066 * @return instance of LocalizedLabel 067 */ 068 public static LocalizedLabel of() { 069 return new LocalizedLabelImpl(); 070 } 071 072 /** 073 * factory method to create a shallow copy LocalizedLabel 074 * @param template instance to be copied 075 * @return copy instance 076 */ 077 public static LocalizedLabel of(final LocalizedLabel template) { 078 LocalizedLabelImpl instance = new LocalizedLabelImpl(); 079 instance.setValue(template.getValue()); 080 return instance; 081 } 082 083 /** 084 * factory method to create a deep copy of LocalizedLabel 085 * @param template instance to be copied 086 * @return copy instance 087 */ 088 @Nullable 089 public static LocalizedLabel deepCopy(@Nullable final LocalizedLabel template) { 090 if (template == null) { 091 return null; 092 } 093 LocalizedLabelImpl instance = new LocalizedLabelImpl(); 094 instance.setValue(com.commercetools.history.models.common.LocalizedString.deepCopy(template.getValue())); 095 return instance; 096 } 097 098 /** 099 * builder factory method for LocalizedLabel 100 * @return builder 101 */ 102 public static LocalizedLabelBuilder builder() { 103 return LocalizedLabelBuilder.of(); 104 } 105 106 /** 107 * create builder for LocalizedLabel instance 108 * @param template instance with prefilled values for the builder 109 * @return builder 110 */ 111 public static LocalizedLabelBuilder builder(final LocalizedLabel template) { 112 return LocalizedLabelBuilder.of(template); 113 } 114 115 /** 116 * accessor map function 117 * @param <T> mapped type 118 * @param helper function to map the object 119 * @return mapped value 120 */ 121 default <T> T withLocalizedLabel(Function<LocalizedLabel, T> helper) { 122 return helper.apply(this); 123 } 124 125 /** 126 * gives a TypeReference for usage with Jackson DataBind 127 * @return TypeReference 128 */ 129 public static com.fasterxml.jackson.core.type.TypeReference<LocalizedLabel> typeReference() { 130 return new com.fasterxml.jackson.core.type.TypeReference<LocalizedLabel>() { 131 @Override 132 public String toString() { 133 return "TypeReference<LocalizedLabel>"; 134 } 135 }; 136 } 137}