diff --git a/core/src/main/java/io/github/almightysatan/jaskl/impl/WritableConfigEntry.java b/core/src/main/java/io/github/almightysatan/jaskl/impl/WritableConfigEntry.java index 4d9b0f6..d9d597a 100644 --- a/core/src/main/java/io/github/almightysatan/jaskl/impl/WritableConfigEntry.java +++ b/core/src/main/java/io/github/almightysatan/jaskl/impl/WritableConfigEntry.java @@ -37,17 +37,23 @@ public interface WritableConfigEntry extends ConfigEntry { * * @param keyPreprocessor a {@link Function} that will be invoked on all map keys * @return a value that can be written to a config - * @throws InvalidTypeException if the type of this ConfigEntry's value is incorrect. This shouldn't happen under normal circumstances. + * @throws InvalidTypeException if the type of this ConfigEntry's value is incorrect. This shouldn't happen under + * normal circumstances. + * @throws ValidationException if the value fails validation. This could for example happen when using an + * {@link io.github.almightysatan.jaskl.annotation.AnnotationManager}. */ - @NotNull Object getValueToWrite(@NotNull Function<@NotNull Object, @NotNull Object> keyPreprocessor) throws InvalidTypeException; + @NotNull Object getValueToWrite(@NotNull Function<@NotNull Object, @NotNull Object> keyPreprocessor) throws InvalidTypeException, ValidationException; /** * Returns the value that should be written to a persistent config. This also sets modified to false. * * @return a value that can be written to a config - * @throws InvalidTypeException if the type of this ConfigEntry's value is incorrect. This shouldn't happen under normal circumstances. + * @throws InvalidTypeException if the type of this ConfigEntry's value is incorrect. This shouldn't happen under + * normal circumstances. + * @throws ValidationException if the value fails validation. This could for example happen when using an + * {@link io.github.almightysatan.jaskl.annotation.AnnotationManager}. */ - default @NotNull Object getValueToWrite() throws InvalidTypeException { + default @NotNull Object getValueToWrite() throws InvalidTypeException, ValidationException { return this.getValueToWrite(Function.identity()); }