Package com.axelor.ai.provider.sync
Record Class SyncRules
java.lang.Object
java.lang.Record
com.axelor.ai.provider.sync.SyncRules
- Record Components:
exclude- regexes rejected before any family is consulted. Families are matched in order and the first match wins, so a filter listed only on a broad family never sees an id a narrower one already claimed — noise belongs here, where it cannot be forgotten per family.A family's
defaultsare applied only when a model is created. Nothing a rule set declares is re-applied later: it is a guess, and overwriting an administrator who corrected it would be wrong. Only values the provider itself reports are refreshed on every sync.families- matched in order; the first family whose regex accepts an id claims itmaxModels- hard cap across all families, bounding a rule set that matches far more than intended
public record SyncRules(List<String> exclude, List<SyncRules.Family> families, int maxModels)
extends Record
The admin-editable rules stored in
AiProvider.syncRules, deciding which of a provider's
models to take and what they can do.
Authored as a YAML sync: block in the shipped bundle and stored as the JSON equivalent
— one schema, two encodings.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSyncRules(List<String> exclude, List<SyncRules.Family> families, int maxModels) Creates an instance of aSyncRulesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.exclude()Returns the value of theexcluderecord component.families()Returns the value of thefamiliesrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxModelsrecord component.static SyncRulesParses the stored JSON.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_MAX_MODELS
public static final int DEFAULT_MAX_MODELS- See Also:
-
-
Constructor Details
-
Method Details
-
parse
Parses the stored JSON.- Throws:
IllegalArgumentException- with a message naming the problem. The rules are hand-edited, so a parse failure is an everyday event that has to read well on the provider form — not an internal error.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
exclude
Returns the value of theexcluderecord component.- Returns:
- the value of the
excluderecord component
-
families
Returns the value of thefamiliesrecord component.- Returns:
- the value of the
familiesrecord component
-
maxModels
public int maxModels()Returns the value of themaxModelsrecord component.- Returns:
- the value of the
maxModelsrecord component
-