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-credentialneu
fdai5728 3 years ago
parent
commit
e3013269d2
  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