public MessageType union(MessageType toMerge) { return union(toMerge, true); }
/** * will return the result of merging toMerge into mergedSchema * @param toMerge the schema to merge into mergedSchema * @param mergedSchema the schema to append the fields to * @param strict should schema primitive types match * @return the resulting schema */ static MessageType mergeInto(MessageType toMerge, MessageType mergedSchema, boolean strict) { if (mergedSchema == null) { return toMerge; } return mergedSchema.union(toMerge, strict); }
/** * will return the result of merging toMerge into mergedSchema * @param toMerge the schema to merge into mergedSchema * @param mergedSchema the schema to append the fields to * @param strict should schema primitive types match * @return the resulting schema */ static MessageType mergeInto(MessageType toMerge, MessageType mergedSchema, boolean strict) { if (mergedSchema == null) { return toMerge; } return mergedSchema.union(toMerge, strict); }
public MessageType union(MessageType toMerge) { return union(toMerge, true); }
projection = new MessageType(messageName, t); } else { projection = projection.union(new MessageType(messageName, t));
projection = new MessageType(messageName, t); } else { projection = projection.union(new MessageType(messageName, t));
public static void main(String[] args) { MessageType message1; MessageType message2; PrimitiveType c = new PrimitiveType(Repetition.OPTIONAL, PrimitiveTypeName.INT32, "c"); GroupType b = new GroupType(Repetition.REQUIRED, "b"); GroupType a = new GroupType(Repetition.OPTIONAL, "a", b); message1 = new MessageType("root", a); PrimitiveType c2 = new PrimitiveType(Repetition.OPTIONAL, PrimitiveTypeName.INT32, "d"); GroupType b2 = new GroupType(Repetition.OPTIONAL, "b", c2); GroupType a2 = new GroupType(Repetition.OPTIONAL, "a", b2); message2 = new MessageType("root", a2); MessageType message3 = message1.union(message2); StringBuilder builder = new StringBuilder(); message3.writeToStringBuilder(builder, ""); System.out.println(builder); } }