001 002package com.commercetools.history.models.change_value; 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 * FieldDefinitionOrderValue 020 * 021 * <hr> 022 * Example to create an instance using the builder pattern 023 * <div class=code-example> 024 * <pre><code class='java'> 025 * FieldDefinitionOrderValue fieldDefinitionOrderValue = FieldDefinitionOrderValue.builder() 026 * .name("{name}") 027 * .label(labelBuilder -> labelBuilder) 028 * .build() 029 * </code></pre> 030 * </div> 031 */ 032@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 033@JsonDeserialize(as = FieldDefinitionOrderValueImpl.class) 034public interface FieldDefinitionOrderValue { 035 036 /** 037 * <p>Name of the FieldDefinition.</p> 038 * @return name 039 */ 040 @NotNull 041 @JsonProperty("name") 042 public String getName(); 043 044 /** 045 * <p>Descriptive label of the field.</p> 046 * @return label 047 */ 048 @NotNull 049 @Valid 050 @JsonProperty("label") 051 public LocalizedString getLabel(); 052 053 /** 054 * <p>Name of the FieldDefinition.</p> 055 * @param name value to be set 056 */ 057 058 public void setName(final String name); 059 060 /** 061 * <p>Descriptive label of the field.</p> 062 * @param label value to be set 063 */ 064 065 public void setLabel(final LocalizedString label); 066 067 /** 068 * factory method 069 * @return instance of FieldDefinitionOrderValue 070 */ 071 public static FieldDefinitionOrderValue of() { 072 return new FieldDefinitionOrderValueImpl(); 073 } 074 075 /** 076 * factory method to create a shallow copy FieldDefinitionOrderValue 077 * @param template instance to be copied 078 * @return copy instance 079 */ 080 public static FieldDefinitionOrderValue of(final FieldDefinitionOrderValue template) { 081 FieldDefinitionOrderValueImpl instance = new FieldDefinitionOrderValueImpl(); 082 instance.setName(template.getName()); 083 instance.setLabel(template.getLabel()); 084 return instance; 085 } 086 087 /** 088 * factory method to create a deep copy of FieldDefinitionOrderValue 089 * @param template instance to be copied 090 * @return copy instance 091 */ 092 @Nullable 093 public static FieldDefinitionOrderValue deepCopy(@Nullable final FieldDefinitionOrderValue template) { 094 if (template == null) { 095 return null; 096 } 097 FieldDefinitionOrderValueImpl instance = new FieldDefinitionOrderValueImpl(); 098 instance.setName(template.getName()); 099 instance.setLabel(com.commercetools.history.models.common.LocalizedString.deepCopy(template.getLabel())); 100 return instance; 101 } 102 103 /** 104 * builder factory method for FieldDefinitionOrderValue 105 * @return builder 106 */ 107 public static FieldDefinitionOrderValueBuilder builder() { 108 return FieldDefinitionOrderValueBuilder.of(); 109 } 110 111 /** 112 * create builder for FieldDefinitionOrderValue instance 113 * @param template instance with prefilled values for the builder 114 * @return builder 115 */ 116 public static FieldDefinitionOrderValueBuilder builder(final FieldDefinitionOrderValue template) { 117 return FieldDefinitionOrderValueBuilder.of(template); 118 } 119 120 /** 121 * accessor map function 122 * @param <T> mapped type 123 * @param helper function to map the object 124 * @return mapped value 125 */ 126 default <T> T withFieldDefinitionOrderValue(Function<FieldDefinitionOrderValue, T> helper) { 127 return helper.apply(this); 128 } 129 130 /** 131 * gives a TypeReference for usage with Jackson DataBind 132 * @return TypeReference 133 */ 134 public static com.fasterxml.jackson.core.type.TypeReference<FieldDefinitionOrderValue> typeReference() { 135 return new com.fasterxml.jackson.core.type.TypeReference<FieldDefinitionOrderValue>() { 136 @Override 137 public String toString() { 138 return "TypeReference<FieldDefinitionOrderValue>"; 139 } 140 }; 141 } 142}