dev.fitko.fitconnect.api.domain.zbp.message.AuthenticationLevel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client Show documentation
Show all versions of client Show documentation
Library that provides client access to the FIT-Connect api-endpoints for sending, subscribing and
routing
package dev.fitko.fitconnect.api.domain.zbp.message;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
import java.util.Arrays;
/**
* Representation of the STORK-QAA-Levels
*/
@Getter
public enum AuthenticationLevel {
/**
* Basisregistrierung
*/
ONE(1),
/**
* Niedrig
*/
TWO(2),
/**
* Substantiell
*/
THREE(3),
/**
* Hoch
*/
FOUR(4);
@JsonValue
private final int level;
AuthenticationLevel(int level) {
this.level = level;
}
public static AuthenticationLevel fromInt(int level){
return Arrays.stream(values())
.filter(a -> a.getLevel() == level)
.findFirst()
.orElseThrow(() -> new IllegalArgumentException("AuthenticationLevel not available"));
}
}