class DefaultSchemaFactory implements SchemaFactory {

  @Override
  public Schema createSchema(Iterable<FieldValueGetter> fieldValueGetters) {
    List<Schema.Field> fields = Lists.newArrayList();
    for (FieldValueGetter getter : fieldValueGetters) {
      fields.add(Schema.Field.of(getter.name(), getTypeDescriptor(getter.type())));
    }
    return Schema.builder().addFields(fields).build();
  }

}