Annotation Interface Implementation.TypeAdapter
- Enclosing class:
Implementation
A class annotated with Implementation.TypeAdapter will be automatically searched for and instantiated as a
TypeAdapter by guice.
Example
@TypeAdapter(clazz = CustomType.class)
public class CustomTypeAdapter implements TypeAdapter<CustomType> {
public Optional<CustomType> apply(String raw, GenericInteractionCreateEvent event) {
return Optional.of(new CustomType(raw, event));
}///
}
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionClass<?> Gets theClassthisTypeAdapterwill convert from.Class<?> Gets theClassthisTypeAdapterwill convert into.
-
Element Details
-
source
Class<?> sourceGets theClassthisTypeAdapterwill convert from.- Returns:
- the class the
TypeAdapterwill convert from
-
target
Class<?> targetGets theClassthisTypeAdapterwill convert into.- Returns:
- the class the
TypeAdapterwill convert into
-