Interface VectorMappable

All Superinterfaces:
ValueMappable
All Known Implementing Classes:
CvssV2Data.AccessComplexityType, CvssV2Data.AccessVectorType, CvssV2Data.AuthenticationType, CvssV2Data.CiaRequirementType, CvssV2Data.CiaType, CvssV2Data.CollateralDamagePotentialType, CvssV2Data.ExploitabilityType, CvssV2Data.RemediationLevelType, CvssV2Data.ReportConfidenceType, CvssV2Data.TargetDistributionType, CvssV3Data.AttackComplexityType, CvssV3Data.AttackVectorType, CvssV3Data.CiaRequirementType, CvssV3Data.CiaType, CvssV3Data.ConfidenceType, CvssV3Data.ExploitCodeMaturityType, CvssV3Data.ModifiedAttackComplexityType, CvssV3Data.ModifiedAttackVectorType, CvssV3Data.ModifiedCiaType, CvssV3Data.ModifiedPrivilegesRequiredType, CvssV3Data.ModifiedScopeType, CvssV3Data.ModifiedUserInteractionType, CvssV3Data.PrivilegesRequiredType, CvssV3Data.RemediationLevelType, CvssV3Data.ScopeType, CvssV3Data.UserInteractionType, CvssV4Data.AttackComplexityType, CvssV4Data.AttackRequirementsType, CvssV4Data.AttackVectorType, CvssV4Data.AutomatableType, CvssV4Data.CiaRequirementType, CvssV4Data.CiaType, CvssV4Data.ExploitMaturityType, CvssV4Data.ModifiedAttackComplexityType, CvssV4Data.ModifiedAttackRequirementsType, CvssV4Data.ModifiedAttackVectorType, CvssV4Data.ModifiedCiaType, CvssV4Data.ModifiedPrivilegesRequiredType, CvssV4Data.ModifiedSubCType, CvssV4Data.ModifiedSubIaType, CvssV4Data.ModifiedUserInteractionType, CvssV4Data.ModifiedVulnCiaType, CvssV4Data.PrivilegesRequiredType, CvssV4Data.ProviderUrgencyType, CvssV4Data.RecoveryType, CvssV4Data.SafetyType, CvssV4Data.UserInteractionType, CvssV4Data.ValueDensityType, CvssV4Data.VulnerabilityResponseEffortType

interface VectorMappable extends ValueMappable
A type that can be serialized to/from a vector string with a defined value in addition to its canonical value within JSON or XML.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.github.jeremylong.openvulnerability.client.nvd.ValueMappable

    ValueMappable.Lookup<E extends Enum<E> & ValueMappable>
  • Method Summary

    Modifier and Type
    Method
    Description
    static <E extends Enum<E> & VectorMappable>
    ValueMappable.Lookup<E>
    create(Class<E> enumClass)
    Indexes the passed enum class as a lookup table for types by their value and by the vector string value, treating all values as case-sensitive, except the single-char canonical vector string value of "X"/"x".
    static <E extends Enum<E> & VectorMappable>
    ValueMappable.Lookup<E>
    createLenient(Class<E> enumClass)
    Indexes the passed enum class as a lookup table for types by their value and by the vector string value, treating vector string values case-insensitively (lenient).
     

    Methods inherited from interface io.github.jeremylong.openvulnerability.client.nvd.ValueMappable

    value
  • Method Details

    • vectorValue

      String vectorValue()
      Returns:
      The value as represented within a CVSS vector string
    • create

      static <E extends Enum<E> & VectorMappable> ValueMappable.Lookup<E> create(Class<E> enumClass)
      Indexes the passed enum class as a lookup table for types by their value and by the vector string value, treating all values as case-sensitive, except the single-char canonical vector string value of "X"/"x".

      Note that this is not necessarily strict for use across all vector types, as some older CVSS versions do not serialize not defined as "X".

      Type Parameters:
      E - The Enum type to map
      Parameters:
      enumClass - Type to index
      Returns:
      An immutable lookup table
    • createLenient

      static <E extends Enum<E> & VectorMappable> ValueMappable.Lookup<E> createLenient(Class<E> enumClass)
      Indexes the passed enum class as a lookup table for types by their value and by the vector string value, treating vector string values case-insensitively (lenient).

      Note that this is not necessarily safe for use across all vector types, as some vector strings are serialized as multi-char values.

      Type Parameters:
      E - The Enum type to map
      Parameters:
      enumClass - Type to index
      Returns:
      An immutable lookup table