Class UniqueIdFormat

java.lang.Object
org.junit.platform.engine.UniqueIdFormat
All Implemented Interfaces:
Serializable

class UniqueIdFormat extends Object implements Serializable
Used to parse(java.lang.String) a UniqueId from a string representation or to format(org.junit.platform.engine.UniqueId) a UniqueId into a string representation.
Since:
1.0
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • defaultFormat

      private static final UniqueIdFormat defaultFormat
    • openSegment

      private final char openSegment
    • closeSegment

      private final char closeSegment
    • segmentDelimiter

      private final char segmentDelimiter
    • typeValueSeparator

      private final char typeValueSeparator
    • segmentPattern

      private final Pattern segmentPattern
    • encodedCharacterMap

      private final HashMap<Character,String> encodedCharacterMap
  • Constructor Details

    • UniqueIdFormat

      UniqueIdFormat(char openSegment, char typeValueSeparator, char closeSegment, char segmentDelimiter)
  • Method Details

    • getDefault

      static UniqueIdFormat getDefault()
    • quote

      private static String quote(char c)
    • encode

      private static String encode(char c)
    • parse

      UniqueId parse(String source) throws org.junit.platform.commons.JUnitException
      Parse a UniqueId from the supplied string representation.
      Returns:
      a properly constructed UniqueId
      Throws:
      org.junit.platform.commons.JUnitException - if the string cannot be parsed
    • createSegment

      private UniqueId.Segment createSegment(String segmentString) throws org.junit.platform.commons.JUnitException
      Throws:
      org.junit.platform.commons.JUnitException
    • checkAllowed

      private String checkAllowed(String typeOrValue)
    • checkDoesNotContain

      private void checkDoesNotContain(String typeOrValue, char forbiddenCharacter)
    • format

      String format(UniqueId uniqueId)
      Format and return the string representation of the supplied UniqueId.
    • describe

      private String describe(UniqueId.Segment segment)
    • encode

      private String encode(String s)
    • decode

      private static String decode(String s)