Skip to content

Commit 90a10bd

Browse files
committed
javadoc.
1 parent 875c20a commit 90a10bd

File tree

4 files changed

+127
-117
lines changed

4 files changed

+127
-117
lines changed

src/main/java/org/meeuw/i18n/languages/ISO_639.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,17 @@ public class ISO_639 {
2424
static ThreadLocal<Boolean> ignoreNotFound = ThreadLocal.withInitial(() -> Boolean.FALSE);
2525
static ThreadLocal<Function<String, ISO_639_Code>> notFoundFallback = ThreadLocal.withInitial(() -> c -> NOTFOUND);
2626

27+
/**
28+
* If a code is not found in {@link #iso639(String)}, to throw {@link LanguageNotFoundException}, but return {@code null}
29+
*/
2730
public static RemoveIgnoreNotFound setIgnoreNotFound() {
2831
return setIgnoreNotFound(null);
2932
}
3033

34+
/**
35+
* If a code is not found in {@link #iso639(String)}, to throw {@link LanguageNotFoundException}, but produce use given function
36+
* @param fallback What to produce in those cases
37+
*/
3138
public static RemoveIgnoreNotFound setIgnoreNotFound(Function<String, ISO_639_Code> fallback) {
3239
ignoreNotFound.set(Boolean.TRUE);
3340
notFoundFallback.set(fallback);
@@ -230,6 +237,8 @@ public static Optional<ISO_639_Code> get(String code) {
230237
* @return The {@link ISO_639_3_Code} if found
231238
* @param code ISO-639 code to find
232239
* @throws LanguageNotFoundException if not found, unless {@link ISO_639#setIgnoreNotFound()} was set, in which case {@link LanguageCode#NOTFOUND}
240+
* @see #setIgnoreNotFound()
241+
* @see #setIgnoreNotFound(Function)
233242
*/
234243
public static ISO_639_Code iso639(String code) {
235244
if (ignoreNotFound.get()) {

0 commit comments

Comments
 (0)