← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16475: minor javadoc updates

 

------------------------------------------------------------
revno: 16475
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-08-22 12:35:40 +0700
message:
  minor javadoc updates
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/acl/AclService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateUnit.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/acl/AclService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/acl/AclService.java	2014-08-15 07:02:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/acl/AclService.java	2014-08-22 05:35:40 +0000
@@ -140,12 +140,11 @@
     boolean canManage( User user, IdentifiableObject object );
 
     /**
-     * Can create
+     * Can create an object of this type.
      *
-     * @param user
-     * @param klass
-     * @param <T>
-     * @return
+     * @param user  User to User to check against
+     * @param klass Type to check against
+     * @return Result of test
      */
     <T extends IdentifiableObject> boolean canCreate( User user, Class<T> klass );
 
@@ -182,6 +181,12 @@
      */
     <T extends IdentifiableObject> boolean canExternalize( User user, Class<T> klass );
 
+    /**
+     * Is the default for this type to be public?
+     *
+     * @param klass Type to check
+     * @return Result of test
+     */
     <T extends IdentifiableObject> boolean defaultPublic( Class<T> klass );
 
     Class<? extends IdentifiableObject> classForType( String type );
@@ -195,9 +200,10 @@
     <T extends IdentifiableObject> Access getAccess( T object );
 
     /**
-     * Return the access object for a object.
+     * Return the access object for a object for a specific user.
      *
      * @param object Object to check for access
+     * @param user   User to check against
      * @return Populated access instance
      */
     <T extends IdentifiableObject> Access getAccess( T object, User user );

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateUnit.java	2014-05-23 15:34:22 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateUnit.java	2014-08-22 05:35:40 +0000
@@ -172,6 +172,11 @@
         return iso8601;
     }
 
+    /**
+     * Converts dateUnit to Joda-Time DateTime
+     *
+     * @return Populated DateTime object
+     */
     public DateTime toDateTime()
     {
         if ( !iso8601 )
@@ -182,11 +187,22 @@
         return new DateTime( year, month, day, 0, 0, ISOChronology.getInstance() );
     }
 
+    /**
+     * Converts dateUnit to Joda-Time DateTime with a specific chronology.
+     *
+     * @param chronology Chronology to use
+     * @return Populated DateTime object
+     */
     public DateTime toDateTime( Chronology chronology )
     {
         return new DateTime( year, month, day, 0, 0, chronology );
     }
 
+    /**
+     * Converts dateUnit to JDK Calendar
+     *
+     * @return Populated JDK Calendar object
+     */
     public java.util.Calendar toJdkCalendar()
     {
         if ( !iso8601 )
@@ -200,22 +216,45 @@
         return calendar;
     }
 
+    /**
+     * Converts dateUnit to JDK Date
+     *
+     * @return Populated JDK Date object
+     */
     public Date toJdkDate()
     {
         return toJdkCalendar().getTime();
     }
 
+    /**
+     * Converts from Joda-Time DateTime to DateUnit
+     *
+     * @param dateTime DateTime object
+     * @return Populated DateUnit object
+     */
     public static DateUnit fromDateTime( DateTime dateTime )
     {
         return new DateUnit( dateTime.getYear(), dateTime.getMonthOfYear(), dateTime.getDayOfMonth(), dateTime.getDayOfWeek() );
     }
 
+    /**
+     * Converts from JDK Calendar to DateUnit
+     *
+     * @param calendar JDK Calendar object
+     * @return Populated DateUnit object
+     */
     public static DateUnit fromJdkCalendar( java.util.Calendar calendar )
     {
         return new DateUnit( calendar.get( java.util.Calendar.YEAR ), calendar.get( java.util.Calendar.MONTH ) + 1,
             calendar.get( java.util.Calendar.DAY_OF_MONTH ), calendar.get( java.util.Calendar.DAY_OF_WEEK ), true );
     }
 
+    /**
+     * Converts from JDK Date to DateUnit
+     *
+     * @param date JDK Date object
+     * @return Populated DateUnit object
+     */
     public static DateUnit fromJdkDate( Date date )
     {
         DateUnit dateUnit = fromDateTime( new DateTime( date.getTime() ) );