package info.izumin.android.droidux.processor.fixture;

/**
 * Created by izumin on 11/2/15.
 */
public final class Source {
    public static final String TAG = Source.class.getSimpleName();

    public static final String[] EMPTY = {};

    public static final class StoreImpl {
        public static final String[] COUNTER = {
                "package info.izumin.android.droidux.sample;",
                "",
                "import info.izumin.android.droidux.Action;",
                "import info.izumin.android.droidux.StoreImpl;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "import info.izumin.android.droidux.processor.fixture.CounterReducer;",
                "import info.izumin.android.droidux.processor.fixture.action.ClearCountAction;",
                "import info.izumin.android.droidux.processor.fixture.action.IncrementCountAction;",
                "import info.izumin.android.droidux.processor.fixture.action.InitializeCountAction;",
                "import info.izumin.android.droidux.processor.fixture.action.SquareCountAction;",
                "",
                "final class DroiduxRootStore_CounterStoreImpl extends StoreImpl<Counter, CounterReducer> {",
                "    protected DroiduxRootStore_CounterStoreImpl(Counter state, CounterReducer reducer) {",
                "        super(state, reducer);",
                "    }",
                "",
                "    @Override",
                "    protected void dispatch(Action action) {",
                "        Class<? extends Action> actionClass = action.getClass();",
                "        Counter result = null;",
                "        if (IncrementCountAction.class.isAssignableFrom(actionClass)) {",
                "            result = getReducer().increment(getState(), (IncrementCountAction) action);",
                "        }",
                "        if (SquareCountAction.class.isAssignableFrom(actionClass)) {",
                "            result = getReducer().square(getState());",
                "        }",
                "        if (InitializeCountAction.class.isAssignableFrom(actionClass)) {",
                "            result = getReducer().initialize((InitializeCountAction) action);",
                "        }",
                "        if (ClearCountAction.class.isAssignableFrom(actionClass)) {",
                "            result = getReducer().clear();",
                "        }",
                "        if (result != null) {",
                "            setState(result);",
                "        }",
                "    }",
                "}"
        };

        public static final String[] TODO_LIST = {
                "package info.izumin.android.droidux.sample;",
                "",
                "import info.izumin.android.droidux.Action;",
                "import info.izumin.android.droidux.UndoableStoreImpl;",
                "import info.izumin.android.droidux.processor.fixture.TodoList;",
                "import info.izumin.android.droidux.processor.fixture.TodoListReducer;",
                "import info.izumin.android.droidux.processor.fixture.action.AddTodoItemAction;",
                "",
                "final class DroiduxRootStore_TodoListStoreImpl extends UndoableStoreImpl<TodoList, TodoListReducer> {",
                "    protected DroiduxCounterStore_CounterStoreImpl(TodoList state, TodoListReducer reducer) {",
                "        super(state, reducer);",
                "    }",
                "",
                "    @Override",
                "    protected void dispatch(Action action) {",
                "        super.dispatch(action);",
                "        Class<? extends Action> actionClass = action.getClass();",
                "        TodoList result = null;",
                "        if (AddTodoItemAction.class.isAssignableFrom(actionClass)) {",
                "            result = getReducer().add(getState().clone(), (AddTodoItemAction) action);",
                "        }",
                "        if (result != null) {",
                "            setState(result);",
                "        }",
                "    }",
                "}"
        };
    }

    public static class Counter {
        public static final String[] TARGET = {
                "package info.izumin.android.droidux.sample;",
                "import info.izumin.android.droidux.annotation.Store;",
                "import info.izumin.android.droidux.Action;",
                "import info.izumin.android.droidux.BaseStore;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "import info.izumin.android.droidux.processor.fixture.CounterReducer;",
                "import io.reactivex.Flowable;",
                "@Store({CounterReducer.class})",
                "public interface RootStore extends BaseStore {",
                "    Counter counter();",
                "    Flowable<Counter> observeCounter();",
                "}"
        };

