File tree Expand file tree Collapse file tree
src/main/java/com/apicatalog/multibase Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,4 +98,32 @@ public byte[] decode(final String encoded) {
9898 .map (base -> base .decode (encoded ))
9999 .orElseThrow (() -> new IllegalArgumentException ("Unsupported multibase encoding [" + encoded .charAt (0 ) + "]." ));
100100 }
101+
102+ /**
103+ * Returns an unmodifiable view of the registered multibase encodings.
104+ *
105+ * <p>
106+ * The returned map associates each multibase prefix character with its
107+ * corresponding {@link Multibase} instance. Attempts to modify the map (e.g.
108+ * {@code put}, {@code remove}) will result in an
109+ * {@link UnsupportedOperationException}.
110+ * </p>
111+ *
112+ * @return an unmodifiable map of prefix characters to {@link Multibase}
113+ * instances
114+ */
115+ public Map <Character , Multibase > bases () {
116+ return bases ;
117+ }
118+
119+ /**
120+ * Returns the number of multibase encodings currently registered with this
121+ * decoder.
122+ *
123+ * @return the count of registered encodings
124+ */
125+ public long size () {
126+ return bases .size ();
127+ }
128+
101129}
You can’t perform that action at this time.
0 commit comments