Package com.atlassian.sal.api.validate
Class LicenseValidationResult
java.lang.Object
com.atlassian.sal.api.validate.LicenseValidationResult
The outcome of a license validation check for each product key.
- Since:
- 4.2
-
Method Summary
Modifier and TypeMethodDescriptionReturns validation error for each products.Returns validation warnings for each products.booleanReturn true if the validation added error messages.booleanReturn true if the validation added warning messages.booleanisValid()Return true if the validation passed, false if there were errors.static LicenseValidationResultwithErrorAndWarningMessages(Optional<String> productKey, Optional<String> license, Iterable<LicenseValidationError> errorMessages, Iterable<LicenseValidationWarning> warningMessages) static LicenseValidationResultwithErrorMessages(Optional<String> productKey, Optional<String> license, Iterable<LicenseValidationError> errorMessages) static LicenseValidationResultwithValidResult(Optional<String> productKey, Optional<String> license) static LicenseValidationResultwithWarningMessages(Optional<String> productKey, Optional<String> license, Iterable<LicenseValidationWarning> warningMessages)
-
Method Details
-
withErrorMessages
public static LicenseValidationResult withErrorMessages(@Nonnull Optional<String> productKey, @Nonnull Optional<String> license, @Nonnull Iterable<LicenseValidationError> errorMessages) -
withWarningMessages
public static LicenseValidationResult withWarningMessages(@Nonnull Optional<String> productKey, @Nonnull Optional<String> license, @Nonnull Iterable<LicenseValidationWarning> warningMessages) -
withErrorAndWarningMessages
public static LicenseValidationResult withErrorAndWarningMessages(@Nonnull Optional<String> productKey, @Nonnull Optional<String> license, @Nonnull Iterable<LicenseValidationError> errorMessages, @Nonnull Iterable<LicenseValidationWarning> warningMessages) -
withValidResult
-
getProductKey
- Returns:
- product key of this class
-
getLicense
- Returns:
- the raw license String that gets validated. It could be valid or invalid depends on the
isValid()
-
isValid
public boolean isValid()Return true if the validation passed, false if there were errors. (Note warnings do not cause this method to return false).- Returns:
- true if the validation passed, false if there were errors.
- See Also:
-
hasErrors
public boolean hasErrors()Return true if the validation added error messages.- Returns:
- true if the validation failed with error messages.
-
hasWarnings
public boolean hasWarnings()Return true if the validation added warning messages.- Returns:
- true if the validation failed with warning messages.
-
getErrorMessages
Returns validation error for each products.This will never be null, but may be empty.
- Returns:
- validation error messages, could be empty but not null.
-
getWarningMessages
Returns validation warnings for each products.This will never be null, but may be empty.
- Returns:
- validation warning messages, could be empty but not null.
-