001/* 002 * SPDX-FileCopyrightText: none 003 * SPDX-License-Identifier: CC0-1.0 004 */ 005// Generated from: ../../../../../../metaschema/unit-tests.yaml 006// Do not edit - changes will be lost when regenerated. 007 008package dev.metaschema.model.testing.testsuite; 009 010import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 011import org.apache.commons.lang3.builder.ToStringStyle; 012 013import java.net.URI; 014 015import dev.metaschema.core.datatype.adapter.TokenAdapter; 016import dev.metaschema.core.datatype.adapter.UriReferenceAdapter; 017import dev.metaschema.core.model.IBoundObject; 018import dev.metaschema.core.model.IMetaschemaData; 019import dev.metaschema.core.model.constraint.IConstraint; 020import dev.metaschema.core.util.ObjectUtils; 021import dev.metaschema.databind.model.annotations.AllowedValue; 022import dev.metaschema.databind.model.annotations.AllowedValues; 023import dev.metaschema.databind.model.annotations.BoundFlag; 024import dev.metaschema.databind.model.annotations.MetaschemaAssembly; 025import dev.metaschema.databind.model.annotations.ValueConstraints; 026import edu.umd.cs.findbugs.annotations.NonNull; 027import edu.umd.cs.findbugs.annotations.Nullable; 028 029/** 030 * A schema generation comparison test case. 031 */ 032@MetaschemaAssembly( 033 formalName = "Generation Case", 034 description = "A schema generation comparison test case.", 035 name = "generation-case", 036 moduleClass = MetaschemaTestSuiteModule.class) 037public class GenerationCase implements IBoundObject { 038 private final IMetaschemaData __metaschemaData; 039 040 /** 041 * The format of the source content. 042 */ 043 @BoundFlag( 044 formalName = "Source Format", 045 description = "The format of the source content.", 046 name = "source-format", 047 typeAdapter = TokenAdapter.class, 048 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, 049 values = { @AllowedValue(value = "XML", description = "Content is XML."), 050 @AllowedValue(value = "JSON", description = "Content is JSON."), 051 @AllowedValue(value = "YAML", description = "Content is YAML.") }))) 052 private String _sourceFormat; 053 054 /** 055 * A URI reference to the expected schema file location. 056 */ 057 @BoundFlag( 058 formalName = "Location", 059 description = "A URI reference to the expected schema file location.", 060 name = "location", 061 required = true, 062 typeAdapter = UriReferenceAdapter.class) 063 private URI _location; 064 065 /** 066 * The expected result of content comparison. 067 */ 068 @BoundFlag( 069 formalName = "Match Result", 070 description = "The expected result of content comparison.", 071 name = "match-result", 072 defaultValue = "MATCH", 073 typeAdapter = TokenAdapter.class, 074 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, values = { 075 @AllowedValue(value = "MATCH", description = "The actual content matched the expected content."), 076 @AllowedValue(value = "MISMATCH", description = "The actual content did not match the expected content.") }))) 077 private String _matchResult; 078 079 /** 080 * Constructs a new 081 * {@code dev.metaschema.model.testing.testsuite.GenerationCase} instance with 082 * no metadata. 083 */ 084 public GenerationCase() { 085 this(null); 086 } 087 088 /** 089 * Constructs a new 090 * {@code dev.metaschema.model.testing.testsuite.GenerationCase} instance with 091 * the specified metadata. 092 * 093 * @param data 094 * the metaschema data, or {@code null} if none 095 */ 096 public GenerationCase(IMetaschemaData data) { 097 this.__metaschemaData = data; 098 } 099 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}