Skip to content

Commit 21e37d6

Browse files
committed
nullness annotations added.
1 parent 72bdc62 commit 21e37d6

File tree

11 files changed

+73
-44
lines changed

11 files changed

+73
-44
lines changed

library/src/main/java/io/syslogic/github/api/model/WorkflowJobs.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
public class WorkflowJobs {
1616

1717
@SerializedName("total_count")
18-
private Integer totalCount;
18+
private Long totalCount = 0L;
1919

2020
@SerializedName("jobs")
2121
private ArrayList<WorkflowJob> jobs;
2222

2323
/** Setters... */
24-
public void setTotalCount(@NonNull Integer value) {
24+
public void setTotalCount(@NonNull Long value) {
2525
this.totalCount = value;
2626
}
2727

@@ -31,16 +31,12 @@ public void setJobs(@NonNull ArrayList<WorkflowJob> value) {
3131

3232
/** Getters... */
3333
@NonNull
34-
public Integer getId() {
35-
return this.totalCount;
36-
}
37-
38-
@NonNull
39-
public ArrayList<WorkflowJob> getName() {
34+
public ArrayList<WorkflowJob> getJobs() {
4035
return this.jobs;
4136
}
4237

43-
public Integer getTotalCount() {
38+
@NonNull
39+
public Long getTotalCount() {
4440
return this.totalCount;
4541
}
4642
}

library/src/main/java/io/syslogic/github/api/model/WorkflowJobsResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
public class WorkflowJobsResponse {
1616
@SerializedName("total_count")
17-
private Long totalCount;
17+
private Long totalCount = 0L;
1818
@SerializedName("jobs")
1919
private ArrayList<WorkflowJob> jobs;
2020

library/src/main/java/io/syslogic/github/api/model/WorkflowRunsResponse.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
public class WorkflowRunsResponse {
1616
@SerializedName("total_count")
17-
private Long totalCount;
17+
private Long totalCount = 0L;
1818
@SerializedName("workflow_runs")
1919
private ArrayList<WorkflowRun> workflowRuns;
2020

@@ -29,6 +29,7 @@ public void setWorkflowRuns(@NonNull ArrayList<WorkflowRun> value) {
2929
public Long getTotalCount() {
3030
return this.totalCount;
3131
}
32+
3233
@Nullable
3334
public ArrayList<WorkflowRun> getWorkflowRuns() {
3435
return this.workflowRuns;

library/src/main/java/io/syslogic/github/api/model/WorkflowsResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
public class WorkflowsResponse {
1616

1717
@SerializedName("total_count")
18-
private Long totalCount;
18+
private Long totalCount = 0L;
1919

2020
@SerializedName("workflows")
2121
private ArrayList<Workflow> workflows;

library/src/main/java/io/syslogic/github/api/room/LicensesDao.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.database.Cursor;
44

5+
import androidx.annotation.NonNull;
56
import androidx.room.Dao;
67
import androidx.room.Delete;
78
import androidx.room.Insert;
@@ -21,24 +22,28 @@
2122
@Dao
2223
public interface LicensesDao {
2324

25+
@NonNull
2426
@Query("SELECT * FROM " + Constants.TABLE_LICENSES)
2527
List<License> getItems();
2628

2729
/* For ContentProvider */
30+
@NonNull
2831
@Query("SELECT * FROM " + Constants.TABLE_LICENSES)
2932
Cursor selectAll();
3033

34+
@NonNull
3135
@Insert()
32-
Long insert(License item);
36+
Long insert(@NonNull License item);
3337

3438
@Update()
35-
void update(License item);
39+
void update(@NonNull License item);
3640

3741
@Delete()
38-
void delete(License item);
42+
void delete(@NonNull License item);
3943

40-
// @Query("DELETE FROM " + Constants.TABLE_LICENSES + " WHERE id = :itemId")
41-
// void deleteById(Long itemId);
44+
@SuppressWarnings("unused")
45+
@Query("DELETE FROM " + Constants.TABLE_LICENSES + " WHERE id = :itemId")
46+
void deleteById(@NonNull Long itemId);
4247

4348
@Query("DELETE FROM " + Constants.TABLE_LICENSES)
4449
void clear();

library/src/main/java/io/syslogic/github/api/room/OwnersDao.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.database.Cursor;
44

5+
import androidx.annotation.NonNull;
56
import androidx.room.Dao;
67
import androidx.room.Delete;
78
import androidx.room.Insert;
@@ -21,24 +22,28 @@
2122
@Dao
2223
public interface OwnersDao {
2324

25+
@NonNull
2426
@Query("SELECT * FROM " + Constants.TABLE_OWNERS)
2527
List<Owner> getItems();
2628

2729
/* For ContentProvider */
30+
@NonNull
2831
@Query("SELECT * FROM " + Constants.TABLE_OWNERS)
2932
Cursor selectAll();
3033

34+
@NonNull
3135
@Insert()
32-
Long insert(Owner item);
36+
Long insert(@NonNull Owner item);
3337

3438
@Update()
35-
void update(Owner item);
39+
void update(@NonNull Owner item);
3640

3741
@Delete()
38-
void delete(Owner item);
42+
void delete(@NonNull Owner item);
3943

40-
// @Query("DELETE FROM " + Constants.TABLE_OWNERS + " WHERE id = :itemId")
41-
// void deleteById(Long itemId);
44+
@SuppressWarnings("unused")
45+
@Query("DELETE FROM " + Constants.TABLE_OWNERS + " WHERE id = :itemId")
46+
void deleteById(@NonNull Long itemId);
4247

4348
@Query("DELETE FROM " + Constants.TABLE_OWNERS)
4449
void clear();

library/src/main/java/io/syslogic/github/api/room/QueryStringsDao.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.database.Cursor;
44

5+
import androidx.annotation.NonNull;
56
import androidx.room.Dao;
67
import androidx.room.Delete;
78
import androidx.room.Insert;
@@ -21,27 +22,32 @@
2122
@Dao
2223
public interface QueryStringsDao {
2324

25+
@NonNull
2426
@Query("SELECT * FROM " + Constants.TABLE_QUERY_STRINGS)
2527
List<QueryString> getItems();
2628

29+
@NonNull
2730
@Query("SELECT * FROM " + Constants.TABLE_QUERY_STRINGS + " WHERE id = :itemId")
28-
QueryString getItem(Long itemId);
31+
QueryString getItem(@NonNull Long itemId);
2932

3033
/* For ContentProvider */
34+
@NonNull
3135
@Query("SELECT * FROM " + Constants.TABLE_QUERY_STRINGS)
3236
Cursor selectAll();
3337

38+
@NonNull
3439
@Insert()
35-
Long insert(QueryString item);
40+
Long insert(@NonNull QueryString item);
3641

3742
@Update()
38-
int update(QueryString item);
43+
int update(@NonNull QueryString item);
3944

4045
@Delete()
41-
void delete(QueryString item);
46+
void delete(@NonNull QueryString item);
4247

48+
@SuppressWarnings("unused")
4349
@Query("DELETE FROM " + Constants.TABLE_QUERY_STRINGS + " WHERE id = :itemId")
44-
int deleteById(Long itemId);
50+
int deleteById(@NonNull Long itemId);
4551

4652
@Query("DELETE FROM " + Constants.TABLE_QUERY_STRINGS)
4753
void clear();

library/src/main/java/io/syslogic/github/api/room/RepositoriesDao.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.database.Cursor;
44

5+
import androidx.annotation.NonNull;
56
import androidx.room.Dao;
67
import androidx.room.Delete;
78
import androidx.room.Insert;
@@ -21,32 +22,36 @@
2122
@Dao
2223
public interface RepositoriesDao {
2324

24-
// @Transaction
25+
@NonNull
2526
@Query("SELECT * FROM " + Constants.TABLE_REPOSITORIES)
2627
List<Repository> getItems();
2728

2829
/* For ContentProvider */
30+
@NonNull
2931
@Query("SELECT * FROM " + Constants.TABLE_REPOSITORIES)
3032
Cursor selectAll();
3133

3234
/* For ContentProvider */
35+
@NonNull
3336
@Query("SELECT * FROM " + Constants.TABLE_REPOSITORIES + " WHERE id LIKE :itemId LIMIT 1")
34-
Cursor getCursor(Long itemId);
37+
Cursor getCursor(@NonNull Long itemId);
3538

39+
@NonNull
3640
@Query("SELECT * FROM " + Constants.TABLE_REPOSITORIES + " WHERE id LIKE :itemId LIMIT 1")
37-
Repository getItem(Long itemId);
41+
Repository getItem(@NonNull Long itemId);
3842

43+
@NonNull
3944
@Insert()
40-
Long insert(Repository item);
45+
Long insert(@NonNull Repository item);
4146

4247
@Update()
43-
int update(Repository item);
48+
int update(@NonNull Repository item);
4449

4550
@Delete()
46-
void delete(Repository item);
51+
void delete(@NonNull Repository item);
4752

4853
@Query("DELETE FROM " + Constants.TABLE_REPOSITORIES + " WHERE id = :itemId")
49-
int deleteById(Long itemId);
54+
int deleteById(@NonNull Long itemId);
5055

5156
@Query("DELETE FROM " + Constants.TABLE_REPOSITORIES)
5257
void clear();

library/src/main/java/io/syslogic/github/api/room/WorkflowsDao.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.database.Cursor;
44

5+
import androidx.annotation.NonNull;
56
import androidx.room.Dao;
67
import androidx.room.Delete;
78
import androidx.room.Insert;
@@ -21,32 +22,37 @@
2122
@Dao
2223
public interface WorkflowsDao {
2324

24-
// @Transaction
25+
@NonNull
2526
@Query("SELECT * FROM " + Constants.TABLE_WORKFLOWS)
2627
List<Workflow> getItems();
2728

2829
/* For ContentProvider */
30+
@NonNull
2931
@Query("SELECT * FROM " + Constants.TABLE_WORKFLOWS)
3032
Cursor selectAll();
3133

3234
/* For ContentProvider */
35+
@NonNull
3336
@Query("SELECT * FROM " + Constants.TABLE_WORKFLOWS + " WHERE id LIKE :itemId LIMIT 1")
34-
Cursor getCursor(Long itemId);
37+
Cursor getCursor(@NonNull Long itemId);
3538

39+
@NonNull
3640
@Query("SELECT * FROM " + Constants.TABLE_WORKFLOWS + " WHERE id LIKE :itemId LIMIT 1")
37-
Workflow getItem(Long itemId);
41+
Workflow getItem(@NonNull Long itemId);
3842

43+
@NonNull
3944
@Insert()
40-
Long insert(Workflow item);
45+
Long insert(@NonNull Workflow item);
4146

4247
@Update()
43-
int update(Workflow item);
48+
int update(@NonNull Workflow item);
4449

4550
@Delete()
46-
void delete(Workflow item);
51+
void delete(@NonNull Workflow item);
4752

53+
@SuppressWarnings("unused")
4854
@Query("DELETE FROM " + Constants.TABLE_WORKFLOWS + " WHERE id = :itemId")
49-
int deleteById(Long itemId);
55+
int deleteById(@NonNull Long itemId);
5056

5157
@Query("DELETE FROM " + Constants.TABLE_WORKFLOWS)
5258
void clear();

library/src/main/java/io/syslogic/github/api/utils/DateConverter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
*/
1313
public class DateConverter {
1414

15+
@NonNull
1516
@TypeConverter
16-
public Date fromLong(Long value) {
17+
public Date fromLong(@NonNull Long value) {
1718
return new Date(value);
1819
}
1920

21+
@NonNull
2022
@TypeConverter
2123
public Long toLong(@NonNull Date value) {
2224
return value.getTime();

0 commit comments

Comments
 (0)