Skip to content
This repository was archived by the owner on Jan 8, 2023. It is now read-only.

Commit a29307d

Browse files
committed
Fix javadoc
1 parent 8addbd3 commit a29307d

File tree

1 file changed

+12
-11
lines changed
  • src/main/java/io/github/spair/byond/dmi

1 file changed

+12
-11
lines changed

src/main/java/io/github/spair/byond/dmi/Dmi.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
@SuppressWarnings("WeakerAccess")
1818
public class Dmi {
1919

20-
/**
21-
* The number of states one Dmi file can store. More states than that value won't work properly.
22-
*/
20+
/** The number of states one Dmi file can store. More states than that value won't work properly. */
2321
public static final int MAX_STATES = 512;
2422

2523
private String name = "";
@@ -52,40 +50,43 @@ public void addState(final DmiState dmiState) {
5250
}
5351

5452
/**
55-
* Returns state with provided name or null if wasn't found.
53+
* Returns state with provided name or empty optional if not found.
5654
*
5755
* @param stateName state name to search
58-
* @return {@link DmiState} instance or null if wasn't found
56+
* @return {@link DmiState} instance or empty optional if not found
5957
*/
6058
public Optional<DmiState> getState(final String stateName) {
6159
return Optional.ofNullable(states.get(stateName));
6260
}
6361

6462
/**
65-
* Returns the first sprite of state with provided name or null if wasn't found.
63+
* Returns the first sprite of state with provided name or empty optional if not found.
6664
*
6765
* @param stateName state name to search
68-
* @return {@link DmiSprite} instance or null if wasn't found
66+
* @return {@link DmiSprite} instance or empty optional if not found
6967
*/
7068
public Optional<DmiSprite> getStateSprite(final String stateName) {
7169
return getState(stateName).flatMap(DmiState::getSprite);
7270
}
7371

7472
/**
75-
* Returns the first sprite of state with provided name and dir or null if wasn't found.
73+
* Returns sprite of state with provided name and dir or empty optional if not found.
7674
*
7775
* @param stateName state name to search
78-
* @return {@link DmiSprite} instance or null if wasn't found
76+
* @param dir dir value to search
77+
* @return {@link DmiSprite} instance or empty optional if not found
7978
*/
8079
public Optional<DmiSprite> getStateSprite(final String stateName, final SpriteDir dir) {
8180
return getState(stateName).flatMap(s -> s.getSprite(dir));
8281
}
8382

8483
/**
85-
* Returns sprite of state with provided name, dir and frame or null if wasn't found.
84+
* Returns sprite of state with provided name, dir and frame or empty optional if not found.
8685
*
8786
* @param stateName state name to search
88-
* @return {@link DmiSprite} instance or null if wasn't found
87+
* @param dir dir value to search
88+
* @param frame dir number to search
89+
* @return {@link DmiSprite} instance or empty optional if not found
8990
*/
9091
public Optional<DmiSprite> getStateSprite(final String stateName, final SpriteDir dir, final int frame) {
9192
return getState(stateName).flatMap(s -> s.getSprite(dir, frame));

0 commit comments

Comments
 (0)