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