Browse Source

Reverts some mistakes

Implements and tests function to delete entries

@TODO: catch index left-shift after deleting an item
feature-serializer
fdai5728 2 years ago
committed by fdai6352
parent
commit
ffdbc80dfe
  1. 17
      src/main/java/CredentialRepository.java
  2. 5
      src/test/java/CredentialRepositoryTest.java

17
src/main/java/CredentialRepository.java

@ -49,7 +49,6 @@ public class CredentialRepository implements CredentialRepositoryInterface{
return null;
}
}
/*
@ -90,7 +89,23 @@ public class CredentialRepository implements CredentialRepositoryInterface{
}
/*
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()
{
return this.credentials.size();

5
src/test/java/CredentialRepositoryTest.java

@ -81,9 +81,4 @@ class CredentialRepositoryTest {
Assertions.assertEquals(null, this.credentialRepository.getCredentialsViaId(0));
}
@Test
void testIndexShiftAfterDeletion(){
}
}
Loading…
Cancel
Save