]> git.basschouten.com Git - openhab-addons.git/blob
88eda33d7b2504e326eb29761c7640d64bd817bc
[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.spotify.internal.api.model;
14
15 import com.google.gson.FieldNamingPolicy;
16 import com.google.gson.Gson;
17 import com.google.gson.GsonBuilder;
18
19 /**
20  * Util class to get the Gson instance used to parse the Spotify data.
21  *
22  * @author Hilbrand Bouwkamp - Initial contribution
23  */
24 public final class ModelUtil {
25     private static final Gson GSON = new GsonBuilder()
26             .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
27
28     private ModelUtil() {
29         // Util class
30     }
31
32     /**
33      * @return Returns the Gson instance to parse the Spotify data.
34      */
35     public static Gson gsonInstance() {
36         return GSON;
37     }
38 }