/******************************************************************************************************************* * * ******************************************************************************************************************/ @Nonnull private Id internalCreateId (final @Nonnull Class<?> clazz, final @CheckForNull Object object) { // FIXME: cache for performance // FIXME: the list should be ordered from subclasses to superclasses for managing inheritance for (final IdFactoryDelegate<?> idFactoryDelegate : Lookup.getDefault().lookupAll(IdFactoryDelegate.class)) { if (idFactoryDelegate.getManagedClass().isAssignableFrom(clazz)) { return idFactoryDelegate.createId(object); } } throw new RuntimeException("There's no IdFactoryDelegate for Object installed in the system"); } }
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Nonnull private Id internalCreateId (final @Nonnull Class<?> clazz, final @CheckForNull Object object) { // FIXME: cache for performance // FIXME: the list should be ordered from subclasses to superclasses for managing inheritance for (final IdFactoryDelegate<?> idFactoryDelegate : Lookup.getDefault().lookupAll(IdFactoryDelegate.class)) { if (idFactoryDelegate.getManagedClass().isAssignableFrom(clazz)) { return idFactoryDelegate.createId(object); } } throw new RuntimeException("There's no IdFactoryDelegate for Object installed in the system"); } }