Package org.apache.jena.atlas.lib
Class Lib
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 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?static final inthashCodeObject(Object obj) HashCode - allow nullsstatic final inthashCodeObject(Object obj, int nullHashCode) HashCode - allow nullsstatic 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 equalstatic <X> XreadThreadLocal(ThreadLocal<X> threadLocal) Read thread local, assuming that "null" means it does not exist for this thread.static final voidsleep(int milliSeconds) static final voidstatic <X> List<X>Stream toListunsupportedMethod(Object object, String method) CreateUnsupportedOperationExceptionwith formatted message.
-
Method Details
-
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. -
equalsListAsSet
Do two lists have the same elements without considering the order of the lists? -
hashCodeObject
HashCode - allow nulls -
hashCodeObject
HashCode - allow nulls -
sleep
public static final void sleep(int milliSeconds) -
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.
-