Blame view

src/main/java/fr/plil/sio/persistence/api/Right.java 1.04 KB
fd5e74ca   jcartign   First student ver...
1
2
  package fr.plil.sio.persistence.api;
  
d41edfbc   jcartign   Migrate modificat...
3
4
5
6
7
8
9
10
  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.
   */
fd5e74ca   jcartign   First student ver...
11
  
fd5e74ca   jcartign   First student ver...
12
13
  public class Right {
  
fd5e74ca   jcartign   First student ver...
14
15
      private Long id;
  
fd5e74ca   jcartign   First student ver...
16
17
      private String name;
  
e5e76a48   jcartign   Add persistence a...
18
      /// the parent right
fd5e74ca   jcartign   First student ver...
19
20
      private Right parent;
  
e5e76a48   jcartign   Add persistence a...
21
      /// the sibling right(s), eventually empty
d41edfbc   jcartign   Migrate modificat...
22
      private List<Right> siblings = new LinkedList<>();
fd5e74ca   jcartign   First student ver...
23
  
d41edfbc   jcartign   Migrate modificat...
24
      public List<Right> getSiblings() {
fd5e74ca   jcartign   First student ver...
25
26
27
          return siblings;
      }
  
d41edfbc   jcartign   Migrate modificat...
28
      public void setSiblings(List<Right> siblings) {
fd5e74ca   jcartign   First student ver...
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
          this.siblings = siblings;
      }
  
      public Long getId() {
          return id;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public Right getParent() {
          return parent;
      }
  
      public void setParent(Right parent) {
          this.parent = parent;
      }
  }