Package org.silverpeas.components.blog.service

# Class BlogFilters

java.lang.Object
org.silverpeas.components.blog.service.BlogFilters

public class BlogFilters extends Object
Class allowing to define several filters for blog post fetching.

Author:
  silveryocha

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BlogFilters(boolean getDraftIfNotCreator)`
  Mandatory constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Optional<Integer>`
  `getMaxResult()`
  Gets the maximum of results if any.
  `Predicate<org.silverpeas.core.contribution.publication.model.PublicationDetail>`
  `toPredicate()`
  Gets the predicate to apply on publication list.
  `BlogFilters`
  `withCreatorId(String creatorId)`
  Sets the identifier of the creator.
  `BlogFilters`
  `withMaxResult(int maxResult)`
  Sets the maximum result if result must be limited.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### BlogFilters

    public BlogFilters(boolean getDraftIfNotCreator)
    Mandatory constructor.
    Parameters:
      `getDraftIfNotCreator` - true to get

- ## Method Details

  - ### withCreatorId

    public BlogFilters withCreatorId(String creatorId)
    Sets the identifier of the creator.

    The creator is a registered Silverpeas user.

    Parameters:
      `creatorId` - identifier of a user.
    Returns:
      itself.

  - ### withMaxResult

    public BlogFilters withMaxResult(int maxResult)
    Sets the maximum result if result must be limited.
    Parameters:
      `maxResult` - positive integer to set a maximum result, 0 or negative means no limit.
    Returns:
      itself.

  - ### toPredicate

    public Predicate<org.silverpeas.core.contribution.publication.model.PublicationDetail> toPredicate()
    Gets the predicate to apply on publication list.
    Returns:
      the `Predicate` instance.

  - ### getMaxResult

    public Optional<Integer> getMaxResult()
    Gets the maximum of results if any.
    Returns:
      an optional positive integer.