Skip to content

Commit

Permalink
Added and modified remaining annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Sxtanna committed Apr 11, 2022
1 parent d345d39 commit 9ea6971
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/ch/jalu/configme/SettingsManagerBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private SettingsManagerBuilder(@NotNull PropertyResource resource) {
*
* @return the settings manager
*/
public @Nullable SettingsManager create() {
public @NotNull SettingsManager create() {
Objects.requireNonNull(resource, "resource");
Objects.requireNonNull(configurationData, "configurationData");
return new SettingsManagerImpl(resource, configurationData, migrationService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import ch.jalu.configme.SettingsHolder;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.UnmodifiableView;

import java.util.Arrays;
import java.util.Collections;
Expand All @@ -14,7 +15,7 @@
*/
public class CommentsConfiguration {

private final Map<String, List<String>> comments;
private final @NotNull Map<String, List<String>> comments;

/**
* Constructor.
Expand Down Expand Up @@ -48,7 +49,7 @@ public void setComment(@NotNull String path, @NotNull String... commentLines) {
*
* @return map with all comments
*/
public @NotNull Map<String, List<String>> getAllComments() {
public @NotNull @UnmodifiableView Map<String, @UnmodifiableView List<String>> getAllComments() {
return Collections.unmodifiableMap(comments);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public interface ConfigurationData {
* @param <T> property type
* @return value associated with the property, or null if not present
*/
<T> T getValue(@NotNull Property<T> property);
<T> @Nullable T getValue(@NotNull Property<T> property);

/**
* Sets the given value for the given property. May throw an exception
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/jalu/configme/properties/Property.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ default boolean isValidInResource(@NotNull PropertyReader propertyReader) {
* @param value the value to convert to an export value
* @return value to use for export, null to skip the property
*/
@Nullable Object toExportValue(T value);
@Nullable Object toExportValue(@Nullable T value);

}

0 comments on commit 9ea6971

Please sign in to comment.