001package com.box.sdk;
002
003import com.eclipsesource.json.JsonArray;
004import com.eclipsesource.json.JsonObject;
005import com.eclipsesource.json.JsonValue;
006import java.util.ArrayList;
007import java.util.List;
008
009/**
010 * Represents a conflict that occurs between items that have the same name.
011 */
012public class BoxZipConflict extends BoxJSONObject {
013    private List<BoxZipConflictItem> items;
014
015    /**
016     * Constructs a BoxZipDownloadStatus with default settings.
017     */
018    public BoxZipConflict() {
019    }
020
021    /**
022     * Constructs a BoxZipDownloadStatus from a JSON string.
023     *
024     * @param json the JSON encoded enterprise.
025     */
026    public BoxZipConflict(String json) {
027        super(json);
028    }
029
030    BoxZipConflict(JsonObject jsonObject) {
031        super(jsonObject);
032    }
033
034    /**
035     * Gets the items that conflict because they have the same name.
036     *
037     * @return the items that conflict because they have the same name.
038     */
039    public List<BoxZipConflictItem> getItems() {
040        return this.items;
041    }
042
043    @Override
044    void parseJSONMember(JsonObject.Member member) {
045        JsonArray value = member.getValue().asArray();
046        List<BoxZipConflictItem> conflictItems = new ArrayList<BoxZipConflictItem>(value.size());
047        for (JsonValue item : value) {
048            conflictItems.add(new BoxZipConflictItem(item.asObject()));
049        }
050        this.items = conflictItems;
051    }
052}