Skip to content

Commit 18d1e50

Browse files
Add functional interfaces (#21)
* Add functional interfaces * Update functional interfaces to reflect latest changes --------- Co-authored-by: theEvilReaper <theEvilReaper@users.noreply.github.com>
1 parent 52cf9be commit 18d1e50

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package net.onelitefeather.guira.functional;
2+
3+
import net.onelitefeather.guira.data.SetupData;
4+
import org.jetbrains.annotations.NotNull;
5+
import org.jetbrains.annotations.Nullable;
6+
7+
import java.util.Optional;
8+
import java.util.UUID;
9+
10+
/**
11+
* Functional interface for getting setup data associated with a specific {@link UUID}.
12+
*
13+
* @author theEvilReaper
14+
* @version 0.1.0
15+
* @since 0.3.0
16+
*/
17+
@FunctionalInterface
18+
public interface OptionalSetupGetter {
19+
20+
/**
21+
* Gets the setup data for the given {@link UUID}.
22+
*
23+
* @param uuid the {@link UUID} of the player
24+
* @return an Optional containing the setup data if it exists, or an empty Optional if it does not
25+
*/
26+
@NotNull Optional<@Nullable SetupData> get(@NotNull UUID uuid);
27+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package net.onelitefeather.guira.functional;
2+
3+
import net.onelitefeather.guira.data.SetupData;
4+
import org.jetbrains.annotations.NotNull;
5+
import org.jetbrains.annotations.Nullable;
6+
7+
import java.util.UUID;
8+
9+
/**
10+
* Functional interface for getting setup data associated with a specific {@link UUID}.
11+
*
12+
* @author theEvilReaper
13+
* @version 0.1.0
14+
* @since 0.3.0
15+
*/
16+
@FunctionalInterface
17+
public interface SetupDataGetter {
18+
19+
/**
20+
* Retrieves the setup data for the specified {@link UUID}.
21+
*
22+
* @param uuid the {@link UUID} of the player
23+
* @return the setup data associated with the {@link UUID}, or null if no data exists
24+
*/
25+
@Nullable SetupData getData(@NotNull UUID uuid);
26+
}

0 commit comments

Comments
 (0)