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