Skip to content

Commit 8771311

Browse files
author
eugenp
committed
formatting cleanup
1 parent a25f807 commit 8771311

File tree

4 files changed

+22
-19
lines changed

4 files changed

+22
-19
lines changed

core-java-8/src/main/java/com/baeldung/AdderImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
public class AdderImpl implements Adder {
77

88
@Override
9-
public String addWithFunction(Function<String, String> f) {
9+
public String addWithFunction(final Function<String, String> f) {
1010
return f.apply("Something ");
1111
}
1212

1313
@Override
14-
public void addWithConsumer(Consumer<Integer> f) {
14+
public void addWithConsumer(final Consumer<Integer> f) {
1515
}
1616

1717
}

core-java-8/src/main/java/com/baeldung/doublecolumn/Computer.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ public class Computer {
66
private String color;
77
private Integer healty;
88

9-
public Computer(int age, String color) {
9+
public Computer(final int age, final String color) {
1010
this.age = age;
1111
this.color = color;
1212
}
1313

14-
public Computer(Integer age, String color, Integer healty) {
14+
public Computer(final Integer age, final String color, final Integer healty) {
1515
this.age = age;
1616
this.color = color;
1717
this.healty = healty;
@@ -24,23 +24,23 @@ public Integer getAge() {
2424
return age;
2525
}
2626

27-
public void setAge(Integer age) {
27+
public void setAge(final Integer age) {
2828
this.age = age;
2929
}
3030

3131
public String getColor() {
3232
return color;
3333
}
3434

35-
public void setColor(String color) {
35+
public void setColor(final String color) {
3636
this.color = color;
3737
}
3838

3939
public Integer getHealty() {
4040
return healty;
4141
}
4242

43-
public void setHealty(Integer healty) {
43+
public void setHealty(final Integer healty) {
4444
this.healty = healty;
4545
}
4646

@@ -50,16 +50,19 @@ public String toString() {
5050
}
5151

5252
@Override
53-
public boolean equals(Object o) {
54-
if (this == o)
53+
public boolean equals(final Object o) {
54+
if (this == o) {
5555
return true;
56-
if (o == null || getClass() != o.getClass())
56+
}
57+
if (o == null || getClass() != o.getClass()) {
5758
return false;
59+
}
5860

59-
Computer computer = (Computer) o;
61+
final Computer computer = (Computer) o;
6062

61-
if (age != null ? !age.equals(computer.age) : computer.age != null)
63+
if (age != null ? !age.equals(computer.age) : computer.age != null) {
6264
return false;
65+
}
6366
return color != null ? color.equals(computer.color) : computer.color == null;
6467

6568
}

core-java-8/src/main/java/com/baeldung/doublecolumn/ComputerUtils.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
package com.baeldung.doublecolumn;
22

3-
import com.baeldung.doublecolumn.function.ComputerPredicate;
4-
53
import java.util.ArrayList;
64
import java.util.List;
75

6+
import com.baeldung.doublecolumn.function.ComputerPredicate;
7+
88
public class ComputerUtils {
99

1010
public static final ComputerPredicate after2010Predicate = (c) -> (c.getAge() > 2010);
1111
public static final ComputerPredicate blackPredicate = (c) -> "black".equals(c.getColor());
1212

13-
public static List<Computer> filter(List<Computer> inventory, ComputerPredicate p) {
13+
public static List<Computer> filter(final List<Computer> inventory, final ComputerPredicate p) {
1414

15-
List<Computer> result = new ArrayList<>();
15+
final List<Computer> result = new ArrayList<>();
1616
inventory.stream().filter(p::filter).forEach(result::add);
1717

1818
return result;
1919
}
2020

21-
public static void repair(Computer computer) {
21+
public static void repair(final Computer computer) {
2222
if (computer.getHealty() < 50) {
2323
computer.setHealty(100);
2424
}

core-java-8/src/main/java/com/baeldung/doublecolumn/function/TriFunction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ public interface TriFunction<A, B, C, R> {
88

99
R apply(A a, B b, C c);
1010

11-
default <V> TriFunction<A, B, C, V> andThen(Function<? super R, ? extends V> after) {
11+
default <V> TriFunction<A, B, C, V> andThen(final Function<? super R, ? extends V> after) {
1212
Objects.requireNonNull(after);
13-
return (A a, B b, C c) -> after.apply(apply(a, b, c));
13+
return (final A a, final B b, final C c) -> after.apply(apply(a, b, c));
1414
}
1515
}

0 commit comments

Comments
 (0)