Browse Source

Implements search function and test for search

feature-serializer
fdai5728 3 years ago
committed by fdai6352
parent
commit
a914453294
  1. 7
      src/main/java/CredentialRepository.java
  2. 4
      src/main/java/CredentialRepositoryInterface.java

7
src/main/java/CredentialRepository.java

@ -33,11 +33,15 @@ public class CredentialRepository implements CredentialRepositoryInterface{
}
@Override
public Credential getCredentialsViaName(String needle) {
for(int c = 0; c < this.getListSize(); c++)
{
Credential credential = this.credentials.get(c);
if(credential.getName().equals(needle))
return credential;
}
return null;
@ -45,8 +49,9 @@ public class CredentialRepository implements CredentialRepositoryInterface{
@Override
public void getCredentialsViaId() {
public Credential getCredentialsViaId() {
return null;
}
@Override

4
src/main/java/CredentialRepositoryInterface.java

@ -3,8 +3,8 @@ public interface CredentialRepositoryInterface {
int createNewCredential(String name, String password);
void edit();
void delete();
void getCredentialsViaName();
void getCredentialsViaId();
Credential getCredentialsViaName(String needle);
Credential getCredentialsViaId();
void setCredentials();
void getAsJSON();
void loadCredentialsFromJSON();

Loading…
Cancel
Save