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/** Represents a conflict that occurs between items that have the same name. */ 010public class BoxZipConflict extends BoxJSONObject { 011 private List<BoxZipConflictItem> items; 012 013 /** Constructs a BoxZipDownloadStatus with default settings. */ 014 public BoxZipConflict() {} 015 016 /** 017 * Constructs a BoxZipDownloadStatus from a JSON string. 018 * 019 * @param json the JSON encoded enterprise. 020 */ 021 public BoxZipConflict(String json) { 022 super(json); 023 } 024 025 BoxZipConflict(JsonObject jsonObject) { 026 super(jsonObject); 027 } 028 029 /** 030 * Gets the items that conflict because they have the same name. 031 * 032 * @return the items that conflict because they have the same name. 033 */ 034 public List<BoxZipConflictItem> getItems() { 035 return this.items; 036 } 037 038 @Override 039 void parseJSONMember(JsonObject.Member member) { 040 JsonArray value = member.getValue().asArray(); 041 List<BoxZipConflictItem> conflictItems = new ArrayList<BoxZipConflictItem>(value.size()); 042 for (JsonValue item : value) { 043 conflictItems.add(new BoxZipConflictItem(item.asObject())); 044 } 045 this.items = conflictItems; 046 } 047}