Browse Source

Clases

master
Cristobal Bernal Mayordomo 2 years ago
parent
commit
a4537a08dd
3 changed files with 108 additions and 0 deletions
  1. +18
    -0
      src/main/java/com/cristobalbernal/loladvisor/LolAdvisorApp.java
  2. +32
    -0
      src/main/java/com/cristobalbernal/loladvisor/config/AppConfig.java
  3. +58
    -0
      src/main/java/com/cristobalbernal/loladvisor/model/Lol.java

+ 18
- 0
src/main/java/com/cristobalbernal/loladvisor/LolAdvisorApp.java View File

@ -0,0 +1,18 @@
package com.cristobalbernal.loladvisor;
import com.cristobalbernal.loladvisor.config.AppConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class LolAdvisorApp {
public static void main(String[] args) {
ApplicationContext appContext = new AnnotationConfigApplicationContext(AppConfig.class);
LolAdvisorRunApp runApp = appContext.getBean(LolAdvisorRunApp.class);
runApp.run(args);
((AnnotationConfigApplicationContext) appContext).close();
}
}

+ 32
- 0
src/main/java/com/cristobalbernal/loladvisor/config/AppConfig.java View File

@ -0,0 +1,32 @@
package com.cristobalbernal.loladvisor.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
@Configuration
@ComponentScan(basePackages="com.cristobalbernal")
@PropertySource("classpath:/application.properties")
public class AppConfig {
@Value("${file.path}")
public String file;
@Value("${file.csv.separator}")
public String separator;
@Value("${file.csv.list_separator}")
public String listSeparator;
public String getFile() {
return file;
}
public String getSeparator() {
return separator;
}
public String getListSeparator() {
return listSeparator;
}
}

+ 58
- 0
src/main/java/com/cristobalbernal/loladvisor/model/Lol.java View File

@ -0,0 +1,58 @@
package com.cristobalbernal.loladvisor.model;
import java.util.List;
public class Lol {
private long id;
private String nombre;
private List<String> rol;
private String genero;
public Lol() {}
public Lol(long id, String nombre, List<String> rol, String plataformas) {
this.id = id;
this.nombre = nombre;
this.rol = rol;
this.genero = plataformas;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public List<String> getRol() {
return rol;
}
public void setRol(List<String> rol) {
this.rol = rol;
}
public String getGenero() {
return genero;
}
public void setGenero(String genero) {
this.genero = genero;
}
@Override
public String toString() {
return "Videogame [id=" + id + ", nombre=" + nombre + ", Rol="
+ rol.toString() + ", plataformas=" + genero + "]";
}
}

Loading…
Cancel
Save