Class ResourceFactory


  • public class ResourceFactory
    extends java.lang.Object
    A factory class for creating Resource instances.
    See Also:
    Resource
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.logging.Logger logger  
      private java.util.Map<java.net.URI,​Resource> resources
      Ensures that only one Resource is created given the same URI.
    • Constructor Summary

      Constructors 
      Constructor Description
      ResourceFactory()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Resource createResource​(java.lang.String primaryKey, java.net.URI uri)
      Returns an instance of Resource with the given URI as the parameter.
      • Methods inherited from class java.lang.Object

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

      • logger

        private static final java.util.logging.Logger logger
      • resources

        private final java.util.Map<java.net.URI,​Resource> resources
        Ensures that only one Resource is created given the same URI.
    • Constructor Detail

      • ResourceFactory

        public ResourceFactory()
    • Method Detail

      • createResource

        public Resource createResource​(java.lang.String primaryKey,
                                       java.net.URI uri)
        Returns an instance of Resource with the given URI as the parameter.
        Parameters:
        primaryKey - The primary key.
        uri - The URI used when creating the instance.
        Returns:
        The Resource if created.