From b26b2e129de0324a6cd06ecbecf813166cac6626 Mon Sep 17 00:00:00 2001 From: jcartign Date: Tue, 20 Sep 2016 09:56:31 +0200 Subject: [PATCH] Clarify Javadocs API --- src/main/java/fr/plil/sio/persistence/api/Group.java | 4 ++++ src/main/java/fr/plil/sio/persistence/api/GroupService.java | 4 ++-- src/main/java/fr/plil/sio/persistence/api/Right.java | 5 +++++ src/main/java/fr/plil/sio/persistence/api/User.java | 4 ++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/java/fr/plil/sio/persistence/api/Group.java b/src/main/java/fr/plil/sio/persistence/api/Group.java index c629518..cd04459 100644 --- a/src/main/java/fr/plil/sio/persistence/api/Group.java +++ b/src/main/java/fr/plil/sio/persistence/api/Group.java @@ -3,6 +3,10 @@ package fr.plil.sio.persistence.api; import java.util.LinkedList; import java.util.List; +/** + * A group is unique by its name (no two groups with the same name or the same ID can exist in the database). + * A group contains a list of rights unique by their ID (no two groups with the same ID can exist in the database). + */ public class Group { private Long id; diff --git a/src/main/java/fr/plil/sio/persistence/api/GroupService.java b/src/main/java/fr/plil/sio/persistence/api/GroupService.java index c20990a..94eb212 100644 --- a/src/main/java/fr/plil/sio/persistence/api/GroupService.java +++ b/src/main/java/fr/plil/sio/persistence/api/GroupService.java @@ -4,7 +4,7 @@ public interface GroupService { /** * Create a group with a specific name in the database. - * There is no two groups with the same name in the database. + * There is no two groups with the same name or the same ID in the database. * * @param name the name of the group * @return an instance of the group @@ -23,7 +23,7 @@ public interface GroupService { boolean delete(String name); /** - * Find a group in the database based on its name. Only references at one level are available (i.e. the users + * Find a group in the database based on its name. Only references at one level are loaded (i.e. the users * who belong to the group). * * @param name the name of the group to search for. diff --git a/src/main/java/fr/plil/sio/persistence/api/Right.java b/src/main/java/fr/plil/sio/persistence/api/Right.java index 291f2c0..9d1ed36 100644 --- a/src/main/java/fr/plil/sio/persistence/api/Right.java +++ b/src/main/java/fr/plil/sio/persistence/api/Right.java @@ -3,6 +3,11 @@ package fr.plil.sio.persistence.api; import java.util.LinkedList; import java.util.List; +/** + * A right is unique by itd ID, i.e. it can exist two rights with the same name in the database. + * A right may have a parent, null else. + * A right can have zero, one or more siblings. + */ public class Right { private Long id; diff --git a/src/main/java/fr/plil/sio/persistence/api/User.java b/src/main/java/fr/plil/sio/persistence/api/User.java index cbc3f27..f19c759 100644 --- a/src/main/java/fr/plil/sio/persistence/api/User.java +++ b/src/main/java/fr/plil/sio/persistence/api/User.java @@ -1,5 +1,9 @@ package fr.plil.sio.persistence.api; +/** + * An user MUST have a group in the database. + * An user is unique by it name, i.e. database cannot contain two user with the same name or the same ID. + */ public class User { private Long id; -- libgit2 0.21.2