|
@ -49,7 +49,6 @@ public class CredentialRepository implements CredentialRepositoryInterface{ |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
@ -60,20 +59,53 @@ public class CredentialRepository implements CredentialRepositoryInterface{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void updatePassword(int index) { |
|
|
|
|
|
|
|
|
public void updatePassword(int index, String newPassword) { |
|
|
|
|
|
|
|
|
|
|
|
try{ |
|
|
|
|
|
this.credentials.get(index).upDatePassword(newPassword); |
|
|
|
|
|
} |
|
|
|
|
|
catch (IndexOutOfBoundsException outOfBoundsException) |
|
|
|
|
|
{ |
|
|
|
|
|
System.err.println("No Credential with Index" + index + " found"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void updateUsername(int index){ |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void updateUsername(int index, String newUsername){ |
|
|
|
|
|
|
|
|
|
|
|
try{ |
|
|
|
|
|
this.credentials.get(index).updateUsername(newUsername); |
|
|
|
|
|
} |
|
|
|
|
|
catch (IndexOutOfBoundsException outOfBoundsException) |
|
|
|
|
|
{ |
|
|
|
|
|
System.err.println("No Credential with Index" + index + " found"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void delete(int index) { |
|
|
public void delete(int index) { |
|
|
|
|
|
|
|
|
|
|
|
this.credentials.remove(index); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
this function will be required in the future for catching the left-shift in the arrayList |
|
|
|
|
|
after one entry was deleted. welp, maybe it won't. can't tell and i've no time atm to |
|
|
|
|
|
finish this |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int mapIndexToListCounter(int needle) { |
|
|
|
|
|
for(int c = 0; c<this.credentials.size(); c++) |
|
|
|
|
|
{ |
|
|
|
|
|
if(this.credentials.get(c).getId() == needle) |
|
|
|
|
|
{ |
|
|
|
|
|
return c; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return -1; |
|
|
|
|
|
} |
|
|
|
|
|
*/ |
|
|
private int getListSize() |
|
|
private int getListSize() |
|
|
{ |
|
|
{ |
|
|
return this.credentials.size(); |
|
|
return this.credentials.size(); |
|
|