1 package org.kuali.common.devops.jenkins.file; 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 DiskUsage { 8 9 private final int files; 10 private final long size; 11 12 private DiskUsage(Builder builder) { 13 this.files = builder.files; 14 this.size = builder.size; 15 } 16 17 public static Builder builder() { 18 return new Builder(); 19 } 20 21 public static class Builder extends ValidatingBuilder<DiskUsage> { 22 23 private int files; 24 private long size; 25 26 public Builder withFiles(int files) { 27 this.files = files; 28 return this; 29 } 30 31 public Builder withSize(long size) { 32 this.size = size; 33 return this; 34 } 35 36 @Override 37 public DiskUsage build() { 38 return validate(new DiskUsage(this)); 39 } 40 } 41 42 public int getFiles() { 43 return files; 44 } 45 46 public long getSize() { 47 return size; 48 } 49 50 }