/*
|
* 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;
|
}
|
}
|