All Downloads are FREE. Search and download functionalities are using the official Maven repository.

es.edn.groogle.sheet.CoordinatesSpec.groovy Maven / Gradle / Ivy

/*
 * Groogle, a Groovy Google DSL
 *
 * @author Jorge Aguilera 
 *
 * Copyright (c) 2024.
 *
 */

package es.edn.groogle.sheet

import com.google.api.services.sheets.v4.model.GridRange
import es.edn.groogle.SheetService

class CoordinatesSpec implements SheetService.Coordinates{
    Integer id
    Integer startRowIndex = null
    Integer startColIndex = null
    Integer endRowIndex = null
    Integer endColIndex = null

    @Override
    SheetService.Coordinates startRowIndex(int i) {
        this.startRowIndex = i
        this
    }

    @Override
    SheetService.Coordinates startColIndex(int i) {
        this.startColIndex = i
        this
    }

    @Override
    SheetService.Coordinates endRowIndex(int i) {
        this.endRowIndex = i
        this
    }

    @Override
    SheetService.Coordinates endColIndex(int i) {
        this.endColIndex = i
        this
    }

    GridRange getGridRange(){
        GridRange gridRange = new GridRange()
        if( id )
            gridRange.sheetId = id
        if( startRowIndex)
            gridRange.startRowIndex = startRowIndex
        if( startColIndex)
            gridRange.startColumnIndex = startColIndex
        if( endRowIndex)
            gridRange.endRowIndex = endRowIndex
        if( endColIndex)
            gridRange.endColumnIndex = endColIndex
        gridRange
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy