Skip to content

Commit 95d6f65

Browse files
bilal-alsharifijoeygrover
authored andcommitted
Add javadoc to SdlFile & SdlArtwork (#1041)
* Add java doc for SdlFile * Add javadoc to sdl Artwork * Add more javadoc SdlFile & SdlArtwork * Update java docs for SdlFile/SdlArtwork
1 parent 6439b3e commit 95d6f65

File tree

4 files changed

+235
-22
lines changed

4 files changed

+235
-22
lines changed

android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,34 +47,62 @@ public class SdlArtwork extends SdlFile {
4747
private boolean isTemplate;
4848
private Image imageRPC;
4949

50+
/**
51+
* Creates a new instance of SdlArtwork
52+
*/
5053
public SdlArtwork(){}
5154

55+
/**
56+
* Creates a new instance of SdlArtwork
57+
* @param fileName a String value representing the name that will be used to store the file in the head unit
58+
* @param fileType a FileType enum value representing the type of the file
59+
* @param id an int value representing the android resource id of the file
60+
* @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
61+
*/
5262
public SdlArtwork(@NonNull String fileName, @NonNull FileType fileType, int id, boolean persistentFile) {
5363
super(fileName, fileType, id, persistentFile);
5464
}
5565

66+
/**
67+
* Creates a new instance of SdlArtwork
68+
* @param fileName a String value representing the name that will be used to store the file in the head unit
69+
* @param fileType a FileType enum value representing the type of the file
70+
* @param uri a URI value representing a file's location. Currently, it only supports local files
71+
* @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
72+
*/
5673
public SdlArtwork(@NonNull String fileName, @NonNull FileType fileType, Uri uri, boolean persistentFile) {
5774
super(fileName, fileType, uri, persistentFile);
5875
}
5976

77+
/**
78+
* Creates a new instance of SdlArtwork
79+
* @param fileName a String value representing the name that will be used to store the file in the head unit
80+
* @param fileType a FileType enum value representing the type of the file
81+
* @param data a byte array representing the data of the file
82+
* @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
83+
*/
6084
public SdlArtwork(@NonNull String fileName, @NonNull FileType fileType, byte[] data, boolean persistentFile) {
6185
super(fileName, fileType, data, persistentFile);
6286
}
6387

88+
/**
89+
* Creates a new instance of SdlArtwork
90+
* @param staticIconName a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit
91+
*/
6492
public SdlArtwork(@NonNull StaticIconName staticIconName) {
6593
super(staticIconName);
6694
}
6795

6896
/**
69-
* Set whether this SdlArtwork is a template image whose coloring should be decided by the HMI
97+
* Sets whether this SdlArtwork is a template image whose coloring should be decided by the HMI
7098
* @param isTemplate boolean that tells whether this SdlArtwork is a template image
7199
*/
72100
public void setTemplateImage(boolean isTemplate){
73101
this.isTemplate = isTemplate;
74102
}
75103

76104
/**
77-
* Get whether this SdlArtwork is a template image whose coloring should be decided by the HMI
105+
* Gets whether this SdlArtwork is a template image whose coloring should be decided by the HMI
78106
* @return boolean that tells whether this SdlArtwork is a template image
79107
*/
80108
public boolean isTemplateImage(){
@@ -92,8 +120,8 @@ public void setType(@NonNull FileType fileType) {
92120
}
93121

94122
/**
95-
* Get the Image RPC representing this artwork. Generally for use internally, you should instead pass an artwork to a Screen Manager method.
96-
* @return The Image RPC representing this artwork.
123+
* Gets the Image RPC representing this artwork. Generally for use internally, you should instead pass an artwork to a Screen Manager method
124+
* @return The Image RPC representing this artwork
97125
*/
98126
public Image getImageRPC() {
99127
if (imageRPC == null) {

android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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
}

javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,51 @@ public class SdlArtwork extends SdlFile {
4444
private boolean isTemplate;
4545
private Image imageRPC;
4646

47+
/**
48+
* Creates a new instance of SdlArtwork
49+
*/
4750
public SdlArtwork(){}
4851

49-
public SdlArtwork(@NonNull StaticIconName staticIconName) {
50-
super(staticIconName);
51-
}
52-
52+
/**
53+
* Creates a new instance of SdlArtwork
54+
* @param fileName a String value representing the name that will be used to store the file in the head unit
55+
* @param fileType a FileType enum value representing the type of the file
56+
* @param filePath a String value representing the the location of the file
57+
* @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
58+
*/
5359
public SdlArtwork(@NonNull String fileName, @NonNull FileType fileType, String filePath, boolean persistentFile) {
5460
super(fileName, fileType, filePath, persistentFile);
5561
}
5662

63+
/**
64+
* Creates a new instance of SdlArtwork
65+
* @param fileName a String value representing the name that will be used to store the file in the head unit
66+
* @param fileType a FileType enum value representing the type of the file
67+
* @param data a byte array representing the data of the file
68+
* @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
69+
*/
5770
public SdlArtwork(@NonNull String fileName, @NonNull FileType fileType, byte[] data, boolean persistentFile) {
5871
super(fileName, fileType, data, persistentFile);
5972
}
6073

6174
/**
62-
* Set whether this SdlArtwork is a template image whose coloring should be decided by the HMI
75+
* Creates a new instance of SdlArtwork
76+
* @param staticIconName a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit
77+
*/
78+
public SdlArtwork(@NonNull StaticIconName staticIconName) {
79+
super(staticIconName);
80+
}
81+
82+
/**
83+
* Sets whether this SdlArtwork is a template image whose coloring should be decided by the HMI
6384
* @param isTemplate boolean that tells whether this SdlArtwork is a template image
6485
*/
6586
public void setTemplateImage(boolean isTemplate){
6687
this.isTemplate = isTemplate;
6788
}
6889

6990
/**
70-
* Get whether this SdlArtwork is a template image whose coloring should be decided by the HMI
91+
* Gets whether this SdlArtwork is a template image whose coloring should be decided by the HMI
7192
* @return boolean that tells whether this SdlArtwork is a template image
7293
*/
7394
public boolean isTemplateImage(){
@@ -86,7 +107,7 @@ public void setType(@NonNull FileType fileType) {
86107
}
87108

88109
/**
89-
* Get the Image RPC representing this artwork. Generally for use internally, you should instead pass an artwork to a Screen Manager method.
110+
* Gets the Image RPC representing this artwork. Generally for use internally, you should instead pass an artwork to a Screen Manager method
90111
* @return The Image RPC representing this artwork.
91112
*/
92113
public Image getImageRPC() {

0 commit comments

Comments
 (0)