dev.fuxing.airtable.AirtableList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of airtable-api Show documentation
Show all versions of airtable-api Show documentation
Java Airtable API for https://airtable.com/api
The newest version!
package dev.fuxing.airtable;
import com.fasterxml.jackson.databind.JsonNode;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Created by: Fuxing
* Date: 2019-04-21
* Time: 16:23
*/
public class AirtableList extends ArrayList implements AirtableTable.PaginationList {
private String offset;
public AirtableList(JsonNode node) {
super(parse(node.path("records")));
this.offset = node.path("offset").asText(null);
}
/**
* @return offset
* @see AirtableTable.PaginationList#getOffset()
*/
@Nullable
@Override
public String getOffset() {
return offset;
}
public static List parse(JsonNode node) {
if (node.isMissingNode()) return Collections.emptyList();
List records = new ArrayList<>();
for (JsonNode jsonNode : node) {
records.add(new AirtableRecord(jsonNode));
}
return records;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy