Java Code Examples for org.springframework.data.mapping.Alias#isPresent()

The following examples show how to use org.springframework.data.mapping.Alias#isPresent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultArangoTypeMapper.java    From spring-data with Apache License 2.0 5 votes vote down vote up
public void writeType(final TypeInformation<?> info, final VPackBuilder sink) {
	Assert.notNull(info, "TypeInformation must not be null!");

	final Alias alias = getAliasFor(info);
	if (alias.isPresent()) {
		accessor.writeTypeTo(sink, alias.getValue());
	}
}
 
Example 2
Source File: DefaultArangoTypeMapper.java    From spring-data with Apache License 2.0 5 votes vote down vote up
protected final Alias getAliasFor(final TypeInformation<?> info) {
	Assert.notNull(info, "TypeInformation must not be null!");
	
	for (final TypeInformationMapper mapper : mappers) {
		final Alias alias = mapper.createAliasFor(info);
		if (alias.isPresent()) {
			return alias;
		}
	}

	return Alias.NONE;
}