You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.0 KiB
63 lines
1.0 KiB
import java.util.ArrayList;
|
|
|
|
public class CredentialRepository implements CredentialRepositoryInterface{
|
|
|
|
private int idCounter = 0;
|
|
private ArrayList<Credential> credentials;
|
|
|
|
public CredentialRepository()
|
|
{
|
|
this.credentials = new ArrayList<Credential>();
|
|
}
|
|
|
|
public int createNewCredential(String name, String password)
|
|
{
|
|
try {
|
|
this.credentials.add(new Credential(name, password, this.idCounter++));
|
|
}
|
|
catch(Exception fail)
|
|
{
|
|
System.err.println(fail.getMessage());
|
|
}
|
|
|
|
return this.getListSize();
|
|
}
|
|
|
|
@Override
|
|
public void edit() {
|
|
|
|
}
|
|
|
|
@Override
|
|
public void delete() {
|
|
|
|
}
|
|
|
|
@Override
|
|
public void getCredentials() {
|
|
|
|
}
|
|
|
|
@Override
|
|
public void setCredentials() {
|
|
|
|
}
|
|
|
|
@Override
|
|
public void getAsJSON() {
|
|
|
|
}
|
|
|
|
@Override
|
|
public void loadCredentialsFromJSON() {
|
|
|
|
}
|
|
|
|
private int getListSize()
|
|
{
|
|
return this.credentials.size();
|
|
}
|
|
|
|
}
|
|
|
|
|