Record Class NetworkServiceInfo

java.lang.Object
java.lang.Record
eu.cloudnetservice.modules.bridge.player.NetworkServiceInfo
Record Components:
groups - the groups of the represented service.
serviceId - the service id of the represented service.

public record NetworkServiceInfo(@NonNull Set<String> groups, @NonNull eu.cloudnetservice.driver.service.ServiceId serviceId) extends Record
A network service info represents a small portion of a ServiceInfoSnapshot.
Since:
4.0
See Also:
  • ServiceId
  • Field Details

  • Constructor Details

    • NetworkServiceInfo

      public NetworkServiceInfo(@NonNull @NonNull Set<String> groups, @NonNull @NonNull eu.cloudnetservice.driver.service.ServiceId serviceId)
      Creates an instance of a NetworkServiceInfo record class.
      Parameters:
      groups - the value for the groups record component
      serviceId - the value for the serviceId record component
  • Method Details

    • fromServiceInfoSnapshot

      @NonNull public static @NonNull NetworkServiceInfo fromServiceInfoSnapshot(@NonNull @NonNull eu.cloudnetservice.driver.service.ServiceInfoSnapshot snapshot)
      Creates a new network service info with groups and the service id from the given service.
      Parameters:
      snapshot - the snapshot to create a network service from.
      Returns:
      the new network service info for the given service info.
      Throws:
      NullPointerException - if the given snapshot is null.
    • environment

      @NonNull public @NonNull eu.cloudnetservice.driver.service.ServiceEnvironmentType environment()
      Gets the environment of the given service from the given service id.
      Returns:
      the environment of the service.
      See Also:
      • ServiceId.environment()
    • uniqueId

      @NonNull public @NonNull UUID uniqueId()
      Gets the unique id of the given service from the given service id.
      Returns:
      the unique id of the service.
      See Also:
      • ServiceId.uniqueId()
    • serverName

      @NonNull public @NonNull String serverName()
      Gets the name of the given service from the given service id.
      Returns:
      the name of the given service.
      See Also:
      • ServiceId.name()
    • taskName

      @NonNull public @NonNull String taskName()
      Gets the name of the task the given service is associated with.
      Returns:
      the task name of the given service.
      See Also:
      • ServiceId.taskName()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • groups

      @NonNull public @NonNull Set<String> groups()
      Returns the value of the groups record component.
      Returns:
      the value of the groups record component
    • serviceId

      @NonNull public @NonNull eu.cloudnetservice.driver.service.ServiceId serviceId()
      Returns the value of the serviceId record component.
      Returns:
      the value of the serviceId record component