Class EdgeConfig.Component

  • Enclosing class:
    EdgeConfig

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

      • Component

        public Component​(java.lang.String servicePid,
                         java.lang.String id,
                         java.lang.String alias,
                         java.lang.String factoryId,
                         java.util.TreeMap<java.lang.String,​com.google.gson.JsonElement> properties,
                         java.util.TreeMap<java.lang.String,​EdgeConfig.Component.Channel> channels)
    • Method Detail

      • getPid

        public java.lang.String getPid()
      • getId

        public java.lang.String getId()
      • getAlias

        public java.lang.String getAlias()
      • getFactoryId

        public java.lang.String getFactoryId()
      • getProperties

        public java.util.Map<java.lang.String,​com.google.gson.JsonElement> getProperties()
      • getProperty

        public java.util.Optional<com.google.gson.JsonElement> getProperty​(java.lang.String propertyId)
      • isStateChannel

        public boolean isStateChannel​(java.lang.String channelId)
        Is the given Channel-ID a StateChannel?.
        Parameters:
        channelId - the Channel-ID
        Returns:
        true if it is a StateChannel
      • getStateChannel

        public java.util.Optional<EdgeConfig.Component.Channel> getStateChannel​(java.lang.String channelId)
        Get the StateChannel with the given Channel-ID.
        Parameters:
        channelId - the Channel-ID
        Returns:
        the Channel; or empty if the Channel does not exist or is not a StateChannel.
      • toJson

        public com.google.gson.JsonObject toJson​(EdgeConfig.Component.JsonFormat jsonFormat)
        Returns the Component configuration as a JSON Object.
         {
           alias: string,
           factoryId: string,
                 properties: {
             [key: string]: value
           },
           channels: {
             [channelId: string]: {}
           }
         }
         
        Parameters:
        jsonFormat - the EdgeConfig.Component.JsonFormat
        Returns:
        configuration as a JSON Object