Kenmegne
6 days ago 6494941037ae2670876de9940853d50538eb5129
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Enum.java to edit this template
 */
package com.megatim.reporting.adhoc.pojo.enums;
 
import java.util.stream.Stream;
 
/**
 *
 * @author ASUS
 */
public enum Position {
    LEFT("GAUCHE"), RIGHT("DROITE");
    
    private final String position;
    
    private Position(String pos) {
        this.position = pos;
    }
 
    @Override
    public String toString() {
        return  position ;
    }
    
     public static Position of(String position) {
        return Stream.of(Position.values())
          .filter(p -> p.getPosition().equalsIgnoreCase(position) || p.name().equalsIgnoreCase(position))
          .findFirst()
          .orElseThrow(IllegalArgumentException::new);
    }
     
     public String getPosition() {
         return position;
     }
}