Package org.radarbase.schema.util
Class SchemaUtils
- java.lang.Object
-
- org.radarbase.schema.util.SchemaUtils
-
public final class SchemaUtils extends java.lang.ObjectTODO.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSchemaUtils.ThrowingFunction<T,R>Function that may throw an exception.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T,R>
java.util.function.Function<T,java.util.stream.Stream<R>>applyOrEmpty(SchemaUtils.ThrowingFunction<T,java.util.stream.Stream<R>> func)Apply a throwing function, and if it throws, log it and let it return an empty Stream.static <T,R>
java.util.function.Function<T,java.util.stream.Stream<R>>applyOrIllegalException(SchemaUtils.ThrowingFunction<T,java.util.stream.Stream<R>> func)Apply a throwing function, and if it throws, log it and let it return an empty Stream.static java.lang.StringexpandClass(java.lang.String classShorthand)Expand a class name with the group name if it starts with a dot.static java.lang.StringgetProjectGroup()TODO.static java.lang.StringsnakeToCamelCase(java.lang.String value)Converts given file name from snake_case to CamelCase.
-
-
-
Method Detail
-
getProjectGroup
public static java.lang.String getProjectGroup()
TODO.- Returns:
- TODO
-
expandClass
public static java.lang.String expandClass(java.lang.String classShorthand)
Expand a class name with the group name if it starts with a dot.- Parameters:
classShorthand- class name, possibly starting with a dot as a shorthand.- Returns:
- class name or
nullif null or empty.
-
snakeToCamelCase
public static java.lang.String snakeToCamelCase(java.lang.String value)
Converts given file name from snake_case to CamelCase. This will cause underscores to be removed, and the next character to be uppercase. This only converts the value up to the first dot encountered.- Parameters:
value- file name in snake_case- Returns:
- main part of file name in CamelCase.
-
applyOrEmpty
public static <T,R> java.util.function.Function<T,java.util.stream.Stream<R>> applyOrEmpty(SchemaUtils.ThrowingFunction<T,java.util.stream.Stream<R>> func)
Apply a throwing function, and if it throws, log it and let it return an empty Stream.
-
applyOrIllegalException
public static <T,R> java.util.function.Function<T,java.util.stream.Stream<R>> applyOrIllegalException(SchemaUtils.ThrowingFunction<T,java.util.stream.Stream<R>> func)
Apply a throwing function, and if it throws, log it and let it return an empty Stream.
-
-