1 package org.kuali.common.devops.vagrant.cloud.model; 2 3 import org.kuali.common.core.build.ValidatingBuilder; 4 import org.kuali.common.core.validate.annotation.IdiotProofImmutable; 5 6 import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 7 8 @IdiotProofImmutable 9 @JsonDeserialize(builder = UploadDescriptor.Builder.class) 10 public final class UploadDescriptor { 11 12 private final String uploadPath; 13 private final String token; 14 15 private UploadDescriptor(Builder builder) { 16 this.uploadPath = builder.uploadPath; 17 this.token = builder.token; 18 } 19 20 public static Builder builder() { 21 return new Builder(); 22 } 23 24 public static class Builder extends ValidatingBuilder<UploadDescriptor> { 25 26 private String uploadPath; 27 private String token; 28 29 public Builder withUploadPath(String uploadPath) { 30 this.uploadPath = uploadPath; 31 return this; 32 } 33 34 public Builder withToken(String token) { 35 this.token = token; 36 return this; 37 } 38 39 @Override 40 public UploadDescriptor build() { 41 return validate(new UploadDescriptor(this)); 42 } 43 } 44 45 public String getUploadPath() { 46 return uploadPath; 47 } 48 49 public String getToken() { 50 return token; 51 } 52 53 }