public static boolean isNotEmpty(Map map) { return !isEmpty( map ); }
public static boolean isNotEmpty(Collection collection) { return !isEmpty( collection ); }
protected void sortMethods(List<FrameworkMethod> computedTestMethods) { if ( CollectionHelper.isEmpty( computedTestMethods ) ) { return; } Collections.sort( computedTestMethods, new Comparator<FrameworkMethod>() { @Override public int compare(FrameworkMethod o1, FrameworkMethod o2) { return o1.getName().compareTo( o2.getName() ); } } ); }
public IdentifierGeneratorDefinition( final String name, final String strategy, final Map<String, String> parameters) { this.name = name; this.strategy = strategy; if ( CollectionHelper.isEmpty( parameters ) ) { this.parameters = Collections.emptyMap(); } else { this.parameters = Collections.unmodifiableMap( parameters ); } }
public CollectionIdSourceImpl( ColumnSource columnSource, HibernateTypeSourceImpl typeSource, String generator, final Map<String, String> parameters) { this.columnSource = columnSource; this.typeSource = typeSource; this.generator = generator; if ( CollectionHelper.isEmpty( parameters ) ) { this.parameters = Collections.emptyMap(); } else { this.parameters = Collections.unmodifiableMap( parameters ); } }
@SuppressWarnings({ "unchecked" }) public FilterQueryPlanKey(String query, String collectionRole, boolean shallow, Map enabledFilters) { this.query = query; this.collectionRole = collectionRole; this.shallow = shallow; if ( CollectionHelper.isEmpty( enabledFilters ) ) { this.filterNames = Collections.emptySet(); } else { final Set<String> tmp = new HashSet<String>(); tmp.addAll( enabledFilters.keySet() ); this.filterNames = Collections.unmodifiableSet( tmp ); } int hash = query.hashCode(); hash = 29 * hash + collectionRole.hashCode(); hash = 29 * hash + ( shallow ? 1 : 0 ); hash = 29 * hash + filterNames.hashCode(); this.hashCode = hash; }
public static <K, V, E> Map<K, V> makeMap( Collection<E> collection, Function<E,K> keyProducer, Function<E,V> valueProducer) { if ( isEmpty( collection ) ) { return Collections.emptyMap(); } final Map<K, V> map = new HashMap<>(); for ( E element : collection ) { map.put( keyProducer.apply( element ), valueProducer.apply( element ) ); } return map; }
private static Map<String, String> extractConfigParameters(List<JaxbHbmConfigParameterType> paramElementList) { if ( CollectionHelper.isEmpty( paramElementList ) ) { return Collections.emptyMap(); } final Map<String,String> params = new HashMap<String,String>(); for ( JaxbHbmConfigParameterType paramElement : paramElementList ) { params.put( paramElement.getName(), paramElement.getValue() ); } return params; }
public void render(StringBuilder buffer, FilterAliasGenerator aliasGenerator, Map enabledFilters) { if ( CollectionHelper.isEmpty( filterNames ) ) { return; } for ( int i = 0, max = filterNames.length; i < max; i++ ) { if ( enabledFilters.containsKey( filterNames[i] ) ) { final String condition = filterConditions[i]; if ( StringHelper.isNotEmpty( condition ) ) { buffer.append( " and " ).append( render( aliasGenerator, i ) ); } } } }
public HQLQueryPlanKey(String query, boolean shallow, Map enabledFilters) { this.query = query; this.shallow = shallow; if ( CollectionHelper.isEmpty( enabledFilters ) ) { filterKeys = Collections.emptySet(); } else { final Set<DynamicFilterKey> tmp = new HashSet<DynamicFilterKey>( CollectionHelper.determineProperSizing( enabledFilters ), CollectionHelper.LOAD_FACTOR ); for ( Object o : enabledFilters.values() ) { tmp.add( new DynamicFilterKey( (FilterImpl) o ) ); } this.filterKeys = Collections.unmodifiableSet( tmp ); } int hash = query.hashCode(); hash = 29 * hash + ( shallow ? 1 : 0 ); hash = 29 * hash + filterKeys.hashCode(); this.hashCode = hash; }
@Override public String[] getSynchronizedTableNames() { if ( CollectionHelper.isEmpty( jaxbEntityMapping.getSynchronize() ) ) { return StringHelper.EMPTY_STRINGS; } else { final int size = jaxbEntityMapping.getSynchronize().size(); final String[] synchronizedTableNames = new String[size]; for ( int i = 0; i < size; i++ ) { synchronizedTableNames[i] = jaxbEntityMapping.getSynchronize().get( i ).getTable(); } return synchronizedTableNames; } }
PersistentClass pc, HbmLocalMetadataBuildingContext context) { if ( CollectionHelper.isEmpty( rtnSource.getReturnProperty() ) ) { return null;
final SharedSessionContractImplementor session) throws SQLException, HibernateException { int result = 0; if ( CollectionHelper.isEmpty( namedParams ) ) { return result;
public static boolean isNotEmpty(Map map) { return !isEmpty( map ); } }
public IdGenerator( String name, String strategy, Map<String, String> parameters ) { this.name = name; this.strategy = strategy; if ( CollectionHelper.isEmpty( parameters ) ) { this.parameters = Collections.emptyMap(); } else { this.parameters = Collections.unmodifiableMap( parameters ); } }
public IdGenerator( String name, String strategy, Map<String, String> parameters ) { this.name = name; this.strategy = strategy; if ( CollectionHelper.isEmpty( parameters ) ) { this.parameters = Collections.emptyMap(); } else { this.parameters = Collections.unmodifiableMap( parameters ); } }
if ( !CollectionHelper.isEmpty( elementSource.getFilterSources() ) || elementSource.getWhere() != null ) { if ( getCollectionBinding().getFetchMode() == FetchMode.JOIN
public static Set<CascadeStyle> cascadeTypeToCascadeStyleSet(Set<CascadeType> cascadeTypes) { if ( CollectionHelper.isEmpty( cascadeTypes ) ) { return Collections.emptySet(); } Set<CascadeStyle> cascadeStyleSet = new HashSet<CascadeStyle>(); for ( CascadeType cascadeType : cascadeTypes ) { cascadeStyleSet.add( cascadeTypeToCascadeStyle( cascadeType ) ); } return cascadeStyleSet; } }
public static Set<CascadeStyle> cascadeTypeToCascadeStyleSet(Set<CascadeType> cascadeTypes) { if ( CollectionHelper.isEmpty( cascadeTypes ) ) { return Collections.emptySet(); } Set<CascadeStyle> cascadeStyleSet = new HashSet<CascadeStyle>(); for ( CascadeType cascadeType : cascadeTypes ) { cascadeStyleSet.add( cascadeTypeToCascadeStyle( cascadeType ) ); } return cascadeStyleSet; } }
public void render(StringBuilder buffer, FilterAliasGenerator aliasGenerator, Map enabledFilters) { if ( CollectionHelper.isEmpty( filterNames ) ) { return; } for ( int i = 0, max = filterNames.length; i < max; i++ ) { if ( enabledFilters.containsKey( filterNames[i] ) ) { final String condition = filterConditions[i]; if ( StringHelper.isNotEmpty( condition ) ) { buffer.append( " and " ).append( render( aliasGenerator, i ) ); } } } }