Class CourseStructure

java.lang.Object
dev.jcputney.elearning.parser.input.aicc.CourseStructure
All Implemented Interfaces:
Serializable

public final class CourseStructure extends Object implements Serializable

Represents the courseStructure complex type.

The following schema snippet specifies its contents:


 <xs:complexType name="courseStructure">
   <xs:all>
     <xs:element name="block" type="xs:string" minOccurs="0" maxOccurs="1" />
     <xs:element name="member" type="xs:string" minOccurs="0" maxOccurs="1" />
   </xs:all>
 </xs:complexType>
 
See Also:
  • Constructor Details

    • CourseStructure

      public CourseStructure()
      Default constructor for the CourseStructure class. This constructor initializes an empty CourseStructure object without setting any fields or performing any operations.
    • CourseStructure

      public CourseStructure(String block, String member)
      Constructs a CourseStructure instance with the specified block and member.
      Parameters:
      block - the block associated with the course structure. Represents a specific aspect or grouping within the course structure. Can be null.
      member - the member associated with the course structure. Represents a specific entity within the course structure. Can be null.
  • Method Details

    • getBlock

      public String getBlock()
      Retrieves the block associated with the course structure.
      Returns:
      the block for the course structure as a string. The returned value may be null if the block has not been set.
    • setBlock

      public void setBlock(String block)
      Sets the block associated with the course structure.
      Parameters:
      block - the block to set for the course structure. Can be null. Represents a specific aspect or grouping within the course structure.
    • getMember

      public String getMember()
      Retrieves the member associated with the course structure.
      Returns:
      the member for the course structure as a string. The returned value may be null if the member has not been set.
    • setMember

      public void setMember(String member)
      Sets the member associated with the course structure.
      Parameters:
      member - the member to set for the course structure. Can be null. Represents a specific member or entity within the course structure.
    • getPrerequisites

      public String getPrerequisites()
      Retrieves the prerequisites associated with the course structure.
      Returns:
      the prerequisites for the course structure as a string. The returned value may be null if the prerequisites have not been set.
    • setPrerequisites

      public void setPrerequisites(String prerequisites)
      Sets the prerequisites for the course structure. If the provided string is blank, this method will set the prerequisites to null.
      Parameters:
      prerequisites - the prerequisites information for the course. If blank, it will default to null.
    • getAttributesRaw

      public String getAttributesRaw()
      Retrieves the raw attributes string associated with the course structure.
      Returns:
      the raw attributes as a string. The returned value may be null if the raw attributes have not been set or initialized.
    • setAdditionalColumn

      public void setAdditionalColumn(String key, String value)
      Adds or updates an additional column with the provided key-value pair. If the key matches specific predefined keys (block, member, prerequisites, attributes), it delegates the value to the respective setter method. Otherwise, the key-value pair is stored in the additional columns map and also added as an attribute.
      Parameters:
      key - the key for the column. If blank, the method does not perform any operations.
      value - the value for the column. Can be null.
    • getAttributes

      public Map<String,String> getAttributes()
      Retrieves an immutable view of the attributes map associated with the course structure. The attributes represent key-value pairs related to the course structure.
      Returns:
      an unmodifiable map of attribute key-value pairs. The map is never null.
    • setAttributes

      public void setAttributes(String attributes)
      Sets the attributes for the course structure from a raw string. If the provided string is blank, the attributes will be set to null. Otherwise, the string is processed to initialize individual attribute key-value pairs by parsing it.
      Parameters:
      attributes - a raw attribute string containing key-value pairs separated by semicolons (';'). If blank, the attributes will be set to null instead of being processed.
    • getAttribute

      public String getAttribute(String key)
      Retrieves the value of the attribute associated with the specified key. If the key is null, the method returns null.
      Parameters:
      key - the key of the attribute to retrieve; may be null. If the key is null, null will be returned.
      Returns:
      the value of the attribute associated with the normalized key, or null if the key is null or not found in the attributes.
    • getAdditionalColumns

      public Map<String,String> getAdditionalColumns()
      Retrieves an immutable view of the additional columns map associated with the course structure. The additional columns represent key-value pairs that provide extended information not covered by predefined fields like block, member, or prerequisites.
      Returns:
      an unmodifiable map of additional columns as key-value pairs. The map is never null.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object