1 package org.kuali.common.devops.model;
2
3 import java.util.List;
4
5 import org.kuali.common.util.Assert;
6
7 import com.google.common.collect.ImmutableList;
8
9 public final class Java {
10
11 private final String home;
12 private final List<String> options;
13 private final boolean useNonBlockingEntropyGatheringDevice;
14
15 public static class Builder {
16
17
18 private final String home;
19
20
21 private List<String> options = ImmutableList.of();
22 private boolean useNonBlockingEntropyGatheringDevice = true;
23
24 public Builder(String home) {
25 this.home = home;
26 }
27
28 public Builder options(List<String> options) {
29 this.options = options;
30 return this;
31 }
32
33 public Builder useNonBlockingEntropyGatheringDevice(boolean useNonBlockingEntropyGatheringDevice) {
34 this.useNonBlockingEntropyGatheringDevice = useNonBlockingEntropyGatheringDevice;
35 return this;
36 }
37
38 public Java build() {
39 Assert.noBlanks(home);
40 Assert.noNulls(options);
41 this.options = ImmutableList.copyOf(options);
42 return new Java(this);
43 }
44 }
45
46 private Java(Builder builder) {
47 this.home = builder.home;
48 this.options = builder.options;
49 this.useNonBlockingEntropyGatheringDevice = builder.useNonBlockingEntropyGatheringDevice;
50 }
51
52 public List<String> getOptions() {
53 return options;
54 }
55
56 public String getHome() {
57 return home;
58 }
59
60 public boolean isUseNonBlockingEntropyGatheringDevice() {
61 return useNonBlockingEntropyGatheringDevice;
62 }
63
64 }