        public static final String[] GENERATED_STORE = {
                "package info.izumin.android.droidux.sample;",
                "",
                "import android.databinding.BaseObservable;",
                "import info.izumin.android.droidux.Action;",
                "import info.izumin.android.droidux.Dispatcher;",
                "import info.izumin.android.droidux.Middleware;",
                "import info.izumin.android.droidux.exception.NotInitializedException;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "import info.izumin.android.droidux.processor.fixture.CounterReducer;",
                "import io.reactivex.Flowable;",
                "import java.util.ArrayList;",
                "import java.util.List;",
                "",
                "public final class DroiduxRootStore extends BaseObservable implements RootStore {",
                "    private final DroiduxRootStore_CounterStoreImpl counterStoreImpl;",
                "    private final Dispatcher dispatcher;",
                "",
                "    protected DroiduxRootStore(final Builder builder) {",
                "        counterStoreImpl= new DroiduxRootStore_CounterStoreImpl(builder.counter, builder.counterReducer);",
                "        dispatcher = new Dispatcher(builder.middlewares, counterStoreImpl);",
                "        for (Middleware middleware : builder.middlewares) {",
                "            middleware.onAttach(this, dispatcher);",
                "        }",
                "    }",
                "",
                "    public static Builder builder() {",
                "        return new Builder();",
                "    }",
                "",
                "    @Override",
                "    public Counter counter() {",
                "        return counterStoreImpl.getState();",
                "    }",
                "",
                "    @Override",
                "    public Flowable<Counter> observeCounter() {",
                "        return counterStoreImpl.observe();",
                "    }",
                "",
                "    @Override",
                "    public Flowable<Action> dispatch(Action action) {",
                "        return dispatcher.dispatch(action)",
                "    }",
                "",
                "    public static final class Builder {",
                "        private final List<Middleware> middlewares;",
                "        private CounterReducer counterReducer;",
                "        private Counter counter;",
                "",
                "        private Builder() {",
                "            middlewares = new ArrayList<>();",
                "        }",
                "",
                "        public Builder addMiddleware(Middleware middleware) {",
                "            middlewares.add(middleware);",
                "            return this;",
                "        }",
                "",
                "        public Builder setReducer(CounterReducer counterReducer) {",
                "            this.counterReducer = counterReducer;",
                "            return this;",
                "        }",
                "",
                "        public Builder setReducer(CounterReducer counterReducer, Counter counter) {",
                "            this.counter = counter;",
                "            return setReducer(counterReducer);",
                "        }",
                "",
                "        public DroiduxRootStore build() {",
                "            if (counterReducer == null) {",
                "                throw new NotInitializedException(\"CounterReducer has not been initialized.\");",
                "            }",
                "            return new DroiduxRootStore(this);",
                "        }",
                "    }",
                "}"
        };
    }

    public static class CounterWithBackpressureStrategy {
        public static final String[] TARGET = {
                "package info.izumin.android.droidux.sample;",
                "import info.izumin.android.droidux.annotation.Store;",
                "import info.izumin.android.droidux.Action;",
                "import info.izumin.android.droidux.BaseStore;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "import info.izumin.android.droidux.processor.fixture.CounterReducer;",
                "import io.reactivex.BackpressureStrategy;",
                "import io.reactivex.Flowable;",
                "@Store({CounterReducer.class})",
                "public interface RootStore extends BaseStore {",
                "    Counter counter();",
                "    Flowable<Counter> observeCounter();",
                "    Flowable<Counter> observeCounter(BackpressureStrategy strategy);",
                "}"
        };

