Class TypedComponentReplacerImpl<T extends Component>

java.lang.Object
net.dv8tion.jda.internal.components.replacer.TypedComponentReplacerImpl<T>
All Implemented Interfaces:
ComponentReplacer

public class TypedComponentReplacerImpl<T extends Component> extends Object implements ComponentReplacer
  • Constructor Details

  • Method Details

    • apply

      @Nullable public Component apply(@Nonnull Component oldComponent)
      Description copied from interface: ComponentReplacer
      Attempts to replace or remove the given component.

      If this method returns the same component and contains children, then this replacer will be applied recursively; otherwise, the component is not replaced.

      The returned component must be compatible with the source (a ActionRow or a Container for example) it originated from.

      Specified by:
      apply in interface ComponentReplacer
      Parameters:
      oldComponent - The component which is attempted to be replaced
      Returns:
      A new, compatible component, the same component, or null to remove the component.