All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.search.elasticsearch.bridge.impl.ElasticsearchPrimitiveBridgeProvider Maven / Gradle / Ivy

There is a newer version: 5.11.12.Final
Show newest version
/*
 * Hibernate Search, full-text search for your domain model
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later
 * See the lgpl.txt file in the root directory or .
 */

package org.hibernate.search.elasticsearch.bridge.impl;

import org.hibernate.search.bridge.FieldBridge;
import org.hibernate.search.bridge.spi.BridgeProvider;
import org.hibernate.search.bridge.util.impl.TwoWayString2FieldBridgeIgnoreAnalyzerAdaptor;
import org.hibernate.search.elasticsearch.bridge.builtin.impl.ElasticsearchBooleanBridge;

/**
 * Creates bridges specific to Elasticsearch for primitive types.
 *
 * @author Yoann Rodiere
 */
class ElasticsearchPrimitiveBridgeProvider implements BridgeProvider {

	@Override
	public FieldBridge provideFieldBridge(BridgeProviderContext context) {
		Class returnType = context.getReturnType();
		if ( Boolean.class.equals( returnType ) || boolean.class.equals( returnType ) ) {
			return new TwoWayString2FieldBridgeIgnoreAnalyzerAdaptor( ElasticsearchBooleanBridge.INSTANCE );
		}

		return null;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy