Android Open Source - libraryofalexandria Art Work Service Impl






From Project

Back to project page libraryofalexandria.

License

The source code is released under:

Apache License

If you think the Android project libraryofalexandria listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package alexandria.israelferrer.com.libraryofalexandria;
/*w w  w .j av a  2  s. com*/

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

public class ArtWorkServiceImpl implements ArtWorkService {

    private final InputStream source;
    private List<ArtWork> artWorkList;

    public ArtWorkServiceImpl(InputStream source) {
        this.source = source;
        this.artWorkList = new ArrayList<ArtWork>();
    }

    @Override
    public void getArtWorks(Callback<List<ArtWork>> result) {
        Type listType = new TypeToken<List<ArtWork>>() {
        }.getType();
        artWorkList = new Gson().fromJson(new InputStreamReader(source), listType);
        result.success(artWorkList);
    }
}




Java Source Code List

alexandria.israelferrer.com.libraryofalexandria.ArtWorkListActivityTests.java
alexandria.israelferrer.com.libraryofalexandria.ArtWorkListActivity.java
alexandria.israelferrer.com.libraryofalexandria.ArtWorkListPresenter.java
alexandria.israelferrer.com.libraryofalexandria.ArtWorkModelTests.java
alexandria.israelferrer.com.libraryofalexandria.ArtWorkModel.java
alexandria.israelferrer.com.libraryofalexandria.ArtWorkPersistence.java
alexandria.israelferrer.com.libraryofalexandria.ArtWorkPresenterTests.java
alexandria.israelferrer.com.libraryofalexandria.ArtWorkServiceImpl.java
alexandria.israelferrer.com.libraryofalexandria.ArtWorkService.java
alexandria.israelferrer.com.libraryofalexandria.ArtWork.java
alexandria.israelferrer.com.libraryofalexandria.Callback.java
alexandria.israelferrer.com.libraryofalexandria.Display.java
alexandria.israelferrer.com.libraryofalexandria.ItemView.java
alexandria.israelferrer.com.libraryofalexandria.Model.java
alexandria.israelferrer.com.libraryofalexandria.Presenter.java