/*
 * Aeronica's mxTune MOD
 * Copyright 2019, Paul Boese a.k.a. Aeronica
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package net.aeronica.mods.mxtune.managers.records;

import net.aeronica.mods.mxtune.caches.FileHelper;
import net.aeronica.mods.mxtune.util.NBTHelper;
import net.minecraft.nbt.NBTTagCompound;

import java.io.Serializable;
import java.util.UUID;

public abstract class BaseData implements Serializable
{
    private static final long serialVersionUID = -76044260522231311L;
    protected UUID uuid;

    BaseData()
    {
        uuid = new UUID(0L, 0L);
    }

    public void readFromNBT(NBTTagCompound compound)
    {
        uuid = NBTHelper.getUuidFromCompound(compound);
    }

    public void writeToNBT(NBTTagCompound compound)
    {
        NBTHelper.setUuidToCompound(compound, uuid);
    }

    public UUID getUUID()
    {
        return uuid;
    }

    public String getFileName()
    {
        return uuid.toString() + FileHelper.EXTENSION_DAT;
    }

    public abstract <T extends BaseData> T factory();
}

@@ -947,16 +947,34 @@
 alizable
+, Comparable%3CUUID%3E
 %0A%7B%0A    p
@@ -1582,11 +1582,332 @@
 ctory();
+%0A%0A    @Override%0A    public int hashCode()%0A    %7B%0A        return this.uuid.hashCode();%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object obj)%0A    %7B%0A        return obj instanceof BaseData && super.equals(obj);%0A    %7D%0A%0A    @Override%0A    public int compareTo(UUID uuid)%0A    %7B%0A        return this.uuid.compareTo(uuid);%0A    %7D
 %0A%7D%0A

Make BaseData implement Comparable<UUID>