Last active
June 2, 2016 13:01
-
-
Save gastonprieto/7a2825575c0bb61acf8b7ae616d13032 to your computer and use it in GitHub Desktop.
gestion_incidentes_ugly
This file contains hidden or 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
public class Incidente { | |
private String tag; | |
private String sector; | |
} | |
public class PersonaViolenta extends Incidente { | |
private Persona persona; | |
private String sector; | |
} | |
public class PrincipioIncendio extends Incidente { | |
} | |
public interface GestorIncidentes { | |
public void registrar(Incidente incidente) ; | |
} | |
public class GestionDeIncidentesImpl implements GestorIncidentes { | |
private List<Incidente> incidentes; | |
private BlackList = new BlackList(); | |
private Biper = new Biper(); | |
private boolean integracionBlackList; | |
private boolean integracionBiper; | |
private boolean integracionBomberos; | |
private boolean integracionPrevencion; | |
public void registrar(Incidente incidente) { | |
this.incidentes.add(incidente); | |
if (incidente.getClass().equals(PersonaViolenta.class)) { | |
PersonaViolenta invidenteViolento = (PersonaViolenta) incidente; | |
if (integracionBlackList) { | |
blackList.registrar(incidenteViolenta.getPersona().getDni()); | |
} | |
if (integracionBiper) { | |
biper.call(incidenteViolento.getSector(), "Incidente Violento"); | |
} | |
} | |
if (incidente.getClass().equals(PrincipioIncendio.class) { | |
if (integracionBomberos) { | |
//..... | |
} | |
if (integracionPrevencion) { | |
//..... | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment