Annotation Interface Implementation.TypeAdapter

Enclosing class:
Implementation

@Target(TYPE) @Retention(RUNTIME) @Scope public static @interface Implementation.TypeAdapter

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 Elements
    Modifier and Type
    Required Element
    Description
    Gets the Class this TypeAdapter will convert from.
    Gets the Class this TypeAdapter will convert into.
  • Element Details

    • source

      Class<?> source
      Gets the Class this TypeAdapter will convert from.
      Returns:
      the class the TypeAdapter will convert from
    • target

      Class<?> target
      Gets the Class this TypeAdapter will convert into.
      Returns:
      the class the TypeAdapter will convert into