test_class.file: server/src/test/java/io/spine/server/entity/AbstractEntityTest.java
test_class.identifier: AbstractEntityTest
test_case.body: @Test
      @DisplayName("throw InvalidEntityStateException if state is invalid")
      void rejectInvalidState() {
          AbstractEntity<?, NaturalNumber> entity = new NaturalNumberEntity(0L);
          NaturalNumber invalidNaturalNumber = newNaturalNumber(-1);
          try {
              // This should pass.
              entity.updateState(newNaturalNumber(1));
  
              // This should fail.
              entity.updateState(invalidNaturalNumber);
  
              fail("Exception expected.");
          } catch (InvalidEntityStateException e) {
              assertThat(e.error()
                          .getValidationError()
                          .getConstraintViolationList()).hasSize(1);
          }
      }
test_case.class_method_signature: AbstractEntityTest.rejectInvalidState()
test_case.full_signature: @Test @DisplayName("throw InvalidEntityStateException if state is invalid") void rejectInvalidState()
test_case.identifier: rejectInvalidState
test_case.invocations: newNaturalNumber updateState newNaturalNumber updateState fail hasSize assertThat getConstraintViolationList getValidationError error
test_case.modifiers: @Test @DisplayName("throw InvalidEntityStateException if state is invalid")
test_case.parameters: ()
test_case.return: void
test_case.signature: void rejectInvalidState()
focal_class.declarator: thisClass
focal_class.modifier: @LazyInit
      private volatile @MonotonicNonNull
focal_class.original_string: @LazyInit
      private volatile @MonotonicNonNull EntityClass<?> thisClass;
focal_class.type: EntityClass<?>
focal_class.var_name: thisClass
focal_class.declarator: id
focal_class.modifier: private @MonotonicNonNull
focal_class.original_string: private @MonotonicNonNull I id;
focal_class.type: I
focal_class.var_name: id
focal_class.declarator: stringId
focal_class.modifier: @LazyInit
      private volatile @MonotonicNonNull
focal_class.original_string: @LazyInit
      private volatile @MonotonicNonNull String stringId;
focal_class.type: String
focal_class.var_name: stringId
focal_class.declarator: state
focal_class.modifier: @LazyInit
      private volatile @MonotonicNonNull
focal_class.original_string: @LazyInit
      private volatile @MonotonicNonNull S state;
