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.dbquery.internal.domain;
15 import java.util.Collections;
16 import java.util.HashMap;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.eclipse.jdt.annotation.Nullable;
25 * @author Joan Pujol - Initial contribution
28 public class QueryParameters {
29 public static final QueryParameters EMPTY = new QueryParameters(Collections.emptyMap());
30 private final Map<String, @Nullable Object> params;
32 private QueryParameters() {
33 this.params = new HashMap<>();
36 public QueryParameters(Map<String, @Nullable Object> params) {
40 public void setParameter(String name, @Nullable Object value) {
41 params.put(name, value);
44 public @Nullable Object getParameter(String paramName) {
45 return params.get(paramName);
48 public Map<String, @Nullable Object> getAll() {
49 return Collections.unmodifiableMap(params);