title: Update specific item in arraylist
body: <p>I want to update specific item in arraylist.</p>
  
  <p>This is <code>Conversation</code> class:</p>
  
  <pre><code>class Conversation
  {
      String sender,to,name,bio,picture;
      Integer id,time,unread;
      public Conversation() {
  
      }
      public Conversation (int id,String sender,String to,String name,String bio,String picture,int time,int unread) {
          this.sender=sender;
          this.to=to;
          this.id=id;
          this.name=name;
          this.bio=bio;
          this.picture=picture;
          this.time=time;
          this.unread=unread;
      }
  
      public void setSender(String sender) {
          this.sender=sender;
      }
      public void setTo(String to) {
          this.to=to;
      }
      public void setId(int id) {
          this.id=id;
      }
      public void setTime(int time) {
          this.time=time;
      }
      public void setUnread(int unread) {
          this.unread=unread;
      }
      public void setName(String name) {
          this.name=name;
      }
      public void setBio(String bio) {
          this.bio=bio;
      }
      public void setPicture(String picture) {
          this.picture=picture;
      }
  
      public String getSender() {
          return this.sender;
      }
      public String getTo() {
          return this.to;
      }
      public int getId() {
          return this.id;
      }
      public int getTime() {
          return this.time;
      }
      public int getUnread() {
          return this.unread;
      }
      public String getName() {
          return this.name;
      }
      public String getBio() {
          return this.bio;
      }
      public String getPicture() {
          return this.picture;
      }
  }
  </code></pre>
  
  <p>I am adding items from database to this list with following lines:</p>
  
  <pre><code>public List&lt;Conversation&gt; getAllConversations() {
      List&lt;Conversation&gt; conversationsList=new ArrayList&lt;Conversation&gt;();
      String selectQuery = "SELECT * FROM " + TABLE_CONVERSATIONS+" order by id desc";
  
          SQLiteDatabase db = this.getWritableDatabase();
          Cursor cursor = db.rawQuery(selectQuery, null);
          if (cursor.moveToFirst()) {
              do {
                  Conversation Conversation = new Conversation();
                  Conversation.setId(Integer.parseInt(cursor.getString(0)));
                  Conversation.setSender(cursor.getString(1));
                  Conversation.setTo(cursor.getString(2));
                  Conversation.setName(cursor.getString(3));
                  Conversation.setBio(cursor.getString(4));
                  Conversation.setPicture(cursor.getString(5));
                  Conversation.setTime(Integer.parseInt(cursor.getString(6)));
                  Conversation.setUnread(Integer.parseInt(cursor.getString(7)));          
                  conversationsList.add(Conversation);
              } while (cursor.moveToNext());
          }
          return conversationsList;
  }
  </code></pre>
  
  <p>I want to use <code>setUnread</code> method for specific item but how ? I know I can change like this:</p>
  
  <pre><code>conversationsList.get(location).setUnread(1);
  </code></pre>
  
  <p>But I don't know the location.I need to get the item with another parameter.e.g can I get the item by <code>sender</code> value ? </p>
  
  <p>I need something like this:</p>
  
  <pre><code>conversationsList.getByUsername("username").setUnread(1);
  </code></pre>