001package com.box.sdk; 002 003import com.eclipsesource.json.JsonObject; 004import com.eclipsesource.json.JsonValue; 005 006/** 007 * Represents an enterprise organization on Box. 008 */ 009public class BoxEnterprise extends BoxJSONObject { 010 private String id; 011 private String name; 012 013 /** 014 * Constructs a BoxEnterprise with default settings. 015 */ 016 public BoxEnterprise() { 017 } 018 019 /** 020 * Constructs a BoxEnterprise from a JSON string. 021 * 022 * @param json the JSON encoded enterprise. 023 */ 024 public BoxEnterprise(String json) { 025 super(json); 026 } 027 028 BoxEnterprise(JsonObject jsonObject) { 029 super(jsonObject); 030 } 031 032 /** 033 * Gets the ID of this enterprise. 034 * 035 * @return the ID of this enterprise. 036 */ 037 public String getID() { 038 return this.id; 039 } 040 041 /** 042 * Gets the name of this enterprise. 043 * 044 * @return the name of this enterprise. 045 */ 046 public String getName() { 047 return this.name; 048 } 049 050 @Override 051 void parseJSONMember(JsonObject.Member member) { 052 JsonValue value = member.getValue(); 053 String memberName = member.getName(); 054 if (memberName.equals("id")) { 055 this.id = value.asString(); 056 } else if (memberName.equals("name")) { 057 this.name = value.asString(); 058 } 059 } 060}