forked from jenkinsci/azure-vm-agents-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAvailabilityBuilder.java
34 lines (27 loc) · 1.12 KB
/
AvailabilityBuilder.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.microsoft.azure.vmagent.builders;
import com.microsoft.azure.vmagent.AvailabilityType;
public class AvailabilityBuilder extends AvailabilityFluent<AvailabilityBuilder> {
private AvailabilityFluent<?> fluent;
public AvailabilityBuilder(AvailabilityFluent<?> fluent) {
this.fluent = fluent;
}
public AvailabilityBuilder(AvailabilityFluent<?> fluent, Availability availability) {
this.fluent = fluent;
if (AvailabilityType.AVAILABILITY_SET.getName().equals(availability.getAvailabilityType())) {
fluent.withAvailabilitySet(availability.getAvailabilitySet());
}
}
public AvailabilityBuilder() {
this.fluent = this;
}
public AvailabilityBuilder(Availability availability) {
this.fluent = this;
if (AvailabilityType.AVAILABILITY_SET.getName().equals(availability.getAvailabilityType())) {
fluent.withAvailabilitySet(availability.getAvailabilitySet());
}
}
public Availability build() {
return new Availability(fluent.getAvailabilityType(),
fluent.getAvailabilitySet());
}
}