Class AiccPrerequisite

java.lang.Object
dev.jcputney.elearning.parser.output.metadata.aicc.AiccPrerequisite
All Implemented Interfaces:
Serializable

public final class AiccPrerequisite extends Object implements Serializable
Enriched prerequisite details for an assignable unit, including parsed tokens and completion rules.
See Also:
  • 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 of AiccPrerequisite.
      mandatory - a flag indicating if the prerequisite is mandatory; true if mandatory, false otherwise.
      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

      public static List<String> toTokenValues(List<AiccPrerequisiteToken> tokens)
      Converts a list of AiccPrerequisiteToken objects to a list of trimmed, non-null, and non-empty string values extracted from the tokens.
      Parameters:
      tokens - the list of AiccPrerequisiteToken objects; 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

      public String getAssignableUnitId()
      Retrieves the unique identifier for the assignable unit.
      Returns:
      the unique identifier of the assignable unit as a String.
    • getRawExpression

      public 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:
      true if the prerequisite is mandatory; false otherwise.
    • getReferencedAuIds

      public List<String> 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

      public List<String> 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

      public List<String> 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

      public List<String> 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

      public AiccPrerequisiteExpression getExpression()
      Retrieves the prerequisite expression associated with this instance.
      Returns:
      an instance of AiccPrerequisiteExpression representing the prerequisite expression.
    • getCompletionCriteria

      public AiccCompletionCriteria getCompletionCriteria()
      Retrieves the completion criteria associated with the prerequisite.
      Returns:
      an instance of AiccCompletionCriteria representing the completion criteria.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object