1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   // Generated from: ../../../../../../metaschema/unit-tests.yaml
6   // Do not edit - changes will be lost when regenerated.
7   
8   package dev.metaschema.model.testing.testsuite;
9   
10  import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
11  import org.apache.commons.lang3.builder.ToStringStyle;
12  
13  import java.net.URI;
14  
15  import dev.metaschema.core.datatype.adapter.TokenAdapter;
16  import dev.metaschema.core.datatype.adapter.UriReferenceAdapter;
17  import dev.metaschema.core.model.IBoundObject;
18  import dev.metaschema.core.model.IMetaschemaData;
19  import dev.metaschema.core.model.constraint.IConstraint;
20  import dev.metaschema.core.util.ObjectUtils;
21  import dev.metaschema.databind.model.annotations.AllowedValue;
22  import dev.metaschema.databind.model.annotations.AllowedValues;
23  import dev.metaschema.databind.model.annotations.BoundFlag;
24  import dev.metaschema.databind.model.annotations.MetaschemaAssembly;
25  import dev.metaschema.databind.model.annotations.ValueConstraints;
26  import edu.umd.cs.findbugs.annotations.NonNull;
27  import edu.umd.cs.findbugs.annotations.Nullable;
28  
29  /**
30   * A schema generation comparison test case.
31   */
32  @MetaschemaAssembly(
33      formalName = "Generation Case",
34      description = "A schema generation comparison test case.",
35      name = "generation-case",
36      moduleClass = MetaschemaTestSuiteModule.class)
37  public class GenerationCase implements IBoundObject {
38    private final IMetaschemaData __metaschemaData;
39  
40    /**
41     * The format of the source content.
42     */
43    @BoundFlag(
44        formalName = "Source Format",
45        description = "The format of the source content.",
46        name = "source-format",
47        typeAdapter = TokenAdapter.class,
48        valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR,
49            values = { @AllowedValue(value = "XML", description = "Content is XML."),
50                @AllowedValue(value = "JSON", description = "Content is JSON."),
51                @AllowedValue(value = "YAML", description = "Content is YAML.") })))
52    private String _sourceFormat;
53  
54    /**
55     * A URI reference to the expected schema file location.
56     */
57    @BoundFlag(
58        formalName = "Location",
59        description = "A URI reference to the expected schema file location.",
60        name = "location",
61        required = true,
62        typeAdapter = UriReferenceAdapter.class)
63    private URI _location;
64  
65    /**
66     * The expected result of content comparison.
67     */
68    @BoundFlag(
69        formalName = "Match Result",
70        description = "The expected result of content comparison.",
71        name = "match-result",
72        defaultValue = "MATCH",
73        typeAdapter = TokenAdapter.class,
74        valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, values = {
75            @AllowedValue(value = "MATCH", description = "The actual content matched the expected content."),
76            @AllowedValue(value = "MISMATCH", description = "The actual content did not match the expected content.") })))
77    private String _matchResult;
78  
79    /**
80     * Constructs a new
81     * {@code dev.metaschema.model.testing.testsuite.GenerationCase} instance with
82     * no metadata.
83     */
84    public GenerationCase() {
85      this(null);
86    }
87  
88    /**
89     * Constructs a new
90     * {@code dev.metaschema.model.testing.testsuite.GenerationCase} instance with
91     * the specified metadata.
92     *
93     * @param data
94     *          the metaschema data, or {@code null} if none
95     */
96    public GenerationCase(IMetaschemaData data) {
97      this.__metaschemaData = data;
98    }
99  
100   @Override
101   public IMetaschemaData getMetaschemaData() {
102     return __metaschemaData;
103   }
104 
105   /**
106    * Get the source Format.
107    *
108    * <p>
109    * The format of the source content.
110    *
111    * @return the source-format value, or {@code null} if not set
112    */
113   @Nullable
114   public String getSourceFormat() {
115     return _sourceFormat;
116   }
117 
118   /**
119    * Set the source Format.
120    *
121    * <p>
122    * The format of the source content.
123    *
124    * @param value
125    *          the source-format value to set, or {@code null} to clear
126    */
127   public void setSourceFormat(@Nullable String value) {
128     _sourceFormat = value;
129   }
130 
131   /**
132    * Get the location.
133    *
134    * <p>
135    * A URI reference to the expected schema file location.
136    *
137    * @return the location value
138    */
139   @NonNull
140   public URI getLocation() {
141     return _location;
142   }
143 
144   /**
145    * Set the location.
146    *
147    * <p>
148    * A URI reference to the expected schema file location.
149    *
150    * @param value
151    *          the location value to set
152    */
153   public void setLocation(@NonNull URI value) {
154     _location = value;
155   }
156 
157   /**
158    * Get the match Result.
159    *
160    * <p>
161    * The expected result of content comparison.
162    *
163    * @return the match-result value, or {@code null} if not set
164    */
165   @Nullable
166   public String getMatchResult() {
167     return _matchResult;
168   }
169 
170   /**
171    * Set the match Result.
172    *
173    * <p>
174    * The expected result of content comparison.
175    *
176    * @param value
177    *          the match-result value to set, or {@code null} to clear
178    */
179   public void setMatchResult(@Nullable String value) {
180     _matchResult = value;
181   }
182 
183   @Override
184   public String toString() {
185     return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString());
186   }
187 }