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;
23 * DynamoDBItem for items that can be serialized as DynamoDB string
25 * @author Sami Salonen - Initial contribution
28 public class DynamoDBStringItem extends AbstractDynamoDBItem<String> {
30 public DynamoDBStringItem() {
31 this(null, null, null);
34 public DynamoDBStringItem(String name, String state, ZonedDateTime time) {
35 super(name, state, time);
38 @DynamoDBAttribute(attributeName = DynamoDBItem.ATTRIBUTE_NAME_ITEMSTATE)
40 public String getState() {
44 @DynamoDBHashKey(attributeName = DynamoDBItem.ATTRIBUTE_NAME_ITEMNAME)
46 public String getName() {
51 @DynamoDBRangeKey(attributeName = ATTRIBUTE_NAME_TIMEUTC)
52 public ZonedDateTime getTime() {
57 public void accept(org.openhab.persistence.dynamodb.internal.DynamoDBItemVisitor visitor) {
62 public void setName(String name) {
67 public void setState(String state) {
72 public void setTime(ZonedDateTime time) {