@@ -50,82 +50,172 @@ public class SdlFile{
5050 private boolean persistentFile ;
5151 private boolean isStaticIcon ;
5252
53-
53+ /**
54+ * Creates a new instance of SdlFile
55+ */
5456 public SdlFile (){}
5557
58+ /**
59+ * Creates a new instance of SdlFile
60+ * @param fileName a String value representing the name that will be used to store the file in the head unit
61+ * @param fileType a FileType enum value representing the type of the file
62+ * @param id an int value representing the android resource id of the file
63+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
64+ */
5665 public SdlFile (@ NonNull String fileName , @ NonNull FileType fileType , int id , boolean persistentFile ){
5766 this .fileName = fileName ;
5867 this .fileType = fileType ;
5968 this .id = id ;
6069 this .persistentFile = persistentFile ;
6170 }
6271
72+ /**
73+ * Creates a new instance of SdlFile
74+ * @param fileName a String value representing the name that will be used to store the file in the head unit
75+ * @param fileType a FileType enum value representing the type of the file
76+ * @param uri a URI value representing a file's location. Currently, it only supports local files
77+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
78+ */
6379 public SdlFile (@ NonNull String fileName , @ NonNull FileType fileType , Uri uri , boolean persistentFile ){
6480 this .fileName = fileName ;
6581 this .fileType = fileType ;
6682 this .uri = uri ;
6783 this .persistentFile = persistentFile ;
6884 }
6985
86+ /**
87+ * Creates a new instance of SdlFile
88+ * @param fileName a String value representing the name that will be used to store the file in the head unit
89+ * @param fileType a FileType enum value representing the type of the file
90+ * @param data a byte array representing the data of the file
91+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
92+ */
7093 public SdlFile (@ NonNull String fileName , @ NonNull FileType fileType , byte [] data , boolean persistentFile ){
7194 this .fileName = fileName ;
7295 this .fileType = fileType ;
7396 this .fileData = data ;
7497 this .persistentFile = persistentFile ;
7598 }
7699
100+ /**
101+ * Creates a new instance of SdlFile
102+ * @param staticIconName a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit
103+ */
77104 public SdlFile (@ NonNull StaticIconName staticIconName ){
78105 this .fileName = staticIconName .toString ();
79106 this .fileData = staticIconName .toString ().getBytes ();
80107 this .persistentFile = false ;
81108 this .isStaticIcon = true ;
82109 }
83110
111+ /**
112+ * Sets the name of the file
113+ * @param fileName a String value representing the name that will be used to store the file in the head unit
114+ */
84115 public void setName (@ NonNull String fileName ){
85116 this .fileName = fileName ;
86117 }
118+
119+ /**
120+ * Gets the name of the file
121+ * @return a String value representing the name that will be used to store the file in the head unit
122+ */
87123 public String getName (){
88124 return fileName ;
89125 }
90126
127+ /**
128+ * Sets the resource ID of the file
129+ * @param id an int value representing the android resource id of the file
130+ */
91131 public void setResourceId (int id ){
92132 this .id = id ;
93133 }
134+
135+ /**
136+ * Gets the resource id of the file
137+ * @return an int value representing the android resource id of the file
138+ */
94139 public int getResourceId (){
95140 return id ;
96141 }
97142
143+ /**
144+ * Sets the uri of the file
145+ * @param uri a URI value representing a file's location. Currently, it only supports local files
146+ */
98147 public void setUri (Uri uri ){
99148 this .uri = uri ;
100149 }
150+
151+ /**
152+ * Gets the uri of the file
153+ * @return a URI value representing a file's location. Currently, it only supports local files
154+ */
101155 public Uri getUri (){
102156 return uri ;
103157 }
104158
159+ /**
160+ * Sets the byte array that represents the content of the file
161+ * @param data a byte array representing the data of the file
162+ */
105163 public void setFileData (byte [] data ){
106164 this .fileData = data ;
107165 }
166+
167+ /**
168+ * Gets the byte array that represents the content of the file
169+ * @return a byte array representing the data of the file
170+ */
108171 public byte [] getFileData (){
109172 return fileData ;
110173 }
111174
175+ /**
176+ * Sets the type of the file
177+ * @param fileType a FileType enum value representing the type of the file
178+ */
112179 public void setType (@ NonNull FileType fileType ){
113180 this .fileType = fileType ;
114181 }
182+
183+ /**
184+ * Gets the type of the file
185+ * @return a FileType enum value representing the type of the file
186+ */
115187 public FileType getType (){
116188 return fileType ;
117189 }
118190
191+ /**
192+ * Sets whether the file should persist between sessions / ignition cycles
193+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
194+ */
119195 public void setPersistent (boolean persistentFile ){
120196 this .persistentFile = persistentFile ;
121197 }
198+
199+ /**
200+ * Gets whether the file should persist between sessions / ignition cycles
201+ * @return a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
202+ */
122203 public boolean isPersistent (){
123204 return this .persistentFile ;
124205 }
125206
207+ /**
208+ * Sets the the name of the static file. Static files comes pre-shipped with the head unit
209+ * @param staticIcon a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit
210+ */
126211 public void setStaticIcon (boolean staticIcon ) {
127212 isStaticIcon = staticIcon ;
128213 }
214+
215+ /**
216+ * Gets the the name of the static file. Static files comes pre-shipped with the head unit
217+ * @return a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit
218+ */
129219 public boolean isStaticIcon () {
130220 return isStaticIcon ;
131221 }
0 commit comments