1 Reply Latest reply on Jun 13, 2005 11:25 PM by Bela Ban

    Request for new Fqn constructors

    Brian Dueck Newbie

      Hi;

      I'm wondering if it would be possible to add a few more constructors to the Fqn class. In particular, I have a situation where I am always creating an Fqn from an existing Fqn plus some relative names. The relative names are either a java.util.List of Objects, or two or three individual Objects are aren't in a list.

      There doesn't appear to be a convenient and (more importantly) efficient way of doing this with existing constructors, and these new constructors don't in any way compromise the immutability of Fqn's so, hoping you will see the benefit of adding them.

      Here's my prototype implementation. If you'd like me to open a Jira enhancement on this just let me know.

      public Fqn(Fqn base, List relative) {
       elements.addAll(base.elements);
       elements.addAll(relative);
       }
      
       public Fqn(Fqn base, Object relative_name1, Object relative_name2) {
       elements.addAll(base.elements);
       elements.add(relative_name1);
       elements.add(relative_name2);
       }
      
       public Fqn(Fqn base, Object relative_name1, Object relative_name2, Object relative_name3) {
       elements.addAll(base.elements);
       elements.add(relative_name1);
       elements.add(relative_name2);
       elements.add(relative_name3);
       }


      Thanks and regards,

      Brian.