Skip to content

Commit 9eeda4c

Browse files
Merge pull request #209 from OpenElements/spotless
feat: add Spotless code formatting and CI check
2 parents e9841a6 + 3b0fda1 commit 9eeda4c

File tree

211 files changed

+20343
-18515
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+20343
-18515
lines changed

.github/workflows/maven.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ jobs:
3030
distribution: 'temurin'
3131
cache: maven
3232

33+
- name: Check code formatting with Spotless
34+
run: ./mvnw spotless:check
35+
3336
- name: Prepare Hiero Solo
3437
id: solo
3538
uses: hiero-ledger/hiero-solo-action@fbca3e7a99ce9aa8a250563a81187abe115e0dad # v0.16.0

hiero-enterprise-base/src/main/java/com/openelements/hiero/base/AccountClient.java

Lines changed: 82 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -7,96 +7,97 @@
77
import org.jspecify.annotations.NonNull;
88

99
/**
10-
* Interface for interacting with a Hiero network. This interface provides methods for interacting with Hedera accounts,
11-
* like creating and deleting accounts. An implementation of this interface is using an internal account to interact
12-
* with a Hiero network. That account is the account that is used to pay for the transactions that are sent to the
13-
* network and called 'operator account'.
10+
* Interface for interacting with a Hiero network. This interface provides methods for interacting
11+
* with Hedera accounts, like creating and deleting accounts. An implementation of this interface is
12+
* using an internal account to interact with a Hiero network. That account is the account that is
13+
* used to pay for the transactions that are sent to the network and called 'operator account'.
1414
*/
1515
public interface AccountClient {
1616

17-
/**
18-
* Creates a new account. The account is created with an initial balance of 0 hbar. The account is created by the
19-
* operator account.
20-
*
21-
* @return the created account
22-
* @throws HieroException if the account could not be created
23-
*/
24-
@NonNull
25-
default Account createAccount() throws HieroException {
26-
return createAccount(Hbar.ZERO);
27-
}
17+
/**
18+
* Creates a new account. The account is created with an initial balance of 0 hbar. The account is
19+
* created by the operator account.
20+
*
21+
* @return the created account
22+
* @throws HieroException if the account could not be created
23+
*/
24+
@NonNull
25+
default Account createAccount() throws HieroException {
26+
return createAccount(Hbar.ZERO);
27+
}
2828

29-
/**
30-
* Creates a new account with the given initial balance. The account is created by the operator account.
31-
*
32-
* @param initialBalance the initial balance of the account
33-
* @return the created account
34-
* @throws HieroException if the account could not be created
35-
*/
36-
@NonNull
37-
Account createAccount(@NonNull Hbar initialBalance) throws HieroException;
29+
/**
30+
* Creates a new account with the given initial balance. The account is created by the operator
31+
* account.
32+
*
33+
* @param initialBalance the initial balance of the account
34+
* @return the created account
35+
* @throws HieroException if the account could not be created
36+
*/
37+
@NonNull Account createAccount(@NonNull Hbar initialBalance) throws HieroException;
3838

39-
/**
40-
* Creates a new account with the given initial balance (in HBAR). The account is created by the operator account.
41-
*
42-
* @param initialBalanceInHbar the initial balance of the account in HBAR
43-
* @return the created account
44-
* @throws HieroException if the account could not be created
45-
*/
46-
@NonNull
47-
default Account createAccount(long initialBalanceInHbar) throws HieroException {
48-
if (initialBalanceInHbar < 0) {
49-
throw new IllegalArgumentException("initialBalanceInHbar must be non-negative");
50-
}
51-
return createAccount(Hbar.from(initialBalanceInHbar));
39+
/**
40+
* Creates a new account with the given initial balance (in HBAR). The account is created by the
41+
* operator account.
42+
*
43+
* @param initialBalanceInHbar the initial balance of the account in HBAR
44+
* @return the created account
45+
* @throws HieroException if the account could not be created
46+
*/
47+
@NonNull
48+
default Account createAccount(long initialBalanceInHbar) throws HieroException {
49+
if (initialBalanceInHbar < 0) {
50+
throw new IllegalArgumentException("initialBalanceInHbar must be non-negative");
5251
}
52+
return createAccount(Hbar.from(initialBalanceInHbar));
53+
}
5354

54-
/**
55-
* Deletes the account with the given ID. All fees of that account are transferred to the operator account.
56-
*
57-
* @param account the account to delete
58-
* @throws HieroException if the account could not be deleted
59-
*/
60-
void deleteAccount(@NonNull Account account) throws HieroException;
55+
/**
56+
* Deletes the account with the given ID. All fees of that account are transferred to the operator
57+
* account.
58+
*
59+
* @param account the account to delete
60+
* @throws HieroException if the account could not be deleted
61+
*/
62+
void deleteAccount(@NonNull Account account) throws HieroException;
6163

62-
/**
63-
* Deletes the account with the given ID. All fees of that account are transferred to the given toAccount.
64-
*
65-
* @param account the account to delete
66-
* @param toAccount the account to transfer the fees to
67-
* @throws HieroException if the account could not be deleted
68-
*/
69-
void deleteAccount(@NonNull Account account, @NonNull Account toAccount) throws HieroException;
64+
/**
65+
* Deletes the account with the given ID. All fees of that account are transferred to the given
66+
* toAccount.
67+
*
68+
* @param account the account to delete
69+
* @param toAccount the account to transfer the fees to
70+
* @throws HieroException if the account could not be deleted
71+
*/
72+
void deleteAccount(@NonNull Account account, @NonNull Account toAccount) throws HieroException;
7073

71-
/**
72-
* Returns the balance of the given account.
73-
*
74-
* @param accountId the ID of the account
75-
* @return the balance of the account
76-
* @throws HieroException if the balance could not be retrieved
77-
*/
78-
@NonNull
79-
Hbar getAccountBalance(@NonNull AccountId accountId) throws HieroException;
74+
/**
75+
* Returns the balance of the given account.
76+
*
77+
* @param accountId the ID of the account
78+
* @return the balance of the account
79+
* @throws HieroException if the balance could not be retrieved
80+
*/
81+
@NonNull Hbar getAccountBalance(@NonNull AccountId accountId) throws HieroException;
8082

81-
/**
82-
* Returns the balance of the given account.
83-
*
84-
* @param accountId the ID of the account
85-
* @return the balance of the account
86-
* @throws HieroException if the balance could not be retrieved
87-
*/
88-
@NonNull
89-
default Hbar getAccountBalance(@NonNull String accountId) throws HieroException {
90-
Objects.requireNonNull(accountId, "newAccountId must not be null");
91-
return getAccountBalance(AccountId.fromString(accountId));
92-
}
83+
/**
84+
* Returns the balance of the given account.
85+
*
86+
* @param accountId the ID of the account
87+
* @return the balance of the account
88+
* @throws HieroException if the balance could not be retrieved
89+
*/
90+
@NonNull
91+
default Hbar getAccountBalance(@NonNull String accountId) throws HieroException {
92+
Objects.requireNonNull(accountId, "newAccountId must not be null");
93+
return getAccountBalance(AccountId.fromString(accountId));
94+
}
9395

94-
/**
95-
* Returns the balance of the operator account.
96-
*
97-
* @return the balance of the operator account
98-
* @throws HieroException if the balance could not be retrieved
99-
*/
100-
@NonNull
101-
Hbar getOperatorAccountBalance() throws HieroException;
96+
/**
97+
* Returns the balance of the operator account.
98+
*
99+
* @return the balance of the operator account
100+
* @throws HieroException if the balance could not be retrieved
101+
*/
102+
@NonNull Hbar getOperatorAccountBalance() throws HieroException;
102103
}

0 commit comments

Comments
 (0)