Params { @NonNull public static <S extends IConfig> IParam<S, ObsGathering> onObsGathering(@NonNull ObsGathering defaultValue, @NonNull String frequencyKey, @NonNull String aggregationKey, @NonNull String skipKey) { return new ObsGatheringParam(defaultValue, frequencyKey, aggregationKey, skipKey); } private  Params(); @NonNull static IParam<S, String> onString(@NonNull String defaultValue, @NonNull String key); @NonNull static IParam<S, File> onFile(@NonNull File defaultValue, @NonNull String key); @NonNull static IParam<S, X> onEnum(@NonNull X defaultValue, @NonNull String key); @NonNull static IParam<S, Integer> onInteger(@NonNull Integer defaultValue, @NonNull String key); @NonNull static IParam<S, Long> onLong(@NonNull Long defaultValue, @NonNull String key); @NonNull static IParam<S, Boolean> onBoolean(@NonNull Boolean defaultValue, @NonNull String key); @NonNull static IParam<S, Character> onCharacter(@NonNull Character defaultValue, @NonNull String key); @NonNull static IParam<S, Double> onDouble(@NonNull Double defaultValue, @NonNull String key); @NonNull static IParam<S, Charset> onCharset(@NonNull Charset defaultValue, @NonNull String key); @Deprecated @NonNull static IParam<S, DataFormat> onDataFormat(@NonNull DataFormat defaultValue, @NonNull String localeKey, @NonNull String datePatternKey); @NonNull static IParam<S, DataFormat> onDataFormat(@NonNull DataFormat defaultValue, @NonNull String localeKey, @NonNull String datePatternKey, @NonNull String numberPatternKey); @NonNull static IParam<S, double[]> onDoubleArray(@NonNull String key, @NonNull double... defaultValues); @NonNull static IParam<S, String[]> onStringArray(@NonNull String key, @NonNull String... defaultValues); @NonNull static IParam<S, List<String>> onStringList(@NonNull List<String> defaultValue, @NonNull String key, @NonNull Splitter splitter, @NonNull Joiner joiner); @NonNull static IParam<S, ObsGathering> onObsGathering(@NonNull ObsGathering defaultValue, @NonNull String frequencyKey, @NonNull String aggregationKey, @NonNull String skipKey);  }
@Test @SuppressWarnings("null") public void testOnObsGathering() { ObsGathering defaultValue = ObsGathering.DEFAULT; ObsGathering newValue = ObsGathering.includingMissingValues(TsFrequency.Yearly, TsAggregationType.Average); assertBehavior(Params.onObsGathering(defaultValue, "f", "a", "s"), defaultValue, newValue, ImmutableMap.of("f", "Yearly", "a", "Average", "s", "false")); assertThatThrownBy(() -> Params.onObsGathering(null, "f", "a", "s")).isInstanceOf(NullPointerException.class); assertThatThrownBy(() -> Params.onObsGathering(defaultValue, null, "a", "s")).isInstanceOf(NullPointerException.class); assertThatThrownBy(() -> Params.onObsGathering(defaultValue, "f", null, "s")).isInstanceOf(NullPointerException.class); assertThatThrownBy(() -> Params.onObsGathering(defaultValue, "f", "a", null)).isInstanceOf(NullPointerException.class); }