java.lang.Object
org.apache.jena.atlas.lib.Lib
-
Method Summary
Modifier and TypeMethodDescriptionstatic longadler32(byte[] bytes) Faster than CRC32, nearly as good.static final StringSafely return the class short name for an object -- obj.getClass().getSimpleName()static final StringclassShortName(Class<?> cls) Safely return the class short name for a classstatic StringconcatPaths(String directory, String path) Concatenate two "/" delimited path names.static final <X> Set<X>"ConcurrentHashSet"static longcrc32(byte[] bytes) static final <T> booleanequals(T obj1, T obj2) Return true if obj1 and obj are both null or are .equals, else return false PreferObjects.equals(Object, Object)static final booleanequalsIgnoreCase(String str1, String str2) Return true if obj1 and obj are both null or are .equals, else return falsestatic <T> booleanequalsListAsSet(List<T> list1, List<T> list2) Do two lists have the same elements without considering the order of the lists nor duplicates?static StringGet an environment variable value; if not found try in the system properties.static StringGet system properties (argument sysPropName) or if not found, read an environment variable value (argument envName).static final inthashCodeObject(Object obj) HashCode - allow nullsstatic final inthashCodeObject(Object obj, int nullHashCode) HashCode - allow nullsstatic booleanisEmpty(CharSequence cs) static booleanTest whether a property (environment variable or system property) is true.static booleanisPropertyOrEnvVarSetToTrue(String sysPropName, String envName) Test whether a property (argument sysPropName) or an environment variable (argument envName) is true.static StringNon-locale lowercaseLocale.ROOTstatic StringmurmurHashHex(String string) Calculate the Murmur3 hash of a string, and return it as a hex-encoded string.static final <T> booleannotEqual(T obj1, T obj2) Return true if obj1 and obj are not equalPowerSetstatic <X> XreadThreadLocal(ThreadLocal<X> threadLocal) Read thread local, assuming that "null" means it does not exist for this thread.static RuntimeExceptionReturn a RuntimeException.static final voidsleep(int milliSeconds) static final voidstatic <X> List<X>Stream toListunsupportedMethod(Object object, String method) CreateUnsupportedOperationExceptionwith formatted message.static StringNon-locale uppercaseLocale.ROOT
-
Method Details
-
concatPaths
Concatenate two "/" delimited path names.- If path (second argument) starts with "/", it is assumed to be absolute and path is returned.
- If path (second argument) is "", return the directory.
- Otherwise the arguments are concatenated ensuring there is a "/" between them.
-
toList
Stream toList -
concurrentHashSet
"ConcurrentHashSet" -
sync
-
equals
public static final <T> boolean equals(T obj1, T obj2) Return true if obj1 and obj are both null or are .equals, else return false PreferObjects.equals(Object, Object) -
equalsIgnoreCase
Return true if obj1 and obj are both null or are .equals, else return false -
notEqual
public static final <T> boolean notEqual(T obj1, T obj2) Return true if obj1 and obj are not equal -
className
Safely return the class short name for an object -- obj.getClass().getSimpleName() -
classShortName
Safely return the class short name for a class -
unsupportedMethod
CreateUnsupportedOperationExceptionwith formatted message. -
runtimeException
Return a RuntimeException. If the argument is alreadyRuntimeException, return the argument. Otherwise, wrap inRuntimeException, with the same message, and return theRuntimeException -
equalsListAsSet
Do two lists have the same elements without considering the order of the lists nor duplicates? -
hashCodeObject
HashCode - allow nulls -
hashCodeObject
HashCode - allow nulls -
isEmpty
-
lowercase
Non-locale lowercaseLocale.ROOT -
uppercase
Non-locale uppercaseLocale.ROOT -
sleep
public static final void sleep(int milliSeconds) -
getenv
Get an environment variable value; if not found try in the system properties. -
getenv
Get system properties (argument sysPropName) or if not found, read an environment variable value (argument envName). -
isPropertyOrEnvVarSetToTrue
Test whether a property (environment variable or system property) is true. -
isPropertyOrEnvVarSetToTrue
Test whether a property (argument sysPropName) or an environment variable (argument envName) is true. -
readThreadLocal
Read thread local, assuming that "null" means it does not exist for this thread. If null is read, the thread local is removed. -
crc32
public static long crc32(byte[] bytes) - See Also:
-
adler32
public static long adler32(byte[] bytes) Faster than CRC32, nearly as good.- See Also:
-
murmurHashHex
Calculate the Murmur3 hash of a string, and return it as a hex-encoded string. -
powerSet
PowerSet
-