checkDomain

@JvmStatic
fun checkDomain(domain: String?): String?(source)

Checks a String for validity of use as a Logger.domain value. This provides a uniform standard for all Log implementations to rely on.

A valid domain is either null, or complies with the following parameters:

  • Is greater than or equal to 3 characters in length.

  • Is less than or equal to 32 characters in length.

  • Contains only the following:

    • Characters 0 - 9

    • Characters a - z

    • Separators ., -, :

  • Does not start or end with a separator character.

    • e.g. Invalid >>.my.domain

    • e.g. Invalid >>my.domain.

  • Contains at least 1 separator character.

    • e.g. Invalid >>mydomain

  • Separator characters do not precede or follow another separator character.

    • e.g. Invalid >>my.:domain

Return

The domain

Throws

IllegalArgumentException

If domain is invalid.