Class ConfigTypeMismatchContext
java.lang.Object
tech.guilhermekaua.spigotboot.config.reference.context.ConfigTypeMismatchContext
Context object for type mismatch errors during reference resolution.
Provides information about the expected type, actual type, and the resolved value.
-
Constructor Summary
ConstructorsConstructorDescriptionConfigTypeMismatchContext(@NotNull ReferenceKey sourceKey, @Nullable Field sourceField, @NotNull String fullReference, @NotNull Type expectedType, @NotNull Class<?> actualType, @Nullable Object actualValue) Creates a new context. -
Method Summary
Modifier and TypeMethodDescription@NotNull Class<?>Gets the actual type of the resolved value.@Nullable ObjectGets the actual resolved value.@NotNull TypeGets the expected type for the target field.@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
-
ConfigTypeMismatchContext
public ConfigTypeMismatchContext(@NotNull @NotNull ReferenceKey sourceKey, @Nullable @Nullable Field sourceField, @NotNull @NotNull String fullReference, @NotNull @NotNull Type expectedType, @NotNull @NotNull Class<?> actualType, @Nullable @Nullable Object actualValue) 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 stringexpectedType- the expected type for the fieldactualType- the actual type of the resolved valueactualValue- the actual resolved value (may be null)
-
-
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
-
getExpectedType
Gets the expected type for the target field.- Returns:
- the expected type
-
getActualType
Gets the actual type of the resolved value.- Returns:
- the actual type
-
getActualValue
Gets the actual resolved value.- Returns:
- the actual value, may be null
-