Class DynMethods.Builder

  • Enclosing class:
    DynMethods

    public static class DynMethods.Builder
    extends Object
    • Constructor Detail

      • Builder

        public Builder​(String methodName)
    • Method Detail

      • loader

        public DynMethods.Builder loader​(ClassLoader loader)
        Set the ClassLoader used to lookup classes by name.

        If not set, the current thread's ClassLoader is used.

        Parameters:
        loader - a ClassLoader
        Returns:
        this Builder for method chaining
      • orNoop

        public DynMethods.Builder orNoop()
        If no implementation has been found, adds a NOOP method. Note: calls to impl will not match after this method is called!
        Returns:
        this Builder for method chaining
      • impl

        public DynMethods.Builder impl​(String className,
                                       String methodName,
                                       Class<?>... argClasses)
        Checks for an implementation, first finding the given class by name.
        Parameters:
        className - name of a class
        methodName - name of a method (different from constructor)
        argClasses - argument classes for the method
        Returns:
        this Builder for method chaining
      • impl

        public DynMethods.Builder impl​(String className,
                                       Class<?>... argClasses)
        Checks for an implementation, first finding the given class by name. The name passed to the constructor is the method name used.
        Parameters:
        className - name of a class
        argClasses - argument classes for the method
        Returns:
        this Builder for method chaining
      • impl

        public DynMethods.Builder impl​(Class<?> targetClass,
                                       String methodName,
                                       Class<?>... argClasses)
        Checks for a method implementation.
        Parameters:
        targetClass - the class to check for an implementation
        methodName - name of a method (different from constructor)
        argClasses - argument classes for the method
        Returns:
        this Builder for method chaining
      • impl

        public DynMethods.Builder impl​(Class<?> targetClass,
                                       Class<?>... argClasses)
        Checks for a method implementation. The name passed to the constructor is the method name used.
        Parameters:
        targetClass - the class to check for an implementation
        argClasses - argument classes for the method
        Returns:
        this Builder for method chaining
      • hiddenImpl

        public DynMethods.Builder hiddenImpl​(String className,
                                             String methodName,
                                             Class<?>... argClasses)
        Checks for an implementation, first finding the given class by name.
        Parameters:
        className - name of a class
        methodName - name of a method (different from constructor)
        argClasses - argument classes for the method
        Returns:
        this Builder for method chaining
      • hiddenImpl

        public DynMethods.Builder hiddenImpl​(String className,
                                             Class<?>... argClasses)
        Checks for an implementation, first finding the given class by name. The name passed to the constructor is the method name used.
        Parameters:
        className - name of a class
        argClasses - argument classes for the method
        Returns:
        this Builder for method chaining
      • hiddenImpl

        public DynMethods.Builder hiddenImpl​(Class<?> targetClass,
                                             String methodName,
                                             Class<?>... argClasses)
        Checks for a method implementation.
        Parameters:
        targetClass - the class to check for an implementation
        methodName - name of a method (different from constructor)
        argClasses - argument classes for the method
        Returns:
        this Builder for method chaining
      • hiddenImpl

        public DynMethods.Builder hiddenImpl​(Class<?> targetClass,
                                             Class<?>... argClasses)
        Checks for a method implementation. The name passed to the constructor is the method name used.
        Parameters:
        targetClass - the class to check for an implementation
        argClasses - argument classes for the method
        Returns:
        this Builder for method chaining