@Test void testMake_content() { final KeybindComponent component = KeybindComponent.make("key.jump", builder -> builder.color(TextColor.DARK_PURPLE)); assertEquals("key.jump", component.keybind()); assertEquals(TextColor.DARK_PURPLE, component.color()); }
@Test void testMake() { final KeybindComponent component = KeybindComponent.make(builder -> { builder.keybind("key.jump"); builder.color(TextColor.DARK_PURPLE); }); assertEquals("key.jump", component.keybind()); assertEquals(TextColor.DARK_PURPLE, component.color()); }
/** * Creates a keybind component with content, and optional color and decorations. * * @param keybind the keybind * @param color the color * @param decorations the decorations * @return the keybind component */ public static KeybindComponent of(final @NonNull String keybind, final @Nullable TextColor color, final @NonNull Set<TextDecoration> decorations) { return builder(keybind).color(color).decorations(decorations, true).build(); }
/** * Creates a keybind component with content, and optional color and decorations. * * @param keybind the keybind * @param color the color * @param decorations the decorations * @return the keybind component */ public static KeybindComponent of(final @NonNull String keybind, final @Nullable TextColor color, final @NonNull Set<TextDecoration> decorations) { return builder(keybind).color(color).decorations(decorations, true).build(); }
/** * Creates a keybind component with content, and optional color and decorations. * * @param keybind the keybind * @param color the color * @param decorations the decorations * @return the keybind component */ public static KeybindComponent of(final @NonNull String keybind, final @Nullable TextColor color, final @NonNull Set<TextDecoration> decorations) { return builder(keybind).color(color).decorations(decorations, true).build(); }