2 * Copyright (c) 2010-2022 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.unifi.internal.api.util;
15 import java.lang.reflect.Type;
17 import org.openhab.binding.unifi.internal.api.model.UniFiController;
18 import org.openhab.binding.unifi.internal.api.model.UniFiDevice;
20 import com.google.gson.InstanceCreator;
24 * The {@link UniFiDeviceInstanceCreator} creates instances of {@link UniFiDevice}s during the JSON unmarshalling of
25 * controller responses.
27 * @author Matthew Bowman - Initial contribution
29 public class UniFiDeviceInstanceCreator implements InstanceCreator<UniFiDevice> {
31 private final UniFiController controller;
33 public UniFiDeviceInstanceCreator(UniFiController controller) {
34 this.controller = controller;
38 public UniFiDevice createInstance(Type type) {
39 return new UniFiDevice(controller);