Trillo Workbench Lessons
  • Introduction
    • Sample Application
  • Introduction to Lessons
    • IDE Lessons
    • Annotated Directory Structure
  • New classes using workbench UI
  • Save many records into tables using the workbench UI
  • New function using Workbench UI
  • Introduction to Code Lessons
    • Anatomy of Trillo Function
  • Begin Code Lessons
    • Paginated list
    • Pagination using SQL Query
    • DataIterator
    • Read file from cloud storage bucket
    • Generating signed URL for a file download
    • Import a CSV file from bucket into BigQuery
    • Query a dataset of BigQuery
    • Using an Document AI Processor
    • Chat using GenAI
    • Function calling another function
    • Accessing Runtime Context
    • Write a workflow (pipeline for data processing)
  • Appendixes
    • ServerlessFunction
    • Map, List and Tree
    • Logs and Audit Logs
    • DataRequest Class
    • DataResponse Class
    • DataIterator Class
    • Result
Powered by GitBook
On this page
  1. Appendixes

DataResponse Class

package com.collager.trillo.model;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public class DataResult {
  private List<Object> items;
  private int totalItems = 0;
  private int start;
  public List<Object> getItems() {
    return items;
  }
  public void setItems(List<Object> items) {
    this.items = items;
  }
  public int getTotalItems() {
    return totalItems;
  }
  public void setTotalItems(int totalItems) {
    this.totalItems = totalItems;
  }
  public int getStart() {
    return start;
  }
  public void setStart(int start) {
    this.start = start;
  }
  public boolean is_paginated_() {
    return true;
  }
  @SuppressWarnings("unchecked")
  @JsonIgnore
  public List<Map<String, Object>> getItemsAsListOfMaps() {
    List<Map<String,Object>> l = new ArrayList<Map<String, Object>>();
    if (items == null) {
      return null;
    }
    for (Object item : items) {
      l.add((Map<String, Object>) item);
    }
    return l;
  }
}

PreviousDataRequest ClassNextDataIterator Class

Last updated 1 year ago