public class SystemUtil extends Object
Constructor and Description |
---|
SystemUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> T[] |
concatenate(T[] array1,
T... array2)
Deprecated.
use StringsPlume.concatenate
|
static <T> T[] |
concatenate(T firstElt,
T[] array,
T lastElt)
Deprecated.
use PlumeUtil.concat
|
static boolean |
getBooleanSystemProperty(String key)
Deprecated.
use UtilPlume.getBooleanSystemProperty
|
static boolean |
getBooleanSystemProperty(String key,
boolean defaultValue)
Deprecated.
use UtilPlume.getBooleanSystemProperty
|
static int |
getJreVersion()
Returns the major JRE version.
|
static @Nullable String |
getReleaseValue(ProcessingEnvironment env)
Returns the release value passed to the compiler or null if release was not passed.
|
static @Nullable String |
getToolsJar()
Returns the pathname to the tools.jar file, or null if it does not exist.
|
static String |
join(CharSequence delimiter,
Iterable<?> values)
Deprecated.
use
StringsPlume.join |
static <T> String |
join(CharSequence delimiter,
T[] objs)
Deprecated.
use
StringsPlume.join |
static String |
joinLines(Iterable<? extends Object> v)
Deprecated.
use
StringsPlume.joinLines |
static <T> String |
joinLines(T... a)
Deprecated.
use
StringsPlume.joinLines |
static List<String> |
readFile(File argFile)
Deprecated.
use Files.readAllLines
|
static void |
sleep(long millis)
Deprecated.
use SystemPlume.sleep
|
@Deprecated public static boolean getBooleanSystemProperty(String key)
key
- system property to check@Deprecated public static boolean getBooleanSystemProperty(String key, boolean defaultValue)
key
- system property to checkdefaultValue
- value to use if the property is not setkey
or defaultValue
if key
is not setpublic static int getJreVersion()
This is different from the version passed to the compiler via --release; use getReleaseValue(ProcessingEnvironment)
to get that version.
Extract the major version number from the "java.version" system property. Two possible formats are considered. Up to Java 8, from a version string like `1.8.whatever`, this method extracts 8. Since Java 9, from a version string like `11.0.1`, this method extracts 11.
public static @Nullable String getReleaseValue(ProcessingEnvironment env)
env
- the ProcessingEnvironmentpublic static @Nullable String getToolsJar()
@Deprecated public static <T> T[] concatenate(T[] array1, T... array2)
T
- the type of the array elementsarray1
- the first arrayarray2
- the second array@Deprecated public static List<String> readFile(File argFile) throws IOException
argFile
- argument fileIOException
- when reading the argFile@Deprecated public static <T> String join(CharSequence delimiter, T[] objs)
StringsPlume.join
T
- the type of array elementsdelimiter
- the delimiter that separates each elementobjs
- the values whose string representations to join together@Deprecated public static String join(CharSequence delimiter, Iterable<?> values)
StringsPlume.join
delimiter
- the delimiter that separates each elementvalues
- the values whose string representations to join together@Deprecated @SafeVarargs public static <T> String joinLines(T... a)
StringsPlume.joinLines
T
- the type of array elementsa
- array of values to concatenate@Deprecated public static String joinLines(Iterable<? extends Object> v)
StringsPlume.joinLines
v
- list of values to concatenate@Deprecated public static void sleep(long millis)
millis
- the length of time to sleep in milliseconds@Deprecated public static <T> T[] concatenate(T firstElt, T[] array, T lastElt)
T
- the type of the array elementsfirstElt
- the first elementarray
- the arraylastElt
- the last elemeent