Class DriverEnvironment

java.lang.Object
eu.cloudnetservice.driver.DriverEnvironment
All Implemented Interfaces:
eu.cloudnetservice.common.document.property.DefaultedDocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,DriverEnvironment>, eu.cloudnetservice.common.document.property.DocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,DriverEnvironment>, eu.cloudnetservice.common.Nameable

public final class DriverEnvironment extends Object implements eu.cloudnetservice.common.document.property.DefaultedDocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,DriverEnvironment>, eu.cloudnetservice.common.Nameable
Represents the current environment in which the driver is running. There are currently two default environments, the node and wrapper which are statically represented in this class.

A driver environment can hold additional information in its json properties, these are however never persisted anywhere.

Since:
4.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
     
    static final DriverEnvironment
    The jvm-static representation of the node environment.
    private final eu.cloudnetservice.common.document.gson.JsonDocument
     
    static final DriverEnvironment
    The jvm-static representation of the wrapper environment.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DriverEnvironment(@NonNull String name, @NonNull eu.cloudnetservice.common.document.gson.JsonDocument properties)
    Constructs a new driver environment instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull eu.cloudnetservice.common.document.gson.JsonDocument

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface eu.cloudnetservice.common.document.property.DefaultedDocPropertyHolder

    propertyAbsent, propertyPresent, readProperty, readPropertyOrDefault, readPropertyOrGet, readPropertyOrThrow, readPropertyOrThrow, removeProperty, writeProperty, writePropertyIfAbsent, writePropertyIfAbsent, writePropertyIfPresent, writePropertyIfPresent
  • Field Details

    • NODE

      public static final DriverEnvironment NODE
      The jvm-static representation of the node environment.
    • WRAPPER

      public static final DriverEnvironment WRAPPER
      The jvm-static representation of the wrapper environment.
    • name

      private final String name
    • properties

      private final eu.cloudnetservice.common.document.gson.JsonDocument properties
  • Constructor Details

    • DriverEnvironment

      public DriverEnvironment(@NonNull @NonNull String name, @NonNull @NonNull eu.cloudnetservice.common.document.gson.JsonDocument properties)
      Constructs a new driver environment instance.
      Parameters:
      name - the name of the environment.
      properties - the properties of the environment.
      Throws:
      NullPointerException - if the given name or properties are null.
  • Method Details

    • name

      @NonNull public @NonNull String name()
      Specified by:
      name in interface eu.cloudnetservice.common.Nameable
    • propertyHolder

      @NonNull public @NonNull eu.cloudnetservice.common.document.gson.JsonDocument propertyHolder()
      Specified by:
      propertyHolder in interface eu.cloudnetservice.common.document.property.DocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,DriverEnvironment>