@Override
public Set<NameValuePair> setup(String language,
Set<NameValuePair> nvps) {
for (int i = 0; i < images.size(); i++) {
Image image = images.get(i);
if (image.getFid() == null) {
throw new IllegalArgumentException("fid cannot be null");
}
nvps.add(new BasicNameValuePair(name + "[" + language + "]" + "["
+ i + "][fid]", image.getFid()));
nvps.add(new BasicNameValuePair(name + "[" + language + "]" + "["
+ i + "][display]", "1"));
if (image.getAlt() != null) {
nvps.add(new BasicNameValuePair(name + "[" + language + "]"
+ "[" + i + "][alt]", image.getAlt()));
}
if (image.getTitle() != null) {
nvps.add(new BasicNameValuePair(name + "[" + language + "]"
+ "[" + i + "][title]", image.getTitle()));
}
}
return nvps;
}