All Downloads are FREE. Search and download functionalities are using the official Maven repository.

crawlers.json.SingleSourceResponse Maven / Gradle / Ivy

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package crawlers.json;

import crawlers.Logos;
import db.news.NewsSource;
import db.news.Tag;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 * @author zua
 */
public class SingleSourceResponse {

    private String id;
    private String name;
    private String description;
    private String url;
    private String category;
    private String language;
    private String country;
    private Map urlsToLogos;
    private List sortBysAvailable;

    public SingleSourceResponse() {
        urlsToLogos = new HashMap<>();
        sortBysAvailable = new ArrayList<>();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public Map getUrlsToLogos() {
        return urlsToLogos;
    }

    public void setUrlsToLogos(Map urlsToLogos) {
        this.urlsToLogos = urlsToLogos;
    }

    public List getSortBysAvailable() {
        return sortBysAvailable;
    }

    public void setSortBysAvailable(List sortBysAvailable) {
        this.sortBysAvailable = sortBysAvailable;
    }


    public NewsSource convert2NewsSource() {
        NewsSource result = new NewsSource();
        result.setSourceId(id);
        result.setName(name);
        result.setDescription(description);
        result.setCountry(country);
        result.setLanguage(language);
        result.setUrl(url);
        result.setLogoUrl(Logos.getLogo(id));
        result.setCategory(new Tag(category));
        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy