Even more annotations

This commit is contained in:
themode 2021-04-01 00:32:21 +02:00
parent 5807da47a6
commit 70191e23e9

View File

@ -39,12 +39,13 @@ public class Item {
} }
@Contract(value = "_, -> new", pure = true) @Contract(value = "_, -> new", pure = true)
public @NotNull Item with(@NotNull Consumer<ItemBuilder> builderConsumer) { public @NotNull Item with(@NotNull Consumer<@NotNull ItemBuilder> builderConsumer) {
var builder = builder(); var builder = builder();
builderConsumer.accept(builder); builderConsumer.accept(builder);
return builder.build(); return builder.build();
} }
@Contract(pure = true)
public int getAmount() { public int getAmount() {
return amount; return amount;
} }
@ -59,6 +60,7 @@ public class Item {
return withAmount(intUnaryOperator.applyAsInt(amount)); return withAmount(intUnaryOperator.applyAsInt(amount));
} }
@Contract(pure = true)
public @Nullable Component getDisplayName() { public @Nullable Component getDisplayName() {
return displayName; return displayName;
} }
@ -73,6 +75,7 @@ public class Item {
return withDisplayName(componentUnaryOperator.apply(displayName)); return withDisplayName(componentUnaryOperator.apply(displayName));
} }
@Contract(pure = true)
public @Nullable List<@NotNull Component> getLore() { public @Nullable List<@NotNull Component> getLore() {
return lore; return lore;
} }