public class ConfigUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ConfigUtils.MemberAccessorType |
Modifier and Type | Field and Description |
---|---|
static String |
AVAILABLE_PROCESSOR_COUNT
Name of the variable that represents {@link Runtime#availableProcessors()).
|
Modifier and Type | Method and Description |
---|---|
static MemberAccessor |
buildMemberAccessor(Member member,
ConfigUtils.MemberAccessorType memberAccessorType,
Class<? extends Annotation> annotationClass) |
static int |
ceilDivide(int dividend,
int divisor)
Divides and ceils the result without using floating point arithmetic.
|
static Class<? extends Annotation> |
extractAnnotationClass(Member member,
Class<? extends Annotation>... annotations) |
static List<Class<?>> |
getAllAnnotatedLineageClasses(Class<?> bottomClass,
Class<? extends Annotation> annotation) |
static List<Member> |
getAllMembers(Class<?> baseClass,
Class<? extends Annotation> annotationClass) |
static List<Member> |
getDeclaredMembers(Class<?> baseClass) |
static <C extends AbstractConfig<C>> |
inheritConfig(C original,
C inherited) |
static <C extends AbstractConfig<C>> |
inheritMergeableListConfig(List<C> originalList,
List<C> inheritedList) |
static <T> List<T> |
inheritMergeableListProperty(List<T> originalList,
List<T> inheritedList) |
static <K,T> Map<K,T> |
inheritMergeableMapProperty(Map<K,T> originalMap,
Map<K,T> inheritedMap) |
static <T> T |
inheritOverwritableProperty(T original,
T inherited) |
static boolean |
isEmptyCollection(Collection<?> collection) |
static <T> T |
meldProperty(T a,
T b)
A relaxed version of
mergeProperty(Object, Object) . |
static <T> T |
mergeProperty(T a,
T b) |
static <T> T |
newInstance(Object bean,
String propertyName,
Class<T> clazz) |
static int |
resolveThreadPoolSizeScript(String propertyName,
String script,
String... magicValues) |
public static final String AVAILABLE_PROCESSOR_COUNT
public static <C extends AbstractConfig<C>> C inheritConfig(C original, C inherited)
public static <C extends AbstractConfig<C>> List<C> inheritMergeableListConfig(List<C> originalList, List<C> inheritedList)
public static <T> T inheritOverwritableProperty(T original, T inherited)
public static <T> List<T> inheritMergeableListProperty(List<T> originalList, List<T> inheritedList)
public static <K,T> Map<K,T> inheritMergeableMapProperty(Map<K,T> originalMap, Map<K,T> inheritedMap)
public static <T> T mergeProperty(T a, T b)
public static <T> T meldProperty(T a, T b)
mergeProperty(Object, Object)
. Used primarily for merging failed benchmarks,
where a property remains the same over benchmark runs (for example: dataset problem size), but the property in
the failed benchmark isn't initialized, therefore null. When merging, we can still use the correctly initialized
property of the benchmark that didn't fail.
Null-handling:
mergeProperty(Object, Object)
T
- the type of property a
and b
a
- property a
b
- property b
mergeProperty(Object, Object)
public static boolean isEmptyCollection(Collection<?> collection)
public static int ceilDivide(int dividend, int divisor)
Math.floorDiv(long, long)
.dividend
- the dividenddivisor
- the divisorArithmeticException
- if divisor == 0
public static int resolveThreadPoolSizeScript(String propertyName, String script, String... magicValues)
public static List<Class<?>> getAllAnnotatedLineageClasses(Class<?> bottomClass, Class<? extends Annotation> annotation)
public static List<Member> getDeclaredMembers(Class<?> baseClass)
baseClass
- never nullAlphabeticMemberComparator
.public static List<Member> getAllMembers(Class<?> baseClass, Class<? extends Annotation> annotationClass)
baseClass
- never nullannotationClass
- never nullAlphabeticMemberComparator
.public static Class<? extends Annotation> extractAnnotationClass(Member member, Class<? extends Annotation>... annotations)
public static MemberAccessor buildMemberAccessor(Member member, ConfigUtils.MemberAccessorType memberAccessorType, Class<? extends Annotation> annotationClass)
Copyright © 2006–2016 JBoss by Red Hat. All rights reserved.