        public static final String[] GENERATED_STORE = {
                "package info.izumin.android.droidux.sample;",
                "",
                "import android.databinding.BaseObservable;",
                "import info.izumin.android.droidux.Action;",
                "import info.izumin.android.droidux.Dispatcher;",
                "import info.izumin.android.droidux.Middleware;",
                "import info.izumin.android.droidux.exception.NotInitializedException;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "import info.izumin.android.droidux.processor.fixture.CounterReducer;",
                "import io.reactivex.BackpressureStrategy;",
                "import io.reactivex.Flowable;",
                "import java.util.ArrayList;",
                "import java.util.List;",
                "",
                "public final class DroiduxRootStore extends BaseObservable implements RootStore {",
                "    private final DroiduxRootStore_CounterStoreImpl counterStoreImpl;",
                "    private final Dispatcher dispatcher;",
                "",
                "    protected DroiduxRootStore(final Builder builder) {",
                "        counterStoreImpl= new DroiduxRootStore_CounterStoreImpl(builder.counter, builder.counterReducer);",
                "        dispatcher = new Dispatcher(builder.middlewares, counterStoreImpl);",
                "        for (Middleware middleware : builder.middlewares) {",
                "            middleware.onAttach(this, dispatcher);",
                "        }",
                "    }",
                "",
                "    public static Builder builder() {",
                "        return new Builder();",
                "    }",
                "",
                "    @Override",
                "    public Counter counter() {",
                "        return counterStoreImpl.getState();",
                "    }",
                "",
                "    @Override",
                "    public Flowable<Counter> observeCounter() {",
                "        return counterStoreImpl.observe();",
                "    }",
                "",
                "",
                "    @Override",
                "    public Flowable<Counter> observeCounter(BackpressureStrategy strategy) {",
                "        return counterStoreImpl.observe(strategy);",
                "    }",
                "",
                "    @Override",
                "    public Flowable<Action> dispatch(Action action) {",
                "        return dispatcher.dispatch(action)",
                "    }",
                "",
                "    public static final class Builder {",
                "        private final List<Middleware> middlewares;",
                "        private CounterReducer counterReducer;",
                "        private Counter counter;",
                "",
                "        private Builder() {",
                "            middlewares = new ArrayList<>();",
                "        }",
                "",
                "        public Builder addMiddleware(Middleware middleware) {",
                "            middlewares.add(middleware);",
                "            return this;",
                "        }",
                "",
                "        public Builder setReducer(CounterReducer counterReducer) {",
                "            this.counterReducer = counterReducer;",
                "            return this;",
                "        }",
                "",
                "        public Builder setReducer(CounterReducer counterReducer, Counter counter) {",
                "            this.counter = counter;",
                "            return setReducer(counterReducer);",
                "        }",
                "",
                "        public DroiduxRootStore build() {",
                "            if (counterReducer == null) {",
                "                throw new NotInitializedException(\"CounterReducer has not been initialized.\");",
                "            }",
                "            return new DroiduxRootStore(this);",
                "        }",
                "    }",
                "}"
        };
    }

    public static class BindableCounter {
        public static final String[] TARGET = {
                "package info.izumin.android.droidux.sample;",
                "import android.databinding.Bindable;",
                "import info.izumin.android.droidux.annotation.Store;",
                "import info.izumin.android.droidux.Action;",
                "import info.izumin.android.droidux.BaseStore;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "import info.izumin.android.droidux.processor.fixture.CounterReducer;",
                "import io.reactivex.Flowable;",
                "@Store({CounterReducer.class})",
                "public interface RootStore extends BaseStore, android.databinding.Observable {",
                "    @Bindable Counter counter();",
                "    Flowable<Counter> observeCounter();",
                "}"
        };

