FMPResource.Builder

Description

The FMPResource.Builder class is a builder for the FMPResource class.

class Builder

Methods

Method Description

name(_:)

Save resource name to variable.
func name(_ name: String) -> Builder

Parameters:

  • name. Resource name.

params(_:) Save input parameters for request to variable.
func params(_ params: String) -> Builder

Parameters:

  • params. Input parameters for request.

isDelta(_:) It sets the use of the deltaStream method on server request.
func isDelta(_ isDelta: Bool = true) -> Builder

Parameters:

  • isDelta. If the value is True, the deltaStream is used on server request. If the value is False, the tableStream method is used.

isLocalCached(_:) It sets table caching on writing to a local database.
func isLocalCached(_ isLocalCached: Bool = true) -> Builder

Parameters:

  • isLocalCached. If the value is true, local tables are cached on executing query to server. If the value is false, local tables are not cached

isFiltered(_:) It sets the use of filtering by columns on requesting data from server.
func isFiltered(_ isFiltered: Bool = true) -> Builder

Parameters:

  • isFiltered. If the value is true, filtering by columns is used on requesting data from server. If the value is false, filtering is not used.

build() Build an instance of the FMPResource class. It returns the object of the FMPResource type.
func build() -> FMPResource

Example

Build an instance of the FMPResource class:

// Build an instance of the FMPQuery class with the query expression: SELECT column from table1 LEFT JOIN table2 USING(column) WHERE id = 0 AND key = all ORDER BY column ASC
let resource: FMPResource = fmp.resource
    .name("name") // By default ""
    .params("params") // By default ""
    .isDelta(true) // By default false
    .isLocalCached(true) // By default false
    .isFiltered(true) // By default false
    .build()

See also:

FMPWrapper Framework | Classes