Class NetworkConnection.ConnectionType

  • Enclosing interface:
    NetworkConnection

    public static class NetworkConnection.ConnectionType
    extends java.lang.Object
    ConnectionType is a bitmask to represent a device's network connection
     Data  | WIFI | Airplane
     0       0      1         == 1
     1       1      0         == 6
     1       0      0         == 4
     0       1      0         == 2
     0       0      0         == 0
     

    Giving "Data" the first bit positions in order to give room for the future of enabling specific types of data (Edge / 2G, 3G, 4G, LTE, etc) if the device allows it.

    • Constructor Detail

      • ConnectionType

        public ConnectionType​(java.lang.Boolean wifi,
                              java.lang.Boolean data,
                              java.lang.Boolean airplaneMode)
      • ConnectionType

        public ConnectionType​(int mask)
    • Method Detail

      • isAirplaneMode

        public java.lang.Boolean isAirplaneMode()
      • isWifiEnabled

        public java.lang.Boolean isWifiEnabled()
      • isDataEnabled

        public java.lang.Boolean isDataEnabled()
      • equals

        public boolean equals​(java.lang.Object type)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toJson

        public java.lang.Integer toJson()