8
8
* %%
9
9
* Redistribution and use in source and binary forms, with or without
10
10
* modification, are permitted provided that the following conditions are met:
11
- *
11
+ *
12
12
* 1. Redistributions of source code must retain the above copyright notice,
13
13
* this list of conditions and the following disclaimer.
14
14
* 2. Redistributions in binary form must reproduce the above copyright notice,
15
15
* this list of conditions and the following disclaimer in the documentation
16
16
* and/or other materials provided with the distribution.
17
- *
17
+ *
18
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
19
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
20
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34
34
import java .lang .reflect .Type ;
35
35
36
36
import org .scijava .convert .ConversionRequest ;
37
- import org .scijava .convert .Converter ;
38
37
import org .scijava .convert .ConvertService ;
38
+ import org .scijava .convert .Converter ;
39
39
import org .scijava .convert .DefaultConverter ;
40
+ import org .scijava .prefs .DefaultPrefService ;
40
41
41
42
/**
42
43
* Useful methods for converting and casting between classes and types.
43
44
* <p>
44
45
* For extensible type conversion, use {@link ConvertService}.
45
46
* </p>
46
- *
47
+ *
47
48
* @author Curtis Rueden
48
49
* @author Mark Hiner
49
50
*/
@@ -64,7 +65,7 @@ private ConversionUtils() {
64
65
/**
65
66
* Converts the given string value to an enumeration constant of the specified
66
67
* type.
67
- *
68
+ *
68
69
* @param src The value to convert.
69
70
* @param dest The type of the enumeration constant.
70
71
* @return The converted enumeration constant, or null if the type is not an
@@ -99,7 +100,7 @@ public static <T> T cast(final Object src, final Class<T> dest) {
99
100
/**
100
101
* Checks whether objects of the given class can be cast to the specified
101
102
* type.
102
- *
103
+ *
103
104
* @see #cast(Object, Class)
104
105
*/
105
106
public static boolean canCast (final Class <?> src , final Class <?> dest ) {
@@ -108,7 +109,7 @@ public static boolean canCast(final Class<?> src, final Class<?> dest) {
108
109
109
110
/**
110
111
* Checks whether the given object can be cast to the specified type.
111
- *
112
+ *
112
113
* @see #cast(Object, Class)
113
114
*/
114
115
public static boolean canCast (final Object src , final Class <?> dest ) {
@@ -176,8 +177,8 @@ public static <T> T getNullValue(final Class<T> type) {
176
177
/**
177
178
* Sets the {@link ConvertService}
178
179
*/
179
- public static void setDelegateService (
180
- final ConvertService conversionService , final double priority )
180
+ public static void setDelegateService (final ConvertService conversionService ,
181
+ final double priority )
181
182
{
182
183
if (ConversionUtils .conversionService == null ||
183
184
Double .compare (priority , servicePriority ) > 0 )
@@ -264,8 +265,8 @@ public static Class<?> getComponentClass(final Type type) {
264
265
//-- Helper methods --
265
266
266
267
/**
267
- * Gets the delegate {@link ConvertService} to use for preference
268
- * operations. If this service has not been explicitly set, then a
268
+ * Gets the delegate {@link ConvertService} to use for preference operations.
269
+ * If this service has not been explicitly set, then a
269
270
* {@link DefaultPrefService} will be used.
270
271
*
271
272
* @return The current {@link ConvertService} to use for delegation.
0 commit comments