Browse Source

Me falta el readme

master
Cristobal Bernal Mayordomo 2 years ago
parent
commit
38ec29a296
6 changed files with 7 additions and 16 deletions
  1. +1
    -1
      src/main/java/com/cristobalbernal/loladvisor/LolAdvisorRunApp.java
  2. +1
    -1
      src/main/java/com/cristobalbernal/loladvisor/dao/LolDao.java
  3. +1
    -1
      src/main/java/com/cristobalbernal/loladvisor/dao/LolDaoImplMemory.java
  4. +0
    -1
      src/main/java/com/cristobalbernal/loladvisor/service/LolQueryService.java
  5. +1
    -8
      src/main/java/com/cristobalbernal/loladvisor/service/LolQueryServiceImpl.java
  6. +3
    -4
      src/main/java/com/cristobalbernal/loladvisor/service/LolService.java

+ 1
- 1
src/main/java/com/cristobalbernal/loladvisor/LolAdvisorRunApp.java View File

@ -65,7 +65,7 @@ public class LolAdvisorRunApp {
lolQueryService.titleContains(argumento[1]);
break;
case "-l":
daoImplMemory.findAll();
daoImplMemory.mostrarTodos();
break;
case "-c":
daoImplMemory.mostrarCantidadPersonajes();


+ 1
- 1
src/main/java/com/cristobalbernal/loladvisor/dao/LolDao.java View File

@ -5,7 +5,7 @@ import java.util.Collection;
public interface LolDao {
public void buscarPorID(long id);
public Collection<Lol> findAll();
public Collection<Lol> mostrarTodos();
public void insertarPersonaje(Lol videogame);
public void editarPersonaje(Lol videogame);
public void eliminarPersonaje(long id);


+ 1
- 1
src/main/java/com/cristobalbernal/loladvisor/dao/LolDaoImplMemory.java View File

@ -29,7 +29,7 @@ public class LolDaoImplMemory implements LolDao {
System.out.println(result.orElse(null));
}
@Override
public Collection<Lol> findAll() {
public Collection<Lol> mostrarTodos() {
return lol;
}


+ 0
- 1
src/main/java/com/cristobalbernal/loladvisor/service/LolQueryService.java View File

@ -9,6 +9,5 @@ public interface LolQueryService {
public LolQueryService allName(String... name);
public LolQueryService titleContains(String title);
public LolQueryService mostrarPorDificultada(String... dificultad);
public LolQueryService mostrarPorGenero(String... genero);
}

+ 1
- 8
src/main/java/com/cristobalbernal/loladvisor/service/LolQueryServiceImpl.java View File

@ -26,7 +26,7 @@ public class LolQueryServiceImpl implements LolQueryService {
@Override
public Collection<Lol> exec() {
//@formatter:off
return dao.findAll()
return dao.mostrarTodos()
.stream()
.filter(predicate)
.collect(Collectors.toList());
@ -60,11 +60,4 @@ public class LolQueryServiceImpl implements LolQueryService {
predicate = (predicate == null) ? pAnyGenre : predicate.and(pAnyGenre);
return this;
}
@Override
public LolQueryService mostrarPorGenero(String... genero) {
Predicate<Lol> pAnyGenre = (lol -> Arrays.stream(genero).anyMatch(lol.getGenero()::contains));
predicate = (predicate == null) ? pAnyGenre : predicate.and(pAnyGenre);
return this;
}
}

+ 3
- 4
src/main/java/com/cristobalbernal/loladvisor/service/LolService.java View File

@ -20,7 +20,7 @@ public class LolService {
List<String> result = null;
result = lolDao.findAll()
result = lolDao.mostrarTodos()
.stream()
.map(lol -> lol.getRol())
.flatMap(list -> list.stream())
@ -36,12 +36,11 @@ public class LolService {
public Collection<Lol> findByAnyGenre(String... genres) {
return queryService.anyName(genres).exec();
}
public Collection<Lol> findByAllGenres(String... genres) {
return queryService.allName(genres).exec();
}
public Collection<Lol> buscarPorDifucultad(String... dificultada){
return null;
return queryService.mostrarPorDificultada(dificultada).exec();
}
public Collection<Lol> findByTitleContains(String title) {
@ -49,6 +48,6 @@ public class LolService {
}
public Collection<Lol> findAll() {
return lolDao.findAll();
return lolDao.mostrarTodos();
}
}

Loading…
Cancel
Save