001 002package com.commercetools.api.models.order; 003 004import java.util.*; 005 006import javax.annotation.Nullable; 007 008import io.vrap.rmf.base.client.Builder; 009import io.vrap.rmf.base.client.utils.Generated; 010 011/** 012 * TrackingDataBuilder 013 * <hr> 014 * Example to create an instance using the builder pattern 015 * <div class=code-example> 016 * <pre><code class='java'> 017 * TrackingData trackingData = TrackingData.builder() 018 * .build() 019 * </code></pre> 020 * </div> 021 */ 022@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 023public class TrackingDataBuilder implements Builder<TrackingData> { 024 025 @Nullable 026 private String trackingId; 027 028 @Nullable 029 private String carrier; 030 031 @Nullable 032 private String provider; 033 034 @Nullable 035 private String providerTransaction; 036 037 @Nullable 038 private Boolean isReturn; 039 040 /** 041 * <p>The ID to track one parcel.</p> 042 * @param trackingId value to be set 043 * @return Builder 044 */ 045 046 public TrackingDataBuilder trackingId(@Nullable final String trackingId) { 047 this.trackingId = trackingId; 048 return this; 049 } 050 051 /** 052 * <p>The carrier that delivers the parcel.</p> 053 * @param carrier value to be set 054 * @return Builder 055 */ 056 057 public TrackingDataBuilder carrier(@Nullable final String carrier) { 058 this.carrier = carrier; 059 return this; 060 } 061 062 /** 063 * set the value to the provider 064 * @param provider value to be set 065 * @return Builder 066 */ 067 068 public TrackingDataBuilder provider(@Nullable final String provider) { 069 this.provider = provider; 070 return this; 071 } 072 073 /** 074 * set the value to the providerTransaction 075 * @param providerTransaction value to be set 076 * @return Builder 077 */ 078 079 public TrackingDataBuilder providerTransaction(@Nullable final String providerTransaction) { 080 this.providerTransaction = providerTransaction; 081 return this; 082 } 083 084 /** 085 * <p>Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).</p> 086 * @param isReturn value to be set 087 * @return Builder 088 */ 089 090 public TrackingDataBuilder isReturn(@Nullable final Boolean isReturn) { 091 this.isReturn = isReturn; 092 return this; 093 } 094 095 /** 096 * <p>The ID to track one parcel.</p> 097 * @return trackingId 098 */ 099 100 @Nullable 101 public String getTrackingId() { 102 return this.trackingId; 103 } 104 105 /** 106 * <p>The carrier that delivers the parcel.</p> 107 * @return carrier 108 */ 109 110 @Nullable 111 public String getCarrier() { 112 return this.carrier; 113 } 114 115 /** 116 * value of provider} 117 * @return provider 118 */ 119 120 @Nullable 121 public String getProvider() { 122 return this.provider; 123 } 124 125 /** 126 * value of providerTransaction} 127 * @return providerTransaction 128 */ 129 130 @Nullable 131 public String getProviderTransaction() { 132 return this.providerTransaction; 133 } 134 135 /** 136 * <p>Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).</p> 137 * @return isReturn 138 */ 139 140 @Nullable 141 public Boolean getIsReturn() { 142 return this.isReturn; 143 } 144 145 /** 146 * builds TrackingData with checking for non-null required values 147 * @return TrackingData 148 */ 149 public TrackingData build() { 150 return new TrackingDataImpl(trackingId, carrier, provider, providerTransaction, isReturn); 151 } 152 153 /** 154 * builds TrackingData without checking for non-null required values 155 * @return TrackingData 156 */ 157 public TrackingData buildUnchecked() { 158 return new TrackingDataImpl(trackingId, carrier, provider, providerTransaction, isReturn); 159 } 160 161 /** 162 * factory method for an instance of TrackingDataBuilder 163 * @return builder 164 */ 165 public static TrackingDataBuilder of() { 166 return new TrackingDataBuilder(); 167 } 168 169 /** 170 * create builder for TrackingData instance 171 * @param template instance with prefilled values for the builder 172 * @return builder 173 */ 174 public static TrackingDataBuilder of(final TrackingData template) { 175 TrackingDataBuilder builder = new TrackingDataBuilder(); 176 builder.trackingId = template.getTrackingId(); 177 builder.carrier = template.getCarrier(); 178 builder.provider = template.getProvider(); 179 builder.providerTransaction = template.getProviderTransaction(); 180 builder.isReturn = template.getIsReturn(); 181 return builder; 182 } 183 184}