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.yamahareceiver.internal.protocol.xml;
16 * Template for XML commands
18 * @author Tomasz Maruszak - Initial contribution
20 class CommandTemplate {
22 private final String command;
23 private final String path;
25 public CommandTemplate(String command, String path) {
26 this.command = command;
30 public CommandTemplate(String command) {
34 public CommandTemplate replace(String oldToken, String newToken) {
35 return new CommandTemplate(command.replace(oldToken, newToken), path.replace(oldToken, newToken));
38 public String apply(Object... args) {
39 return String.format(command, args);
42 public String getPath() {
47 public String toString() {