    001    package com.hammurapi.eventbus;
    002
    003    import java.util.Arrays;
    004
    005    import com.hammurapi.eventbus.AbstractEventBus.Handle;
    006
    007
    008    /**
    009     * @author Pavel Vlasov
    010     *
    011     * @param <E>
    012     * @param <P>
    013     * @param <C>
    014     * @param <H>
    015     */
    016    public class RemoveCommand<E, P extends Comparable<P>, C, K, H extends EventBus.Handle<E,P,C>, S extends EventStore<E,P,C,H,S>> extends InferenceCommand<E,P,C,K,H,S> {
    017
    018            private Handle<E,P,C,K> handle;
    019            private boolean forUpdate;
    020
    021            public RemoveCommand(
    022                            Handle<E,P,C,K> handle,
    023                            K handlerId,
    024                            EventHandler<E, P, C, H, S> handler,
    025                            InferenceContext<E,P,C,K,H,S> inferenceContext,
    026                            boolean forUpdate,
    027                            Handle<E,P,C,K>[] inputs) {
    028                    super(handlerId,handler,inputs,inferenceContext);
    029                    this.handle = handle;
    030                    this.forUpdate = forUpdate;
    031            }
    032
    033            public Handle<E, P, C, K> getHandle() {
    034                    return handle;
    035            }
    036
    037            public boolean isForUpdate() {
    038                    return forUpdate;
    039            }
    040
    041            @Override
    042            public String toString() {
    043                    return "RemoveCommand [handle=" + handle
    044                                    + ", handler=" + getHandler() + ", forUpdate=" + forUpdate + ", inputs="
    045                                    + Arrays.toString(getInputs()) + "]";
    046            }
    047
    048
    049    }