package fr.paris10.projet.assogenda.assogenda.util;

/**
 * Created by valentin on 22/01/17.
 */

public class Period {
    private int begin;
    private int end;

    public Period(int begin, int end) throws PeriodException{
        if(begin > end || begin == end)
            throw new PeriodException("Begin must be lower or different than end");
        if(begin < 0 || begin > 24 || end < 0 || begin > 24 || begin > end)
            throw new PeriodException("A period can't exceed 24hours or have negative values");
        this.begin = begin;
        this.end = end;
    }
}

@@ -218,16 +218,17 @@
 xception
+ 
 %7B%0A      
@@ -227,24 +227,25 @@
 %7B%0A        if
+ 
 (begin %3E end
@@ -319,34 +319,40 @@
  be 
-lower or different than en
+inferior to the end of the perio
 d%22);
@@ -362,16 +362,17 @@
       if
+ 
 (begin %3C
@@ -391,48 +391,136 @@
 %3E 24
- %7C%7C end %3C 0 %7C%7C begin %3E 24 %7C%7C begin %3E end
+)%0A            throw new PeriodException(%22Begin of period can't be negative of exceed 24 hours%22);%0A        if (end %3C 0 %7C%7C end %3E 24
 )%0A  
@@ -560,9 +560,16 @@
 on(%22
-A
+End of a
  per
@@ -578,16 +578,31 @@
 d can't 
+be negative or 
 exceed 2
@@ -606,37 +606,14 @@
 d 24
+ 
 hours
- or have negative values
 %22);%0A

Fix constructor to identify wrong period