blob: e2b4b68ef625c1e119cd1f376b58c4bb4789964a [file] [log] [blame]
Matthias Andreas Benkard31c61e72021-12-16 20:06:39 +01001package eu.mulk.jgvariant.core;
2
3/**
4 * A dynamically typed GVariant value carrying a {@link Signature} describing its type.
5 *
6 * <p>{@link #value()} can be of one of the following types:
7 *
8 * <ul>
9 * <li>{@link Boolean}
10 * <li>{@link Byte}
11 * <li>{@link Short}
12 * <li>{@link Integer}
13 * <li>{@link Long}
14 * <li>{@link String}
15 * <li>{@link java.util.Optional} (a GVariant {@code Maybe} type)
16 * <li>{@link java.util.List} (a GVariant array)
17 * <li>{@link Object[]} (a GVariant structure)
18 * </ul>
19 *
20 * @param signature the signature describing the type of the value.
21 * @param value the value itself; one of {@link Boolean}, {@link Byte}, {@link Short}, {@link
22 * Integer}, {@link Long}, {@link String}, {@link java.util.Optional}, {@link java.util.List},
23 * {@link Object[]}.
24 */
25public record Variant(Signature signature, Object value) {}