package net.minecraft.network.chat;

import net.minecraft.ChatFormatting;
import java.util.function.UnaryOperator;

public interface MutableComponent extends Component {
    MutableComponent setStyle(final Style nb);
    
    default MutableComponent append(final String string) {
        return this.append(new TextComponent(string));
    }
    
    MutableComponent append(final Component mr);
    
    default MutableComponent withStyle(final UnaryOperator<Style> unaryOperator) {
        this.setStyle(unaryOperator.apply(this.getStyle()));
        return this;
    }
    
    default MutableComponent withStyle(final Style nb) {
        this.setStyle(nb.applyTo(this.getStyle()));
        return this;
    }
    
    default MutableComponent withStyle(final ChatFormatting... arr) {
        this.setStyle(this.getStyle().applyFormats(arr));
        return this;
    }
    
    default MutableComponent withStyle(final ChatFormatting i) {
        this.setStyle(this.getStyle().applyFormat(i));
        return this;
    }
}
