Class AiccPrerequisite
java.lang.Object
dev.jcputney.elearning.parser.output.metadata.aicc.AiccPrerequisite
- All Implemented Interfaces:
Serializable
Enriched prerequisite details for an assignable unit, including parsed tokens and completion
rules.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAiccPrerequisite(String assignableUnitId, AiccPrerequisiteExpression expression, boolean mandatory, List<String> referencedAuIds, List<String> optionalAuIds, List<String> tokens, List<String> postfixTokens, AiccCompletionCriteria completionCriteria) Constructs an instance of AiccPrerequisite with the specified attributes. -
Method Summary
Modifier and TypeMethodDescriptionbooleanRetrieves the unique identifier for the assignable unit.Retrieves the completion criteria associated with the prerequisite.Retrieves the prerequisite expression associated with this instance.Retrieves the list of optional assignable unit (AU) IDs associated with the prerequisite.Retrieves the list of postfix tokens associated with the prerequisite.Retrieves the raw expression associated with the prerequisite.Retrieves the list of referenced assignable unit (AU) IDs associated with the prerequisite.Retrieves the list of tokens associated with the prerequisite.inthashCode()booleanDetermines whether the prerequisite is mandatory.toTokenValues(List<AiccPrerequisiteToken> tokens) Converts a list ofAiccPrerequisiteTokenobjects to a list of trimmed, non-null, and non-empty string values extracted from the tokens.
-
Constructor Details
-
AiccPrerequisite
public AiccPrerequisite(String assignableUnitId, AiccPrerequisiteExpression expression, boolean mandatory, List<String> referencedAuIds, List<String> optionalAuIds, List<String> tokens, List<String> postfixTokens, AiccCompletionCriteria completionCriteria) Constructs an instance of AiccPrerequisite with the specified attributes.- Parameters:
assignableUnitId- the unique identifier for the assignable unit.expression- the prerequisite expression associated with this instance ofAiccPrerequisite.mandatory- a flag indicating if the prerequisite is mandatory;trueif mandatory,falseotherwise.referencedAuIds- a list of assignable unit (AU) IDs referenced by this prerequisite. May be null or empty.optionalAuIds- a list of optional assignable unit (AU) IDs associated with this prerequisite. May be null or empty.tokens- the list of token strings used for parsing and validation. May be null or empty.postfixTokens- a list of strings representing the postfix notation of the prerequisite expression. May be null or empty.completionCriteria- the completion criteria associated with this prerequisite.
-
-
Method Details
-
toTokenValues
Converts a list ofAiccPrerequisiteTokenobjects to a list of trimmed, non-null, and non-empty string values extracted from the tokens.- Parameters:
tokens- the list ofAiccPrerequisiteTokenobjects; may be null or empty- Returns:
- a list of non-null, non-empty, trimmed string values derived from the tokens. Returns an empty list if the input list is null or contains no valid values.
-
getAssignableUnitId
Retrieves the unique identifier for the assignable unit.- Returns:
- the unique identifier of the assignable unit as a String.
-
getRawExpression
Retrieves the raw expression associated with the prerequisite.- Returns:
- the raw expression as a String.
-
isMandatory
public boolean isMandatory()Determines whether the prerequisite is mandatory.- Returns:
trueif the prerequisite is mandatory;falseotherwise.
-
getReferencedAuIds
Retrieves the list of referenced assignable unit (AU) IDs associated with the prerequisite.- Returns:
- a list of Strings representing the referenced AU IDs. The returned list may be empty if no referenced AU IDs are specified.
-
getOptionalAuIds
Retrieves the list of optional assignable unit (AU) IDs associated with the prerequisite.- Returns:
- a list of Strings representing the optional AU IDs. The returned list may be empty if no optional AU IDs are specified.
-
getTokens
Retrieves the list of tokens associated with the prerequisite.- Returns:
- a list of strings representing the tokens. The returned list may be empty if no tokens are specified.
-
getPostfixTokens
Retrieves the list of postfix tokens associated with the prerequisite.- Returns:
- a list of strings representing the postfix tokens. The returned list may be empty if no postfix tokens are specified.
-
getExpression
Retrieves the prerequisite expression associated with this instance.- Returns:
- an instance of
AiccPrerequisiteExpressionrepresenting the prerequisite expression.
-
getCompletionCriteria
Retrieves the completion criteria associated with the prerequisite.- Returns:
- an instance of
AiccCompletionCriteriarepresenting the completion criteria.
-
equals
-
hashCode
public int hashCode()
-