Record Class InstanceBeanProvider

java.lang.Object
java.lang.Record
cool.scx.bean.provider.InstanceBeanProvider
All Implemented Interfaces:
BeanProvider

public record InstanceBeanProvider(Object bean) extends Record implements BeanProvider
根据一个 已经存在的 Bean 创建
Version:
0.0.1
Author:
scx567888
  • Constructor Details

    • InstanceBeanProvider

      public InstanceBeanProvider(Object bean)
      Creates an instance of a InstanceBeanProvider record class.
      Parameters:
      bean - the value for the bean record component
  • Method Details

    • getBean

      public Object getBean(BeanFactory beanFactory)
      Description copied from interface: BeanProvider
      获取 Bean
      Specified by:
      getBean in interface BeanProvider
    • singleton

      public boolean singleton()
      Description copied from interface: BeanProvider
      表示 getBean() 是否始终返回同一实例
      Specified by:
      singleton in interface BeanProvider
    • beanClass

      public Class<?> beanClass()
      Description copied from interface: BeanProvider
      表示 getBean() 返回的对象类型
      Specified by:
      beanClass in interface BeanProvider
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • bean

      public Object bean()
      Returns the value of the bean record component.
      Returns:
      the value of the bean record component