minor formatting work
This commit is contained in:
@@ -4,9 +4,9 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class Building {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Building.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Building.class);
|
||||
|
||||
public void paint() {
|
||||
LOGGER.info("Painting Building");
|
||||
}
|
||||
public void paint() {
|
||||
LOGGER.info("Painting Building");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,11 +15,9 @@ public class Generics {
|
||||
// definition of a generic method
|
||||
public static <T, G> List<G> fromArrayToList(T[] a, List<G> list, Function<T, G> mapperFunction) {
|
||||
List<T> listWithTypeT = Arrays.stream(a).collect(Collectors.toList());
|
||||
return listWithTypeT.stream().map(mapperFunction)
|
||||
.collect(Collectors.toList());
|
||||
return listWithTypeT.stream().map(mapperFunction).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
// example of a generic method that has Number as an upper bound for T
|
||||
public static <T extends Number> List<T> fromArrayToListWithUpperBound(T[] a) {
|
||||
return Arrays.stream(a).collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user