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.homeconnect.internal.client.model;
15 import java.time.ZonedDateTime;
16 import java.util.UUID;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
25 * @author Jonas BrĂ¼stel - Initial Contribution
28 public class ApiRequest {
29 private final String id;
30 private final ZonedDateTime time;
31 private final HomeConnectRequest homeConnectRequest;
32 private final @Nullable HomeConnectResponse homeConnectResponse;
34 public ApiRequest(ZonedDateTime time, HomeConnectRequest homeConnectRequest,
35 @Nullable HomeConnectResponse homeConnectResponse) {
36 this.id = UUID.randomUUID().toString();
38 this.homeConnectRequest = homeConnectRequest;
39 this.homeConnectResponse = homeConnectResponse;
42 public String getId() {
46 public ZonedDateTime getTime() {
50 public HomeConnectRequest getRequest() {
51 return homeConnectRequest;
54 public @Nullable HomeConnectResponse getResponse() {
55 return homeConnectResponse;
59 public String toString() {
60 return "ApiRequest [id=" + id + ", time=" + time + ", request=" + homeConnectRequest + ", response="
61 + homeConnectResponse + "]";