Package org.junit.platform.engine
Class UniqueIdFormat
- java.lang.Object
-
- org.junit.platform.engine.UniqueIdFormat
-
- All Implemented Interfaces:
java.io.Serializable
class UniqueIdFormat extends java.lang.Object implements java.io.Serializable
Used toparse(java.lang.String)
aUniqueId
from a string representation or toformat(org.junit.platform.engine.UniqueId)
aUniqueId
into a string representation.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private char
closeSegment
private static UniqueIdFormat
defaultFormat
private java.util.HashMap<java.lang.Character,java.lang.String>
encodedCharacterMap
private char
openSegment
private char
segmentDelimiter
private java.util.regex.Pattern
segmentPattern
private static long
serialVersionUID
private char
typeValueSeparator
-
Constructor Summary
Constructors Constructor Description UniqueIdFormat(char openSegment, char typeValueSeparator, char closeSegment, char segmentDelimiter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
checkAllowed(java.lang.String typeOrValue)
private void
checkDoesNotContain(java.lang.String typeOrValue, char forbiddenCharacter)
private UniqueId.Segment
createSegment(java.lang.String segmentString)
private static java.lang.String
decode(java.lang.String s)
private java.lang.String
describe(UniqueId.Segment segment)
private static java.lang.String
encode(char c)
private java.lang.String
encode(java.lang.String s)
(package private) java.lang.String
format(UniqueId uniqueId)
Format and return the string representation of the suppliedUniqueId
.(package private) static UniqueIdFormat
getDefault()
(package private) UniqueId
parse(java.lang.String source)
Parse aUniqueId
from the supplied string representation.private static java.lang.String
quote(char c)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
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 java.util.regex.Pattern segmentPattern
-
encodedCharacterMap
private final java.util.HashMap<java.lang.Character,java.lang.String> encodedCharacterMap
-
-
Method Detail
-
getDefault
static UniqueIdFormat getDefault()
-
quote
private static java.lang.String quote(char c)
-
encode
private static java.lang.String encode(char c)
-
parse
UniqueId parse(java.lang.String source) throws JUnitException
Parse aUniqueId
from the supplied string representation.- Returns:
- a properly constructed
UniqueId
- Throws:
JUnitException
- if the string cannot be parsed
-
createSegment
private UniqueId.Segment createSegment(java.lang.String segmentString) throws JUnitException
- Throws:
JUnitException
-
checkAllowed
private java.lang.String checkAllowed(java.lang.String typeOrValue)
-
checkDoesNotContain
private void checkDoesNotContain(java.lang.String typeOrValue, char forbiddenCharacter)
-
format
java.lang.String format(UniqueId uniqueId)
Format and return the string representation of the suppliedUniqueId
.
-
describe
private java.lang.String describe(UniqueId.Segment segment)
-
encode
private java.lang.String encode(java.lang.String s)
-
decode
private static java.lang.String decode(java.lang.String s)
-
-