Skip to content

Commit

Permalink
- bread crumb output further refined.
Browse files Browse the repository at this point in the history
- Improved stack handling in deepEquals()
  • Loading branch information
jdereg committed Dec 28, 2024
1 parent 20b4d28 commit 3b94d75
Show file tree
Hide file tree
Showing 3 changed files with 216 additions and 249 deletions.
21 changes: 12 additions & 9 deletions src/main/java/com/cedarsoftware/util/Converter.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public static boolean isConversionSupportedFor(Class<?> source, Class<?> target)
* @return {@code true} if a direct conversion exists (including component type conversions for arrays),
* {@code false} otherwise
*/
public boolean isDirectConversionSupported(Class<?> source, Class<?> target) {
public static boolean isDirectConversionSupported(Class<?> source, Class<?> target) {
return instance.isDirectConversionSupported(source, target);
}

Expand All @@ -359,18 +359,21 @@ public boolean isDirectConversionSupported(Class<?> source, Class<?> target) {
*
* <p><strong>Example usage:</strong></p>
* <pre>{@code
* Converter converter = new Converter(options);
*
* // Check if String can be converted to Integer
* boolean canConvert = converter.isNonCollectionConversionSupportedFor(
* boolean canConvert = Converter.isSimpleTypeConversionSupported(
* String.class, Integer.class); // returns true
*
* // Check array conversion (always returns false)
* boolean arrayConvert = converter.isNonCollectionConversionSupportedFor(
* boolean arrayConvert = Converter.isSimpleTypeConversionSupported(
* String[].class, Integer[].class); // returns false
*
* // Intentionally repeat source type (class) - will find identity conversion
* // Let's us know that it is a "simple" type (String, Date, Class, UUID, URL, Temporal type, etc.)
* boolean isSimpleType = Converter.isSimpleTypeConversionSupported(
* ZonedDateTime.class, ZonedDateTime.class);
*
* // Check collection conversion (always returns false)
* boolean listConvert = converter.isNonCollectionConversionSupportedFor(
* boolean listConvert = Converter.isSimpleTypeConversionSupported(
* List.class, Set.class); // returns false
* }</pre>
*
Expand All @@ -381,10 +384,10 @@ public boolean isDirectConversionSupported(Class<?> source, Class<?> target) {
* @see #isConversionSupportedFor(Class, Class)
* @see #isDirectConversionSupported(Class, Class)
*/
public boolean isSimpleTypeConversionSupported(Class<?> source, Class<?> target) {
public static boolean isSimpleTypeConversionSupported(Class<?> source, Class<?> target) {
return instance.isSimpleTypeConversionSupported(source, target);
}

/**
* Retrieves a map of all supported conversions, categorized by source and target classes.
* <p>
Expand Down Expand Up @@ -434,7 +437,7 @@ public static Map<String, Set<String>> getSupportedConversions() {
* @param conversionFunction A function that converts an instance of the source type to an instance of the target type.
* @return The previous conversion function associated with the source and target types, or {@code null} if no conversion existed.
*/
public Convert<?> addConversion(Class<?> source, Class<?> target, Convert<?> conversionFunction) {
public static Convert<?> addConversion(Class<?> source, Class<?> target, Convert<?> conversionFunction) {
return instance.addConversion(source, target, conversionFunction);
}

Expand Down
Loading

0 comments on commit 3b94d75

Please sign in to comment.