Back to project page PasswordDroid.
The source code is released under:
GNU General Public License
If you think the Android project PasswordDroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package de.wuthoehle.passworddroid.service.model.entries; //ww w .j ava 2s . c om /* Copyright (c) 2015 Marco Huenseler <marcoh.huenseler+git@gmail.com> * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Saltable extends ArrayList<String> implements EntryElement { private Entry parent; private List<String> salts; public Saltable(Entry parent) { super(); this.parent = parent; this.salts = new ArrayList<>(); } public Saltable(Entry parent, List<String> salts) { super(); this.parent = parent; this.addAll(salts); this.parent.setPassword_known(false); } public List<String> getSalts() { return this; } public void setSalts(List<String> salts) { this.clear(); this.addAll(salts); this.parent.setPassword_known(false); } @Override public void accept(EntryVisitor visitor) { visitor.visit(this); } /** * ******************************************************************************************* * Override ArrayList methods to notify parent that PW could no longer be valid * ******************************************************************************************** */ @Override public boolean add(String object) { this.parent.setPassword_known(false); return super.add(object); } @Override public void add(int index, String object) { this.parent.setPassword_known(false); super.add(index, object); } @Override public boolean addAll(Collection<? extends String> collection) { this.parent.setPassword_known(false); return super.addAll(collection); } @Override public boolean addAll(int index, Collection<? extends String> collection) { this.parent.setPassword_known(false); return super.addAll(index, collection); } @Override public void clear() { this.parent.setPassword_known(false); super.clear(); } @Override public String remove(int index) { this.parent.setPassword_known(false); return super.remove(index); } @Override public boolean remove(Object object) { this.parent.setPassword_known(false); return super.remove(object); } @Override protected void removeRange(int fromIndex, int toIndex) { this.parent.setPassword_known(false); super.removeRange(fromIndex, toIndex); } @Override public String set(int index, String object) { this.parent.setPassword_known(false); return super.set(index, object); } @Override public boolean removeAll(Collection<?> collection) { this.parent.setPassword_known(false); return super.removeAll(collection); } @Override public boolean retainAll(Collection<?> collection) { this.parent.setPassword_known(false); return super.retainAll(collection); } }