Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PrimitiveType.java to allow customClasses #4192

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -257,18 +257,19 @@ private PrimitiveType(Class<?> keyClass, String commonName) {
}

/**
* Adds support for custom mapping of classes to primitive types
* Adds support for custom excluded classes
*
* @return Set of custom classes to primitive type
* @since 1.6.6
* @return Set of custom excluded classes
*/
public static Set<String> customExcludedClasses() {
return customExcludedClasses;
}

/**
* Adds support for custom mapping of classes to primitive types
* Adds support for custom excluded external classes
*
* @return Set of custom classes to primitive type
* @return Set of custom excluded external classes
*/
public static Set<String> customExcludedExternalClasses() {
return customExcludedExternalClasses;
Expand All @@ -277,6 +278,7 @@ public static Set<String> customExcludedExternalClasses() {
/**
* Adds support for custom mapping of classes to primitive types
*
* @since 1.6.13
* @return Map of custom classes to primitive type
*/
public static Map<String, PrimitiveType> customClasses() {
Expand All @@ -295,6 +297,7 @@ public static PrimitiveType fromType(Type type) {
if (custom != null) {
return custom;
}

final PrimitiveType external = EXTERNAL_CLASSES.get(raw.getName());
if (external != null) {
if (!customExcludedExternalClasses().contains(raw.getName())) {
Expand Down
Loading