use of io.swagger.v3.jaxrs2.resources.model.Pet in project swagger-core by swagger-api.
the class PetData method createPet.
static Pet createPet(long id, Category cat, String name, String[] urls, String[] tags, String status) {
Pet pet = new Pet();
pet.setId(id);
pet.setCategory(cat);
pet.setName(name);
if (null != urls) {
List<String> urlObjs = new ArrayList<String>();
for (String urlString : urls) {
urlObjs.add(urlString);
}
pet.setPhotoUrls(urlObjs);
}
List<Tag> tagObjs = new ArrayList<Tag>();
int i = 0;
if (null != tags) {
for (String tagString : tags) {
i = i + 1;
Tag tag = new Tag();
tag.setId(i);
tag.setName(tagString);
tagObjs.add(tag);
}
}
pet.setTags(tagObjs);
pet.setStatus(status);
return pet;
}
Aggregations