1717
1818import io .micrometer .core .instrument .config .validate .Validated ;
1919import io .micrometer .core .instrument .config .validate .ValidationException ;
20- import org .jspecify .annotations .Nullable ;
20+ import org .jspecify .annotations .NonNull ;
21+ import org .jspecify .annotations .NullUnmarked ;
2122
2223import java .util .Arrays ;
2324import java .util .function .Function ;
@@ -55,8 +56,8 @@ public static <M extends MeterRegistryConfig> Validated<?> checkAll(M config,
5556 * @return A function which, given a configuration instance, validates the property.
5657 */
5758 @ SuppressWarnings ("unchecked" )
58- public static <M extends MeterRegistryConfig , T extends @ Nullable Object > Function <M , Validated <T >> check (
59- String property , Function <M , T > getter ) {
59+ @ NullUnmarked public static <M extends @ NonNull MeterRegistryConfig , T > Function <M , Validated <T >> check (@ NonNull String property ,
60+ Function <M , T > getter ) {
6061 return config -> {
6162 try {
6263 return Validated .valid (config .prefix () + '.' + property , getter .apply (config ));
@@ -68,8 +69,8 @@ public static <M extends MeterRegistryConfig> Validated<?> checkAll(M config,
6869 };
6970 }
7071
71- public static <M extends MeterRegistryConfig , T extends @ Nullable Object > Function <M , Validated <T >> checkRequired (
72- String property , Function <M , T > getter ) {
72+ @ NullUnmarked public static <M extends @ NonNull MeterRegistryConfig , T > Function <M , Validated <T >> checkRequired (
73+ @ NonNull String property , Function <M , T > getter ) {
7374 return check (property , getter ).andThen (Validated ::required );
7475 }
7576
0 commit comments