Class JsonDataEntity

  • All Implemented Interfaces:
    IFilterable

    public class JsonDataEntity
    extends DataEntity
    A data entity that represents a JSON record.
    • Field Detail

      • id

        public final int id
        The identifier of the record.
      • title

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

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

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

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

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

      • JsonDataEntity

        public JsonDataEntity​(int id,
                              String title,
                              String body,
                              String url,
                              Date date,
                              String source)
        Creates a new JSON data entity.
        Parameters:
        id - the identifier of the record
        title - the title of the record
        body - the body of the record
        url - the URL of the record
        date - the date of the record
        source - the source of the record
    • Method Detail

      • 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