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 * Constructs a BoxEnterprise from a JSON string. 020 * @param json the JSON encoded enterprise. 021 */ 022 public BoxEnterprise(String json) { 023 super(json); 024 } 025 026 BoxEnterprise(JsonObject jsonObject) { 027 super(jsonObject); 028 } 029 030 /** 031 * Gets the ID of this enterprise. 032 * @return the ID of this enterprise. 033 */ 034 public String getID() { 035 return this.id; 036 } 037 038 /** 039 * Gets the name of this enterprise. 040 * @return the name of this enterprise. 041 */ 042 public String getName() { 043 return this.name; 044 } 045 046 @Override 047 void parseJSONMember(JsonObject.Member member) { 048 JsonValue value = member.getValue(); 049 String memberName = member.getName(); 050 if (memberName.equals("id")) { 051 this.id = value.asString(); 052 } else if (memberName.equals("name")) { 053 this.name = value.asString(); 054 } 055 } 056}