示例#1
0
 protected List<Boolean> readBooleanRepeated(
     JSONObject jsonObject, String fieldLabel, int fieldNumber)
     throws InvalidProtocolBufferException {
   List<Boolean> fieldBooleanRepeated = null;
   if (jsonObject != null && fieldLabel != null) {
     JSONValue fieldValue = jsonObject.get(fieldLabel);
     if (fieldValue != null) {
       JSONArray fieldJSONArray = jsonValueToArray(fieldValue);
       if (fieldJSONArray != null) {
         fieldBooleanRepeated = new ArrayList<Boolean>();
         for (int i = 0; i < fieldJSONArray.size(); ++i) {
           Boolean fieldBoolean = jsonValueToBoolean(fieldJSONArray.get(i));
           if (fieldBoolean != null) {
             fieldBooleanRepeated.add(fieldBoolean);
           } else {
             throw InvalidProtocolBufferException.failedToReadBooleanRepeated(fieldLabel);
           }
         }
       } else {
         throw InvalidProtocolBufferException.failedToReadBooleanRepeated(fieldLabel);
       }
     }
   }
   return fieldBooleanRepeated;
 }