001/*
002 * Trident - A Multithreaded Server Alternative
003 * Copyright 2014 The TridentSDK Team
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *    http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package net.tridentsdk.meta.item;
018
019import java.util.Arrays;
020import java.util.List;
021
022/**
023 * Represents a book's (BOOK_AND_QUILL, WRITTEN_BOOK) additional metadata, which
024 * include title, pages, tier and author.
025 */
026public interface BookMeta extends ItemMeta {
027    /**
028     * Returns copy tier of the book.
029     *
030     *
031     * <p>0 - original 1 - copy of original 2 - copy of copy, > 2 - cannot be
032     * copied</p>
033     *
034     * @return Copy tier
035     */
036    int copyTier();
037
038    /**
039     * Manually set the copy tier of the book
040     *
041     * @param copyTier
042     *            Copy tier you wish to set it to
043     * @see #copyTier()
044     */
045    void setCopyTier(int copyTier);
046
047    /**
048     * Returns last known author of the book.
049     *
050     * @return The ast known author.
051     */
052    String author();
053
054    /**
055     * Sets the author of the book.
056     *
057     * @param name
058     *            Name of the author.
059     */
060    void setAuthor(String name);
061
062    /**
063     * Gets the title of the book.
064     *
065     * @return The title.
066     */
067    String title();
068
069    /**
070     * Sets the title of the book
071     *
072     * @param title
073     *            The title.
074     */
075    void setTitle(String title);
076
077    /**
078     * Gets the pages of the book as a List.
079     *
080     * @return The pages.
081     */
082    List<String> pages();
083
084    /**
085     * Set the pages of the book.
086     *
087     * @param pages
088     *            The pages.
089     */
090    void setPages(List<String> pages);
091
092    /**
093     * Set the pages of the book.
094     *
095     * @param pages
096     *            The pages.
097     */
098    default void setPages(String... pages) {
099        setPages(Arrays.asList(pages));
100    }
101}