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

Simplify setting of properties.

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • iPOJO-1.6.0
    • iPOJO
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment