java.lang.Object
dev.jcputney.elearning.parser.input.xapi.types.LangString
All Implemented Interfaces:
Serializable

public final class LangString extends Object implements Serializable
Represents a single localized string with an optional language attribute.

Defined in the schema as:


 <xs:element name="langstring" maxOccurs="unbounded" minOccurs="1">
   <xs:complexType>
     <xs:simpleContent>
       <xs:extension base="xs:string">
         <xs:attribute name="lang" type="xs:language"/>
         <xs:attributeGroup ref="anyAttribute"/>
       </xs:extension>
     </xs:simpleContent>
   </xs:complexType>
 
See Also:
  • Constructor Details

    • LangString

      public LangString(String value, String lang)
      Constructs a new LangString with the specified value and language.
      Parameters:
      value - the actual text content of the localized string
      lang - the language of the string, represented as a String; this value is optional
    • LangString

      public LangString()
      Default no-argument constructor for the LangString class. Initializes a new instance of LangString with no initial value or language set.
  • Method Details

    • getValue

      public String getValue()
      Retrieves the value of the localized string.
      Returns:
      the actual text content of the localized string
    • setValue

      public void setValue(String value)
      Sets the value of the localized string.
      Parameters:
      value - the text content to set for the localized string
    • getLang

      public String getLang()
      Retrieves the language associated with the localized string.
      Returns:
      the language of the string as a String, or null if not set
    • setLang

      public void setLang(String lang)
      Sets the language attribute for the localized string.
      Parameters:
      lang - the language to associate with the string, represented as a String
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object