Interface ValueMappable

All Known Subinterfaces:
VectorMappable
All Known Implementing Classes:
Config.Operator, CveTag.TagType, CvssV2.Type, CvssV2Data.AccessComplexityType, CvssV2Data.AccessVectorType, CvssV2Data.AuthenticationType, CvssV2Data.CiaRequirementType, CvssV2Data.CiaType, CvssV2Data.CollateralDamagePotentialType, CvssV2Data.ExploitabilityType, CvssV2Data.RemediationLevelType, CvssV2Data.ReportConfidenceType, CvssV2Data.TargetDistributionType, CvssV2Data.Version, CvssV3.Type, 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.SeverityType, CvssV3Data.UserInteractionType, CvssV3Data.Version, CvssV4.Type, 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.SeverityType, CvssV4Data.UserInteractionType, CvssV4Data.ValueDensityType, CvssV4Data.Version, CvssV4Data.VulnerabilityResponseEffortType, Node.Operator

interface ValueMappable
A type that can be serialized to/from a string within CVSS as JSON or XML.
  • Method Details

    • value

      String value()
      Returns:
      The value as represented when serialized according to official CVSS serialization specs.
    • create

      static <E extends Enum<E> & ValueMappable> ValueMappable.Lookup<E> create(Class<E> enumClass)
      Indexes the passed enum class as a lookup table for types by their value.
      Type Parameters:
      E - The Enum type to map
      Parameters:
      enumClass - Type to index
      Returns:
      An immutable lookup table
    • getOrThrow

      static <E extends Enum<E>> E getOrThrow(Map<String,E> constants, String value)
      Looks up the passed value directly, treating all values as case-sensitive.
      Parameters:
      constants - lookup map
      value - the value to look up
      Throws:
      IllegalArgumentException - if the value cannot be mapped to an enum.