• 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/ScheduleListDescription.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 io.temporal.api.common.v1.Payload;
24
import io.temporal.common.converter.DataConverter;
25
import java.lang.reflect.Type;
26
import java.util.Map;
27
import javax.annotation.Nonnull;
28
import javax.annotation.Nullable;
29

30
/** Description of a listed schedule. */
31
public final class ScheduleListDescription {
32
  private final String scheduleId;
33
  private final ScheduleListSchedule schedule;
34
  private final ScheduleListInfo info;
35
  private final Map<String, Payload> memos;
36
  private final @Nonnull DataConverter dataConverter;
37
  private final Map<String, ?> searchAttributes;
38

39
  public ScheduleListDescription(
40
      String scheduleId,
41
      ScheduleListSchedule schedule,
42
      ScheduleListInfo info,
43
      Map<String, Payload> memos,
44
      @Nonnull DataConverter dataConverter,
45
      Map<String, ?> searchAttributes) {
×
46
    this.scheduleId = scheduleId;
×
47
    this.schedule = schedule;
×
48
    this.info = info;
×
49
    this.memos = memos;
×
50
    this.dataConverter = dataConverter;
×
51
    this.searchAttributes = searchAttributes;
×
52
  }
×
53

54
  /**
55
   * Get the schedule IDs
56
   *
57
   * @return Schedule ID
58
   */
59
  public String getScheduleId() {
60
    return scheduleId;
×
61
  }
62

63
  /**
64
   * Gets the schedule.
65
   *
66
   * @return Schedule
67
   */
68
  public ScheduleListSchedule getSchedule() {
69
    return schedule;
×
70
  }
71

72
  /**
73
   * Get information about the schedule.
74
   *
75
   * @return Schedule info
76
   */
77
  public ScheduleListInfo getInfo() {
78
    return info;
×
79
  }
80

81
  @Nullable
82
  public <T> Object getMemo(String key, Class<T> valueClass) {
83
    return getMemo(key, valueClass, valueClass);
×
84
  }
85

86
  @Nullable
87
  public <T> T getMemo(String key, Class<T> valueClass, Type genericType) {
88
    Payload memo = memos.get(key);
×
89
    if (memo == null) {
×
90
      return null;
×
91
    }
92
    return dataConverter.fromPayload(memo, valueClass, genericType);
×
93
  }
94

95
  /**
96
   * Gets the search attributes on the schedule.
97
   *
98
   * @return Search attributes
99
   */
100
  public Map<String, ?> getSearchAttributes() {
101
    return searchAttributes;
×
102
  }
103
}
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