APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.xml.internal

public Class Utils

extends Object
Class Inheritance
Imports
java.lang.reflect.Array, java.util.Arrays, .Objects, java.util.function.Supplier, java.util.stream.Stream

General utility. Use JdkXmlUtils for XML processing related functions.

Field Summary

Modifier and TypeField and Description
private static boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Class<?>[]

Returns:

a new array with copies of the original array and additional items
arraysAppend
(final Class<?>[]
the original array
original
,
final Class<?>...
items to be appended to the original array
items
)

Creates a new array with copies of the original array and additional items appended to the end of it.

public static byte[]

Returns:

the original array, or an empty array if it is null
createEmptyArrayIfNull
(byte[]
the specified array
array
)

Returns the original array, or an empty array if it is null.

public static int[]

Returns:

the original array, or an empty array if it is null
createEmptyArrayIfNull
(int[]
the specified array
array
)

Returns the original array, or an empty array if it is null.

public static <
the class type
T
>
T[]

Returns:

the original array, or an empty array if it is null
createEmptyArrayIfNull
(final T[]
the specified array
array
,
final Class<T[]>
the type of the array
type
)

Returns the original array, or an empty array if it is null.

public static void
public static boolean

Returns:

true if the CharSequence is empty or null
isEmpty
(final CharSequence
the CharSequence to check, may be null
cs
)

Checks if a CharSequence is empty ("") or null.

public static <
the type of stream elements
T
>
Stream<T>

Returns:

the new stream created by Stream.of(values) or an empty sequential stream created by Stream.empty() if values is null.
streamOfIfNonNull
(final T...
the elements of the new stream
values
)

Returns the new stream created by Stream.of(values) or an empty sequential stream created by Stream.empty() if values is null.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

debugback to summary
private static boolean debug

Constructor Detail

Utilsback to summary
public Utils()

Method Detail

arraysAppendback to summary
public static Class<?>[] arraysAppend(final Class<?>[] original, final Class<?>... items)

Creates a new array with copies of the original array and additional items appended to the end of it.

Parameters
original:Class<?>[]

the original array

items:Class<?>[]

items to be appended to the original array

Returns:Class<?>[]

a new array with copies of the original array and additional items

createEmptyArrayIfNullback to summary
public static byte[] createEmptyArrayIfNull(byte[] array)

Returns the original array, or an empty array if it is null.

Parameters
array:byte[]

the specified array

Returns:byte[]

the original array, or an empty array if it is null

createEmptyArrayIfNullback to summary
public static int[] createEmptyArrayIfNull(int[] array)

Returns the original array, or an empty array if it is null.

Parameters
array:int[]

the specified array

Returns:int[]

the original array, or an empty array if it is null

createEmptyArrayIfNullback to summary
public static <T> T[] createEmptyArrayIfNull(final T[] array, final Class<T[]> type)

Returns the original array, or an empty array if it is null.

Parameters
<T>
the class type
array:T[]

the specified array

type:Class<T[]>

the type of the array

Returns:T[]

the original array, or an empty array if it is null

dPrintback to summary
public static void dPrint(Supplier<String> msgGen)
isEmptyback to summary
public static boolean isEmpty(final CharSequence cs)

Checks if a CharSequence is empty ("") or null.

Parameters
cs:CharSequence

the CharSequence to check, may be null

Returns:boolean

true if the CharSequence is empty or null

streamOfIfNonNullback to summary
public static <T> Stream<T> streamOfIfNonNull(final T... values)

Returns the new stream created by Stream.of(values) or an empty sequential stream created by Stream.empty() if values is null.

Parameters
<T>
the type of stream elements
values:T[]

the elements of the new stream

Returns:Stream<T>

the new stream created by Stream.of(values) or an empty sequential stream created by Stream.empty() if values is null.

Annotations
@SafeVarargs
@SuppressWarnings:varargs