Code example for JSONArray

Methods: getInt

0
		}; 
		final PrimitiveConverter<Byte> jsonByteRetriever = new PrimitiveConverter<Byte> () {
			@Override 
			public Byte retrieve (final JSONObject json, final String key) throws JSONException { return ((Integer)json.getInt(key)).byteValue(); }
			@Override 
			public Byte retrieve (final JSONArray json, final int index) throws JSONException { return ((Integer)json.getInt(index)).byteValue(); }
			@Override 
			protected Integer convertToPutableObject (final Byte value) { return value.intValue(); }
		}; 
		final PrimitiveConverter<Character> jsonCharRetriever = new PrimitiveConverter<Character> () {
			@Override 
			public Character retrieve (final JSONObject json, final String key) throws JSONException { return (json.getString(key)).charAt(0); }
			@Override 
			public Character retrieve (final JSONArray json, final int index) throws JSONException { return (json.getString(index)).charAt(0); }
			@Override 
			protected String convertToPutableObject (final Character value) { return value.toString(); }
		}; 
 
		map.put(String.class   , jsonStringRetriever);
		map.put(Boolean.class  , jsonBooleanRetriever);
		map.put(boolean.class  , jsonBooleanRetriever);