Package com.rosivanyshyn.service

# Interface ApartmentService

All Known Implementing Classes:
  `ApartmentServiceImpl`

public interface ApartmentService
Apartment Service interface.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Boolean`
  `createApartment(Apartment apartment)`
  Create new apartment
  `Boolean`
  `deleteApartment(Apartment apartment)`
  Delete apartment
  `Apartment`
  `findApartmentByField(String field, Object value)`
  Find apartment by field
  `ArrayList<Apartment>`
  `findFewApartment(int start, int total)`
  Find few apartments by total count and from set start id
  `ArrayList<Apartment>`
  `findFewApartmentsAndSort(String secondQueryPart, String... fields)`
  Find few apartments using second query part conditions and by fields for them
  `ArrayList<Apartment>`
  `findFewApartmentsWhichAreBooked(String secondQueryPart, String... fields)`
  Find few apartments which are already booked using second query part conditions and by fields for them
  `ArrayList<Apartment>`
  `findFewApartmentsWhichAreFree(String secondQueryPart, String... fields)`
  Find few apartments which are free (not booked in the future) and available
  `int`
  `getRowsNumber()`
  Get last statement rows count
  `ArrayList<Apartment>`
  `searchApartment(String value, int start, int total)`
  Find few apartments using direct search algorithm by total count and from set start id
  `Boolean`
  `updateApartment(Apartment apartment)`
  Update apartment

- ## Method Details

  - ### createApartment

    Boolean createApartment(Apartment apartment)
    Create new apartment
    Parameters:
      `apartment` - the apartment to be added
    Returns:
      operation result

  - ### findApartmentByField

    Apartment findApartmentByField(String field, Object value)
    Find apartment by field
    Parameters:
      `field` - field name
      `value` - unique field value
    Returns:
      found apartment

  - ### findFewApartment

    ArrayList<Apartment> findFewApartment(int start, int total)
    Find few apartments by total count and from set start id
    Parameters:
      `start` - countdown start id
      `total` - total rows count
    Returns:
      found apartments

  - ### searchApartment

    ArrayList<Apartment> searchApartment(String value, int start, int total)
    Find few apartments using direct search algorithm by total count and from set start id
    Parameters:
      `value` - user value
      `start` - countdown start id
      `total` - total rows count
    Returns:
      found apartments

  - ### findFewApartmentsAndSort

    ArrayList<Apartment> findFewApartmentsAndSort(String secondQueryPart, String... fields)
    Find few apartments using second query part conditions and by fields for them
    Parameters:
      `secondQueryPart` - QueryBuilder result string
      `fields` - fields to insert in second query part statement
    Returns:
      found apartments

  - ### findFewApartmentsWhichAreBooked

    ArrayList<Apartment> findFewApartmentsWhichAreBooked(String secondQueryPart, String... fields)
    Find few apartments which are already booked using second query part conditions and by fields for them
    Parameters:
      `secondQueryPart` - QueryBuilder result string
      `fields` - fields to insert in second query part statement
    Returns:
      found apartments

  - ### findFewApartmentsWhichAreFree

    ArrayList<Apartment> findFewApartmentsWhichAreFree(String secondQueryPart, String... fields)
    Find few apartments which are free (not booked in the future) and available
    Parameters:
      `secondQueryPart` - QueryBuilder result string
      `fields` - fields to insert in second query part statement
    Returns:
      found apartments

  - ### updateApartment

    Boolean updateApartment(Apartment apartment)
    Update apartment
    Parameters:
      `apartment` - apartment to update
    Returns:
      operation result

  - ### deleteApartment

    Boolean deleteApartment(Apartment apartment)
    Delete apartment
    Parameters:
      `apartment` - apartment to delete
    Returns:
      operation result

  - ### getRowsNumber

    int getRowsNumber()
    Get last statement rows count
    Returns:
      last statement rows count