diff --git a/src/com/urise/webapp/storage/ArrayStorage.java b/src/com/urise/webapp/storage/ArrayStorage.java index b37a9eb7..169cca78 100644 --- a/src/com/urise/webapp/storage/ArrayStorage.java +++ b/src/com/urise/webapp/storage/ArrayStorage.java @@ -6,7 +6,7 @@ /** * Array based storage for Resumes */ -public class ArrayStorage { +public class ArrayStorage implements Storage { private static final int STORAGE_LIMIT = 10000; private Resume[] storage = new Resume[STORAGE_LIMIT]; diff --git a/src/com/urise/webapp/storage/Storage.java b/src/com/urise/webapp/storage/Storage.java new file mode 100644 index 00000000..9372adba --- /dev/null +++ b/src/com/urise/webapp/storage/Storage.java @@ -0,0 +1,24 @@ +package com.urise.webapp.storage; + +import com.urise.webapp.model.Resume; +import java.util.Arrays; + +public interface Storage { + + void clear(); + + void update(Resume r); + + void save(Resume r); + + Resume get(String uuid); + + void delete(String uuid); + + /** + * @return array, contains only Resumes in storage (without null) + */ + Resume[] getAll(); + + int size(); +}