|
@ -2,7 +2,7 @@ import java.util.ArrayList; |
|
|
|
|
|
|
|
|
public class CredentialRepository implements CredentialRepositoryInterface{ |
|
|
public class CredentialRepository implements CredentialRepositoryInterface{ |
|
|
|
|
|
|
|
|
private int idCounter = 0; |
|
|
|
|
|
|
|
|
private int idCounter = 1; |
|
|
private ArrayList<Credential> credentials; |
|
|
private ArrayList<Credential> credentials; |
|
|
|
|
|
|
|
|
public CredentialRepository() |
|
|
public CredentialRepository() |
|
@ -49,9 +49,17 @@ public class CredentialRepository implements CredentialRepositoryInterface{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Credential getCredentialsViaId() { |
|
|
|
|
|
|
|
|
public Credential getCredentialsViaId(int id) { |
|
|
|
|
|
|
|
|
|
|
|
try{ |
|
|
|
|
|
return this.credentials.get(id); |
|
|
|
|
|
} |
|
|
|
|
|
catch (IndexOutOfBoundsException outOfBoundsException) |
|
|
|
|
|
{ |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|