class SchemaNameAsAttribute implements SchemaAccessWriter {

    @Override
    public void validateSchema(final RecordSchema schema) throws SchemaNotFoundException {
        final SchemaIdentifier schemaId = schema.getIdentifier();
        if (schemaId == null) {
            throw new SchemaNotFoundException("Cannot write Schema Name As Attribute because Schema Identifier is not known");
        }
        if (!schemaId.getName().isPresent()) {
            throw new SchemaNotFoundException("Cannot write Schema Name As Attribute because the Schema Name is not known");
        }
    }

}