Class DecoratedName

java.lang.Object
org.ek9lang.compiler.support.DecoratedName
All Implemented Interfaces:
Function<InternalNameDetails, String>

public class DecoratedName extends Object implements Function<InternalNameDetails, String>
Useful function that generates the decorated/internal name for generic types that have been parameterized. Uses a mix of fully qualified and basic names and then a hashing function.

Note that this also has a 'main' entry point so that it can be used by developers when looking to create parameterised generic types.

So to produce 'List of String' for example, the Java command line is as follows (from the project root):

  java -cp ./compiler-main/target/classes
  org.ek9lang.compiler.support.DecoratedName List org.ek9.lang::List org.ek9.lang::String
  # Response will be
  _List_8F118296CF271EAEB58F9D4B4FDDDB2DA7B80C13BF342D8C4A916D54EBB208E1

To product a Dict of (String, String) for example: the java command line would be:

  java -cp ./compiler-main/target/classes
  org.ek9lang.compiler.support.DecoratedName Dict org.ek9.lang::Dict org.ek9.lang::String org.ek9.lang::String
  #Response will be
  _Dict_E9A1EFF0D62E8EB35F7B0572E7F2C5492D6C980FE8B69376B38612DE6EBEC25F

For Dict of (String, Integer) it would be:

  java -cp ./compiler-main/target/classes
  org.ek9lang.compiler.support.DecoratedName Dict org.ek9.lang::Dict org.ek9.lang::String org.ek9.lang::Integer
  _Dict_7E7710D38A91EC202D64601DF4D9FB5B4AF2026CC3EF59394F5CF6B738812BB6