2 * Copyright (c) 2010-2023 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.nest.internal.wwn.dto;
15 import java.util.HashMap;
19 * Contains the data needed to do a WWN update request back to Nest.
21 * @author David Bennett - Initial contribution
23 public class WWNUpdateRequest {
24 private final String updatePath;
25 private final Map<String, Object> values;
27 private WWNUpdateRequest(Builder builder) {
28 this.updatePath = builder.basePath + builder.identifier;
29 this.values = builder.values;
32 public String getUpdatePath() {
36 public Map<String, Object> getValues() {
40 public static class Builder {
41 private String basePath;
42 private String identifier;
43 private Map<String, Object> values = new HashMap<>();
45 public Builder withBasePath(String basePath) {
46 this.basePath = basePath;
50 public Builder withIdentifier(String identifier) {
51 this.identifier = identifier;
55 public Builder withAdditionalValue(String field, Object value) {
56 values.put(field, value);
60 public WWNUpdateRequest build() {
61 return new WWNUpdateRequest(this);