1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-06-28 22:44:50 +02:00
pgpainless/src/main/java/de/vanitasvitae/crypto/pgpainless/algorithm/Feature.java

34 lines
679 B
Java
Raw Normal View History

package de.vanitasvitae.crypto.pgpainless.algorithm;
2018-06-02 21:21:35 +02:00
import java.util.HashMap;
import java.util.Map;
import org.bouncycastle.bcpg.sig.Features;
public enum Feature {
MODIFICATION_DETECTION(Features.FEATURE_MODIFICATION_DETECTION),
;
private static final Map<Byte, Feature> MAP = new HashMap<>();
static {
for (Feature f : Feature.values()) {
MAP.put(f.featureId, f);
}
}
public static Feature fromId(byte id) {
return MAP.get(id);
}
private final byte featureId;
Feature(byte featureId) {
this.featureId = featureId;
}
public byte getFeatureId() {
return featureId;
}
}