Skip to content

Instantly share code, notes, and snippets.

@dd701116
Created December 15, 2020 16:51
Show Gist options
  • Save dd701116/4ae43fa300e1d956d60e4b5210161af3 to your computer and use it in GitHub Desktop.
Save dd701116/4ae43fa300e1d956d60e4b5210161af3 to your computer and use it in GitHub Desktop.
public interface Repository<T> {
/**
* Get all element which respect the filter
* @param filter
* @return List of result
*/
public ArrayList<T> readAll(T filter);
/**
* Get the first element which respect the filter
* @param filter
* @return a result
*/
public T read(T filter);
/**
* Create an element
* @param item
* @return the element form the DataBase
*/
public T create(T item);
/**
* Update an element existing element
* @param item
* @return the element form the DataBase
*/
public T update(T item);
/**
* Delete an existing element
* @param item
* @return the element form the DataBase
*/
public T delete(T item);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment