2 * Copyright (c) 2010-2020 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.yamahareceiver.internal.config;
15 import java.util.Optional;
17 import org.apache.commons.lang.StringUtils;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
24 * @author Tomasz Maruszak - Initial contribution.
27 public class YamahaBridgeConfig {
30 * The host name of the Yamaha AVR.
32 private @Nullable String host;
34 * Port under which the control interface is exposed on the Yamaha AVR.
36 private int port = 80;
38 * Interval (in seconds) at which state updates are polled.
40 private int refreshInterval = 60; // Default: Every 1min
42 * The default album image placeholder URL used when the source does not provide its own.
44 private String albumUrl = "";
46 * Input source mapping for each command. This is a comma separated list of settings.
48 private String inputMapping = "";
50 public @Nullable String getHost() {
54 public int getPort() {
58 public int getRefreshInterval() {
59 return refreshInterval;
62 public String getAlbumUrl() {
66 public Optional<String> getHostWithPort() {
67 final String str = host;
68 if (StringUtils.isEmpty(str)) {
69 return Optional.empty();
71 return Optional.of(str + ":" + port);
74 public String getInputMapping() {