Annotation Type AssertLegal


  • @Target(METHOD)
    @Retention(RUNTIME)
    public @interface AssertLegal
    Annotation to be placed on methods in commands or queries. After an aggregate is loaded and a Aggregate is returned you can pass the command or query to the Aggregate.assertLegal(java.lang.Object) method to assert whether or not the command or query is allowed given the state of the model.

    Annotated methods should contain at least one parameter. The first parameter is reserved for the Model's entity (as obtained via Aggregate.get()).