Skip to content

Commit 0b984dd

Browse files
committed
Update not null annotation usage
1 parent e1ae8df commit 0b984dd

File tree

7 files changed

+18
-27
lines changed

7 files changed

+18
-27
lines changed

src/main/java/net/onelitefeather/guira/SetupDataService.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import net.onelitefeather.guira.data.SetupData;
44
import org.jetbrains.annotations.Contract;
5-
import org.jetbrains.annotations.NotNull;
65
import org.jetbrains.annotations.Nullable;
76
import org.jetbrains.annotations.UnmodifiableView;
87

@@ -27,7 +26,7 @@ public interface SetupDataService {
2726
* @return a new instance of SetupDataService
2827
*/
2928
@Contract(pure = true)
30-
static @NotNull SetupDataService create() {
29+
static SetupDataService create() {
3130
return new SetupDataServiceImpl();
3231
}
3332

@@ -50,30 +49,29 @@ public interface SetupDataService {
5049
* @param uuid the unique identifier for the setup data
5150
* @param data the setup data to add
5251
*/
53-
void add(@NotNull UUID uuid, @NotNull SetupData data);
52+
void add(UUID uuid, SetupData data);
5453

5554
/**
5655
* Removes the setup data associated with the given UUID.
5756
*
5857
* @param uuid the unique identifier for the setup data
5958
* @return an optional containing the removed setup data, or empty if not found
6059
*/
61-
@NotNull Optional<@Nullable SetupData> remove(@NotNull UUID uuid);
60+
Optional<@Nullable SetupData> remove(UUID uuid);
6261

6362
/**
6463
* Retrieves the setup data associated with the given UUID.
6564
*
6665
* @param uuid the unique identifier for the setup data
6766
* @return an optional containing the setup data, or empty if not found
6867
*/
69-
@NotNull Optional<@Nullable SetupData> get(@NotNull UUID uuid);
68+
Optional<@Nullable SetupData> get(UUID uuid);
7069

7170
/**
7271
* Returns an unmodifiable view of the setup data map.
7372
*
7473
* @return an unmodifiable view
7574
*/
76-
@NotNull
7775
@UnmodifiableView
7876
Map<UUID, SetupData> getView();
7977
}

src/main/java/net/onelitefeather/guira/SetupDataServiceImpl.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package net.onelitefeather.guira;
22

33
import net.onelitefeather.guira.data.SetupData;
4-
import org.jetbrains.annotations.NotNull;
54
import org.jetbrains.annotations.UnmodifiableView;
65

76
import java.util.Collections;
@@ -51,31 +50,31 @@ public boolean isEmpty() {
5150
* {@inheritDoc}
5251
*/
5352
@Override
54-
public void add(@NotNull UUID uuid, @NotNull SetupData data) {
53+
public void add(UUID uuid, SetupData data) {
5554
dataMap.put(uuid, data);
5655
}
5756

5857
/**
5958
* {@inheritDoc}
6059
*/
6160
@Override
62-
public @NotNull Optional<SetupData> remove(@NotNull UUID uuid) {
61+
public Optional<SetupData> remove(UUID uuid) {
6362
return Optional.ofNullable(this.dataMap.remove(uuid));
6463
}
6564

6665
/**
6766
* {@inheritDoc}
6867
*/
6968
@Override
70-
public @NotNull Optional<SetupData> get(@NotNull UUID uuid) {
69+
public Optional<SetupData> get(UUID uuid) {
7170
return Optional.ofNullable(this.dataMap.get(uuid));
7271
}
7372

7473
/**
7574
* {@inheritDoc}
7675
*/
7776
@Override
78-
public @NotNull @UnmodifiableView Map<UUID, SetupData> getView() {
77+
public @UnmodifiableView Map<UUID, SetupData> getView() {
7978
return Collections.unmodifiableMap(this.dataMap);
8079
}
8180
}

src/main/java/net/onelitefeather/guira/data/MapSetupData.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import net.theevilreaper.aves.map.BaseMap;
44
import net.theevilreaper.aves.map.MapEntry;
5-
import org.jetbrains.annotations.NotNull;
65
import org.jetbrains.annotations.Nullable;
76

87
import java.util.Objects;
@@ -22,15 +21,15 @@ public abstract class MapSetupData<T extends BaseMap> implements SetupData {
2221

2322
protected final UUID uuid;
2423
protected final MapEntry mapEntry;
25-
protected T map;
24+
protected @Nullable T map;
2625

2726
/**
2827
* Creates a new instance of {@link MapSetupData} with the given UUID and map entry.
2928
*
3029
* @param uuid the unique identifier for the map setup data
3130
* @param mapEntry the map entry containing the map information
3231
*/
33-
protected MapSetupData(@NotNull UUID uuid, @NotNull MapEntry mapEntry) {
32+
protected MapSetupData(UUID uuid, MapEntry mapEntry) {
3433
this.uuid = uuid;
3534
this.mapEntry = mapEntry;
3635
}
@@ -60,7 +59,7 @@ public boolean hasMapFile() {
6059
*
6160
* @return the map entry as {@link MapEntry}
6261
*/
63-
public @NotNull MapEntry getEntry() {
62+
public MapEntry getEntry() {
6463
return this.mapEntry;
6564
}
6665

@@ -69,7 +68,7 @@ public boolean hasMapFile() {
6968
*
7069
* @return the map as {@link BaseMap}
7170
*/
72-
public @NotNull UUID getId() {
71+
public UUID getId() {
7372
return this.uuid;
7473
}
7574

@@ -78,7 +77,7 @@ public boolean hasMapFile() {
7877
*
7978
* @return an {@link Optional} containing the map if it exists, otherwise empty
8079
*/
81-
public @NotNull Optional<@Nullable T> getMap() {
80+
public Optional<@Nullable T> getMap() {
8281
return Optional.ofNullable(this.map);
8382
}
8483
}

src/main/java/net/onelitefeather/guira/data/SetupData.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package net.onelitefeather.guira.data;
22

3-
import org.jetbrains.annotations.NotNull;
4-
53
import java.util.UUID;
64

75
/**
@@ -33,5 +31,5 @@ public interface SetupData {
3331
*
3432
* @return the owner as {@link UUID}
3533
*/
36-
@NotNull UUID getId();
34+
UUID getId();
3735
}

src/main/java/net/onelitefeather/guira/event/SetupCreateEvent.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import net.minestom.server.event.Event;
44
import net.minestom.server.event.trait.CancellableEvent;
55
import net.onelitefeather.guira.data.SetupData;
6-
import org.jetbrains.annotations.NotNull;
76

87
/**
98
* The {@link SetupCreateEvent} can be used to indicate that a setup has started by the owner.
@@ -23,7 +22,7 @@ public class SetupCreateEvent implements Event, CancellableEvent {
2322
*
2423
* @param data the setup data that is involved in the event
2524
*/
26-
public SetupCreateEvent(@NotNull SetupData data) {
25+
public SetupCreateEvent(SetupData data) {
2726
this.data = data;
2827
}
2928

src/main/java/net/onelitefeather/guira/event/SetupFinishEvent.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import net.minestom.server.event.Event;
44
import net.minestom.server.event.trait.CancellableEvent;
55
import net.onelitefeather.guira.data.SetupData;
6-
import org.jetbrains.annotations.NotNull;
76

87
/**
98
* The {@link SetupFinishEvent} can be used to indicate that a setup process has been finished by the user.
@@ -24,7 +23,7 @@ public class SetupFinishEvent implements Event, CancellableEvent {
2423
*
2524
* @param setupData the setup data of the event
2625
*/
27-
public SetupFinishEvent(@NotNull SetupData setupData) {
26+
public SetupFinishEvent(SetupData setupData) {
2827
this.setupData = setupData;
2928
}
3029

@@ -53,7 +52,7 @@ public boolean isCancelled() {
5352
*
5453
* @return the setup data
5554
*/
56-
public @NotNull SetupData getData() {
55+
public SetupData getData() {
5756
return setupData;
5857
}
5958
}

src/main/java/net/onelitefeather/guira/functional/OptionalSetupDataGetter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package net.onelitefeather.guira.functional;
22

33
import net.onelitefeather.guira.data.SetupData;
4-
import org.jetbrains.annotations.NotNull;
54
import org.jetbrains.annotations.Nullable;
65

76
import java.util.Optional;
@@ -23,5 +22,5 @@ public interface OptionalSetupDataGetter {
2322
* @param uuid the {@link UUID} of the player
2423
* @return an Optional containing the setup data if it exists, or an empty Optional if it does not
2524
*/
26-
@NotNull Optional<@Nullable SetupData> get(@NotNull UUID uuid);
25+
Optional<@Nullable SetupData> get(UUID uuid);
2726
}

0 commit comments

Comments
 (0)