Package com.mwdle.bitwarden.model
Enum Class BitwardenItemType
- All Implemented Interfaces:
Serializable
,Comparable<BitwardenItemType>
,Constable
Represents the type of Bitwarden item, mapped from the integer code provided by the CLI.
This enum is designed to be directly used in Jackson deserialization.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic BitwardenItemType
fromInteger
(int typeCode) Deserializes an integer from JSON into the correspondingBitwardenItemType
.int
Serializes this enum constant into its corresponding integer code for JSON.static BitwardenItemType
Returns the enum constant of this class with the specified name.static BitwardenItemType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LOGIN
-
SECURE_NOTE
-
CARD
-
IDENTITY
-
SSH_KEY
-
UNKNOWN
A fallback for any unknown or unsupported item types.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
fromInteger
Deserializes an integer from JSON into the correspondingBitwardenItemType
. This method is used by the Jackson library.- Parameters:
typeCode
- The integer value from the "type" field in the JSON.- Returns:
- The corresponding
BitwardenItemType
, orUNKNOWN
if not found.
-
getTypeCode
public int getTypeCode()Serializes this enum constant into its corresponding integer code for JSON.- Returns:
- The integer code for the enum constant.
-