Skip to content

Commit

Permalink
Add view of all component types
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubenicos committed Sep 18, 2024
1 parent 540b4e1 commit 49eadec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/com/saicone/rtag/data/ComponentType.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.lang.invoke.MethodHandle;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -170,6 +171,15 @@ public static Object of(String name) {
return TYPES.get(key(name));
}

/**
* Get all DataComponentType objects associated with its ID.
*
* @return an unmodifiable view of all types.
*/
public static Map<String, Object> all() {
return Collections.unmodifiableMap(TYPES);
}

/**
* Get declared codec from DataComponentType instance or ID.<br>
* Take in count that not all the component types provide a codec instance.
Expand Down

0 comments on commit 49eadec

Please sign in to comment.