        public static final String[] GENERATED_STORE = {
                "package info.izumin.android.droidux.sample;",
                "",
                "import android.databinding.BaseObservable;",
                "import info.izumin.android.droidux.Action;",
                "import info.izumin.android.droidux.Dispatcher;",
                "import info.izumin.android.droidux.Middleware;",
                "import info.izumin.android.droidux.OnStateChangedListener;",
                "import info.izumin.android.droidux.exception.NotInitializedException;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "import info.izumin.android.droidux.processor.fixture.CounterReducer;",
                "import io.reactivex.Flowable;",
                "import java.util.ArrayList;",
                "import java.util.List;",
                "",
                "public final class DroiduxRootStore extends BaseObservable implements RootStore {",
                "    private final DroiduxRootStore_CounterStoreImpl counterStoreImpl;",
                "    private final Dispatcher dispatcher;",
                "",
                "    protected DroiduxRootStore(final Builder builder) {",
                "        counterStoreImpl = new DroiduxRootStore_CounterStoreImpl(builder.counter, builder.counterReducer);",
                "        counterStoreImpl.addListener(new OnStateChangedListener<Counter>() {",
                "            @Override",
                "            public void onStateChanged(Counter counter) {",
                "                notifyPropertyChanged(builder.counterFieldId);",
                "            }",
                "        });",
                "        dispatcher = new Dispatcher(builder.middlewares, counterStoreImpl);",
                "        for (Middleware middleware : builder.middlewares) {",
                "            middleware.onAttach(this, dispatcher);",
                "        }",
                "    }",
                "",
                "    public static Builder builder() {",
                "        return new Builder();",
                "    }",
                "",
                "    @Override",
                "    public Counter counter() {",
                "        return counterStoreImpl.getState();",
                "    }",
                "",
                "    @Override",
                "    public Flowable<Counter> observeCounter() {",
                "        return counterStoreImpl.observe();",
                "    }",
                "",
                "    @Override",
                "    public Flowable<Action> dispatch(Action action) {",
                "        return dispatcher.dispatch(action)",
                "    }",
                "",
                "    public static final class Builder {",
                "        private final List<Middleware> middlewares;",
                "        private CounterReducer counterReducer;",
                "        private Counter counter;",
                "        private int counterFieldId;",
                "",
                "        private Builder() {",
                "            middlewares = new ArrayList<>();",
                "        }",
                "",
                "        public Builder addMiddleware(Middleware middleware) {",
                "            middlewares.add(middleware);",
                "            return this;",
                "        }",
                "",
                "        public Builder setReducer(CounterReducer counterReducer, int counterFieldId) {",
                "            this.counterFieldId = counterFieldId;",
                "            this.counterReducer = counterReducer;",
                "            return this;",
                "        }",
                "",
                "        public Builder setReducer(CounterReducer counterReducer, Counter counter, int counterFieldId) {",
                "            this.counter = counter;",
                "            return setReducer(counterReducer, counterFieldId);",
                "        }",
                "",
                "        public DroiduxRootStore build() {",
                "            if (counterReducer == null) {",
                "                throw new NotInitializedException(\"CounterReducer has not been initialized.\");",
                "            }",
                "            return new DroiduxRootStore(this);",
                "        }",
                "    }",
                "}"
        };
    }

    public static class CombinedTwoReducers {
        public static final String[] TARGET = {
                "package info.izumin.android.droidux.sample;",
                "import info.izumin.android.droidux.annotation.Store;",
                "import info.izumin.android.droidux.Action;",
                "import info.izumin.android.droidux.BaseStore;",
                "import info.izumin.android.droidux.processor.fixture.CounterReducer;",
                "import info.izumin.android.droidux.processor.fixture.TodoListReducer;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "import info.izumin.android.droidux.processor.fixture.TodoList;",
                "import io.reactivex.Flowable;",
                "@Store({CounterReducer.class, TodoListReducer.class})",
                "public interface RootStore extends BaseStore {",
                "    Counter counter();",
                "    Flowable<Counter> observeCounter();",
                "    TodoList todoList();",
                "    Flowable<TodoList> observeTodoList();",
                "}"
        };

        public static final String[] GENERATED = {
                "package info.izumin.android.droidux.sample;",
                "",
                "import android.databinding.BaseObservable;",
                "import info.izumin.android.droidux.Action;",
                "import info.izumin.android.droidux.Dispatcher;",
                "import info.izumin.android.droidux.Middleware;",
                "import info.izumin.android.droidux.exception.NotInitializedException;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "import info.izumin.android.droidux.processor.fixture.CounterReducer;",
                "import info.izumin.android.droidux.processor.fixture.TodoList;",
                "import info.izumin.android.droidux.processor.fixture.TodoListReducer;",
                "import io.reactivex.Flowable;",
                "import java.util.ArrayList;",
                "import java.util.List;",
                "",
                "public final class DroiduxRootStore extends BaseObservable implements RootStore {",
                "    private final DroiduxRootStore_CounterStoreImpl counterStoreImpl;",
                "    private final DroiduxRootStore_TodoListStoreImpl todoListStoreImpl;",
                "    private final Dispatcher dispatcher;",
                "",
                "    protected DroiduxRootStore(final Builder builder) {",
                "        counterStoreImpl= new DroiduxRootStore_CounterStoreImpl(builder.counter, builder.counterReducer);",
                "        todoListStoreImpl= new DroiduxRootStore_TodoListStoreImpl(builder.todoList, builder.todoListReducer);",
                "        dispatcher = new Dispatcher(builder.middlewares, counterStoreImpl, todoListStoreImpl);",
                "        for (Middleware middleware : builder.middlewares) {",
                "            middleware.onAttach(this, dispatcher);",
                "        }",
                "    }",
                "",
                "    public static Builder builder() {",
                "        return new Builder();",
                "    }",
                "",
                "    @Override",
                "    public Counter counter() {",
                "        return counterStoreImpl.getState();",
                "    }",
                "",
                "    @Override",
                "    public Flowable<Counter> observeCounter() {",
                "        return counterStoreImpl.observe();",
                "    }",
                "",
                "    @Override",
                "    public TodoList todoList() {",
                "        return todoListStoreImpl.getState();",
                "    }",
                "",
                "    @Override",
                "    public Flowable<TodoList> observeTodoList() {",
                "        return todoListStoreImpl.observe();",
                "    }",
                "",
                "    @Override",
                "    public Flowable<Action> dispatch(Action action) {",
                "        return dispatcher.dispatch(action)",
                "    }",
                "",
                "    public static final class Builder {",
                "        private final List<Middleware> middlewares;",
                "        private CounterReducer counterReducer;",
                "        private TodoListReducer todoListReducer;",
                "        private Counter counter;",
                "        private TodoList todoList;",
                "        ",
                "        private Builder() {",
                "            middlewares = new ArrayList<>();",
                "        }",
                "",
                "        public Builder addMiddleware(Middleware middleware) {",
                "            middlewares.add(middleware);",
                "            return this;",
                "        }",
                "",
                "        public Builder setReducer(CounterReducer counterReducer) {",
                "            this.counterReducer = counterReducer;",
                "            return this;",
                "        }",
                "",
                "        public Builder setReducer(TodoListReducer todoListReducer) {",
                "            this.todoListReducer = todoListReducer;",
                "            return this;",
                "        }",
                "",
                "        public Builder setReducer(CounterReducer counterReducer, Counter counter) {",
                "            this.counter = counter;",
                "            return setReducer(counterReducer);",
                "        }",
                "",
                "        public Builder setReducer(TodoListReducer todoListReducer, TodoList todoList) {",
                "            this.todoList = todoList;",
                "            return setReducer(todoListReducer);",
                "        }",
                "",
                "        public DroiduxRootStore build() {",
                "            if (counterReducer == null) {",
                "                throw new NotInitializedException(\"CounterReducer has not been initialized.\");",
                "            }",
                "            if (todoListReducer == null) {",
                "                throw new NotInitializedException(\"TodoListReducer has not been initialized.\");",
                "            }",
                "            return new DroiduxRootStore(this);",
                "        }",
                "    }",
                "}"
        };
    }

