Class EdgeConfig.Factory

  • Enclosing class:
    EdgeConfig

    public static class EdgeConfig.Factory
    extends java.lang.Object
    Represents an OpenEMS Component Factory.
    • Constructor Detail

      • Factory

        public Factory​(java.lang.String id,
                       java.lang.String name,
                       java.lang.String description,
                       EdgeConfig.Factory.Property[] properties,
                       java.lang.String[] natureIds)
    • Method Detail

      • create

        public static EdgeConfig.Factory create​(java.lang.String factoryId,
                                                org.osgi.service.metatype.ObjectClassDefinition ocd,
                                                java.lang.String[] natureIds)
        Creates a EdgeConfig.Factory from an ObjectClassDefinition.
        Parameters:
        factoryId - the Factory-ID
        ocd - the ObjectClassDefinition
        natureIds - the Nature-IDs
        Returns:
        a EdgeConfig.Factory
      • getId

        public java.lang.String getId()
        Gets the ID of the EdgeConfig.Factory.
        Returns:
        the ID
      • getName

        public java.lang.String getName()
        Gets the Name of the EdgeConfig.Factory.
        Returns:
        the name
      • getDescription

        public java.lang.String getDescription()
        Gets the Description of the EdgeConfig.Factory.
        Returns:
        the description
      • getProperty

        public java.util.Optional<EdgeConfig.Factory.Property> getProperty​(java.lang.String key)
        Gets the Property with the given key.
        Parameters:
        key - the property key
        Returns:
        the Property
      • getPropertyDefaultValue

        public com.google.gson.JsonElement getPropertyDefaultValue​(java.lang.String propertyId)
        Gets the default value of a property.
        Parameters:
        propertyId - the Property ID
      • getNatureIds

        public java.lang.String[] getNatureIds()
        Gets the Nature-IDs of the EdgeConfig.Factory.
        Returns:
        the Nature-IDs
      • toJson

        public com.google.gson.JsonObject toJson()
        Returns the Factory configuration as a JSON Object.
         {
           natureIds: string[]
         }
         
        Returns:
        configuration as a JSON Object