001package com.box.sdk;
002
003import com.eclipsesource.json.JsonObject;
004import com.eclipsesource.json.JsonValue;
005
006/** Represents items that have naming conflicts when creating a zip file. */
007public class BoxZipConflictItem extends BoxJSONObject {
008  private String id;
009  private String type;
010  private String originalName;
011  private String downloadName;
012
013  /** Constructs a BoxZipNameConflict with default settings. */
014  public BoxZipConflictItem() {}
015
016  /**
017   * Constructs a BoxZipNameConflict from a JSON string.
018   *
019   * @param json the JSON encoded enterprise.
020   */
021  public BoxZipConflictItem(String json) {
022    super(json);
023  }
024
025  BoxZipConflictItem(JsonObject jsonObject) {
026    super(jsonObject);
027  }
028
029  /**
030   * Gets the ID of the item that has the conflict.
031   *
032   * @return the ID of the item that has the conflict.
033   */
034  public String getID() {
035    return this.id;
036  }
037
038  /**
039   * Gets the type of the item that has the conflict.
040   *
041   * @return the type of the item that has the conflict.
042   */
043  public String getType() {
044    return this.type;
045  }
046
047  /**
048   * Gets the original name of the item that has the conflict.
049   *
050   * @return the original name of the item that has the conflict.
051   */
052  public String getOriginalName() {
053    return this.originalName;
054  }
055
056  /**
057   * Gets the new name of the item when it downloads that resolves the conflict.
058   *
059   * @return the new name of the item when it downloads that resolves the conflict.
060   */
061  public String getDownloadName() {
062    return this.downloadName;
063  }
064
065  @Override
066  void parseJSONMember(JsonObject.Member member) {
067    JsonValue value = member.getValue();
068    String memberName = member.getName();
069    if (memberName.equals("id")) {
070      this.id = value.asString();
071    } else if (memberName.equals("type")) {
072      this.type = value.asString();
073    } else if (memberName.equals("original_name")) {
074      this.originalName = value.asString();
075    } else if (memberName.equals("download_name")) {
076      this.downloadName = value.asString();
077    }
078  }
079}