2 * Copyright (c) 2010-2021 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.bmwconnecteddrive.internal.dto;
15 import static org.openhab.binding.bmwconnecteddrive.internal.utils.Constants.*;
17 import org.openhab.binding.bmwconnecteddrive.internal.utils.Constants;
18 import org.openhab.binding.bmwconnecteddrive.internal.utils.Converter;
21 * The {@link Destination} Data Transfer Object
23 * @author Bernd Weymann - Initial contribution
25 public class Destination {
28 public String country;
31 public String streetNumber;
33 public String createdAt;
35 public String getAddress() {
36 StringBuilder buf = new StringBuilder();
39 if (streetNumber != null) {
40 buf.append(SPACE).append(streetNumber);
44 if (buf.length() > 0) {
45 buf.append(COMMA).append(SPACE).append(city);
50 if (buf.length() == 0) {
53 return Converter.toTitleCase(buf.toString());
57 public String getCoordinates() {
58 return lat + Constants.COMMA + lon;