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

public final class LangString extends Object implements Serializable
Represents a LangString in LOM metadata, which is a collection of strings with language attributes. This type is used for fields such as title, description, and keyword.

 <xs:complexType name="LangString">
   <xs:choice minOccurs="0" maxOccurs="unbounded">
     <xs:element name="string" type="langString"/>
     <xs:group ref="ex:customElements"/>
   </xs:choice>
 </xs:complexType>

 <xs:complexType name="langString">
   <xs:simpleContent>
     <xs:extension base="CharacterString">
       <xs:attribute name="language" type="LanguageId"/>
     </xs:extension>
   </xs:simpleContent>
 </xs:complexType>
 
See Also:
  • Constructor Details

    • LangString

      public LangString(String language, String value)
      Constructs a LangString object with a specified language and value.
      Parameters:
      language - the language code for the string, generally using ISO 639-1 or ISO 639-3 codes
      value - the value of the string in the specified language
    • LangString

      public LangString(String value)
      Constructs a LangString object with a specified value.
      Parameters:
      value - the value of the string; typically representing text in a specific language
    • LangString

      public LangString()
      Default constructor for the LangString class. Constructs an instance of the LangString class without initializing the language or value fields. This constructor is primarily provided for use cases requiring an object without any preset state.
  • Method Details

    • getLanguage

      public String getLanguage()
      Retrieves the language associated with this instance.
      Returns:
      the language as a String
    • setLanguage

      public void setLanguage(String language)
      Sets the language attribute of this instance.
      Parameters:
      language - the language code to set, typically represented as an ISO 639-1 or ISO 639-3 code
    • getValue

      public String getValue()
      Retrieves the value of the string associated with this instance.
      Returns:
      the value as a String
    • setValue

      public void setValue(String value)
      Sets the value of this instance.
      Parameters:
      value - the string value to set; trimmed of leading whitespaces while preserving indentation
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object