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

com.kazurayam.materialstore.mapper.RSSDemo2ExcelMapper Maven / Gradle / Ivy

package com.kazurayam.materialstore.mapper;

import com.rometools.rome.feed.synd.SyndFeed;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public final class RSSDemo2ExcelMapper extends RSS2ExcelMapper {

    private static final Logger logger =
            LoggerFactory.getLogger(RSSDemo2ExcelMapper.class);

    public RSSDemo2ExcelMapper() {
        super();
    }

    @Override
    String getSheetName() {
        return "Sheet1";
    }

    @Override
    List> getData(SyndFeed feed) {
        // feed argument is not used
        List columnNames = this.getColumns();
        List> grid = new ArrayList<>();
        grid.add(new HashMap() {{
            put(columnNames.get(0).name(), "Hadrianus");
            put(columnNames.get(1).name(), "42");
        }});
        grid.add(new HashMap() {{
            put(columnNames.get(0).name(), "Antoninus Pius");
            put(columnNames.get(1).name(), "74");
        }});
        grid.add(new HashMap() {{
            put(columnNames.get(0).name(), "Marcus Aurelius");
            put(columnNames.get(1).name(), "58");
        }});
        return grid;
    }

    @Override
    List getColumns() {
        return Arrays.asList(
                new Column("Name", 6000),
                new Column("Age", 4000)
        );
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy