Esempio n. 1
0
 /**
  * Adds a new field and sets the file keys.
  *
  * @param name field name
  * @param fileKeys list of the file keys
  */
 public void setFiles(String name, List<String> fileKeys) {
   List<FileDto> list = new ArrayList<FileDto>();
   for (String key : fileKeys) {
     FileDto file = new FileDto();
     file.setFileKey(key);
     list.add(file);
   }
   Field field = new Field(name, FieldType.FILE, list);
   addField(name, field);
 }
Esempio n. 2
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((userId == null) ? 0 : userId.hashCode());
   result = prime * result + ((image == null) ? 0 : image.hashCode());
   return result;
 }
Esempio n. 3
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   final CreateVetRequest other = (CreateVetRequest) obj;
   if ((userId == null && other.userId != null) || !userId.equals(other.userId)) return false;
   if ((image == null && other.image != null) || !image.equals(other.image)) return false;
   return true;
 }
Esempio n. 4
0
 /**
  * asDto.
  *
  * @param file a {@link net.sourceforge.seqware.common.model.File} object.
  * @return a {@link net.sourceforge.seqware.webservice.dto.FileDto} object.
  */
 public static FileDto asDto(File file) {
   FileDto dto = new FileDto();
   dto.setFilePath(file.getFilePath());
   if (file.getMetaType() != null) {
     dto.setMetaType(file.getMetaType());
   }
   if (file.getDescription() != null) {
     dto.setDescription(file.getDescription());
   }
   if (file.getMd5sum() != null) {
     dto.setMd5sum(file.getMd5sum());
   }
   if (file.getSize() != null) {
     dto.setSize(file.getSize());
   }
   if (file.getType() != null) {
     dto.setType(file.getType());
   }
   return dto;
 }