Package org.drasyl.node.event
Class Node
- java.lang.Object
-
- org.drasyl.node.event.Node
-
public abstract class Node extends Object
Used byEvent
to describe an event related to the local Node (e.g.NodeUpEvent
,NodeOnlineEvent
).This is an immutable object.
-
-
Constructor Summary
Constructors Constructor Description Node()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Identity
getIdentity()
Returns the node's identity.abstract int
getPort()
Returns the node's server port.abstract int
getTcpFallbackPort()
Returns the node's tcp fallback server port.static Node
of(Identity identity)
static Node
of(Identity identity, int port)
static Node
of(Identity identity, int port, int tcpFallbackPort)
-
-
-
Method Detail
-
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
- ifidentity
isnull
-
of
public static Node of(Identity identity, int port)
- Throws:
NullPointerException
- ifidentity
isnull
IllegalArgumentException
- ifport
is negative
-
of
public static Node of(Identity identity, int port, int tcpFallbackPort)
- Throws:
NullPointerException
- ifidentity
isnull
IllegalArgumentException
- ifport
ortcpFallbackPort
is negative
-
-