@SuppressWarnings("ConstantConditions") @Test @DisplayName("not accept null to `checkEntityState`") void rejectNullState() { AnEntity entity = new AnEntity(0L); assertThrows(NullPointerException.class, () -> entity.checkEntityState(null)); }
protected final List<ConstraintViolation> checkEntityState(S newState) { checkNotNull(newState); ImmutableList.Builder<ConstraintViolation> violations = ImmutableList.builder(); violations.addAll(violationsOf(newState)); violations.addAll(validateChange(state(), newState)); return violations.build(); }
AbstractEntity implements Entity<I, S>, HandlerLifecycle { protected final List<ConstraintViolation> checkEntityState(S newState) { checkNotNull(newState); ImmutableList.Builder<ConstraintViolation> violations = ImmutableList.builder(); violations.addAll(violationsOf(newState)); violations.addAll(validateChange(state(), newState)); return violations.build(); } }
AbstractEntity implements Entity<I, S>, HandlerLifecycle { protected final List<ConstraintViolation> checkEntityState(S newState) { checkNotNull(newState); ImmutableList.Builder<ConstraintViolation> violations = ImmutableList.builder(); violations.addAll(violationsOf(newState)); violations.addAll(validateChange(state(), newState)); return violations.build(); } protected  AbstractEntity(); protected  AbstractEntity(I id); protected  AbstractEntity(I id, Function<I, S> defaultState); }
AbstractEntity implements Entity<I, S>, HandlerLifecycle { protected final List<ConstraintViolation> checkEntityState(S newState) { checkNotNull(newState); ImmutableList.Builder<ConstraintViolation> violations = ImmutableList.builder(); violations.addAll(violationsOf(newState)); violations.addAll(validateChange(state(), newState)); return violations.build(); } protected  AbstractEntity(); protected  AbstractEntity(I id); protected  AbstractEntity(I id, Function<I, S> defaultState); @Override I id(); @Override final S state(); @Override String idAsString(); @Override String toString(); @Override LifecycleFlags getLifecycleFlags(); @Override final boolean isArchived(); @Override final boolean isDeleted(); @Override boolean lifecycleFlagsChanged(); @Override Version version(); Timestamp whenModified(); @OverridingMethodsMustInvokeSuper @Override void beforeInvoke(HandlerMethod<?, ?, ?, ?> method); @OverridingMethodsMustInvokeSuper @Override void afterInvoke(HandlerMethod<?, ?, ?, ?> method); final FluentLogger.Api at(Level logLevel); @Override boolean equals(Object o); @Override int hashCode(); }
AbstractEntity implements Entity<I, S>, HandlerLifecycle { protected final List<ConstraintViolation> checkEntityState(S newState) { checkNotNull(newState); ImmutableList.Builder<ConstraintViolation> violations = ImmutableList.builder(); violations.addAll(violationsOf(newState)); violations.addAll(validateChange(state(), newState)); return violations.build(); } protected  AbstractEntity(); protected  AbstractEntity(I id); protected  AbstractEntity(I id, Function<I, S> defaultState); @Override I id(); @Override final S state(); @Override String idAsString(); @Override String toString(); @Override LifecycleFlags getLifecycleFlags(); @Override final boolean isArchived(); @Override final boolean isDeleted(); @Override boolean lifecycleFlagsChanged(); @Override Version version(); Timestamp whenModified(); @OverridingMethodsMustInvokeSuper @Override void beforeInvoke(HandlerMethod<?, ?, ?, ?> method); @OverridingMethodsMustInvokeSuper @Override void afterInvoke(HandlerMethod<?, ?, ?, ?> method); final FluentLogger.Api at(Level logLevel); @Override boolean equals(Object o); @Override int hashCode();  }