Interface TypedMetaBean<T extends Bean>

  • Type Parameters:
    T - the type of the bean
    All Superinterfaces:
    MetaBean
    All Known Implementing Classes:
    LightMetaBean, MinimalMetaBean, ReflectiveMetaBean

    public interface TypedMetaBean<T extends Bean>
    extends MetaBean
    A meta-bean that captures the type of the bean.

    It is not possible to add the generic type to all beans, as the type cannot be refined in hierarchies. This interface is thus useful when there are no subclasses.

    • Method Detail

      • builder

        BeanBuilder<T> builder()
        Description copied from interface: MetaBean
        Creates a bean builder that can be used to create an instance of this bean.

        The builder is used in two main ways. The first is to allow immutable beans to be constructed. The second is to enable automated tools like serialization/deserialization.

        The builder can be thought of as a Map of MetaProperty to value. Note that the implementation is not necessarily an actual map.

        Specified by:
        builder in interface MetaBean
        Returns:
        the bean builder, not null
      • beanType

        Class<T> beanType()
        Description copied from interface: MetaBean
        Get the type of the bean, represented as a Class.

        A MetaBean can be thought of as the equivalent of Class but for beans. This method allows the actual Class instance of the bean to be obtained.

        Specified by:
        beanType in interface MetaBean
        Returns:
        the type of the bean, not null