001/*
002 * Copyright (c) 2013 Maxim Yunusov
003 *    Licensed under the Apache License, Version 2.0 (the "License");
004 *    you may not use this file except in compliance with the License.
005 *    You may obtain a copy of the License at
006 *
007 *        http://www.apache.org/licenses/LICENSE-2.0
008 *
009 *    Unless required by applicable law or agreed to in writing, software
010 *    distributed under the License is distributed on an "AS IS" BASIS,
011 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012 *    See the License for the specific language governing permissions and
013 *    limitations under the License.
014 */
015
016package org.maxur.perfmodel.backend.domain;
017
018import java.util.Collection;
019import java.util.Optional;
020
021/**
022 * @author Maxim Yunusov
023 * @version 1.0 07.11.13
024 */
025public interface Repository<T> {
026
027    Optional<T> get(String key);
028
029    Optional<T> remove(String key);
030
031    Optional<T> add(T value) throws ConflictException;
032
033    Optional<T> amend(T value) throws ConflictException;
034
035    Optional<T> findByName(String name);
036
037    Collection<T> findAll();
038}