Class SimpleResource

  • All Implemented Interfaces:
    java.io.Serializable, Resource

    public class SimpleResource
    extends java.lang.Object
    implements Resource
    A simple resource with only a single dependency.
    Author:
    Thomas Morgner
    See Also:
    Serialized Form
    • Constructor Detail

      • SimpleResource

        public SimpleResource​(ResourceKey key,
                              java.lang.Object value,
                              java.lang.Class targetType,
                              long version)
    • Method Detail

      • getResource

        public java.lang.Object getResource()
        Specified by:
        getResource in interface Resource
      • getDependencies

        public ResourceKey[] getDependencies()
        The primary source is also included in this set. The dependencies are given as ResourceKey objects. The keys itself do not hold any state information.

        The dependencies do not track deep dependencies. So if Resource A depends on Resource B which depends on Resource C, then A only knows about B, not C.

        Specified by:
        getDependencies in interface Resource
        Returns:
      • getTargetType

        public java.lang.Class getTargetType()
        Specified by:
        getTargetType in interface Resource