Browse Source

Restructures repository class and interface

feature-serializer
fdai5728 3 years ago
committed by fdai6352
parent
commit
729f80d09d
  1. 32
      src/main/java/CredentialRepository.java
  2. 5
      src/main/java/CredentialRepositoryInterface.java

32
src/main/java/CredentialRepository.java

@ -23,16 +23,6 @@ public class CredentialRepository implements CredentialRepositoryInterface{
return this.getListSize(); return this.getListSize();
} }
@Override
public void edit() {
}
@Override
public void delete() {
}
@Override @Override
public Credential getCredentialsViaName(String needle) { public Credential getCredentialsViaName(String needle) {
@ -62,6 +52,28 @@ public class CredentialRepository implements CredentialRepositoryInterface{
} }
/*
The next 3 functions assume you already have successfully
pulled a credential from the repository and now want to edit it.
Thus, these functions require you to pass the desired credential's index
*/
@Override
public void updatePassword(int index) {
}
public void updateUsername(int index){
}
@Override
public void delete(int index) {
}
private int getListSize() private int getListSize()
{ {
return this.credentials.size(); return this.credentials.size();

5
src/main/java/CredentialRepositoryInterface.java

@ -1,9 +1,10 @@
public interface CredentialRepositoryInterface { public interface CredentialRepositoryInterface {
int createNewCredential(String name, String password); int createNewCredential(String name, String password);
void edit();
void delete();
Credential getCredentialsViaName(String needle); Credential getCredentialsViaName(String needle);
Credential getCredentialsViaId(int id); Credential getCredentialsViaId(int id);
void updatePassword(int index);
void updateUsername(int index);
void delete(int index);
} }
Loading…
Cancel
Save