Enum TinyMappingFormat

java.lang.Object
java.lang.Enum<TinyMappingFormat>
net.fabricmc.lorenztiny.TinyMappingFormat
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TinyMappingFormat>, java.lang.constant.Constable

public enum TinyMappingFormat
extends java.lang.Enum<TinyMappingFormat>
A helper class for working with Tiny mappings with Lorenz, in lieu of having a mapping format.
Since:
2.0.0
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant Description
    DETECT
    Reads tiny mappings of either the standard (new) or legacy format.
    LEGACY
    Reads tiny mappings with legacy format ("v1" header).
    STANDARD
    Reads tiny mappings with new standard ("tiny" header).
  • Method Summary

    Modifier and Type Method Description
    org.cadixdev.lorenz.io.MappingsReader createReader​(java.nio.file.Path path, java.lang.String from, java.lang.String to)
    Creates a new mappings reader for the mappings contained by the path supplied.
    org.cadixdev.lorenz.io.MappingsWriter createWriter​(java.io.Writer writer, java.lang.String from, java.lang.String to)
    Creates a new mappings writer for the writer supplied.
    protected abstract net.fabricmc.mapping.tree.TinyTree load​(java.io.BufferedReader reader)  
    org.cadixdev.lorenz.MappingSet read​(java.nio.file.Path path, java.lang.String from, java.lang.String to)
    Reads Tiny mappings from the given path, into a new mapping set.
    org.cadixdev.lorenz.MappingSet read​(org.cadixdev.lorenz.MappingSet mappings, java.nio.file.Path path, java.lang.String from, java.lang.String to)
    Reads Tiny mappings from the given path, into the given mapping set.
    static TinyMappingFormat valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static TinyMappingFormat[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    void write​(org.cadixdev.lorenz.MappingSet mappings, java.nio.file.Path path, java.lang.String from, java.lang.String to)
    Write the given mapping set to the file specified by the supplied path.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • STANDARD

      public static final TinyMappingFormat STANDARD
      Reads tiny mappings with new standard ("tiny" header).
      See Also:
      TinyMappingFactory.load(BufferedReader)
    • LEGACY

      public static final TinyMappingFormat LEGACY
      Reads tiny mappings with legacy format ("v1" header).
      See Also:
      TinyMappingFactory.loadLegacy(BufferedReader)
    • DETECT

      public static final TinyMappingFormat DETECT
      Reads tiny mappings of either the standard (new) or legacy format.
      See Also:
      TinyMappingFactory.loadWithDetection(BufferedReader)
  • Method Details

    • values

      public static TinyMappingFormat[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static TinyMappingFormat valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
      java.lang.NullPointerException - if the argument is null
    • load

      protected abstract net.fabricmc.mapping.tree.TinyTree load​(java.io.BufferedReader reader) throws java.io.IOException, net.fabricmc.mapping.reader.v2.MappingParseException
      Throws:
      java.io.IOException
      net.fabricmc.mapping.reader.v2.MappingParseException
    • createWriter

      public org.cadixdev.lorenz.io.MappingsWriter createWriter​(java.io.Writer writer, java.lang.String from, java.lang.String to)
      Creates a new mappings writer for the writer supplied.

      The resulting mappings written will use the from namespace (for the obfuscated names in Lorenz) to the to namespace (for the de-obfuscated names in Lorenz).

      Parameters:
      writer - The Writer to write the mappings to
      from - The namespace to place the obfuscated names under
      to - The namespace to place the deobfuscated names under
      Returns:
      The mappings writer
      Since:
      3.0.0
    • write

      public void write​(org.cadixdev.lorenz.MappingSet mappings, java.nio.file.Path path, java.lang.String from, java.lang.String to) throws java.io.IOException
      Write the given mapping set to the file specified by the supplied path.

      The resulting mappings written will use the from namespace (for the obfuscated names in Lorenz) to the to namespace (for the de-obfuscated names in Lorenz).

      Parameters:
      mappings - The mappings to write
      path - The file to write the mappings to
      from - The namespace to place the obfuscated names under
      to - The namespace to place the deobfuscated names under
      Throws:
      java.io.IOException - if an I/O error occurs writing the file
      Since:
      3.0.0
    • createReader

      public org.cadixdev.lorenz.io.MappingsReader createReader​(java.nio.file.Path path, java.lang.String from, java.lang.String to) throws java.io.IOException, net.fabricmc.mapping.reader.v2.MappingParseException
      Creates a new mappings reader for the mappings contained by the path supplied.

      The resulting mappings will use the from namespace (as the obfuscated names in Lorenz) to the to namespace (as the de-obfuscated names in Lorenz).

      Parameters:
      path - The path to the Tiny mappings
      from - The namespace to use in the tiny file, as Lorenz's obfuscated names
      to - The namespace to use in the tiny file, as Lorenz's de-obfuscated names
      Returns:
      The mappings reader
      Throws:
      java.io.IOException - if an I/O error occurs opening the file
      net.fabricmc.mapping.reader.v2.MappingParseException
    • read

      public org.cadixdev.lorenz.MappingSet read​(org.cadixdev.lorenz.MappingSet mappings, java.nio.file.Path path, java.lang.String from, java.lang.String to) throws java.io.IOException, net.fabricmc.mapping.reader.v2.MappingParseException
      Reads Tiny mappings from the given path, into the given mapping set.

      The resulting mappings will use the from namespace (as the obfuscated names in Lorenz) to the to namespace (as the de-obfuscated names in Lorenz).

      Parameters:
      mappings - The mapping set to read to
      path - The path to the Tiny mappings
      from - The namespace to use in the tiny file, as Lorenz's obfuscated names
      to - The namespace to use in the tiny file, as Lorenz's de-obfuscated names
      Returns:
      The given mapping set
      Throws:
      java.io.IOException - if an I/O error occurs opening the file
      net.fabricmc.mapping.reader.v2.MappingParseException
    • read

      public org.cadixdev.lorenz.MappingSet read​(java.nio.file.Path path, java.lang.String from, java.lang.String to) throws java.io.IOException, net.fabricmc.mapping.reader.v2.MappingParseException
      Reads Tiny mappings from the given path, into a new mapping set.

      The resulting mappings will use the from namespace (as the obfuscated names in Lorenz) to the to namespace (as the de-obfuscated names in Lorenz).

      Parameters:
      path - The path to the Tiny mappings
      from - The namespace to use in the tiny file, as Lorenz's obfuscated names
      to - The namespace to use in the tiny file, as Lorenz's de-obfuscated names
      Returns:
      The mapping set
      Throws:
      java.io.IOException - if an I/O error occurs opening the file
      net.fabricmc.mapping.reader.v2.MappingParseException