@Test @DisplayName("not allow getting BoundedContext before registration") void notGetBcIfUnregistered() { assertThrows(IllegalStateException.class, () -> new TestRepo().context()); }
protected final BoundedContext context() { checkState(hasContext(), "The repository (class: `%s`) is not registered with a `BoundedContext`.", getClass().getName()); return context; }
Repository implements ContextAware, Closeable, Logging { protected final BoundedContext context() { checkState(hasContext(), "The repository (class: `%s`) is not registered with a `BoundedContext`.", getClass().getName()); return context; } }
Repository implements ContextAware, Closeable, Logging { protected final BoundedContext context() { checkState(hasContext(), "The repository (class: `%s`) is not registered with a `BoundedContext`.", getClass().getName()); return context; } protected  Repository(); }
Repository implements ContextAware, Closeable, Logging { protected final BoundedContext context() { checkState(hasContext(), "The repository (class: `%s`) is not registered with a `BoundedContext`.", getClass().getName()); return context; } protected  Repository(); abstract E create(I id); abstract Optional<E> find(I id); Iterator<E> iterator(Predicate<E> filter); Iterator<I> index(); @Internal EntityClass<E> entityModelClass(); @SuppressWarnings("unchecked") // The cast is ensured by generic parameters of the repository. final Class<I> idClass(); final Class<E> entityClass(); final TypeUrl entityStateType(); @OverridingMethodsMustInvokeSuper @Override @Internal void registerWith(BoundedContext context); @Override boolean isRegistered(); @SuppressWarnings("NoopMethodInAbstractClass") // see Javadoc @OverridingMethodsMustInvokeSuper void onRegistered(); @VisibleForTesting final boolean storageAssigned(); @Override @OverridingMethodsMustInvokeSuper void close(); @Override final boolean isOpen(); @Internal EntityLifecycle lifecycleOf(I id); @SPI @Pure EventFilter eventFilter(); }
Repository implements ContextAware, Closeable, Logging { protected final BoundedContext context() { checkState(hasContext(), "The repository (class: `%s`) is not registered with a `BoundedContext`.", getClass().getName()); return context; } protected  Repository(); abstract E create(I id); abstract Optional<E> find(I id); Iterator<E> iterator(Predicate<E> filter); Iterator<I> index(); @Internal EntityClass<E> entityModelClass(); @SuppressWarnings("unchecked") // The cast is ensured by generic parameters of the repository. final Class<I> idClass(); final Class<E> entityClass(); final TypeUrl entityStateType(); @OverridingMethodsMustInvokeSuper @Override @Internal void registerWith(BoundedContext context); @Override boolean isRegistered(); @SuppressWarnings("NoopMethodInAbstractClass") // see Javadoc @OverridingMethodsMustInvokeSuper void onRegistered(); @VisibleForTesting final boolean storageAssigned(); @Override @OverridingMethodsMustInvokeSuper void close(); @Override final boolean isOpen(); @Internal EntityLifecycle lifecycleOf(I id); @SPI @Pure EventFilter eventFilter();  }