2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.lametrictime.internal.api.local.dto;
18 * @author Gregory Moyer - Initial contribution
20 public class GoalData {
21 private Integer start;
22 private Integer current;
26 public Integer getStart() {
30 public void setStart(Integer start) {
34 public GoalData withStart(Integer start) {
39 public Integer getCurrent() {
43 public void setCurrent(Integer current) {
44 this.current = current;
47 public GoalData withCurrent(Integer current) {
48 this.current = current;
52 public Integer getEnd() {
56 public void setEnd(Integer end) {
60 public GoalData withEnd(Integer end) {
65 public String getUnit() {
69 public void setUnit(String unit) {
73 public GoalData withUnit(String unit) {
79 public int hashCode() {
82 result = prime * result + ((current == null) ? 0 : current.hashCode());
83 result = prime * result + ((end == null) ? 0 : end.hashCode());
84 result = prime * result + ((start == null) ? 0 : start.hashCode());
85 result = prime * result + ((unit == null) ? 0 : unit.hashCode());
90 public boolean equals(Object obj) {
97 if (getClass() != obj.getClass()) {
100 GoalData other = (GoalData) obj;
101 if (current == null) {
102 if (other.current != null) {
105 } else if (!current.equals(other.current)) {
109 if (other.end != null) {
112 } else if (!end.equals(other.end)) {
116 if (other.start != null) {
119 } else if (!start.equals(other.start)) {
123 if (other.unit != null) {
126 } else if (!unit.equals(other.unit)) {
133 public String toString() {
134 StringBuilder builder = new StringBuilder();
135 builder.append("GoalData [start=");
136 builder.append(start);
137 builder.append(", current=");
138 builder.append(current);
139 builder.append(", end=");
141 builder.append(", unit=");
142 builder.append(unit);
144 return builder.toString();