Skip to content

Commit a35624b

Browse files
committed
more javadoc comments.
1 parent 0d812a2 commit a35624b

File tree

6 files changed

+129
-15
lines changed

6 files changed

+129
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The JitPack repository URL would be: `maven { url 'https://jitpack.io' }`
2929

3030
dependencies {
3131
// implementation "io.syslogic:androidx-github:master-SNAPSHOT"
32-
implementation "io.syslogic:androidx-github:1.1.7"
32+
implementation "io.syslogic:androidx-github:1.1.8"
3333
}
3434

3535
[![Release](https://jitpack.io/v/syslogic/androidx-github.svg)](https://jitpack.io/#io.syslogic/androidx-github)

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

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,49 @@
2121
@Dao
2222
public interface LicensesDao {
2323

24+
/** @return a list of {@link License} records. */
2425
@Query("SELECT * FROM " + Constants.TABLE_LICENSES)
2526
List<License> getItems();
2627

27-
/* For ContentProvider */
28+
/** @return one {@link License} record. */
29+
@Query("SELECT * FROM " + Constants.TABLE_LICENSES + " WHERE id LIKE :itemId LIMIT 1")
30+
License getItem(Long itemId);
31+
32+
/**
33+
* For ContentProvider
34+
* @return a cursor.
35+
*/
2836
@Query("SELECT * FROM " + Constants.TABLE_LICENSES)
2937
Cursor selectAll();
3038

39+
/**
40+
* @param item the {@link License} to insert.
41+
* @return the id of the item inserted.
42+
*/
3143
@Insert()
3244
Long insert(License item);
3345

46+
/**
47+
* @param item the {@link License} to update.
48+
*/
3449
@Update()
3550
void update(License item);
3651

52+
/**
53+
* @param item the {@link License} to delete.
54+
*/
3755
@Delete()
3856
void delete(License item);
3957

58+
/**
59+
* Delete one {@link License} record by ID.
60+
* @return the number of affected records.
61+
*/
4062
@SuppressWarnings("unused")
4163
@Query("DELETE FROM " + Constants.TABLE_LICENSES + " WHERE id = :itemId")
42-
void deleteById(Long itemId);
64+
int deleteById(Long itemId);
4365

66+
/** Delete all {@link License} records. */
4467
@Query("DELETE FROM " + Constants.TABLE_LICENSES)
4568
void clear();
4669
}

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,49 @@
2121
@Dao
2222
public interface OwnersDao {
2323

24+
/** @return a list of {@link Owner} records. */
2425
@Query("SELECT * FROM " + Constants.TABLE_OWNERS)
2526
List<Owner> getItems();
2627

27-
/* For ContentProvider */
28+
/** @return one {@link Owner} record. */
29+
@Query("SELECT * FROM " + Constants.TABLE_OWNERS + " WHERE id LIKE :itemId LIMIT 1")
30+
Owner getItem(Long itemId);
31+
32+
/**
33+
* For ContentProvider
34+
* @return a cursor.
35+
*/
2836
@Query("SELECT * FROM " + Constants.TABLE_OWNERS)
2937
Cursor selectAll();
3038

39+
/**
40+
* @param item the {@link Owner} to insert.
41+
* @return the id of the item inserted.
42+
*/
3143
@Insert()
3244
Long insert(Owner item);
3345

46+
/**
47+
* @param item the {@link Owner} to update.
48+
*/
3449
@Update()
3550
void update(Owner item);
3651

52+
/**
53+
* @param item the {@link Owner} to delete.
54+
*/
3755
@Delete()
3856
void delete(Owner item);
3957

58+
/**
59+
* Delete one {@link Owner} record by ID.
60+
* @return the number of affected records.
61+
*/
4062
@SuppressWarnings("unused")
4163
@Query("DELETE FROM " + Constants.TABLE_OWNERS + " WHERE id = :itemId")
4264
void deleteById(Long itemId);
4365

66+
/** Delete all {@link Owner} records. */
4467
@Query("DELETE FROM " + Constants.TABLE_OWNERS)
4568
void clear();
4669
}

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,49 @@
2121
@Dao
2222
public interface QueryStringsDao {
2323

24+
/** @return a list of {@link QueryString} records. */
2425
@Query("SELECT * FROM " + Constants.TABLE_QUERY_STRINGS)
2526
List<QueryString> getItems();
2627

28+
/** @return one {@link QueryString} record. */
2729
@Query("SELECT * FROM " + Constants.TABLE_QUERY_STRINGS + " WHERE id = :itemId")
2830
QueryString getItem(Long itemId);
2931

30-
/* For ContentProvider */
32+
/**
33+
* For ContentProvider
34+
* @return a cursor.
35+
*/
3136
@Query("SELECT * FROM " + Constants.TABLE_QUERY_STRINGS)
3237
Cursor selectAll();
3338

39+
/**
40+
* @param item the {@link QueryString} to insert.
41+
* @return the id of the item inserted.
42+
*/
3443
@Insert()
3544
Long insert(QueryString item);
3645

46+
/**
47+
* @param item the {@link QueryString} to update.
48+
*/
3749
@Update()
3850
int update(QueryString item);
3951

52+
/**
53+
* @param item the {@link QueryString} to delete.
54+
*/
4055
@Delete()
4156
void delete(QueryString item);
4257

58+
/**
59+
* Delete one {@link QueryString} record by ID.
60+
* @return the number of affected records.
61+
*/
4362
@SuppressWarnings("unused")
4463
@Query("DELETE FROM " + Constants.TABLE_QUERY_STRINGS + " WHERE id = :itemId")
4564
int deleteById(Long itemId);
4665

66+
/** Delete all {@link QueryString} records. */
4767
@Query("DELETE FROM " + Constants.TABLE_QUERY_STRINGS)
4868
void clear();
4969
}

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

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,56 @@
2121
@Dao
2222
public interface RepositoriesDao {
2323

24+
/** @return a list of {@link Repository} records. */
2425
@Query("SELECT * FROM " + Constants.TABLE_REPOSITORIES)
2526
List<Repository> getItems();
2627

27-
/* For ContentProvider */
28+
/** @return one {@link Repository} record. */
29+
@Query("SELECT * FROM " + Constants.TABLE_REPOSITORIES + " WHERE id LIKE :itemId LIMIT 1")
30+
Repository getItem(Long itemId);
31+
32+
/**
33+
* For ContentProvider
34+
* @return a cursor.
35+
*/
2836
@Query("SELECT * FROM " + Constants.TABLE_REPOSITORIES)
2937
Cursor selectAll();
3038

31-
/* For ContentProvider */
39+
/**
40+
* For ContentProvider
41+
* @param itemId the id of the record.
42+
* @return a cursor.
43+
*/
3244
@Query("SELECT * FROM " + Constants.TABLE_REPOSITORIES + " WHERE id LIKE :itemId LIMIT 1")
3345
Cursor getCursor(Long itemId);
3446

35-
@Query("SELECT * FROM " + Constants.TABLE_REPOSITORIES + " WHERE id LIKE :itemId LIMIT 1")
36-
Repository getItem(Long itemId);
37-
47+
/**
48+
* @param item the {@link Repository} to insert.
49+
* @return the id of the item inserted.
50+
*/
3851
@Insert()
3952
Long insert(Repository item);
4053

54+
/**
55+
* @param item the {@link Repository} to update.
56+
*/
4157
@Update()
4258
int update(Repository item);
4359

60+
/**
61+
* @param item the {@link Repository} to delete.
62+
*/
4463
@Delete()
4564
void delete(Repository item);
4665

66+
/**
67+
* Delete one {@link Repository} record by ID.
68+
* @return the number of affected records.
69+
*/
4770
@Query("DELETE FROM " + Constants.TABLE_REPOSITORIES + " WHERE id = :itemId")
4871
int deleteById(Long itemId);
4972

73+
/** Delete all {@link Repository} records. */
5074
@Query("DELETE FROM " + Constants.TABLE_REPOSITORIES)
5175
void clear();
5276
}

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

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,57 @@
2121
@Dao
2222
public interface WorkflowsDao {
2323

24+
/** @return a list of {@link Workflow} records. */
2425
@Query("SELECT * FROM " + Constants.TABLE_WORKFLOWS)
2526
List<Workflow> getItems();
2627

27-
/* For ContentProvider */
28+
/** @return one {@link Workflow} record. */
29+
@Query("SELECT * FROM " + Constants.TABLE_WORKFLOWS + " WHERE id LIKE :itemId LIMIT 1")
30+
Workflow getItem(Long itemId);
31+
32+
/**
33+
* For ContentProvider
34+
* @return a cursor.
35+
*/
2836
@Query("SELECT * FROM " + Constants.TABLE_WORKFLOWS)
2937
Cursor selectAll();
3038

31-
/* For ContentProvider */
39+
/**
40+
* For ContentProvider
41+
* @param itemId the id of the record.
42+
* @return a cursor.
43+
*/
3244
@Query("SELECT * FROM " + Constants.TABLE_WORKFLOWS + " WHERE id LIKE :itemId LIMIT 1")
3345
Cursor getCursor(Long itemId);
3446

35-
@Query("SELECT * FROM " + Constants.TABLE_WORKFLOWS + " WHERE id LIKE :itemId LIMIT 1")
36-
Workflow getItem(Long itemId);
37-
47+
/**
48+
* @param item the {@link Workflow} to insert.
49+
* @return the id of the item inserted.
50+
*/
3851
@Insert()
3952
Long insert(Workflow item);
4053

54+
/**
55+
* @param item the {@link Workflow} to update.
56+
*/
4157
@Update()
4258
int update(Workflow item);
4359

60+
/**
61+
* @param item the {@link Workflow} to delete.
62+
*/
4463
@Delete()
4564
void delete(Workflow item);
4665

66+
/**
67+
* Delete one {@link Workflow} record by ID.
68+
* @return the number of affected records.
69+
*/
4770
@SuppressWarnings("unused")
4871
@Query("DELETE FROM " + Constants.TABLE_WORKFLOWS + " WHERE id = :itemId")
4972
int deleteById(Long itemId);
5073

74+
/** Delete all {@link Workflow} records. */
5175
@Query("DELETE FROM " + Constants.TABLE_WORKFLOWS)
5276
void clear();
5377
}

0 commit comments

Comments
 (0)