Delete BookRepositoryImpl.java

This commit is contained in:
gupta-ashu01 2020-07-17 12:58:51 +05:30 committed by GitHub
parent fc717bb9f1
commit d600c40573
1 changed files with 0 additions and 35 deletions

View File

@ -1,35 +0,0 @@
package com.hexagonal.repository;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.springframework.stereotype.Repository;
import com.hexagonal.domain.Book;
@Repository
public class BookRepositoryImpl implements BookRepository {
private Map<String, Book> bookMap = new HashMap<>();
@Override
public void add(Book book) {
bookMap.put(book.getIsbn(), book);
System.out.println("Book Added " + book);
}
@Override
public Book buy(String isbn) {
return bookMap.get(isbn);
}
@Override
public List<Book> list() {
return bookMap.values()
.stream()
.collect(Collectors.toList());
}
}