1 package org.kuali.common.aws.s3.model; 2 3 import org.kuali.common.core.build.ValidatingBuilder; 4 import org.kuali.common.core.validate.annotation.IdiotProofImmutable; 5 6 @IdiotProofImmutable 7 public final class SSEResult { 8 9 private final String algorithm; 10 private final String customerAlgorithm; 11 private final String customerKeyMd5; 12 13 private SSEResult(Builder builder) { 14 this.algorithm = builder.algorithm; 15 this.customerAlgorithm = builder.customerAlgorithm; 16 this.customerKeyMd5 = builder.customerKeyMd5; 17 } 18 19 public static Builder builder() { 20 return new Builder(); 21 } 22 23 public static class Builder extends ValidatingBuilder<SSEResult> { 24 25 private String algorithm; 26 private String customerAlgorithm; 27 private String customerKeyMd5; 28 29 public Builder withAlgorithm(String algorithm) { 30 this.algorithm = algorithm; 31 return this; 32 } 33 34 public Builder withCustomerAlgorithm(String customerAlgorithm) { 35 this.customerAlgorithm = customerAlgorithm; 36 return this; 37 } 38 39 public Builder withCustomerKeyMd5(String customerKeyMd5) { 40 this.customerKeyMd5 = customerKeyMd5; 41 return this; 42 } 43 44 @Override 45 public SSEResult build() { 46 return validate(new SSEResult(this)); 47 } 48 } 49 50 public String getAlgorithm() { 51 return algorithm; 52 } 53 54 public String getCustomerAlgorithm() { 55 return customerAlgorithm; 56 } 57 58 public String getCustomerKeyMd5() { 59 return customerKeyMd5; 60 } 61 }