angry1980.audio.dao.FingerprintDAO Maven / Gradle / Ivy
package angry1980.audio.dao;
import angry1980.audio.model.Fingerprint;
import java.util.Collection;
import java.util.Optional;
public interface FingerprintDAO {
Collection getAll();
Collection findByTrackIds(long[] trackIds);
default Optional findByTrackId(long trackId){
return Optional.ofNullable(tryToFindByTrackId(trackId));
}
F tryToFindByTrackId(long trackId);
default Optional create(F fingerprint){
return Optional.of(tryToCreate(fingerprint));
}
F tryToCreate(F fingerprint);
}