Subversion Repositories SmartDukaan

Rev

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

Rev 21675 Rev 21756
Line 4... Line 4...
4
import java.time.LocalDateTime;
4
import java.time.LocalDateTime;
5
import java.time.LocalTime;
5
import java.time.LocalTime;
6
import java.time.format.DateTimeParseException;
6
import java.time.format.DateTimeParseException;
7
import java.util.ArrayList;
7
import java.util.ArrayList;
8
import java.util.List;
8
import java.util.List;
9
import java.util.Map;
-
 
10
import java.util.Set;
-
 
11
 
9
 
12
import javax.mail.internet.InternetAddress;
10
import javax.mail.internet.InternetAddress;
13
 
11
 
14
import org.slf4j.Logger;
12
import org.slf4j.Logger;
15
import org.slf4j.LoggerFactory;
13
import org.slf4j.LoggerFactory;
16
 
14
 
17
import com.fasterxml.jackson.core.JsonProcessingException;
15
import com.fasterxml.jackson.core.JsonProcessingException;
18
import com.fasterxml.jackson.databind.ObjectMapper;
16
import com.fasterxml.jackson.databind.ObjectMapper;
19
import com.sun.mail.imap.protocol.Item;
-
 
20
 
17
 
21
public class StringUtils {
18
public class StringUtils {
22
	
19
	
23
	private static ObjectMapper objectMapper = new ObjectMapper();
20
	private static ObjectMapper objectMapper = new ObjectMapper();
24
	
21
	
Line 88... Line 85...
88
		} catch (JsonProcessingException e) {
85
		} catch (JsonProcessingException e) {
89
			LOGGER.error("Error occured while converting object to json", e);
86
			LOGGER.error("Error occured while converting object to json", e);
90
			throw e;
87
			throw e;
91
		}
88
		}
92
	}
89
	}
-
 
90
	public static boolean isValidPinCode(String pinCode){
-
 
91
		if(pinCode == null || pinCode.isEmpty()){
-
 
92
			return false;
-
 
93
		}
-
 
94
		if(pinCode.length() != 6){
-
 
95
			return false;
-
 
96
		}
-
 
97
		if(pinCode.startsWith("00") || pinCode.startsWith("01") || pinCode.startsWith("10")){
-
 
98
			return false;
-
 
99
		}
-
 
100
		return true;
-
 
101
		
-
 
102
	}
93
 
103
 
94
}
104
}