Skip to content

Instantly share code, notes, and snippets.

@nico-abram
Created April 20, 2018 20:16
Show Gist options
  • Save nico-abram/56ab6039db56bf84766d6c451ff19d7c to your computer and use it in GitHub Desktop.
Save nico-abram/56ab6039db56bf84766d6c451ff19d7c to your computer and use it in GitHub Desktop.
public static void main(String[] args) {
Dispositivo a = new Dispositivo("a", 1.0, true);
Dispositivo b = new Dispositivo("b", 1.0, true);
RepoDispositivos.getInstance().agregar(a);
RepoDispositivos.getInstance().agregar(b);
try {
JSONWrapper.getInstance().guardarDispositivos();
RepoDispositivos.getInstance().quitar(a);
JSONWrapper.getInstance().cargarDispositivos();
RepoDispositivos.getInstance().get().forEach(disp -> {
System.out.println(disp.nombre());
});
}
catch(Exception e) {}
LocalDate now = LocalDate.now();
Administrador aA = new Administrador(
new String[]{"Juan"}, new String[]{"Perez"},
"Belgrano 2251", now.minusMonths(2));
Administrador bA = new Administrador(
new String[]{"Pepe"}, new String[]{"Rodriguez"},
"Belgrano 2251", now.minusMonths(3));
RepoAdmins.getInstance().agregar(aA);
RepoAdmins.getInstance().agregar(bA);
try {
JSONWrapper.getInstance().guardarAdmins();
RepoAdmins.getInstance().quitar(aA);
JSONWrapper.getInstance().cargarAdmins();
RepoAdmins.getInstance().get().forEach(adm -> {
System.out.println(adm.nombre());
});
}
catch(Exception e) {}
Cliente aC = new Cliente(
new String[]{"Juan"}, new String[]{"Perez"},new Documento(40732178, TipoDocumento.DNI),
"Belgrano 2251", "", null, null);
Cliente bC = new Cliente(
new String[]{"Martin"}, new String[]{"Perez"},new Documento(40732178, TipoDocumento.DNI),
"Belgrano 2251", "", null, null);
RepoClientes.getInstance().agregar(aC);
RepoClientes.getInstance().agregar(bC);
try {
JSONWrapper.getInstance().guardarClientes();
RepoClientes.getInstance().quitar(aC);
JSONWrapper.getInstance().cargarClientes();
RepoClientes.getInstance().get().forEach(c -> {
System.out.println(c.nombre());
});
}
catch(Exception e) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment