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.dynamodb.internal;
15 import java.time.ZonedDateTime;
17 import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute;
18 import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBDocument;
19 import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey;
20 import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBRangeKey;
21 import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTypeConverted;
24 * DynamoDBItem for items that can be serialized as DynamoDB string
26 * @author Sami Salonen - Initial contribution
29 public class DynamoDBStringItem extends AbstractDynamoDBItem<String> {
31 public DynamoDBStringItem() {
32 this(null, null, null);
35 public DynamoDBStringItem(String name, String state, ZonedDateTime time) {
36 super(name, state, time);
39 @DynamoDBAttribute(attributeName = DynamoDBItem.ATTRIBUTE_NAME_ITEMSTATE)
41 public String getState() {
45 @DynamoDBHashKey(attributeName = DynamoDBItem.ATTRIBUTE_NAME_ITEMNAME)
47 public String getName() {
52 @DynamoDBRangeKey(attributeName = ATTRIBUTE_NAME_TIMEUTC)
53 @DynamoDBTypeConverted(converter = ZonedDateTimeConverter.class)
54 public ZonedDateTime getTime() {
59 public void accept(org.openhab.persistence.dynamodb.internal.DynamoDBItemVisitor visitor) {
64 public void setName(String name) {
69 public void setState(String state) {
74 public void setTime(ZonedDateTime time) {