]> git.basschouten.com Git - openhab-addons.git/blob
e95a9ca73e51f5a73a3ac873239b6e28bbc75233
[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.binding.homeconnect.internal.client.model;
14
15 import java.util.Date;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18
19 /**
20  * Token model
21  *
22  * @author Jonas BrĂ¼stel - Initial contribution
23  *
24  */
25 @NonNullByDefault
26 public class Token {
27
28     private final String accessToken;
29     private final String refreshToken;
30     private final long accessTokenExpirationInSeconds;
31
32     public Token(String accessToken, String refreshToken, long accessTokenExpirationInSeconds) {
33         this.accessToken = accessToken;
34         this.refreshToken = refreshToken;
35         this.accessTokenExpirationInSeconds = accessTokenExpirationInSeconds;
36     }
37
38     public String getAccessToken() {
39         return accessToken;
40     }
41
42     public String getRefreshToken() {
43         return refreshToken;
44     }
45
46     public long getAccessTokenExpiration() {
47         return accessTokenExpirationInSeconds;
48     }
49
50     @Override
51     public String toString() {
52         return "Token [accessToken=" + accessToken + ", refreshToken=" + refreshToken + ", accessTokenExpiration="
53                 + new Date(accessTokenExpirationInSeconds) + "]";
54     }
55 }