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.icloud.internal.utilities;
15 import org.eclipse.jdt.annotation.NonNull;
16 import org.eclipse.jdt.annotation.NonNullByDefault;
19 * Implementation of simple pair. Used mainly for HTTP header handling.
21 * @author Simon Spielmann - Initial contribution.
22 * @param <K> Type of first element
23 * @param <V> Type of second element
26 public class Pair<@NonNull K, @NonNull V> {
32 private Pair(K key, V value) {
38 * Create pair with key and value. Both of type {@link String}.
42 * @return Pair with given key and value
44 public static Pair<String, String> of(String key, String value) {
45 return new Pair<>(key, value);
49 public String toString() {
50 return "Pair [key=" + this.key + ", value=" + this.value + "]";