Class WriteableTypeImpl

    • Method Detail

      • getName

        public String getName()
        Description copied from interface: Type
        A unique identifier for this type
        Specified by:
        getName in interface Type
        Returns:
        A unique identifier for this type (may not return null)
      • getInstances

        public Map<String,​Instance> getInstances()
        Description copied from interface: Type
        Returns a read-only map of the instances that are associated with this type
        Specified by:
        getInstances in interface Type
        Returns:
        A read-only and possibly empty map of instances associated with this type
      • getInstance

        public Instance getInstance​(String key)
        Description copied from interface: Type
        Gets the instance associated with this key, or null if there is none
        Specified by:
        getInstance in interface Type
        Parameters:
        key - The non-null key for the instance
        Returns:
        The resulting instance or null if there is none
      • addInstance

        public Instance addInstance​(String key,
                                    Object bean)
        Description copied from interface: WriteableType
        Adds the instance with the given key to the type
        Specified by:
        addInstance in interface WriteableType
        Parameters:
        key - A non-null name for this bean
        bean - The non-null bean to add
        Returns:
        The instance that was created
      • addInstance

        public Instance addInstance​(String key,
                                    Object bean,
                                    Object metadata)
        Description copied from interface: WriteableType
        Adds the instance with the given key to the type
        Specified by:
        addInstance in interface WriteableType
        Parameters:
        key - A non-null name for this bean
        bean - The non-null bean to add
        metadata - Possibly null metadata to be associated with this bean
        Returns:
        The instance that was created
      • removeInstance

        public Instance removeInstance​(String key)
        Description copied from interface: WriteableType
        Removes the instance with the given key from the type
        Specified by:
        removeInstance in interface WriteableType
        Parameters:
        key - A non-null name for this bean
        Returns:
        The possibly null bean that was removed. If null then no bean was found with the given name
      • modifyInstance

        public PropertyChangeEvent[] modifyInstance​(String key,
                                                    Object newBean,
                                                    PropertyChangeEvent... propChanges)
        Description copied from interface: WriteableType
        Modifies the instance with the given key
        Specified by:
        modifyInstance in interface WriteableType
        Parameters:
        key - A non-null name or key for the bean to modify
        newBean - The new bean to use with this key
        propChanges - The full set of changes from the previous version. If this is a zero-length array then the system will attempt to automatically determine the changes made to this type and will generate the list of PropertyChangeEvent to be associated with this modification
        Returns:
        If changes has length greater than zero then this simply returns changes. If changes is zero length then this will return the set of changes automatically determined by the system
      • getMetadata

        public Object getMetadata()
        Description copied from interface: Type
        Gets information about this type. Can be used to describe the type in some useful way
        Specified by:
        getMetadata in interface Type
        Returns:
        The possibly null metadata associated with this type
      • setMetadata

        public void setMetadata​(Object metadata)
        Description copied from interface: Type
        Sets an object containing information about this type. Can be used to describe the type in some useful way
        Specified by:
        setMetadata in interface Type
        Parameters:
        metadata - The possibly null metadata to be associated with this type