001 002package com.commercetools.history.models.change; 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>Change triggered when the format of changes on an entity is not identified by Audit Log.</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 * UnknownChange unknownChange = UnknownChange.builder() 024 * .change("{change}") 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 = UnknownChangeImpl.class) 031public interface UnknownChange extends Change { 032 033 /** 034 * discriminator value for UnknownChange 035 */ 036 String UNKNOWN_CHANGE = "UnknownChange"; 037 038 /** 039 * 040 * @return type 041 */ 042 @NotNull 043 @JsonProperty("type") 044 public String getType(); 045 046 /** 047 * <p>Identifier for the type of modification.</p> 048 * @return change 049 */ 050 @NotNull 051 @JsonProperty("change") 052 public String getChange(); 053 054 /** 055 * <p>Value before the change.</p> 056 * @return previousValue 057 */ 058 @NotNull 059 @JsonProperty("previousValue") 060 public Object getPreviousValue(); 061 062 /** 063 * <p>Value after the change.</p> 064 * @return nextValue 065 */ 066 @NotNull 067 @JsonProperty("nextValue") 068 public Object getNextValue(); 069 070 /** 071 * <p>Identifier for the type of modification.</p> 072 * @param change value to be set 073 */ 074 075 public void setChange(final String change); 076 077 /** 078 * <p>Value before the change.</p> 079 * @param previousValue value to be set 080 */ 081 082 public void setPreviousValue(final Object previousValue); 083 084 /** 085 * <p>Value after the change.</p> 086 * @param nextValue value to be set 087 */ 088 089 public void setNextValue(final Object nextValue); 090 091 /** 092 * factory method 093 * @return instance of UnknownChange 094 */ 095 public static UnknownChange of() { 096 return new UnknownChangeImpl(); 097 } 098 099 /** 100 * factory method to create a shallow copy UnknownChange 101 * @param template instance to be copied 102 * @return copy instance 103 */ 104 public static UnknownChange of(final UnknownChange template) { 105 UnknownChangeImpl instance = new UnknownChangeImpl(); 106 instance.setChange(template.getChange()); 107 instance.setPreviousValue(template.getPreviousValue()); 108 instance.setNextValue(template.getNextValue()); 109 return instance; 110 } 111 112 /** 113 * factory method to create a deep copy of UnknownChange 114 * @param template instance to be copied 115 * @return copy instance 116 */ 117 @Nullable 118 public static UnknownChange deepCopy(@Nullable final UnknownChange template) { 119 if (template == null) { 120 return null; 121 } 122 UnknownChangeImpl instance = new UnknownChangeImpl(); 123 instance.setChange(template.getChange()); 124 instance.setPreviousValue(template.getPreviousValue()); 125 instance.setNextValue(template.getNextValue()); 126 return instance; 127 } 128 129 /** 130 * builder factory method for UnknownChange 131 * @return builder 132 */ 133 public static UnknownChangeBuilder builder() { 134 return UnknownChangeBuilder.of(); 135 } 136 137 /** 138 * create builder for UnknownChange instance 139 * @param template instance with prefilled values for the builder 140 * @return builder 141 */ 142 public static UnknownChangeBuilder builder(final UnknownChange template) { 143 return UnknownChangeBuilder.of(template); 144 } 145 146 /** 147 * accessor map function 148 * @param <T> mapped type 149 * @param helper function to map the object 150 * @return mapped value 151 */ 152 default <T> T withUnknownChange(Function<UnknownChange, T> helper) { 153 return helper.apply(this); 154 } 155 156 /** 157 * gives a TypeReference for usage with Jackson DataBind 158 * @return TypeReference 159 */ 160 public static com.fasterxml.jackson.core.type.TypeReference<UnknownChange> typeReference() { 161 return new com.fasterxml.jackson.core.type.TypeReference<UnknownChange>() { 162 @Override 163 public String toString() { 164 return "TypeReference<UnknownChange>"; 165 } 166 }; 167 } 168}