focal_class.type: S
focal_class.var_name: state
focal_class.declarator: version
focal_class.modifier: private volatile
focal_class.original_string: private volatile Version version;
focal_class.type: Version
focal_class.var_name: version
focal_class.declarator: lifecycleFlags
focal_class.modifier: private volatile @MonotonicNonNull
focal_class.original_string: private volatile @MonotonicNonNull LifecycleFlags lifecycleFlags;
focal_class.type: LifecycleFlags
focal_class.var_name: lifecycleFlags
focal_class.declarator: lifecycleFlagsChanged
focal_class.modifier: private volatile
focal_class.original_string: private volatile boolean lifecycleFlagsChanged;
focal_class.type: boolean
focal_class.var_name: lifecycleFlagsChanged
focal_class.declarator: handlerLog
focal_class.modifier: private @Nullable
focal_class.original_string: private @Nullable HandlerLog handlerLog;
focal_class.type: HandlerLog
focal_class.var_name: handlerLog
focal_class.file: server/src/main/java/io/spine/server/entity/AbstractEntity.java
focal_class.identifier: AbstractEntity
focal_class.interfaces: implements Entity<I, S>, HandlerLifecycle
focal_class.class_method_signature: AbstractEntity.AbstractEntity()
focal_class.full_signature: protected  AbstractEntity()
focal_class.identifier: AbstractEntity
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.signature:  AbstractEntity()
focal_class.class_method_signature: AbstractEntity.AbstractEntity(I id)
focal_class.full_signature: protected  AbstractEntity(I id)
focal_class.identifier: AbstractEntity
focal_class.modifiers: protected
focal_class.parameters: (I id)
focal_class.signature:  AbstractEntity(I id)
focal_class.class_method_signature: AbstractEntity.setId(I id)
focal_class.full_signature: @SuppressWarnings("InstanceVariableUsedBeforeInitialized") // checked in `if` final void setId(I id)
focal_class.identifier: setId
focal_class.modifiers: @SuppressWarnings("InstanceVariableUsedBeforeInitialized") // checked in `if` final
focal_class.parameters: (I id)
focal_class.return: void
focal_class.signature: void setId(I id)
focal_class.class_method_signature: AbstractEntity.AbstractEntity(I id, Function<I, S> defaultState)
focal_class.full_signature: protected  AbstractEntity(I id, Function<I, S> defaultState)
focal_class.identifier: AbstractEntity
focal_class.modifiers: protected
focal_class.parameters: (I id, Function<I, S> defaultState)
focal_class.signature:  AbstractEntity(I id, Function<I, S> defaultState)
focal_class.class_method_signature: AbstractEntity.id()
focal_class.full_signature: @Override public I id()
focal_class.identifier: id
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: I
focal_class.signature: I id()
focal_class.class_method_signature: AbstractEntity.state()
focal_class.full_signature: @Override public final S state()
focal_class.identifier: state
focal_class.modifiers: @Override public final
focal_class.parameters: ()
focal_class.return: S
focal_class.signature: S state()
focal_class.class_method_signature: AbstractEntity.thisClass()
focal_class.full_signature: @Internal protected EntityClass<?> thisClass()
focal_class.identifier: thisClass
focal_class.modifiers: @Internal protected
focal_class.parameters: ()
focal_class.return: EntityClass<?>
focal_class.signature: EntityClass<?> thisClass()
focal_class.class_method_signature: AbstractEntity.modelClass()
focal_class.full_signature: @Internal protected EntityClass<?> modelClass()
focal_class.identifier: modelClass
focal_class.modifiers: @Internal protected
focal_class.parameters: ()
focal_class.return: EntityClass<?>
focal_class.signature: EntityClass<?> modelClass()
focal_class.class_method_signature: AbstractEntity.setState(S newState)
focal_class.full_signature:  void setState(S newState)
focal_class.identifier: setState
focal_class.parameters: (S newState)
focal_class.return: void
focal_class.signature: void setState(S newState)
focal_class.class_method_signature: AbstractEntity.defaultState()
focal_class.full_signature: protected final S defaultState()
focal_class.identifier: defaultState
focal_class.modifiers: protected final
focal_class.parameters: ()
focal_class.return: S
focal_class.signature: S defaultState()
focal_class.class_method_signature: AbstractEntity.updateState(S state)
focal_class.full_signature: final void updateState(S state)
focal_class.identifier: updateState
focal_class.modifiers: final
focal_class.parameters: (S state)
focal_class.return: void
focal_class.signature: void updateState(S state)
focal_class.class_method_signature: AbstractEntity.checkEntityState(S newState)
focal_class.full_signature: protected final List<ConstraintViolation> checkEntityState(S newState)
focal_class.identifier: checkEntityState
focal_class.modifiers: protected final
focal_class.parameters: (S newState)
focal_class.return: List<ConstraintViolation>
focal_class.signature: List<ConstraintViolation> checkEntityState(S newState)
focal_class.class_method_signature: AbstractEntity.validate(S newState)
focal_class.full_signature: private void validate(S newState)
focal_class.identifier: validate
focal_class.modifiers: private
focal_class.parameters: (S newState)
focal_class.return: void
focal_class.signature: void validate(S newState)
focal_class.class_method_signature: AbstractEntity.idAsString()
focal_class.full_signature: @Override public String idAsString()
focal_class.identifier: idAsString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String idAsString()
focal_class.class_method_signature: AbstractEntity.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: AbstractEntity.setLifecycleFlags(LifecycleFlags lifecycleFlags)
focal_class.full_signature:  void setLifecycleFlags(LifecycleFlags lifecycleFlags)
focal_class.identifier: setLifecycleFlags
focal_class.parameters: (LifecycleFlags lifecycleFlags)
focal_class.return: void
focal_class.signature: void setLifecycleFlags(LifecycleFlags lifecycleFlags)
focal_class.class_method_signature: AbstractEntity.getLifecycleFlags()
focal_class.full_signature: @Override public LifecycleFlags getLifecycleFlags()
focal_class.identifier: getLifecycleFlags
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: LifecycleFlags
focal_class.signature: LifecycleFlags getLifecycleFlags()
focal_class.class_method_signature: AbstractEntity.isArchived()
focal_class.full_signature: @Override public final boolean isArchived()
focal_class.identifier: isArchived
focal_class.modifiers: @Override public final
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isArchived()
focal_class.class_method_signature: AbstractEntity.setArchived(boolean archived)
focal_class.full_signature: protected void setArchived(boolean archived)
focal_class.identifier: setArchived
focal_class.modifiers: protected
focal_class.parameters: (boolean archived)
focal_class.return: void
focal_class.signature: void setArchived(boolean archived)
focal_class.class_method_signature: AbstractEntity.isDeleted()
focal_class.full_signature: @Override public final boolean isDeleted()
focal_class.identifier: isDeleted
focal_class.modifiers: @Override public final
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isDeleted()
focal_class.class_method_signature: AbstractEntity.setDeleted(boolean deleted)
focal_class.full_signature: protected void setDeleted(boolean deleted)
focal_class.identifier: setDeleted
focal_class.modifiers: protected
focal_class.parameters: (boolean deleted)
focal_class.return: void
focal_class.signature: void setDeleted(boolean deleted)
focal_class.class_method_signature: AbstractEntity.checkNotArchived()
focal_class.full_signature: protected void checkNotArchived()
focal_class.identifier: checkNotArchived
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void checkNotArchived()
focal_class.class_method_signature: AbstractEntity.checkNotDeleted()
focal_class.full_signature: protected void checkNotDeleted()
focal_class.identifier: checkNotDeleted
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void checkNotDeleted()
focal_class.class_method_signature: AbstractEntity.lifecycleFlagsChanged()
focal_class.full_signature: @Override public boolean lifecycleFlagsChanged()
focal_class.identifier: lifecycleFlagsChanged
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean lifecycleFlagsChanged()
focal_class.class_method_signature: AbstractEntity.clearLifecycleFlags()
focal_class.full_signature: private void clearLifecycleFlags()
focal_class.identifier: clearLifecycleFlags
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clearLifecycleFlags()
focal_class.class_method_signature: AbstractEntity.updateState(S state, Version version)
focal_class.full_signature: final void updateState(S state, Version version)
focal_class.identifier: updateState
focal_class.modifiers: final
focal_class.parameters: (S state, Version version)
focal_class.return: void
focal_class.signature: void updateState(S state, Version version)
focal_class.class_method_signature: AbstractEntity.versionNumber()
focal_class.full_signature: protected int versionNumber()
focal_class.identifier: versionNumber
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int versionNumber()
focal_class.class_method_signature: AbstractEntity.updateVersion(Version newVersion)
focal_class.full_signature: final void updateVersion(Version newVersion)
focal_class.identifier: updateVersion
focal_class.modifiers: final
focal_class.parameters: (Version newVersion)
focal_class.return: void
focal_class.signature: void updateVersion(Version newVersion)
focal_class.class_method_signature: AbstractEntity.incrementState(S newState)
focal_class.full_signature: @VisibleForTesting void incrementState(S newState)
focal_class.identifier: incrementState
focal_class.modifiers: @VisibleForTesting
focal_class.parameters: (S newState)
focal_class.return: void
focal_class.signature: void incrementState(S newState)
focal_class.class_method_signature: AbstractEntity.setVersion(Version version)
focal_class.full_signature:  void setVersion(Version version)
focal_class.identifier: setVersion
focal_class.parameters: (Version version)
focal_class.return: void
focal_class.signature: void setVersion(Version version)
focal_class.class_method_signature: AbstractEntity.incrementedVersion()
focal_class.full_signature: private Version incrementedVersion()
focal_class.identifier: incrementedVersion
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Version
focal_class.signature: Version incrementedVersion()
focal_class.class_method_signature: AbstractEntity.version()
focal_class.full_signature: @Override public Version version()
focal_class.identifier: version
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Version
focal_class.signature: Version version()
focal_class.class_method_signature: AbstractEntity.incrementVersion()
focal_class.full_signature:  int incrementVersion()
focal_class.identifier: incrementVersion
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int incrementVersion()
focal_class.class_method_signature: AbstractEntity.whenModified()
focal_class.full_signature: public Timestamp whenModified()
focal_class.identifier: whenModified
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Timestamp
focal_class.signature: Timestamp whenModified()
focal_class.class_method_signature: AbstractEntity.beforeInvoke(HandlerMethod<?, ?, ?, ?> method)
focal_class.full_signature: @OverridingMethodsMustInvokeSuper @Override public void beforeInvoke(HandlerMethod<?, ?, ?, ?> method)
focal_class.identifier: beforeInvoke
focal_class.modifiers: @OverridingMethodsMustInvokeSuper @Override public
focal_class.parameters: (HandlerMethod<?, ?, ?, ?> method)
focal_class.return: void
focal_class.signature: void beforeInvoke(HandlerMethod<?, ?, ?, ?> method)
focal_class.class_method_signature: AbstractEntity.afterInvoke(HandlerMethod<?, ?, ?, ?> method)
focal_class.full_signature: @OverridingMethodsMustInvokeSuper @Override public void afterInvoke(HandlerMethod<?, ?, ?, ?> method)
focal_class.identifier: afterInvoke
focal_class.modifiers: @OverridingMethodsMustInvokeSuper @Override public
focal_class.parameters: (HandlerMethod<?, ?, ?, ?> method)
focal_class.return: void
focal_class.signature: void afterInvoke(HandlerMethod<?, ?, ?, ?> method)
focal_class.class_method_signature: AbstractEntity.at(Level logLevel)
focal_class.full_signature: public final FluentLogger.Api at(Level logLevel)
focal_class.identifier: at
focal_class.modifiers: public final
focal_class.parameters: (Level logLevel)
focal_class.return: FluentLogger.Api
focal_class.signature: FluentLogger.Api at(Level logLevel)
focal_class.class_method_signature: AbstractEntity.equals(Object o)
focal_class.full_signature: @Override public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.class_method_signature: AbstractEntity.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_method.body: final void updateState(S state) {
          checkNotNull(state);
          validate(state);
          setState(state);
      }
focal_method.class_method_signature: AbstractEntity.updateState(S state)
focal_method.full_signature: final void updateState(S state)
focal_method.identifier: updateState
focal_method.invocations: checkNotNull validate setState
focal_method.modifiers: final
focal_method.parameters: (S state)
focal_method.return: void
focal_method.signature: void updateState(S state)