blob: d9e13dd0b53d72137c1de9631f798d4a6a96fc6b [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 Benkardd6a25d12021-12-28 01:13:58 +010021 * <li>{@link java.util.Map} (a dictionary)
Matthias Andreas Benkardcd924f62021-12-28 00:46:06 +010022 * <li>{@link java.util.Map.Entry} (a dictionary entry)
Matthias Andreas Benkardb50fcd02021-12-16 20:17:20 +010023 * <li>{@link Variant} (a nested variant)
Matthias Andreas Benkard31c61e72021-12-16 20:06:39 +010024 * </ul>
25 *
26 * @param signature the signature describing the type of the value.
27 * @param value the value itself; one of {@link Boolean}, {@link Byte}, {@link Short}, {@link
28 * Integer}, {@link Long}, {@link String}, {@link java.util.Optional}, {@link java.util.List},
Matthias Andreas Benkarda66b73d2021-12-18 19:15:52 +010029 * {@code Object[]}, {@link Variant}.
Matthias Andreas Benkard31c61e72021-12-16 20:06:39 +010030 */
Matthias Andreas Benkard25b7f902021-12-17 06:02:11 +010031@API(status = Status.EXPERIMENTAL)
Matthias Andreas Benkard31c61e72021-12-16 20:06:39 +010032public record Variant(Signature signature, Object value) {}