001 002package com.commercetools.history.models.common; 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.fasterxml.jackson.annotation.*; 013import com.fasterxml.jackson.databind.annotation.*; 014 015import io.vrap.rmf.base.client.utils.Generated; 016 017/** 018 * SyncInfo 019 * 020 * <hr> 021 * Example to create an instance using the builder pattern 022 * <div class=code-example> 023 * <pre><code class='java'> 024 * SyncInfo syncInfo = SyncInfo.builder() 025 * .channel(channelBuilder -> channelBuilder) 026 * .externalId("{externalId}") 027 * .syncedAt("{syncedAt}") 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 = SyncInfoImpl.class) 034public interface SyncInfo { 035 036 /** 037 * 038 * @return channel 039 */ 040 @NotNull 041 @Valid 042 @JsonProperty("channel") 043 public Reference getChannel(); 044 045 /** 046 * <p>Can be used to reference an external order instance, file etc.</p> 047 * @return externalId 048 */ 049 @NotNull 050 @JsonProperty("externalId") 051 public String getExternalId(); 052 053 /** 054 * 055 * @return syncedAt 056 */ 057 @NotNull 058 @JsonProperty("syncedAt") 059 public String getSyncedAt(); 060 061 /** 062 * set channel 063 * @param channel value to be set 064 */ 065 066 public void setChannel(final Reference channel); 067 068 /** 069 * <p>Can be used to reference an external order instance, file etc.</p> 070 * @param externalId value to be set 071 */ 072 073 public void setExternalId(final String externalId); 074 075 /** 076 * set syncedAt 077 * @param syncedAt value to be set 078 */ 079 080 public void setSyncedAt(final String syncedAt); 081 082 /** 083 * factory method 084 * @return instance of SyncInfo 085 */ 086 public static SyncInfo of() { 087 return new SyncInfoImpl(); 088 } 089 090 /** 091 * factory method to create a shallow copy SyncInfo 092 * @param template instance to be copied 093 * @return copy instance 094 */ 095 public static SyncInfo of(final SyncInfo template) { 096 SyncInfoImpl instance = new SyncInfoImpl(); 097 instance.setChannel(template.getChannel()); 098 instance.setExternalId(template.getExternalId()); 099 instance.setSyncedAt(template.getSyncedAt()); 100 return instance; 101 } 102 103 /** 104 * factory method to create a deep copy of SyncInfo 105 * @param template instance to be copied 106 * @return copy instance 107 */ 108 @Nullable 109 public static SyncInfo deepCopy(@Nullable final SyncInfo template) { 110 if (template == null) { 111 return null; 112 } 113 SyncInfoImpl instance = new SyncInfoImpl(); 114 instance.setChannel(com.commercetools.history.models.common.Reference.deepCopy(template.getChannel())); 115 instance.setExternalId(template.getExternalId()); 116 instance.setSyncedAt(template.getSyncedAt()); 117 return instance; 118 } 119 120 /** 121 * builder factory method for SyncInfo 122 * @return builder 123 */ 124 public static SyncInfoBuilder builder() { 125 return SyncInfoBuilder.of(); 126 } 127 128 /** 129 * create builder for SyncInfo instance 130 * @param template instance with prefilled values for the builder 131 * @return builder 132 */ 133 public static SyncInfoBuilder builder(final SyncInfo template) { 134 return SyncInfoBuilder.of(template); 135 } 136 137 /** 138 * accessor map function 139 * @param <T> mapped type 140 * @param helper function to map the object 141 * @return mapped value 142 */ 143 default <T> T withSyncInfo(Function<SyncInfo, T> helper) { 144 return helper.apply(this); 145 } 146 147 /** 148 * gives a TypeReference for usage with Jackson DataBind 149 * @return TypeReference 150 */ 151 public static com.fasterxml.jackson.core.type.TypeReference<SyncInfo> typeReference() { 152 return new com.fasterxml.jackson.core.type.TypeReference<SyncInfo>() { 153 @Override 154 public String toString() { 155 return "TypeReference<SyncInfo>"; 156 } 157 }; 158 } 159}