Primero
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package org.palomafp.dam2.aadd.anp.model;
|
||||
|
||||
public class Continente {
|
||||
|
||||
private String codigoContinente;
|
||||
private String nombre;
|
||||
|
||||
public Continente(String codigoContinente, String nombre) {
|
||||
this.codigoContinente = codigoContinente;
|
||||
this.nombre = nombre;
|
||||
}
|
||||
|
||||
public Continente() {
|
||||
}
|
||||
|
||||
public String getCodigoContinente() {
|
||||
return codigoContinente;
|
||||
}
|
||||
|
||||
public void setCodigoContinente(String codigoContinente) {
|
||||
this.codigoContinente = codigoContinente;
|
||||
}
|
||||
|
||||
public String getNombre() {
|
||||
return nombre;
|
||||
}
|
||||
|
||||
public void setNombre(String nombre) {
|
||||
this.nombre = nombre;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Continente [Código: " + codigoContinente + ", Nombre: " + nombre + "]";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.palomafp.dam2.aadd.anp.model;
|
||||
|
||||
public class Pais {
|
||||
|
||||
private int id;
|
||||
private String nombre;
|
||||
private String capital;
|
||||
private Continente continente;
|
||||
|
||||
public Pais() {
|
||||
}
|
||||
|
||||
public Pais(int id, String nombre, String capital, Continente continente) {
|
||||
this.id = id;
|
||||
this.nombre = nombre;
|
||||
this.capital = capital;
|
||||
this.continente = continente;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getNombre() {
|
||||
return nombre;
|
||||
}
|
||||
|
||||
public void setNombre(String nombre) {
|
||||
this.nombre = nombre;
|
||||
}
|
||||
|
||||
public String getCapital() {
|
||||
return capital;
|
||||
}
|
||||
|
||||
public void setCapital(String capital) {
|
||||
this.capital = capital;
|
||||
}
|
||||
|
||||
public Continente getContinente() {
|
||||
return continente;
|
||||
}
|
||||
|
||||
public void setContinente(Continente continente) {
|
||||
this.continente = continente;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return nombre + " (" + id + "), con capital en " + capital
|
||||
+ " pertenece a " + continente.getNombre()
|
||||
+ " (" + continente.getCodigoContinente() + ")";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user