formatting cleanup
This commit is contained in:
parent
b3878dada2
commit
a25f807e3e
@ -1,6 +1,5 @@
|
|||||||
package com.baeldung.doublecolumn;
|
package com.baeldung.doublecolumn;
|
||||||
|
|
||||||
|
|
||||||
public class Computer {
|
public class Computer {
|
||||||
|
|
||||||
private Integer age;
|
private Integer age;
|
||||||
@ -47,21 +46,20 @@ public class Computer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Computer{" +
|
return "Computer{" + "age=" + age + ", color='" + color + '\'' + ", healty=" + healty + '}';
|
||||||
"age=" + age +
|
|
||||||
", color='" + color + '\'' +
|
|
||||||
", healty=" + healty +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o)
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
return true;
|
||||||
|
if (o == null || getClass() != o.getClass())
|
||||||
|
return false;
|
||||||
|
|
||||||
Computer computer = (Computer) o;
|
Computer computer = (Computer) o;
|
||||||
|
|
||||||
if (age != null ? !age.equals(computer.age) : computer.age != null) return false;
|
if (age != null ? !age.equals(computer.age) : computer.age != null)
|
||||||
|
return false;
|
||||||
return color != null ? color.equals(computer.color) : computer.color == null;
|
return color != null ? color.equals(computer.color) : computer.color == null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import java.util.List;
|
|||||||
|
|
||||||
public class ComputerUtils {
|
public class ComputerUtils {
|
||||||
|
|
||||||
|
|
||||||
public static final ComputerPredicate after2010Predicate = (c) -> (c.getAge() > 2010);
|
public static final ComputerPredicate after2010Predicate = (c) -> (c.getAge() > 2010);
|
||||||
public static final ComputerPredicate blackPredicate = (c) -> "black".equals(c.getColor());
|
public static final ComputerPredicate blackPredicate = (c) -> "black".equals(c.getColor());
|
||||||
|
|
||||||
@ -19,12 +18,10 @@ public class ComputerUtils {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void repair(Computer computer) {
|
public static void repair(Computer computer) {
|
||||||
if (computer.getHealty() < 50) {
|
if (computer.getHealty() < 50) {
|
||||||
computer.setHealty(100);
|
computer.setHealty(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package com.baeldung.doublecolumn.function;
|
|||||||
|
|
||||||
import com.baeldung.doublecolumn.Computer;
|
import com.baeldung.doublecolumn.Computer;
|
||||||
|
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface ComputerPredicate {
|
public interface ComputerPredicate {
|
||||||
|
|
||||||
|
@ -8,8 +8,7 @@ public interface TriFunction<A,B,C,R> {
|
|||||||
|
|
||||||
R apply(A a, B b, C c);
|
R apply(A a, B b, C c);
|
||||||
|
|
||||||
default <V> TriFunction<A, B, C, V> andThen(
|
default <V> TriFunction<A, B, C, V> andThen(Function<? super R, ? extends V> after) {
|
||||||
Function<? super R, ? extends V> after) {
|
|
||||||
Objects.requireNonNull(after);
|
Objects.requireNonNull(after);
|
||||||
return (A a, B b, C c) -> after.apply(apply(a, b, c));
|
return (A a, B b, C c) -> after.apply(apply(a, b, c));
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@ import static com.baeldung.doublecolumn.ComputerUtils.*;
|
|||||||
|
|
||||||
public class TestComputerUtils {
|
public class TestComputerUtils {
|
||||||
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user