]> git.basschouten.com Git - openhab-addons.git/blob
9515a8b773180841c7ff34cb1d6f5cf7d7eda109
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.automower.internal.rest.api;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jetty.client.HttpClient;
17
18 import com.google.gson.Gson;
19 import com.google.gson.GsonBuilder;
20
21 /**
22  * Base class for the Husqvarna apis
23  *
24  * @author Markus Pfleger - Initial contribution
25  */
26 @NonNullByDefault
27 public abstract class HusqvarnaApi {
28     private final HttpClient httpClient;
29     protected final Gson gson;
30
31     protected HusqvarnaApi(HttpClient httpClient) {
32         this.httpClient = httpClient;
33
34         GsonBuilder gsonBuilder = new GsonBuilder();
35         gson = gsonBuilder.create();
36     }
37
38     protected abstract String getBaseUrl();
39
40     protected HttpClient getHttpClient() {
41         return httpClient;
42     }
43 }