Commit b26b2e129de0324a6cd06ecbecf813166cac6626

Authored by jcartign
1 parent c07d86ab

Clarify Javadocs API

src/main/java/fr/plil/sio/persistence/api/Group.java
@@ -3,6 +3,10 @@ package fr.plil.sio.persistence.api; @@ -3,6 +3,10 @@ package fr.plil.sio.persistence.api;
3 import java.util.LinkedList; 3 import java.util.LinkedList;
4 import java.util.List; 4 import java.util.List;
5 5
  6 +/**
  7 + * A group is unique by its name (no two groups with the same name or the same ID can exist in the database).
  8 + * A group contains a list of rights unique by their ID (no two groups with the same ID can exist in the database).
  9 + */
6 public class Group { 10 public class Group {
7 11
8 private Long id; 12 private Long id;
src/main/java/fr/plil/sio/persistence/api/GroupService.java
@@ -4,7 +4,7 @@ public interface GroupService { @@ -4,7 +4,7 @@ public interface GroupService {
4 4
5 /** 5 /**
6 * Create a group with a specific name in the database. 6 * Create a group with a specific name in the database.
7 - * There is no two groups with the same name in the database. 7 + * There is no two groups with the same name or the same ID in the database.
8 * 8 *
9 * @param name the name of the group 9 * @param name the name of the group
10 * @return an instance of the group 10 * @return an instance of the group
@@ -23,7 +23,7 @@ public interface GroupService { @@ -23,7 +23,7 @@ public interface GroupService {
23 boolean delete(String name); 23 boolean delete(String name);
24 24
25 /** 25 /**
26 - * Find a group in the database based on its name. Only references at one level are available (i.e. the users 26 + * Find a group in the database based on its name. Only references at one level are loaded (i.e. the users
27 * who belong to the group). 27 * who belong to the group).
28 * 28 *
29 * @param name the name of the group to search for. 29 * @param name the name of the group to search for.
src/main/java/fr/plil/sio/persistence/api/Right.java
@@ -3,6 +3,11 @@ package fr.plil.sio.persistence.api; @@ -3,6 +3,11 @@ package fr.plil.sio.persistence.api;
3 import java.util.LinkedList; 3 import java.util.LinkedList;
4 import java.util.List; 4 import java.util.List;
5 5
  6 +/**
  7 + * A right is unique by itd ID, i.e. it can exist two rights with the same name in the database.
  8 + * A right may have a parent, null else.
  9 + * A right can have zero, one or more siblings.
  10 + */
6 public class Right { 11 public class Right {
7 12
8 private Long id; 13 private Long id;
src/main/java/fr/plil/sio/persistence/api/User.java
1 package fr.plil.sio.persistence.api; 1 package fr.plil.sio.persistence.api;
2 2
  3 +/**
  4 + * An user MUST have a group in the database.
  5 + * An user is unique by it name, i.e. database cannot contain two user with the same name or the same ID.
  6 + */
3 public class User { 7 public class User {
4 8
5 private Long id; 9 private Long id;