Interface Mapping<M extends Mapping,​P>

    • Method Detail

      • getObfuscatedName

        java.lang.String getObfuscatedName()
        Gets the obfuscated name of the member being represented.
        Returns:
        The obfuscated name
      • getDeobfuscatedName

        java.lang.String getDeobfuscatedName()
        Gets the de-obfuscated name of the member being represented. This can be altered through use of setDeobfuscatedName(String).
        Returns:
        The de-obfuscated name
      • setDeobfuscatedName

        M setDeobfuscatedName​(java.lang.String deobfuscatedName)
        Sets the de-obfuscated name of the member.
        Parameters:
        deobfuscatedName - The new de-obfuscated name
        Returns:
        this for chaining
      • getSimpleObfuscatedName

        default java.lang.String getSimpleObfuscatedName()
        Gets the unqualified ("simple") obfuscated name of the member.
        Returns:
        The simple obfuscated name
        Since:
        0.4.0
      • getSimpleDeobfuscatedName

        default java.lang.String getSimpleDeobfuscatedName()
        Gets the unqualified ("simple") de-obfuscated name of the member.
        Returns:
        The simple de-obfuscated name
        Since:
        0.4.0
      • getFullObfuscatedName

        java.lang.String getFullObfuscatedName()
        Gets the fully-qualified obfuscated name of the member.
        Returns:
        The fully-qualified obfuscated name
      • getFullDeobfuscatedName

        java.lang.String getFullDeobfuscatedName()
        Gets the fully-qualified de-obfuscated name of the member.
        Returns:
        The fully-qualified de-obfuscated name
      • hasDeobfuscatedName

        boolean hasDeobfuscatedName()
        Establishes whether the mapping has had a de-obfuscated name set.
        Returns:
        True if the mapping is mapped, false otherwise
      • getMappings

        MappingSet getMappings()
        Gets the MappingSet that the mappings belongs to.
        Returns:
        The owning mapping set
      • merge

        M merge​(M with,
                P parent)
        Merges this mapping with another, to a given parent.
        Parameters:
        with - The mapping to merge with
        parent - The parent
        Returns:
        The new mapping
        Since:
        0.5.0
      • copy

        M copy​(P parent)
        Clones this mapping, to a given parent.
        Parameters:
        parent - The parent
        Returns:
        The cloned mapping
        Since:
        0.5.0
      • get

        <T> java.util.Optional<T> get​(ExtensionKey<T> key)
        Gets the value of the extension data, if it exists.
        Type Parameters:
        T - The type of the extension data
        Parameters:
        key - The key of the extension data
        Returns:
        The value, wrapped in an Optional
        Since:
        0.5.0
      • getOrCreate

        default <T> T getOrCreate​(ExtensionKey<T> key,
                                  java.util.function.Supplier<T> supplier)
        Gets the value of the extension data, or uses the supplier (setting that value too).
        Type Parameters:
        T - The type of the extension data
        Parameters:
        key - The key of the extension data
        supplier - The "backup" value supplier
        Returns:
        The value
        Since:
        0.5.0
      • set

        <T> void set​(ExtensionKey<T> key,
                     T value)
        Sets the given extension data to the given value.
        Type Parameters:
        T - The type of the extension data
        Parameters:
        key - The extension data key
        value - The extension data value
        Since:
        0.5.0