1 22 23 24 package com.mchange.v2.coalesce; 25 26 public final class CoalescerFactory 27 { 28 37 public static Coalescer createCoalescer() 38 { return createCoalescer( true, true ); } 39 40 54 public static Coalescer createCoalescer( boolean weak, boolean synced ) 55 { return createCoalescer( null, weak, synced ); } 56 57 80 public static Coalescer createCoalescer( CoalesceChecker cc, boolean weak, boolean synced ) 81 { 82 Coalescer out; 83 if ( cc == null ) 84 { 85 out = ( weak ? 86 (Coalescer) new WeakEqualsCoalescer() : 87 (Coalescer) new StrongEqualsCoalescer() ); 88 } 89 else 90 { 91 out = ( weak ? 92 (Coalescer) new WeakCcCoalescer( cc ) : 93 (Coalescer) new StrongCcCoalescer( cc ) ); 94 } 95 return ( synced ? new SyncedCoalescer( out ) : out ); 96 } 97 98 } 99 | Popular Tags |