Interface BinaryServiceDescriptor<T>

  • Type Parameters:
    T - the type of the value provided by the described service
    All Superinterfaces:
    ServiceDescriptor<T>
    All Known Subinterfaces:
    BinaryServiceDescriptor.Provider<T>

    public interface BinaryServiceDescriptor<T>
    extends ServiceDescriptor<T>
    Describes a service by its name, provided value type, and dynamic name resolution mechanism.
    Author:
    Paul Ferraro
    • Method Detail

      • resolve

        default Map.Entry<String,​String[]> resolve​(String parent,
                                                         String child)
        Resolves the dynamic name of the service using the specified segments.
        Parameters:
        parent - the first dynamic segment
        child - the second dynamic segment
        Returns:
        a tuple containing the resolved name and dynamic segments
      • asType

        default <U extends TBinaryServiceDescriptor<U> asType​(Class<U> type)
        Description copied from interface: ServiceDescriptor
        Returns a sub-class view of this service descriptor.
        Specified by:
        asType in interface ServiceDescriptor<T>
        Type Parameters:
        U - the subclass type
        Parameters:
        type - a sub-class of this descriptor's type
        Returns:
        a sub-class view of this service descriptor.
      • of

        static <T> BinaryServiceDescriptor<T> of​(String name,
                                                 Class<T> type)
        Creates a binary service descriptor with the specified name and type.
        Type Parameters:
        T - the service type
        Parameters:
        name - the service name
        type - the service type
        Returns:
        a service descriptor
      • of

        static <T> BinaryServiceDescriptor<T> of​(String name,
                                                 UnaryServiceDescriptor<T> defaultDescriptor)
        Creates a binary service descriptor with the specified name and default descriptor.
        Type Parameters:
        T - the service type
        Parameters:
        name - the service name
        defaultDescriptor - the service descriptor used to resolve an undefined dynamic child name
        Returns:
        a service descriptor