Class GenericModel<T>

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void attach()
      Attach an object.
      protected boolean canEqual​(java.lang.Object other)  
      void detach()
      Detach an object.
      boolean equals​(java.lang.Object o)  
      T getObject()
      Backing object.
      java.lang.Class<T> getObjectClass()
      Gets the object class.
      int hashCode()  
      static <C> IModel<java.util.Collection<C>> ofCollection​(java.util.Collection<C> collection)
      Factory method for models that contain collections.
      static <C> IModel<java.util.List<C>> ofList​(java.util.List<C> list)
      Factory method for models that contain lists.
      static <K,​V>
      IModel<java.util.Map<K,​V>>
      ofMap​(java.util.Map<K,​V> map)
      Factory method for models that contain maps.
      static <C> IModel<java.util.Set<C>> ofSet​(java.util.Set<C> set)
      Factory method for models that contain sets.
      void setObject​(T object)
      Backing object.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • GenericModel

        public GenericModel​(T object)
        Instantiates a new GenericModel.
        Parameters:
        object - the object
      • GenericModel

        public GenericModel()
    • Method Detail

      • ofCollection

        public static <C> IModel<java.util.Collection<C>> ofCollection​(java.util.Collection<C> collection)
        Factory method for models that contain collections. This factory method will automatically rebuild a nonserializable collection into a serializable ArrayList.
        Type Parameters:
        C - model type
        Parameters:
        collection - The Collection, which may or may not be Serializable
        Returns:
        A IModel object wrapping the Set
      • ofList

        public static <C> IModel<java.util.List<C>> ofList​(java.util.List<C> list)
        Factory method for models that contain lists. This factory method will automatically rebuild a nonserializable list into a serializable one.
        Type Parameters:
        C - model type
        Parameters:
        list - The List, which may or may not be Serializable
        Returns:
        A IModel object wrapping the List
      • ofMap

        public static <K,​V> IModel<java.util.Map<K,​V>> ofMap​(java.util.Map<K,​V> map)
        Factory method for models that contain maps. This factory method will automatically rebuild a nonserializable map into a serializable one.
        Type Parameters:
        K - key type in map
        V - value type in map
        Parameters:
        map - The Map, which may or may not be Serializable
        Returns:
        A IModel object wrapping the Map
      • ofSet

        public static <C> IModel<java.util.Set<C>> ofSet​(java.util.Set<C> set)
        Factory method for models that contain sets. This factory method will automatically rebuild a nonserializable set into a serializable one.
        Type Parameters:
        C - model type
        Parameters:
        set - The Set, which may or may not be Serializable
        Returns:
        A IModel object wrapping the Set
      • attach

        public void attach()
        Attach an object.
        Specified by:
        attach in interface Attachable
      • detach

        public void detach()
        Detach an object.
        Specified by:
        detach in interface IDetachable
      • getObject

        public T getObject()
        Backing object.
        Specified by:
        getObject in interface IModel<T>
        Returns:
        The model object
      • setObject

        public void setObject​(T object)
        Backing object.
        Specified by:
        setObject in interface IModel<T>
        Parameters:
        object - The model object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object