diff --git a/src/main/java/com/cristobalbernal/loladvisor/model/Lol.java b/src/main/java/com/cristobalbernal/loladvisor/model/Lol.java index fc4dca5..88cb1a1 100644 --- a/src/main/java/com/cristobalbernal/loladvisor/model/Lol.java +++ b/src/main/java/com/cristobalbernal/loladvisor/model/Lol.java @@ -1,12 +1,14 @@ package com.cristobalbernal.loladvisor.model; +import java.util.List; + public class Lol { private long id; private String nombre; - private String rol; + private List rol; private String dificultad; - public Lol(long id, String nombre, String rol, String dificultad) { + public Lol(long id, String nombre, List rol, String dificultad) { this.id = id; this.nombre = nombre; this.rol = rol; @@ -21,9 +23,7 @@ public class Lol { return nombre; } - public String getRol() { - return rol; - } + public String getDificultad() { return dificultad; @@ -37,11 +37,59 @@ public class Lol { this.nombre = nombre; } - public void setRol(String rol) { + public List getRol() { + return rol; + } + + public void setRol(List rol) { this.rol = rol; } public void setDificultad(String dificultad) { this.dificultad = dificultad; } + + @Override + public int hashCode() { + return super.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Lol other = (Lol) obj; + if (dificultad == null) { + if (other.dificultad != null) + return false; + } else if (!dificultad.equals(other.dificultad)) + return false; + if (id != other.id) + return false; + if (nombre == null) { + if (other.nombre != null) + return false; + } else if (!nombre.equals(other.nombre)) + return false; + if (rol == null) { + if (other.rol != null) + return false; + } else if (!rol.equals(other.rol)) + return false; + return true; + } + + @Override + public String toString() { + return "Lol{" + + "id=" + id + + ", nombre='" + nombre + '\'' + + ", rol=" + rol + + ", dificultad='" + dificultad + '\'' + + '}'; + } }