2 * Copyright (c) 2010-2020 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.persistence.jdbc.model;
15 import java.time.ZonedDateTime;
17 import org.openhab.core.persistence.HistoricItem;
18 import org.openhab.core.types.State;
21 * Represents the data on the part of openHAB.
23 * @author Helmut Lehmeyer - Initial contribution
25 public class JdbcHistoricItem implements HistoricItem {
27 private final String name;
28 private final State state;
29 private final ZonedDateTime timestamp;
31 public JdbcHistoricItem(String name, State state, ZonedDateTime timestamp) {
34 this.timestamp = timestamp;
38 public String getName() {
43 public State getState() {
48 public ZonedDateTime getTimestamp() {
53 public String toString() {
54 StringBuilder builder = new StringBuilder();
55 builder.append("JdbcItem [name=");
57 builder.append(", state=");
58 builder.append(state);
59 builder.append(", timestamp=");
60 builder.append(timestamp);
62 return builder.toString();