]> git.basschouten.com Git - openhab-addons.git/blob
9144f8290fd4ac4c07bff796bdea2999b36ed2a7
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.neeo.internal.models;
14
15 import java.util.Arrays;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19
20 /**
21  * The model representing an execute result (serialize/deserialize json use only)
22  *
23  * @author Tim Roberts - Initial contribution
24  */
25 @NonNullByDefault
26 public class ExecuteResult {
27
28     /** The estimated duration */
29     private int estimatedDuration;
30
31     /** The name */
32     @Nullable
33     private String name;
34
35     /** The start time */
36     private long startTime;
37
38     /** The steps */
39     private ExecuteStep @Nullable [] steps;
40
41     /** The type */
42     @Nullable
43     private String type;
44
45     /**
46      * Gets the estimated duration.
47      *
48      * @return the estimated duration
49      */
50     public int getEstimatedDuration() {
51         return estimatedDuration;
52     }
53
54     /**
55      * Gets the name.
56      *
57      * @return the name
58      */
59     @Nullable
60     public String getName() {
61         return name;
62     }
63
64     /**
65      * Gets the start time.
66      *
67      * @return the start time
68      */
69     public long getStartTime() {
70         return startTime;
71     }
72
73     /**
74      * Gets the steps.
75      *
76      * @return the steps
77      */
78     public ExecuteStep[] getSteps() {
79         final ExecuteStep @Nullable [] localSteps = steps;
80         return localSteps == null ? new ExecuteStep[0] : localSteps;
81     }
82
83     /**
84      * Gets the type.
85      *
86      * @return the type
87      */
88     @Nullable
89     public String getType() {
90         return type;
91     }
92
93     @Override
94     public String toString() {
95         return "ExecuteResult [estimatedDuration=" + estimatedDuration + ", name=" + name + ", startTime=" + startTime
96                 + ", steps=" + Arrays.toString(steps) + ", type=" + type + "]";
97     }
98 }