Skip to content
This repository was archived by the owner on Jul 7, 2021. It is now read-only.

Commit 0c6e3b3

Browse files
authored
Integrate eo iwfy (#332)
integrate EO static analyzer iwillfailyou
1 parent 467ae47 commit 0c6e3b3

File tree

92 files changed

+434
-304
lines changed

Some content is hidden

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

92 files changed

+434
-304
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ addons:
1313
organization: proshin-roman-github
1414
install: true
1515
script:
16-
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar
16+
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package iwillfailyou:iwillfailyou sonar:sonar
1717
after_success:
1818
- mvn coveralls:report
1919
- bash <(curl -s https://codecov.io/bash)

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ The project is following the next principles (it is a subset of [those ones](htt
4545
- No instanceof, type casting or reflection
4646
- No implementation inheritance
4747

48+
All badges are through [iwillfailyou](https://iwillfailyou.com/)
49+
50+
![nullfree status](https://iwillfailyou.com/nullfree/proshin-roman/finapi-java-client)
51+
![staticfree status](https://iwillfailyou.com/staticfree/proshin-roman/finapi-java-client)
52+
![allfinal status](https://iwillfailyou.com/allfinal/proshin-roman/finapi-java-client)
53+
![allpublic status](https://iwillfailyou.com/allpublic/proshin-roman/finapi-java-client)
54+
4855
## How to use
4956

5057
Just add the following lines into your `pom.xml`

pom.xml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<dependency>
8080
<groupId>org.cactoos</groupId>
8181
<artifactId>cactoos</artifactId>
82-
<version>0.44</version>
82+
<version>0.46</version>
8383
</dependency>
8484
<dependency>
8585
<groupId>org.apache.httpcomponents</groupId>
@@ -265,6 +265,37 @@
265265
<autoReleaseAfterClose>true</autoReleaseAfterClose>
266266
</configuration>
267267
</plugin>
268+
269+
<plugin>
270+
<groupId>com.iwillfailyou</groupId>
271+
<artifactId>iwillfailyou-maven-plugin</artifactId>
272+
<version>0.2.0</version>
273+
274+
<!-- then configure it, if you need: -->
275+
<configuration>
276+
<offline>false</offline><!-- default false -->
277+
<nullfree>
278+
<disabled>false</disabled><!-- default false -->
279+
<threshold>0</threshold><!-- default 0 -->
280+
<skipComparisons>true</skipComparisons><!-- default false -->
281+
</nullfree>
282+
<staticfree>
283+
<disabled>false</disabled><!-- default false -->
284+
<threshold>0</threshold><!-- default 0 -->
285+
</staticfree>
286+
<allfinal>
287+
<disabled>false</disabled><!-- default false -->
288+
<threshold>0</threshold><!-- default 0 -->
289+
<skipInterfaceMethodParams>true</skipInterfaceMethodParams><!-- default true -->
290+
<skipLambdaParams>true</skipLambdaParams><!-- default false -->
291+
<skipCatchParams>false</skipCatchParams><!-- default false -->
292+
</allfinal>
293+
<allpublic>
294+
<disabled>false</disabled><!-- default false -->
295+
<threshold>0</threshold><!-- default 0 -->
296+
</allpublic>
297+
</configuration>
298+
</plugin>
268299
</plugins>
269300
</build>
270301

src/main/java/org/proshin/finapi/account/FpAccountInterface.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.proshin.finapi.primitives.IterableJsonArray;
2525
import org.proshin.finapi.primitives.optional.OptionalOffsetDateTimeOf;
2626

27-
public class FpAccountInterface implements AccountInterface {
27+
public final class FpAccountInterface implements AccountInterface {
2828

2929
private final JSONObject origin;
3030

src/main/java/org/proshin/finapi/account/Type.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,4 @@ public enum Type {
5353
public int asCode() {
5454
return this.code;
5555
}
56-
57-
/**
58-
* @deprecated since v0.1.92 due to PSD2-related changes
59-
*/
60-
@Deprecated
61-
public static class TypeOf {
62-
private final int code;
63-
64-
public TypeOf(final int code) {
65-
this.code = code;
66-
}
67-
68-
public Type get() {
69-
for (final Type type : values()) {
70-
if (type.asCode() == this.code) {
71-
return type;
72-
}
73-
}
74-
throw new IllegalArgumentException(String.format("Unknown type %d", this.code));
75-
}
76-
}
7756
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2020 Roman Proshin
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.proshin.finapi.account;
17+
18+
/**
19+
* @deprecated since v0.1.92 due to PSD2-related changes
20+
*/
21+
@Deprecated
22+
public final class TypeOf {
23+
private final int code;
24+
25+
public TypeOf(final int code) {
26+
this.code = code;
27+
}
28+
29+
public Type get() {
30+
for (final Type type : Type.values()) {
31+
if (type.asCode() == this.code) {
32+
return type;
33+
}
34+
}
35+
throw new IllegalArgumentException(String.format("Unknown type %d", this.code));
36+
}
37+
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* Copyright 2020 Roman Proshin
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.proshin.finapi.account.in;
17+
18+
import java.math.BigDecimal;
19+
import java.time.LocalDate;
20+
import org.json.JSONObject;
21+
import org.proshin.finapi.Jsonable;
22+
import org.proshin.finapi.primitives.StringOf;
23+
24+
public final class Debtor implements Jsonable {
25+
private final JSONObject origin;
26+
27+
public Debtor() {
28+
this(new JSONObject());
29+
}
30+
31+
public Debtor(final JSONObject origin) {
32+
this.origin = origin;
33+
}
34+
35+
public Debtor withName(final String name) {
36+
this.origin.put("debitorName", name);
37+
return this;
38+
}
39+
40+
public Debtor withIban(final String iban) {
41+
this.origin.put("debitorIban", iban);
42+
return this;
43+
}
44+
45+
public Debtor withBic(final String bic) {
46+
this.origin.put("debitorBic", bic);
47+
return this;
48+
}
49+
50+
public Debtor withAmount(final BigDecimal amount) {
51+
this.origin.put("amount", amount);
52+
return this;
53+
}
54+
55+
public Debtor withPurpose(final String purpose) {
56+
this.origin.put("purpose", purpose);
57+
return this;
58+
}
59+
60+
public Debtor withSepaPurposeCode(final String sepaPurposeCode) {
61+
this.origin.put("sepaPurposeCode", sepaPurposeCode);
62+
return this;
63+
}
64+
65+
public Debtor withMandateId(final String mandateId) {
66+
this.origin.put("mandateId", mandateId);
67+
return this;
68+
}
69+
70+
public Debtor withMandateDate(final LocalDate mandateDate) {
71+
this.origin.put("mandateDate", new StringOf(mandateDate));
72+
return this;
73+
}
74+
75+
public Debtor withCreditorId(final String creditorId) {
76+
this.origin.put("creditorId", creditorId);
77+
return this;
78+
}
79+
80+
public Debtor withEndToEndId(final String endToEndId) {
81+
this.origin.put("endToEndId", endToEndId);
82+
return this;
83+
}
84+
85+
@Override
86+
public JSONObject asJson() {
87+
return this.origin;
88+
}
89+
}

src/main/java/org/proshin/finapi/account/in/DirectDebitParameters.java

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.proshin.finapi.account.in;
1717

18-
import java.math.BigDecimal;
1918
import java.time.LocalDate;
2019
import org.json.JSONObject;
2120
import org.proshin.finapi.Jsonable;
@@ -112,71 +111,4 @@ public enum DirectDebitType {
112111
public enum SequenceType {
113112
OOFF, FRST, RCUR, FNAL
114113
}
115-
116-
public static final class Debtor implements Jsonable {
117-
private final JSONObject origin;
118-
119-
public Debtor() {
120-
this(new JSONObject());
121-
}
122-
123-
public Debtor(final JSONObject origin) {
124-
this.origin = origin;
125-
}
126-
127-
public Debtor withName(final String name) {
128-
this.origin.put("debitorName", name);
129-
return this;
130-
}
131-
132-
public Debtor withIban(final String iban) {
133-
this.origin.put("debitorIban", iban);
134-
return this;
135-
}
136-
137-
public Debtor withBic(final String bic) {
138-
this.origin.put("debitorBic", bic);
139-
return this;
140-
}
141-
142-
public Debtor withAmount(final BigDecimal amount) {
143-
this.origin.put("amount", amount);
144-
return this;
145-
}
146-
147-
public Debtor withPurpose(final String purpose) {
148-
this.origin.put("purpose", purpose);
149-
return this;
150-
}
151-
152-
public Debtor withSepaPurposeCode(final String sepaPurposeCode) {
153-
this.origin.put("sepaPurposeCode", sepaPurposeCode);
154-
return this;
155-
}
156-
157-
public Debtor withMandateId(final String mandateId) {
158-
this.origin.put("mandateId", mandateId);
159-
return this;
160-
}
161-
162-
public Debtor withMandateDate(final LocalDate mandateDate) {
163-
this.origin.put("mandateDate", new StringOf(mandateDate));
164-
return this;
165-
}
166-
167-
public Debtor withCreditorId(final String creditorId) {
168-
this.origin.put("creditorId", creditorId);
169-
return this;
170-
}
171-
172-
public Debtor withEndToEndId(final String endToEndId) {
173-
this.origin.put("endToEndId", endToEndId);
174-
return this;
175-
}
176-
177-
@Override
178-
public JSONObject asJson() {
179-
return this.origin;
180-
}
181-
}
182114
}

src/main/java/org/proshin/finapi/account/in/MoneyTransferParameters.java

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.proshin.finapi.account.in;
1717

18-
import java.math.BigDecimal;
1918
import java.time.LocalDate;
2019
import java.util.Iterator;
2120
import org.cactoos.iterator.IteratorOf;
@@ -112,62 +111,4 @@ public MoneyTransferParameters withMultiStepAuthentication(final MultiStepAuthen
112111
public JSONObject asJson() {
113112
return this.origin;
114113
}
115-
116-
public static final class Recipient implements Jsonable {
117-
118-
private final JSONObject origin;
119-
120-
public Recipient() {
121-
this(new JSONObject());
122-
}
123-
124-
public Recipient(final JSONObject origin) {
125-
this.origin = origin;
126-
}
127-
128-
public Recipient withName(final String name) {
129-
this.origin.put("recipientName", name);
130-
return this;
131-
}
132-
133-
public Recipient withIban(final String iban) {
134-
this.origin.put("recipientIban", iban);
135-
return this;
136-
}
137-
138-
public Recipient withBic(final String bic) {
139-
this.origin.put("recipientBic", bic);
140-
return this;
141-
}
142-
143-
public Recipient withClearingAccount(final String id) {
144-
this.origin.put("clearingAccountId", id);
145-
return this;
146-
}
147-
148-
public Recipient withEndToEndId(final String endToEndId) {
149-
this.origin.put("endToEndId", endToEndId);
150-
return this;
151-
}
152-
153-
public Recipient withAmount(final BigDecimal amount) {
154-
this.origin.put("amount", amount);
155-
return this;
156-
}
157-
158-
public Recipient withPurpose(final String purpose) {
159-
this.origin.put("purpose", purpose);
160-
return this;
161-
}
162-
163-
public Recipient withSepaPurposeCode(final String sepaPurposeCode) {
164-
this.origin.put("sepaPurposeCode", sepaPurposeCode);
165-
return this;
166-
}
167-
168-
@Override
169-
public JSONObject asJson() {
170-
return this.origin;
171-
}
172-
}
173114
}

0 commit comments

Comments
 (0)