Class DittoConnection

java.lang.Object
com.ditto.java.DittoConnection

public final class DittoConnection extends Object
Represents a connection between two peers in a Ditto mesh network.
  • Method Details

    • getId

      public @NonNull String getId()
      Returns the connection ID. This ID is deterministic for any two peers and a given connection type.
      Returns:
      the connection ID string.
    • getPeer1Key

      public @NonNull String getPeer1Key()
      Returns the peer key of the peer at one end of the connection. The assignment to getPeer1Key() and getPeer2Key() is deterministic and stable for any two peers.
      Returns:
      the peer key string.
    • getPeer2Key

      public @NonNull String getPeer2Key()
      Returns the peer key of the peer at the other end of the connection. The assignment to getPeer1Key() and getPeer2Key() is deterministic and stable for any two peers.
      Returns:
      the peer key string.
    • getConnectionType

      public @NonNull DittoConnectionType getConnectionType()
      Returns the type of transport enabling this connection.
      Returns:
      the DittoConnectionType for this connection.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object