Class Network

java.lang.Object
org.stellar.sdk.Network

public class Network extends Object
Network class is used to specify which Stellar network you want to use. Each network has a networkPassphrase which is hashed to every transaction id.
  • Field Details

    • PUBLIC

      public static final Network PUBLIC
    • TESTNET

      public static final Network TESTNET
    • FUTURENET

      public static final Network FUTURENET
    • STANDALONE

      public static final Network STANDALONE
    • SANDBOX

      public static final Network SANDBOX
  • Constructor Details

    • Network

      public Network(@NonNull @NonNull String networkPassphrase)
      Creates a new Network object to represent a network with a given passphrase
      Parameters:
      networkPassphrase - The network passphrase
  • Method Details

    • getNetworkId

      public byte[] getNetworkId()
      Returns network id (SHA-256 hashed networkPassphrase).
      Returns:
      network id
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getNetworkPassphrase

      @NonNull public @NonNull String getNetworkPassphrase()
      The network passphrase
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object