Subversion Repositories SmartDukaan

Rev

Rev 23663 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23663 Rev 23784
Line 3... Line 3...
3
import java.util.function.BiConsumer;
3
import java.util.function.BiConsumer;
4
import java.util.function.Function;
4
import java.util.function.Function;
5
import java.util.stream.Collector;
5
import java.util.stream.Collector;
6
import java.util.stream.Stream;
6
import java.util.stream.Stream;
7
 
7
 
8
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
-
 
9
import com.spice.profitmandi.web.model.LoginDetails;
-
 
10
 
-
 
11
public class Utils {
8
public class Utils {
12
	public static String getRedictUrlFromLogin(LoginDetails loginDetails) {
-
 
13
		if ((loginDetails.getRoleTypes().contains(RoleType.RETAILER)
-
 
14
				&& loginDetails.getRoleTypes().contains(RoleType.FOFO))
-
 
15
				|| (loginDetails.getRoleTypes().contains(RoleType.FOFO_ADMIN))) {
-
 
16
			return "/dashboard";
-
 
17
		} else {
-
 
18
			return "/login";
-
 
19
		}
-
 
20
	}
-
 
21
 
9
 
22
	static <T, U, A, R> Collector<T, ?, R> flatMapping(Function<? super T, ? extends Stream<? extends U>> mapper,
10
	static <T, U, A, R> Collector<T, ?, R> flatMapping(Function<? super T, ? extends Stream<? extends U>> mapper,
23
			Collector<? super U, A, R> downstream) {
11
			Collector<? super U, A, R> downstream) {
24
 
12
 
25
		BiConsumer<A, ? super U> acc = downstream.accumulator();
13
		BiConsumer<A, ? super U> acc = downstream.accumulator();