Class ConnectionMethod

    • Constructor Detail

      • ConnectionMethod

        public ConnectionMethod()
    • Method Detail

      • combine

        @NonNull
        public static java.util.List<ConnectionMethod> combine​(@NonNull
                                                               java.util.List<ConnectionMethod> connectionMethods)
        Combines connection methods.

        Given a list of connection methods, produce a list where similar methods are combined into a single one. This is currently only applicable for BLE and one requirement is that all method instances share the same UUID. If this is not the case, IllegalArgumentException is thrown.

        This is the reverse of disambiguate(List).

        Parameters:
        connectionMethods - a list of connection methods.
        Returns:
        the given list of connection methods where similar methods are combined into one.
        Throws:
        java.lang.IllegalArgumentException - if some methods couldn't be combined
      • disambiguate

        @NonNull
        public static java.util.List<ConnectionMethod> disambiguate​(@NonNull
                                                                    java.util.List<ConnectionMethod> connectionMethods)
        Disambiguates a list of connection methods.

        Given a list of connection methods, produce a list where each method represents exactly one connectable endpoint. For example, for BLE if both central client mode and peripheral server mode is set, replaces this with two connection methods so it's clear which one is which.

        This is the reverse of combine(List).

        Parameters:
        connectionMethods - a list of connection methods.
        Returns:
        the given list of connection methods where each instance is unambiguously refers to one and only one connectable endpoint.
      • createDataTransport

        @NonNull
        public abstract DataTransport createDataTransport​(@NonNull
                                                          android.content.Context context,
                                                          int role,
                                                          @NonNull
                                                          DataTransportOptions options)
        Creates a new DataTransport-derived instance for the given type of ConnectionMethod.
        Parameters:
        context - application context.
        role - whether the transport will be used by the mdoc or mdoc reader.
        options - options for configuring the created instance.
        Returns:
        A DataTransport-derived instance configured with the given options.
        Throws:
        java.lang.IllegalArgumentException - if the connection-method has invalid options specified.