/*
 * This file is part of Total Economy, licensed under the MIT License (MIT).
 *
 * Copyright (c) Eric Grandt <https://www.ericgrandt.com>
 * 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 com.erigitic.shops.data;

import com.erigitic.shops.PlayerShopInfo;
import com.erigitic.shops.Shop;
import com.erigitic.shops.ShopItem;
import com.google.common.reflect.TypeToken;
import org.spongepowered.api.data.DataQuery;
import org.spongepowered.api.data.key.Key;
import org.spongepowered.api.data.key.KeyFactory;
import org.spongepowered.api.data.value.mutable.Value;

public class ShopKeys {

    public static Key<Value<Shop>> SINGLE_SHOP = KeyFactory.makeSingleKey(
            TypeToken.of(Shop.class),
            new TypeToken<Value<Shop>>() {},
            DataQuery.of("shop"),
            "totaleconomy:shop",
            "shop"
    );

    public static Key<Value<ShopItem>> SHOP_ITEM = KeyFactory.makeSingleKey(
            TypeToken.of(ShopItem.class),
            new TypeToken<Value<ShopItem>>() {},
            DataQuery.of("shopitem"),
            "totaleconomy:shopitem",
            "shopitem"
    );

    public static Key<Value<PlayerShopInfo>> PLAYER_SHOP_INFO = KeyFactory.makeSingleKey(
            TypeToken.of(PlayerShopInfo.class),
            new TypeToken<Value<PlayerShopInfo>>() {},
            DataQuery.of("playershopinfo"),
            "totaleconomy:playershopinfo",
            "playershopinfo"
    );
}

@@ -1703,38 +1703,26 @@
 OP = Key
-Factory.makeSingleKey(
+.builder()
 %0A       
@@ -1730,46 +1730,14 @@
     
-TypeToken.of(Shop.class),%0A            
+.type(
 new 
@@ -1759,25 +1759,25 @@
 %3CShop%3E%3E() %7B%7D
-,
+)
 %0A           
@@ -1781,28 +1781,19 @@
     
-DataQuery.of
+.id
 (%22shop%22)
 ,%0A  
@@ -1788,17 +1788,16 @@
 (%22shop%22)
-,
 %0A       
@@ -1805,28 +1805,21 @@
     
-%22totaleconomy:
+.name(%22
 shop%22
-,
+)
 %0A   
@@ -1831,19 +1831,56 @@
     
-%22shop%22%0A    
+.query(DataQuery.of(%22shop%22))%0A            .build(
 );%0A%0A
@@ -1933,38 +1933,26 @@
 EM = Key
-Factory.makeSingleKey(
+.builder()
 %0A       
@@ -1960,50 +1960,14 @@
     
-TypeToken.of(ShopItem.class),%0A            
+.type(
 new 
@@ -1993,25 +1993,25 @@
 pItem%3E%3E() %7B%7D
-,
+)
 %0A           
@@ -2011,28 +2011,19 @@
         
-DataQuery.of
+.id
 (%22shopit
@@ -2026,17 +2026,16 @@
 opitem%22)
-,
 %0A       
@@ -2039,30 +2039,23 @@
         
-%22totaleconomy:
+.name(%22
 shopitem
@@ -2055,17 +2055,17 @@
 hopitem%22
-,
+)
 %0A       
@@ -2069,16 +2069,36 @@
         
+.query(DataQuery.of(
 %22shopite
@@ -2099,21 +2099,38 @@
 hopitem%22
+))
 %0A    
+        .build(
 );%0A%0A    
@@ -2196,30 +2196,18 @@
  Key
-Factory.makeSingleKey(
+.builder()
 %0A   
@@ -2219,56 +2219,14 @@
     
-TypeToken.of(PlayerShopInfo.class),%0A            
+.type(
 new 
@@ -2262,17 +2262,17 @@
 o%3E%3E() %7B%7D
-,
+)
 %0A       
@@ -2276,28 +2276,19 @@
         
-DataQuery.of
+.id
 (%22player
@@ -2297,17 +2297,16 @@
 opinfo%22)
-,
 %0A       
@@ -2314,22 +2314,15 @@
     
-%22totaleconomy:
+.name(%22
 play
@@ -2332,17 +2332,17 @@
 hopinfo%22
-,
+)
 %0A       
@@ -2350,29 +2350,66 @@
     
-%22playershopinfo%22%0A    
+.query(DataQuery.of(%22playershopinfo%22))%0A            .build(
 );%0A%7D

Replace deprecated code