Skip to content

Package: Strings

Strings

nameinstructionbranchcomplexitylinemethod
nonEmptyText(String, String)
M: 19 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2017, 2022 Red Hat Inc and others.
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Red Hat Inc - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.client.gateway.spi.util;
14:
15: public final class Strings {
16:
17: private Strings() {
18: }
19:
20: public static String nonEmptyText(final String string, final String fieldName) {
21:• if (string == null || string.isEmpty()) {
22: throw new IllegalArgumentException(String.format("'%s' must not be null or empty", fieldName));
23: }
24: return string;
25: }
26:
27: }