Class CsvDataEntity

  • All Implemented Interfaces:
    IFilterable

    public class CsvDataEntity
    extends DataEntity
    A data entity that represents a CSV record.
    • Field Detail

      • identifier

        public final String identifier
        The identifier of the record.
      • url

        public final String url
        The URL of the record.
      • title

        public final String title
        The title of the record.
      • body

        public final String body
        The body of the record.
      • date

        public final Date date
        The date of the record.
      • sourceSet

        public final String sourceSet
        The source set of the record.
      • source

        public final String source
        The source of the record.
    • Constructor Detail

      • CsvDataEntity

        public CsvDataEntity​(String identifier,
                             String url,
                             String title,
                             String body,
                             Date date,
                             String sourceSet,
                             String source)
        Creates a new CSV data entity.
        Parameters:
        identifier - the identifier of the record
        url - the URL of the record
        title - the title of the record
        body - the body of the record
        date - the date of the record
        sourceSet - the source set of the record
        source - the source of the record
    • Method Detail

      • fromCsvRecord

        public static CsvDataEntity fromCsvRecord​(org.apache.commons.csv.CSVRecord record)
        Creates a new CSV data entity from a CSV record.
        Parameters:
        record - the CSV record
        Returns:
        the CSV data entity
      • contains

        public boolean contains​(String s)
        Filters the object by a string.
        Specified by:
        contains in interface IFilterable
        Overrides:
        contains in class DataEntity
        Parameters:
        s - the string to filter by
        Returns:
        true if the object respects the filter, false otherwise
      • before

        public boolean before​(Date date)
        Filters the object by a date.
        Specified by:
        before in interface IFilterable
        Overrides:
        before in class DataEntity
        Parameters:
        date - the date to filter from
        Returns:
        true if the object respects the filter, false otherwise
      • after

        public boolean after​(Date date)
        Filters the object by a date.
        Specified by:
        after in interface IFilterable
        Overrides:
        after in class DataEntity
        Parameters:
        date - the date to filter to
        Returns:
        true if the object respects the filter, false otherwise