    public static class CombinedReducerAndBindableReducer {
        public static final String[] TARGET = {
                "package info.izumin.android.droidux.sample;",
                "import android.databinding.Bindable;",
                "import info.izumin.android.droidux.annotation.Store;",
                "import info.izumin.android.droidux.Action;",
                "import info.izumin.android.droidux.BaseStore;",
                "import info.izumin.android.droidux.processor.fixture.CounterReducer;",
                "import info.izumin.android.droidux.processor.fixture.TodoListReducer;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "import info.izumin.android.droidux.processor.fixture.TodoList;",
                "import io.reactivex.Flowable;",
                "@Store({CounterReducer.class, TodoListReducer.class})",
                "public interface RootStore extends BaseStore, android.databinding.Observable {",
                "    Counter counter();",
                "    Flowable<Counter> observeCounter();",
                "    @Bindable TodoList todoList();",
                "    Flowable<TodoList> observeTodoList();",
                "}"
        };

        public static final String[] GENERATED = {
                "package info.izumin.android.droidux.sample;",
                "",
                "import android.databinding.BaseObservable;",
                "import info.izumin.android.droidux.Action;",
                "import info.izumin.android.droidux.Dispatcher;",
                "import info.izumin.android.droidux.Middleware;",
                "import info.izumin.android.droidux.OnStateChangedListener;",
                "import info.izumin.android.droidux.exception.NotInitializedException;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "import info.izumin.android.droidux.processor.fixture.CounterReducer;",
                "import info.izumin.android.droidux.processor.fixture.TodoList;",
                "import info.izumin.android.droidux.processor.fixture.TodoListReducer;",
                "import io.reactivex.Flowable;",
                "import java.util.ArrayList;",
                "import java.util.List;",
                "",
                "public final class DroiduxRootStore extends BaseObservable implements RootStore {",
                "    private final DroiduxRootStore_CounterStoreImpl counterStoreImpl;",
                "    private final DroiduxRootStore_TodoListStoreImpl todoListStoreImpl;",
                "    private final Dispatcher dispatcher;",
                "",
                "    protected DroiduxRootStore(final Builder builder) {",
                "        counterStoreImpl= new DroiduxRootStore_CounterStoreImpl(builder.counter, builder.counterReducer);",
                "        todoListStoreImpl= new DroiduxRootStore_TodoListStoreImpl(builder.todoList, builder.todoListReducer);",
                "        todoListStoreImpl.addListener(new OnStateChangedListener<TodoList>() {",
                "            @Override",
                "            public void onStateChanged(TodoList todoList) {",
                "                notifyPropertyChanged(builder.todoListFieldId);",
                "            }",
                "        });",
                "        dispatcher = new Dispatcher(builder.middlewares, counterStoreImpl, todoListStoreImpl);",
                "        for (Middleware middleware : builder.middlewares) {",
                "            middleware.onAttach(this, dispatcher);",
                "        }",
                "    }",
                "",
                "    public static Builder builder() {",
                "        return new Builder();",
                "    }",
                "",
                "    @Override",
                "    public Counter counter() {",
                "        return counterStoreImpl.getState();",
                "    }",
                "",
                "    @Override",
                "    public Flowable<Counter> observeCounter() {",
                "        return counterStoreImpl.observe();",
                "    }",
                "",
                "    @Override",
                "    public TodoList todoList() {",
                "        return todoListStoreImpl.getState();",
                "    }",
                "",
                "    @Override",
                "    public Flowable<TodoList> observeTodoList() {",
                "        return todoListStoreImpl.observe();",
                "    }",
                "",
                "    @Override",
                "    public Flowable<Action> dispatch(Action action) {",
                "        return dispatcher.dispatch(action)",
                "    }",
                "",
                "    public static final class Builder {",
                "        private final List<Middleware> middlewares;",
                "        private CounterReducer counterReducer;",
                "        private TodoListReducer todoListReducer;",
                "        private Counter counter;",
                "        private TodoList todoList;",
                "        private int todoListFieldId;",
                "        ",
                "        private Builder() {",
                "            middlewares = new ArrayList<>();",
                "        }",
                "",
                "        public Builder addMiddleware(Middleware middleware) {",
                "            middlewares.add(middleware);",
                "            return this;",
                "        }",
                "",
                "        public Builder setReducer(CounterReducer counterReducer) {",
                "            this.counterReducer = counterReducer;",
                "            return this;",
                "        }",
                "",
                "        public Builder setReducer(TodoListReducer todoListReducer, int todoListFieldId) {",
                "            this.todoListFieldId = todoListFieldId;",
                "            this.todoListReducer = todoListReducer;",
                "            return this;",
                "        }",
                "",
                "        public Builder setReducer(CounterReducer counterReducer, Counter counter) {",
                "            this.counter = counter;",
                "            return setReducer(counterReducer);",
                "        }",
                "",
                "        public Builder setReducer(TodoListReducer todoListReducer, TodoList todoList, int todoListFieldId) {",
                "            this.todoList = todoList;",
                "            return setReducer(todoListReducer, todoListFieldId);",
                "        }",
                "",
                "        public DroiduxRootStore build() {",
                "            if (counterReducer == null) {",
                "                throw new NotInitializedException(\"CounterReducer has not been initialized.\");",
                "            }",
                "            if (todoListReducer == null) {",
                "                throw new NotInitializedException(\"TodoListReducer has not been initialized.\");",
                "            }",
                "            return new DroiduxRootStore(this);",
                "        }",
                "    }",
                "}"
        };
    }

