danhaywood commented on code in PR #1019:
URL: https://github.com/apache/isis/pull/1019#discussion_r926786447


##########
api/applib/src/main/java/org/apache/isis/applib/services/bookmark/IdStringifier.java:
##########
@@ -0,0 +1,48 @@
+package org.apache.isis.applib.services.bookmark;
+
+import java.util.Optional;
+
+import lombok.Getter;
+
+/**
+ * SPI to allow other modules to extend the bookmarking mechanism.
+ *
+ * <p>
+ * Originally introduced to allow JPA CommandLog implementation use 
CommandLogEntryPK for its primary key.
+ * </p>
+ */
+public interface IdStringifier<T> {
+
+    boolean handles(Class<?> candidateClass);
+
+    Class<T> getHandledClass();
+
+    String stringify(final T value);
+
+    T parse(final String stringified);
+
+    abstract class Abstract<T> implements IdStringifier<T> {
+
+        @Getter
+        private final Class<T> handledClass;
+        /**
+         * Allows for a Stringifier to handle (for example) both 
<code>Integer.class</code> and <code>int.class</code>.
+         */
+        @Getter
+        private final Optional<Class<T>> primitiveClass;

Review Comment:
   it was applicable, this is how it's implemented.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to