Interface YamlElement


public interface YamlElement
The YamlElement interface must be implemented by any classes that need to be handled by the YamlModelRepositoryImpl.

Implementations

  • MUST have a default constructor to allow deserialization with Jackson
  • MUST provide equals(Object other) and hashcode() methods
  • MUST be annotated with YamlElementName containing the element name
  • SHOULD implement a proper toString() method
Author:
Laurent Garnier - Initial contribution, Jan N. Klug - Refactoring and improvements to JavaDoc
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull String
    Get the identifier of this element.
    boolean
    Check if this element is valid and should be included in the model.
  • Method Details

    • getId

      @NonNull String getId()
      Get the identifier of this element.

      Identifiers

      • MUST be non-null
      • MUST be unique within a model
      • SHOULD be unique across all models
      Returns:
      the identifier as a string
    • isValid

      boolean isValid()
      Check if this element is valid and should be included in the model.

      Implementations

      • MUST check that at least {link #getId()} returns a non-null value
      • SHOULD log the reason of failed checks at WARN level
      • MAY perform additional checks
      Returns:
      true if all the checks are completed successfully