title: Is there an efficient way to create a shared resourcelist containing a ID property and a data Property?
body: <p>This shared resourcelist will be apart of a process management system. I am seeking the most efficient way to create this list with an id and data Property that can be accessed and updated throughout the project.</p>
  <pre><code>import java.util.ArrayList;
  public class task {
      private int taskId;
      private ArrayList &lt;Integer&gt; sharedlist= new ArrayList&lt;Integer&gt;(20);
  
      public task() {
      }
  
      public task(int taskId, ArrayList&lt;Integer&gt; sharedlist) {
          this.taskId = taskId;
          this.sharedlist = sharedlist;
      }
  
      public int getTaskId() {
          return this.taskId;
      }
  
      public void setTaskId(int taskId) {
          this.taskId = taskId;
      }
  
      public ArrayList&lt;Integer&gt; getSharedlist() {
          return this.sharedlist;
      }
  
      public void setSharedlist(ArrayList&lt;Integer&gt; sharedlist) {
          this.sharedlist = sharedlist;
      }
  
      public task taskId(int taskId) {
          setTaskId(taskId);
          return this;
      }
  
      public task sharedlist(ArrayList&lt;Integer&gt; sharedlist) {
          setSharedlist(sharedlist);
          return this;
      }
  
      @Override
      public String toString() {
          return &quot;{&quot; +
              &quot; taskId='&quot; + getTaskId() + &quot;'&quot; +
              &quot;, sharedlist='&quot; + getSharedlist() + &quot;'&quot; +
              &quot;}&quot;;
      }
      
  }
  </code></pre>
  <p>Task such as a summation of all data properties will be done as well as retrieval of a specific record using the id property.</p>