Skip to content

Commit 6b60808

Browse files
committed
🎨 use Optional Object in order to avoid null return
1 parent c1efb23 commit 6b60808

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/io/asfjava/ui/core/SchemaDecoratorFactory.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package io.asfjava.ui.core;
22

33
import java.util.Map;
4+
import java.util.Optional;
45
import java.util.concurrent.ConcurrentHashMap;
56

67
import io.asfjava.ui.core.schema.decorators.SchemaDecorator;
78

89
public final class SchemaDecoratorFactory {
9-
public SchemaDecorator getDecorator(String annotationName) {
10-
return decorators.get(annotationName);
10+
public Optional<SchemaDecorator> getDecorator(String annotationName) {
11+
return Optional.ofNullable(decorators.get(annotationName));
1112
}
1213

1314
void register(String annotationName, SchemaDecorator generator) {

0 commit comments

Comments
 (0)