Top Description Methods
org.osgi.util.converter

public Interface Functioning

extends Specifying<Functioning>
Known Direct Implementers
org.osgi.util.converter.FunctioningImpl
Annotations
@ProviderType
Imports
java.lang.reflect.Type, org.osgi.annotation.versioning.ProviderType, org.osgi.util.function.Function

This interface is used to specify the target function to perform conversions. This function can be used multiple times. A Functioning instance can be obtained via the Converter.
Author
$Id: 8911137abe6bb875117d124cf23082fde93df481 $

Method Summary

Modifier and TypeMethod and Description
public <
The type to convert to.
T
>
Function<Object, T>

Returns:

A function that can perform the conversion.
to
(Class<T>
The class to convert to.
cls
)

Specify the target object type for the conversion as a class object.

public <
The type to convert to.
T
>
Function<Object, T>

Returns:

A function that can perform the conversion.
to
(Type
A Type object to represent the target type to be converted to.
type
)

Specify the target object type as a Java Reflection Type object.

public <
The type to convert to.
T
>
Function<Object, T>

Returns:

A function that can perform the conversion.
to
(TypeReference<T>
A type reference to the object being converted to.
ref
)

Specify the target object type as a TypeReference.

Inherited from org.osgi.util.converter.Specifying:
defaultValuekeysIgnoreCasesourceAssourceAsBeansourceAsDTOtargetAstargetAsBeantargetAsDTOview

Method Detail

toback to summary
public <T> Function<Object, T> to(Class<T> cls)

Specify the target object type for the conversion as a class object.

Parameters
<T>
The type to convert to.
cls:Class<T>

The class to convert to.

Returns:Function<Object, T>

A function that can perform the conversion.

toback to summary
public <T> Function<Object, T> to(Type type)

Specify the target object type as a Java Reflection Type object.

Parameters
<T>
The type to convert to.
type:Type

A Type object to represent the target type to be converted to.

Returns:Function<Object, T>

A function that can perform the conversion.

toback to summary
public <T> Function<Object, T> to(TypeReference<T> ref)

Specify the target object type as a TypeReference. If the target class carries generics information a TypeReference should be used as this preserves the generic information whereas a Class object has this information erased. Example use:

List<String> result = converter.function()
		.to(new TypeReference<List<String>>() {
		});
Parameters
<T>
The type to convert to.
ref:TypeReference<T>

A type reference to the object being converted to.

Returns:Function<Object, T>

A function that can perform the conversion.