Class BookMetaMock

java.lang.Object
be.seeseemelk.mockbukkit.inventory.meta.ItemMetaMock
be.seeseemelk.mockbukkit.inventory.meta.BookMetaMock
All Implemented Interfaces:
Cloneable, net.kyori.adventure.inventory.Book, net.kyori.adventure.util.Buildable<net.kyori.adventure.inventory.Book,net.kyori.adventure.inventory.Book.Builder>, net.kyori.examination.Examinable, org.bukkit.configuration.serialization.ConfigurationSerializable, org.bukkit.inventory.meta.BookMeta, org.bukkit.inventory.meta.Damageable, org.bukkit.inventory.meta.ItemMeta, org.bukkit.inventory.meta.Repairable, org.bukkit.inventory.meta.WritableBookMeta, org.bukkit.persistence.PersistentDataHolder

public class BookMetaMock extends ItemMetaMock implements org.bukkit.inventory.meta.BookMeta
Mock implementation of a BookMeta.
See Also:
  • Constructor Details

    • BookMetaMock

      public BookMetaMock()
      Constructs a new BookMetaMock.
    • BookMetaMock

      public BookMetaMock(@NotNull @NotNull org.bukkit.inventory.meta.BookMeta meta)
      Constructs a new BookMetaMock, cloning the data from another.
      Parameters:
      meta - The meta to clone.
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ItemMetaMock
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class ItemMetaMock
    • hasTitle

      public boolean hasTitle()
      Specified by:
      hasTitle in interface org.bukkit.inventory.meta.BookMeta
    • hasPages

      public boolean hasPages()
      Specified by:
      hasPages in interface org.bukkit.inventory.meta.WritableBookMeta
    • title

      @Nullable public @Nullable net.kyori.adventure.text.Component title()
      Specified by:
      title in interface net.kyori.adventure.inventory.Book
      Specified by:
      title in interface org.bukkit.inventory.meta.BookMeta
    • title

      @NotNull public @NotNull org.bukkit.inventory.meta.BookMeta title(@Nullable @Nullable net.kyori.adventure.text.Component title)
      Specified by:
      title in interface net.kyori.adventure.inventory.Book
      Specified by:
      title in interface org.bukkit.inventory.meta.BookMeta
    • author

      @Nullable public @Nullable net.kyori.adventure.text.Component author()
      Specified by:
      author in interface net.kyori.adventure.inventory.Book
      Specified by:
      author in interface org.bukkit.inventory.meta.BookMeta
    • author

      @NotNull public @NotNull org.bukkit.inventory.meta.BookMeta author(@Nullable @Nullable net.kyori.adventure.text.Component author)
      Specified by:
      author in interface net.kyori.adventure.inventory.Book
      Specified by:
      author in interface org.bukkit.inventory.meta.BookMeta
    • pages

      @NotNull public @Unmodifiable @NotNull List<net.kyori.adventure.text.Component> pages()
      Specified by:
      pages in interface net.kyori.adventure.inventory.Book
    • pages

      @NotNull public @NotNull net.kyori.adventure.inventory.Book pages(@NotNull @NotNull List<net.kyori.adventure.text.Component> pages)
      Specified by:
      pages in interface net.kyori.adventure.inventory.Book
    • page

      @NotNull public @NotNull net.kyori.adventure.text.Component page(int page)
      Specified by:
      page in interface org.bukkit.inventory.meta.BookMeta
    • page

      public void page(int page, @NotNull @NotNull net.kyori.adventure.text.Component data)
      Specified by:
      page in interface org.bukkit.inventory.meta.BookMeta
    • addPages

      public void addPages(@NotNull @NotNull net.kyori.adventure.text.Component... pages)
      Specified by:
      addPages in interface org.bukkit.inventory.meta.BookMeta
    • toBuilder

      public @NonNull org.bukkit.inventory.meta.BookMeta.BookMetaBuilder toBuilder()
      Specified by:
      toBuilder in interface net.kyori.adventure.inventory.Book
      Specified by:
      toBuilder in interface org.bukkit.inventory.meta.BookMeta
      Specified by:
      toBuilder in interface net.kyori.adventure.util.Buildable<net.kyori.adventure.inventory.Book,net.kyori.adventure.inventory.Book.Builder>
    • getTitle

      @Nullable public @Nullable String getTitle()
      Specified by:
      getTitle in interface org.bukkit.inventory.meta.BookMeta
    • setTitle

      public boolean setTitle(@Nullable @Nullable String title)
      Specified by:
      setTitle in interface org.bukkit.inventory.meta.BookMeta
    • hasAuthor

      public boolean hasAuthor()
      Specified by:
      hasAuthor in interface org.bukkit.inventory.meta.BookMeta
    • getAuthor

      @Nullable public @Nullable String getAuthor()
      Specified by:
      getAuthor in interface org.bukkit.inventory.meta.BookMeta
    • setAuthor

      public void setAuthor(@Nullable @Nullable String author)
      Specified by:
      setAuthor in interface org.bukkit.inventory.meta.BookMeta
    • getPage

      @Deprecated(since="1.16") @NotNull public @NotNull String getPage(int page)
      Deprecated.
      Specified by:
      getPage in interface org.bukkit.inventory.meta.BookMeta
      Specified by:
      getPage in interface org.bukkit.inventory.meta.WritableBookMeta
    • setPage

      @Deprecated(since="1.16") public void setPage(int page, @Nullable @Nullable String text)
      Deprecated.
      Specified by:
      setPage in interface org.bukkit.inventory.meta.BookMeta
      Specified by:
      setPage in interface org.bukkit.inventory.meta.WritableBookMeta
    • getPages

      @Deprecated(since="1.16") @NotNull public @NotNull List<String> getPages()
      Deprecated.
      Specified by:
      getPages in interface org.bukkit.inventory.meta.BookMeta
      Specified by:
      getPages in interface org.bukkit.inventory.meta.WritableBookMeta
    • setPages

      @Deprecated(since="1.16") public void setPages(String... pages)
      Deprecated.
      Specified by:
      setPages in interface org.bukkit.inventory.meta.BookMeta
      Specified by:
      setPages in interface org.bukkit.inventory.meta.WritableBookMeta
    • setPages

      @Deprecated(since="1.16") public void setPages(@NotNull @NotNull List<String> pages)
      Deprecated.
      Specified by:
      setPages in interface org.bukkit.inventory.meta.BookMeta
      Specified by:
      setPages in interface org.bukkit.inventory.meta.WritableBookMeta
    • addPage

      @Deprecated(since="1.16") public void addPage(String @NotNull ... pages)
      Deprecated.
      Specified by:
      addPage in interface org.bukkit.inventory.meta.BookMeta
      Specified by:
      addPage in interface org.bukkit.inventory.meta.WritableBookMeta
    • getPageCount

      public int getPageCount()
      Specified by:
      getPageCount in interface org.bukkit.inventory.meta.WritableBookMeta
    • clone

      @NotNull public @NotNull BookMetaMock clone()
      Specified by:
      clone in interface org.bukkit.inventory.meta.BookMeta
      Specified by:
      clone in interface org.bukkit.inventory.meta.Damageable
      Specified by:
      clone in interface org.bukkit.inventory.meta.ItemMeta
      Specified by:
      clone in interface org.bukkit.inventory.meta.Repairable
      Specified by:
      clone in interface org.bukkit.inventory.meta.WritableBookMeta
      Overrides:
      clone in class ItemMetaMock
    • hasGeneration

      public boolean hasGeneration()
      Specified by:
      hasGeneration in interface org.bukkit.inventory.meta.BookMeta
    • getGeneration

      @Nullable public @Nullable org.bukkit.inventory.meta.BookMeta.Generation getGeneration()
      Specified by:
      getGeneration in interface org.bukkit.inventory.meta.BookMeta
    • setGeneration

      public void setGeneration(@Nullable @Nullable org.bukkit.inventory.meta.BookMeta.Generation generation)
      Specified by:
      setGeneration in interface org.bukkit.inventory.meta.BookMeta
    • spigot

      @NotNull public @NotNull org.bukkit.inventory.meta.BookMeta.Spigot spigot()
      Specified by:
      spigot in interface org.bukkit.inventory.meta.BookMeta
    • deserialize

      @NotNull public static @NotNull BookMetaMock deserialize(@NotNull @NotNull Map<String,Object> args)
      Required method for Bukkit deserialization.
      Parameters:
      args - A serialized BookMetaMock object in a Map<String, Object> format.
      Returns:
      A new instance of the BookMetaMock class.
    • serialize

      @NotNull public @NotNull Map<String,Object> serialize()
      Serializes the properties of an BookMetaMock to a HashMap. Unimplemented properties are not present in the map.
      Specified by:
      serialize in interface org.bukkit.configuration.serialization.ConfigurationSerializable
      Overrides:
      serialize in class ItemMetaMock
      Returns:
      A HashMap of String, Object pairs representing the BookMetaMock.
    • getTypeName

      protected String getTypeName()
      Overrides:
      getTypeName in class ItemMetaMock