/*
 * This file is part of SpongeAPI, licensed under the MIT License (MIT).
 *
 * Copyright (c) SpongePowered <https://www.spongepowered.org>
 * Copyright (c) contributors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.spongepowered.api.item.inventory.query;

import org.spongepowered.api.Sponge;
import org.spongepowered.api.data.Key;
import org.spongepowered.api.data.KeyValueMatcher;
import org.spongepowered.api.item.ItemType;
import org.spongepowered.api.item.inventory.Inventory;
import org.spongepowered.api.item.inventory.InventoryKeys;
import org.spongepowered.api.item.inventory.ItemStack;
import org.spongepowered.api.item.inventory.entity.Hotbar;
import org.spongepowered.api.item.inventory.entity.PrimaryPlayerInventory;
import org.spongepowered.api.item.inventory.query.QueryType.NoParam;
import org.spongepowered.api.item.inventory.query.QueryType.OneParam;
import org.spongepowered.api.item.inventory.query.QueryType.TwoParam;
import org.spongepowered.api.text.translation.Translation;
import org.spongepowered.api.util.Nameable;
import org.spongepowered.math.vector.Vector2i;

import java.util.function.Predicate;
import java.util.function.Supplier;

@SuppressWarnings({"unused", "WeakerAccess"})
public final class QueryTypes {

    // SORTFIELDS:ON

    /**
     * TODO property instead?
     * Tests based on the title of the inventory.
     *
     * @see InventoryKeys#TITLE
     * @see Nameable.Translatable#getNameTranslation()
     */
    public static final Supplier<OneParam<Translation>> INVENTORY_TRANSLATION = Sponge.getRegistry().getCatalogRegistry().provideSupplier(OneParam.class, "INVENTORY_TRANSLATION");

    /**
     * Tests based on the class of the inventory.
     */
    public static final Supplier<OneParam<Class<? extends Inventory>>> INVENTORY_TYPE = Sponge.getRegistry().getCatalogRegistry().provideSupplier(OneParam.class, "INVENTORY_TYPE");

    /**
     * Allows a custom condition for the items contained within an item stack.
     */
    public static final Supplier<OneParam<Predicate<ItemStack>>> ITEM_STACK_CUSTOM = Sponge.getRegistry().getCatalogRegistry().provideSupplier(OneParam.class, "ITEM_STACK_CUSTOM");

    /**
     * Tests for an exact match of the item stack contained in each slot.
     *
     * <p>Generally uses {@link ItemStack}'s <code>#equals</code> method.</p>
     */
    public static final Supplier<OneParam<ItemStack>> ITEM_STACK_EXACT = Sponge.getRegistry().getCatalogRegistry().provideSupplier(OneParam.class, "ITEM_STACK_EXACT");

    /**
     * Tests for an exact match of the item stack contained in each slot, with
     * the exception of the quantity. This allows testing for custom data on
     * item stacks that may be moved and stacked by players.
     *
     * @see ItemStack#equalTo(ItemStack)
     */
    public static final Supplier<OneParam<ItemStack>> ITEM_STACK_IGNORE_QUANTITY = Sponge.getRegistry().getCatalogRegistry().provideSupplier(OneParam.class, "ITEM_STACK_IGNORE_QUANTITY");

    /**
     * Tests for a match of the type of item contained in each slot.
     *
     * @see ItemStack#getType()
     */
    public static final Supplier<OneParam<ItemType>> ITEM_TYPE = Sponge.getRegistry().getCatalogRegistry().provideSupplier(OneParam.class, "ITEM_TYPE");

    /**
     * Tests based on an inventory property present on the target inventory.
     *
     * @see Inventory#get(Inventory, Key)
     */
    public static final Supplier<OneParam<KeyValueMatcher<?>>> KEY_VALUE = Sponge.getRegistry().getCatalogRegistry().provideSupplier(OneParam.class, "KEY_VALUE");

    /**
     * Tests based on the class of the inventory.
     */
    public static final Supplier<OneParam<Class<?>>> TYPE = Sponge.getRegistry().getCatalogRegistry().provideSupplier(OneParam.class, "TYPE");

    /**
     * Query for a modified order of slots in a player inventory.
     * Ordering the {@link Hotbar} before the {@link PrimaryPlayerInventory}
     */
    public static final Supplier<NoParam> PLAYER_PRIMARY_HOTBAR_FIRST = Sponge.getRegistry().getCatalogRegistry().provideSupplier(NoParam.class, "PLAYER_PRIMARY_HOTBAR_FIRST");

    /**
     * Query for a reverse order of slots.
     */
    public static final Supplier<NoParam> REVERSE = Sponge.getRegistry().getCatalogRegistry().provideSupplier(NoParam.class, "REVERSE");

    /**
     * A grid query. Only works on grids. The first value is the offset the second value is the grid size.
     */
    public static final Supplier<TwoParam<Vector2i, Vector2i>> GRID = Sponge.getRegistry().getCatalogRegistry().provideSupplier(TwoParam.class, "GRID");

    // SORTFIELDS:OFF

    // Suppress default constructor to ensure non-instantiability.
    private QueryTypes() {
        throw new AssertionError("You should not be attempting to instantiate this class.");
    }

}

@@ -1527,67 +1527,8 @@
 ry;%0A
-import org.spongepowered.api.item.inventory.InventoryKeys;%0A
 impo
@@ -1578,16 +1578,16 @@
 mStack;%0A
+
 import o
@@ -1925,111 +1925,8 @@
 am;%0A
-import org.spongepowered.api.text.translation.Translation;%0Aimport org.spongepowered.api.util.Nameable;%0A
 impo
@@ -2122,16 +2122,16 @@
 ypes %7B%0A%0A
+
     // S
@@ -2148,379 +2148,8 @@
 ON%0A%0A
-    /**%0A     * TODO property instead?%0A     * Tests based on the title of the inventory.%0A     *%0A     * @see InventoryKeys#TITLE%0A     * @see Nameable.Translatable#getNameTranslation()%0A     */%0A    public static final Supplier%3COneParam%3CTranslation%3E%3E INVENTORY_TRANSLATION = Sponge.getRegistry().getCatalogRegistry().provideSupplier(OneParam.class, %22INVENTORY_TRANSLATION%22);%0A%0A
     

remove INVENTORY_TRANSLATION query instead search using KEY_VALUE and Keys.DISPLAY_NAME