Subversion Repositories SmartDukaan

Rev

Rev 31697 | Rev 32199 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31697 Rev 31903
Line 41... Line 41...
41
import java.util.regex.Matcher;
41
import java.util.regex.Matcher;
42
import java.util.regex.Pattern;
42
import java.util.regex.Pattern;
43
 
43
 
44
public class Utils {
44
public class Utils {
45
 
45
 
46
	private static final float FLOAT_EPSILON = 0.001f;
46
	public static final float FLOAT_EPSILON = 0.001f;
47
 
47
 
48
	private static final double DOUBLE_EPSILON = 0.001d;
48
	public static final double DOUBLE_EPSILON = 0.001d;
49
 
49
 
50
	private static final Logger logger = LogManager.getLogger(Utils.class);
50
	private static final Logger logger = LogManager.getLogger(Utils.class);
51
	public static final String EXPORT_ENTITIES_PATH = getExportPath();
51
	public static final String EXPORT_ENTITIES_PATH = getExportPath();
52
	public static final String PRODUCT_PROPERTIES_SNIPPET = "ProductPropertiesSnippet.html";
52
	public static final String PRODUCT_PROPERTIES_SNIPPET = "ProductPropertiesSnippet.html";
53
	public static final String DOCUMENT_STORE = "/profitmandi/documents/";
53
	public static final String DOCUMENT_STORE = "/profitmandi/documents/";
Line 484... Line 484...
484
	public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
484
	public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
485
		Set<Object> seen = ConcurrentHashMap.newKeySet();
485
		Set<Object> seen = ConcurrentHashMap.newKeySet();
486
		return t -> seen.add(keyExtractor.apply(t));
486
		return t -> seen.add(keyExtractor.apply(t));
487
	}
487
	}
488
 
488
 
-
 
489
	public static <T> Predicate<T> smallestByKey(Function<? super T, ?> keyExtractor) {
-
 
490
		Set<Object> seen = ConcurrentHashMap.newKeySet();
-
 
491
		return t -> seen.add(keyExtractor.apply(t));
-
 
492
	}
-
 
493
 
489
}
494
}
490
495