Back to project page MinerStatus.
The source code is released under:
Apache License
If you think the Android project MinerStatus listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package me.davidgreene.minerstatus.util; /*from w w w .j a va 2s. c o m*/ import me.davidgreene.minerstatus.beans.BitpoolStatus; import me.davidgreene.minerstatus.beans.BtcMine; import me.davidgreene.minerstatus.beans.BtcguildStatus; import me.davidgreene.minerstatus.beans.DeepbitStatus; import me.davidgreene.minerstatus.beans.SlushStatus; import me.davidgreene.minerstatus.beans.Status; import com.google.gson.Gson; public class StatusObjectFactory { public static Status getStatusObject(String result, String identifier){ if (identifier == null){ return null; } Gson gson = new Gson(); if (identifier.equals("bitcoinpool")){ return gson.fromJson(result, BitpoolStatus.class); } else if (identifier.equals("slush")){ return gson.fromJson(result, SlushStatus.class); } else if (identifier.equals("deepbit")){ return gson.fromJson(result, DeepbitStatus.class); } else if (identifier.equals("btcmine")){ return gson.fromJson(result, BtcMine.class); } else if (identifier.equals("btcguild")){ return gson.fromJson(result, BtcguildStatus.class); } return null; } }