public enum Utils extends Enum<Utils>
| Modifier and Type | Method and Description |
|---|---|
static Stream<String> |
allScriptsUnder(String prefix) |
static Stream<String> |
allScriptsUnderMatching(String prefix,
Pattern pattern) |
static Stream<Class<?>> |
allTypesAnnotatedWith(String prefix,
Class<? extends Annotation> annotation) |
static com.github.dakusui.jcunit.core.tuples.Tuple |
append(com.github.dakusui.jcunit.core.tuples.Tuple tuple,
String key,
Object value) |
static <T,R> R[] |
castArray(T[] array,
Class<R> klass) |
static <E extends ScriptiveUnitException> |
check(boolean cond,
Supplier<E> thrower) |
static <V> V |
check(V target,
Predicate<? super V> predicate,
String fmt,
Object... args) |
static <E extends ScriptiveUnitException,V> |
check(V target,
Predicate<? super V> predicate,
Supplier<? extends E> thrower) |
static <V> V |
checkState(V target,
Predicate<? super V> predicate) |
static <V> V |
checkState(V target,
Predicate<? super V> predicate,
String fmt,
Object... args) |
static <T> T |
convert(Object input,
Class<T> to) |
static <T> Object |
convertIfNecessary(Object input,
Class<T> type) |
static org.codehaus.jackson.node.ObjectNode |
deepMerge(org.codehaus.jackson.node.ObjectNode source,
org.codehaus.jackson.node.ObjectNode target) |
static com.github.dakusui.jcunit.core.tuples.Tuple |
filterSimpleSingleLevelParametersOut(com.github.dakusui.jcunit.core.tuples.Tuple tuple,
List<com.github.dakusui.jcunit8.factorspace.Parameter> factors) |
static Stream<Class<?>> |
findEntitiesUnder(String prefix,
Function<org.reflections.Reflections,Set<Class<?>>> func) |
static List<ObjectField> |
getAnnotatedFields(Object object,
Class<? extends Annotation> annotationClass) |
static List<ObjectMethod> |
getAnnotatedMethods(Object object,
Class<? extends Annotation> annotationClass,
Map<String,String> aliases) |
static <T extends Annotation> |
getAnnotation(AnnotatedElement annotatedElement,
Class<T> annotationClass,
T defaultInstance)
Returns an annotation element of a specified type (
annotationClass)
attached to annotatedElement. |
static <T> Constructor<T> |
getConstructor(Class<? extends T> clazz) |
static Object |
getFieldValue(Object object,
Field field) |
static boolean |
isCompatible(Object input,
Class<?> to) |
static String |
iterableToString(Iterable<?> i) |
static InputStream |
openResourceAsStream(String resourceName) |
static void |
performActionWithLogging(com.github.dakusui.actionunit.Action action) |
static <T,U> com.github.dakusui.actionunit.connectors.Pipe<T,U> |
prettify(String prettyString,
com.github.dakusui.actionunit.connectors.Pipe<T,U> pipe) |
static <T> Predicate<T> |
prettify(String prettyString,
Predicate<T> predicate) |
static Runnable |
prettify(String prettyString,
Runnable runnable) |
static <T> com.github.dakusui.actionunit.connectors.Sink<T> |
prettify(String prettyString,
com.github.dakusui.actionunit.connectors.Sink<T> sink) |
static <T> com.github.dakusui.actionunit.connectors.Source<T> |
prettify(String prettyString,
com.github.dakusui.actionunit.connectors.Source<T> source) |
static <T> Supplier<T> |
prettify(String prettyString,
Supplier<T> supplier) |
static org.codehaus.jackson.JsonNode |
readJsonNodeFromStream(InputStream is) |
static String |
template(String s,
Map<String,Object> map) |
static String |
toALL_CAPS(String inputString) |
static BigDecimal |
toBigDecimal(Number number) |
static Object |
toBigDecimalIfPossible(Object object) |
static String |
toCamelCase(String inputString) |
static Utils |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Utils[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
static <T> Class<T> |
wrap(Class<T> c) |
public static Utils[] values()
for (Utils c : Utils.values()) System.out.println(c);
public static Utils valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static <T,R> R[] castArray(T[] array,
Class<R> klass)
public static <T> com.github.dakusui.actionunit.connectors.Source<T> prettify(String prettyString, com.github.dakusui.actionunit.connectors.Source<T> source)
public static <T,U> com.github.dakusui.actionunit.connectors.Pipe<T,U> prettify(String prettyString, com.github.dakusui.actionunit.connectors.Pipe<T,U> pipe)
public static <T> com.github.dakusui.actionunit.connectors.Sink<T> prettify(String prettyString, com.github.dakusui.actionunit.connectors.Sink<T> sink)
public static com.github.dakusui.jcunit.core.tuples.Tuple filterSimpleSingleLevelParametersOut(com.github.dakusui.jcunit.core.tuples.Tuple tuple,
List<com.github.dakusui.jcunit8.factorspace.Parameter> factors)
public static com.github.dakusui.jcunit.core.tuples.Tuple append(com.github.dakusui.jcunit.core.tuples.Tuple tuple,
String key,
Object value)
public static void performActionWithLogging(com.github.dakusui.actionunit.Action action)
public static org.codehaus.jackson.node.ObjectNode deepMerge(org.codehaus.jackson.node.ObjectNode source,
org.codehaus.jackson.node.ObjectNode target)
public static <T> Constructor<T> getConstructor(Class<? extends T> clazz)
public static <E extends ScriptiveUnitException> void check(boolean cond, Supplier<E> thrower)
public static <E extends ScriptiveUnitException,V> V check(V target, Predicate<? super V> predicate, Supplier<? extends E> thrower)
public static <V> V check(V target,
Predicate<? super V> predicate,
String fmt,
Object... args)
public static <V> V checkState(V target,
Predicate<? super V> predicate)
public static <V> V checkState(V target,
Predicate<? super V> predicate,
String fmt,
Object... args)
public static BigDecimal toBigDecimal(Number number)
public static <T extends Annotation> T getAnnotation(AnnotatedElement annotatedElement, Class<T> annotationClass, T defaultInstance)
annotationClass)
attached to annotatedElement.
If it is not present, defaultInstance will be returned.annotatedElement - An element from which annotation object to be returned is retrieved.annotationClass - An annotation class of the instance to be returned.defaultInstance - An annotation object to be returned in the annotatedElement doesn't have it.public static List<ObjectMethod> getAnnotatedMethods(Object object, Class<? extends Annotation> annotationClass, Map<String,String> aliases)
public static List<ObjectField> getAnnotatedFields(Object object, Class<? extends Annotation> annotationClass)
public static InputStream openResourceAsStream(String resourceName)
public static org.codehaus.jackson.JsonNode readJsonNodeFromStream(InputStream is)
public static Stream<String> allScriptsUnderMatching(String prefix, Pattern pattern)
public static Stream<Class<?>> allTypesAnnotatedWith(String prefix, Class<? extends Annotation> annotation)
Copyright © 2017. All rights reserved.