Annotation + ItemStoreBuilder should be more like a builder

This commit is contained in:
themode 2021-04-04 17:54:05 +02:00
parent 68de2b1980
commit 005d70e3a6
2 changed files with 5 additions and 3 deletions

View File

@ -106,8 +106,8 @@ public class ItemStack {
}
@Contract(value = "_ -> new", pure = true)
public @NotNull ItemStack withStore(@NotNull Consumer<@NotNull ItemStoreBuilder> metaOperator) {
return builder().store(metaOperator).build();
public @NotNull ItemStack withStore(@NotNull Consumer<@NotNull ItemStoreBuilder> storeConsumer) {
return builder().store(storeConsumer).build();
}
@Contract(pure = true)

View File

@ -20,8 +20,10 @@ public class ItemStoreBuilder {
this(new ConcurrentHashMap<>());
}
public <T> void set(@NotNull String key, T value, MergingRule<T> mergingRule) {
@Contract(value = "_, _, _ -> this")
public <T> @NotNull ItemStoreBuilder set(@NotNull String key, T value, MergingRule<T> mergingRule) {
this.entryMap.put(key, new Entry<>(value, mergingRule));
return this;
}
@Contract(value = "-> new", pure = true)