
org.spincast.website.repositories.NewsRepository Maven / Gradle / Ivy
package org.spincast.website.repositories;
import java.util.List;
import org.spincast.website.models.NewsEntriesAndTotalNbr;
import org.spincast.website.models.NewsEntry;
/**
* Repository for Spincast's news entry / blog entries.
*/
public interface NewsRepository {
/**
* Gets news entries number.
*/
public int getNewsEntriesTotalNumber();
/**
* Gets all the news entries.
*
* @param ascOrder If true
, returns the entries by their
* publication date in ascending order. Otherwise, in descending
* order.
*/
public List getNewsEntries(boolean ascOrder);
/**
* Gets news entries.
*
* @param startPos The position of the first entry to return. The first element
* is "1", not "0".
*
* @param endPos The position of the last entry to return (inclusive).
*
* @param ascOrder If true
, returns the entries by their
* publication date in ascending order. Otherwise, in descending
* order.
*/
public List getNewsEntries(int startPos, int endPos, boolean ascOrder);
/**
* Gets news entries and the number total of entries in the data source.
*
* @param startPos The position of the first entry to return. The first element
* is "1", not "0".
* @param endPos The position of the last entry to return (inclusive).
*
* @param ascOrder If true
, returns the entries by their
* publication date in ascending order. Otherwise, in descending
* order.
*/
public NewsEntriesAndTotalNbr getNewsEntriesAndTotalNbr(int startPos, int endPos, boolean ascOrder);
/**
* Gets a specific news entry.
*
* @return the news entry or null
if not found.
*/
public NewsEntry getNewsEntry(long newsId);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy