blob: d1c1049c052d911c604af8106fa16dc7edd53c0d [file] [log] [blame]
Matthias Andreas Benkard31c61e72021-12-16 20:06:39 +01001package eu.mulk.jgvariant.core;
2
Matthias Andreas Benkard25b7f902021-12-17 06:02:11 +01003import org.apiguardian.api.API;
4import org.apiguardian.api.API.Status;
5
Matthias Andreas Benkard31c61e72021-12-16 20:06:39 +01006/**
7 * A dynamically typed GVariant value carrying a {@link Signature} describing its type.
8 *
9 * <p>{@link #value()} can be of one of the following types:
10 *
11 * <ul>
12 * <li>{@link Boolean}
13 * <li>{@link Byte}
14 * <li>{@link Short}
15 * <li>{@link Integer}
16 * <li>{@link Long}
17 * <li>{@link String}
18 * <li>{@link java.util.Optional} (a GVariant {@code Maybe} type)
19 * <li>{@link java.util.List} (a GVariant array)
Matthias Andreas Benkarda66b73d2021-12-18 19:15:52 +010020 * <li>{@code Object[]} (a GVariant structure)
Matthias Andreas Benkardb50fcd02021-12-16 20:17:20 +010021 * <li>{@link Variant} (a nested variant)
Matthias Andreas Benkard31c61e72021-12-16 20:06:39 +010022 * </ul>
23 *
24 * @param signature the signature describing the type of the value.
25 * @param value the value itself; one of {@link Boolean}, {@link Byte}, {@link Short}, {@link
26 * Integer}, {@link Long}, {@link String}, {@link java.util.Optional}, {@link java.util.List},
Matthias Andreas Benkarda66b73d2021-12-18 19:15:52 +010027 * {@code Object[]}, {@link Variant}.
Matthias Andreas Benkard31c61e72021-12-16 20:06:39 +010028 */
Matthias Andreas Benkard25b7f902021-12-17 06:02:11 +010029@API(status = Status.EXPERIMENTAL)
Matthias Andreas Benkard31c61e72021-12-16 20:06:39 +010030public record Variant(Signature signature, Object value) {}