Skip navigation links
net.gdface.utils

Class InterfaceDecorator<I,T>

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected T delegate 
    • Constructor Summary

      Constructors 
      Constructor and Description
      InterfaceDecorator(java.lang.Class<I> interfaceClass, T delegate)
      构造方法
      InterfaceDecorator(T delegate)
      简化版构造函数
      当delegate只实现了一个接口时,自动推断接口类型
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      T delegate() 
      java.lang.Class<I> getInterfaceClass()
      返回代理的接口类
      java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) 
      I proxyInstance()
      根据当前对象创建新的接口实例Proxy
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InterfaceDecorator

        public InterfaceDecorator(java.lang.Class<I> interfaceClass,
                                  T delegate)
        构造方法
        Parameters:
        interfaceClass - 接口类
        delegate - 实现接口的类
      • InterfaceDecorator

        public InterfaceDecorator(T delegate)
        简化版构造函数
        当delegate只实现了一个接口时,自动推断接口类型
        Parameters:
        delegate -
    • Method Detail

      • invoke

        public java.lang.Object invoke(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Throws:
        java.lang.Throwable
      • getInterfaceClass

        public final java.lang.Class<IgetInterfaceClass()
        返回代理的接口类
        Returns:
      • proxyInstance

        public final I proxyInstance()
        根据当前对象创建新的接口实例Proxy
        Returns:

Copyright © 2019. All rights reserved.