]> git.basschouten.com Git - openhab-addons.git/blob
94e876134625bcc916689032d667c0e82c9f2364
[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.persistence.jdbc.internal.dto;
14
15 import java.util.Date;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.core.persistence.PersistenceItemInfo;
20
21 /**
22  * Represents the item info for openHAB.
23  *
24  * @author Christoph Weitkamp - Initial contribution
25  */
26 @NonNullByDefault
27 public class JdbcPersistenceItemInfo implements PersistenceItemInfo {
28
29     private final String name;
30     private final @Nullable Integer count;
31     private final @Nullable Date earliest;
32     private final @Nullable Date latest;
33
34     public JdbcPersistenceItemInfo(String name) {
35         this(name, null, null, null);
36     }
37
38     public JdbcPersistenceItemInfo(String name, @Nullable Integer count, @Nullable Date earliest,
39             @Nullable Date latest) {
40         this.name = name;
41         this.count = count;
42         this.earliest = earliest;
43         this.latest = latest;
44     }
45
46     @Override
47     public String getName() {
48         return name;
49     }
50
51     @Override
52     public @Nullable Integer getCount() {
53         return count;
54     }
55
56     @Override
57     public @Nullable Date getEarliest() {
58         return earliest;
59     }
60
61     @Override
62     public @Nullable Date getLatest() {
63         return latest;
64     }
65 }