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

temporalio / sdk-java / #174

pending completion
#174

push

github-actions

web-flow
Add schedules API (#1776)

Add schedules API

1143 of 1143 new or added lines in 35 files covered. (100.0%)

18101 of 23284 relevant lines covered (77.74%)

0.78 hits per line

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

0.0
/temporal-sdk/src/main/java/io/temporal/client/schedules/ScheduleRange.java
1
/*
2
 * Copyright (C) 2022 Temporal Technologies, Inc. All Rights Reserved.
3
 *
4
 * Copyright (C) 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
 *
6
 * Modifications copyright (C) 2017 Uber Technologies, Inc.
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this material except in compliance with the License.
10
 * You may obtain a copy of the License at
11
 *
12
 *   http://www.apache.org/licenses/LICENSE-2.0
13
 *
14
 * Unless required by applicable law or agreed to in writing, software
15
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 * See the License for the specific language governing permissions and
18
 * limitations under the License.
19
 */
20

21
package io.temporal.client.schedules;
22

23
import com.google.common.base.Preconditions;
24
import java.util.Objects;
25

26
/** Inclusive range for a schedule match value. */
27
public final class ScheduleRange {
28
  private final int start;
29
  private final int end;
30
  private final int step;
31

32
  /**
33
   * Create a inclusive range for a schedule match value.
34
   *
35
   * @param start The inclusive start of the range
36
   */
37
  public ScheduleRange(int start) {
38
    this(start, 0, 0);
×
39
  }
×
40

41
  /**
42
   * Create a inclusive range for a schedule match value.
43
   *
44
   * @param start The inclusive start of the range
45
   * @param end The inclusive end of the range. Default if unset or less than start is start.
46
   */
47
  public ScheduleRange(int start, int end) {
48
    this(start, end, 0);
×
49
  }
×
50

51
  /**
52
   * Create a inclusive range for a schedule match value.
53
   *
54
   * @param start The inclusive start of the range
55
   * @param end The inclusive end of the range. Default if unset or less than start is start.
56
   * @param step The step to take between each value. Default if unset or 0, is 1.
57
   */
58
  public ScheduleRange(int start, int end, int step) {
×
59
    Preconditions.checkState(start >= 0 && step >= 0 && step >= 0);
×
60
    this.start = start;
×
61
    this.end = end;
×
62
    this.step = step;
×
63
  }
×
64

65
  /**
66
   * Gets the inclusive start of the range.
67
   *
68
   * @return start of range
69
   */
70
  public int getStart() {
71
    return start;
×
72
  }
73

74
  /**
75
   * Gets the inclusive end of the range.
76
   *
77
   * @return end of range
78
   */
79
  public int getEnd() {
80
    return end;
×
81
  }
82

83
  /**
84
   * Gets the step taken between each value.
85
   *
86
   * @return steps taken between values.
87
   */
88
  public int getStep() {
89
    return step;
×
90
  }
91

92
  @Override
93
  public boolean equals(Object o) {
94
    if (this == o) return true;
×
95
    if (o == null || getClass() != o.getClass()) return false;
×
96
    ScheduleRange that = (ScheduleRange) o;
×
97
    return start == that.start && end == that.end && step == that.step;
×
98
  }
99

100
  @Override
101
  public int hashCode() {
102
    return Objects.hash(start, end, step);
×
103
  }
104

105
  @Override
106
  public String toString() {
107
    return "ScheduleRange{" + "start=" + start + ", end=" + end + ", step=" + step + '}';
×
108
  }
109
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc