}
/**
+ * Address Class
+ */
+ public static class Address {
+ @SerializedName("account_alias")
+ public String accountAlias;
+
+ @SerializedName("account_id")
+ public String accountId;
+
+ @SerializedName("address")
+ public String address;
+
+ @SerializedName("change")
+ public Boolean change;
+
+ @SerializedName("vaild")
+ public Boolean vaild;
+
+ @SerializedName("is_local")
+ public Boolean is_local;
+
+ /**
+ * Serializes the Address into a form that is safe to transfer over the wire.
+ *
+ * @return the JSON-serialized representation of the Receiver object
+ */
+ public String toJson() {
+ return Utils.serializer.toJson(this);
+ }
+
+ /**
+ * Deserializes a Address from JSON.
+ *
+ * @param json a JSON-serialized Receiver object
+ * @return the deserialized Receiver object
+ * @throws JSONException Raised if the provided string is not valid JSON.
+ */
+ public static Address fromJson(String json) throws JSONException {
+ try {
+ return Utils.serializer.fromJson(json, Address.class);
+ } catch (IllegalStateException e) {
+ throw new JSONException("Unable to parse serialized receiver: " + e.getMessage());
+ }
+ }
+
+ }
+
+ /**
* Use this class to create a {@link Address} under an account.
*/
public static class AddressBuilder {
+++ /dev/null
-package io.bytom.api;
-
-import com.google.gson.annotations.SerializedName;
-import io.bytom.common.Utils;
-import io.bytom.exception.JSONException;
-
-public class Address {
- @SerializedName("account_alias")
- public String accountAlias;
-
- @SerializedName("account_id")
- public String accountId;
-
- @SerializedName("address")
- public String address;
-
- @SerializedName("change")
- public Boolean change;
-
- @SerializedName("vaild")
- public Boolean vaild;
-
- @SerializedName("is_local")
- public Boolean is_local;
-
- /**
- * Serializes the Address into a form that is safe to transfer over the wire.
- *
- * @return the JSON-serialized representation of the Receiver object
- */
- public String toJson() {
- return Utils.serializer.toJson(this);
- }
-
- /**
- * Deserializes a Address from JSON.
- *
- * @param json a JSON-serialized Receiver object
- * @return the deserialized Receiver object
- * @throws JSONException Raised if the provided string is not valid JSON.
- */
- public static Address fromJson(String json) throws JSONException {
- try {
- return Utils.serializer.fromJson(json, Address.class);
- } catch (IllegalStateException e) {
- throw new JSONException("Unable to parse serialized receiver: " + e.getMessage());
- }
- }
-
-}
import io.bytom.TestUtils;
import io.bytom.api.Account;
-import io.bytom.api.Address;
import io.bytom.api.Receiver;
import io.bytom.http.Client;
import org.junit.Test;
String id = accountList.get(accountList.size()-1).id;
Account.AddressBuilder addressBuilder = new Account.AddressBuilder().setAccountId(id).setAccountAlias(alias);
- List<Address> addressList = addressBuilder.list(client);
+ List<Account.Address> addressList = addressBuilder.list(client);
assertNotNull(addressList);
}
String id = accountList.get(accountList.size()-1).id;
Account.AddressBuilder addressBuilder = new Account.AddressBuilder().setAccountId(id).setAccountAlias(alias);
- List<Address> addressList = addressBuilder.list(client);
+ List<Account.Address> addressList = addressBuilder.list(client);
- Address address = addressBuilder.validate(client, addressList.get(0).address);
+ Account.Address address = addressBuilder.validate(client, addressList.get(0).address);
assertEquals(true, address.is_local);
}
import io.bytom.TestUtils;
import io.bytom.api.Account;
-import io.bytom.api.Address;
import io.bytom.api.Asset;
-import io.bytom.api.Receiver;
import io.bytom.http.Client;
import org.junit.Test;
-import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertEquals;
package io.bytom.integration;
import io.bytom.TestUtils;
-import io.bytom.api.Account;
-import io.bytom.api.Address;
import io.bytom.api.Message;
-import io.bytom.api.Wallet;
import io.bytom.exception.BytomException;
import io.bytom.http.Client;
import org.junit.Assert;
import org.junit.Test;
-import java.util.List;
-
public class MessageTest {
static Client client;