package com.smartdevicelink.proxy.rpc;

import android.support.annotation.NonNull;

import com.smartdevicelink.proxy.RPCStruct;

import java.util.Hashtable;

/**
 * Describes the hour, minute and second values used to set the media clock.
 * <p><b> Parameter List</b></p>
 * <table border="1" rules="all">
 * 		<tr>
 * 			<th>Name</th>
 * 			<th>Type</th>
 * 			<th>Description</th>
 * 			<th>SmartDeviceLink Ver. Available</th>
 * 		</tr>
 * 		<tr>
 * 			<td>hours</td>
 * 			<td>Integer</td>
 * 			<td>The hour. Minvalue="0", maxvalue="59"
 *					<p><b>Note:</b></p>Some display types only support a max value of 19. If out of range, it will be rejected.
 *			</td>
 * 			<td>SmartDeviceLink 1.0</td>
 * 		</tr>
  * 		<tr>
 * 			<td>minutes</td>
 * 			<td>Integer</td>
 * 			<td>The minute. Minvalue="0", maxvalue="59".</td>
 * 			<td>SmartDeviceLink 1.0</td>
 * 		</tr>
 *     <tr>
 * 			<td>seconds</td>
 * 			<td>Integer</td>
 * 			<td>The second. Minvalue="0", maxvalue="59".</td>
 * 			<td>SmartDeviceLink 1.0</td>
 * 		</tr>
 * </table>
 * @since SmartDeviceLink 1.0
 */
public class StartTime extends RPCStruct {
	public static final String KEY_MINUTES = "minutes";
	public static final String KEY_SECONDS = "seconds";
	public static final String KEY_HOURS = "hours";

	/**
	 * Constructs a newly allocated StartTime object
	 */
	public StartTime() { }
    /**
     * Constructs a newly allocated StartTime object indicated by the Hashtable parameter
     * @param hash The Hashtable to use
     */
    public StartTime(Hashtable<String, Object> hash) {
        super(hash);
    }
	/**
	 * Constructs a newly allocated StartTime object
	 * @param timeInterval time interval in seconds
	 */
	public StartTime(@NonNull Integer timeInterval){
        this();
        int hours = timeInterval / 3600;
        int minutes = (timeInterval % 3600) / 60;
        int seconds = timeInterval % 60;
        setHours(hours);
        setMinutes(minutes);
        setSeconds(seconds);
	}
    /**
     * Constructs a newly allocated StartTime object
     * @param hours The hour
     * @param minutes The minute
     * @param seconds The second
     */
    public StartTime(@NonNull Integer hours, @NonNull Integer minutes, @NonNull Integer seconds){
        this();
        setHours(hours);
        setMinutes(minutes);
        setSeconds(seconds);
    }
    /**
     * Get the hour. Minvalue="0", maxvalue="59"
 *					<p><b>Note:</b></p>Some display types only support a max value of 19. If out of range, it will be rejected.
     * @return hours Minvalue="0", maxvalue="59"
     */    
    public Integer getHours() {
        return getInteger( KEY_HOURS );
    }
    /**
     * Set the hour. Minvalue="0", maxvalue="59"
 *					<p><b>Note:</b></p>Some display types only support a max value of 19. If out of range, it will be rejected.
     * @param hours min: 0; max: 59
     */    
    public void setHours(@NonNull Integer hours ) {
        setValue(KEY_HOURS, hours);
    }
    /**
     * Get the minute. Minvalue="0", maxvalue="59".
     * @return minutes Minvalue="0", maxvalue="59"
     */    
    public Integer getMinutes() {
        return getInteger( KEY_MINUTES );
    }
    /**
     * Set the minute. Minvalue="0", maxvalue="59".
     * @param minutes min: 0; max: 59
     */    
    public void setMinutes( @NonNull Integer minutes ) {
        setValue(KEY_MINUTES, minutes);
    }
    /**
     * Get the second. Minvalue="0", maxvalue="59".
     * @return seconds. Minvalue="0", maxvalue="59".
     */    
    public Integer getSeconds() {
        return getInteger( KEY_SECONDS );
    }
    /**
     * Set the second. Minvalue="0", maxvalue="59".
     * @param seconds min: 0 max: 59
     */    
    public void setSeconds( @NonNull Integer seconds ) {
        setValue(KEY_SECONDS, seconds);
    }
}

@@ -1640,16 +1640,18 @@
 %0A    %7D%0D%0A
+%0D%0A
 %09/**%0D%0A%09 
@@ -1802,32 +1802,26 @@
 Interval)%7B%0D%0A
-        
+%09%09
 this();%0D%0A   
@@ -1817,24 +1817,18 @@
 his();%0D%0A
-        
+%09%09
 int hour
@@ -1849,32 +1849,26 @@
 al / 3600;%0D%0A
-        
+%09%09
 int minutes 
@@ -1898,24 +1898,18 @@
  / 60;%0D%0A
-        
+%09%09
 int seco
@@ -1934,24 +1934,18 @@
  %25 60;%0D%0A
-        
+%09%09
 setHours
@@ -1950,32 +1950,26 @@
 rs(hours);%0D%0A
-        
+%09%09
 setMinutes(m
@@ -1974,32 +1974,26 @@
 (minutes);%0D%0A
-        
+%09%09
 setSeconds(s
@@ -2006,29 +2006,23 @@
 );%0D%0A%09%7D%0D%0A
-    
+%09
 /**%0D%0A
-    
+%09
  * Const
@@ -2063,20 +2063,17 @@
 object%0D%0A
-    
+%09
  * @para
@@ -2090,20 +2090,17 @@
 e hour%0D%0A
-    
+%09
  * @para
@@ -2121,20 +2121,17 @@
 minute%0D%0A
-    
+%09
  * @para
@@ -2152,29 +2152,23 @@
 second%0D%0A
-    
+%09
  */%0D%0A
-    
+%09
 public S
@@ -2254,24 +2254,18 @@
 onds)%7B%0D%0A
-        
+%09%09
 this();%0D
@@ -2265,24 +2265,18 @@
 his();%0D%0A
-        
+%09%09
 setHours
@@ -2285,24 +2285,18 @@
 ours);%0D%0A
-        
+%09%09
 setMinut
@@ -2309,24 +2309,18 @@
 utes);%0D%0A
-        
+%09%09
 setSecon
@@ -2329,28 +2329,25 @@
 (seconds);%0D%0A
-    
+%09
 %7D%0D%0A    /**%0D%0A

fix spacing