Skip to content

Commit f9fb88e

Browse files
committed
Fix #131
1 parent 50d40ab commit f9fb88e

File tree

11 files changed

+41
-84
lines changed

11 files changed

+41
-84
lines changed

core/src/main/java/eu/bittrade/libs/steemj/SteemJ.java

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public void broadcastBlock(SignedBlock signedBlock) throws SteemCommunicationExc
287287
* <li>If the Server returned an error object.</li>
288288
* </ul>
289289
*/
290-
public Boolean login(AccountName accountName, String password)
290+
public boolean login(AccountName accountName, String password)
291291
throws SteemCommunicationException, SteemResponseException {
292292
return LoginApi.login(communicationHandler, accountName, password);
293293
}
@@ -1565,36 +1565,6 @@ public WitnessSchedule getWitnessSchedule() throws SteemCommunicationException,
15651565
return communicationHandler.performRequest(requestObject, WitnessSchedule.class).get(0);
15661566
}
15671567

1568-
/**
1569-
* Login under the use of the credentials which are stored in the config
1570-
* object.
1571-
*
1572-
* <p>
1573-
* <b>Notice:</b> The login method is only needed to access protected apis.
1574-
* For some apis like the broadcast_api a call of this method with empty
1575-
* strings can be enough to access them.
1576-
*
1577-
* @return true if the login was successful. False otherwise.
1578-
* @throws SteemCommunicationException
1579-
* <ul>
1580-
* <li>If the server was not able to answer the request in the
1581-
* given time (see
1582-
* {@link eu.bittrade.libs.steemj.configuration.SteemJConfig#setResponseTimeout(int)
1583-
* setResponseTimeout}).</li>
1584-
* <li>If there is a connection problem.</li>
1585-
* </ul>
1586-
* @throws SteemResponseException
1587-
* <ul>
1588-
* <li>If the SteemJ is unable to transform the JSON response
1589-
* into a Java object.</li>
1590-
* <li>If the Server returned an error object.</li>
1591-
* </ul>
1592-
*/
1593-
public Boolean login() throws SteemCommunicationException, SteemResponseException {
1594-
return login(SteemJConfig.getInstance().getApiUsername(),
1595-
String.valueOf(SteemJConfig.getInstance().getApiPassword()));
1596-
}
1597-
15981568
/**
15991569
* Search for accounts.
16001570
*
@@ -1686,7 +1656,7 @@ public List<String> lookupWitnessAccounts(String pattern, int limit)
16861656
* <li>If the Server returned an error object.</li>
16871657
* </ul>
16881658
*/
1689-
public Boolean verifyAuthority(SignedTransaction signedTransaction)
1659+
public boolean verifyAuthority(SignedTransaction signedTransaction)
16901660
throws SteemCommunicationException, SteemResponseException {
16911661
JsonRPCRequest requestObject = new JsonRPCRequest();
16921662
requestObject.setApiMethod(RequestMethods.VERIFY_AUTHORITY);

core/src/main/java/eu/bittrade/libs/steemj/apis/database/models/state/Comment.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ public class Comment {
8888
@JsonProperty("percent_steem_dollars")
8989
private short percentSteemDollars;
9090
@JsonProperty("allow_replies")
91-
private Boolean allowReplies;
91+
private boolean allowReplies;
9292
@JsonProperty("allow_votes")
93-
private Boolean allowVotes;
93+
private boolean allowVotes;
9494
@JsonProperty("allow_curation_rewards")
95-
private Boolean allowCurationRewards;
95+
private boolean allowCurationRewards;
9696
// TODO: Fix type
9797
// bip::vector< beneficiary_route_type, allocator< beneficiary_route_type >
9898
// > beneficiaries;
@@ -332,21 +332,21 @@ public short getPercentSteemDollars() {
332332
/**
333333
* @return the allowReplies
334334
*/
335-
public Boolean getAllowReplies() {
335+
public boolean getAllowReplies() {
336336
return allowReplies;
337337
}
338338

339339
/**
340340
* @return the allowVotes
341341
*/
342-
public Boolean getAllowVotes() {
342+
public boolean getAllowVotes() {
343343
return allowVotes;
344344
}
345345

346346
/**
347347
* @return the allowCurationRewards
348348
*/
349-
public Boolean getAllowCurationRewards() {
349+
public boolean getAllowCurationRewards() {
350350
return allowCurationRewards;
351351
}
352352

core/src/main/java/eu/bittrade/libs/steemj/apis/login/LoginApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private LoginApi() {
5757
* <li>If the Server returned an error object.</li>
5858
* </ul>
5959
*/
60-
public static Boolean login(CommunicationHandler communicationHandler, AccountName accountName, String password)
60+
public static boolean login(CommunicationHandler communicationHandler, AccountName accountName, String password)
6161
throws SteemCommunicationException, SteemResponseException {
6262
JsonRPCRequest requestObject = new JsonRPCRequest();
6363
requestObject.setApiMethod(RequestMethods.LOGIN);

core/src/main/java/eu/bittrade/libs/steemj/base/models/Config.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
public class Config {
1313
@JsonProperty("IS_TEST_NET")
14-
private Boolean isTestNet;
14+
private boolean isTestNet;
1515
/**
1616
* @deprecated Has been removed with HF 19. Depending on the version of the
1717
* used Steem Node the value of this field may be null.
@@ -404,7 +404,7 @@ private Config() {
404404
/**
405405
* @return the isTestNet
406406
*/
407-
public Boolean getIsTestNet() {
407+
public boolean getIsTestNet() {
408408
return isTestNet;
409409
}
410410

core/src/main/java/eu/bittrade/libs/steemj/base/models/operations/DeclineVotingRightsOperation.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class DeclineVotingRightsOperation extends Operation {
2626
@JsonProperty("account")
2727
private AccountName account;
2828
@JsonProperty("decline")
29-
private Boolean decline;
29+
private boolean decline;
3030

3131
/**
3232
* Create a new decline voting rights operation. Use this operation with
@@ -38,12 +38,12 @@ public class DeclineVotingRightsOperation extends Operation {
3838
* {@link #setAccount(AccountName)}).
3939
* @param decline
4040
* Define if the voting rights should be declined or not (see
41-
* {@link #setDecline(Boolean)}).
41+
* {@link #setDecline(boolean)}).
4242
* @throws InvalidParameterException
4343
* If one of the arguments does not fulfill the requirements.
4444
*/
4545
public DeclineVotingRightsOperation(@JsonProperty("account") AccountName account,
46-
@JsonProperty("decline") Boolean decline) {
46+
@JsonProperty("decline") boolean decline) {
4747
super(false);
4848

4949
this.setAccount(account);
@@ -79,7 +79,7 @@ public void setAccount(AccountName account) {
7979
* @return The information if the {@link #getAccount() account} decline its
8080
* voting rights or not.
8181
*/
82-
public Boolean getDecline() {
82+
public boolean getDecline() {
8383
return decline;
8484
}
8585

@@ -91,12 +91,8 @@ public Boolean getDecline() {
9191
* The information if the {@link #getAccount() account} decline
9292
* its voting rights or not.
9393
*/
94-
public void setDecline(Boolean decline) {
95-
if (decline == null) {
96-
this.decline = false;
97-
} else {
98-
this.decline = decline;
99-
}
94+
public void setDecline(boolean decline) {
95+
this.decline = decline;
10096
}
10197

10298
@Override

core/src/main/java/eu/bittrade/libs/steemj/base/models/operations/EscrowApproveOperation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class EscrowApproveOperation extends AbstractEscrowOperation {
2727
@JsonProperty("who")
2828
private AccountName who;
2929
@JsonProperty("approve")
30-
private Boolean approve;
30+
private boolean approve;
3131

3232
/**
3333
* Create a new escrow approve operation.
@@ -61,7 +61,7 @@ public class EscrowApproveOperation extends AbstractEscrowOperation {
6161
@JsonCreator
6262
public EscrowApproveOperation(@JsonProperty("from") AccountName from, @JsonProperty("to") AccountName to,
6363
@JsonProperty("agent") AccountName agent, @JsonProperty("escrow_id") long escrowId,
64-
@JsonProperty("who") AccountName who, @JsonProperty("approve") Boolean approve) {
64+
@JsonProperty("who") AccountName who, @JsonProperty("approve") boolean approve) {
6565
super(false);
6666

6767
this.setFrom(from);
@@ -152,7 +152,7 @@ public void setWho(AccountName who) {
152152
*
153153
* @return True if the operation has been approved or false if not.
154154
*/
155-
public Boolean getApprove() {
155+
public boolean getApprove() {
156156
return approve;
157157
}
158158

core/src/main/java/eu/bittrade/libs/steemj/base/models/operations/LimitOrderCreate2Operation.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class LimitOrderCreate2Operation extends AbstractLimitOrderOperation {
3131
@JsonProperty("amount_to_sell")
3232
private Asset amountToSell;
3333
@JsonProperty("fill_or_kill")
34-
private Boolean fillOrKill;
34+
private boolean fillOrKill;
3535
@JsonProperty("exchange_rate")
3636
private Price exchangeRate;
3737
@JsonProperty("expiration")
@@ -54,7 +54,7 @@ public class LimitOrderCreate2Operation extends AbstractLimitOrderOperation {
5454
* The amount to sell (see {@link #setAmountToSell(Asset)}).
5555
* @param fillOrKill
5656
* Define if this order is a "fillOrKill" order (see
57-
* {@link #setFillOrKill(Boolean)}).
57+
* {@link #setFillOrKill(boolean)}).
5858
* @param exchangeRate
5959
* The exchange rate to set (see
6060
* {@link #setExchangeRate(Price)}).
@@ -67,7 +67,7 @@ public class LimitOrderCreate2Operation extends AbstractLimitOrderOperation {
6767
@JsonCreator
6868
public LimitOrderCreate2Operation(@JsonProperty("owner") AccountName owner,
6969
@JsonProperty("orderid") UInteger orderId, @JsonProperty("amount_to_sell") Asset amountToSell,
70-
@JsonProperty("fill_or_kill") Boolean fillOrKill, @JsonProperty("exchange_rate") Price exchangeRate,
70+
@JsonProperty("fill_or_kill") boolean fillOrKill, @JsonProperty("exchange_rate") Price exchangeRate,
7171
@JsonProperty("expiration") TimePointSec expirationDate) {
7272
super(false);
7373

@@ -81,7 +81,7 @@ public LimitOrderCreate2Operation(@JsonProperty("owner") AccountName owner,
8181

8282
/**
8383
* Like
84-
* {@link #LimitOrderCreate2Operation(AccountName, UInteger, Asset, Boolean, Price, TimePointSec)},
84+
* {@link #LimitOrderCreate2Operation(AccountName, UInteger, Asset, boolean, Price, TimePointSec)},
8585
* but this constructor applies default values for the
8686
* <code>fillOrKill</code> and the <code>expirationDate</code> parameters.
8787
* The <code>fillOrKill</code> parameter is set to false and the
@@ -200,7 +200,7 @@ public void setAmountToSell(Asset amountToSell) {
200200
* @return <code>true</code> if this order was a fill or kill order,
201201
* otherwise <code>false</code>.
202202
*/
203-
public Boolean getFillOrKill() {
203+
public boolean getFillOrKill() {
204204
return fillOrKill;
205205
}
206206

@@ -214,12 +214,8 @@ public Boolean getFillOrKill() {
214214
* <code>true</code> if this order is a fill or kill order,
215215
* otherwise <code>false</code>.
216216
*/
217-
public void setFillOrKill(Boolean fillOrKill) {
218-
if (fillOrKill == null) {
219-
this.fillOrKill = false;
220-
} else {
221-
this.fillOrKill = fillOrKill;
222-
}
217+
public void setFillOrKill(boolean fillOrKill) {
218+
this.fillOrKill = fillOrKill;
223219
}
224220

225221
/**

core/src/main/java/eu/bittrade/libs/steemj/base/models/operations/LimitOrderCreateOperation.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class LimitOrderCreateOperation extends AbstractLimitOrderOperation {
3131
@JsonProperty("min_to_receive")
3232
private Asset minToReceive;
3333
@JsonProperty("fill_or_kill")
34-
private Boolean fillOrKill;
34+
private boolean fillOrKill;
3535
@JsonProperty("expiration")
3636
private TimePointSec expirationDate;
3737

@@ -50,7 +50,7 @@ public class LimitOrderCreateOperation extends AbstractLimitOrderOperation {
5050
* {@link #setMinToReceive(Asset)}).
5151
* @param fillOrKill
5252
* Define if this order is a fill or kill order (see
53-
* {@link #setFillOrKill(Boolean)}).
53+
* {@link #setFillOrKill(boolean)}).
5454
* @param expirationDate
5555
* Define how long this order is valid (see
5656
* {@link #setExpirationDate(TimePointSec)}).
@@ -59,7 +59,7 @@ public class LimitOrderCreateOperation extends AbstractLimitOrderOperation {
5959
*/
6060
public LimitOrderCreateOperation(@JsonProperty("owner") AccountName owner,
6161
@JsonProperty("orderid") UInteger orderId, @JsonProperty("amount_to_sell") Asset amountToSell,
62-
@JsonProperty("min_to_receive") Asset minToReceive, @JsonProperty("fill_or_kill") Boolean fillOrKill,
62+
@JsonProperty("min_to_receive") Asset minToReceive, @JsonProperty("fill_or_kill") boolean fillOrKill,
6363
@JsonProperty("expiration") TimePointSec expirationDate) {
6464
super(false);
6565

@@ -213,7 +213,7 @@ public void setMinToReceive(Asset minToReceive) {
213213
* @return <code>true</code> if this order was a fill or kill order,
214214
* otherwise <code>false</code>.
215215
*/
216-
public Boolean getFillOrKill() {
216+
public boolean getFillOrKill() {
217217
return fillOrKill;
218218
}
219219

@@ -227,12 +227,8 @@ public Boolean getFillOrKill() {
227227
* <code>true</code> if this order is a fill or kill order,
228228
* otherwise <code>false</code>.
229229
*/
230-
public void setFillOrKill(Boolean fillOrKill) {
231-
if (fillOrKill == null) {
232-
this.fillOrKill = false;
233-
} else {
234-
this.fillOrKill = fillOrKill;
235-
}
230+
public void setFillOrKill(boolean fillOrKill) {
231+
this.fillOrKill = fillOrKill;
236232
}
237233

238234
/**

core/src/main/java/eu/bittrade/libs/steemj/base/models/operations/ProveAuthorityOperation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class ProveAuthorityOperation extends Operation {
2727
@JsonProperty("challenged")
2828
private AccountName challenged;
2929
@JsonProperty("require_owner")
30-
private Boolean requireOwner;
30+
private boolean requireOwner;
3131

3232
/**
3333
* Create a new prove authority operation.
@@ -43,7 +43,7 @@ public class ProveAuthorityOperation extends Operation {
4343
*/
4444
@JsonCreator
4545
public ProveAuthorityOperation(@JsonProperty("challenged") AccountName challenged,
46-
@JsonProperty("require_owner") Boolean requireOwner) {
46+
@JsonProperty("require_owner") boolean requireOwner) {
4747
super(false);
4848

4949
this.setChallenged(challenged);
@@ -93,7 +93,7 @@ public void setChallenged(AccountName challenged) {
9393
* @return <code>true</code> if the owner key should be used to sign this
9494
* operation, or false, if the active key is sufficient.
9595
*/
96-
public Boolean getRequireOwner() {
96+
public boolean getRequireOwner() {
9797
return requireOwner;
9898
}
9999

core/src/main/java/eu/bittrade/libs/steemj/base/models/operations/SetWithdrawVestingRouteOperation.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class SetWithdrawVestingRouteOperation extends Operation {
3333
@JsonProperty("percent")
3434
private int percent;
3535
@JsonProperty("auto_vest")
36-
private Boolean autoVest;
36+
private boolean autoVest;
3737

3838
/**
3939
* Create a new set withdraw vesting route operation.
@@ -62,7 +62,7 @@ public class SetWithdrawVestingRouteOperation extends Operation {
6262
@JsonCreator
6363
public SetWithdrawVestingRouteOperation(@JsonProperty("from_account") AccountName fromAccount,
6464
@JsonProperty("to_account") AccountName toAccount, @JsonProperty("percent") int percent,
65-
@JsonProperty("auto_vest") Boolean autoVest) {
65+
@JsonProperty("auto_vest") boolean autoVest) {
6666
super(false);
6767

6868
this.setFromAccount(fromAccount);
@@ -73,7 +73,7 @@ public SetWithdrawVestingRouteOperation(@JsonProperty("from_account") AccountNam
7373

7474
/**
7575
* Like
76-
* {@link #SetWithdrawVestingRouteOperation(AccountName, AccountName, int, Boolean)},
76+
* {@link #SetWithdrawVestingRouteOperation(AccountName, AccountName, int, boolean)},
7777
* but will automatically use the default values (<code>percent=0</code> and
7878
* <code>autoVest=false</code>).
7979
*
@@ -87,7 +87,7 @@ public SetWithdrawVestingRouteOperation(@JsonProperty("from_account") AccountNam
8787
* If one of the arguments does not fulfill the requirements.
8888
*/
8989
public SetWithdrawVestingRouteOperation(AccountName fromAccount, AccountName toAccount) {
90-
this(fromAccount, toAccount, 0, Boolean.FALSE);
90+
this(fromAccount, toAccount, 0, false);
9191
}
9292

9393
/**
@@ -164,7 +164,7 @@ public void setPercent(int percent) {
164164
*
165165
* @return True if the funds should be reinvested or false if not.
166166
*/
167-
public Boolean getAutoVest() {
167+
public boolean getAutoVest() {
168168
return autoVest;
169169
}
170170

0 commit comments

Comments
 (0)