Class SimpleLangString

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

public final class SimpleLangString extends Object implements Serializable
Represents a simple langstring element as defined in the TinCan XSD schema.

According to the official TinCan XSD schema, langstring elements have:

  • Text content directly in the element
  • An optional lang attribute for language specification

Example XML:


 <name lang="en-US">Course Title</name>
 <description lang="en-US">Course description</description>
 <launch lang="en-US">index.html</launch>
 

This differs from the complex TextType which uses nested langstring child elements.

See Also:
  • Constructor Details

    • SimpleLangString

      public SimpleLangString()
      Default no-argument constructor.
    • SimpleLangString

      public SimpleLangString(String value, String lang)
      Constructor with value and language.
      Parameters:
      value - the text value
      lang - the language code (may be null)
  • Method Details

    • getValue

      public String getValue()
      Gets the text value.
      Returns:
      the text value
    • setValue

      public void setValue(String value)
      Sets the text value.
      Parameters:
      value - the text value
    • getLang

      public String getLang()
      Gets the language code.
      Returns:
      the language code, or null if not specified
    • setLang

      public void setLang(String lang)
      Sets the language code.
      Parameters:
      lang - the language code
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object