Files
GSE2TaskTracker/build/jacocoHtml/hhn.temp.project/Task.java.html
Jan-Philipp Luithardt e8a1f161b4 upload
2025-12-03 11:04:32 +01:00

66 lines
3.6 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="de"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>Task.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">GSE2TaskTracker</a> &gt; <a href="index.source.html" class="el_package">hhn.temp.project</a> &gt; <span class="el_source">Task.java</span></div><h1>Task.java</h1><pre class="source lang-java linenums">package hhn.temp.project;
public class Task {
private String name;
private String description;
private TaskStatus taskStatus;
private int taskID;
<span class="fc" id="L9"> private static int idCounter = 0;</span>
<span class="fc" id="L11"> public Task(String name, String description) {</span>
<span class="fc bfc" id="L13" title="All 4 branches covered."> if (name == null || description == null ) {</span>
<span class="fc" id="L15"> throw new IllegalArgumentException(&quot;Name/Description is null!&quot;);</span>
}
<span class="fc bfc" id="L17" title="All 4 branches covered."> if(name.isEmpty() || description.isEmpty()) {</span>
<span class="fc" id="L18"> throw new IllegalArgumentException(&quot;Name/Description is empty!&quot;);</span>
}
<span class="fc" id="L21"> this.name = name;</span>
<span class="fc" id="L22"> this.description = description;</span>
<span class="fc" id="L23"> this.taskStatus = TaskStatus.OPEN;</span>
//TODO when DB then auto IDs
<span class="fc" id="L25"> this.taskID = idCounter++;</span>
<span class="fc" id="L26"> }</span>
public int getTaskID() {
<span class="fc" id="L29"> return taskID;</span>
}
public String getName() {
<span class="fc" id="L33"> return name;</span>
}
public String getDescription() {
<span class="fc" id="L37"> return description;</span>
}
public TaskStatus getStatus() {
<span class="fc" id="L41"> return taskStatus;</span>
}
public void setDescription(String description) {
<span class="fc bfc" id="L45" title="All 2 branches covered."> if (description == null ) {</span>
<span class="fc" id="L47"> throw new IllegalArgumentException(&quot;Description is null!&quot;);</span>
}
<span class="fc bfc" id="L49" title="All 2 branches covered."> if(description.isEmpty()) {</span>
<span class="fc" id="L50"> throw new IllegalArgumentException(&quot;Description is empty!&quot;);</span>
}
<span class="fc" id="L53"> this.description = description;</span>
<span class="fc" id="L54"> }</span>
public void setStatus(TaskStatus taskStatus) {
<span class="fc bfc" id="L57" title="All 2 branches covered."> if (taskStatus == null ) {</span>
<span class="fc" id="L59"> throw new IllegalArgumentException(&quot;TaskStatus is null!&quot;);</span>
}
<span class="fc" id="L62"> this.taskStatus = taskStatus;</span>
<span class="fc" id="L63"> }</span>
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.13.202504020838</span></div></body></html>