Class ConfigReferenceNotFoundContext
java.lang.Object
tech.guilhermekaua.spigotboot.config.reference.context.ConfigReferenceNotFoundContext
Context object for config reference not found errors.
Provides information about where the reference was used and what alternatives are available.
-
Constructor Summary
ConstructorsConstructorDescriptionConfigReferenceNotFoundContext(@NotNull ReferenceKey sourceKey, @Nullable Field sourceField, @NotNull String fullReference, @NotNull Set<String> availableAlternatives) Creates a new context. -
Method Summary
Modifier and TypeMethodDescriptionGets suggested alternatives.@NotNull StringGets the full reference string.@Nullable FieldGets the field being bound, if available.@NotNull ReferenceKeyGets the key of the config or folder config item containing the reference.
-
Constructor Details
-
ConfigReferenceNotFoundContext
public ConfigReferenceNotFoundContext(@NotNull @NotNull ReferenceKey sourceKey, @Nullable @Nullable Field sourceField, @NotNull @NotNull String fullReference, @NotNull @NotNull Set<String> availableAlternatives) Creates a new context.- Parameters:
sourceKey- the key of the config/item containing the referencesourceField- the field being bound (may be null for raw resolution)fullReference- the full reference string (e.g.,"${items.diamond_sword}")availableAlternatives- suggested alternatives (config/folder config/item names)
-
-
Method Details
-
getSourceKey
Gets the key of the config or folder config item containing the reference.- Returns:
- the source key
-
getSourceField
Gets the field being bound, if available.- Returns:
- the field, or null if not binding to a specific field
-
getFullReference
Gets the full reference string.- Returns:
- the full reference (e.g.,
"${items.diamond_sword}")
-
getAvailableAlternatives
Gets suggested alternatives.May contain available config names, folder config names, or item IDs depending on what part of the reference was not found.
- Returns:
- set of suggested alternatives
-