/*
 * Copyright 2016, TeamDev Ltd. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package org.spine3.server.aggregate;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

//TODO:2016-03-24:alexander.yevsyukov: Update with description of new applier convention: getBuilder(), etc.

/**
 * Marks a method of an aggregate as one that modifies the state of the aggregate with data from the passed event.

 * <p>As we apply the event to the aggregate state, we call such method <i>Event Applier</i>.

 * <p>Event appliers are not supposed to be called from the outside of the declaring aggregate class.
 * As such they should be declared {@code private}.
 *
 * <p>The type of the event will be indicated by the first (and only) parameter.
 *
 * @author Alexander Yevsyukov
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Apply {
}


@@ -1048,16 +1048,53 @@
 egate;%0A%0A
+import com.google.protobuf.Message;%0A%0A
 import j
@@ -1251,118 +1251,8 @@
 t;%0A%0A
-//TODO:2016-03-24:alexander.yevsyukov: Update with description of new applier convention: getBuilder(), etc.%0A%0A
 /**%0A
@@ -1465,16 +1465,21 @@
 i%3E.%0A
+ *
 %0A * %3Cp%3E
-E
+An e
 vent
@@ -1490,125 +1490,82 @@
 lier
-s are not supposed to be called from the outside of the declaring aggregate class.%0A * As such they should be declared
+ method:%0A * %3Cul%3E%0A *     %3Cli%3Eis annotated with %7B@link Apply%7D;%0A *     %3Cli%3Eis
  %7B@c
@@ -1580,92 +1580,185 @@
 ate%7D
-.%0A *%0A * %3Cp%3EThe type of the event will be indicated by the first (and only) parame
+;%0A *     %3Cli%3Eis void;%0A *     %3Cli%3Eaccepts an event %7B@link Message%7D.%0A * %3C/ul%3E%0A *%0A * %3Cp%3ETypically %7B@link Aggregate#getBuilder()%7D method is used to get and update an aggregate sta
 te
-r
 .%0A *

Update @Apply docs.