Uses of Interface
io.github.ttno1.configvalidation.ConfigFilter
Packages that use ConfigFilter
-
Uses of ConfigFilter in io.github.ttno1.configvalidation
Methods in io.github.ttno1.configvalidation that return ConfigFilterModifier and TypeMethodDescriptionstatic <T,
U> ConfigFilter <List<T>, List<U>> ConfigFilters.forEach
(ConfigFilter<T, U> filter) Returns a filter that applies the provided filter to a list of elements of the provided filter's input type and returns a list of elements of the provided filter's output type.
Similar toStream.map(java.util.function.Function)
.
Note that in the event of a failure, the returned filter will continue to apply the supplied filter to the remaining elements in the list and the fail message will contain the fail message of all failed list items.static <X> ConfigFilter
<X, X> ConfigFilter.nullFilter()
A "null" filter that does nothing.static <X> ConfigFilter
<X, X> Returns a ConfigFilter that runs the providedConsumer
and passes.default ConfigFilter
<T, U> Runs aConsumer
with the output of this filter.
Useful for retrieving the value of a filter.static <T extends Enum<T>>
ConfigFilter<String, T> Returns a filter that attempts to convert the input string into a value of the provided enum type and fails if the input string is not a valid enum type.
The filter will callString.toUpperCase()
on the input string and replace all spaces (U+0020) with underscores before attempting to callEnum.valueOf(Class, String)
.static ConfigFilter
<String, Path> ConfigFilters.validPath
(ConfigFilters.FileState fileState) Returns a filter that verifies that the input string is a valid file path, and optionally that the file meets the conditions specified by the providedConfigFilters.FileState
, and that converts the string to aPath
.static ConfigFilter
<String, URL> Returns a filter that first verifies that the input string is a valid URL using Apache Commons ValidatorUrlValidator.isValid(String)
with the provided schemes, and then attempts to convert the string into aURL
withURL(String)
.default <V> ConfigFilter
<T, V> ConfigFilter.withFilter
(ConfigFilter<U, V> filter) Returns a filter that takes in the input ofthis
and returns the output of the supplied filter.
Useful for chaining multiple filters together into one filter.Methods in io.github.ttno1.configvalidation with parameters of type ConfigFilterModifier and TypeMethodDescriptionstatic <T,
U> ConfigFilter <List<T>, List<U>> ConfigFilters.forEach
(ConfigFilter<T, U> filter) Returns a filter that applies the provided filter to a list of elements of the provided filter's input type and returns a list of elements of the provided filter's output type.
Similar toStream.map(java.util.function.Function)
.
Note that in the event of a failure, the returned filter will continue to apply the supplied filter to the remaining elements in the list and the fail message will contain the fail message of all failed list items.static <W> ConfigSpec
<W> Cfg.newSpec
(ConfigFilter<ConfigWrapper, W> filter) static <W,
X> ConfigList <Boolean, X, W> Cfg.List.ofBoolean
(ConfigFilter<List<X>, W> filter, ConfigFilter<Boolean, X> elementFilter) Creates a ConfigList for a list of boolean values with the specified filter and element filter.static <W> ConfigNode
<Boolean, W> Cfg.Node.ofBoolean
(ConfigFilter<Boolean, W> filter) Creates a ConfigNode for a boolean value with the specified filter.static <W,
X> ConfigList <Byte, X, W> Cfg.List.ofByte
(ConfigFilter<List<X>, W> filter, ConfigFilter<Byte, X> elementFilter) Creates a ConfigList for a list of byte values with the specified filter and element filter.static <W> ConfigNode
<Byte, W> Cfg.Node.ofByte
(ConfigFilter<Byte, W> filter) Creates a ConfigNode for a byte value with the specified filter.static <W,
X> ConfigList <ConfigWrapper, X, W> Cfg.List.ofConfigSpec
(ConfigFilter<List<X>, W> filter, ConfigSpec<X> configSpec) Creates a ConfigList for a list of config subsection values with the specified filter and with the specified ConfigSpec that is validated against every element.static <W,
X> ConfigList <Double, X, W> Cfg.List.ofDouble
(ConfigFilter<List<X>, W> filter, ConfigFilter<Double, X> elementFilter) Creates a ConfigList for a list of double values with the specified filter and element filter.static <W> ConfigNode
<Double, W> Cfg.Node.ofDouble
(ConfigFilter<Double, W> filter) Creates a ConfigNode for a double value with the specified filter.static <W,
X> ConfigList <Float, X, W> Cfg.List.ofFloat
(ConfigFilter<List<X>, W> filter, ConfigFilter<Float, X> elementFilter) Creates a ConfigList for a list of float values with the specified filter and element filter.static <W> ConfigNode
<Float, W> Cfg.Node.ofFloat
(ConfigFilter<Float, W> filter) Creates a ConfigNode for a float value with the specified filter.static <W,
X> ConfigList <Integer, X, W> Cfg.List.ofInteger
(ConfigFilter<List<X>, W> filter, ConfigFilter<Integer, X> elementFilter) Creates a ConfigList for a list of integer values with the specified filter and element filter.static <W> ConfigNode
<Integer, W> Cfg.Node.ofInteger
(ConfigFilter<Integer, W> filter) Creates a ConfigNode for a integer value with the specified filter.static <W,
X> ConfigList <List<Object>, W, X> Cfg.List.ofList
(ConfigFilter<List<W>, X> filter, ConfigFilter<List<Object>, W> elementFilter) Creates a ConfigList for a list of list values with the specified filter and element filter.static <W,
X> ConfigList <Long, X, W> Cfg.List.ofLong
(ConfigFilter<List<X>, W> filter, ConfigFilter<Long, X> elementFilter) Creates a ConfigList for a list of long values with the specified filter and element filter.static <W> ConfigNode
<Long, W> Cfg.Node.ofLong
(ConfigFilter<Long, W> filter) Creates a ConfigNode for a long value with the specified filter.static <W,
X> ConfigList <Short, X, W> Cfg.List.ofShort
(ConfigFilter<List<X>, W> filter, ConfigFilter<Short, X> elementFilter) Creates a ConfigList for a list of short values with the specified filter and element filter.static <W> ConfigNode
<Short, W> Cfg.Node.ofShort
(ConfigFilter<Short, W> filter) Creates a ConfigNode for a short value with the specified filter.static <W,
X> ConfigList <String, X, W> Cfg.List.ofString
(ConfigFilter<List<X>, W> filter, ConfigFilter<String, X> elementFilter) Creates a ConfigList for a list of string values with the specified filter and element filter.static <W> ConfigNode
<String, W> Cfg.Node.ofString
(ConfigFilter<String, W> filter) Creates a ConfigNode for a string value with the specified filter.default <V> ConfigFilter
<T, V> ConfigFilter.withFilter
(ConfigFilter<U, V> filter) Returns a filter that takes in the input ofthis
and returns the output of the supplied filter.
Useful for chaining multiple filters together into one filter.<V> ConfigNode
<T, V> ConfigNode.withFilter
(ConfigFilter<U, V> filter) Convenience method that returns a new ConfigNode with the provided filter appended onto the current filter usingwithFilter(ConfigFilter)
.