-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support endpoint for balance of multiple addresses at a given hei…
…ght (#74)
- Loading branch information
Showing
3 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.wavesplatform.wavesj; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import im.mak.waves.transactions.account.Address; | ||
|
||
import java.util.Objects; | ||
|
||
public class Balance { | ||
private final Address address; | ||
private final long balance; | ||
|
||
public Balance(@JsonProperty("id") Address address, | ||
@JsonProperty("balance") long balance) { | ||
this.address = Common.notNull(address, "Id"); | ||
this.balance = balance; | ||
} | ||
|
||
public Address getAddress() { | ||
return address; | ||
} | ||
|
||
public long getBalance() { | ||
return balance; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (!(o instanceof Balance)) return false; | ||
Balance balance1 = (Balance) o; | ||
return getBalance() == balance1.getBalance() && | ||
Objects.equals(getAddress(), balance1.getAddress()); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(getAddress(), getBalance()); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Balance{" + | ||
"address=" + address + | ||
", balance=" + balance + | ||
'}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters