// Path: library/src/main/java/com/zaclimon/xipl/model/AvContent.java
// public class AvContent {
// 
//     private String mTitle;
//     private String mLogo;
//     private String mGroup;
//     private String mContentLink;
//     private String mContentCategory;
//     private int mId;
// 
//     public AvContent() {}
// 
//     /**
//      * Base constructor
//      *
//      * @param title         the title of the content
//      * @param logo          the URL pointing to the related logo of the content
//      * @param group         the group in which a content might belong to
//      * @param contentCategory the category in which a content might belong to
//      * @param contentLink   the URL pointing to the content itself
//      */
//     public AvContent(String title, String logo, String group, String contentCategory, String contentLink) {
//         mTitle = title;
//         mLogo = logo;
//         mGroup = group;
//         mContentCategory = contentCategory;
//         mContentLink = contentLink;
//     }
// 
//     /**
//      * Constructor for an AvContent having a special identifier.
//      *
//      * @param title         the title of the content
//      * @param logo          the URL pointing to the related logo of the content
//      * @param group         the category in which a content might belong to
//      * @param contentCategory the category in which a content might belong to
//      * @param contentLink   the URL pointing to the content itself
//      * @param id            An additional id that can be given to the content
//      */
//     public AvContent(String title, String logo, String group, String contentCategory, String contentLink, int id) {
//         mTitle = title;
//         mLogo = logo;
//         mGroup = group;
//         mContentCategory = contentCategory;
//         mContentLink = contentLink;
//         mId = id;
//     }
// 
//     /**
//      * Gets the title
//      *
//      * @return the title of the content
//      */
//     public String getTitle() {
//         return (mTitle);
//     }
// 
//     /**
//      * Gets the logo
//      *
//      * @return the logo URL of the content
//      */
//     public String getLogo() {
//         return (mLogo);
//     }
// 
//     /**
//      * Gets the category
//      *
//      * @return the category of the content
//      */
//     public String getGroup() {
//         return (mGroup);
//     }
// 
//     /**
//      * Gets the content category
//      *
//      * @return the category in which this content belongs to.
//      */
//     public String getContentCategory() {
//         return (mContentCategory);
//     }
// 
//     /**
//      * Gets the link
//      *
//      * @return the link to the content
//      */
//     public String getContentLink() {
//         return (mContentLink);
//     }
// 
//     /**
//      * Gets the id
//      *
//      * @return the id of the content if any
//      */
//     public int getId() {
//         return (mId);
//     }
// }


import com.zaclimon.xipl.model.AvContent;
import java.util.List;
/*
 * Copyright 2017 Isaac Pateau
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.zaclimon.xipl.persistence;



/**
 * Persistence API for {@link AvContent}.
 * Will mostly be used if a content must be persisted to the disk (For caching or other reasons)
 *
 * @author zaclimon
 * Creation date: 11/08/17
 */

public interface ContentPersistence {

    /**
     * Gives a content to be persisted
     *
     * @param avContent the content that will be saved
     */
    void insert(AvContent avContent);

    /**
     * Gives a list of content to be to be persisted
     *
     * @param avContents the list that will be saved
     */
    void insert(List<AvContent> avContents);

    /**
     * Deletes a category based on {@link AvContent#mContentCategory}
     *
     * @param category the category which will get deleted.
     */
    void deleteCategory(String category);

    /**
     * Deletes all the items that have been persisted.
     */
    void deleteAll();

    /**
     * Gets all the items that have been persisted.
     *
     * @return the list of all the {@link AvContent} that have been persisted
     */
    List<AvContent> getAll();

    /**
     * Gives a list of {@link AvContent} containing a given title. The list can be sorted or not.
     *
     * @param title the title in which the content must correspond
     * @param isAlphabeticallySorted whether the retrieved contents should be sorted by alphabetical order
     * @return the list of contents.
     */
    List<AvContent> getFromTitle(String title, boolean isAlphabeticallySorted);

    /**
     * Gives a list of the {@link AvContent} belonging to a given category. The list can be sorted
     * or not. A category can be defined as the root of the content tree (VOD, TV shows, TV Catchup)
     *
     * @param category the given category for a content
     * @param isAlphabeticallySorted whether the retrieved contents should be sorted by alphabetical order
     * @return the list of contents
     */
    List<AvContent> getFromCategory(String category, boolean isAlphabeticallySorted);

    /**
     * Gets the total size of the persistence medium
     *
     * @return the total number of elements for this medium.
     */
// Path: library/src/main/java/com/zaclimon/xipl/model/AvContent.java
// public class AvContent {
// 
//     private String mTitle;
//     private String mLogo;
//     private String mGroup;
//     private String mContentLink;
//     private String mContentCategory;
//     private int mId;
// 
//     public AvContent() {}
// 
//     /**
//      * Base constructor
//      *
//      * @param title         the title of the content
//      * @param logo          the URL pointing to the related logo of the content
//      * @param group         the group in which a content might belong to
//      * @param contentCategory the category in which a content might belong to
//      * @param contentLink   the URL pointing to the content itself
//      */
//     public AvContent(String title, String logo, String group, String contentCategory, String contentLink) {
//         mTitle = title;
//         mLogo = logo;
//         mGroup = group;
//         mContentCategory = contentCategory;
//         mContentLink = contentLink;
//     }
// 
//     /**
//      * Constructor for an AvContent having a special identifier.
//      *
//      * @param title         the title of the content
//      * @param logo          the URL pointing to the related logo of the content
//      * @param group         the category in which a content might belong to
//      * @param contentCategory the category in which a content might belong to
//      * @param contentLink   the URL pointing to the content itself
//      * @param id            An additional id that can be given to the content
//      */
//     public AvContent(String title, String logo, String group, String contentCategory, String contentLink, int id) {
//         mTitle = title;
//         mLogo = logo;
//         mGroup = group;
//         mContentCategory = contentCategory;
//         mContentLink = contentLink;
//         mId = id;
//     }
// 
//     /**
//      * Gets the title
//      *
//      * @return the title of the content
//      */
//     public String getTitle() {
//         return (mTitle);
//     }
// 
//     /**
//      * Gets the logo
//      *
//      * @return the logo URL of the content
//      */
//     public String getLogo() {
//         return (mLogo);
//     }
// 
//     /**
//      * Gets the category
//      *
//      * @return the category of the content
//      */
//     public String getGroup() {
//         return (mGroup);
//     }
// 
//     /**
//      * Gets the content category
//      *
//      * @return the category in which this content belongs to.
//      */
//     public String getContentCategory() {
//         return (mContentCategory);
//     }
// 
//     /**
//      * Gets the link
//      *
//      * @return the link to the content
//      */
//     public String getContentLink() {
//         return (mContentLink);
//     }
// 
//     /**
//      * Gets the id
//      *
//      * @return the id of the content if any
//      */
//     public int getId() {
//         return (mId);
//     }
// }


// Path: library/src/main/java/com/zaclimon/xipl/persistence/ContentPersistence.java
import com.zaclimon.xipl.model.AvContent;
import java.util.List;

/*
 * Copyright 2017 Isaac Pateau
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.zaclimon.xipl.persistence;



/**
 * Persistence API for {@link AvContent}.
 * Will mostly be used if a content must be persisted to the disk (For caching or other reasons)
 *
 * @author zaclimon
 * Creation date: 11/08/17
 */

public interface ContentPersistence {

    /**
     * Gives a content to be persisted
     *
     * @param avContent the content that will be saved
     */
    void insert(AvContent avContent);

    /**
     * Gives a list of content to be to be persisted
     *
     * @param avContents the list that will be saved
     */
    void insert(List<AvContent> avContents);

    /**
     * Deletes a category based on {@link AvContent#mContentCategory}
     *
     * @param category the category which will get deleted.
     */
    void deleteCategory(String category);

    /**
     * Deletes all the items that have been persisted.
     */
    void deleteAll();

    /**
     * Gets all the items that have been persisted.
     *
     * @return the list of all the {@link AvContent} that have been persisted
     */
    List<AvContent> getAll();

    /**
     * Gives a list of {@link AvContent} containing a given title. The list can be sorted or not.
     *
     * @param title the title in which the content must correspond
     * @param isAlphabeticallySorted whether the retrieved contents should be sorted by alphabetical order
     * @return the list of contents.
     */
    List<AvContent> getFromTitle(String title, boolean isAlphabeticallySorted);

    /**
     * Gives a list of the {@link AvContent} belonging to a given category. The list can be sorted
     * or not. A category can be defined as the root of the content tree (VOD, TV shows, TV Catchup)
     *
     * @param category the given category for a content
     * @param isAlphabeticallySorted whether the retrieved contents should be sorted by alphabetical order
     * @return the list of contents
     */
    List<AvContent> getFromCategory(String category, boolean isAlphabeticallySorted);

    /**
     * Gets the total size of the persistence medium
     *
     * @return the total number of elements for this medium.
     */
    long size();