    public static class DispatchableTakesWrongStateType {
        public static final String[] TARGET = {
                "package info.izumin.android.droidux.sample;",
                "import info.izumin.android.droidux.BaseStore;",
                "import info.izumin.android.droidux.annotation.Dispatchable;",
                "import info.izumin.android.droidux.annotation.Reducer;",
                "import info.izumin.android.droidux.annotation.Store;",
                "import info.izumin.android.droidux.processor.fixture.action.IncrementCountAction;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "@Store(CounterStore.CounterReducer.class)",
                "public interface CounterStore extends BaseStore {",
                "    @Reducer(Counter.class)",
                "    public static class CounterReducer {",
                "        @Dispatchable(IncrementCountAction.class)",
                "        public Counter increment(Object state, IncrementCountAction action) {",
                "            return null;",
                "        }",
                "    }",
                "}"
        };
    }

    public static class DispatchableTakesWrongActionType {
        public static final String[] TARGET = {
                "package info.izumin.android.droidux.sample;",
                "import info.izumin.android.droidux.BaseStore;",
                "import info.izumin.android.droidux.annotation.Dispatchable;",
                "import info.izumin.android.droidux.annotation.Reducer;",
                "import info.izumin.android.droidux.annotation.Store;",
                "import info.izumin.android.droidux.processor.fixture.action.AddTodoItemAction;",
                "import info.izumin.android.droidux.processor.fixture.action.CompleteTodoItemAction;",
                "import info.izumin.android.droidux.processor.fixture.TodoList;",
                "@Store(TodoListStore.TodoListReducer.class)",
                "public interface TodoListStore extends BaseStore {",
                "    @Reducer(TodoList.class)",
                "    public static class TodoListReducer {",
                "        @Dispatchable(CompleteTodoItemAction.class)",
                "        public TodoList addItem(TodoList state, AddTodoItemAction action) {",
                "            return null;",
                "        }",
                "    }",
                "}"
        };
    }

