blob: 5b98bd12e4dab4862109442d32abae1adbef8160 [file] [log] [blame]
jaegonkim6a7b5242018-09-12 23:09:42 +09001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.workflow.api;
17
18import com.google.common.base.MoreObjects;
19
20
21public final class TimeoutTask extends HandlerTask {
22
23 private TimeoutTask(Builder builder) {
24 super(builder);
25 }
26
27 @Override
28 public String toString() {
29 return MoreObjects.toStringHelper(getClass())
30 .add("context", context())
31 .add("workletType", workletType())
32 .toString();
33 }
34
35 /**
36 * Gets a instance of builder.
37 * @return instance of builder
38 */
39 public static Builder builder() {
40 return new Builder();
41 }
42
43 /**
44 * Builder of TimeoutTask.
45 */
46 public static class Builder extends HandlerTask.Builder {
47 @Override
48 public Builder context(WorkflowContext context) {
49 super.context(context);
50 return this;
51 }
52
53 @Override
54 public Builder workletType(String workletType) {
55 super.workletType(workletType);
56 return this;
57 }
58
59 /**
60 * Builds TimeoutTask.
61 * @return instance of TimeoutTask
62 */
63 public TimeoutTask build() {
64 return new TimeoutTask(this);
65 }
66 }
67}