Class MapBean

    • Constructor Detail

      • MapBean

        public MapBean()
        Creates an instance.
    • Method Detail

      • meta

        public static DynamicMetaBean meta()
        Creates a standalone meta-bean.

        This creates a new instance each time in line with dynamic bean principles.

        Returns:
        the meta-bean, not null
      • metaBean

        public DynamicMetaBean metaBean()
        Description copied from interface: DynamicBean
        Gets the meta-bean representing the parts of the bean that are common across all instances, such as the set of meta-properties.
        Specified by:
        metaBean in interface Bean
        Specified by:
        metaBean in interface DynamicBean
        Returns:
        the meta-bean, not null
      • property

        public Property<Object> property​(String name)
        Description copied from interface: DynamicBean
        Gets a property by name.

        This will not throw an exception if the property name does not exist. Whether a property is immediately created or not is implementation dependent.

        Specified by:
        property in interface Bean
        Specified by:
        property in interface DynamicBean
        Parameters:
        name - the property name to retrieve, not null
        Returns:
        the property, not null
      • propertyNames

        public Set<String> propertyNames()
        Description copied from interface: Bean
        Gets the set of property names.

        Each bean consists of a known set of properties. This method returns the known property names.

        Specified by:
        propertyNames in interface Bean
        Returns:
        the unmodifiable set of property names, not null
      • propertyDefine

        public void propertyDefine​(String propertyName,
                                   Class<?> propertyType)
        Description copied from interface: DynamicBean
        Adds a property to those allowed to be stored in the bean.

        Some implementations will automatically add properties, in which case this method will have no effect.

        Specified by:
        propertyDefine in interface DynamicBean
        Parameters:
        propertyName - the property name to check, not empty, not null
        propertyType - the property type, not null
      • propertyRemove

        public void propertyRemove​(String propertyName)
        Description copied from interface: DynamicBean
        Removes a property by name.
        Specified by:
        propertyRemove in interface DynamicBean
        Parameters:
        propertyName - the property name to remove, null ignored
      • toString

        public String toString()
        Returns a string that summarises the bean.

        The string contains the class name and properties.

        Overrides:
        toString in class AbstractMap<String,​Object>
        Returns:
        a summary string, not null