Class TincanActivity

java.lang.Object
dev.jcputney.elearning.parser.input.xapi.tincan.TincanActivity

public class TincanActivity extends Object
Represents an activity element in a TinCan manifest.

According to the official TinCan XSD schema, activities use the langstring format where elements have text content and an optional lang attribute:

Example XML:


 <activity id="http://example.com/activity/1"
           type="http://adlnet.gov/expapi/activities/course">
   <name lang="en-US">Course Name</name>
   <description lang="en-US">Course description</description>
   <launch lang="en-US">index.html</launch>
 </activity>
 
  • Constructor Details

    • TincanActivity

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

      public TincanActivity(String id, String type, List<SimpleLangString> names, List<SimpleLangString> descriptions, List<SimpleLangString> launches)
      Constructor with all fields.
      Parameters:
      id - the activity IRI
      type - the activity type URI
      names - the activity names (may be multiple for different languages)
      descriptions - the activity descriptions (may be multiple for different languages)
      launches - the launch URLs (may be multiple for different languages)
  • Method Details

    • getId

      public String getId()
      Gets the activity ID (IRI).
      Returns:
      the activity ID
    • setId

      public void setId(String id)
      Sets the activity ID (IRI).
      Parameters:
      id - the activity ID
    • getType

      public String getType()
      Gets the activity type (IRI).
      Returns:
      the activity type
    • setType

      public void setType(String type)
      Sets the activity type (IRI).
      Parameters:
      type - the activity type
    • getNames

      public List<SimpleLangString> getNames()
      Gets the list of activity names.
      Returns:
      the list of activity names
    • setNames

      public void setNames(List<SimpleLangString> names)
      Sets the list of activity names.
      Parameters:
      names - the list of activity names
    • getName

      public String getName()
      Gets the first activity name value (for convenience).
      Returns:
      the first name value, or null if no names
    • getDescriptions

      public List<SimpleLangString> getDescriptions()
      Gets the list of activity descriptions.
      Returns:
      the list of activity descriptions
    • setDescriptions

      public void setDescriptions(List<SimpleLangString> descriptions)
      Sets the list of activity descriptions.
      Parameters:
      descriptions - the list of activity descriptions
    • getDescription

      public String getDescription()
      Gets the first activity description value (for convenience).
      Returns:
      the first description value, or null if no descriptions
    • getLaunches

      public List<SimpleLangString> getLaunches()
      Gets the list of launch URLs.
      Returns:
      the list of launch URLs
    • setLaunches

      public void setLaunches(List<SimpleLangString> launches)
      Sets the list of launch URLs.
      Parameters:
      launches - the list of launch URLs
    • getLaunch

      public String getLaunch()
      Gets the first launch URL value (for convenience).
      Returns:
      the first launch URL value, or null if no launches
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object