Package io.openems.common.types
Class EdgeConfig.Factory.Property
java.lang.Object
io.openems.common.types.EdgeConfig.Factory.Property
- Enclosing class:
- EdgeConfig.Factory
Represents a configuration option of an OpenEMS Component Factory.
-
Constructor Summary
ConstructorsConstructorDescriptionProperty
(String id, String name, String description, OpenemsType type, boolean isRequired, boolean isPassword, com.google.gson.JsonElement defaultValue, com.google.gson.JsonObject schema) -
Method Summary
Modifier and TypeMethodDescriptionstatic EdgeConfig.Factory.Property
from
(org.osgi.service.metatype.AttributeDefinition ad) Creates aEdgeConfig.Factory.Property
from anAttributeDefinition
.static EdgeConfig.Factory.Property
fromJson
(com.google.gson.JsonElement json) Creates a Property from JSON.com.google.gson.JsonElement
Gets the default value of the Property.Gets the Description of theEdgeConfig.Factory.Property
.getId()
Gets the ID of theEdgeConfig.Factory.Property
.getName()
Gets the Name of theEdgeConfig.Factory.Property
.getType()
Gets theOpenemsType
of theEdgeConfig.Factory.Property
.boolean
Does this Property represent a password?.boolean
Is this Property required?.com.google.gson.JsonObject
toJson()
Returns the Factory Property as a JSON Object.
-
Constructor Details
-
Property
public Property(String id, String name, String description, OpenemsType type, boolean isRequired, boolean isPassword, com.google.gson.JsonElement defaultValue, com.google.gson.JsonObject schema)
-
-
Method Details
-
from
Creates aEdgeConfig.Factory.Property
from anAttributeDefinition
.- Parameters:
ad
- theAttributeDefinition
- Returns:
- the
EdgeConfig.Factory.Property
-
fromJson
public static EdgeConfig.Factory.Property fromJson(com.google.gson.JsonElement json) throws OpenemsError.OpenemsNamedException Creates a Property from JSON.- Parameters:
json
- the JSON- Returns:
- the Property
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
toJson
public com.google.gson.JsonObject toJson()Returns the Factory Property as a JSON Object.{ id: string, name: string, description: string, isOptional: boolean, isPassword: boolean, defaultValue: any, schema: { type: string } }
- Returns:
- property as a JSON Object
-
getId
Gets the ID of theEdgeConfig.Factory.Property
.- Returns:
- the Property-ID
-
getName
Gets the Name of theEdgeConfig.Factory.Property
.- Returns:
- the Name
-
getDescription
Gets the Description of theEdgeConfig.Factory.Property
.- Returns:
- the Description
-
getType
Gets theOpenemsType
of theEdgeConfig.Factory.Property
.- Returns:
- the
OpenemsType
-
isPassword
public boolean isPassword()Does this Property represent a password?.- Returns:
- true if it is a password
-
isRequired
public boolean isRequired()Is this Property required?.- Returns:
- true if it is required
-
getDefaultValue
public com.google.gson.JsonElement getDefaultValue()Gets the default value of the Property.- Returns:
- the default value
-