MCPcopy Create free account
hub / github.com/HumbleUI/JWM / ClipboardEntry

Class ClipboardEntry

shared/java/ClipboardEntry.java:6–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4import lombok.*;
5
6@Data
7public class ClipboardEntry {
8 @ApiStatus.Internal public final ClipboardFormat _format;
9 @ApiStatus.Internal public final byte[] _data;
10
11 /**
12 * <p>Make new clipboard entry from format and raw byte data.</p>
13 *
14 * @param format clipboard entry format
15 * @param data raw byte data
16 * @return clipboard entry
17 */
18 @NotNull
19 public static ClipboardEntry make(ClipboardFormat format, byte[] data) {
20 return new ClipboardEntry(format, data);
21 }
22
23 /**
24 * <p>Make new plain text entry from plain text.</p>
25 *
26 * @param text raw string text
27 * @return clipboard entry
28 */
29 @NotNull @SneakyThrows
30 public static ClipboardEntry makePlainText(String text) {
31 return makeString(ClipboardFormat.TEXT, text);
32 }
33
34 /**
35 * <p>Make new html entry from plain text.</p>
36 *
37 * @param text raw string text
38 * @return clipboard entry
39 */
40 @NotNull @SneakyThrows
41 public static ClipboardEntry makeHTML(String text) {
42 return makeString(ClipboardFormat.HTML, text);
43 }
44
45 /**
46 * <p>Make new rtf entry from plain text.</p>
47 *
48 * @param text raw string text
49 * @return clipboard entry
50 */
51 @NotNull @SneakyThrows
52 public static ClipboardEntry makeRTF(String text) {
53 return makeString(ClipboardFormat.RTF, text);
54 }
55
56 /**
57 * <p>Make new clipboard entry from format and plain text.</p>
58 *
59 * @param format clipboard entry format
60 * @param text raw string text
61 * @return clipboard entry
62 */
63 @NotNull @SneakyThrows

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected