Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Servlet {
- public Entity createEntity(JSONObject json){
- String host = json.getString("host");
- String user = json.getString("user");
- String pwd = json.getString("pwd");
- String bd = json.getString("bd");
- Entity entity = new Entity(host, user, pwd, bd);
- return entity;
- }
- }
- public class Entity {
- private String host;
- private String user;
- private String pwd;
- private String bd;
- public Entity(String host, String user, String pwd, String bd){
- this.host = host;
- this.user = user;
- this.pwd = pwd;
- this.bd = bd;
- }
- public String getHost() {
- return host;
- }
- public void setHost(String host) {
- this.host = host;
- }
- public String getUser() {
- return user;
- }
- public void setUser(String user) {
- this.user = user;
- }
- public String getPwd() {
- return pwd;
- }
- public void setPwd(String pwd) {
- this.pwd = pwd;
- }
- public String getBd() {
- return bd;
- }
- public void setBd(String bd) {
- this.bd = bd;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement