001package org.nuxeo.box.api.marshalling.dao;
002
003import com.fasterxml.jackson.annotation.JsonProperty;
004
005import java.util.ArrayList;
006import java.util.Map;
007
008public class BoxCollectionBase extends BoxObject {
009
010    public static final String FIELD_ENTRIES = "entries";
011
012    public BoxCollectionBase() {
013    }
014
015    /**
016     * Copy constructor, this does deep copy for all the fields.
017     *
018     * @param obj
019     */
020    public BoxCollectionBase(BoxCollectionBase obj) {
021        super(obj);
022    }
023
024    /**
025     * Instantiate the object from a map. Each entry in the map reflects to a field.
026     *
027     * @param map
028     */
029    public BoxCollectionBase(Map<String, Object> map) {
030        super(map);
031    }
032
033    /**
034     * @return the entries
035     */
036    @SuppressWarnings("unchecked")
037    @JsonProperty("entries")
038    public ArrayList<BoxTypedObject> getEntries() {
039        return (ArrayList<BoxTypedObject>) super.getValue(FIELD_ENTRIES);
040    }
041
042    /**
043     * @param entries the entries to set
044     */
045    @JsonProperty("entries")
046    private void setEntries(ArrayList<BoxTypedObject> entries) {
047        put(FIELD_ENTRIES, entries);
048    }
049
050}