Class ClassModel

java.lang.Object
lu.kbra.modelizer_next.domain.ClassModel
All Implemented Interfaces:
IdOwner, NamesOwner, StyleOwner, VisibilityOwner

public class ClassModel extends Object implements VisibilityOwner, IdOwner, StyleOwner, NamesOwner
Persistent model of a diagram class/table. It owns display names, style, visibility, and the ordered list of fields.
  • Constructor Details

    • ClassModel

      public ClassModel()
      Creates a class model instance.
  • Method Details

    • addField

      public void addField(FieldModel fieldModel)
    • addField

      public void addField(int index, FieldModel fieldModel)
    • buildFieldByIdIndex

      public Map<String,FieldModel> buildFieldByIdIndex()
    • buildPrimaryKeyFieldIdsIndex

      public Set<String> buildPrimaryKeyFieldIdsIndex()
    • getField

      public FieldModel getField(int i, PanelType panelType)
      Returns the field.
      Parameters:
      i - zero-based index to read or update
      panelType - diagram panel type whose model or layout should be used
      Returns:
      the field
    • getFieldCount

      public int getFieldCount(PanelType panelType)
      Returns the field count.
      Parameters:
      panelType - diagram panel type whose model or layout should be used
      Returns:
      the field count
    • getFieldIndex

      public int getFieldIndex(String fieldId)
      Returns the field index.
      Parameters:
      fieldId - id of the field to look up or modify
      Returns:
      the field index
    • getFieldIndex

      public int getFieldIndex(String fieldId, PanelType panelType)
      Returns the field index.
      Parameters:
      fieldId - id of the field to look up or modify
      panelType - diagram panel type whose model or layout should be used
      Returns:
      the field index
    • getFields

      public List<FieldModel> getFields(PanelType panelType)
      Returns the fields.
      Parameters:
      panelType - diagram panel type whose model or layout should be used
      Returns:
      the fields
    • removeField

      public void removeField(FieldModel fieldModel)
    • setFieldById

      public void setFieldById(Map<String,FieldModel> fieldById)
    • setFields

      public void setFields(List<FieldModel> fields)
      Sets the fields.
      Parameters:
      fields - values for fields
    • validateFieldByIdIndex

      public Map<String,FieldModel> validateFieldByIdIndex()
    • validatePrimaryKeyFieldIdsIndex

      public Set<String> validatePrimaryKeyFieldIdsIndex()
    • validateDuplicatedFields

      public Map<PanelType,Set<String>> validateDuplicatedFields()
    • validateDuplicatedFields

      public Set<String> validateDuplicatedFields(PanelType pt)
    • getDuplicatedFields

      public Set<String> getDuplicatedFields(PanelType pt)