@Test public void testToJsonString() { try{ ArrayList<String> ids = new ArrayList<>(); ids.add(bilthon_25.getObjectId()); mWebSocket.addListener(new GetObjects(ids, new WitnessResponseListener() { @Override public void onSuccess(WitnessResponse response) { System.out.println("onSuccess"); List<GrapheneObject> result = (List<GrapheneObject>) response.result; UserAccount userAccount = (UserAccount) result.get(0); System.out.println("user account: "+userAccount.toJsonString()); synchronized (UserAccountTest.this){ UserAccountTest.this.notifyAll(); } } @Override public void onError(BaseResponse.Error error) { System.out.println("onError"); synchronized (UserAccountTest.this){ UserAccountTest.this.notifyAll(); } } })); mWebSocket.connect(); synchronized (this){ wait(); } }catch (WebSocketException e) { System.out.println("WebSocketException. Msg: " + e.getMessage()); } catch (InterruptedException e) { System.out.println("InterruptedException. Msg: "+e.getMessage()); } }
@Override public String toJsonString() { Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); return gson.toJson(this); }
UserAccount extends GrapheneObject implements ByteSerializable, JsonSerializable { @Override public String toJsonString() { Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); return gson.toJson(this); } }
UserAccount extends GrapheneObject implements ByteSerializable, JsonSerializable { @Override public String toJsonString() { Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); return gson.toJson(this); } UserAccount(String id);  UserAccount(String id, String name); }
UserAccount extends GrapheneObject implements ByteSerializable, JsonSerializable { @Override public String toJsonString() { Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); return gson.toJson(this); } UserAccount(String id);  UserAccount(String id, String name); String getName(); void setName(String name); @Override boolean equals(Object o); @Override int hashCode(); @Override byte[] toBytes(); @Override String toJsonString(); @Override JsonObject toJsonObject(); @Override String toString(); long getMembershipExpirationDate(); void setMembershipExpirationDate(long membershipExpirationDate); String getRegistrar(); void setRegistrar(String registrar); String getReferrer(); void setReferrer(String referrer); String getLifetimeReferrer(); void setLifetimeReferrer(String lifetimeReferrer); long getNetworkFeePercentage(); void setNetworkFeePercentage(long networkFeePercentage); long getLifetimeReferrerFeePercentage(); void setLifetimeReferrerFeePercentage(long lifetimeReferrerFeePercentage); long getReferrerRewardsPercentage(); void setReferrerRewardsPercentage(long referrerRewardsPercentage); Authority getOwner(); void setOwner(Authority owner); Authority getActive(); void setActive(Authority active); AccountOptions getOptions(); void setOptions(AccountOptions options); String getStatistics(); void setStatistics(String statistics); boolean isLifeTime(); void setLifeTime(boolean lifeTime); }
UserAccount extends GrapheneObject implements ByteSerializable, JsonSerializable { @Override public String toJsonString() { Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); return gson.toJson(this); } UserAccount(String id);  UserAccount(String id, String name); String getName(); void setName(String name); @Override boolean equals(Object o); @Override int hashCode(); @Override byte[] toBytes(); @Override String toJsonString(); @Override JsonObject toJsonObject(); @Override String toString(); long getMembershipExpirationDate(); void setMembershipExpirationDate(long membershipExpirationDate); String getRegistrar(); void setRegistrar(String registrar); String getReferrer(); void setReferrer(String referrer); String getLifetimeReferrer(); void setLifetimeReferrer(String lifetimeReferrer); long getNetworkFeePercentage(); void setNetworkFeePercentage(long networkFeePercentage); long getLifetimeReferrerFeePercentage(); void setLifetimeReferrerFeePercentage(long lifetimeReferrerFeePercentage); long getReferrerRewardsPercentage(); void setReferrerRewardsPercentage(long referrerRewardsPercentage); Authority getOwner(); void setOwner(Authority owner); Authority getActive(); void setActive(Authority active); AccountOptions getOptions(); void setOptions(AccountOptions options); String getStatistics(); void setStatistics(String statistics); boolean isLifeTime(); void setLifeTime(boolean lifeTime); static final String PROXY_TO_SELF; static final String KEY_MEMBERSHIP_EXPIRATION_DATE; static final String KEY_REGISTRAR; static final String KEY_REFERRER; static final String KEY_LIFETIME_REFERRER; static final String KEY_NETWORK_FEE_PERCENTAGE; static final String KEY_LIFETIME_REFERRER_FEE_PERCENTAGE; static final String KEY_REFERRER_REWARD_PERCENTAGE; static final String KEY_NAME; static final String KEY_OWNER; static final String KEY_ACTIVE; static final String KEY_OPTIONS; static final String KEY_STATISTICS; static final String KEY_WHITELISTING_ACCOUNTS; static final String KEY_BLACKLISTING_ACCOUNTS; static final String KEY_WHITELISTED_ACCOUNTS; static final String KEY_BLACKLISTED_ACCOUNTS; static final String KEY_OWNER_SPECIAL_AUTHORITY; static final String KEY_ACTIVE_SPECIAL_AUTHORITY; static final String KEY_N_CONTROL_FLAGS; static final String LIFETIME_EXPIRATION_DATE; }