blob: 134a5e8343f8f2160cd4e40cdff6ce07d5dcc4ae [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)
Matthias Andreas Benkardb50fcd02021-12-16 20:17:20 +010018 * <li>{@link Variant} (a nested variant)
Matthias Andreas Benkard31c61e72021-12-16 20:06:39 +010019 * </ul>
20 *
21 * @param signature the signature describing the type of the value.
22 * @param value the value itself; one of {@link Boolean}, {@link Byte}, {@link Short}, {@link
23 * Integer}, {@link Long}, {@link String}, {@link java.util.Optional}, {@link java.util.List},
Matthias Andreas Benkardb50fcd02021-12-16 20:17:20 +010024 * {@link Object[]}, {@link Variant}.
Matthias Andreas Benkard31c61e72021-12-16 20:06:39 +010025 */
26public record Variant(Signature signature, Object value) {}