Class TincanActivity
java.lang.Object
dev.jcputney.elearning.parser.input.xapi.tincan.TincanActivity
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 Summary
ConstructorsConstructorDescriptionDefault no-argument constructor.TincanActivity(String id, String type, List<SimpleLangString> names, List<SimpleLangString> descriptions, List<SimpleLangString> launches) Constructor with all fields. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the first activity description value (for convenience).Gets the list of activity descriptions.getId()Gets the activity ID (IRI).Gets the first launch URL value (for convenience).Gets the list of launch URLs.getName()Gets the first activity name value (for convenience).getNames()Gets the list of activity names.getType()Gets the activity type (IRI).inthashCode()voidsetDescriptions(List<SimpleLangString> descriptions) Sets the list of activity descriptions.voidSets the activity ID (IRI).voidsetLaunches(List<SimpleLangString> launches) Sets the list of launch URLs.voidsetNames(List<SimpleLangString> names) Sets the list of activity names.voidSets the activity type (IRI).
-
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 IRItype- the activity type URInames- 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
Gets the activity ID (IRI).- Returns:
- the activity ID
-
setId
Sets the activity ID (IRI).- Parameters:
id- the activity ID
-
getType
Gets the activity type (IRI).- Returns:
- the activity type
-
setType
Sets the activity type (IRI).- Parameters:
type- the activity type
-
getNames
Gets the list of activity names.- Returns:
- the list of activity names
-
setNames
Sets the list of activity names.- Parameters:
names- the list of activity names
-
getName
Gets the first activity name value (for convenience).- Returns:
- the first name value, or null if no names
-
getDescriptions
Gets the list of activity descriptions.- Returns:
- the list of activity descriptions
-
setDescriptions
Sets the list of activity descriptions.- Parameters:
descriptions- the list of activity descriptions
-
getDescription
Gets the first activity description value (for convenience).- Returns:
- the first description value, or null if no descriptions
-
getLaunches
Gets the list of launch URLs.- Returns:
- the list of launch URLs
-
setLaunches
Sets the list of launch URLs.- Parameters:
launches- the list of launch URLs
-
getLaunch
Gets the first launch URL value (for convenience).- Returns:
- the first launch URL value, or null if no launches
-
equals
-
hashCode
public int hashCode()
-