Private categoryPrivate numberStatic Private Readonly ID_Starts with a letter from CategoryNames and ends with 1-4 digits.
Static Private Readonly MD5_Contains 32 hexadecimal characters.
Static Private Readonly NAME_Starts with "Grammle-" and then the #ID_REGEX.
Static Private Readonly ORDER_Starts with a letter from CategoryNames and ends with 4 digits, but not with 4 zeros.
`(?!0{4})`: Negative lookahead that ensures the number is not 0000 (written by GitHub Copilot)
Sets a new category, but keeps the current number.
true if the category was set successfully
the new category
Sets a new ID and updates the internal #category and #number accordingly.
ID must be in the format <category[0]><UInt>, such as B3 or S10.
true if the ID was set successfully
if the ID is not in the format <category[0]><UInt>
the new ID
Sets a new ID number, but keeps the current category.
true if the number was set successfully
if the number is not an integer in the range 1-9999
the new ID number. Must be an integer in the range 1-9999.
Returns a string representation of the GrammleID in the format
<first category letter><padding zeros><number>,
such as B0003 for Grammle-B3 or S0010 for Grammle-S10.
the orderID as a string
Static fromthe given category
Static fromConstructs a new GrammleID from a given CategoryNames and number.
the new GrammleID
if the ID number is not a positive integer
the category of the new ID
the number of the new ID
Static fromIDConstructs a new GrammleID from a given identification.
the new GrammleID
if the ID is not in the format <category[0]><UInt>
the given identification
Static fromConstructs a new GrammleID from a given rule name.
the new GrammleID
if the name is not in the format Grammle-<category[0]><UInt>
the given rule name
Static fromConstructs a new GrammleID from a given order ID. The order ID is the current ID with padding zeros.
the new GrammleID
if the order ID is not in the format <category[0]><padding zeros><UInt> with number.length == 4
the given order ID
Static getReturns the main category of a given ID. Partly written by GitHub Copilot.
the main category of the ID as a CategoryNames enum value
if the ID is not in the format <category[0]><UInt>
the ID to get the category from
Static getIDRegexStatic getMD5Static getStatic getStatic validateIDStatic validateStatic validateStatic validateUIDChecks whether a given String is an MD5 hash, i.e. a 32-character hexadecimal number. Does NOT check whether the MD5 hash already exists in the MistakeManager.
true if the String is an MD5 hash, false otherwise
the String to check
Generated using TypeDoc
Stores the identification of a Mistake and provides methods to parse it, validate it and convert it to different formats.