Package io.openems.edge.core.appmanager
Class AbstractEnumOpenemsApp<PROPERTY extends Enum<PROPERTY> & Nameable>
java.lang.Object
io.openems.edge.core.appmanager.AbstractOpenemsApp<PROPERTY>
io.openems.edge.core.appmanager.AbstractEnumOpenemsApp<PROPERTY>
- All Implemented Interfaces:
ComponentManagerSupplier
,ComponentUtilSupplier
,OpenemsApp
- Direct Known Subclasses:
AbstractMeterApp
,AbstractPvInverter
,GridOptimizedCharge
,MqttApi
,RestJsonApiReadWrite
,SelfConsumptionOptimization
public abstract class AbstractEnumOpenemsApp<PROPERTY extends Enum<PROPERTY> & Nameable>
extends AbstractOpenemsApp<PROPERTY>
-
Field Summary
Fields inherited from class io.openems.edge.core.appmanager.AbstractOpenemsApp
cm, componentContext, componentManager, componentUtil
Fields inherited from interface io.openems.edge.core.appmanager.OpenemsApp
FALLBACK_IMAGE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractEnumOpenemsApp
(ComponentManager componentManager, org.osgi.service.component.ComponentContext componentContext, org.osgi.service.cm.ConfigurationAdmin cm, ComponentUtil componentUtil) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ThrowingTriFunction<ConfigurationTarget,
EnumMap<PROPERTY, com.google.gson.JsonElement>, Language, AppConfiguration, OpenemsError.OpenemsNamedException> protected ThrowingTriFunction<ConfigurationTarget,
Map<PROPERTY, com.google.gson.JsonElement>, Language, AppConfiguration, OpenemsError.OpenemsNamedException> Provides a factory forAppConfigurations
.protected String
getId
(ConfigurationTarget t, Map<PROPERTY, com.google.gson.JsonElement> map, DefaultEnum key) Gets the id of the map with the given DefaultEnumprotected String
getValueOrDefault
(EnumMap<PROPERTY, com.google.gson.JsonElement> map, DefaultEnum property) Gets the value of the property name in the map or the defaulValue if the property was not found.protected PROPERTY[]
Methods inherited from class io.openems.edge.core.appmanager.AbstractOpenemsApp
base64OfImage, createResourceBundle, fillUpProperties, getAppAssistant, getAppAssistant, getAppConfiguration, getAppId, getAppPermissions, getComponentManager, getComponentUtil, getComponentWithFactoryId, getId, getImage, getName, getNullableTranslation, getProperties, getPropertyByName, getShortName, getTranslation, getTranslationBundle, getValidateBuilder, getValidatorConfig, getValueOrDefault, hasProperty, installationValidation
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.openems.edge.core.appmanager.OpenemsApp
flags, getAppDescriptor, getCardinality, getCategories
-
Constructor Details
-
AbstractEnumOpenemsApp
protected AbstractEnumOpenemsApp(ComponentManager componentManager, org.osgi.service.component.ComponentContext componentContext, org.osgi.service.cm.ConfigurationAdmin cm, ComponentUtil componentUtil)
-
-
Method Details
-
appConfigurationFactory
protected abstract ThrowingTriFunction<ConfigurationTarget,EnumMap<PROPERTY, appConfigurationFactory()com.google.gson.JsonElement>, Language, AppConfiguration, OpenemsError.OpenemsNamedException> -
appPropertyConfigurationFactory
protected ThrowingTriFunction<ConfigurationTarget,Map<PROPERTY, appPropertyConfigurationFactory()com.google.gson.JsonElement>, Language, AppConfiguration, OpenemsError.OpenemsNamedException> Description copied from class:AbstractOpenemsApp
Provides a factory forAppConfigurations
.- Specified by:
appPropertyConfigurationFactory
in classAbstractOpenemsApp<PROPERTY extends Enum<PROPERTY> & Nameable>
- Returns:
- a
ThrowingFunction
that creates aAppConfiguration
from aMap
of configuration properties for a givenConfigurationTarget
in the specified language.
-
propertyValues
- Specified by:
propertyValues
in classAbstractOpenemsApp<PROPERTY extends Enum<PROPERTY> & Nameable>
-
getId
protected String getId(ConfigurationTarget t, Map<PROPERTY, com.google.gson.JsonElement> map, DefaultEnum key) Gets the id of the map with the given DefaultEnume. g. defaultValue: "ess0" => the next available id with the base-name "ess" and the the next available number
- Parameters:
t
- the configuration targetmap
- the configuration mapkey
- the key to be searched for- Returns:
- the found id
-
getValueOrDefault
protected String getValueOrDefault(EnumMap<PROPERTY, com.google.gson.JsonElement> map, DefaultEnum property) Gets the value of the property name in the map or the defaulValue if the property was not found.- Parameters:
map
- the configuration mapproperty
- the property to be searched for- Returns:
- the String value
-
getPropertyClass
-