diff --git a/src/main/java/com/hivemq/client2/util/TypeSwitch.java b/src/main/java/com/hivemq/client2/util/TypeSwitch.java deleted file mode 100644 index 32a6c6090..000000000 --- a/src/main/java/com/hivemq/client2/util/TypeSwitch.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2018-present HiveMQ and the HiveMQ Community - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.client2.util; - -import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.function.Consumer; - -/** - * Util to enable switching over types. - *
- * Example: - *
- * {@code - * Mqtt5MessageException e; - * TypeSwitch.when(e) - * .is(Mqtt5ConnAckException.class, c -> System.out.println(c.getMqttMessage().getReasonCode())) - * .is(Mqtt5DisconnectException.class, d -> System.out.println(d.getMqttMessage().getServerReference())); - * } - *- * - * @param
T
.
- *
- * @param t the object of type T
.
- * @param
- * If the type matches the returned TypeSwitch will not match any further type.
- *
- * @param type the class of the type to check.
- * @param consumer the callback to execute if the type matches.
- * @param the type to check
- * @return the TypeSwitch object.
- */
- @NotNull TypeSwitch