001package net.tnemc.item.platform.applier;
002
003/*
004 * The New Item Library
005 * Copyright (C) 2022 - 2025 Daniel "creatorfromhell" Vidmar
006 *
007 * This program is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 3 of the License, or (at your option) any later version.
011 *
012 * This program is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
015 * Lesser General Public License for more details.
016 *
017 * You should have received a copy of the GNU Lesser General Public License
018 * along with this program; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
020 */
021
022import net.tnemc.item.AbstractItemStack;
023import net.tnemc.item.platform.Identifiable;
024
025/**
026 * The ItemApplicator interface represents an applicator that can be used to apply changes to an item.
027 *
028 * @param <I> the type of AbstractItemStack that this applicator can work with
029 * @param <T> the type of item that this applicator can modify
030 *
031 * @author creatorfromhell
032 * @since 0.2.0.0
033 */
034public interface ItemApplicator<I extends AbstractItemStack<T>, T> extends Identifiable {
035
036  /**
037   * @param version the version being used when this applicator is called.
038   *
039   * @return true if this applicator is enabled for the version, otherwise false
040   * @since 0.2.0.0
041   * @since 0.2.0.0
042   */
043  boolean enabled(final String version);
044
045  /**
046   * @param serialized the serialized item stack to use
047   * @param item       the item that we should use to apply this applicator to.
048   *
049   * @return the updated item.
050   * @since 0.2.0.0
051   * @since 0.2.0.0
052   */
053  T apply(final I serialized, T item);
054}