java.lang.Object
gov.nasa.jpl.aerie.contrib.streamline.debugging.Naming

public final class Naming extends Object
Allows anything that uses reference equality to be given a name.

By handling naming in a static auxiliary data structure, we achieve several goals: 1) Naming doesn't bloat interfaces like Resource and DynamicsEffect. 2) Names can be applied to classes and interfaces after-the-fact, including applying names to classes and interfaces that can't be modified, like library code. 3) Naming is nevertheless globally available. (Unlike passing the name in a parallel parameter, for example.)

  • Method Details

    • name

      public static <T> T name(T thing, String nameFormat, Object... args)
      Register a name for thing, as a function of args' names. If any of the args are anonymous, so is this thing.
    • getName

      public static Optional<String> getName(Object thing)
      Get the name for thing. If thing has no registered name and no synonyms, returns empty.
    • getName

      public static String getName(Object thing, String anonymousName)
      Get the name for thing. Use anonymousName for anything without a name instead of returning empty.
    • argsFormat

      public static String argsFormat(Collection<?> collection)