| Modifiers | Name | Description |
|---|---|---|
protected Closure<?> |
closure |
Closure used to convert matching values. |
protected int |
paramCount |
Number of parameters expected by the conversion closure. |
protected Class<?> |
type |
Type accepted by this converter. |
| Constructor and description |
|---|
protected ClosureConverter(Class<?> type, Closure<?> closure)Creates a converter backed by the supplied closure. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Object |
convert(Object value, String key)Converts a given value. |
|
public boolean |
equals(Object o)Any two Converter instances registered for the same type are considered to be equal. |
|
public boolean |
handles(Class<?> type)Returns true if this converter can handle conversions
of the given type. |
|
public int |
hashCode()Returns a hash code based on the handled type. |
|
public String |
toString()Returns a string form that includes the handled type. |
Closure used to convert matching values.
Number of parameters expected by the conversion closure.
Type accepted by this converter.
Converts a given value.
value - the object to convertkey - the key name for the value, may be nullAny two Converter instances registered for the same type are considered to be equal. This comparison makes managing instances in a Set easier; since there is no chaining of Converters it makes sense to only allow one per type.
o - the object with which to compare.true if this object contains the same class; false otherwise. Returns true if this converter can handle conversions
of the given type.
type - the type of the object to convertReturns a hash code based on the handled type.
Returns a string form that includes the handled type.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.