Interface Commented

All Known Subinterfaces:
Actuator<C>, BallotCaster, Centrifuge, ComplexInstrument, ComprehensiveIdentification, Device, Experiment<I,R>, HumidityProbe, Microscope, Multimeter, Oscilloscope, PHMeter, PressureGauge, Seismograph, Sensor<Q>, Spectrometer, Telescope, TemperatureProbe, VitalSignsMonitor, VoterScanner, VotingMachine, WeatherStation
All Known Implementing Classes:
AbstractActuator, AbstractDevice, AbstractSensor, AbstractSimulatedActuator, AbstractSimulatedDevice, AbstractSimulatedSensor, Account, Act, Activity, Administration, AlkaliEarthMetal, AlkaliMetal, AminoAcid, Article, Artifact, Artist, Artwork, Atom, Bank, Behavior, Belief, BioChemicalReaction, Biography, Bond, Book, Building, Building, BusinessPlace, Candidate, Celebration, Cell, ChatSituation, Check, ChemicalReaction, ChoiceQuestion, Choreography, Citizen, City, City, Civilization, CivilSituation, Clade, Clothes, Coin, Collection, Community, Composition, Compound, Concept, Conflict, Contract, Country, Creature, Crowd, Culture, Currency, Defendant, Diagnostic, Disease, DNA, Doctor, EarthEcosource, EconomicAgent, EconomicSituation, Economy, Election, Element, EmpiricalEvidence, Event, Evidence, Factory, Film, Flag, Fossil, FreeMarketEconomy, Gas, GeologicalEra, GeologicalTimeScale, GPIBDevice, Halogen, HistoricalEra, HistoricalEvent, HistoricalTimeline, Holding, Home, Human, HumanGroup, HumanResource, HumanTimeline, Impairment, Individual, Installation, Item, Judge, Jurisdiction, JuryMember, Knowledge, LawSuitSituation, Lawyer, Liquid, Locutor, Machine, MassSpectra, MasterOfCeremony, Match, MaterialResource, MedicalSituation, Medication, Member, Metal, Mineral, Model, Molecule, Nation, Natural, NeuralNetwork, Neuron, NobleGas, NonMetal, Observation, Organ, Organigram, Organization, OrganizationTask, OwnedPlace, Pathology, Pathway, Patient, Performance, Person, PhilosophicalCurrent, PhylogeneticTree, PhysicalObject, Picture, Place, Plaintiff, PlannedEconomy, PoliticalParty, Population, PortfolioData, PositionedEvent, PotentialResource, Proposition, Prosecutor, Protein, PsychologicalFamily, PsychologicalGroup, Question, RareEarthMetal, RationalEvidence, Receipt, Region, Religion, Resource, ResponsibleIndividual, Ritual, RNA, Road, Robot, Role, Sample, ScaleQuestion, ScientificAnalysis, ScientificDescription, ScientificExperiment, ScientificReport, ScientificTerm, Score, Settlement, Share, SimulatedBallotCaster, SimulatedCentrifuge, SimulatedGPIBDevice, SimulatedHumidityProbe, SimulatedMicroscope, SimulatedMultimeter, SimulatedOscilloscope, SimulatedPHMeter, SimulatedPressureGauge, SimulatedSeismograph, SimulatedSpectrometer, SimulatedTelescope, SimulatedTemperatureProbe, SimulatedUSBDevice, SimulatedVitalSignsMonitor, SimulatedVoterScanner, SimulatedVotingMachine, SimulatedWeatherStation, Site, Situation, SocialCollective, SocialEntity, SocialNetwork, Society, SociologicalFamily, SociologicalGroup, Solid, Species, SpectralPeak, Spectrum, Sport, Statute, Story, StrategicModel, Stratum, StreetSituation, Subject, Survey, SurveyResponse, Synapse, Task, Taxon, Team, TestimonialEvidence, TextQuestion, Thing, TimedPlace, Timeline, Tissue, Tool, Transaction, TransitionMetal, Treatment, TrialExperiment, Tribe, USBDevice, Vehicle, Vehicle, Virus, Voter, Witness, Worker, WorkSituation

public interface Commented
Interface for objects that can have comments and dynamic attributes/traits.
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Returns the comments associated with this object.
    default Object
    Retrieves a custom trait.
    default <T> T
    getTrait(String name, Class<T> type)
    Retrieves a typed custom trait.
    Returns the map of traits/attributes for this object.
    default void
    setComments(String comments)
    Sets the comments for this object.
    default void
    setTrait(String name, Object value)
    Sets a custom trait (dynamic property).
  • Method Details

    • getTraits

      Map<String,Object> getTraits()
      Returns the map of traits/attributes for this object. Implementations should provide a mutable map to support default methods.
      Returns:
      the traits map
    • setTrait

      default void setTrait(String name, Object value)
      Sets a custom trait (dynamic property).
      Parameters:
      name - trait name
      value - trait value
    • getTrait

      default Object getTrait(String name)
      Retrieves a custom trait.
      Parameters:
      name - trait name
      Returns:
      trait value, or null if not found
    • getTrait

      default <T> T getTrait(String name, Class<T> type)
      Retrieves a typed custom trait.
      Type Parameters:
      T - result type
      Parameters:
      name - trait name
      type - expected class of the trait
      Returns:
      typed trait value, or null if not found or type mismatch
    • getComments

      default String getComments()
      Returns the comments associated with this object. Maps to a "comments" trait.
      Returns:
      the comments
    • setComments

      default void setComments(String comments)
      Sets the comments for this object. Maps to a "comments" trait.
      Parameters:
      comments - the comments to set