Interface Validator
- All Known Implementing Classes:
ValidatorImpl
public interface Validator
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
checkStatus
(OpenemsApp openemsApp, Language language) Checks the current status of anOpenemsApp
and throws an exception if the app can not be installed.getErrorCompatibleMessages
(ValidatorConfig config, Language language) Gets the error messages for compatibility.getErrorInstallableMessages
(ValidatorConfig config, Language language) Gets the error messages for installation.getErrorMessages
(List<ValidatorConfig.CheckableConfig> checkableConfigs, Language language, boolean returnImmediate) Gets the error messages for the givenCheckable
.default OpenemsAppStatus
getStatus
(ValidatorConfig config) Validates theCheckable
s and gets the Status.default com.google.gson.JsonObject
toJsonObject
(ValidatorConfig config, Language language) Builds aJsonObject
out of the givenValidatorConfig
.
-
Method Details
-
getErrorCompatibleMessages
Gets the error messages for compatibility.- Parameters:
config
- the config that gets validatedlanguage
- the language of the errors- Returns:
- the error messages
-
getErrorInstallableMessages
Gets the error messages for installation.- Parameters:
config
- the config that gets validatedlanguage
- the language of the errors- Returns:
- the error messages
-
getStatus
Validates theCheckable
s and gets the Status.- Parameters:
config
- the config that gets validated- Returns:
- the Status
-
toJsonObject
Builds aJsonObject
out of the givenValidatorConfig
.- Parameters:
config
- the config that gets validatedlanguage
- the language of the errors- Returns:
- the
JsonObject
-
getErrorMessages
List<String> getErrorMessages(List<ValidatorConfig.CheckableConfig> checkableConfigs, Language language, boolean returnImmediate) Gets the error messages for the givenCheckable
.- Parameters:
checkableConfigs
- theCheckable
s to be checked.language
- the language of the errorsreturnImmediate
- after the first checkable who returns false- Returns:
- a list of errors
-
checkStatus
default void checkStatus(OpenemsApp openemsApp, Language language) throws OpenemsError.OpenemsNamedException Checks the current status of anOpenemsApp
and throws an exception if the app can not be installed.- Parameters:
openemsApp
- theOpenemsApp
to checklanguage
- the currentLanguage
- Throws:
OpenemsError.OpenemsNamedException
- on status error
-