code: public static BoxEntity createEntityFromJson(final JsonObject json){
          JsonValue typeValue = json.get(BoxEntity.FIELD_TYPE);
          if (!typeValue.isString()) {
              return null;
          }
          String type = typeValue.asString();
          BoxEntityCreator creator = ENTITY_ADDON_MAP.get(type);
          BoxEntity entity = null;
          if (creator == null){
              entity = new BoxEntity();
          } else {
              entity = creator.createEntity();
          }
          entity.createFromJson(json);
          return entity;
      }
docs: Helper method that will parse into a known child of BoxEntity.
  
  @param json JsonObject representing a BoxEntity or one of its known children.
  @return a BoxEntity or one of its known children.