Enum TransportStrategy

java.lang.Object
java.lang.Enum<TransportStrategy>
com.codename1.nearby.transport.TransportStrategy
All Implemented Interfaces:
Comparable<TransportStrategy>

public enum TransportStrategy extends Enum<TransportStrategy>
The connection topology a transport session uses. The platforms trade bandwidth against the number of simultaneous links, and this is where an app says which side of that trade it wants.
  • Enum Constant Details

    • CLUSTER

      public static final TransportStrategy CLUSTER
      Many-to-many: every device may connect to every other. The most flexible and the slowest per link. Android Strategy.P2P_CLUSTER; the natural fit for MultipeerConnectivity, which is a mesh by nature.
    • STAR

      public static final TransportStrategy STAR
      One advertiser, many discoverers. The advertiser accepts several connections and each discoverer holds exactly one. Android Strategy.P2P_STAR.
    • POINT_TO_POINT

      public static final TransportStrategy POINT_TO_POINT
      Exactly one connection on each side, and the highest bandwidth of the three. Android Strategy.P2P_POINT_TO_POINT.
  • Method Details

    • values

      public static TransportStrategy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static TransportStrategy valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null