Browse Source

Implements Skeleton for CredentialRepository

Defines Constructor - Credentials are Held in ArrayList for ease of use

Defines public function to add new credential with incrementing indizes
feature-serializer
fdai5728 3 years ago
committed by fdai6352
parent
commit
cd340772ab
  1. 55
      src/main/java/CredentialRepository.java

55
src/main/java/CredentialRepository.java

@ -0,0 +1,55 @@
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 void createNewCredential(String name, String password)
{
try {
this.credentials.add(new Credential(name, password, this.idCounter++));
}
catch(Exception fail)
{
System.err.println(fail.getMessage());
}
}
@Override
public void edit() {
}
@Override
public void delete() {
}
@Override
public void getCredentials() {
}
@Override
public void setCredentials() {
}
@Override
public void getAsJSON() {
}
@Override
public void loadCredentialsFromJSON() {
}
}
Loading…
Cancel
Save