Interface DecodedResource<R>

All Known Implementing Classes:
DecodedResourceImpl

public interface DecodedResource<R>
Represents a Resource whose configuration contents have been successfully decoded using the resource's ResourceCodec.decode(Resource) method.

Typically, this means that the resource's config.json file was successfully deserialized.

An optional "backup" config object may also be present, using the file backupConfig.json. If present, this backup config object will be used when the gateway's redundancy role is NodeRole.Backup.

  • Method Details

    • resource

      Resource resource()
      Returns:
      direct access to the Resource itself. This is useful because the Resource contains the name, enabled bit, description, and any other data files that may be associated with the resource.
    • config

      R config()
      Returns:
      the decoded configuration object, which is the result of deserializing the resource's config.json data file.
    • backupConfig

      Optional<R> backupConfig()
      An optional alternate copy of the config object, to be used if the gateway's redundancy NodeRole = Backup
    • name

      default String name()
      Returns:
      the name of the resource, a shortcut for resource().getResourceName()
    • description

      @Nullable default String description()
      Returns:
      the description of the resource, a shortcut for resource().getDocumentation()
    • enabled

      default boolean enabled()
      Returns:
      the enabled status of the resource, a shortcut for ResourceUtil.isEnabled(resource)