Class EntitySource

java.lang.Object
com.tnsai.context.entity.EntitySource

public final class EntitySource extends Object
Represents a source system that provides entity data.

EntitySource abstracts different data sources (CRM, email, Slack, etc.) and provides metadata about their reliability and capabilities.

Usage Example


 EntitySource salesforce = EntitySource.builder()
     .id("salesforce")
     .name("Salesforce CRM")
     .type(SourceType.CRM)
     .priority(1)
     .defaultConfidence(0.95)
     .build();
 
  • Method Details

    • of

      public static EntitySource of(String id)
      Creates a simple source with just an ID.
    • of

      public static EntitySource of(String id, EntitySource.SourceType type)
      Creates a source with ID and type.
    • builder

      public static EntitySource.Builder builder()
      Creates a new builder.
    • getId

      public String getId()
    • getName

      public String getName()
    • getType

      public EntitySource.SourceType getType()
    • getPriority

      public int getPriority()
    • getDefaultConfidence

      public double getDefaultConfidence()
    • getLastSync

      public Instant getLastSync()
    • getSpec

      public Map<String,Object> getSpec()
    • hasHigherPriorityThan

      public boolean hasHigherPriorityThan(EntitySource other)
      Returns true if this source has higher priority than another.
    • isAuthoritative

      public boolean isAuthoritative()
      Returns true if this source is authoritative (priority invalid input: '<'= 1).
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object