Class Node

java.lang.Object
org.drasyl.node.event.Node

public abstract class Node extends Object
Used by Event to describe an event related to the local Node (e.g. NodeUpEvent, NodeOnlineEvent).

This is an immutable object.

  • Constructor Details

    • Node

      public Node()
  • Method Details

    • getIdentity

      public abstract Identity getIdentity()
      Returns the node's identity.
      Returns:
      the node's identity
    • getPort

      public abstract int getPort()
      Returns the node's server port.
      Returns:
      the node's server port
    • getTcpFallbackPort

      public abstract int getTcpFallbackPort()
      Returns the node's tcp fallback server port.
      Returns:
      the node's tcp fallback server port
    • of

      public static Node of(Identity identity)
      Throws:
      NullPointerException - if identity is null
    • of

      public static Node of(Identity identity, int port)
      Throws:
      NullPointerException - if identity is null
      IllegalArgumentException - if port is negative
    • of

      public static Node of(Identity identity, int port, int tcpFallbackPort)
      Throws:
      NullPointerException - if identity is null
      IllegalArgumentException - if port or tcpFallbackPort is negative