Class WellFormedName

java.lang.Object
gov.nist.secauto.cpe.common.WellFormedName

public class WellFormedName
extends java.lang.Object
The WellFormedName class represents a Well Formed Name, as defined in the CPE Specification version 2.3.
Author:
Joshua Kraunelis, David Waltermire
See Also:
NISTIR 7695 Section 5
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  WellFormedName.Attribute  
  • Constructor Summary

    Constructors 
    Constructor Description
    WellFormedName()
    Constructs a new WellFormedName object, with all components set to the default value "ANY".
    WellFormedName​(java.lang.Object part, java.lang.Object vendor, java.lang.Object product, java.lang.Object version, java.lang.Object update, java.lang.Object edition, java.lang.Object language, java.lang.Object swEdition, java.lang.Object targetSoftware, java.lang.Object targetHardware, java.lang.Object other)
    Constructs a new WellFormedName object, setting each component to the given parameter value.
  • Method Summary

    Modifier and Type Method Description
    java.lang.Object get​(WellFormedName.Attribute attribute)
    get the value of the provided attribute.
    void set​(WellFormedName.Attribute attribute, java.lang.Object value)
    Sets the given attribute to value, if the attribute is in the list of permissible components.
    java.lang.String toString()
    Get the string representation of this WellFormedName.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • WellFormedName

      public WellFormedName()
      Constructs a new WellFormedName object, with all components set to the default value "ANY".
      Throws:
      java.lang.RuntimeException - if this implementation is incorrect
    • WellFormedName

      public WellFormedName​(java.lang.Object part, java.lang.Object vendor, java.lang.Object product, java.lang.Object version, java.lang.Object update, java.lang.Object edition, java.lang.Object language, java.lang.Object swEdition, java.lang.Object targetSoftware, java.lang.Object targetHardware, java.lang.Object other) throws java.text.ParseException
      Constructs a new WellFormedName object, setting each component to the given parameter value. If a parameter is null, the component is set to the default value "ANY".
      Parameters:
      part - string representing the part component
      vendor - string representing the vendor component
      product - string representing the product component
      version - string representing the version component
      update - string representing the update component
      edition - string representing the edition component
      language - string representing the language component
      swEdition - string representing the sw_edition component
      targetSoftware - string representing the target_sw component
      targetHardware - string representing the target_hw component
      other - string representing the other component
      Throws:
      java.text.ParseException - if any of the provided values are invalid
  • Method Details

    • get

      public java.lang.Object get​(WellFormedName.Attribute attribute)
      get the value of the provided attribute.
      Parameters:
      attribute - String representing the component value to get
      Returns:
      the String value of the given component, or default value LogicalValue.ANY if the component does not exist
    • set

      public final void set​(WellFormedName.Attribute attribute, java.lang.Object value) throws java.text.ParseException
      Sets the given attribute to value, if the attribute is in the list of permissible components.
      Parameters:
      attribute - enumerated value representing the component to set
      value - Object representing the value of the given component
      Throws:
      java.text.ParseException - if the provided value is invalid
    • toString

      public java.lang.String toString()
      Get the string representation of this WellFormedName.
      Overrides:
      toString in class java.lang.Object
      Returns:
      the string representation of the WellFormedName