Class Code

java.lang.Object
org.episteme.social.law.Code
All Implemented Interfaces:
Named

public class Code extends Object implements Named
A class representing a systematic collection of laws or regulations (e.g., Civil Code, Penal Code) applicable in a specific jurisdiction.
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • Code

      public Code(String name)
      Minimal constructor for the legal code.
      Parameters:
      name - the name of the code
    • Code

      public Code(String name, String category, Date date, List<Article> articles)
      Creates a new Code object.
      Parameters:
      name - the name of the code (e.g., "Code Civil")
      category - the legal category (e.g., "Civil Law")
      date - the date of promulgation or publication
      articles - the initial list of articles
      Throws:
      IllegalArgumentException - if any argument is null or if the list contains non-Article entities
  • Method Details

    • getName

      public String getName()
      Returns the name of the legal code.
      Specified by:
      getName in interface Named
      Returns:
      the name
    • getCategory

      public String getCategory()
      Returns the category of the code.
      Returns:
      the category
    • getDate

      public Date getDate()
      Returns the publication or effective date of the code.
      Returns:
      the date
    • getArticles

      public List<Article> getArticles()
      Returns the list of articles contained in this code.
      Returns:
      the list of articles
    • addArticle

      public void addArticle(Article article)
      Adds an article to the code.
      Parameters:
      article - the article to add
      Throws:
      IllegalArgumentException - if article is null
    • removeArticle

      public void removeArticle(Article article)
      Removes an article from the code.
      Parameters:
      article - the article to remove
    • getId

      public String getId()
      Legacy getter for ID.
    • getArticle

      public Article getArticle(String num)
      Retrieves an article by its numbering.