protected < X > Specification < ENTITY > equalsSpecification ( Function < Root < ENTITY > , Expression < X > > metaclassFunction , final X value ) { return ( root , query , builder ) -> builder . equal ( metaclassFunction . apply ( root ) , value ) ; }
Generic method which based on a Root&lt ; ENTITY&gt ; returns an Expression which type is the same as the given value type .