package com.shipdream.lib.android.mvc.view.injection.service.internal;

import com.shipdream.lib.android.mvc.Constructable;
import com.shipdream.lib.android.mvc.StateManaged;
import com.shipdream.lib.android.mvc.view.injection.service.StorageService;

/**
 * Created by kejun on 1/13/2016.
 */
public class StorageServiceImpl implements StorageService, StateManaged<StorageService.Storage>,
        Constructable{
    private Storage storage;

    @Override
    public Class<Storage> getStateType() {
        return Storage.class;
    }

    @Override
    public Storage getState() {
        return storage;
    }

    @Override
    public void restoreState(Storage restoredState) {
        this.storage = restoredState;
    }

    @Override
    public String getContent() {
        return getState().getContent();
    }

    @Override
    public void setContent(String content) {
        getState().setContent(content);
    }

    @Override
    public void onConstruct() {
        storage = new Storage();
    }
}

@@ -106,72 +106,15 @@
 mvc.
-Constructable;%0Aimport com.shipdream.lib.android.mvc.StateManaged
+MvcBean
 ;%0Aim
@@ -266,252 +266,129 @@
 mpl 
-implements StorageService, StateManaged%3CStorageService.Storage%3E,%0A        Constructable%7B%0A    private Storage storage;%0A%0A    @Override%0A    public Class%3CStorage%3E getStateType() %7B%0A        return Storage.class;%0A    %7D%0A%0A    @Override%0A    public 
+extends MvcBean%3CStorageService.Storage%3E implements StorageService%7B%0A    @Override%0A    public Class%3CStorageService.
 Storage
+%3E
  get
@@ -392,16 +392,20 @@
 getState
+Type
 () %7B%0A   
@@ -420,128 +420,36 @@
 urn 
-s
+S
 torage
-;%0A    %7D%0A%0A    @Override%0A    public void restoreState(Storage restoredState) %7B%0A        this.storage = restoredState
+Service.Storage.class
 ;%0A  
@@ -657,91 +657,6 @@
  %7D%0A%0A
-    @Override%0A    public void onConstruct() %7B%0A        storage = new Storage();%0A    %7D%0A
 %7D%0A

Fix tests