Package uk.num.validators
Class NumUriValidator
- java.lang.Object
-
- uk.num.validators.NumUriValidator
-
public class NumUriValidator extends java.lang.ObjectFull validation of NUM URIs
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNUM_PROTOCOL_PREFIXThe expected NUM protocol prefix is present.static java.lang.StringPROTOCOL_SEPARATORUsed to detect whether a URI includes the protocol or not.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ValidationResultvalidate(@NonNull java.lang.String domain, int moduleNumber, @NonNull java.lang.String path)Build a NUM URI from the parts and validate it.static ValidationResultvalidate(java.lang.String uri)Fully validate a NUM URI, including checks to make sure that the independent and hosted domain names are within the maximum length of a domain name.
-
-
-
Field Detail
-
PROTOCOL_SEPARATOR
public static final java.lang.String PROTOCOL_SEPARATOR
Used to detect whether a URI includes the protocol or not.- See Also:
- Constant Field Values
-
NUM_PROTOCOL_PREFIX
public static final java.lang.String NUM_PROTOCOL_PREFIX
The expected NUM protocol prefix is present. Defaults to this if not present.- See Also:
- Constant Field Values
-
-
Method Detail
-
validate
public static ValidationResult validate(@NonNull @NonNull java.lang.String domain, int moduleNumber, @NonNull @NonNull java.lang.String path)
Build a NUM URI from the parts and validate it.- Parameters:
domain- a non-null domain StringmoduleNumber- a non-negative module number intpath- a non-null path String- Returns:
- ValidationResult
-
validate
public static ValidationResult validate(java.lang.String uri)
Fully validate a NUM URI, including checks to make sure that the independent and hosted domain names are within the maximum length of a domain name.Uses the other validators to help.
- Parameters:
uri- String- Returns:
- ValidationResult
-
-