1 package org.kuali.common.devops.model; 2 3 import java.io.File; 4 5 import org.kuali.common.core.build.ValidatingBuilder; 6 import org.kuali.common.core.validate.annotation.IdiotProofImmutable; 7 8 import com.google.common.base.Optional; 9 10 @IdiotProofImmutable 11 public final class FileCache { 12 13 private final String url; 14 private final Optional<String> content; 15 private final File cache; 16 17 private FileCache(Builder builder) { 18 this.url = builder.url; 19 this.content = builder.content; 20 this.cache = builder.cache; 21 } 22 23 public static Builder builder() { 24 return new Builder(); 25 } 26 27 public static class Builder extends ValidatingBuilder<FileCache> { 28 29 private String url; 30 private Optional<String> content; 31 private File cache; 32 33 public Builder url(String url) { 34 this.url = url; 35 return this; 36 } 37 38 public Builder content(Optional<String> content) { 39 this.content = content; 40 return this; 41 } 42 43 public Builder cache(File cache) { 44 this.cache = cache; 45 return this; 46 } 47 48 @Override 49 public FileCache build() { 50 return validate(new FileCache(this)); 51 } 52 53 public String getUrl() { 54 return url; 55 } 56 57 public void setUrl(String url) { 58 this.url = url; 59 } 60 61 public Optional<String> getContent() { 62 return content; 63 } 64 65 public void setContent(Optional<String> content) { 66 this.content = content; 67 } 68 69 public File getCache() { 70 return cache; 71 } 72 73 public void setCache(File cache) { 74 this.cache = cache; 75 } 76 77 } 78 79 public String getUrl() { 80 return url; 81 } 82 83 public Optional<String> getContent() { 84 return content; 85 } 86 87 public File getCache() { 88 return cache; 89 } 90 91 }