All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lesstif.jira.issue.Issue Maven / Gradle / Ivy

package com.lesstif.jira.issue;

import java.io.File;
import java.io.IOException;

import com.lesstif.jira.JsonPrettyString;

import lombok.Data;

@Data
public class Issue extends JsonPrettyString{
	private String expand;
	private String id;
	private String self;
	private String key;
	
	private IssueFields fields = new IssueFields();

	public Issue addAttachment(String filePath) throws IOException {		
		addAttachment(new File(filePath));
		
		return this;
	}
	
	public Issue addAttachment(File file) throws IOException {	
		fields.addAttachment(file);	
		
		return this;
	}

	/**
	 * check attachment exist 
	 * 
	 * @return boolean true: issue have attachment, false: no attachment
	 */
	public boolean hasAttachments() {
		if (fields.getFileList() != null && fields.getFileList().size() > 0)
			return true;
		
		return false;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy