Top Description Constructors Methods
nonapi.io.github.classgraph.utils

public final Class StringUtils

extends Object
Class Inheritance

File utilities.

Constructor Summary

AccessConstructor and Description
private
StringUtils()

Constructor.

Method Summary

Modifier and TypeMethod and Description
public static void
join(final StringBuilder
The buffer to append to.
buf
,
final String
The token to add at the beginning of the string.
addAtBeginning
,
final String
The separator string.
sep
,
final String
The token to add at the end of the string.
addAtEnd
,
final Iterable<?>
The Iterable to join.
iterable
)

A replacement for Java 8's String.join().

public static String

Returns:

The string representation of the joined elements.
join
(final String
The separator string.
sep
,
final Iterable<?>
The Iterable to join.
iterable
)

A replacement for Java 8's String.join().

public static String

Returns:

The string representation of the joined items.
join
(final String
The separator string.
sep
,
final Object...
The items to join.
items
)

A replacement for Java 8's String.join().

public static String

Returns:

The string.
readString
(final byte[]
the array to read the string from
arr
,
final int
The start offset of the string within the array.
startOffset
,
final int
The number of bytes of the UTF8 encoding of the string.
numBytes
,
final boolean
If true, replace '/' with '.'.
replaceSlashWithDot
,
final boolean
If true, string final ';' character.
stripLSemicolon
)

Reads the "modified UTF8" format defined in the Java classfile spec, optionally replacing '/' with '.', and optionally removing the prefix "L" and the suffix ";".

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StringUtilsback to summary
private StringUtils()

Constructor.

Method Detail

joinback to summary
public static void join(final StringBuilder buf, final String addAtBeginning, final String sep, final String addAtEnd, final Iterable<?> iterable)

A replacement for Java 8's String.join().

Parameters
buf:StringBuilder

The buffer to append to.

addAtBeginning:String

The token to add at the beginning of the string.

sep:String

The separator string.

addAtEnd:String

The token to add at the end of the string.

iterable:Iterable<?>

The Iterable to join.

joinback to summary
public static String join(final String sep, final Iterable<?> iterable)

A replacement for Java 8's String.join().

Parameters
sep:String

The separator string.

iterable:Iterable<?>

The Iterable to join.

Returns:String

The string representation of the joined elements.

joinback to summary
public static String join(final String sep, final Object... items)

A replacement for Java 8's String.join().

Parameters
sep:String

The separator string.

items:Object[]

The items to join.

Returns:String

The string representation of the joined items.

readStringback to summary
public static String readString(final byte[] arr, final int startOffset, final int numBytes, final boolean replaceSlashWithDot, final boolean stripLSemicolon) throws IllegalArgumentException

Reads the "modified UTF8" format defined in the Java classfile spec, optionally replacing '/' with '.', and optionally removing the prefix "L" and the suffix ";".

Parameters
arr:byte[]

the array to read the string from

startOffset:int

The start offset of the string within the array.

numBytes:int

The number of bytes of the UTF8 encoding of the string.

replaceSlashWithDot:boolean

If true, replace '/' with '.'.

stripLSemicolon:boolean

If true, string final ';' character.

Returns:String

The string.

Exceptions
IllegalArgumentException:
If string could not be parsed.