Class MorpheusModel

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String config  
      protected java.lang.Long id
      Database reference Id of the Object.
    • Constructor Summary

      Constructors 
      Constructor Description
      MorpheusModel()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getConfig()  
      java.util.Map getConfigMap()  
      java.lang.Object getConfigProperty​(java.lang.String prop)  
      java.util.Set<java.lang.String> getDirtyProperties()
      Gets a list of all dirty properties / fields (things that have changes) on the corresponding model based on the used setters.
      java.util.LinkedHashMap<java.lang.String,​java.lang.Object> getDirtyPropertyValues()
      Gets a Map containing all dirty properties as well as their newly assigned values.
      java.lang.Long getId()
      Gets the uniquely generated ID from the database record stored via the Morpheus appliance.
      java.util.HashMap<java.lang.String,​java.lang.Object> getProperties()  
      java.lang.Boolean isDirty​(java.lang.String propertyName)
      Checks if a property has been modified
      void markClean()
      Marks the corresponding Model clean from all changes.
      protected void markDirty​(java.lang.String propertyName, java.lang.Object value)
      All setters that are presented to the morpheus API should call markDirty with a string representation of the fieldname.
      protected void markDirty​(java.lang.String propertyName, java.lang.Object value, java.lang.Object persistedValue)
      All setters that are presented to the morpheus API should call markDirty with a string representation of the fieldname.
      void setConfig​(java.lang.String config)  
      void setConfigMap​(java.util.Map<java.lang.String,​java.lang.Object> map)  
      void setConfigProperty​(java.lang.String prop, java.lang.Object object)  
      void setId​(java.lang.Long id)
      Used for setting the unique ID of the Pool Type.
      • Methods inherited from class java.lang.Object

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

      • id

        protected java.lang.Long id
        Database reference Id of the Object. Typically not directly set.
      • config

        protected java.lang.String config
    • Constructor Detail

      • MorpheusModel

        public MorpheusModel()
    • Method Detail

      • getId

        public java.lang.Long getId()
        Gets the uniquely generated ID from the database record stored via the Morpheus appliance.
        Returns:
        id
      • setId

        public void setId​(java.lang.Long id)
        Used for setting the unique ID of the Pool Type. This should not be directly used.
        Parameters:
        id - unique identifer
      • markDirty

        protected void markDirty​(java.lang.String propertyName,
                                 java.lang.Object value)
        All setters that are presented to the morpheus API should call markDirty with a string representation of the fieldname. This enables the MorpheusContext to reconcile differences and perform differential updates.
        Parameters:
        propertyName - Name of the property that has been changed
        value - The newly assigned value the property has been given.
      • markDirty

        protected void markDirty​(java.lang.String propertyName,
                                 java.lang.Object value,
                                 java.lang.Object persistedValue)
        All setters that are presented to the morpheus API should call markDirty with a string representation of the fieldname. This enables the MorpheusContext to reconcile differences and perform differential updates.
        Parameters:
        propertyName - Name of the property that has been changed
        value - The newly assigned value the property has been given.
        persistedValue - The old value of the property.
      • markClean

        public void markClean()
        Marks the corresponding Model clean from all changes. This resets all stored differential value changes.
      • isDirty

        public java.lang.Boolean isDirty​(java.lang.String propertyName)
        Checks if a property has been modified
        Parameters:
        propertyName - Name of the property to check
        Returns:
        true or false
      • getDirtyProperties

        public java.util.Set<java.lang.String> getDirtyProperties()
        Gets a list of all dirty properties / fields (things that have changes) on the corresponding model based on the used setters.
        Returns:
        A List of dirty fields by name
      • getDirtyPropertyValues

        public java.util.LinkedHashMap<java.lang.String,​java.lang.Object> getDirtyPropertyValues()
        Gets a Map containing all dirty properties as well as their newly assigned values.
        Returns:
        A Map containing all model changes on properties from the original object.
      • getProperties

        public java.util.HashMap<java.lang.String,​java.lang.Object> getProperties()
        Returns:
        A Map of all properties, similar to Groovy's getProperties()
      • getConfig

        public java.lang.String getConfig()
      • setConfig

        public void setConfig​(java.lang.String config)
      • getConfigMap

        public java.util.Map getConfigMap()
      • setConfigMap

        public void setConfigMap​(java.util.Map<java.lang.String,​java.lang.Object> map)
      • getConfigProperty

        public java.lang.Object getConfigProperty​(java.lang.String prop)
      • setConfigProperty

        public void setConfigProperty​(java.lang.String prop,
                                      java.lang.Object object)