Last active
December 16, 2015 00:49
-
-
Save rohman/5350317 to your computer and use it in GitHub Desktop.
Ulang Spring mvc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package id.web.rohman.ulangspring.service.impl; | |
import id.web.rohman.ulangspring.model.Tamu; | |
import id.web.rohman.ulangspring.service.api.TamuService; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.springframework.stereotype.Service; | |
/** | |
* | |
* @author syahril | |
*/ | |
@Service | |
public class TamuServiceImpl implements TamuService{ | |
private List<Tamu> dbPalsu = new ArrayList<Tamu>(); | |
public TamuServiceImpl() { | |
Tamu t = new Tamu(); | |
t.setName("Ariel"); | |
t.setAddress("Jakarta"); | |
t.setEmail("[email protected]"); | |
t.setId(dbPalsu.size()); | |
dbPalsu.add(t); | |
Tamu t2 = new Tamu(); | |
t2.setName("rohman"); | |
t2.setAddress("Bandung"); | |
t2.setEmail("[email protected]"); | |
t2.setId(dbPalsu.size()); | |
dbPalsu.add(t2); | |
} | |
public List<Tamu> listTamu() { | |
return dbPalsu; | |
} | |
public Tamu findTamuById(Integer id) { | |
return dbPalsu.get(id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment