Package it.unipd.dei.eis.data.entities
Class CsvDataEntity
- java.lang.Object
-
- it.unipd.dei.eis.data.entities.DataEntity
-
- it.unipd.dei.eis.data.entities.CsvDataEntity
-
- All Implemented Interfaces:
IFilterable
public class CsvDataEntity extends DataEntity
A data entity that represents a CSV record.
-
-
Field Summary
Fields Modifier and Type Field Description StringbodyThe body of the record.DatedateThe date of the record.StringidentifierThe identifier of the record.StringsourceThe source of the record.StringsourceSetThe source set of the record.StringtitleThe title of the record.StringurlThe URL of the record.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanafter(Date date)Filters the object by a date.booleanbefore(Date date)Filters the object by a date.booleancontains(String s)Filters the object by a string.static CsvDataEntityfromCsvRecord(org.apache.commons.csv.CSVRecord record)Creates a new CSV data entity from 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 recordurl- the URL of the recordtitle- the title of the recordbody- the body of the recorddate- the date of the recordsourceSet- the source set of the recordsource- 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:
containsin interfaceIFilterable- Overrides:
containsin classDataEntity- 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:
beforein interfaceIFilterable- Overrides:
beforein classDataEntity- 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:
afterin interfaceIFilterable- Overrides:
afterin classDataEntity- Parameters:
date- the date to filter to- Returns:
- true if the object respects the filter, false otherwise
-
-