
com.elibom.client.Account Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elibom-java Show documentation
Show all versions of elibom-java Show documentation
A java client for Elibom REST API
package com.elibom.client;
import java.math.BigDecimal;
import org.json.JSONException;
import org.json.JSONObject;
/**
*
* @author Germán Escobar
*/
public class Account {
private JSONObject json;
private String name;
private BigDecimal credits;
private long ownerId;
public Account(JSONObject json) throws JSONException {
this.json = json;
this.name = json.getString("name");
if (json.has("credits")) {
this.credits = new BigDecimal(json.getString("credits"));
}
this.ownerId = json.getJSONObject("owner").getLong("id");
}
public String getName() {
return name;
}
public BigDecimal getCredits() {
return credits;
}
public long getOwnerId() {
return ownerId;
}
@Override
public String toString() {
return json.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy