TypeConverter


public abstract class TypeConverter<T, V>

Known direct subclasses
BidirectionalTypeConverter

Abstract base class used convert type T to another type V and back again.


Abstract base class used convert type T to another type V. This is necessary when the value types of in animation are different from the property type.

Parameters
<T>

type T. It can be converted to type V

<V>

type V. It can be converted from type T

See also
setConverter

Summary

Public constructors

TypeConverter(@NonNull Class<T> fromClass, @NonNull Class<V> toClass)

Constructor for creating a type converter instance that converts type T to another type V.

Public methods

abstract @NonNull V
convert(@NonNull T value)

Converts a value from one type to another.

Public constructors

TypeConverter

public TypeConverter(@NonNull Class<T> fromClass, @NonNull Class<V> toClass)

Constructor for creating a type converter instance that converts type T to another type V.

Parameters
@NonNull Class<T> fromClass

class of the value type that feeds into the converter

@NonNull Class<V> toClass

class of the value type expected out of the converter

Public methods

convert

public abstract @NonNullconvert(@NonNull T value)

Converts a value from one type to another.

Parameters
@NonNull T value

The Object to convert.

Returns
@NonNull V

A value of type V, converted from value.