public enum DIDFeature extends Enum<DIDFeature>
| Enum Constant and Description |
|---|
EMERGENCY |
INTERNATIONAL_ACCESS |
UNKNOWN |
VANITY |
VOICE_IN |
VOICE_OUT |
| Modifier and Type | Field and Description |
|---|---|
int |
bit
Power-of-two bitmask representation (1, 2, 4, 8, 16, etc.) used for compact storage.
|
String |
displayStr
Human-readable name used in UI or logs.
|
Integer |
value
Legacy numeric value for backward compatibility (e.g., from database).
|
| Modifier and Type | Method and Description |
|---|---|
static List<String> |
decodeDisplayStrings(int mask)
Converts a bitmask into a list of display strings.
|
static DIDFeature |
fromBit(int bit)
Gets the DIDFeature corresponding to a specific bitmask bit.
|
static DIDFeature |
fromName(String name)
Gets the DIDFeature corresponding to a display name (case-insensitive).
|
static DIDFeature |
fromValue(Integer value)
Gets the DIDFeature corresponding to a legacy numeric value (1–5).
|
static LinkedHashSet<Integer> |
getAllPossibleMasksFromFeatureIds(LinkedHashSet<Integer> featureValues)
Generates all possible mask values that include VOICE_IN along with all possible combinations
of the input feature values.
|
static Set<Integer> |
getAllPossibleMasksWithVoiceIn()
Returns a set of all possible valid mask values where VOICE_IN is always included,
combined with all other possible feature combinations.
|
static LinkedHashSet<Integer> |
getDIDFeatureIdsFromMask(int mask) |
static LinkedHashSet<DIDFeature> |
getDIDFeaturesFromMask(int mask)
Decodes a bitmask into a list of DIDFeature enums.
|
static int |
getFeatureMaskFromFeatureIds(LinkedHashSet<Integer> featureIdSet)
Constructs a feature mask (bitwise OR) from a set of legacy feature values.
|
static int |
getFeatureMaskFromFeatureIds(LinkedHashSet<Integer> featureIdSet,
boolean isDefaultVoiceIn)
Constructs a feature mask (bitwise OR) from a set of legacy feature values.
|
static String |
getFeatureNamesFromIds(Set<Integer> featureIds)
Converts a set of legacy feature values to a comma-separated string of feature names.
|
static String |
getFeatureNamesFromMask(int mask)
Converts a bitmask to a single comma-separated string of feature names.
|
static void |
main(String[] args) |
static DIDFeature |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DIDFeature[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DIDFeature VOICE_IN
public static final DIDFeature VOICE_OUT
public static final DIDFeature EMERGENCY
public static final DIDFeature VANITY
public static final DIDFeature INTERNATIONAL_ACCESS
public static final DIDFeature UNKNOWN
public final Integer value
public final String displayStr
public final int bit
public static DIDFeature[] values()
for (DIDFeature c : DIDFeature.values()) System.out.println(c);
public static DIDFeature valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static DIDFeature fromValue(Integer value)
value - the legacy valuepublic static DIDFeature fromBit(int bit)
bit - the power-of-two bitmask valuepublic static LinkedHashSet<DIDFeature> getDIDFeaturesFromMask(int mask)
mask - the combined bitmask valuepublic static LinkedHashSet<Integer> getDIDFeatureIdsFromMask(int mask)
public static List<String> decodeDisplayStrings(int mask)
mask - the combined bitmask valuepublic static String getFeatureNamesFromMask(int mask)
mask - the combined bitmask valuepublic static int getFeatureMaskFromFeatureIds(LinkedHashSet<Integer> featureIdSet)
featureIdSet - the set of legacy values (1–5)public static int getFeatureMaskFromFeatureIds(LinkedHashSet<Integer> featureIdSet, boolean isDefaultVoiceIn)
featureIdSet - the set of legacy values (1–5)public static Set<Integer> getAllPossibleMasksWithVoiceIn()
public static String getFeatureNamesFromIds(Set<Integer> featureIds)
featureIds - the set of legacy values (1-5)public static LinkedHashSet<Integer> getAllPossibleMasksFromFeatureIds(LinkedHashSet<Integer> featureValues)
featureValues - set of legacy feature values (1-5)public static DIDFeature fromName(String name)
name - the display name to look up (e.g., "Voice In")public static void main(String[] args)
Copyright © 2026. All rights reserved.