add current-pass functionality
This commit is contained in:
parent
259891359d
commit
1276999d3d
1 changed files with 23 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
|||
package org.ligi.passandroid.injections;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.Passbook;
|
||||
import org.ligi.passandroid.model.ReducedPassInformation;
|
||||
|
@ -10,6 +12,7 @@ import java.util.List;
|
|||
public class FixedPassListPassStore implements PassStore {
|
||||
|
||||
private final List<Passbook> passes;
|
||||
private Passbook actPass;
|
||||
|
||||
public FixedPassListPassStore(List<Passbook> passes) {
|
||||
this.passes = passes;
|
||||
|
@ -63,4 +66,24 @@ public class FixedPassListPassStore implements PassStore {
|
|||
public List<CountedType> getCountedTypes() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Passbook> getCurrentPass() {
|
||||
return Optional.of(actPass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCurrentPass(Passbook pass) {
|
||||
actPass = pass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCurrentPass(Optional<Passbook> pass) {
|
||||
actPass = pass.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deletePassWithId(String id) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue