• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

temporalio / sdk-java / #433

20 Nov 2026 11:28PM UTC coverage: 71.886% (+0.05%) from 71.837%
#433

push

github

web-flow
Report storage driver types in worker heartbeats (#3230)

8791 of 14383 branches covered (61.12%)

Branch coverage included in aggregate %.

9 of 9 new or added lines in 1 file covered. (100.0%)

146 existing lines in 21 files now uncovered.

34692 of 46106 relevant lines covered (75.24%)

0.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

47.17
/temporal-sdk/src/main/java/io/temporal/workflow/GetVersionOptions.java
1
package io.temporal.workflow;
2

3
import io.temporal.common.Experimental;
4
import java.util.*;
5

6
/** Options for {@link Workflow#getVersion(String, int, int, GetVersionOptions)}. */
7
public final class GetVersionOptions {
8

9
  public static GetVersionOptions.Builder newBuilder() {
10
    return new GetVersionOptions.Builder();
1 ✔
11
  }
12

13
  public static GetVersionOptions.Builder newBuilder(GetVersionOptions options) {
14
    return new GetVersionOptions.Builder(options);
×
15
  }
16

17
  public static GetVersionOptions getDefaultInstance() {
18
    return DEFAULT_INSTANCE;
1 ✔
19
  }
20

21
  private static final GetVersionOptions DEFAULT_INSTANCE;
22

23
  static {
24
    DEFAULT_INSTANCE = GetVersionOptions.newBuilder().build();
1 ✔
25
  }
1 ✔
26

27
  public static final class Builder {
28
    private List<EventGroup> eventGroups;
29

30
    private Builder() {}
31

32
    private Builder(GetVersionOptions options) {
×
33
      if (options == null) {
×
34
        return;
×
35
      }
36
      if (!options.eventGroups.isEmpty()) {
×
37
        this.eventGroups = new ArrayList<>(options.eventGroups);
×
38
      }
39
    }
×
40

41
    /**
42
     * Event Groups to associate with the version marker, in addition to those in scope. Calls
43
     * accumulate.
44
     *
45
     * @see EventGroup
46
     */
47
    @Experimental
48
    public Builder addEventGroups(EventGroup... eventGroups) {
49
      if (eventGroups.length == 0) return this;
1 !
50
      if (this.eventGroups == null) {
1 !
51
        this.eventGroups = new ArrayList<>(eventGroups.length);
1 ✔
52
      }
53
      for (EventGroup group : eventGroups) {
1 ✔
54
        this.eventGroups.add(Objects.requireNonNull(group, "eventGroups"));
1 ✔
55
      }
56
      return this;
1 ✔
57
    }
58

59
    /**
60
     * Associates the given Event Groups, in addition to any already added. Calls accumulate.
61
     *
62
     * @see EventGroup
63
     */
64
    @Experimental
65
    public Builder addEventGroups(List<EventGroup> eventGroups) {
UNCOV
66
      return addEventGroups(eventGroups.toArray(new EventGroup[0]));
×
67
    }
68

69
    public GetVersionOptions build() {
70
      return new GetVersionOptions(eventGroups);
1 ✔
71
    }
72
  }
73

74
  private final List<EventGroup> eventGroups;
75

76
  private GetVersionOptions(List<EventGroup> eventGroups) {
1 ✔
77
    this.eventGroups =
1 ✔
78
        eventGroups == null || eventGroups.isEmpty()
1 !
79
            ? Collections.emptyList()
1 ✔
80
            : Collections.unmodifiableList(new ArrayList<>(eventGroups));
1 ✔
81
  }
1 ✔
82

83
  @Experimental
84
  public List<EventGroup> getEventGroups() {
85
    return eventGroups;
1 ✔
86
  }
87

88
  public Builder toBuilder() {
UNCOV
89
    return new Builder(this);
×
90
  }
91

92
  @Override
93
  public String toString() {
UNCOV
94
    return "GetVersionOptions{" + "eventGroups=" + eventGroups + '}';
×
95
  }
96

97
  @Override
98
  public boolean equals(Object o) {
99
    if (this == o) return true;
×
100
    if (o == null || getClass() != o.getClass()) return false;
×
101
    GetVersionOptions that = (GetVersionOptions) o;
×
UNCOV
102
    return Objects.equals(eventGroups, that.eventGroups);
×
103
  }
104

105
  @Override
106
  public int hashCode() {
UNCOV
107
    return Objects.hashCode(eventGroups);
×
108
  }
109
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc