Interface ComponentFlattener.Builder

    • Method Detail

      • complexMapper

        @NotNull
        <T extends Component> @NotNull ComponentFlattener.Builder complexMapper​(@NotNull
                                                                                @NotNull java.lang.Class<T> type,
                                                                                @NotNull
                                                                                @NotNull java.util.function.BiConsumer<T,​java.util.function.Consumer<Component>> converter)
        Register a type of component that needs to be flattened to an intermediate stage.
        Type Parameters:
        T - component type
        Parameters:
        type - the component type
        converter - a provider of contained Components
        Returns:
        this builder
        Since:
        4.7.0
      • unknownMapper

        @NotNull
        @NotNull ComponentFlattener.Builder unknownMapper​(@Nullable
                                                          @Nullable java.util.function.Function<Component,​java.lang.String> converter)
        Register a handler for unknown component types.

        This will be called if no other converter can be found.

        Parameters:
        converter - the converter, may be null to ignore unknown components
        Returns:
        this builder
        Since:
        4.7.0