    public static class DispatchableTakesExtraArguments {
        public static final String[] TARGET = {
                "package info.izumin.android.droidux.sample;",
                "import info.izumin.android.droidux.BaseStore;",
                "import info.izumin.android.droidux.annotation.Dispatchable;",
                "import info.izumin.android.droidux.annotation.Reducer;",
                "import info.izumin.android.droidux.annotation.Store;",
                "import info.izumin.android.droidux.processor.fixture.action.IncrementCountAction;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "@Store(CounterStore.CounterReducer.class)",
                "public interface CounterStore extends BaseStore {",
                "    @Reducer(Counter.class)",
                "    public static class CounterReducer {",
                "        @Dispatchable(IncrementCountAction.class)",
                "        public Counter increment(Counter state, IncrementCountAction action, String extra) {",
                "            return null;",
                "        }",
                "    }",
                "}"
        };
    }

    public static class DispatchableMethosReturnsWrongType{
        public static final String[] TARGET = {
                "package info.izumin.android.droidux.sample;",
                "import info.izumin.android.droidux.BaseStore;",
                "import info.izumin.android.droidux.annotation.Dispatchable;",
                "import info.izumin.android.droidux.annotation.Reducer;",
                "import info.izumin.android.droidux.annotation.Store;",
                "import info.izumin.android.droidux.processor.fixture.action.IncrementCountAction;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "@Store(CounterStore.CounterReducer.class)",
                "public interface CounterStore extends BaseStore {",
                "    @Reducer(Counter.class)",
                "    public static class CounterReducer {",
                "        @Dispatchable(IncrementCountAction.class)",
                "        public Object increment(Counter state, IncrementCountAction action) {",
                "            return null;",
                "        }",
                "    }",
                "}"
        };
    }

    public static class ReducerWithoutSuffix {
        public static final String[] TARGET = {
                "package info.izumin.android.droidux.sample;",
                "import info.izumin.android.droidux.BaseStore;",
                "import info.izumin.android.droidux.annotation.Dispatchable;",
                "import info.izumin.android.droidux.annotation.Reducer;",
                "import info.izumin.android.droidux.annotation.Store;",
                "import info.izumin.android.droidux.processor.fixture.action.IncrementCountAction;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "@Store(CounterStore.CounterReduce.class)",
                "public interface CounterStore extends BaseStore {",
                "    @Reducer(Counter.class)",
                "    public static class CounterReduce {",
                "        @Dispatchable(IncrementCountAction.class)",
                "        public Counter increment(Counter state, IncrementCountAction action) {",
                "            return null;",
                "        }",
                "    }",
                "}"
        };
    }

    public static class UndoableReducerWithoutUndoableState {
        public static final String[] TARGET = {
                "package info.izumin.android.droidux.sample;",
                "import info.izumin.android.droidux.BaseStore;",
                "import info.izumin.android.droidux.annotation.Reducer;",
                "import info.izumin.android.droidux.annotation.Store;",
                "import info.izumin.android.droidux.annotation.Undoable;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "@Store(CounterStore.CounterReducer.class)",
                "public interface CounterStore extends BaseStore {",
                "    @Undoable",
                "    @Reducer(Counter.class)",
                "    public static class CounterReducer {",
                "    }",
                "}"
        };
    }

    public static class StoreHasInvalidValue {
        public static final String[] TARGET = {
                "package info.izumin.android.droidux.sample;",
                "import info.izumin.android.droidux.BaseStore;",
                "import info.izumin.android.droidux.annotation.Store;",
                "@Store(CounterStore.CounterReducer.class)",
                "public interface CounterStore extends BaseStore {",
                "    public static class CounterReducer {",
                "    }",
                "}"
        };
    }

    public static class StoreNotExtendsBaseStore {
        public static final String[] TARGET = {
                "package info.izumin.android.droidux.sample;",
                "import info.izumin.android.droidux.BaseStore;",
                "import info.izumin.android.droidux.annotation.Reducer;",
                "import info.izumin.android.droidux.annotation.Store;",
                "import info.izumin.android.droidux.processor.fixture.Counter;",
                "@Store(CounterStore.CounterReducer.class)",
                "public interface CounterStore {",
                "    @Reducer(Counter.class)",
                "    public static class CounterReducer {",
                "    }",
                "}"
        };
    }
}
