View Javadoc
1   package org.kuali.common.devops.jenkins.scan;
2   
3   import static org.kuali.common.util.base.Precondition.checkMin;
4   
5   public final class Spike {
6   
7   	private final long timestamp;
8   	private final int count;
9   
10  	private Spike(Builder builder) {
11  		this.timestamp = builder.timestamp;
12  		this.count = builder.count;
13  	}
14  
15  	public static Builder builder() {
16  		return new Builder();
17  	}
18  
19  	public static class Builder implements org.apache.commons.lang3.builder.Builder<Spike> {
20  
21  		private long timestamp;
22  		private int count;
23  
24  		public Builder withTimestamp(long timestamp) {
25  			this.timestamp = timestamp;
26  			return this;
27  		}
28  
29  		public Builder withCount(int count) {
30  			this.count = count;
31  			return this;
32  		}
33  
34  		@Override
35  		public Spike build() {
36  			return validate(new Spike(this));
37  		}
38  
39  		private static Spike validate(Spike instance) {
40  			checkMin(instance.count, 0, "count");
41  			return instance;
42  		}
43  	}
44  
45  	public long getTimestamp() {
46  		return timestamp;
47  	}
48  
49  	public int getCount() {
50  		return count;
51  	}
52  
53  }