← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15593: minor change in toString of property/schema

 

------------------------------------------------------------
revno: 15593
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-06-09 09:14:11 +0200
message:
  minor change in toString of property/schema
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Schema.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java	2014-06-07 17:40:28 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java	2014-06-09 07:14:11 +0000
@@ -31,6 +31,7 @@
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import com.google.common.base.Objects;
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.common.NameableObject;
@@ -40,7 +41,7 @@
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
-@JacksonXmlRootElement(localName = "property", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement( localName = "property", namespace = DxfNamespaces.DXF_2_0 )
 public class Property
 {
     /**
@@ -131,7 +132,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Class<?> getKlass()
     {
         return klass;
@@ -145,7 +146,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Class<?> getItemKlass()
     {
         return itemKlass;
@@ -162,7 +163,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getName()
     {
         return name;
@@ -174,7 +175,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getCollectionName()
     {
         return collectionName == null ? name : collectionName;
@@ -186,7 +187,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getDescription()
     {
         return description;
@@ -198,7 +199,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getNamespaceURI()
     {
         return namespaceURI;
@@ -210,7 +211,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isAttribute()
     {
         return attribute;
@@ -234,7 +235,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isCollection()
     {
         return collection;
@@ -246,7 +247,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isIdentifiableObject()
     {
         return identifiableObject;
@@ -258,7 +259,7 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isNameableObject()
     {
         return nameableObject;
@@ -310,17 +311,19 @@
     @Override
     public String toString()
     {
-        return "Property{" +
-            "klass=" + klass +
-            ", getterMethod=" + getterMethod +
-            ", name='" + name + '\'' +
-            ", collectionName='" + collectionName + '\'' +
-            ", description='" + description + '\'' +
-            ", namespaceURI='" + namespaceURI + '\'' +
-            ", attribute=" + attribute +
-            ", collection=" + collection +
-            ", identifiableObject=" + identifiableObject +
-            ", nameableObject=" + nameableObject +
-            '}';
+        return Objects.toStringHelper( this )
+            .add( "klass", klass )
+            .add( "itemKlass", itemKlass )
+            .add( "getterMethod", getterMethod )
+            .add( "name", name )
+            .add( "collectionName", collectionName )
+            .add( "description", description )
+            .add( "namespaceURI", namespaceURI )
+            .add( "attribute", attribute )
+            .add( "simple", simple )
+            .add( "collection", collection )
+            .add( "identifiableObject", identifiableObject )
+            .add( "nameableObject", nameableObject )
+            .toString();
     }
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Schema.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Schema.java	2014-06-03 08:19:42 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Schema.java	2014-06-09 07:14:11 +0000
@@ -32,6 +32,7 @@
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import com.google.common.base.Objects;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import org.hisp.dhis.common.DxfNamespaces;
@@ -45,7 +46,7 @@
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
-@JacksonXmlRootElement(localName = "schema", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement( localName = "schema", namespace = DxfNamespaces.DXF_2_0 )
 public class Schema implements Ordered
 {
     /**
@@ -150,14 +151,14 @@
     }
 
     @JsonProperty
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isIdentifiableObject()
     {
         return identifiableObject;
     }
 
     @JsonProperty
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isNameableObject()
     {
         return nameableObject;
@@ -329,25 +330,24 @@
         this.order = order;
     }
 
-    @Override
-    public String toString()
+    @Override public String toString()
     {
-        return "Schema{" +
-            "klass=" + klass +
-            ", identifiableObject=" + identifiableObject +
-            ", nameableObject=" + nameableObject +
-            ", singular='" + singular + '\'' +
-            ", plural='" + plural + '\'' +
-            ", namespaceURI='" + namespaceURI + '\'' +
-            ", name='" + name + '\'' +
-            ", collectionName='" + collectionName + '\'' +
-            ", shareable=" + shareable +
-            ", apiEndpoint='" + apiEndpoint + '\'' +
-            ", metadata=" + metadata +
-            ", authorities=" + authorities +
-            ", propertyMap=" + propertyMap +
-            ", order=" + order +
-            ", authorityMap=" + authorityMap +
-            '}';
+        return Objects.toStringHelper( this )
+            .add( "klass", klass )
+            .add( "identifiableObject", identifiableObject )
+            .add( "nameableObject", nameableObject )
+            .add( "singular", singular )
+            .add( "plural", plural )
+            .add( "namespaceURI", namespaceURI )
+            .add( "name", name )
+            .add( "collectionName", collectionName )
+            .add( "shareable", shareable )
+            .add( "apiEndpoint", apiEndpoint )
+            .add( "metadata", metadata )
+            .add( "authorities", authorities )
+            .add( "propertyMap", propertyMap )
+            .add( "order", order )
+            .add( "authorityMap", authorityMap )
+            .toString();
     }
 }