// Path: phial-key-value/src/main/java/com/mindcoders/phial/keyvalue/Category.java
// public class Category {
//     private final String name;
//     private final List<Saver> savers;
// 
//     Category(String name, List<Saver> savers) {
//         this.name = name;
//         this.savers = savers;
//     }
// 
//     /**
//      * Sets a value to be associated with your debug data.
//      * Entry will be under the category set via {@link Phial#category(String)}
//      * <p>
//      * Note: setKey(key, null) will set associated value to null. In order to remove entry use {@link Phial#removeKey(String)}
//      *
//      * @param key   of the debug data
//      * @param value associated value
//      */
//     public Category setKey(@NonNull String key, String value) {
//         verifyKeyIsNotNull(key);
//         for (Saver saver : savers) {
//             saver.save(name, key, value);
//         }
//         return this;
//     }
// 
//     /**
//      * Sets a value to be associated with your debug data.
//      * Entry will be under the category set via {@link Phial#category(String)}
//      * <p>
//      * Note: setKey(key, null) will set associated value to null. In order to remove entry use {@link Phial#removeKey(String)}
//      *
//      * @param key   of the debug data
//      * @param value associated value
//      */
//     public Category setKey(@NonNull String key, Object value) {
//         verifyKeyIsNotNull(key);
//         for (Saver saver : savers) {
//             saver.save(name, key, String.valueOf(value));
//         }
//         return this;
//     }
// 
//     /**
//      * Removes entry with given key from debug data.
//      * <p>
//      * Note: Entry would be removed only from the category set via {@link Phial#category(String)}
//      *
//      * @param key to be removed.
//      */
//     public Category removeKey(@NonNull String key) {
//         verifyKeyIsNotNull(key);
//         for (Saver saver : savers) {
//             saver.remove(name, key);
//         }
//         return this;
//     }
// 
//     /**
//      * Clears all the keys associated with this category.
//      */
//     public void clear() {
//         for (Saver saver : savers) {
//             saver.remove(name);
//         }
//     }
// 
//     private void verifyKeyIsNotNull(String key) {
//         if (key == null) {
//             throw new IllegalArgumentException("key should not be null.");
//         }
//     }
// }
// 
// Path: phial-key-value/src/main/java/com/mindcoders/phial/keyvalue/Phial.java
// public class Phial {
//     private static final List<Saver> SAVERS = new CopyOnWriteArrayList<>();
//     private static final String DEFAULT_CATEGORY_NAME = "Default";
//     private static final Category DEFAULT_CATEGORY = new Category(DEFAULT_CATEGORY_NAME, SAVERS);
//     private static final ConcurrentMap<String, Category> CATEGORIES = new ConcurrentHashMap<>();
// 
//     static {
//         CATEGORIES.put(DEFAULT_CATEGORY_NAME, DEFAULT_CATEGORY);
//     }
// 
//     /**
//      * Sets a value to be associated with your debug data.
//      * Entry will be set under default category.
//      * <p>
//      * Note: setKey(key, null) will set associated value to null. In order to remove entry use {@link Phial#removeKey(String)}
//      *
//      * @param key   of the debug data
//      * @param value associated value
//      */
//     public static void setKey(String key, String value) {
//         DEFAULT_CATEGORY.setKey(key, value);
//     }
// 
//     /**
//      * Sets a value to be associated with your debug data.
//      * Entry will be set under default category.
//      * <p>
//      * Note: setKey(key, null) will set associated value to null. In order to remove entry use {@link Phial#removeKey(String)}
//      *
//      * @param key   of the debug data
//      * @param value associated value
//      */
//     public static void setKey(@NonNull String key, @Nullable Object value) {
//         DEFAULT_CATEGORY.setKey(key, value);
//     }
// 
// 
//     /**
//      * Removes entry with given key from debug data.
//      * <p>
//      * Note: Entry would be removed only from default category.
//      *
//      * @param key to be removed.
//      */
//     public static void removeKey(String key) {
//         DEFAULT_CATEGORY.removeKey(key);
//     }
// 
//     /**
//      * Creates category that can be used for adding key values
//      */
//     public static Category category(String name) {
//         CATEGORIES.putIfAbsent(name, new Category(name, SAVERS));
//         return CATEGORIES.get(name);
//     }
// 
//     /**
//      * Removes category and associated keys.
//      */
//     public static void removeCategory(String name) {
//         Category category = CATEGORIES.remove(name);
//         category.clear();
//     }
// 
//     /**
//      * Add a new saver.
//      */
//     public static void addSaver(Saver saver) {
//         SAVERS.add(saver);
//     }
// 
// 
//     /**
//      * Remove previously added saver
//      */
//     public static void removeSaver(Saver saver) {
//         SAVERS.remove(saver);
//     }
// 
//     @VisibleForTesting
//     static void cleanSavers() {
//         SAVERS.clear();
//     }
// }


import android.content.Context;
import com.mindcoders.phial.keyvalue.Category;
import com.mindcoders.phial.keyvalue.Phial;
package com.mindcoders.phial.internal.keyvalue;



/**
 * Created by rost on 10/30/17.
 */

public abstract class InfoWriter {
    private final Category category;
    private final Context context;

    public InfoWriter(Context context, String categoryName) {
// Path: phial-key-value/src/main/java/com/mindcoders/phial/keyvalue/Category.java
// public class Category {
//     private final String name;
//     private final List<Saver> savers;
// 
//     Category(String name, List<Saver> savers) {
//         this.name = name;
//         this.savers = savers;
//     }
// 
//     /**
//      * Sets a value to be associated with your debug data.
//      * Entry will be under the category set via {@link Phial#category(String)}
//      * <p>
//      * Note: setKey(key, null) will set associated value to null. In order to remove entry use {@link Phial#removeKey(String)}
//      *
//      * @param key   of the debug data
//      * @param value associated value
//      */
//     public Category setKey(@NonNull String key, String value) {
//         verifyKeyIsNotNull(key);
//         for (Saver saver : savers) {
//             saver.save(name, key, value);
//         }
//         return this;
//     }
// 
//     /**
//      * Sets a value to be associated with your debug data.
//      * Entry will be under the category set via {@link Phial#category(String)}
//      * <p>
//      * Note: setKey(key, null) will set associated value to null. In order to remove entry use {@link Phial#removeKey(String)}
//      *
//      * @param key   of the debug data
//      * @param value associated value
//      */
//     public Category setKey(@NonNull String key, Object value) {
//         verifyKeyIsNotNull(key);
//         for (Saver saver : savers) {
//             saver.save(name, key, String.valueOf(value));
//         }
//         return this;
//     }
// 
//     /**
//      * Removes entry with given key from debug data.
//      * <p>
//      * Note: Entry would be removed only from the category set via {@link Phial#category(String)}
//      *
//      * @param key to be removed.
//      */
//     public Category removeKey(@NonNull String key) {
//         verifyKeyIsNotNull(key);
//         for (Saver saver : savers) {
//             saver.remove(name, key);
//         }
//         return this;
//     }
// 
//     /**
//      * Clears all the keys associated with this category.
//      */
//     public void clear() {
//         for (Saver saver : savers) {
//             saver.remove(name);
//         }
//     }
// 
//     private void verifyKeyIsNotNull(String key) {
//         if (key == null) {
//             throw new IllegalArgumentException("key should not be null.");
//         }
//     }
// }
// 
// Path: phial-key-value/src/main/java/com/mindcoders/phial/keyvalue/Phial.java
// public class Phial {
//     private static final List<Saver> SAVERS = new CopyOnWriteArrayList<>();
//     private static final String DEFAULT_CATEGORY_NAME = "Default";
//     private static final Category DEFAULT_CATEGORY = new Category(DEFAULT_CATEGORY_NAME, SAVERS);
//     private static final ConcurrentMap<String, Category> CATEGORIES = new ConcurrentHashMap<>();
// 
//     static {
//         CATEGORIES.put(DEFAULT_CATEGORY_NAME, DEFAULT_CATEGORY);
//     }
// 
//     /**
//      * Sets a value to be associated with your debug data.
//      * Entry will be set under default category.
//      * <p>
//      * Note: setKey(key, null) will set associated value to null. In order to remove entry use {@link Phial#removeKey(String)}
//      *
//      * @param key   of the debug data
//      * @param value associated value
//      */
//     public static void setKey(String key, String value) {
//         DEFAULT_CATEGORY.setKey(key, value);
//     }
// 
//     /**
//      * Sets a value to be associated with your debug data.
//      * Entry will be set under default category.
//      * <p>
//      * Note: setKey(key, null) will set associated value to null. In order to remove entry use {@link Phial#removeKey(String)}
//      *
//      * @param key   of the debug data
//      * @param value associated value
//      */
//     public static void setKey(@NonNull String key, @Nullable Object value) {
//         DEFAULT_CATEGORY.setKey(key, value);
//     }
// 
// 
//     /**
//      * Removes entry with given key from debug data.
//      * <p>
//      * Note: Entry would be removed only from default category.
//      *
//      * @param key to be removed.
//      */
//     public static void removeKey(String key) {
//         DEFAULT_CATEGORY.removeKey(key);
//     }
// 
//     /**
//      * Creates category that can be used for adding key values
//      */
//     public static Category category(String name) {
//         CATEGORIES.putIfAbsent(name, new Category(name, SAVERS));
//         return CATEGORIES.get(name);
//     }
// 
//     /**
//      * Removes category and associated keys.
//      */
//     public static void removeCategory(String name) {
//         Category category = CATEGORIES.remove(name);
//         category.clear();
//     }
// 
//     /**
//      * Add a new saver.
//      */
//     public static void addSaver(Saver saver) {
//         SAVERS.add(saver);
//     }
// 
// 
//     /**
//      * Remove previously added saver
//      */
//     public static void removeSaver(Saver saver) {
//         SAVERS.remove(saver);
//     }
// 
//     @VisibleForTesting
//     static void cleanSavers() {
//         SAVERS.clear();
//     }
// }


// Path: phial-overlay/src/main/java/com/mindcoders/phial/internal/keyvalue/InfoWriter.java
import android.content.Context;
import com.mindcoders.phial.keyvalue.Category;
import com.mindcoders.phial.keyvalue.Phial;

package com.mindcoders.phial.internal.keyvalue;



/**
 * Created by rost on 10/30/17.
 */

public abstract class InfoWriter {
    private final Category category;
    private final Context context;

    public InfoWriter(Context context, String categoryName) {
        this.category = Phial.category(categoryName);