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

io.github11904212.java.stac.client.search.impl.ItemCollectionImpl Maven / Gradle / Ivy

There is a newer version: 1.0.0-alpha.0.7
Show newest version
package io.github11904212.java.stac.client.search.impl;

import io.github11904212.java.stac.client.core.Item;
import io.github11904212.java.stac.client.core.Link;
import io.github11904212.java.stac.client.core.impl.ItemImpl;
import io.github11904212.java.stac.client.core.impl.LinkImpl;
import io.github11904212.java.stac.client.search.ItemCollection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

import java.util.List;

public class ItemCollectionImpl implements ItemCollection {

    private final String type;
    private final List items;
    private final List links;

    @JsonCreator
    public ItemCollectionImpl(
            @JsonProperty(value = "type", required = true)
                    String type,

            @JsonProperty(value = "features", required = true) @JsonDeserialize(contentAs = ItemImpl.class)
                    List items,

            @JsonProperty("links") @JsonDeserialize(contentAs = LinkImpl.class)
                    List links
    ) {
        this.type = type;
        this.items = items;
        this.links = links;
    }


    @Override
    public String getType() {
        return this.type;
    }

    @Override
    public List getItems() {
        return this.items;
    }

    @Override
    public List getLinks() {
        return this.links;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy