MCPcopy Index your code
hub / github.com/apache/avro / create

Method create

lang/java/avro/src/main/java/org/apache/avro/Schema.java:152–173  ·  view source on GitHub ↗

Create a schema for a primitive type.

(Type type)

Source from the content-addressed store, hash-verified

150
151 /** Create a schema for a primitive type. */
152 public static Schema create(Type type) {
153 switch (type) {
154 case STRING:
155 return new StringSchema();
156 case BYTES:
157 return new BytesSchema();
158 case INT:
159 return new IntSchema();
160 case LONG:
161 return new LongSchema();
162 case FLOAT:
163 return new FloatSchema();
164 case DOUBLE:
165 return new DoubleSchema();
166 case BOOLEAN:
167 return new BooleanSchema();
168 case NULL:
169 return new NullSchema();
170 default:
171 throw new AvroRuntimeException("Can't create a: " + type);
172 }
173 }
174
175 private static final Set<String> SCHEMA_RESERVED = new HashSet<>(
176 Arrays.asList("doc", "fields", "items", "name", "namespace", "size", "symbols", "values", "type", "aliases"));

Callers 15

writeSampleFileMethod · 0.95
recodecMethod · 0.95
generateDataMethod · 0.95
writeRandomFileMethod · 0.95
generateDataMethod · 0.95
R1EncodingClass · 0.95
primitivesMethod · 0.95
TestWordCountClass · 0.95
writeLinesFileMethod · 0.95

Calls

no outgoing calls

Tested by 15

writeSampleFileMethod · 0.76
recodecMethod · 0.76
generateDataMethod · 0.76
writeRandomFileMethod · 0.76
generateDataMethod · 0.76
primitivesMethod · 0.76
writeLinesFileMethod · 0.76
javaUnboxMethod · 0.76
javaUnboxDateTimeMethod · 0.76