Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-2268

Simplify setting of properties.

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: iPOJO-1.6.0
    • Component/s: iPOJO
    • Labels:
      None

      Description

      From: Clement Escoffier clement.escoffier@gmail.com
      Sent: 09 April 2010 16:49
      To: peter lawrey
      Subject: Re: It is interesting...

      Hi,

      On 09.04.2010, at 11:46, peter lawrey wrote:

      "This API was designed to be easy to use, avoids redundancies..."
      addProperty(
      new ServiceProperty().setName("language")
      .setType(String.class.getName())
      .setValue("en")
      )

      Perhaps you could simplify this with a method which takes a plain key/value pair. e.g. Properties.setProperty(String, String);

      Like
      addProperty("language","en")

      You could implement this using a helper method.

      public PrimitiveComponentType addProperty(String key, Object obj) {
      Class clazz = obj == null ? String.class : obj.getClass();
      addProperty(new ServiceProperty().setName(key)
      .setType(clazz.getName())
      .setValue(obj) ;
      return this;
      }

        Attachments

          Activity

            People

            • Assignee:
              clement.escoffier Clement Escoffier
              Reporter:
              peter_edgeci Peter Lawrey
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: