query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Data has been read from a socket.
public void readFromSocket(long socketId) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean read() throws IOException\n\t{\n\t\treturn this.read(this.socket);\n\t}", "private boolean isGettingData(){\n int available;\n long startTime = System.nanoTime();\n int timeout = 100;\n InputStream inStream = null;\n flushStream();\n try {\n if(socket!=null)\n inStream = socket.getInputStream();\n Thread.sleep(100); //The Arduino keeps sending data for 100ms after it is told to stop\n }catch(IOException | InterruptedException e){}\n try {\n while (true) {\n available = inStream.available();\n if (available > 0) {\n return true;\n }\n Thread.sleep(1);\n long estimatedTime = System.nanoTime() - startTime;\n long estimatedMillis = TimeUnit.MILLISECONDS.convert(estimatedTime,\n TimeUnit.NANOSECONDS);\n if (estimatedMillis > timeout){\n return false; //timeout, no data coming\n }\n }\n }catch(IOException | InterruptedException | NullPointerException e){\n Log.d(\"Exception\", \"Exception\");\n }\n return false;\n }", "public void readFromSocket() throws IOException, JSONException {\n int bytesAvailable = bluetoothSocket.getInputStream().available();\n if (bytesAvailable > 0) {\n byte[] msg = new byte[bytesAvailable];\n bluetoothSocket.getInputStream().read(msg);\n String receivedMessage = new String(msg);\n mListener.onMessageReceived(receivedMessage); //fire the message to the service\n Log.i(TAG, \"receivedMessage: \" + receivedMessage);\n }\n }", "public void receiveData() throws IOException;", "public boolean read(Socket socket) throws IOException\n\t{\n\t\tthis.socket = socket;\n\t\tthis.readResponseHeader();\n\t\tlong length = this.getRequestDataLength();\n\t\tif(length > -1)\n\t\t{\n\t\t\tthis.body = this.getBody(length);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.body = \"\";\n\t\t\tthis.contentLength = 0;\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean dataIsReady()\n {\n boolean[] status = m_receiver.getBufferStatus();\n if (status.length == 0)\n {\n return false;\n }\n for (boolean b : status)\n {\n if (!b)\n return false;\n }\n return true;\n }", "void onMessageRead(byte[] data);", "@Override\n\tpublic void run()\n\t{\n\t\t try\n\t\t {\n\t\t\t DataInputStream stream = new DataInputStream(socket.getInputStream());\n\t\t\t byte[] data = new byte[3];\n\t\t\t data[0] = stream.readByte();\n\t\t\t data[1] = stream.readByte();\n\t\t\t data[2] = stream.readByte();\n\t\t\t short counter = stream.readShort();\n\n\t\t\t int checksum = data[0]+data[1]+counter;\n\n\t\t\t if(checksum+data[2] != 255)\n\t\t\t {\n\t\t\t\t System.out.println(\"Error: Message Checksum Failed\");\n\t\t\t\t return;\n\t\t\t }\n\n\t\t\t System.out.println(\"------Client-------\");\n\t\t\t System.out.println(\"Source:\"+(char)data[0]);\n\t\t\t System.out.println(\"Destination:\"+(char)data[1]);\n\t\t\t System.out.println(\"Data:\"+counter);\n\n }\n\t\t catch (IOException e)\n\t\t {\n\t\t\te.printStackTrace();\n\t\t }\n\t}", "boolean hasRead();", "public void onDataRecieved(byte data[]);", "public boolean isDataAvailable()\r\n {\r\n return true;\r\n }", "boolean hasSendReading();", "private void sendAndReceiveData(Socket socket) {\n try {\n long start = System.currentTimeMillis();\n\n // get the socket output stream\n OutputStream out = socket.getOutputStream();\n // get the socket input stream\n InputStream in = socket.getInputStream();\n DataInput dis = new DataInputStream(in);\n\n long iterations = dis.readLong();\n int size = dis.readInt();\n long total = iterations * size * 2L;\n long current = 0;\n\n System.out.println(MessageFormat.format(\"Sending/Receiving {0} bytes.\", total));\n while (current < iterations) {\n byte[] buf = new byte[size];\n dis.readFully(buf);\n out.write(buf);\n out.flush();\n current++;\n }\n\n out.close();\n in.close();\n\n long finish = System.currentTimeMillis();\n long elapsed = finish - start;\n System.out.println(MessageFormat.format(\"EOT. Received {0} bytes in {1} ms. Throughput = {2} KB/sec.\", total, elapsed,\n (total / elapsed) * 1000 / 1024));\n socket.close();\n System.out.println(\"Connection closed\");\n } catch (Exception ie) {\n ie.printStackTrace();\n }\n }", "void onDataReceived(int source, byte[] data);", "public boolean isDataAvailable(){return true;}", "public boolean isMessageReadFully() {\r\n\t\t\r\n\t\tCharBuffer charBuffer = byteBuffer.asCharBuffer();\r\n\t\tint limit = charBuffer.limit();\r\n\t\tString protocolMessage = null;\r\n\t\t//Check if the last char is ~ indicating the end of the message which also \r\n\t\t//indicates that the message is fully read\r\n\t\tif (charBuffer.get(limit) == '~') {\r\n\t\t\tprotocolMessage = charBuffer.toString();\r\n\t\t\tSystem.out.println(\"Protocol Message: \" + protocolMessage);\r\n\t\t\t//clear the buffer\r\n\t\t\tbyteBuffer.clear();\r\n\t\t\t//Decode the message into portions\r\n\t\t\tdecode(protocolMessage);\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\t\treturn false;\r\n\t\t\r\n\t\t\r\n\t}", "boolean hasReceived();", "public abstract void RecvData(int sock, String Data) throws LowLinkException, TransportLayerException;", "@Override\n public int read() throws IOException {\n if (stream.available() > 0) {\n return stream.read();\n } else {\n layer.receiveMoreDataForHint(getHint());\n // either the stream is now filled, or we ran into a timeout\n // or the next stream is available\n return stream.read();\n }\n }", "private boolean isReceived(DatagramSocket aSocket) throws IOException\n\t{\n\t\tbyte[] buffer = new byte[BUFFER_SIZE];\n\t\tDatagramPacket reply = new DatagramPacket(buffer, buffer.length);\n\t\ttry\n\t\t{\n\t\t\taSocket.setSoTimeout(TIMEOUT_SIZE);\n\t\t\taSocket.receive(reply);\n\n\t\t\tif(reply.getAddress() == null) return false;\n\n\t\t\tint validationNumber = Character.getNumericValue(new String(reply.getData()).charAt(0)); //Get first char and convert to int\n\t\t\tif(validationNumber == 0) System.out.println(\"Sent message was corrupt.\");\n\n\t\t\t//Packed was successfully sent if host returned 1\n\t\t\treturn validationNumber == 1;\n\t\t}\n\t\tcatch (SocketTimeoutException e)\n\t\t{\n\t\t\tSystem.out.println(\"Timeout.\");\n\t\t\treturn false;\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn false;\n\t}", "String processDataFromSocket(String data, long fromId);", "public boolean wasRead(){\n return isRead==null || isRead;\n }", "@Override\n public boolean read() throws Exception {\n if (count >= size) return true;\n if (source == null) source = new ChannelInputSource(channel);\n while (count < size) {\n final int n = location.transferFrom(source, false);\n if (n <= 0) break;\n count += n;\n channelCount = count;\n if (debugEnabled) log.debug(\"read {} bytes for {}\", n, this);\n }\n return count >= size;\n }", "private void doRead() throws IOException {\n\t\t\tvar res = sc.read(bb);\n\n\t\t\tif ( res == -1 ) {\n\t\t\t\tlogger.info(\"Connection closed with the client.\");\n\t\t\t\tclosed = true;\n\t\t\t}\n\n\t\t\tupdateInterestOps();\n\t\t}", "@DISPID(-2147412071)\n @PropGet\n java.lang.Object ondataavailable();", "@Override\n public synchronized byte[] receive(int length) throws SocketException {\n byte[] data = new byte[length];\n \n try {\n connectionSocket = serverSocket.accept();\n connectionSocket.getInputStream().read(data, 0, length);\n } catch (IOException ex) {\n Logger.getLogger(TCPServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return data;\n }", "public abstract void run(Data data, Socket socket);", "private boolean readResponse() throws IOException {\n replyHeaders.responseCode = socketInput.read();\n int packetLength = socketInput.read();\n packetLength = (packetLength << 8) + socketInput.read();\n\n if (packetLength > OBEXConstants.MAX_PACKET_SIZE_INT) {\n if (exceptionMessage != null) {\n abort();\n }\n throw new IOException(\"Received a packet that was too big\");\n }\n\n if (packetLength > BASE_PACKET_LENGTH) {\n int dataLength = packetLength - BASE_PACKET_LENGTH;\n byte[] data = new byte[dataLength];\n int readLength = socketInput.read(data);\n if (readLength != dataLength) {\n throw new IOException(\"Received a packet without data as decalred length\");\n }\n byte[] body = OBEXHelper.updateHeaderSet(replyHeaders, data);\n\n if (body != null) {\n privateInput.writeBytes(body, 1);\n\n /*\n * Determine if a body (0x48) header or an end of body (0x49)\n * was received. If we received an end of body and\n * a response code of OBEX_HTTP_OK, then the operation should\n * end.\n */\n if ((body[0] == 0x49) && (replyHeaders.responseCode == ResponseCodes.OBEX_HTTP_OK)) {\n return false;\n }\n }\n }\n\n if (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE) {\n return true;\n } else {\n return false;\n }\n }", "private void updateReceivedData(byte[] data) {\n }", "boolean hasData()\n {\n logger.info(\"server: \" + server + \" addr: \" + addr + \"text:\" + text);\n return server != null && addr != null && text != null;\n }", "public int available() {\n try {\n return m_DataInputStream.available();\n }\n catch (IOException e) {\n return -1;\n }\n }", "private boolean _read(byte[] b, int len) throws IOException {\n\t\t\tint s;\n\t\t\tint off = 0;\n\n\t\t\twhile (len > 0) {\n\t\t\t\ts = in.read(b, off, len);\n\t\t\t\tif (s == -1) {\n\t\t\t\t\t// if we have read something before, we should have been\n\t\t\t\t\t// able to read the whole, so make this fatal\n\t\t\t\t\tif (off > 0) {\n\t\t\t\t\t\tif (debug) {\n\t\t\t\t\t\t\tlogRd(\"the following incomplete block was received:\");\n\t\t\t\t\t\t\tlogRx(new String(b, 0, off, \"UTF-8\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow new IOException(\"Read from \" +\n\t\t\t\t\t\t\t\tcon.getInetAddress().getHostName() + \":\" +\n\t\t\t\t\t\t\t\tcon.getPort() + \": Incomplete block read from stream\");\n\t\t\t\t\t}\n\t\t\t\t\tif (debug)\n\t\t\t\t\t\tlogRd(\"server closed the connection (EOF)\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tlen -= s;\n\t\t\t\toff += s;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "public void onDataReceived(byte[] data, String message) {\n }", "public void receiveData(){\n try {\n // setting up input stream and output stream for the data being sent\n fromClient = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n fileCount++;\n outputFile = new FileOutputStream(\"java_20/server/receivedFiles/receivedFile\"+fileCount+\".txt\");\n char[] receivedData = new char[2048];\n String section = null;\n\n //read first chuck of data and start timer\n int dataRead = fromClient.read(receivedData,0,2048);\n startTimer();\n\n //Read the rest of the files worth of data\n while ( dataRead != -1){\n section = new String(receivedData, 0, dataRead);\n outputFile.write(section.getBytes());\n\n dataRead = fromClient.read(receivedData, 0, 2048);\n }\n\n //stop timers\n endTimer();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public byte[] Get_Data() throws IOException {\n byte[] ret = new byte[512];\n DatagramPacket packet = new DatagramPacket(ret, ret.length);\n\n socket.receive(packet);\n\n length = ret.length;\n return ret;\n }", "private byte[] read(SelectionKey key) throws IOException {\n\t\tSocketChannel channel = (SocketChannel)key.channel();\n\t\treadBuffer.clear();\n\t\tint length = channel.read(readBuffer);\n\t\tbyte[] data = null;\n\n\t\t// Checking whether length is negative, to overcome java.lang.NegativeArraySizeException -- Aditya\n\t\tif (length == -1) {\n\t\t\tmClientStatus.remove(channel);\n\t\t\tclients--;\n\t\t\tchannel.close();\n\t\t\tkey.cancel();\n\t\t\tthrow new IOException(\"No data found\");\n\t\t}else {\n\t\t\treadBuffer.flip();\n\t\t\tdata = new byte[length];\n\t\t\treadBuffer.get(data, 0, length);\t\t\t\t\t\t\n\t\t}\n\t\treturn data;\n\t}", "static boolean readFully(SocketChannel sc, ByteBuffer bb) throws IOException {\n while (bb.hasRemaining()) {\n if (sc.read(bb) == -1) {\n return false;\n }\n }\n return true;\n }", "public void beginListenForData() {\n stopWorker = false;\n readBufferPosition = 0;\n try {\n inStream = btSocket.getInputStream();\n } catch (IOException e) {\n Log.d(TAG, \"Bug while reading inStream\", e);\n }\n Thread workerThread = new Thread(new Runnable() {\n public void run() {\n while (!Thread.currentThread().isInterrupted() && !stopWorker) {\n try {\n int bytesAvailable = inStream.available();\n if (bytesAvailable > 0) {\n byte[] packetBytes = new byte[bytesAvailable];\n inStream.read(packetBytes);\n for (int i = 0; i < bytesAvailable; i++) {\n // Log.d(TAG, \" 345 i= \" + i);\n byte b = packetBytes[i];\n if (b == delimiter) {\n byte[] encodedBytes = new byte[readBufferPosition];\n System.arraycopy(readBuffer, 0,\n encodedBytes, 0,\n encodedBytes.length);\n final String data = new String(\n encodedBytes, \"US-ASCII\");\n readBufferPosition = 0;\n handler.post(new Runnable() {\n public void run() {\n Log.d(TAG, \" M250 ingelezen data= \" + data);\n ProcesInput(data); // verwerk de input\n }\n });\n } else {\n readBuffer[readBufferPosition++] = b;\n }\n }\n } // einde bytesavalable > 0\n } catch (IOException ex) {\n stopWorker = true;\n }\n }\n }\n });\n workerThread.start();\n }", "private void handleRead(SelectionKey key) throws IOException {\n\t\t\tSSLSocketChannel ssl_socket_channel = ((SSLClientSession)key.attachment()).getSSLSocketChannel();\n\t\t\tByteBuffer request = ssl_socket_channel.getAppRecvBuffer();\n\t\t\tint count = ssl_socket_channel.read();\n\t\t\t\n\t\t\tif (count < 0) {\n\t\t\t\t\n\t\t\t\tremoveKeyAndSession(key);\n\t\t\t\t\n\t\t\t} else if (request.position() > 0) {\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tString message = new String(request.array(),0,request.position());\n\t\t\t\t\t\n//\t\t\t\t\tOutputHandler.println(\"Server: read \"+message);\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Parse the JSON message\n\t\t\t\t\tJSONObject json = (JSONObject) parser.parse(message);\n\t\t\t\t\t\n\t\t\t\t\t// Process the message\n\t\t\t\t\tprocessNetworkMessage(json, key);\n\t\t\t\t\t\n\t\t\t\t\trequest.clear();\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\tSystem.out.println(\"Invalid message format.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private TimerTask socketListener()\r\n\t{\r\n\t\tString theMessage;\r\n\t\tif (theSocket != null)\r\n\t\t{\r\n\t\t\tif (theSocket.isReady())\r\n\t\t\t{\r\n\t\t\t\t// blocks execution\r\n\t\t\t\t// get theMessage\r\n\t\t\t\ttheMessage = theSocket.getMessage();\r\n\t\t\t\tif (theMessage == null)\r\n\t\t\t\t{\r\n\t\t\t\t\twriteLine(\"Our connection has ended!\", 0);\r\n\t\t\t\t\trunning = false;\r\n\t\t\t\t\t// if the message = null\r\n\t\t\t\t\t// the we need to check the socket again\r\n\t\t\t\t\t// just in case\r\n\t\t\t\t\t// close it nicely if we can\r\n\t\t\t\t\tif (theSocket != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttheSocket.close();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// otherwise just set it to null\r\n\t\t\t\t\t// set it to null regardless\r\n\t\t\t\t\ttheSocket = null;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// if the socket is OK\r\n\t\t\t\t\t// and the socket isReady\r\n\t\t\t\t\t// then display the input\r\n\t\t\t\t\twriteLine(theMessage, 2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} // end if theSocket !=null\r\n\t\treturn null;\r\n\t}", "@Override\n\tpublic long bytesRead() {\n\t\treturn 0;\n\t}", "boolean handle(ByteBuf data) throws Exception;", "boolean handle(ByteBuf data) throws Exception;", "public byte[] read()\n {\n\t\t//byte[] responseData = ISOUtil.hex2byte(\"070088888888\");\n\t\tbyte[] responseData = null;\n try\n {\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\tlong end = System.currentTimeMillis();\n\n\t\t\t\twhile ((end - start) < 45000)\n\t\t\t\t{\n System.out.println(\"++++++ If parameters : read() : \"+inputdata+\" : \"+dataRec);\n\t\t\t\t\tif (inputdata != null && dataRec)\n\t\t\t\t\t{\n System.out.println(\"INSIDE IF -read()\");\n\t\t\t\t\t\tresponseData = ISOUtil.hex2byte(inputdata);\n\t\t\t\t\t\tdataRec=false;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t} else\n\t\t\t\t\t{\n System.out.println(\"INSIDE else -read()\");\n\t\t\t\t\t\tend = System.currentTimeMillis();\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t}\n\t\t\t\t}\n\n }\n catch(Exception e)\n {\n System.err.println(\"ConnectionHandlerLocal$WriterThread.run(): Interrupted!\");\n ezlink.info(\"SerialConnection : read() - Exception: \");\n ezlink.error(new Object(), e);\n }\n finally\n\t\t{\n\t\t\tSystem.out.println(\"&&&&&&&&&& In Finally... &&&&&&&\");\n ezlink.info(\"&&&&&&&&&& In Finally... &&&&&&& \");\n\t\t\tdataHandler.strISODump.setLength(0);\n\t\t\tif(sPort!=null)\n\t\t\t{\n\t\t\t\tsPort.close();\n\t\t\t\tSystem.out.println(\"Port Closed\");\n ezlink.info(\"&&&&&&&&&& Port Closed... &&&&&&& \");\n\t\t\t}\n\t \t}\n\n\t \tSystem.out.println(\"inside read() : ReadData=\"+new String(responseData));\n ezlink.info(\"ReadData= : \"+new String(responseData));\n\n return responseData;\n }", "public void readResponse()\n\t{\n\t\tDataObject rec = null;\n\t\tsynchronized(receive)\n\t\t{\n\t\t\trec = receive.get();\n\t\t}\n\t\tAssertArgument.assertNotNull(rec, \"Received packet\");\n\t\tpublishResponse(rec);\n\t}", "public void startReader() throws Exception{\n byte[] buf = new byte[8];\n buf[0] = (byte) 0x02;\n buf[1] = (byte)0x08;\n buf[2] = (byte)0xB0;\n buf[3] = (byte) 0x00;\n buf[4] = (byte) 0x00;\n buf[5] = (byte) 0x00;\n buf[6] = (byte) 0x00;\n CheckSum(buf,(byte) buf.length);\n OutputStream outputStream = socket.getOutputStream();\n outputStream.write(buf);\n\n InputStream in = socket.getInputStream();\n System.out.println(in.available());\n if (in.available() == 0){\n System.out.println(\"null\");\n }else {\n byte[] bytes = new byte[8];\n in.read(bytes);\n CheckSum(bytes,(byte)8);\n String str = toHex(bytes);\n //String[] str1 = str.split(\"\");\n //ttoString(str1);\n System.out.println(str);\n }\n\n\n\n /*byte[] by2 = new byte[17];\n in.read(by2);\n String str2 = toHex(by2);\n String[] str4 = str2.split(\"\");\n String[] str5 = new String[getInt(str4)];\n System.arraycopy(str4,0,str5,0,getInt(str4));\n if(getInt(str4)>3)\n System.out.println(ttoString(str5));\n set = new HashSet();\n set.add(ttoString(str5));\n list = new ArrayList(set);\n System.out.println(list);*/\n }", "@Override\n public void handle(NIOConnection conn, byte[] data) {\n this.data = data;\n countDownLatch.countDown();\n }", "public void receive(byte[] data, Connection from){\r\n System.out.println(\"Received message: \"+ new String(data));\r\n }", "@Override\n public void dataAvailable(byte[] data, Connection ignoreMe) {\n // Now get the data, and send it back to the listener.\n try {\n disconnect(ignoreMe);\n Message message = NonblockingResolver.parseMessage(data);\n\n if (message != null && LOG.isTraceEnabled()) {\n LOG.trace(\"dataAvailable(\" + data.length + \" bytes)\");\n LOG.trace(message);\n }\n\n NonblockingResolver.verifyTSIG(query, message, data, tsig);\n // Now check that we got the whole message, if we're asked to do so\n if (!tcp && !ignoreTruncation\n && message.getHeader().getFlag(Flags.TC)) {\n // Redo the query, but use tcp this time.\n tcp = true;\n // Now start again with a TCP connection\n startConnect();\n return;\n }\n if (query.getHeader().getID() != message.getHeader().getID()) {\n// System.out.println(\"Query wrong id! Expected \" + query.getHeader().getID() + \" but got \" + message.getHeader().getID());\n return;\n }\n returnResponse(message);\n } catch (IOException e) {\n returnException(e, null);\n }\n }", "private void readEvent() {\n\t\t\t\n\t\t\thandlePacket();\n\t\t\t\n\t\t}", "@Override\n public void onAccepted(AsyncSocket socket) {\n if (asyncClient != null) {\n asyncClient.close();\n }\n asyncClient = (AsyncNetworkSocket) socket;\n asyncClient.setDataCallback(new DataCallback() {\n @Override\n public void onDataAvailable(DataEmitter emitter, ByteBufferList bb) {\n Timber.i(\"Data received: %s\", bb.readString());\n }\n });\n asyncClient.setClosedCallback(new CompletedCallback() {\n @Override\n public void onCompleted(Exception ex) {\n asyncClient = null;\n Timber.i(\"Client socket closed\");\n }\n });\n Timber.i(\"Client socket connected\");\n }", "@Override\n\tpublic int read() throws IOException {\n\t\tif (buf.isReadable()) {\n return buf.readByte() & 0xff;\n }\n return -1;\n\t}", "@Override\n public final int read() throws IOException {\n if (isClosed() || isFailed()) {\n return EOF;\n }\n if (!handshakeComplete) {\n shakeHands();\n if (!handshakeComplete) {\n failTheWebSocketConnection();\n return EOF;\n }\n }\n return nextWebSocketByte();\n }", "public int receive_data(String filename) {\r\n\tif (_socket == null) {\r\n\t\tSystem.out.println(\"no socket\");\r\n\t\treturn 2;\r\n\t}\r\n\t\r\n\tDataInputStream inputStream = null;\r\n\t\r\n\ttry {\r\n\t\t// retreve the stream\r\n\t\tinputStream = _socket.getInputStream();\r\n\t\t\r\n\t} catch (Exception e) {\r\n\t\tSystem.out.println(\"getInputStream() failed\");\r\n\t\treturn 2;\r\n\t}\r\n\t\r\n\ttry {\r\n\t\tString msg_received;\r\n\t\t// send verification information\r\n\t\t_socket.send_msg(\"i love ex machina\");\r\n\t\t\r\n\t\t// get hands shaked\r\n\t\tmsg_received = _socket.receive_msg();\r\n\t\tif (msg_received.equals(\"machina\")) {\r\n\t\t\tSystem.out.println(\"get machina. cool!\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"hand shake failed.\");\r\n\t\t\t_socket.disconnect();\r\n\t\t\treturn 2;\r\n\t\t}\r\n\t\t\r\n\t\t// send ur real need\r\n\t\t_socket.send_msg(\"need a file\");\r\n//\t\t_socket.send_msg(\"list all files\");\r\n\t\tmsg_received = _socket.receive_msg();\r\n\t\t\r\n\t\t// send required filename\r\n\t\t_socket.send_msg(filename);\r\n\t\t\r\n\t // 接收part1, which is filename\r\n\t String fullname = _socket.receive_msg();\r\n _socket.send_msg(\"ok\");\r\n\t if (!fullname.equals(filename))\r\n\t {\r\n\t\t System.out.println(fullname);\r\n\t\t System.out.println(\"file does not exist in the server.\\n\");\r\n\t\t\t _socket.disconnect();\r\n\t\t\t return 3;\r\n\t }\r\n\t \r\n\t System.out.println(fullname + \" is good.\");\r\n\t fullname = _savedir + fullname; \r\n\r\n\t // receive part2, which is file size. \r\n\t long filesize = Integer.parseInt(_socket.receive_msg());\r\n\t _socket.send_msg(\"ok\");\r\n\t System.out.println(\"file length: \" + filesize + \"\\n\");\r\n\r\n\t // 用于接收二进制文件流的stream, get ready for receiving the third part, which is the binary content\r\n\t DataOutputStream fileStream = null;\r\n\t try {\r\n\t\t FileOutputStream fileoutputStream = new FileOutputStream(fullname);\r\n\t\t BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(fileoutputStream);\r\n\t\t fileStream = new DataOutputStream(bufferedOutputStream);\r\n \t } catch (Exception e1) {\r\n\t\t\ttry {\r\n\t\t\t\tinputStream.close();\r\n\t\t\t} catch (IOException e2) {\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"file IO errer: \" + fullname);\r\n\t\t\treturn 1;\r\n \t }\r\n\t \r\n\t System.out.println(\"receiving file...\");\r\n\t \r\n\t // make some room for showing the progress percentage\r\n\t System.out.print(\"transfering: \");\r\n\t _lastpercentage_len = 0;\r\n\t String percent_show = \"what?\";\r\n\t \r\n\t int receive_total = 0;\r\n\t int bufferSize = 16384;\r\n\t byte[] receive_buff = new byte[bufferSize];\r\n\t // start to receive\r\n\t while (true) {\r\n\t \t int receive_current = 0;\r\n\t \t if (inputStream != null) {\r\n\t \t\t // beware that buffsize. only receive that amount of data each time\r\n\t \t\t receive_current = inputStream.read(receive_buff);\r\n\t \t }\r\n\t \t \r\n\t \t if (receive_current != -1){\r\n\t \t\t receive_total += receive_current;\r\n\t \t } else {\r\n\t \t\t break;\r\n\t \t }\r\n\r\n\t \t // just save those binary to file\r\n\t \t try {\r\n\t \t\t fileStream.write(receive_buff, 0, receive_current);\r\n\t \t } catch (Exception e1) {\r\n \t\t\ttry {\r\n \t\t\t\tinputStream.close();\r\n \t\t\t} catch (IOException e2) {\r\n \t\t\t\te1.printStackTrace();\r\n \t\t\t}\r\n \t\t\tSystem.out.println(\"file IO errer: \" + fullname);\r\n \t\t\treturn 1;\r\n\t \t }\r\n\t \t \r\n\t \t percent_show = 100.0 * receive_total / filesize + \"%\";\r\n\t \t for (int i=0; i<_lastpercentage_len; i++) {\r\n\t \t\t System.out.print('\\b');\r\n\t \t }\r\n\t \t System.out.print(percent_show);\r\n\t \t for (int i=percent_show.length(); i<_lastpercentage_len; i++) {\r\n\t \t\t System.out.print(' ');\r\n\t \t }\r\n\t \t for (int i=percent_show.length(); i<_lastpercentage_len; i++) {\r\n\t \t\t System.out.print('\\b');\r\n\t \t }\r\n\t \t _lastpercentage_len = percent_show.length();\r\n\t }\r\n\t \r\n\t fileStream.close();\r\n \t for (int i=0; i<_lastpercentage_len; i++) {\r\n \t\t System.out.print('\\b');\r\n \t }\r\n\t \r\n\t if (receive_total == filesize) {\r\n\t \t System.out.print(\"100%\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\\n\");\r\n\t \t System.out.println(\"\\nfile received: \" + fullname + \"\\n\");\r\n\t } else {\r\n\t \t System.out.println(\"\\nonly partial file was received!!! \" + \"file saved to \" + fullname + \"\\n\");\r\n\t }\r\n\t} catch (Exception e) {\r\n\t\ttry {\r\n\t\t\tinputStream.close();\r\n\t\t} catch (IOException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\tSystem.out.println(\"oh boy, don't know where to start it.\" + \"\\n\");\r\n\t\treturn 2;\r\n\t}\r\n\r\n\ttry {\r\n\t\tinputStream.close();\r\n\t} catch (IOException e1) {\r\n\t\te1.printStackTrace();\r\n\t}\r\n\r\n\treturn 0;\r\n}", "@Override\n public int read(ByteBuffer dst) throws IOException {\n checkConnectionAllowed(0);\n long start = System.currentTimeMillis();\n int bytesDown = 0;\n int position = dst.position();\n try {\n return bytesDown = super.read(dst);\n } finally {\n if (bytesDown >= 0) { // TODO: implement same check in other places\n sleepIfRequired(bytesDown);\n logSocket(System.currentTimeMillis() - start, bytesDown, 0);\n SpyConfiguration effectiveSpyConfiguration = Sniffy.getEffectiveSpyConfiguration();\n if (effectiveSpyConfiguration.isCaptureNetworkTraffic()) {\n dst.position(position);\n byte[] buff = new byte[bytesDown];\n dst.get(buff, 0, bytesDown);\n\n logTraffic(false, Protocol.TCP, buff, 0, buff.length);\n }\n }\n }\n }", "void onPrepared(ByteBuffer preReadData, Socket socket);", "public NetData recieve() throws Exception\n {\n NetData nd;\n\n\n try {\n if(reader.ready())\n {\n nd = new NetData(reader.readLine());\n }\n else\n {\n return null;\n }\n }\n catch (IOException ex)\n {\n xError.Report(xError.READ_FROM_SOCKET);\n throw new Exception();\n }\n xMessenger.miniMessege(\"<<<\"+ nd.toString());\n return nd;\n }", "@Override\n public void run() {\n byte[] buffer = new byte[1024];\n int bytes;\n while (true) {\n try {\n\n bytes = inputStream.read(buffer);\n String data = new String(buffer, 0, bytes);\n handler.obtainMessage(MainActivityFreeEX.DATA_RECEIVED, data).sendToTarget();\n\n Log.i(this.toString(), \"en el run de Connection: \" + handler.obtainMessage(MainActivityFreeEX.DATA_RECEIVED, data).toString());\n\n\n } catch (IOException e) {\n break;\n }\n }\n }", "@Override\n public int read() throws IOException {\n int r = -1;\n \n if (encryptedDataBuffer!=null && pos>=encryptedDataBuffer.length && !closed)\n fillBuffer();\n \n if (encryptedDataBuffer!=null && pos<encryptedDataBuffer.length)\n r = (int)encryptedDataBuffer[pos++]; // next element in the buffer\n return r;\n }", "public boolean socketStillAlive() {\n if (bluetoothSocket != null)\n return bluetoothSocket.getSocket() != null;\n return false;\n }", "public int read() throws IOException {\n if(available() == 0) throw new EOFException(\"No data available.\");\n int ret = data.getFirst().get();\n updateBufferList();\n return ret;\n }", "public int readByte() {\n waitForData();\n try {\n return m_DataInputStream.readByte();\n }\n catch (IOException e) {\n return 256;\n }\n }", "public int available() throws IOException {\n int ret = 0;\n for(IoBuffer buf : data) {\n ret += buf.remaining();\n }\n return ret;\n }", "protected void readDataFromSocket(SelectionKey key) throws Exception {\n\n WorkerThread worker = pool.getWorker();\n\n if (worker == null) {\n // No threads available. Do nothing. The selection\n // loop will keep calling this method until a\n // thread becomes available. This design could\n // be improved.\n return;\n }\n\n // Invoking this wakes up the worker thread, then returns\n worker.serviceChannel(key);\n }", "public abstract void onPingReceived(byte[] data);", "protected int receivePacket()\n\t\t\tthrows IOException, SocketTimeoutException\n\t{\n\t\t\n\t\tbyte buf[] = new byte[ILPacket.MAX_PACKET_SIZE];\n\t\tDatagramPacket packet = new DatagramPacket(buf, buf.length);\n\t\t\n\t\tthis.inSocket.receive(packet);\n\t\t\n\t\tthis.address = (InetSocketAddress) packet.getSocketAddress();\n\t\t\n\t\tthis.buffer = ByteBuffer.wrap(packet.getData());\n\t\t\t\t\n\t\treturn packet.getLength();\n\t}", "@Override\n\tpublic boolean readBoolean() throws IOException {\n\t\treturn ( (_buff.get() & 0xFF) != 0 );\n\t}", "public interface SocketReadProcessor {\n\t\n\t/**\n\t * Process the data and return a response.\n\t * \n\t * <p> This method is called by a socket handler when data is read from it's\n\t * socket. Since the handler read the data the handler is using one of\n\t * MODE_READ, MODE_READ_WRITE or MODE_WRITE_READ. If the handler is using\n\t * MODE_READ_WRITE then the handler will write this method's return value\n\t * back to the socket.\n\t * \n\t * <p> The data will not be null.\n\t * \n\t * <p> The implementation of this method may need to be synchronized if\n\t * multiple socket handler threads will be calling it.\n\t * \n\t * @param data - The data that was read from the socket.\n\t * @param fromId - The unique id of the socket handler thread.\n\t * \n\t * @return A response which will be written back to the socket if the socket\n\t * handler is using MODE_READ_WRITE, otherwise ignored.\n\t */\n\tString processDataFromSocket(String data, long fromId);\n\t\n}", "public final boolean isDataAvailable() {\n\t\tif ( hasStatus() >= FileSegmentInfo.Available &&\n\t\t\t\t hasStatus() < FileSegmentInfo.Error)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public void OnFileDataReceived(byte[] data,int read, int length, int downloaded);", "@Override\n\tpublic int available() throws IOException {\n\t\treturn buf.readableBytes();\n\t}", "public void receivedDataFromStation(int station, String data) {}", "public String recvSensorData(){\n\t\tSystem.out.println(\"Waiting for sensor data!\");\n\t\ttry{\n\t\t\t// timer.scheduleAtFixedRate(new TimerTask() {\n\t\t\t// \t@Override\n\t\t\t// \tpublic void run() {\n\t\t\t// \t\tSystem.out.println(\"No response for sensor data\");\n\t\t\t// \t\tsendMsg(\"S\",\"PC2AR\");\n\t\t\t// \t}\n\t\t\t// }, 10*1000, 10*1000);\n\t\t\tString input = br.readLine();\n\t\t\tif (input != null && input.length() > 0){\n\t\t\t\tSystem.out.println(input);\n\t\t\t\t// timer.cancel();\n\t\t\t\treturn input;\n\t\t\t}\n\t\t} catch (IOException e){\n\t\t\tSystem.out.println(\"receive message --> IO Exception\");\n\t\t} catch (Exception e){\n\t\t\tSystem.out.println(\"receive message --> Exception\");\n\t\t}\n\n\t\treturn null;\n\t}", "private static void read(SelectionKey key) throws IOException {\r\n\t\t// socket def. has something to say (not 0). But may be -1\r\n\t\t\r\n\t\tSocketChannel sc = (SocketChannel) key.channel();\r\n\t\tByteBuffer buf = ByteBuffer.allocateDirect(1024);\r\n\t\t\r\n\t\t// READ data fom channel into buf\r\n\t\t// CHANNEL--read--> --write-->BUF\r\n\t\tint read = sc.read(buf);\r\n\t\tif(read == -1) {\r\n\t\t\tpendingData.remove(sc);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// Note: We do not need to check for read == 0, since this would not have been called if\r\n\t\t// there was no data to read (or the socket had closed)\r\n\r\n\t\t// PREPARE FOR READING from BUF into CHANNEL\r\n\t\t\r\n\t\t// set BUF into WRITE mode\r\n\t\t// e.g.: sets the limit to 'max read position' and set position to 0\r\n\t\tbuf.flip();\r\n\t\t\r\n\t\t// BUF--read--> <PROCESS-DATA> --write-->BUF\r\n\t\tfor(int i = 0; i < buf.limit(); ++i)\r\n\t\t\tbuf.put(i, (byte) Util.switchCase(buf.get(i)));\r\n\t\t\r\n\t\t// note: We only want to write once socket is ready for writing\r\n\t\t// therefore instead make a queue of data to written onto\r\n\t\t// this socket\r\n\t\t//socket.write(buf);\r\n\t\t\t\t\r\n\t\t// save processed data until selector says channel is ready for WRITING\r\n\t\tpendingData.get(sc).add(buf);\r\n\t\t\r\n\t\t// Let selector know we want to know when socket is ready to \r\n\t\t// have pending data written\r\n\t\tsc.register(key.selector(), SelectionKey.OP_WRITE);\r\n\t\t\r\n\t\t// NOTE: For the SocketChannel sc, multiple calls to \r\n\t\t// IOServerTest6.read() may have been before it is ready to be\r\n\t\t// written to. Therefore, this is why we use an ordered Collection\r\n\t\t// (like a FIFO Queue or LinkedList) to store pending writes, so\r\n\t\t// that they are written back to SocketChannel in the correct order.\t\t\r\n\t}", "int getBytesRead() {\n \treturn _read + _o;\n }", "public SocketState getSocketState() throws InvalidTransportHandlerStateException {\n try {\n if (dataSocket.getInputStream().available() > 0) {\n return SocketState.DATA_AVAILABLE;\n }\n dataSocket.setSoTimeout(1);\n int read = dataSocket.getInputStream().read();\n if (read == -1) {\n return SocketState.CLOSED;\n } else {\n throw new InvalidTransportHandlerStateException(\"Received Data during SocketState check\");\n }\n } catch (SocketTimeoutException ex) {\n return SocketState.TIMEOUT;\n } catch (SocketException ex) {\n return SocketState.SOCKET_EXCEPTION;\n } catch (IOException ex) {\n return SocketState.IO_EXCEPTION;\n }\n }", "public boolean hasData() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "protected final boolean didRead (boolean value) { return didRead = value;}", "boolean readByte(int c, String streamProvider) throws RawDataEventException ;", "@Override\n public void onRead() {\n /*\n * It should be an error that the remote send something before we\n * pre-write.\n */\n throw new IllegalStateException();\n }", "public float[] receiveData() {\r\n\t\tString dataString = null;\r\n\t\ttry {\r\n\t\t\tlogger.debug(\"Lese Daten...\");\r\n\t\t\tdataString = com.receiveString();\r\n\t\t\tlogger.debug(\"gelesen: \" + dataString);\r\n\t\t\treturn checkString(dataString);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"Fehler beim Empfangen von Daten:\" + e);\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public boolean read() {\n return so;\n }", "@Override\n protected int readDataBlock(byte[] readData) throws IOException {\n final UsbSerialDriver serialDriver = serialDriverRef.get();\n if(serialDriver == null)\n throw new IOException(\"Device is unavailable.\");\n\n int iavailable = 0;\n try {\n iavailable = serialDriver.read(readData, 200);\n } catch (NullPointerException e) {\n final String errorMsg = \"Error Reading: \" + e.getMessage()\n + \"\\nAssuming inaccessible USB device. Closing connection.\";\n Log.e(TAG, errorMsg, e);\n throw new IOException(errorMsg, e);\n }\n\n if (iavailable == 0)\n iavailable = -1;\n return iavailable;\n }", "@Override\n\tpublic void readData() {\n\t\t\n\t}", "private String readVoidMessage() {\n JSONTokener tokener = new JSONTokener(this.inputStream);\n if(tokener.more()) {\n return TokenerHandler.getNextJSONStringNonContinuous(tokener);\n } else {\n throw new LostConnectionException();\n }\n }", "public void checkPktAvail()\n\t{\n\t\t// schedule the next time to poll for a packet\n\t\tinterrupt.schedule(NetworkReadPoll, (int)this, NetworkTime, NetworkRecvInt);\n\n\t\tif (inHdr.mLength != 0) \t// do nothing if packet is already buffered\n\t\t{\n\t\t\treturn;\t\t\n\t\t}\n\t\tif (!PollSocket(mSock)) \t// do nothing if no packet to be read\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// otherwise, read packet in\n\t\tchar[] buffer = new char[MaxWireSize];\n\t\treadFromSocket(mSock, buffer, MaxWireSize);\n\n\t\t// divide packet into header and data\n\t\tinHdr = new PacketHeader(buffer);\n\t\tassert((inHdr.to == mNetworkAddress) && (inHdr.mLength <= MaxPacketSize));\n//\t\tbcopy(buffer + sizeof(PacketHeader), inbox, inHdr.length);\n\n\n\t\tDebug.print('n', \"Network received packet from \"+ inHdr.from+ \", length \"+ inHdr.mLength+ \"...\\n\");\n\t\tStatistics.numPacketsRecvd++;\n\n\t\t// tell post office that the packet has arrived\n\t\tmReadHandler.call(mHandlerArg);\t\n\t}", "public int read ()\n {\n return (_buffer.remaining() > 0) ? (_buffer.get() & 0xFF) : -1;\n }", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tInputStream inputStream = mSocket.getInputStream();\n\t\t\tint leng;\n\t\t\tbyte[] buffer = new byte[1024];\n\t\t\tByteArrayBuffer[] data = {new ByteArrayBuffer(1024 * 32)};\n\t\t\twhile((leng = inputStream.read(buffer)) != -1 && mConected)\n\t\t\t{\n\t\t\t\tif(mConected)\n\t\t\t\t{\n\t\t\t\t\tdata[0].append(buffer, data[0].length(), leng);\n\t\t\t\t\tprocessMessage(data);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.e(TAG, \"Cannot set InputStream\\nNetwork error\");\n\t\t\tevent.connectionLost();\n\t\t} catch (ProtocolException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tevent.connectionLost();\n\t\t}\n\t}", "public byte[] readBytes() throws IOException {\n\t InputStream in = socket.getInputStream();\n\t DataInputStream dis = new DataInputStream(in);\n\n\t int len = dis.readInt();\n\t byte[] data = new byte[len];\n\t if (len > 0) {\n\t dis.readFully(data);\n\t }\n\t return data;\n\t}", "public boolean recvPacket(byte[] buf) {\n DatagramPacket packet = new DatagramPacket(buf,mRecvBufLen-1);\n try {\n mSocket.receive(packet);\n mRecvLen = packet.getLength();\n //Log.d(TAG, new String(packet.getData(),0,packet.getLength(),\"GBK\"));\n return true;\n } \n catch (IOException e) {\n e.printStackTrace();\n } \n return false;\n }", "public boolean isReady() throws java.io.IOException {\n\n return br.ready();\n }", "@Override\r\n public void onReceivedData(byte[] arg0) {\r\n dataManager.onReceivedData(arg0);\r\n }", "@Override\n public boolean hasRemaining() throws IOException\n {\n return randomAccessRead.available() > 0;\n }", "public void fireBeforeRead(State state, int data_addr) {\n rcount++;\n }", "@Override\n\tpublic void run()\n\t{\n\t\tif(socket != null && !socket.isClosed() && socket.isConnected())\n\t\t{\n\t\t\tSendMessage(ApplicationManager.Instance().GetName(), MessageType.clientData);\n\t\t\tApplicationManager.textChat.writeGreen(\"Connected to \" + connectionInfo.ServerAdress);\n\t\t\t\n\t\t\ttry \n\t\t\t{\n\t\t\t\twhile (IsConnected) \n\t\t {\n\t\t Message message = (Message) in.readObject();\n\t\t\t\t\t\n\t\t if(!IsConnected)\n\t\t \tbreak;\n\t\t \t\n\t\t if(message == null)\n\t\t {\n\t\t \tIsConnected = false;\n\t\t \tbreak;\n\t\t }\n\t\t \n\t\t HandleMessage(message); \n\t\t }\n\t\t\t \n\t\t\t} \n\t\t\tcatch (SocketException | EOFException e) {\n\t\t\t\tif(IsConnected)\n\t\t\t\tApplicationManager.textChat.writeGreen(\"Server go down!\");\n\t\t\t}\n\t\t\tcatch (IOException | ClassNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tApplicationManager.Instance().Disconnect();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tApplicationManager.textChat.writeGreen(\"Cannot connect!\");\n\t\t\tApplicationManager.Instance().Disconnect();\n\n\t\t}\n\t}", "public boolean ready() {\n try {\n return in.available() > 0;\n } catch (IOException x) {\n return false;\n }\n }", "private boolean receivePacket(DatagramSocket sendReceiveSocket) {\r\n\t\tbyte data[] = new byte[1];\r\n\t DatagramPacket receivePacket = new DatagramPacket(data, data.length);\r\n \ttry {\r\n \t\t// Block until a datagram is received via sendReceiveSocket. \r\n \t\tsendReceiveSocket.setSoTimeout(5000);\r\n \t\tsendReceiveSocket.receive(receivePacket); \r\n \t\tSystem.out.println(\"Packet received from the floor subsystem with acknowlegement to update its floor lamps\");\r\n \t\tif(receivePacket.getLength() == 1 && receivePacket.getData()[0] == 1) \r\n \t\t\treturn true; //return true if receive a packet back with correct data\r\n \t\treturn false;\r\n \t} catch(SocketTimeoutException e) {\r\n \t\treturn false;\r\n \t} catch(IOException e) {\r\n \t\te.printStackTrace();\r\n \t\tSystem.exit(1);\r\n \t} \r\n \treturn false; //never called, needed for structure\r\n\t}", "@Override\r\n\t\tpublic void run() {\n\t\t\twhile (socket != null && !socket.isClosed()) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tbInputStream.read(rbyte);\r\n\t\t\t\t\t\tMessage msg = new Message();\r\n\t\t\t\t\t\tmsg.what = 1;\r\n\t\t\t\t\t\tmsg.obj = rbyte;\r\n\t\t\t\t\t\treHandler.sendMessage(msg);\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}", "public byte[] read();", "void assignDataReceived(Serializable dataReceived);" ]
[ "0.6842637", "0.6736113", "0.65607995", "0.6504302", "0.63702756", "0.6340601", "0.61804926", "0.6104585", "0.6081909", "0.6064589", "0.60639983", "0.6060881", "0.60161746", "0.59902954", "0.5984788", "0.592228", "0.58898526", "0.58809304", "0.5878683", "0.58701384", "0.58442295", "0.5790312", "0.57830286", "0.5766122", "0.574953", "0.5741907", "0.5737798", "0.57203144", "0.57164997", "0.57154936", "0.570449", "0.5692618", "0.56725997", "0.56713986", "0.5670294", "0.5656147", "0.56525093", "0.5642079", "0.56337684", "0.56292194", "0.5622985", "0.56056494", "0.56056494", "0.55945253", "0.55713326", "0.55467856", "0.5533544", "0.55328995", "0.55112135", "0.550153", "0.54995185", "0.549461", "0.5491057", "0.54902816", "0.54902744", "0.5489531", "0.54827327", "0.54715526", "0.5450815", "0.544832", "0.5431338", "0.5430998", "0.5420396", "0.54203796", "0.54201025", "0.5411145", "0.54110885", "0.5410974", "0.5410251", "0.54029614", "0.54026127", "0.540067", "0.5399291", "0.5397916", "0.53859556", "0.5374693", "0.5367697", "0.5366357", "0.5360808", "0.53506815", "0.5350396", "0.53497267", "0.5348303", "0.5339131", "0.53388625", "0.5334972", "0.5334463", "0.53343755", "0.53335077", "0.5330438", "0.5300592", "0.5298223", "0.52949417", "0.5293737", "0.5291429", "0.5283212", "0.52812505", "0.5281224", "0.5280844", "0.52790505" ]
0.6185655
6
Bind the service that will run the native server object.
public void initializeNative(Context context, ServerHTTPSSetting httpsSetting) { mContext = context; Intent intent = new Intent(EMBEDDED_TEST_SERVER_SERVICE); setIntentClassName(intent); if (!mContext.bindService(intent, mConn, Context.BIND_AUTO_CREATE)) { throw new EmbeddedTestServerFailure( "Unable to bind to the EmbeddedTestServer service."); } synchronized (mImplMonitor) { Log.i(TAG, "Waiting for EmbeddedTestServer service connection."); while (mImpl == null) { try { mImplMonitor.wait(SERVICE_CONNECTION_WAIT_INTERVAL_MS); } catch (InterruptedException e) { // Ignore the InterruptedException. Rely on the outer while loop to re-run. } Log.i(TAG, "Still waiting for EmbeddedTestServer service connection."); } Log.i(TAG, "EmbeddedTestServer service connected."); boolean initialized = false; try { initialized = mImpl.initializeNative(httpsSetting == ServerHTTPSSetting.USE_HTTPS); } catch (RemoteException e) { Log.e(TAG, "Failed to initialize native server.", e); initialized = false; } if (!initialized) { throw new EmbeddedTestServerFailure("Failed to initialize native server."); } if (!mDisableResetterForTesting) { ResettersForTesting.register(this::stopAndDestroyServer); } if (httpsSetting == ServerHTTPSSetting.USE_HTTPS) { try { String rootCertPemPath = mImpl.getRootCertPemPath(); X509Util.addTestRootCertificate(CertTestUtil.pemToDer(rootCertPemPath)); } catch (Exception e) { throw new EmbeddedTestServerFailure( "Failed to install root certificate from native server.", e); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doBindService() {\n\r\n\t\tIntent serviceIntent = new Intent(MainActivity.this, LocalService.class);\r\n\r\n\t\tstartService(serviceIntent);\r\n\t\t// bindService(serviceIntent, mServiceConnection, 0);\r\n\t\tbindService(serviceIntent, mServiceConnection, BIND_AUTO_CREATE);\r\n\r\n\t\tmIsBound = true;\r\n\t}", "public void bind() {\n\n Intent startintent = new Intent(context, MafService.class);\n startintent.setAction(\"com.baidu.maf.service\");\n\n if(ServiceControlUtil.showInSeperateProcess(context)) {\n try {\n context.startService(startintent);\n } catch (Exception e) {\n LogUtil.e(TAG, \"fail to startService\", e);\n }\n }\n\n //Intent intent = new Intent(InAppApplication.getInstance().getContext(), OutAppService.class);\n\n\n boolean result =\n context.bindService(startintent, mConnection, Context.BIND_AUTO_CREATE);\n\n LogUtil.printMainProcess(\"Service bind. reslut = \" + result);\n LogUtil.printMainProcess(\"bind. serverMessenger = \" + serverMessenger);\n mIsBound = result;\n }", "@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n ServerService.LocalBinder binder = (ServerService.LocalBinder) service;\n mService = binder.getService();\n mBound = true;\n }", "public void bind() {\n }", "void doBindService() {\n final Intent serviceIntent = new Intent(Testing.this, UploadService.class);\n bindService(serviceIntent, mConnection, Context.BIND_AUTO_CREATE);\n mIsBound = true;\n }", "protected abstract void bind();", "protected abstract void bind();", "void bind(EventService service);", "@Override\n\tpublic void bind() {\n\t\t\n\t}", "private void bindMediaPlayerService() {\n if (!serviceIsBound) {\n Intent bindInt = new Intent(this, MediaPlayerService.class);\n serviceIsBound = bindService(bindInt, mediaPlayerConnection, Context.BIND_AUTO_CREATE);\n\n Log.v(TAG, \"Service bound\");\n } else {\n Log.v(TAG, \"no Service to bind\");\n }\n }", "void doBindService() {\r\n\r\n bindService(new Intent(MainActivity.this, CurrentLocationUtil.class),\r\n connection, // ServiceConnection object\r\n Context.BIND_AUTO_CREATE); // Create service if not\r\n\r\n isBound = true;\r\n\r\n }", "public void doBind(){\n\t\tboolean isBound = settings.getBoolean(\"isBound\", false);\n\t\tif(!isBound){\n \t\ti = new Intent(context, LocationService.class);\n \t\tcontext.bindService(i, SpeedConnection, Context.BIND_AUTO_CREATE);\n \t\tcontext.startService(i);\n \t\teditor.putBoolean(\"isBound\", true);\n \t\teditor.apply();\n \t}\n\t}", "void doBindService() {\n\n if (bindService(new Intent(MainActivity.this, PositionService.class),\n mConnection, Context.BIND_AUTO_CREATE)) {\n mBound = true;\n } else {\n Log.e(\"MY_APP_TAG\", \"Error: The requested service doesn't \" +\n \"exist, or this client isn't allowed access to it.\");\n }\n }", "private void initService() {\n connection = new AppServiceConnection();\n Intent i = new Intent(this, AppService.class);\n boolean ret = bindService(i, connection, Context.BIND_AUTO_CREATE);\n Log.d(TAG, \"initService() bound with \" + ret);\n }", "public void bind() {\n\t\ttry {\n\t\t\tthis.out = new DataOutputStream(this.s.getOutputStream());\n\t\t\tthis.in = new DataInputStream(new DataInputStream(this.s.getInputStream()));\n\t\t} catch (IOException e) {\n\t\t\tthis.finishedOK = false;\n\t\t}\n\t}", "public void bindService() {\n mIntent = new Intent();\n mIntent.setPackage(\"com.eebbk.studyos.themes\");\n mIntent.setAction(THEME_SERVICE_ACTION);\n mContext.bindService(mIntent,mConnection, Context.BIND_AUTO_CREATE);\n }", "void doBindService() {\n\t\tbindService(new Intent(this, eidService.class), mConnection, Context.BIND_AUTO_CREATE);\n//\t\tLog.i(\"Convert\", \"At doBind2.\");\n\n\t\tmIsBound = true;\n\t\n\t\tif (mService != null) {\n//\t\t\tLog.i(\"Convert\", \"At doBind3.\");\n\t\t\ttry {\n\t\t\t\t//Request status update\n\t\t\t\tMessage msg = Message.obtain(null, eidService.MSG_UPDATE_STATUS, 0, 0);\n\t\t\t\tmsg.replyTo = mMessenger;\n\t\t\t\tmService.send(msg);\n\t\t\t\tLog.i(\"Convert\", \"At doBind4.\");\n\t\t\t\t//Request full log from service.\n\t\t\t\tmsg = Message.obtain(null, eidService.MSG_UPDATE_LOG_FULL, 0, 0);\n\t\t\t\tmService.send(msg);\n\t\t\t} catch (RemoteException e) {}\n\t\t}\n//\t\tLog.i(\"Convert\", \"At doBind5.\");\n\t}", "@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n BinderService.LocalBinder binder = (BinderService.LocalBinder) service;\n mService = binder.getService();\n mBound = true;\n }", "public void bindSendService(){\r\n\t\tif (sendService!=null){\r\n\t\t\tIntent intent = new Intent(context, SendService.class);\r\n\t context.bindService(intent, sendServiceConnection, Context.BIND_AUTO_CREATE);\r\n\t \r\n\t\t}\r\n\t}", "@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n LocalService.LocalBinder binder = (LocalService.LocalBinder) service;\n mService = binder.getService();\n mBound = true;\n }", "@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n LocalService.LocalBinder binder = (LocalService.LocalBinder) service;\n mService = binder.getService();\n mBound = true;\n }", "public void startServer() {\n URLClassLoader loader = createClasspath(opts);\n X_Process.runInClassloader(loader, appServer\n .map(DevAppServer::doStartServer, getAppName() + \"Server\", getPort())\n .ignoreOut1().unsafe());\n }", "private void bind()\n {\n /* Cancel unbind */\n cancelUnbind();\n\n /* Bind to the Engagement service if not already done or being done */\n if (mEngagementService == null && !mBindingService)\n {\n mBindingService = true;\n mContext.bindService(EngagementAgentUtils.getServiceIntent(mContext), mServiceConnection,\n BIND_AUTO_CREATE);\n }\n }", "public AppiumDriverLocalService StartServer()\n\t{\n\t\tservice = AppiumDriverLocalService.buildDefaultService();\n\t\tservice.start();\n\t\treturn service;\n\t}", "private void bindAudioService() {\n if (audioServiceBinder == null) {\n Intent intent = new Intent(MainActivity.this, AudioService.class);\n\n // Below code will invoke serviceConnection's onServiceConnected method.\n bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE);\n }\n }", "public void startListener() throws BindException, Exception{ // NOPMD by luke on 5/26/07 11:10 AM\n\t\tsynchronized (httpServerMutex){\n\t\t\t// 1 -- Shutdown the previous instances to prevent multiple listeners\n\t\t\tif( webServer != null )\n\t\t\t\twebServer.shutdownServer();\n\t\t\t\n\t\t\t// 2 -- Spawn the appropriate listener\n\t\t\twebServer = new HttpServer();\n\t\t\t\n\t\t\t// 3 -- Start the listener\n\t\t\twebServer.startServer( serverPort, sslEnabled);\n\t\t}\n\t}", "@Override\n protected void configure() {\n bind(OperationPerformingService.class);\n }", "@Singleton\n\t@Provides\n\tServer provideServer(final Injector injector, final ExecutorService execService) {\n\t\tfinal Server server = new Server(port);\n\t\tServletContextHandler sch = new ServletContextHandler(server, \"/jfunk\");\n\t\tsch.addEventListener(new JFunkServletContextListener(injector));\n\t\tsch.addFilter(GuiceFilter.class, \"/*\", null);\n\t\tsch.addServlet(DefaultServlet.class, \"/\");\n\n\t\tRuntime.getRuntime().addShutdownHook(new Thread() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\texecService.shutdown();\n\t\t\t\t\texecService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);\n\t\t\t\t} catch (InterruptedException ex) {\n\t\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\t\tlog.error(ex.getMessage(), ex);\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tserver.stop();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tlog.error(\"Error stopping Jetty.\", ex);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn server;\n\t}", "void doAccelBindService() {\n\t\tbindService(accelIntentDelay, accelConnection, Context.BIND_AUTO_CREATE);\n\t\taccelIsBound = true;\n\t}", "@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n LocalBinder binder = (LocalBinder) service;\n mService = binder.getService();\n mBound = true;\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(Server.this, RemoteService.class);\n // bind the same interface name\n intent.setAction(IRemoteService.class.getName());\n bindService(intent, mConnection, Context.BIND_AUTO_CREATE);\n\n intent.setAction(ISecondary.class.getName());\n bindService(intent, mSecondaryConnection, Context.BIND_AUTO_CREATE);\n\n mIsBound = true;\n mCallbackText.setText(\"Binding the Remote Service\");\n\n }", "public void start() {\n\n // server 환경설정\n EventLoopGroup bossGroup = new NioEventLoopGroup(bossCount);\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n\n try {\n\n ServerBootstrap b = new ServerBootstrap();\n b.group(bossGroup, workerGroup)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>() {\n @Override\n public void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n pipeline.addLast(new StringDecoder(CharsetUtil.UTF_8));\n pipeline.addLast(new StringEncoder(CharsetUtil.UTF_8));\n pipeline.addLast(new LoggingHandler(LogLevel.INFO));\n pipeline.addLast(SERVICE_HANDLER);\n }\n })\n .option(ChannelOption.SO_BACKLOG, backLog)\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\n ChannelFuture channelFuture = b.bind(tcpPort).sync();\n channelFuture.channel().closeFuture().sync();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n\n }", "private void bindService() {\n synchronized (mLock) {\n if (!mEnabled || mConnection != null || mRemoteService != null) {\n if (!mEnabled) {\n Slog.i(TAG, \"Not binding to service, service disabled\");\n } else if (mRemoteService != null) {\n Slog.i(TAG, \"Not binding to service, service already connected\");\n } else {\n Slog.i(TAG, \"Not binding to service, service already connecting\");\n }\n return;\n }\n ComponentName component = getServiceComponentNameLocked();\n if (component == null) {\n Slog.wtf(TAG, \"Explicit health check service not found\");\n return;\n }\n\n Intent intent = new Intent();\n intent.setComponent(component);\n mConnection = new ServiceConnection() {\n @Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n Slog.i(TAG, \"Explicit health check service is connected \" + name);\n initState(service);\n }\n\n @Override\n @MainThread\n public void onServiceDisconnected(ComponentName name) {\n // Service crashed or process was killed, #onServiceConnected will be called.\n // Don't need to re-bind.\n Slog.i(TAG, \"Explicit health check service is disconnected \" + name);\n synchronized (mLock) {\n mRemoteService = null;\n }\n }\n\n @Override\n public void onBindingDied(ComponentName name) {\n // Application hosting service probably got updated\n // Need to re-bind.\n Slog.i(TAG, \"Explicit health check service binding is dead. Rebind: \" + name);\n unbindService();\n bindService();\n }\n\n @Override\n public void onNullBinding(ComponentName name) {\n // Should never happen. Service returned null from #onBind.\n Slog.wtf(TAG, \"Explicit health check service binding is null?? \" + name);\n }\n };\n\n mContext.bindServiceAsUser(intent, mConnection,\n Context.BIND_AUTO_CREATE, UserHandle.of(UserHandle.USER_SYSTEM));\n Slog.i(TAG, \"Explicit health check service is bound\");\n }\n }", "public void run() {\n ServerSocketChannelFactory acceptorFactory = new OioServerSocketChannelFactory();\n ServerBootstrap server = new ServerBootstrap(acceptorFactory);\n\n // The pipelines string together handlers, we set a factory to create\n // pipelines( handlers ) to handle events.\n // For Netty is using the reactor pattern to react to data coming in\n // from the open connections.\n server.setPipelineFactory(new EchoServerPipelineFactory());\n\n server.bind(new InetSocketAddress(port));\n }", "protected void bind() throws SocketException {\n super.bind();\n\n //start the secure socket\n dtlsSocket = options.getSecurePort() > 0 ? new DatagramSocket(options.getSecurePort()) : new DatagramSocket();\n dtslReceiverThread = createDatagramServer(\"mqttsn-dtls-receiver\", options.getReceiveBuffer(), dtlsSocket);\n }", "private void startServerService() {\n Intent intent = new Intent(this, MainServiceForServer.class);\n // Call bindService(..) method to bind service with UI.\n this.bindService(intent, serverServiceConnection, Context.BIND_AUTO_CREATE);\n Utils.log(\"Server Service Starting...\");\n\n //Disable Start Server Button And Enable Stop and Message Button\n messageButton.setEnabled(true);\n stopServerButton.setEnabled(true);\n startServerButton.setEnabled(false);\n\n\n }", "public void launch(int port) {\n try {\n Registry registry = LocateRegistry.createRegistry( port );\n\n EchoService service = new ReversedEchoServiceImpl();\n EchoService stub = (EchoService) UnicastRemoteObject.exportObject(service, 0);\n\n registry.bind(\"com.anotheria.strel.rmi.EchoService\", stub);\n\n log.info(String.format(\"Service is now accessible on port %d with name com.anotheria.strel.rmi.EchoService\", port));\n }\n catch (RemoteException ex) {\n log.fatal(\"Remote Exception: \" + ex.getMessage());\n }\n catch (AlreadyBoundException ex) {\n log.fatal(\"Echo service is already bound with given name: \" + ex.getMessage());\n }\n }", "public void listen()\n {\n service = new BService (this.classroom, \"tcp\");\n service.register();\n service.setListener(this);\n }", "default void setEventService(EventService service) {\n bind(service);\n }", "public final void bind(App app)\n\t{\n\t\tthis.app = app;\n\t}", "public interface FloatServiceBinder {\n /**\n * 启动并且绑定服务完成\n * @param componentName ServiceConnection的componentName\n * @param iBinder ServiceConnection的iBinder\n */\n void onBindSucceed(ComponentName componentName, IBinder iBinder);\n\n /**\n * 当服务意外死亡时触发\n * @param componentName ServiceConnection的componentName\n */\n void onServiceDisconnected(ComponentName componentName);\n}", "@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n MyService.LocalBinder binder = (MyService.LocalBinder) service;\n myService = binder.getService();\n isBound = true;\n\n }", "public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public native int startService(long nativeHandle);", "public boolean bindService(Intent intent, ServiceConnection connection, int mode);", "public void start() throws RemoteException, AlreadyBoundException\n {\n start(DEFAULT_PORT);\n }", "@Override\n public IBinder onBind(Intent intent) {\n \tinit(\"scream\", Boolean.parseBoolean(intent.getStringExtra(MessageCode.DEBUG_FLAG)));\n \t\n \tStrandLog.d(ScreamService.TAG, \"Binding Service started\");\n \t\n\t\tIntent i = new Intent(this, ScreamService.class);\n\t\ti.putExtra(MessageCode.PARAM_LIST, intent.getStringExtra(MessageCode.PARAM_LIST));\n\t\tstartService(i);\n\n\t\treturn mMessenger.getBinder();\n }", "@Override\n\tpublic IBinder onBind(Intent intent) {\n\t\treturn serviceBinder;\n\t}", "public void registerServer() {\n log.info(\"Registering service {}\", serviceName);\n cancelDiscovery = discoveryService.register(\n ResolvingDiscoverable.of(new Discoverable(serviceName, httpService.getBindAddress())));\n }", "protected void onServiceConnectedExtended(ComponentName className,\n IBinder service) {\n mAllowedToBind = true;\n\n }", "@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n TranscriptDownService.LocalBinder binder = (TranscriptDownService.LocalBinder) service;\n mService = binder.getService();\n mBound = true;\n }", "@Override\n\t\tpublic void onServiceConnected(ComponentName name, IBinder service) {\n\t\t\tmBinder = (Stub) service;\n\t\t\tLog.d(TAG, \"mBinder init\");\n\t\t}", "public void bind(String name, Remote ref) throws RemoteException, AlreadyBoundException;", "@Override\n protected void doBind(SocketAddress localAddress) throws Exception {}", "public void run() {\n Runtime.getRuntime().addShutdownHook(new MNOSManagerShutdownHook(this));\n\n OFNiciraVendorExtensions.initialize();\n\n this.startDatabase();\n\n try {\n final ServerBootstrap switchServerBootStrap = this\n .createServerBootStrap();\n\n this.setServerBootStrapParams(switchServerBootStrap);\n\n switchServerBootStrap.setPipelineFactory(this.pfact);\n final InetSocketAddress sa = this.ofHost == null ? new InetSocketAddress(\n this.ofPort) : new InetSocketAddress(this.ofHost,\n this.ofPort);\n this.sg.add(switchServerBootStrap.bind(sa));\n }catch (final Exception e){\n throw new RuntimeException(e);\n }\n\n }", "void bind(WorkerPool workerPool);", "@Override\n public void onServiceConnected(ComponentName className,\n IBinder service) {\n ConnectionService.ConnectionBinder binder = (ConnectionService.ConnectionBinder) service;\n mService = binder.getService();\n mBound = true;\n }", "public Server(int port, mainViewController viewController, LogViewController consoleViewController){\n isRunningOnCLI = false;\n this.viewController = viewController;\n this.port = port;\n this.consoleViewController = consoleViewController;\n viewController.serverStarting();\n log = new LoggingSystem(this.getClass().getCanonicalName(),consoleViewController);\n log.infoMessage(\"New server instance.\");\n try{\n this.serverSocket = new ServerSocket(port);\n //this.http = new PersonServlet();\n log.infoMessage(\"main.Server successfully initialised.\");\n clients = Collections.synchronizedList(new ArrayList<>());\n ServerOn = true;\n log.infoMessage(\"Connecting to datastore...\");\n //mainStore = new DataStore();\n jettyServer = new org.eclipse.jetty.server.Server(8080);\n jettyContextHandler = new ServletContextHandler(jettyServer, \"/\");\n jettyContextHandler.addServlet(servlets.PersonServlet.class, \"/person/*\");\n jettyContextHandler.addServlet(servlets.LoginServlet.class, \"/login/*\");\n jettyContextHandler.addServlet(servlets.HomeServlet.class, \"/home/*\");\n jettyContextHandler.addServlet(servlets.DashboardServlet.class, \"/dashboard/*\");\n jettyContextHandler.addServlet(servlets.UserServlet.class, \"/user/*\");\n jettyContextHandler.addServlet(servlets.JobServlet.class, \"/job/*\");\n jettyContextHandler.addServlet(servlets.AssetServlet.class, \"/assets/*\");\n jettyContextHandler.addServlet(servlets.UtilityServlet.class, \"/utilities/*\");\n jettyContextHandler.addServlet(servlets.EventServlet.class, \"/events/*\");\n //this.run();\n } catch (IOException e) {\n viewController.showAlert(\"Error initialising server\", e.getMessage());\n viewController.serverStopped();\n log.errorMessage(e.getMessage());\n }\n }", "void startServer(int port) throws Exception;", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tIntent i = new Intent(this, M_Service.class);\n\t\tbindService(i, mServiceConn, Context.BIND_AUTO_CREATE);\n\t}", "private void initServerSocket()\n\t{\n\t\tboundPort = new InetSocketAddress(port);\n\t\ttry\n\t\t{\n\t\t\tserverSocket = new ServerSocket(port);\n\n\t\t\tif (serverSocket.isBound())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Server bound to data port \" + serverSocket.getLocalPort() + \" and is ready...\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to initiate socket.\");\n\t\t}\n\n\t}", "private void startListen() {\n try {\n listeningSocket = new ServerSocket(listeningPort);\n } catch (IOException e) {\n throw new RuntimeException(\"Cannot open listeningPort \" + listeningPort, e);\n }\n }", "@Override\n public void run() {\n try {\n registerWithServer();\n initServerSock(mPort);\n listenForConnection();\n\t} catch (IOException e) {\n Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, e);\n setTextToDisplay(\"run(): \" + e.getMessage());\n setConnectedStatus(false);\n\t}\n }", "private void initBinding() throws IOException {\n serverSocketChannel.bind(new InetSocketAddress(0));\n serverSocketChannel.configureBlocking(false);\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n\n sc.configureBlocking(false);\n var key = sc.register(selector, SelectionKey.OP_CONNECT);\n uniqueContext = new ClientContext(key, this);\n key.attach(uniqueContext);\n sc.connect(serverAddress);\n }", "@Override\n\tpublic void bind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise) throws Exception {\n\t\tLog.i(\"MySocketHandler\", \"bind\");\n\t\tsuper.bind(ctx, localAddress, promise);\n\t}", "private Main startJndiServer() throws Exception {\n\t\tNamingServer namingServer = new NamingServer();\n\t\tNamingContext.setLocal(namingServer);\n\t\tMain namingMain = new Main();\n\t\tnamingMain.setInstallGlobalService(true);\n\t\tnamingMain.setPort( -1 );\n\t\tnamingMain.start();\n\t\treturn namingMain;\n\t}", "public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }", "@Override\n public void beforeAll(ExtensionContext context) {\n localServer = RSocketFactory.receive()\n .acceptor((setupPayload, rSocket) -> Mono.just(new SimpleResponderImpl(setupPayload, rSocket)))\n .transport(LocalServerTransport.create(\"test\"))\n .start()\n .block();\n }", "public void run() {\n final Server server = new Server(8081);\n\n // Setup the basic RestApplication \"context\" at \"/\".\n // This is also known as the handler tree (in Jetty speak).\n final ServletContextHandler context = new ServletContextHandler(\n server, CONTEXT_ROOT);\n final ServletHolder restEasyServlet = new ServletHolder(\n new HttpServletDispatcher());\n restEasyServlet.setInitParameter(\"resteasy.servlet.mapping.prefix\",\n APPLICATION_PATH);\n restEasyServlet.setInitParameter(\"javax.ws.rs.Application\",\n \"de.kad.intech4.djservice.RestApplication\");\n context.addServlet(restEasyServlet, CONTEXT_ROOT);\n\n\n try {\n server.start();\n server.join();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "protected void onBind()\n\t{\n\t}", "@Override\n public void onServiceConnected(ComponentName className, IBinder service) {\n OpenVPNService.LocalBinder binder = (OpenVPNService.LocalBinder) service;\n mService = binder.getService();\n }", "@Override\n public void run() {\n eventLoopGroup = EPOLL ? new EpollEventLoopGroup() : new NioEventLoopGroup();\n try {\n System.out.println(startServerMsg);\n LOGGER.info(startServerMsg);\n new ServerBootstrap()\n .group(eventLoopGroup)\n .channel(EPOLL ? EpollServerSocketChannel.class : NioServerSocketChannel.class)\n .childOption(ChannelOption.TCP_NODELAY, true)\n .childOption(ChannelOption.SO_KEEPALIVE,true)\n .childOption(ChannelOption.RCVBUF_ALLOCATOR,new AdaptiveRecvByteBufAllocator(1024,16*1024,1024*1024))\n .childHandler(new ChannelInitializer() {\n @Override\n protected void initChannel(Channel ch) {\n ChannelPipeline pipeline = ch.pipeline();\n pipeline.addLast(\"decoder\", new Decoder());\n pipeline.addLast(\"handler\",new TcpServerHandler(viewModel));\n }\n })\n .bind(port).sync().channel().closeFuture().syncUninterruptibly();\n } catch (InterruptedException e) {\n LOGGER.error(\"Failed to start server : \",e);\n e.printStackTrace();\n } finally {\n System.out.println(ANSI_RED+\"Server shutting down.\"+ANSI_RESET);\n LOGGER.info(\"Server shutting down.\");\n eventLoopGroup.shutdownGracefully();\n\n }\n }", "@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n RemoteControlService.LocalBinder binder = (RemoteControlService.LocalBinder) service;\n binder.getService( ).startIfNotStarted( );\n }", "public Ice.AsyncResult begin_startService(String service, java.util.Map<String, String> __ctx, Ice.Callback __cb);", "@Override\r\n\tpublic IBinder onBind(Intent arg0) {\r\n\t\treturn new BDBServiceBinder();\r\n\t}", "public abstract void listen(ServiceConfig serviceConfig) throws IOException;", "public Ice.AsyncResult begin_startService(String service, Ice.Callback __cb);", "private void bindNcService() {\n Intent intent = new Intent(\"com.miui.notification.NOTIFICATION_CENTER\");\n intent.setPackage(\"com.miui.notification\");\n this.mHasBind = this.mContext.bindServiceAsUser(intent, this.mNcConn, 1, UserHandle.CURRENT);\n String str = TAG;\n Log.i(str, \"NcService bind: \" + this.mHasBind);\n this.mBindTimes = this.mBindTimes + 1;\n if (!this.mHasBind && this.mBindTimes <= 3) {\n this.mHandler.removeMessages(10002);\n this.mHandler.sendEmptyMessageDelayed(10002, (long) DEFAULT_INTERVAL);\n }\n }", "public ServerService(){\n\t\tlogger.info(\"Initilizing the ServerService\");\n\t\tservers.put(1001, new Server(1001, \"Test Server1\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1002, new Server(1002, \"Test Server2\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1003, new Server(1003, \"Test Server3\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1004, new Server(1004, \"Test Server4\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tlogger.info(\"Initilizing the ServerService Done\");\n\t}", "protected void doBind(SocketAddress localAddress) throws Exception {}", "public void startServer() {\n server.start();\n }", "private ChannelFuture runServer(final NioEventLoopGroup bootGroup,\n final NioEventLoopGroup processGroup) {\n final ServerBootstrap server = new ServerBootstrap();\n server.group(bootGroup, processGroup)\n .option(ChannelOption.SO_REUSEADDR, true)\n .channel(NioServerSocketChannel.class)\n .handler(new LoggingHandler(LogLevel.INFO))\n .childHandler(channelPipelineInitializer);\n return server.bind(host, port);\n }", "@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n MediaPlayerService.LocalBinder binder = (MediaPlayerService.LocalBinder) service;\n player = binder.getService();\n serviceBound = true;\n\n\n //Toast.makeText(QuranListenActivity.this, \"Service Bound\", Toast.LENGTH_SHORT).show();\n }", "@Override\n public IBinder onBind(Intent intent)\n {\n Log.d(\"MyService\", \"return\");\n return new MyBind();\n }", "public KVServerHandler(int port, KVServer managerServer){\n this.port = port;\n master = managerServer;\n aliveinstancethreads = new Vector<Thread>();\n aliveInstances = new Vector<KVServerInstance>();\n isRunning = false;\n kv_out = managerServer.getLogger();\n }", "public void start(int port) throws RemoteException, AlreadyBoundException\n {\n\n ZserioService zserioService = (ZserioService)UnicastRemoteObject.exportObject(this, 0);\n Registry registry = LocateRegistry.createRegistry(port);\n registry.bind(serviceFullName, this);\n }", "public Ice.AsyncResult begin_startService(String service, java.util.Map<String, String> __ctx);", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tSystem.out.println(\" ThriftServer start ing ....\");\n\t\t\t\ttry { \n\t\t\t\t\tif (!server.isServing()) {\n\t\t\t\t\t\tserver.serve();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} finally {\n\t\t\t\t\tif (transport != null) {\n\t\t\t\t\t\ttransport.close();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}", "public interface Server {\n void register(String serverName, Class impl) throws Exception;\n\n void start() throws IOException;\n\n\n}", "@Override\n\t\tpublic void configure(Binder binder) {\n\t\t\tbinder.bind(IFoodService.class).to(PizzaService.class);\n\t\t\t// bind the pizzaiolo named\n\t\t\tbinder.bind(String.class).annotatedWith(Names.named(\"pizzaiolo\"))\n\t\t\t\t\t.toInstance(\"Alberto\");\n\t\t\t// bind the print stream named to instance since we System.out is a\n\t\t\t// predefined singleton.\n\t\t\tbinder.bind(PrintStream.class)\n\t\t\t\t\t.annotatedWith(Names.named(\"printStream\"))\n\t\t\t\t\t.toInstance(System.out);\n\n\t\t}", "public synchronized void bindService(BehaviourInferenceAlgorithmRegistry registry) {\n \tthis.registry = registry;\n logger.info(\"BehaviourInferenceAlgorithmRegistry service connected.\");\n }", "@Override\n protected void onStart() {\n super.onStart();\n Intent intent = new Intent(this, PlayerService.class);\n bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE);\n\n }", "@Override\n @SuppressWarnings(\"CallToPrintStackTrace\")\n public void simpleInitApp() {\n \n\n try {\n System.out.println(\"Using port \" + port);\n // create the server by opening a port\n server = Network.createServer(port);\n server.start(); // start the server, so it starts using the port\n } catch (IOException ex) {\n ex.printStackTrace();\n destroy();\n this.stop();\n }\n System.out.println(\"Server started\");\n // create a separat thread for sending \"heartbeats\" every now and then\n new Thread(new NetWrite()).start();\n server.addMessageListener(new ServerListener(), ChangeVelocityMessage.class);\n // add a listener that reacts on incoming network packets\n \n }", "public abstract T addService(BindableService bindableService);", "@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n System.out.println(\"绑定成功\");\n }", "@Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n MediaPlayerService.LocalBinder binder = (MediaPlayerService.LocalBinder) service;\n player = binder.getService();\n serviceBound = true;\n player.setCallbacks(MainActivity.this);\n\n //Toast.makeText(MainActivity.this, \"Service Bound\", Toast.LENGTH_SHORT).show();\n }", "private void registerBindings(){\t\t\n\t}", "private void registerBindings(){\t\t\n\t}", "public ServerMain( int port )\r\n\t{\r\n\t\tthis.port = port;\r\n\t\tserver = new Server( this.port );\r\n\t}", "@Override\n\tpublic IBinder onBind(Intent intent) {\n\t\tLog.i(TAG, \"service on bind\");\n\t\treturn mBinder;\n\t}", "public interface Service extends AsyncRunnable, Remote {\n\n\tint registryPort() throws RemoteException;\n\n\tString name() throws RemoteException;\n}" ]
[ "0.72854084", "0.7252559", "0.70734113", "0.68715703", "0.6773335", "0.67534363", "0.67534363", "0.6712366", "0.66903514", "0.6644883", "0.6511064", "0.65078574", "0.64622456", "0.64479536", "0.6387731", "0.637745", "0.6307346", "0.6300618", "0.62922686", "0.62849027", "0.62849027", "0.6278184", "0.6267983", "0.62367624", "0.6232445", "0.62020165", "0.62017286", "0.6168906", "0.6167708", "0.61356854", "0.6103598", "0.60768616", "0.607306", "0.5995925", "0.59786403", "0.597416", "0.59704036", "0.59698033", "0.5932567", "0.59104604", "0.59024376", "0.5897285", "0.58851165", "0.58770525", "0.58729327", "0.5860118", "0.58553374", "0.58513635", "0.58431584", "0.5833949", "0.5830889", "0.5814851", "0.581061", "0.5808474", "0.5794587", "0.5778458", "0.5773239", "0.5756951", "0.57563776", "0.5734404", "0.57288516", "0.57230777", "0.5720055", "0.57131684", "0.57130486", "0.56982416", "0.56962913", "0.56911504", "0.5689507", "0.5689303", "0.5687982", "0.5667849", "0.5655538", "0.565322", "0.5632801", "0.56323236", "0.56273586", "0.5625342", "0.5623893", "0.5620732", "0.56113356", "0.5611012", "0.5605441", "0.5596807", "0.5590081", "0.55809164", "0.5580018", "0.5579994", "0.5578635", "0.5577813", "0.557454", "0.5559714", "0.5558687", "0.55564207", "0.55522853", "0.5541124", "0.5528591", "0.5528591", "0.5526163", "0.54993296", "0.54939866" ]
0.0
-1
Set intent package and class name that will pass to the service.
protected void setIntentClassName(Intent intent) { intent.setClassName( "org.chromium.net.test.support", "org.chromium.net.test.EmbeddedTestServerService"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setStartService(String strPackage, String strClassName) {\n Intent intent = new Intent();\n ComponentName comName = new ComponentName(strPackage, strClassName);\n\n intent.setComponent(comName);\n mContext.startService(new Intent().setComponent(comName));\n\n intent = null;\n comName = null;\n }", "@Override\n public boolean activityStarting(Intent intent, String pkg) throws RemoteException {\n Log.i(TAG, String.format(\"Starting %s in package %s\", intent, pkg));\n currentPackage = pkg;\n currentIntent = intent;\n return true;\n }", "Intent createNewIntent(Class cls);", "public MyIntentService(String name){\n super(name);\n }", "public IntentStartService(String name) {\n super(name);\n }", "@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n }", "public MyIntentService() {\n super(\"MyIntentServiceName\");\n }", "@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n }", "@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n }", "public MyIntentService() {\n super(\"MyIntentService\");\n }", "public MyIntentService() {\n super(MyIntentService.class.getName());\n }", "@Override\n\tpublic void onNewIntent(Intent intent) {\n\t\tsetIntent(intent);\n\t}", "private Intent m34055b(Context context) {\n Intent intent = new Intent();\n String str = \"package\";\n intent.putExtra(str, context.getPackageName());\n intent.putExtra(Constants.FLAG_PACKAGE_NAME, context.getPackageName());\n intent.setData(Uri.fromParts(str, context.getPackageName(), null));\n String str2 = \"com.huawei.systemmanager\";\n intent.setClassName(str2, \"com.huawei.permissionmanager.ui.MainActivity\");\n if (m34054a(context, intent)) {\n return intent;\n }\n intent.setClassName(str2, \"com.huawei.systemmanager.addviewmonitor.AddViewMonitorActivity\");\n if (m34054a(context, intent)) {\n return intent;\n }\n intent.setClassName(str2, \"com.huawei.notificationmanager.ui.NotificationManagmentActivity\");\n if (m34054a(context, intent)) {\n return intent;\n }\n return m34053a(context);\n }", "public void setIntent(String it) {\n/* 340 */ getCOSObject().setName(COSName.IT, it);\n/* */ }", "void intentPass(Activity activity, Class classname) {\n Intent i = new Intent(activity, classname);\n i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(i);\n enterAnimation();\n }", "public LoadIntentService(String name) {\n super(name);\n }", "public static void packageIntent(Intent intent, String json) {\n\n intent.putExtra(JSON, json);\n\n }", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tServiceAdditionActivity.setclass(\"busness\");\r\n\t\t\t\tstartActivity(new Intent(ServiceActivity.this,ServiceAdditionActivity.class));\r\n\t\t\t}", "public void setIntent(Intent intent) {\n this.mInviteIntent = intent;\n }", "public S<T> to(String name){\n\t\tname = name.trim();\n\t\tIntent i = new Intent();\n\t\tString pkg = activity.getApplicationContext().getPackageName();\n\t\ti.setComponent(new ComponentName(pkg,pkg+\".\"+name));\n\t\tactivity.startActivity(i);\n\t\treturn this;\n\t}", "@Override\n\tprotected void onHandleIntent(Intent intent) {\n\n\t}", "@Override\n\tprotected void onHandleIntent(Intent arg0) {\n\t\t\n\t}", "@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n handleIntent(intent);\n }", "private void sendToHostApp(final Intent intent) {\n intent.putExtra(Control.Intents.EXTRA_AEA_PACKAGE_NAME, getPackageName());\n intent.setPackage(SharedInfo.getInstance().hostPackageName);\n sendBroadcast(intent, Registration.HOSTAPP_PERMISSION);\n }", "void setClassOfService(ClassOfService serviceClass);", "@Override\n protected void onHandleIntent(Intent intent) {\n\n }", "@Override\n protected void onNewIntent(Intent intent) {\n }", "public HelloIntentService() {\n super(\"HelloIntentService\");\n }", "void mo21580A(Intent intent);", "public void setServiceName(java.lang.String param){\n localServiceNameTracker = true;\n \n this.localServiceName=param;\n \n\n }", "public void bindService() {\n mIntent = new Intent();\n mIntent.setPackage(\"com.eebbk.studyos.themes\");\n mIntent.setAction(THEME_SERVICE_ACTION);\n mContext.bindService(mIntent,mConnection, Context.BIND_AUTO_CREATE);\n }", "@Override\r\n public void onNewIntent(Intent intent){\r\n super.onNewIntent(intent);\r\n\r\n //changes the intent returned by getIntent()\r\n setIntent(intent);\r\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n updatePackageInfo();\n }", "@Override\n public void onNewIntent(Intent intent) {\n }", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tServiceAdditionActivity.setclass(\"house\");\r\n\t\t\t\tstartActivity(new Intent(ServiceActivity.this,ServiceAdditionActivity.class));\r\n\t\t\t}", "public abstract void setServiceName(String serviceName);", "public void setServiceClass(java.lang.String serviceClass) {\n this.serviceClass = serviceClass;\n }", "@Override\n\tprotected void onNewIntent(Intent intent) {\n\t\tsuper.onNewIntent(intent);\n\t\tsetIntent(intent);\n\t}", "public void mo1401a(Intent intent) {\n }", "public static void setServiceName(String serviceName) {\n\t\tMDC.put(ApplicationConstants.SERVICE_NAME, serviceName);\n\t}", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tServiceAdditionActivity.setclass(\"carecar\");\r\n\t\t\t\tstartActivity(new Intent(ServiceActivity.this,ServiceAdditionActivity.class));\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tServiceAdditionActivity.setclass(\"health\");\r\n\t\t\t\tstartActivity(new Intent(ServiceActivity.this,ServiceAdditionActivity.class));\r\n\t\t\t}", "public void setClazzName(String clazz);", "@Override // com.oppo.enterprise.mdmcoreservice.utils.defaultapp.DefaultApp\n public void setPreferredActivity(PackageManager pm, IntentFilter filter, int match, ComponentName[] componentNames, ComponentName activity) {\n super.setPreferredActivity(pm, filter, match, componentNames, activity);\n if (Build.VERSION.SDK_INT >= 23) {\n setDefaultBrowserPackageName(pm, activity.getPackageName(), UserHandle.myUserId());\n }\n }", "@Override\n protected void onNewIntent(Intent intent){\n handleIntent(intent);\n }", "public void setPackage(String aPackageName) {\n if (packageName != null) {\n throw new IllegalStateException(\"Package name already set.\");\n }\n\n packageName = aPackageName;\n }", "@Override\n public void onClick(View v) {\n startService(new Intent(MainActivity.this, MyService.class));\n }", "@Override\n public void onRebind(Intent intent) {\n // TODO: Return the communication channel to the service.\n if(org.mcopenplatform.muoapi.BuildConfig.DEBUG)Log.d(TAG,\"onRebind\");\n if(startIntent != null){\n intent=startIntent;\n }\n engine.newClient(intent,this,true);\n }", "public static void startActivity(Context context, String className) {\n\t\ttry {\n\t\t\tstartActivity(context, Class.forName(className));\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tL.log(e.toString());\n\t\t}\n\t}", "public final native void setIntent(Intent value) /*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\tjso.intent = [email protected]::getJsObj()();\n }-*/;", "public MessageIntentService(String name) {\n super(name);\n }", "private void sendIntenttoServiece() {\n\t\tIntent intent = new Intent(context, RedGreenService.class);\n\t\tintent.putExtra(\"sendclean\", \"sendclean\");\n\t\tcontext.startService(intent);\n\n\t}", "public MyIntentService() {\n super(\"\");\n }", "public void onNewIntent(Intent intent) {\n }", "@Override\n public IBinder onBind(Intent arg0) {\n intent=arg0;\n return null;\n }", "void transactTo_setDefaultLauncher(int code, String transactName, ComponentName who, String packageName, String className, int userId) {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \"to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n _data.writeString(packageName);\n _data.writeString(className);\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n }", "public GroundyIntentService(String name) {\n super();\n mName = name;\n mAsyncLoopers = new ArrayList<Looper>();\n }", "void startNewActivity(Intent intent);", "@Override\n public void onReceive(Context context, Intent intent) {\n ComponentName comp = new ComponentName(context.getPackageName(), GCMIntentService.class.getName());\n startWakefulService(context, (intent.setComponent(comp)));\n }", "public static void start(Activity act, Class<?> class1) {\n\t\tact.startActivity(new Intent(act.getApplicationContext(), class1));\n\t}", "public void setActivity(Activity activity) {\n if (activity != null) {\n service = (BleTrackerService) activity.getApplicationContext();\n }\n }", "private void startPluginActivity(Context context, DLIntent intent) {\r\n DLPluginManager dlPluginManager = DLPluginManager.getInstance(context);\r\n if (!dlPluginManager.isHostPackageSet()){\r\n dlPluginManager.setHostPackageName(\"com.ryg\");\r\n }\r\n dlPluginManager.startPluginActivity(this, intent);\r\n }", "protected Intent getStravaActivityIntent()\n {\n return new Intent(this, MainActivity.class);\n }", "public boolean bindService(Intent intent, ServiceConnection connection, int mode);", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n intent = getIntent();\n }", "private static Intent getIntent(Context context, Class<?> cls) {\n Intent intent = new Intent(context, cls);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n return intent;\n }", "@Override\r\n public void onRebind(Intent intent) {\r\n\r\n }", "@Override\n public void startActivity(Intent intent) {\n startActivity(intent, null);\n }", "@Override\n public void onStart(Intent intent, int startid) {\n }", "public final void setService(java.lang.String service)\r\n\t{\r\n\t\tsetService(getContext(), service);\r\n\t}", "private void TransferDataToMainActivity(){\n Intent intent = new Intent(ChooseService.this, MainActivity.class);\n intent.putExtra(\"Professional\", professionalName);\n intent.putExtra(\"Service\", serviceName);\n intent.putExtra(\"Price\", servicePrice);\n startActivity(intent);\n }", "@Override\n\tpublic void onRebind(Intent intent) {\n\t\tLog.i(TAG, \"service on rebind\");\n\t\tsuper.onRebind(intent);\n\t}", "@Override\r\n public void onStart(Intent intent, int startId) {\n }", "private void startActivity(Class destination)\n {\n Intent intent = new Intent(MainActivity.this, destination);\n startActivity(intent);\n }", "public void startNewActivity(Context context, String packageName) {\n Intent intent = context.getPackageManager().getLaunchIntentForPackage(packageName);\n if (intent != null) {\n /* We found the activity now start the activity */\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intent);\n } else {\n /* Bring user to the market or let them choose an app? */\n intent = new Intent(Intent.ACTION_VIEW);\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n intent.setData(Uri.parse(\"market://details?id=\" + packageName));\n context.startActivity(intent);\n }\n }", "public static void startService(Context context, String intentAction) {\n context.startService(new Intent(intentAction));\n }", "protected void changeActivity() {\n\t\tIntent intent = new Intent();\r\n\t\tintent.setClass(this,MainActivity.class);\r\n\t\t//intent.putExtra(\"padapter\", MainActivity.selectedLevel);\r\n\t\t\r\n\t\tstartActivity(intent);\r\n\t}", "public abstract void setServiceType(String serviceType);", "public void moveActivity(Class<?> kelas, Bundle bundle){\n Intent i = new Intent(context,kelas);\n i.putExtras(bundle);\n context.startActivity(i);\n }", "protected void startIntentService() {\n Intent intent = new Intent(this.getActivity(), FetchAddressIntentService.class);\n intent.putExtra(Constants.RECEIVER, mResultReceiver);\n intent.putExtra(Constants.LOCATION_DATA_EXTRA, mLastLocation);\n this.getActivity().startService(intent);\n }", "public void setIntentLabel( String label ) {\n if ( label != null ) {\n Flow.Intent intent = label.equals( NO_INTENT ) ? null : Flow.Intent.valueOfLabel( label );\n doCommand( new UpdateSegmentObject( getUser().getUsername(), getFlow(), \"intent\", intent ) );\n }\n }", "void start(Intent intent, Class<? extends IIntentHandler> handlerClass, IIntentCallback callback,\n\t\t\tIEclipseContext context);", "public final int m8873a(Context context, String str, Intent intent) {\n Object obj = -1;\n switch (str.hashCode()) {\n case -842411455:\n if (str.equals(\"com.google.firebase.INSTANCE_ID_EVENT\")) {\n obj = null;\n break;\n }\n break;\n case 41532704:\n if (str.equals(\"com.google.firebase.MESSAGING_EVENT\")) {\n obj = 1;\n break;\n }\n break;\n }\n switch (obj) {\n case null:\n this.f5745a.offer(intent);\n break;\n case 1:\n this.f5748e.offer(intent);\n break;\n default:\n String str2 = \"FirebaseInstanceId\";\n String str3 = \"Unknown service action: \";\n String valueOf = String.valueOf(str);\n Log.w(str2, valueOf.length() != 0 ? str3.concat(valueOf) : new String(str3));\n return ChatActivity.startAllServices;\n }\n Intent intent2 = new Intent(str);\n intent2.setPackage(context.getPackageName());\n return m8870a(context, intent2);\n }", "public static void navigateToActivityByClassName(Context context, String className, int flags) throws ClassNotFoundException {\n Class <?> c = null;\n if ( className != null ) {\n try {\n c = Class.forName(className);\n } catch (ClassNotFoundException e) {\n QUFactory.QLog.debug(\"ClassNotFound\", e);\n }\n }\n\n navigateToActivity(context, c, flags);\n }", "@Override\n protected void onHandleIntent(Intent workIntent) {\n }", "public static void startApplication(String packageName,\n\t\t\tActivity baseActivity) throws NameNotFoundException {\n\t\tif (baseActivity == null) {\n\t\t\tLog.e(\"ApkMethods\", \"the context was NULL for the package: \"\n\t\t\t\t\t+ packageName);\n\t\t}\n\t\tIntent intent = baseActivity.getApplicationContext()\n\t\t\t\t.getPackageManager().getLaunchIntentForPackage(packageName);\n\t\tLog.d(\"ApkMethods\",\n\t\t\t\t\"created intent, about to launch other application with packageName: \"\n\t\t\t\t\t\t+ packageName);\n\t\tbaseActivity.startActivity(intent);\n\t}", "public static void packageIntent(Intent intent, String title, boolean status) {\n\n intent.putExtra(TITLE, title);\n intent.putExtra(STATUS, status);\n\n }", "public void setClassName(String className) { this.className=className; }", "@Override\n public void onNewIntent(Activity activity, Intent data) {\n }", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tServiceAdditionActivity.setclass(\"rebuy\");\r\n\t\t\t\tstartActivity(new Intent(ServiceActivity.this,ServiceAdditionActivity.class));\r\n\t\t\t}", "public void setServiceName(String serviceName){\n this.serviceName = serviceName;\n }", "public void setPackageName(String value) {\n packageName.set(value);\n }", "@Override\n public void onStart(Intent intent, int startId) {\n\n super.onStart(intent, startId);\n }", "public static Intent newStartIntent(Context context) {\n\n Intent intent = new Intent(context, RadioPlayerService.class);\n intent.setAction(START_SERVICE);\n\n return intent;\n }", "private Intent getNameActivityIntent(String login) {\n // instanciate a new intent of the WLTwitterActivity in WLTwitterApplication's context\n Intent WLTwitterIntent = new Intent(this, worldline.ssm.rd.ux.wltwitter.WLTwitterActivity.class);\n Bundle extra = new Bundle();\n //save login in Bundle\n extra.putString(Constants.Login.EXTRA_LOGIN, login);\n WLTwitterIntent.putExtras(extra);\n \n return WLTwitterIntent;\n }", "@Override\r\n\t\tpublic void setClassName(String className)\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}", "@Override\n protected void onNewIntent(Intent intent) {\n super.onNewIntent(intent);\n handleIntent(intent);\n }", "protected void activityStart(String act){\r\n Class c = Constants.getClass(act);\r\n if(c!=null){\r\n startActivity(new Intent(Main.this, c ));\r\n }\r\n }", "public LiveLongAndProsperIntentService(final String name) {\n\t\tsuper();\n\t\tmName = name;\n\t}", "@Override\n protected void onNewIntent(Intent intent) {\n super.onNewIntent(intent);\n Log.e(TAG, \"onNew Intent \" + this.getClass().getName());\n }" ]
[ "0.72541726", "0.616533", "0.6163327", "0.61511016", "0.6134682", "0.60001427", "0.59787333", "0.5946042", "0.5946042", "0.5902679", "0.58292353", "0.57663846", "0.56735116", "0.5670308", "0.5601593", "0.5584793", "0.55834687", "0.5574758", "0.55734134", "0.55380225", "0.5513606", "0.55132693", "0.5510737", "0.55081266", "0.54823464", "0.5481437", "0.5475051", "0.54724115", "0.5468669", "0.5467116", "0.5458803", "0.545815", "0.5436994", "0.5430409", "0.5429305", "0.54188854", "0.5382295", "0.5377229", "0.53699875", "0.5367836", "0.53578925", "0.5351005", "0.53346694", "0.53342766", "0.5327378", "0.5298582", "0.529742", "0.52897424", "0.5288901", "0.52874726", "0.5243198", "0.5243125", "0.5240874", "0.52399904", "0.52350104", "0.5229482", "0.52233356", "0.52063507", "0.51887596", "0.518706", "0.5176125", "0.5163076", "0.5159791", "0.51431847", "0.512683", "0.5113862", "0.5110677", "0.51102215", "0.5106859", "0.5092684", "0.50837815", "0.5078847", "0.5077588", "0.50715244", "0.5060504", "0.505702", "0.5052754", "0.5052641", "0.50442374", "0.50361645", "0.50342244", "0.50325835", "0.5027265", "0.5023279", "0.50219923", "0.5017367", "0.5014803", "0.5013964", "0.50080985", "0.49962458", "0.49919856", "0.49890977", "0.49877885", "0.4986894", "0.49854764", "0.49851713", "0.49841073", "0.49791628", "0.4978352", "0.49765792" ]
0.75106764
0
Add the default handlers and serve files from the provided directory relative to the external storage directory.
public void addDefaultHandlers(File directory) { addDefaultHandlers(directory.getPath()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addDefaultHandlers(String directoryPath) {\n try {\n synchronized (mImplMonitor) {\n checkServiceLocked();\n mImpl.addDefaultHandlers(directoryPath);\n }\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to add default handlers and start serving files from \" + directoryPath\n + \": \" + e.toString());\n }\n }", "public void serveFilesFromDirectory(File directory) {\n serveFilesFromDirectory(directory.getPath());\n }", "private void addHandlers()\n {\n handlers.add(new FileHTTPRequestHandler());\n }", "public void serveFilesFromDirectory(String directoryPath) {\n try {\n synchronized (mImplMonitor) {\n checkServiceLocked();\n mImpl.serveFilesFromDirectory(directoryPath);\n }\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to start serving files from \" + directoryPath + \": \" + e.toString());\n }\n }", "@Override\n public void loadRequestHandlers(List<String> list) {\n\n this.requestHandlers.add(\n new SoletDispatcher(\n this.workingDir,\n new ApplicationLoadingServiceImpl(\n new EmbeddedApplicationScanningService(configService, workingDir),\n this.configService,\n this.workingDir + configService.getConfigParam(ConfigConstants.ASSETS_DIR_NAME, String.class)\n ),\n this.configService\n ));\n\n this.requestHandlers.add(new ResourceHandler(workingDir, s -> Collections.singletonList(\"\"), this.configService));\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/resources/**\")\n .addResourceLocations(\"classpath:/static/\");\n /*\n * Static Resources store outside the project\n */\n registry.addResourceHandler(\"/files/**\")\n .addResourceLocations(\"file:/opt/FILES_MANAGEMENT/images/\");\n }", "private void startWebApp(Handler<AsyncResult<HttpServer>> next) {\n Router router = Router.router(vertx);\n\n router.route(\"/assets/*\").handler(StaticHandler.create(\"assets\"));\n router.route(\"/api/*\").handler(BodyHandler.create());\n\n router.route(\"/\").handler(this::handleRoot);\n router.get(\"/api/timer\").handler(this::timer);\n router.post(\"/api/c\").handler(this::_create);\n router.get(\"/api/r/:id\").handler(this::_read);\n router.put(\"/api/u/:id\").handler(this::_update);\n router.delete(\"/api/d/:id\").handler(this::_delete);\n\n // Create the HTTP server and pass the \"accept\" method to the request handler.\n vertx.createHttpServer().requestHandler(router).listen(8888, next);\n }", "@Override\r\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\r\n\t\tregistry.addResourceHandler(\"/static/**\").addResourceLocations(\r\n\t\t\t\t\"/static/\");\r\n\t}", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/app/**\").addResourceLocations(\"classpath:/static/\");\n }", "@Override\r\n\tprotected void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\tregistry.addResourceHandler(\"/static/**\").addResourceLocations(\"classpath:/hh/\");\r\n\t\tsuper.addResourceHandlers(registry);\r\n\t}", "public serverHttpHandler( String rootDir ) {\n this.serverHome = rootDir;\n }", "private void addResponseHandlers() {\n\t\t\n\t\tif (responseHandlers == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tresponseHandlers.put(ResponseType.DELETE_FILE, new ResponseHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\tSystem.out.println(reader.readLine());\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tresponseHandlers.put(ResponseType.FILE_LIST, new ResponseHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\t\n\t\t\t\tString pwd = reader.readLine();\n\t\t\t\tSystem.out.println(\"Present Working Directory: \" + pwd);\n\t\t\t\t\n\t\t\t\tInteger numFiles = Integer.parseInt(reader.readLine());\n\t\t\t\tSystem.out.println(\"# Files/Folders: \" + numFiles + \"\\n\");\n\t\t\t\t\n\t\t\t\tif (numFiles == -1) {\n\t\t\t\t\tSystem.out.println(\"End of stream reached\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor (int i=0; i<numFiles; i++) {\n\t\t\t\t\tSystem.out.println(\"\\t\" + reader.readLine());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\nAll contents listed.\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tresponseHandlers.put(ResponseType.FILE_TRANSFER, new ResponseHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\t\n\t\t\t\tString fileName = reader.readLine();\n\t\t\t\tif (checkForErrors(fileName)) {\n\t\t\t\t\tSystem.out.println(fileName);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tInteger fileSize = Integer.parseInt(reader.readLine());\n\t\t\t\tif (fileSize < 0) {\n\t\t\t\t\tSystem.err.println(\"Invalid file size: \" + fileSize);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbyte[] data = new byte[fileSize];\n\t\t\t\tint numRead = socket.getInputStream().read(data, 0, fileSize);\n\t\t\t\tif (numRead == -1) {\n\t\t\t\t\tSystem.out.println(\"End of stream reached.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tFile folder = new File(pwd);\n\t\t\t\tif (!folder.exists() && !folder.mkdir()) {\n\t\t\t\t\tSystem.err.println(\"Failed to create directory: \" + pwd);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Warning: If the file exists it will be overwritten.\");\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\tFile file = new File(pwd + fileName);\n\t\t\t\t\tfile.createNewFile();\n\t\t\t\t\t\n\t\t\t\t\tFileOutputStream fileOutputStream = new FileOutputStream(file);\n\t\t\t fileOutputStream.write(data);\n\t\t\t fileOutputStream.close();\n\t\t\t \n\t\t\t\t} catch (SecurityException | IOException e) {\n\t\t\t\t\tSystem.err.println(e.getLocalizedMessage());\n\t\t\t\t\tSystem.err.println(\"Failed to create file: \" + fileName + \" at pathname: \" + pwd);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t \t\t\n\t\t System.out.println(\"File successfully transferred.\");\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tresponseHandlers.put(ResponseType.EXIT, new ResponseHandler() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\t\n\t\t\t\tString response = reader.readLine();\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t});\n\t}", "@Override\r\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\r\n registry.addResourceHandler(\"/resources/**\").addResourceLocations(\"/resources/\");\r\n// registry.addResourceHandler(\"/static/**\").addResourceLocations(\"/static/\").setCachePeriod(31556926);\r\n }", "@Override\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\t//exposes photos in the user-photo directory\n\t\t\n\t\tString dirName = \"user-photos\";\n\t\t//directory path\n\t\tPath userPhotosDir = Paths.get(dirName);\n\t\t\n\t\t//get absolute path\n\t\tString userPhotosPath = userPhotosDir.toFile().getAbsolutePath();\n\t\t\n\t\tregistry.addResourceHandler(\"/\" + dirName + \"/**\")\n\t\t.addResourceLocations(\"file:/\" + userPhotosPath + \"/\");\n\t\t\n\t\t//exposes images in category-image directory\n\t\tString categoryImagesDirName = \"../category-images\";\n\t\t//directory path\n\t\tPath categoryImagesDir = Paths.get(categoryImagesDirName);\n\t\t\n\t\t//get absolute path\n\t\tString categoryImagesPath = categoryImagesDir.toFile().getAbsolutePath();\n\t\t\n\t\tregistry.addResourceHandler(\"/category-images/**\")\n\t\t.addResourceLocations(\"file:/\" + categoryImagesPath + \"/\");\n\t}", "@Override\n public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n String requestUri = req.getRequestURI();\n\n if (requestUri.startsWith(req.getContextPath())) {\n requestUri = requestUri.substring(req.getContextPath().length());\n }\n\n if (requestUri.equals(\"/\")) {\n requestUri = \"/index.html\";\n }\n\n String baseFilename = String.join(\"\", getPrefix(), requestUri);\n\n // This is the filename that AWS Lambda would use\n String lambdaFilename = baseFilename.replaceFirst(\"/+\", \"\");\n\n // This is the filename that a local debug environment would use\n String localFilename = baseFilename.replaceFirst(\"//\", \"/\");\n\n // Always try to get the AWS Lambda file first since performance counts the most there\n Option<InputStream> inputStreamOption = Option.of(getClass().getClassLoader().getResourceAsStream(lambdaFilename));\n\n if (inputStreamOption.isEmpty()) {\n // Didn't find the AWS Lambda file, maybe we are debugging locally\n inputStreamOption = Option.of(getServletContext().getResource(localFilename))\n .map(url -> Try.of(url::openStream).getOrNull());\n }\n\n if (inputStreamOption.isEmpty()) {\n // Didn't find the file in either place\n resp.setStatus(404);\n return;\n }\n\n InputStream inputStream = inputStreamOption.get();\n\n Optional<String> optionalMimeType = Optional.empty();\n\n if (requestUri.endsWith(\".js\")) {\n // For some reason the \"*.nocache.js\" file gets picked up by Tika as \"text/x-matlab\"\n optionalMimeType = Optional.of(\"application/javascript\");\n } else if (requestUri.endsWith(\".html\")) {\n optionalMimeType = Optional.of(\"text/html\");\n } else if (requestUri.endsWith(\".png\")) {\n optionalMimeType = Optional.of(\"image/png\");\n } else if (requestUri.endsWith(\".jpg\")) {\n optionalMimeType = Optional.of(\"image/jpeg\");\n } else if (requestUri.endsWith(\".css\")) {\n optionalMimeType = Optional.of(\"text/css\");\n } else {\n Optional<MimeHelper> optionalMimeHelper = getOptionalMimeHelper();\n\n if (optionalMimeHelper.isPresent()) {\n // No MIME type detected, use the optional MIME helper\n optionalMimeType = Optional.of(optionalMimeHelper.get().detect(requestUri, inputStream));\n }\n }\n\n // Only set the MIME type if we found it\n optionalMimeType.ifPresent(resp::setContentType);\n\n resp.setStatus(200);\n\n // Throw an exception if the stream copy fails\n Try.run(() -> copyStream(inputStream, resp.getOutputStream())).get();\n }", "public NettyHttpFileHandler() {\r\n synchronized(_lock) {\r\n if (mimeTypesMap == null) {\r\n InputStream is = this.getClass().getResourceAsStream(\"/server.mime.types\");\r\n if (is != null) {\r\n mimeTypesMap = new MimetypesFileTypeMap(is);\r\n } else {\r\n \tlogger.debug(\"Cannot load mime types!\");\r\n }\r\n }\r\n }\r\n }", "public void handleStaticResources(String handler, HttpServletResponse response) {\n String fileName = null;\n if (handler.equals(\"status\")) {\n response.setContentType(\"text/html\");\n fileName = \"overview.html\";\n } else if (handler.equals(\"detail\")) {\n response.setContentType(\"text/html\");\n fileName = \"detail.html\";\n } else if (handler.equals(\"base.css\")) {\n response.setContentType(\"text/css\");\n fileName = \"base.css\";\n } else if (handler.equals(\"jquery.js\")) {\n response.setContentType(\"text/javascript\");\n fileName = \"jquery-1.4.2.min.js\";\n } else if (handler.equals(\"status.js\")) {\n response.setContentType(\"text/javascript\");\n fileName = \"status.js\";\n } else {\n try {\n response.sendError(404);\n } catch (IOException e) {\n throw new RuntimeException(\"Encountered error sending 404\", e);\n }\n return;\n }\n \n response.setHeader(\"Cache-Control\", \"public; max-age=300\");\n \n try {\n InputStream resourceStream = MapReduceServlet.class.getResourceAsStream(\n \"/com/google/appengine/tools/mapreduce/\" + fileName);\n OutputStream responseStream = response.getOutputStream();\n byte[] buffer = new byte[1024];\n int bytesRead;\n while ((bytesRead = resourceStream.read(buffer)) != -1) {\n responseStream.write(buffer, 0, bytesRead);\n }\n responseStream.flush();\n } catch (FileNotFoundException e) {\n throw new RuntimeException(\"Couldn't find static file for MapReduce library\", e);\n } catch (IOException e) {\n throw new RuntimeException(\"Couldn't read static file for MapReduce library\", e);\n }\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/static/**\").addResourceLocations(\"/static/\");\n registry.addResourceHandler(\"/resources/**\").addResourceLocations(\"/resources/\");\n // swagger\n// registry.addResourceHandler(\"swagger-ui.html\").addResourceLocations(\"classpath:/META-INF/resources/\");\n// registry.addResourceHandler(\"/webjars/**\").addResourceLocations(\"classpath:/META-INF/resources/webjars/\");\n \n }", "@Override\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\n\t\tregistry.addResourceHandler(\"/photos/**\").addResourceLocations(\"file:///c:/dev/study/temp2/\")\n\t\t\t\t.setCacheControl(CacheControl.noCache());\n\t\t// .setCacheControl(CacheControl.masAge(Duration.ofDays(1));\n\t\tregistry.addResourceHandler(\"/swagger-ui/**\")\n\t\t.addResourceLocations(\"classpath:/META-INF/resources/webjars/springfox-swagger-ui/\")\n\t\t.resourceChain(false);\n\t}", "private void startServlets(){\n\t\ttry{\n\t\t\tserver = new Server();\n\t\t\tServerConnector c = new ServerConnector(server);\n\t\t\tc.setIdleTimeout(15000);\n\t\t\tc.setAcceptQueueSize(256);\n\t\t\tc.setPort(port);\n\t\t\tif(!bind.equals(\"*\")){\n\t\t\t\tc.setHost(bind);\n\t\t\t}\n\n\t\t\tServletContextHandler handler = new ServletContextHandler(server,\"/\", true, false);\n\t\t\tServletHolder servletHolder = new ServletHolder(StatusServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/status/*\");\n\n\t\t\tservletHolder = new ServletHolder(SampleAPIServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/sample/*\");\n\n\t\t\tservletHolder = new ServletHolder(FileServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/*\");\n\t\t\tFileServlet.sourceFolder=\"./site\";\t\t\t\n\n\t\t\tserver.addConnector(c);\n\t\t\tserver.start();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void configureDefaultServletHandling(\n DefaultServletHandlerConfigurer configurer) {\n\n // DispatcherServlet forwards requests for static resources\n // to the servlet's default servlet and\n // not try to handle them itself\n configurer.enable();\n }", "void whenServeFile(String fileName, HttpServletRequest request);", "@Override protected void configureServlets() {\n serveRegex(\"^/(?!_ah).*\").with(HandlerServlet.class);\n // serves xmpp urls\n serveRegex(\"/_ah/xmpp/.*\").with(HandlerServlet.class);\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/resources/**\")\n .addResourceLocations(\"/resources/\");\n }", "@Override\n public void addResourceHandlers(final ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/resources/**\").addResourceLocations(\"/resources/\").setCachePeriod(31556926);\n }", "private native void setDefaultRealmFileDirectory(String fileDir, AssetManager assets);", "@Override\n protected void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"swagger-ui.html\")\n .addResourceLocations(\"classpath:/META-INF/resources/\");\n \n registry.addResourceHandler(\"/webjars/**\")\n .addResourceLocations(\"classpath:/META-INF/resources/webjars/\");\n }", "public void filesLocation (String externalFolder) {\n externalStaticFileFolder = externalFolder;\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/resources/**\").addResourceLocations(\"/resources/\");\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry){\n// registry.addResourceHandler(\"/jsp/**\").addResourceLocations(\"classpath:/static/jsp/\");\n registry.addResourceHandler(\"/jsp/**\").addResourceLocations(\"classpath:/static/jsp/\");\n registry.addResourceHandler(\"/**.html\").addResourceLocations(\"classpath:/templates/\");\n registry.addResourceHandler(\"/js/**\").addResourceLocations(\"classpath:/static/js/\");\n// registry.addResourceHandler(\"*.jpg\").addResourceLocations(\"classpath:/static/img\");\n\n }", "public static void main(String[] args) {\n staticFiles.location(\"/public\"); // Static files\n get(\"/hello\", (req, res) -> \"Hello World\");\n System.out.println(\"http://localhost:4567/hello\");\n }", "@Override\r\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\tregistry.addResourceHandler(\"/resources/**\")\r\n\t\t\t\t.addResourceLocations(\"/resources/\");\r\n\t}", "private void startServer(String ip, int port, String contentFolder) throws IOException{\n HttpServer server = HttpServer.create(new InetSocketAddress(ip, port), 0);\n \n //Making / the root directory of the webserver\n server.createContext(\"/\", new Handler(contentFolder));\n //Making /log a dynamic page that uses LogHandler\n server.createContext(\"/log\", new LogHandler());\n //Making /online a dynamic page that uses OnlineUsersHandler\n server.createContext(\"/online\", new OnlineUsersHandler());\n server.setExecutor(null);\n server.start();\n \n //Needing loggin info here!\n }", "@Override\n public void handle(HttpExchange exchange) throws IOException {\n boolean wasSuccessful = false;\n try {\n // Only allow POST requests for this operation.\n // This operation requires a POST request, because the\n // client is \"posting\" information to the server for processing.\n if (exchange.getRequestMethod().toLowerCase().equals(\"get\")) {\n\n //String containing the url desired\n String URLrequested = exchange.getRequestURI().toString();\n\n //Checks to see if it is just the open URL as ex: localhost:8080, this is mapped to index.html, this is the case for nothing added.\n if (URLrequested.length() == 1){\n\n\n String location = \"web/index.html\";\n Path path = FileSystems.getDefault().getPath(location);\n\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0);\n\n Files.copy(path, exchange.getResponseBody());\n\n exchange.getResponseBody().close();\n\n } else if (URLrequested.equals(\"/\")) {\n\n //\n String location = \"web\" + URLrequested;\n\n //Obtain the file path, this is the same method used for the name and locations data draw\n Path filePath = FileSystems.getDefault().getPath(location);\n\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0);\n\n //Copies Files into the exchange's responsive body header\n Files.copy(filePath, exchange.getResponseBody());\n\n exchange.getResponseBody().close();\n\n }\n else if(URLrequested.equals(\"/css/main.css\")){\n String location = \"web/css/main.css\";\n //Obtain the file path, this is the same method used for the name and locations data draw\n Path filePath = FileSystems.getDefault().getPath(location);\n\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0);\n\n //Copies Files into the response body\n Files.copy(filePath, exchange.getResponseBody());\n\n exchange.getResponseBody().close();\n\n }\n else{\n String location = \"web/HTML/404.html\";\n\n //Obtain the file path, this is the same method used for the name and locations data draw\n Path filePath = FileSystems.getDefault().getPath(location);\n\n //Response header needs to come first.\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_NOT_FOUND, 0);\n\n //Copies Files into the response body\n Files.copy(filePath, exchange.getResponseBody());\n\n\n //Completes the exchange\n exchange.getResponseBody().close();\n }\n wasSuccessful = true;\n\n\n }\n\n if (!wasSuccessful) {\n //Bad Server Response\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_BAD_REQUEST, 0);\n\n //Completes the exchange\n exchange.getResponseBody().close();\n }\n }\n catch (IOException e) {\n //Bad Server Response\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_SERVER_ERROR, 0);\n //Completes the exchange\n exchange.getResponseBody().close();\n e.printStackTrace();\n }\n }", "private void serve() {\n\t\tif (request == null) {\n\t\t\tchannel.close();\n\t\t\treturn;\n\t\t}\n\t\tlogger.fine(\"Serving \" + type + \" request : \" + request.getPath());\n\t\tResponse resp = RequestHandler.handle(request);\n\t\tif (resp.getRespCode() == ResponseCode.NOT_FOUND) {\n\t\t\terror404(resp);\n\t\t\treturn;\n\t\t}\n\n\t\tStringBuilder header = new StringBuilder();\n\t\tif (type == Type.HTTP) {\n\t\t\theader.append(\"HTTP/1.0 200 OK\\r\\n\");\n\t\t\theader.append(\"Content-Length: \")\n\t\t\t\t\t.append(resp.getFileData().remaining()).append(\"\\r\\n\");\n\t\t\theader.append(\"Connection: close\\r\\n\");\n\t\t\theader.append(\"Server: Hyperion/1.0\\r\\n\");\n\t\t\theader.append(\"Content-Type: \" + resp.getMimeType() + \"\\r\\n\");\n\t\t\theader.append(\"\\r\\n\");\n\t\t}\n\t\tbyte[] headerBytes = header.toString().getBytes();\n\n\t\tByteBuffer bb = resp.getFileData();\n\t\tChannelBuffer ib = ChannelBuffers.buffer(bb.remaining()\n\t\t\t\t+ headerBytes.length);\n\t\tib.writeBytes(headerBytes);\n\t\tib.writeBytes(bb);\n\t\tchannel.write(ib).addListener(ChannelFutureListener.CLOSE);\n\t}", "@Override\n public void start() throws LifecycleException {\n logger.info(\"Start http server ... \");\n\n\n try {\n // create a resource config that scans for JAX-RS resources and providers\n final ResourceConfig rc = new ResourceConfig()\n .packages(PACKAGES_SCAN) // packages path for resources loading\n .property(MvcFeature.TEMPLATE_BASE_PATH, FREEMARKER_BASE) // config freemarker view files's base path\n .register(LoggingFeature.class)\n .register(FreemarkerMvcFeature.class)\n .register(JettisonFeature.class)\n .packages(\"org.glassfish.jersey.examples.multipart\")\n .register(MultiPartFeature.class)\n .registerInstances(new ApplicationBinder()); //\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n httpServer = GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n\n // Set StaticHttpHandler to handle http server's static resources\n String htmlPath = this.getClass().getResource(HTML_BASE).getPath(); // TODO, 部署后要根据实际目录修正!classes 同级目录下的 html 目录\n HttpHandler handler = new StaticHttpHandler(htmlPath);\n httpServer.getServerConfiguration().addHttpHandler(handler, \"/\");\n\n logger.info(\"Jersey app started with WADL available at {} application.wadl\\n \", BASE_URI);\n } catch (Exception e) {\n throw new LifecycleException(e); // just convert to self defined exception\n }\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/js/**\", \"/img/**\", \"/fonts/**\", \"/css/**\", \"/**\")\n // where the resource file is\n .addResourceLocations(\"/js/\", \"/img/\", \"/fonts/\", \"/css/\", \"/\")\n// .setCachePeriod(31556926);\n .setCachePeriod(30);\n }", "@Override\n public Iterable<File> list(File storageDirectory) {\n\treturn null;\n }", "public void doFiles(){\r\n serversDir = new File(rootDirPath+\"/servers/\");\r\n serverList = new File(rootDirPath+\"serverList.txt\");\r\n if(!serversDir.exists()){ //if server Directory doesn't exist\r\n serversDir.mkdirs(); //create it\r\n }\r\n updateServerList();\r\n }", "@Override\n public void process(Path path, FileStorage storage) {\n }", "@Routes( { @Route( method = Method.ANY, path = \":?path=(.*)\", binding = BindingType.raw ) } )\n public void handle( final HttpServerRequest request )\n {\n ResponseUtils.setStatus( ApplicationStatus.OK, request );\n\n request.pause();\n String path = request.params()\n .get( PathParam.path.key() );\n\n if ( path != null && ( path.length() < 1 || path.equals( \"/\" ) ) )\n {\n path = null;\n }\n\n VertXWebdavRequest req = null;\n final VertXWebdavResponse response = new VertXWebdavResponse( request.response() );\n\n try\n {\n String contextPath = masterRouter.getPrefix();\n if ( contextPath == null )\n {\n contextPath = \"\";\n }\n\n req = new VertXWebdavRequest( request, contextPath, \"/mavdav\", path, null );\n\n service.service( req, response );\n\n }\n catch ( WebdavException | IOException e )\n {\n logger.error( String.format( \"Failed to service mavdav request: %s\", e.getMessage() ), e );\n formatResponse( e, request );\n }\n finally\n {\n IOUtils.closeQuietly( req );\n IOUtils.closeQuietly( response );\n\n try\n {\n request.response()\n .end();\n }\n catch ( final IllegalStateException e )\n {\n }\n }\n }", "@Override\n public void handleRequest(HttpServerExchange exchange) throws Exception {\n if (exchange.isInIoThread()) {\n exchange.dispatch(this);\n return;\n }\n\n // We check if the engine was initially loaded or at least tried to be loaded\n if (currentEngine.get() == null) {\n Optional<ScriptRunner> optRunner = loadAndSetScriptRunner();\n if (Boolean.parseBoolean(refresh)) {\n optRunner.ifPresent(runner -> {\n reloadOnChange(runner.getFile());\n });\n }\n }\n\n Optional<ScriptRunner> runner = currentEngine.get();\n if (runner.isPresent()) {\n try {\n Invocable invocable = (Invocable) runner.get().getEngine();\n JSFilterData data = new JSFilterData(exchange, next, runner.get().getScriptLogger());\n invocable.invokeFunction(\"handleRequest\", data);\n } catch (ScriptException | NoSuchMethodException invocationException) {\n LOGGER.warning(\"undertow-jsfilters: failure calling method '\" + \"handleRequest\" + \"' in file => \" + this.fileName);\n LOGGER.throwing(fileName, \"handleRequest\", invocationException);\n next.handleRequest(exchange);\n return;\n }\n } else {\n next.handleRequest(exchange);\n return;\n }\n }", "@Override\n\tpublic void preServe() {\n\n\t}", "public static Handler<RoutingContext> serve(String spaDir, int port) {\n return serve(spaDir, port, \"npm\", \"start\", \"--\");\n }", "@Override\n public void fileNotFound(String path, Throwable cause) {\n headers.put(CONTENT_TYPE, MediaType.getType(\".html\"));\n send404NotFound(ctx, headers, \"404 NOT FOUND\".getBytes(), true);\n }", "@Override\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\t// add a cache period of one week to static resources returned by Tomcat\n\t\tregistry.addResourceHandler(\"/resources/**\")\n\t\t\t\t.addResourceLocations(\"/resources/\")\n\t\t\t\t.setCachePeriod( 604800 ); // one week in seconds\n\t}", "@Override\n public void addDefaultRoutes() {\n super.addDefaultRoutes();\n addRoute( \"/user\", UserResponder.class );\n addRoute( \"/user/:id\", UserResponder.class );\n addRoute( \"/user/help\", GeneralResponder.class );\n addRoute( \"/general/:param1/:param2\", GeneralResponder.class );\n addRoute( \"/photos/:customer_id/:photo_id\", null );\n addRoute( \"/test\", String.class );\n addRoute( \"/interface\", Responder.class ); // this will cause an error\n addRoute( \"/toBeDeleted\", String.class );\n removeRoute( \"/toBeDeleted\" );\n addRoute( \"/stream\", StreamUrl.class );\n addRoute( \"/browse/(.)+\", StaticPageTestResponder.class, new File( \"src/test/resources\" ).getAbsoluteFile() );\n }", "@Override\n public Iterable<File> list(File storageDirectory, FilenameFilter filter) {\n\treturn null;\n }", "@ExceptionHandler(StorageFileNotFoundException.class)\n public ResponseEntity<?> handleStorageFileNotFound(StorageFileNotFoundException exc) {\n return ResponseEntity.notFound().build();\n }", "@Override\n public void parseEmbedded(InputStream stream, ContentHandler handler, Metadata metadata, boolean outputHtml)\n throws SAXException, IOException {\n String name = metadata.get(Metadata.RESOURCE_NAME_KEY);\n\n if (name == null) {\n name = \"file_\" + fileCount++;\n } else {\n //make sure to select only the file name (not any directory paths\n //that might be included in the name) and make sure\n //to normalize the name\n name = FilenameUtils.normalize(FilenameUtils.getName(name));\n }\n\n //now try to figure out the right extension for the embedded file\n MediaType contentType = detector.detect(stream, metadata);\n\n if (name.indexOf('.') == -1 && contentType != null) {\n try {\n name += config.getMimeRepository().forName(\n contentType.toString()).getExtension();\n } catch (MimeTypeException e) {\n e.printStackTrace();\n }\n }\n //should add check to make sure that you aren't overwriting a file\n Path outputFile = outputDir.resolve(name);\n //do a better job than this of checking\n java.nio.file.Files.createDirectories(outputFile.getParent());\n java.nio.file.Files.copy(stream, outputFile, StandardCopyOption.REPLACE_EXISTING);\n\n //上传图片,返回Url,并建立一个映射表\n Calendar calendar = Calendar.getInstance();\n SimpleDateFormat DateFormat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n String dateStr = DateFormat.format(calendar.getTime());\n\n String key = dateStr+\"_\"+UUID.randomUUID().toString()+\"_\"+name;\n String qiniuurl = \"\";\n try {\n File file = new File(outputFile.toString());\n InputStream in = new FileInputStream(file);\n byte b[]=new byte[(int)file.length()];\n in.read(b);\n in.close();\n qiniuurl = fu.fileUpload(uploadManager, b, key, null, contentType.toString());\n imgPathMap.put(name,qiniuurl);\n logger.info(\"=====图片url:\"+qiniuurl);\n }catch (Exception e){\n e.printStackTrace();\n }\n }", "public StorageServer(File root)\n {\n this(root, 0, 0);\n }", "@Override\n\tpublic void handle() {\n\t\tPath p = Paths.get(pathName);\n\t\tFile file = null;\n\t\tString path = null;\n\n\t\tif (p.isAbsolute()) {\n\t\t\tpath = pathName;\n\t\t\tfile = new File(path);\n\t\t} else {\n\t\t\tpath = clientFtp.getCurrentDirectory() + \"/\" + pathName;\n\t\t\tfile = new File(path);\n\t\t}\n\t\t// Check if the client doesn't try to create a directory outside the root\n\t\t// directory\n\t\tif (path.contains(ServerFtp.home)) {\n\t\t\tif (file.exists()) {\n\t\t\t\tclientFtp.sendMessage(String.format(Response.MKD_NOK_EXIST, path));\n\t\t\t} else {\n\t\t\t\t// Creating the directory\n\t\t\t\tboolean bool = file.mkdir();\n\t\t\t\tif (bool) {\n\t\t\t\t\tclientFtp.sendMessage(String.format(Response.MKD_OK, path));\n\t\t\t\t} else {\n\t\t\t\t\tclientFtp.sendMessage(Response.FILE_NOT_FOUND);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tclientFtp.sendMessage(Response.FILE_NOT_FOUND);\n\t\t}\n\t}", "public void addResourceHandlers(ResourceHandlerRegistry registry){\n\t\tregistry.addResourceHandler(\"/resources/**\").addResourceLocations(\"/WEB-INF/resources/\");\n\t}", "public void handle(HttpExchange t) throws IOException {\n os = t.getResponseBody();\n urlString = t.getRequestURI().toString();\n this.url =t.getRequestURI().toString().split(\"/\"); //getRequestURI for URL and split\n\n System.out.println(\"Base URI Received: \"+t.getRequestURI().toString());\n\n if(urlString.contains(\".\")) {\n Helper.returnRequestedFile(t, urlString, os);\n } else {\n if(url.length == 0 || url[url.length-1].equals(\"index.html\")) {\n //Returns index.html\n basePage = new File(\"src/StockMarketServer/client/index/index.html\"); //Write index.html to file\n t.getResponseHeaders().add(\"Content-type\", \"text/html\");\n t.sendResponseHeaders(200, basePage.length()); //Return okay code and length of file\n Files.copy(Paths.get(basePage.getAbsolutePath()), os); //Write index.html to response\n os = t.getResponseBody();\n }\n else {\n //Returns pageNotFound.html\n basePage = new File(\"src/StockMarketServer/client/pageNotFound/pageNotFound.html\"); //Write index.html to file\n t.sendResponseHeaders(404, basePage.length()); //Return okay code and length of file\n Files.copy(Paths.get(basePage.getAbsolutePath()), os); //Write index.html to response\n os = t.getResponseBody();\n }\n }\n os.close();\n }", "protected void doFile(HttpServletRequest request, HttpServletResponse response, String path, String mimeType, boolean dynamic) throws IOException\n {\n if (!dynamic && isUpToDate(request, path))\n {\n response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);\n return;\n }\n \n String output;\n \n synchronized (scriptCache)\n {\n output = (String) scriptCache.get(path);\n if (output == null)\n {\n StringBuffer buffer = new StringBuffer();\n \n String resource = DwrConstants.PACKAGE + path;\n InputStream raw = getClass().getResourceAsStream(resource);\n if (raw == null)\n {\n throw new IOException(\"Failed to find resource: \" + resource); //$NON-NLS-1$\n }\n \n BufferedReader in = new BufferedReader(new InputStreamReader(raw));\n while (true)\n {\n String line = in.readLine();\n if (line == null)\n {\n break;\n }\n \n if (dynamic)\n {\n if (line.indexOf(PARAM_HTTP_SESSIONID) != -1)\n {\n line = LocalUtil.replace(line, PARAM_HTTP_SESSIONID, request.getSession(true).getId());\n }\n \n if (line.indexOf(PARAM_SCRIPT_SESSIONID) != -1)\n {\n line = LocalUtil.replace(line, PARAM_SCRIPT_SESSIONID, generator.generateId(pageIdLength));\n }\n }\n \n buffer.append(line);\n buffer.append('\\n');\n }\n \n output = buffer.toString();\n \n if (mimeType.equals(MimeConstants.MIME_JS) && scriptCompressed)\n {\n output = JavascriptUtil.compress(output, compressionLevel);\n }\n \n if (!dynamic)\n {\n scriptCache.put(path, output);\n }\n }\n }\n \n response.setContentType(mimeType);\n response.setDateHeader(HttpConstants.HEADER_LAST_MODIFIED, servletContainerStartTime);\n response.setHeader(HttpConstants.HEADER_ETAG, etag);\n \n PrintWriter out = response.getWriter();\n out.println(output);\n out.flush();\n }", "public IStatus prepareForServingDirectly(IPath baseDir, TomcatServer server, String tomcatVersion);", "private void loadBasePaths() {\n\n Log.d(TAG, \"****loadBasePaths*****\");\n List<FileInfo> paths = BaseMediaPaths.getInstance().getBasePaths();\n for (FileInfo path : paths) {\n\n }\n }", "private void loadExtensionResources() {\n\n for (String extensionType : ExtensionMgtUtils.getExtensionTypes()) {\n Path path = ExtensionMgtUtils.getExtensionPath(extensionType);\n if (log.isDebugEnabled()) {\n log.debug(\"Loading default templates from: \" + path);\n }\n\n // Check whether the given extension type directory exists.\n if (!Files.exists(path) || !Files.isDirectory(path)) {\n if (log.isDebugEnabled()) {\n log.debug(\"Default templates directory does not exist: \" + path);\n }\n continue;\n }\n\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addExtensionType(extensionType);\n\n // Load extensions from the given extension type directory.\n try (Stream<Path> directories = Files.list(path).filter(Files::isDirectory)) {\n directories.forEach(extensionDirectory -> {\n try {\n // Load extension info.\n ExtensionInfo extensionInfo = loadExtensionInfo(extensionDirectory);\n if (extensionInfo == null) {\n throw new ExtensionManagementException(\"Error while loading extension info from: \"\n + extensionDirectory);\n }\n extensionInfo.setType(extensionType);\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addExtension(extensionType,\n extensionInfo.getId(), extensionInfo);\n // Load templates.\n JSONObject template = loadTemplate(extensionDirectory);\n if (template != null) {\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addTemplate(extensionType,\n extensionInfo.getId(), template);\n }\n // Load metadata.\n JSONObject metadata = loadMetadata(extensionDirectory);\n if (metadata != null) {\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addMetadata(extensionType,\n extensionInfo.getId(), metadata);\n }\n } catch (ExtensionManagementException e) {\n log.error(\"Error while loading resource files in: \" + extensionDirectory, e);\n }\n });\n } catch (IOException e) {\n log.error(\"Error while loading resource files in: \" + path, e);\n }\n }\n }", "public StorageManager() {\n makeDirectory();\n }", "public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }", "private static void deployStaticHEResources(String targetDir, boolean bootstrappingEnabled) throws URISyntaxException, IOException{\r\n \t\r\n\t\tClassLoader loader = ServiceGenerator.class.getClassLoader();\r\n\t\tURI jniInterfaceFilePath = loader.getResource(Constants.HE_SERVICE_RESOURCES_FOLDER \r\n\t\t\t\t+ Constants.SERVICE_JNI_INTERFACE_FILE_NAME).toURI();\r\n\t\tURI jniInterfaceHeaderFilePath = loader.getResource(Constants.HE_SERVICE_RESOURCES_FOLDER \r\n\t\t\t\t+ Constants.SERVICE_JNI_INTERFACE_HEADER_FILE_NAME).toURI();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tFile origJniInterfaceFile = new File(jniInterfaceFilePath);\r\n\t\tFile newJniInterfaceFile = new File(targetDir + origJniInterfaceFile.getName());\r\n\t\t\r\n\t\tFile origJniInterfaceHeaderFile = new File(jniInterfaceHeaderFilePath);\r\n\t\tFile newJniInterfaceHeaderFile = new File(targetDir + origJniInterfaceHeaderFile.getName());\r\n\t\t\t\t\t\t\r\n\t\t \t\t\r\n\t\tUtils.deployStaticResource(origJniInterfaceFile, newJniInterfaceFile);\r\n\t\tUtils.deployStaticResource(origJniInterfaceHeaderFile, newJniInterfaceHeaderFile);\r\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n WebMvcConfigurer.super.addResourceHandlers(registry);\n registry.addResourceHandler(\"/resources/**\").addResourceLocations(\"WEB-INF/resources/\");\n }", "public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException\n {\n try\n {\n String pathInfo = request.getPathInfo();\n String servletPath = request.getServletPath();\n String contextPath = request.getContextPath();\n \n if (nullPathInfoWorkaround && pathInfo == null)\n {\n pathInfo = request.getServletPath();\n servletPath = PathConstants.PATH_ROOT;\n log.debug(\"Default servlet suspected. pathInfo=\" + pathInfo + \"; contextPath=\" + contextPath + \"; servletPath=\" + servletPath); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n }\n \n if (pathInfo == null ||\n pathInfo.length() == 0 ||\n pathInfo.equals(PathConstants.PATH_ROOT))\n {\n response.sendRedirect(contextPath + servletPath + PathConstants.FILE_INDEX);\n }\n else if (pathInfo.startsWith(PathConstants.FILE_INDEX))\n {\n String page = debugPageGenerator.generateIndexPage(contextPath + servletPath);\n \n response.setContentType(MimeConstants.MIME_HTML);\n PrintWriter out = response.getWriter();\n out.print(page);\n response.flushBuffer();\n }\n else if (pathInfo.startsWith(PathConstants.PATH_TEST))\n {\n String scriptName = pathInfo;\n scriptName = LocalUtil.replace(scriptName, PathConstants.PATH_TEST, \"\"); //$NON-NLS-1$\n scriptName = LocalUtil.replace(scriptName, PathConstants.PATH_ROOT, \"\"); //$NON-NLS-1$\n \n String page = debugPageGenerator.generateTestPage(contextPath + servletPath, scriptName);\n \n response.setContentType(MimeConstants.MIME_HTML);\n PrintWriter out = response.getWriter();\n out.print(page);\n response.flushBuffer();\n }\n else if (pathInfo.startsWith(PathConstants.PATH_INTERFACE))\n {\n String scriptName = pathInfo;\n scriptName = LocalUtil.replace(scriptName, PathConstants.PATH_INTERFACE, \"\"); //$NON-NLS-1$\n scriptName = LocalUtil.replace(scriptName, PathConstants.EXTENSION_JS, \"\"); //$NON-NLS-1$\n String path = contextPath + servletPath;\n \n String script = remoter.generateInterfaceScript(scriptName, path);\n \n // Officially we should use MimeConstants.MIME_JS, but if we cheat and\n // use MimeConstants.MIME_PLAIN then it will be easier to read in a\n // browser window, and will still work just fine.\n response.setContentType(MimeConstants.MIME_PLAIN);\n PrintWriter out = response.getWriter();\n out.print(script);\n response.flushBuffer();\n }\n else if (pathInfo.startsWith(PathConstants.PATH_PLAINJS))\n {\n Calls calls = plainJsMarshaller.marshallInbound(request, response);\n Replies replies = remoter.execute(calls);\n plainJsMarshaller.marshallOutbound(replies, request, response);\n }\n else if (pathInfo.startsWith(PathConstants.PATH_HTMLJS))\n {\n Calls calls = htmlJsMarshaller.marshallInbound(request, response);\n Replies replies = remoter.execute(calls);\n htmlJsMarshaller.marshallOutbound(replies, request, response);\n }\n else if (pathInfo.equalsIgnoreCase(PathConstants.FILE_ENGINE))\n {\n doFile(request, response, PathConstants.FILE_ENGINE, MimeConstants.MIME_JS, true);\n }\n else if (pathInfo.equalsIgnoreCase(PathConstants.FILE_UTIL))\n {\n doFile(request, response, PathConstants.FILE_UTIL, MimeConstants.MIME_JS, false);\n }\n else if (pathInfo.startsWith(PathConstants.PATH_STATUS))\n {\n Container container = WebContextFactory.get().getContainer();\n ScriptSessionManager manager = (ScriptSessionManager) container.getBean(ScriptSessionManager.class.getName());\n if (manager instanceof DefaultScriptSessionManager)\n {\n DefaultScriptSessionManager dssm = (DefaultScriptSessionManager) manager;\n dssm.debug();\n }\n }\n else\n {\n log.warn(\"Page not found (\" + pathInfo + \"). In debug/test mode try viewing /[WEB-APP]/dwr/\"); //$NON-NLS-1$ //$NON-NLS-2$\n response.sendError(HttpServletResponse.SC_NOT_FOUND);\n }\n }\n catch (Exception ex)\n {\n log.warn(\"Error: \" + ex); //$NON-NLS-1$\n if (ex instanceof SecurityException && log.isDebugEnabled())\n {\n log.debug(\"- User Agent: \" + request.getHeader(HttpConstants.HEADER_USER_AGENT)); //$NON-NLS-1$\n log.debug(\"- Remote IP: \" + request.getRemoteAddr()); //$NON-NLS-1$\n log.debug(\"- Request URL:\" + request.getRequestURL()); //$NON-NLS-1$\n log.debug(\"- Query: \" + request.getQueryString()); //$NON-NLS-1$\n log.debug(\"- Method: \" + request.getMethod()); //$NON-NLS-1$\n \n ex.printStackTrace();\n }\n \n response.setContentType(MimeConstants.MIME_HTML);\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\n PrintWriter out = response.getWriter();\n out.println(\"<html><head><title>Error</title</head><body>\"); //$NON-NLS-1$\n out.println(\"<p><b>Error</b>: \" + ex.getMessage() + \"</p>\"); //$NON-NLS-1$ //$NON-NLS-2$\n out.println(\"<p>For further information about DWR see:</p><ul>\"); //$NON-NLS-1$\n out.println(\"<li><a href='http://getahead.ltd.uk/dwr/documentation'>DWR Documentation</a></li>\"); //$NON-NLS-1$\n out.println(\"<li><a href='http://getahead.ltd.uk/dwr/support'>DWR Mailing List</a></li>\"); //$NON-NLS-1$\n out.println(\"</ul>\"); //$NON-NLS-1$\n out.println(\"<script type='text/javascript'>\"); //$NON-NLS-1$\n out.println(\"alert('\" + ex.getMessage() + \"');\"); //$NON-NLS-1$ //$NON-NLS-2$\n out.println(\"</script>\"); //$NON-NLS-1$\n out.println(\"</body></html>\"); //$NON-NLS-1$\n out.flush();\n }\n }", "@GetMapping(\"/files\")\n public ResponseEntity<List<FileInfo>> getListFiles() {\n List<FileInfo> fileInfos = storageService.loadAll().map(path -> {\n String filename = path.getFileName().toString();\n String url = MvcUriComponentsBuilder\n .fromMethodName(FilesController.class, \"getFile\", path.getFileName().toString()).build().toString();\n\n return new FileInfo(filename, url);\n }).collect(Collectors.toList());\n\n return ResponseEntity.status(HttpStatus.OK).body(fileInfos);\n }", "public void executelaunchDirectoryFiler() {\n \t\tif (conf.getProperty(\"rootDirectory\") == null)\n \t\t\tUtil.fatalError(\"You must provide a root directory for the filer with -r or --rootDirectory\");\n \t\tif (conf.getProperty(\"secret\") == null)\n \t\t\tUtil.fatalError(\"You must provide a shared secret to protect the server with -s or --secret\");\n \t\t\n \t\tfinal DirectoryFilerServer serv;\n \t\ttry {\n \t\t\tserv = new DirectoryFilerServer(conf.getProperty(\"rootDirectory\"),\n \t\t\t\tconf.getInteger(\"port\", 4263),\n \t\t\t\tconf.getProperty(\"secret\"));\n \t\t} catch (ClassNotFoundException e1) {\n \t\t\tUtil.fatalError(\"failed to load configuration\", e1);\n \t\t\treturn;\n \t\t}\n \t\t\n \t\tRuntime.getRuntime().addShutdownHook(new Thread(new Runnable(){\n \t\t\tpublic void run() {\n \t\t\t\tserv.close();\n \t\t\t}\n \t\t}));\n \t\t\n \t\tserv.launchServer();\n \t}", "protected void handleLs() {\r\n\t\tSystem.out.printf(\"Listing available files.%n\");\r\n\r\n\t\tFile[] availableFiles = new File(fileBase).listFiles();\r\n\r\n\t\tif (availableFiles == null) {\r\n\t\t\tSystem.err.printf(\"%s is not a directory.%n\", fileBase);\r\n\t\t\tsendMessage(String.valueOf(ERROR));\r\n\t\t} else {\r\n\t\t\tsendMessage(String.valueOf(availableFiles.length));\r\n\r\n\t\t\t/* send each file name */\r\n\t\t\tfor (File file : availableFiles) {\r\n\t\t\t\tsendMessage(file.getName());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public interface FilePostDownloadHandler {\n void onPostDownload();\n}", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n System.out.println(\"Adding answers...\");\n String assignmentKey = request.getParameter(\"assignment-key\");\n String questionKey = request.getParameter(\"question-key\");\n\n File folder = new File(\"images/answers\");\n File[] listOfFiles = folder.listFiles();\n\n for (File file : listOfFiles) {\n String path = \"images/answers/\" + file.getName();\n Database.addAnswer(path, parseAnswer(path), 0, assignmentKey, questionKey);\n }\n System.out.println(\"Done!\");\n response.setContentType(\"application/json;\");\n response.getWriter().println(\"\");\n }", "@Override\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\tWebMvcConfigurer.super.addResourceHandlers(registry);\n\t\tregistry.addResourceHandler(\"/resources/**\").addResourceLocations(\"/resources/\");\n\t}", "@Override\n public void scan() throws Exception {\n if (getContexts() == null) {\n throw new IllegalArgumentException(\"No HandlerContainer\");\n }\n\n Resource r = Resource.newResource(getWebAppDir());\n if (!r.exists()) {\n throw new IllegalArgumentException(\"No such webapps resource \" + r);\n }\n\n if (!r.isDirectory()) {\n throw new IllegalArgumentException(\"Not directory webapps resource \" + r);\n }\n\n String[] files = r.list();\n\n files:\n for (int f = 0; (files != null) && (f < files.length); f++) {\n String context = files[f];\n\n if (context.equalsIgnoreCase(\"CVS/\") || context.equalsIgnoreCase(\"CVS\") || context.startsWith(\".\")) {\n continue;\n }\n\n Resource app = r.addPath(r.encode(context));\n\n if (context.toLowerCase().endsWith(\".war\") || context.toLowerCase().endsWith(\".jar\")) {\n context = context.substring(0, context.length() - 4);\n Resource unpacked = r.addPath(context);\n\n if ((unpacked != null) && unpacked.exists() && unpacked.isDirectory()) {\n Log.debug(context + \" already exists.\");\n continue;\n }\n } else if (!app.isDirectory()) {\n Log.debug(app + \" Not directory\");\n continue;\n }\n\n if (context.equalsIgnoreCase(\"root\") || context.equalsIgnoreCase(\"root/\")) {\n context = URIUtil.SLASH;\n } else {\n context = \"/\" + context;\n }\n if (context.endsWith(\"/\") && (context.length() > 0)) {\n context = context.substring(0, context.length() - 1);\n }\n\n // Check the context path has not already been added or the webapp\n // itself is not already deployed\n if (!getAllowDuplicates()) {\n Handler[] installed = getContexts().getChildHandlersByClass(ContextHandler.class);\n for (int i = 0; i < installed.length; i++) {\n ContextHandler c = (ContextHandler) installed[i];\n\n if (context.equals(c.getContextPath())) {\n if (Log.isDebugEnabled()) {\n Log.debug(context + \" Context were equal; duplicate!\");\n }\n continue files;\n }\n\n String path;\n if (c instanceof WebAppContext) {\n path = Resource.newResource(((WebAppContext) c).getWar()).getFile().getAbsolutePath();\n } else {\n path = c.getBaseResource().getFile().getAbsolutePath();\n }\n\n if ((path != null) && path.equals(app.getFile().getAbsolutePath())) {\n if (Log.isDebugEnabled()) {\n Log.debug(path + \" Paths were equal; duplicate!\");\n }\n continue files;\n }\n\n }\n }\n\n // create a webapp\n WebAppContext wah = null;\n HandlerCollection contexts = getContexts();\n if ((contexts instanceof ContextHandlerCollection)\n && WebAppContext.class.isAssignableFrom(((ContextHandlerCollection) contexts).getContextClass())) {\n try {\n wah = (WebAppContext) ((ContextHandlerCollection) contexts).getContextClass().newInstance();\n } catch (Exception e) {\n throw new Error(e);\n }\n } else {\n wah = new WebAppContext();\n }\n\n // configure it\n wah.setContextPath(context);\n\n if (getConfigurationClasses() != null) {\n wah.setConfigurationClasses(getConfigurationClasses());\n }\n\n if (getDefaultsDescriptor() != null) {\n wah.setDefaultsDescriptor(getDefaultsDescriptor());\n }\n wah.setExtractWAR(isExtract());\n wah.setWar(app.toString());\n wah.setParentLoaderPriority(isParentLoaderPriority());\n\n Enumeration<?> names = _attributes.getAttributeNames();\n while (names.hasMoreElements()) {\n String name = (String) names.nextElement();\n wah.setAttribute(name, _attributes.getAttribute(name));\n }\n\n // add it\n Log.debug(\"AndroidWebAppDeployer: prepared \" + app.toString());\n contexts.addHandler(wah);\n _deployed.add(wah);\n //jetty-7.3.0 onwards need to start explicitly due to different startup time ordering\n wah.start();\n }\n }", "public void start() {\n \t\tinit();\n\t\tif(!checkBackend()){\n\t\t\tvertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() {\n\t\t\t\tpublic void handle(HttpServerRequest req) {\n\t\t\t\t String query_type = req.path();\t\t\n\t\t\t\t req.response().headers().set(\"Content-Type\", \"text/plain\");\n\t\t\t\t\n\t\t\t\t if(query_type.equals(\"/target\")){\n\t\t\t\t\t String key = req.params().get(\"targetID\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tprocessRequest(key,req);\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t else {\n\t\t\t\t\t String key = \"1\";\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tprocessRequestRange(key,req);\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t } \n\t\t\t}).listen(80);\n\t\t} else {\n\t\t\tSystem.out.println(\"Please make sure that both your DCI are up and running\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public void onNewDirLoaded(File dirFile);", "public static void sync() {\n\t\tUiApplication.getUiApplication().addFileSystemJournalListener(fileListener);\n\t\tnew Thread() {\n\t\t\tpublic void run() {\n\t\t\t\t// Find files sdcard\n\t\t\t\tif (ToolsBB.fsMounted(FILESYSTEM.SDCARD)) {\n\t\t\t\t\tlogger.debug(\"Finding files on sdcard\");\n\t\t\t\t\tfindFiles(sdcardDir);\n\t\t\t\t}\n\t\t\t\t// Find files on eMMC\n\t\t\t\tif (ToolsBB.fsMounted(FILESYSTEM.STORE)) {\n\t\t\t\t\tlogger.debug(\"Finding files on eMMC\");\n\t\t\t\t\tfindFiles(storeDir);\n\t\t\t\t}\n\n\t\t\t\t// Upload files to server\n\t\t\t\tFileLog.upload();\n\n\t\t\t}\n\t\t}.start();\n\t}", "public void run(){\n // first register the producer\n m_DirectoryQueue.registerProducer();\n\n enqueueFiles(f_Root);\n\n //lastly unregister the producer\n m_DirectoryQueue.unregisterProducer();\n }", "public FileHandlerImpl(){\n\t\tfilepath = null;\n\t}", "private void initializeHandler() {\n if (handler == null) {\n handler = AwsHelpers.initSpringBootHandler(Application.class);\n }\n }", "private void ingest(SnowflakeStreamingServiceConfig config)\n throws IngestResponseException, IOException, URISyntaxException {\n List<String> filesList = config.getFilesList();\n String stagingBucketDir = config.getStagingBucketDir();\n ingestManager = config.getIngestManager();\n\n Set<String> files =\n filesList.stream()\n .map(e -> e.replaceAll(String.valueOf(stagingBucketDir), \"\"))\n .map(e -> e.replaceAll(\"'\", \"\"))\n .collect(Collectors.toSet());\n\n if (!files.isEmpty()) {\n this.ingestManager.ingestFiles(SimpleIngestManager.wrapFilepaths(files), null);\n }\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n\n }", "@Override\n public void run() {\n\n\n try {\n WatchService watchService = FileSystems.getDefault().newWatchService();\n Path path = Paths.get(INPUT_FILES_DIRECTORY);\n\n path.register( watchService, StandardWatchEventKinds.ENTRY_CREATE); //just on create or add no modify?\n\n WatchKey key;\n while ((key = watchService.take()) != null) {\n for (WatchEvent<?> event : key.pollEvents()) {\n\n String fileName = event.context().toString();\n notifyController.processDetectedFile(fileName);\n\n }\n key.reset();\n }\n\n } catch (Exception e) {\n //Logger.getGlobal().setUseParentHandlers(false);\n //Logger.getGlobal().log(Level.SEVERE, e.toString(), e);\n\n }\n }", "public handleFileUpload() {\r\n\t\tsuper();\r\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_add_songs);\n\n Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n setSupportActionBar(toolbar);\n prefs = new PreferencesService(this);\n FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fabAddSongs);\n\n fab.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n APIService ServerAPI = new APIService();\n ServerAPI.mp3Upload(prefs.getDeviceID(), SongFile, new RequestHandler<Song>() {\n @Override\n public void callback(Song result) {\n }\n });\n Intent intent = new Intent(AddSongsActivity.this, MainActivity.class);\n finish();\n startActivity(intent);\n Toast.makeText(AddSongsActivity.this, \"Song Added!\", Toast.LENGTH_LONG).show();\n }\n });\n\n ActivityCompat.requestPermissions(AddSongsActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1);\n ActivityCompat.requestPermissions(AddSongsActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);\n\n if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {\n Toast.makeText(this, \"Error! No SDCARD Found!\", Toast.LENGTH_LONG).show();\n } else {\n fullPath = Environment.getExternalStorageDirectory().getAbsolutePath() + \"/JukeFit/\";\n boolean success = true;\n try {\n file = new File(fullPath);\n if (!file.exists())\n success = file.mkdirs();\n if (success) {\n System.out.println(\"Full Path: \" + fullPath);\n System.out.println(\"Success\");\n } else {\n System.out.println(\"Failure\");\n }\n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n if (file.listFiles() != null) {\n listFile = file.listFiles();\n int len = listFile.length;\n System.out.println(\"Length:\" + len);\n }\n }\n\n if (file.isDirectory() && file.listFiles() != null) {\n listFile = file.listFiles();\n FilePathStrings = new String[listFile.length];\n FileNameStrings = new String[listFile.length];\n\n for (int i = 0; i < listFile.length; i++) {\n System.out.println(\"List File Size: \" + listFile[i].length());\n if (listFile[i].length() != 0) {\n FilePathStrings[i] = listFile[i].getAbsolutePath();\n FileNameStrings[i] = listFile[i].getName();\n System.out.println(\"FilePathStrings: \" + FilePathStrings[i]);\n System.out.println(\"FileNameStrings: \" + FileNameStrings[i]);\n System.out.println(\"List File Size 2: \" + listFile[i].length());\n }\n }\n }\n if (FilePathStrings != null) {\n\n listview = (ListView) findViewById(R.id.SongListView);\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.songlistitem, R.id.SongName, FileNameStrings);\n listview.setAdapter(adapter);\n listview.setChoiceMode(ListView.CHOICE_MODE_SINGLE);\n }\n\n listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n\n @Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n CheckedTextView ctv = (CheckedTextView) view;\n SongFile = new File(listFile[position].getAbsolutePath());\n }\n });\n\n }", "public int handle(Request req, int handlerCode) throws IOException{\n if (fileCache == null) return Interceptor.CONTINUE;\n \n if (handlerCode == Interceptor.RESPONSE_PROCEEDED && fileCache.isEnabled()){\n String docroot = SelectorThread.getWebAppRootPath();\n MessageBytes mb = req.requestURI();\n String uri = req.requestURI().toString(); \n fileCache.add(FileCache.DEFAULT_SERVLET_NAME,docroot,uri,\n req.getResponse().getMimeHeaders(),false); \n } else if (handlerCode == Interceptor.REQUEST_LINE_PARSED) {\n ByteChunk requestURI = req.requestURI().getByteChunk(); \n if (fileCache.sendCache(requestURI.getBytes(), requestURI.getStart(),\n requestURI.getLength(), channel,\n keepAlive(req))){\n return Interceptor.BREAK; \n }\n } \n return Interceptor.CONTINUE;\n }", "List getFileUploads(HttpServletRequest request, File finalDir) throws ValidationException;", "public void startWatchingExternalStorage() {\n\t updateExternalStorageState(Environment.getExternalStorageState());\n\t\tmExternalStorageReceiver = new BroadcastReceiver() {\n\t\t\t@Override\n\t\t\tpublic void onReceive(Context context, Intent intent) {\n\t\t\t String action = intent.getAction();\n\t\t\t\tupdateExternalStorageState(action);\n\t\t synchronized (mObservers) {\n\t\t for (SdcardObserver observer : mObservers)\n\t\t observer.onSdcardChanged();\n\t\t }\n\t\t\t}\n\t\t};\n\t\tIntentFilter filter = new IntentFilter();\n\t\tfilter.addAction(Intent.ACTION_MEDIA_MOUNTED);\n\t\tfilter.addAction(Intent.ACTION_MEDIA_UNMOUNTED);\n\t\tfilter.addDataScheme(\"file\");\n\t\tmApplicationContext.registerReceiver(mExternalStorageReceiver, filter);\n\t}", "@Override\n public void handle(HttpExchange exchange) {\n \n try {\n String resource = exchange.getRequestURI().getPath();\n if (exchange.getRequestMethod().equals(\"HEAD\")){\n exchange.sendResponseHeaders(200, 0);\n return;\n }else if (resource.startsWith(\"/api/\")){\n api(resource, exchange);\n }else{\n if (redirect.containsKey(exchange.getRequestURI().getPath())) resource = redirect.get(exchange.getRequestURI().getPath());\n else resource = resource.substring(1);\n sendResource(resource, exchange);\n }\n System.out.println(exchange.getRequestMethod() + \":\" + exchange.getRequestURI().toString() + \", \" + resource);\n }catch(Exception e){\n System.out.println(exchange.getRequestMethod() + \":\" + exchange.getRequestURI().toString() + \", \" + e);\n e.printStackTrace();\n byte[] data = e.getMessage().getBytes(StandardCharsets.UTF_8);\n try {\n exchange.sendResponseHeaders(500, data.length);\n exchange.getResponseBody().write(data);\n exchange.getResponseBody().flush();\n }catch(Exception ignored){}\n }finally{\n exchange.close();\n }\n }", "@GET\r\n\t@Produces(MediaType.APPLICATION_OCTET_STREAM)\r\n\t@Path(\"assets/{filename}\")\r\n\tpublic Response staticResources(@PathParam(\"filename\") String filename) {\r\n\t\tSystem.out.println(\"Fichier : \" + filename);\r\n\t\t\r\n\t\tString assetsPath = \"./assets/\";\r\n\t\tFile fichier = new File(assetsPath + filename );\r\n\t\t\r\n\t\tif( !fichier.exists() ) {\r\n\t\t\treturn Response.status(404).build();\r\n\t\t}\r\n\t\treturn Response.ok(fichier, MediaType.APPLICATION_OCTET_STREAM)\r\n\t\t .header(\"Content-Disposition\", \"attachment; filename=\\\"\" + fichier.getName() + \"\\\"\")\r\n\t\t\t .build();\r\n\t}", "@Override\n\tpublic void setHandler(String defaultHandler, String handlerName) {\n\n\t}", "public void start()\n {\n FileVector = FileHandler.getFileList( harvesterDirName , filterArray, false );\n iter = FileVector.iterator();\n }", "public void setupLoggingEndpoint() {\n HttpHandler handler = (httpExchange) -> {\n httpExchange.getResponseHeaders().add(\"Content-Type\", \"text/html; charset=UTF-8\");\n httpExchange.sendResponseHeaders(200, serverLogsArray.toJSONString().length());\n OutputStream out = httpExchange.getResponseBody();\n out.write(serverLogsArray.toJSONString().getBytes());\n out.close();\n };\n this.endpointMap.put(this.loggingApiEndpoint, this.server.createContext(this.loggingApiEndpoint));\n this.setHandler(this.getLoggingApiEndpoint(), handler);\n System.out.println(\"Set handler for logging\");\n this.endpointVisitFrequency.put(this.getLoggingApiEndpoint(), 0);\n }", "public static void setUpExample(DatabaseClient client)\n throws IOException, ResourceNotFoundException, ForbiddenUserException, FailedRequestException {\n XMLDocumentManager docMgr = client.newXMLDocumentManager();\n\n InputStreamHandle contentHandle = new InputStreamHandle();\n\n for (String filename: filenames) {\n try ( InputStream docStream = Util.openStream(\"data\"+File.separator+filename) ) {\n if (docStream == null) throw new IOException(\"Could not read document example\");\n\n contentHandle.set(docStream);\n\n docMgr.write(\"/example/\"+filename, contentHandle);\n }\n }\n }", "public static void loadEndpoints(){\n\t\tStart.loadEndpoints();\n\t\t//add\t\t\n\t\t//e.g.: get(\"/my-endpoint\", (request, response) ->\t\tmyEndpointGet(request, response));\n\t\t//e.g.: post(\"/my-endpoint\", (request, response) ->\t\tmyEndpointPost(request, response));\n\t}", "@Override\n\tpublic void addResourceHandlers(final ResourceHandlerRegistry registry) {\n\n\t\tSystem.out.println(\"execution is reaching addResourceHandlers()\");\n\t\tsuper.addResourceHandlers(registry);\n\t\tregistry.addResourceHandler(\"/images/**\").addResourceLocations(\"/resources/images/\").setCachePeriod(0);\n\t\tregistry.addResourceHandler(\"/js/**\").addResourceLocations(\"/resources/js/\").setCachePeriod(0);\n\t\tregistry.addResourceHandler(\"/css/**\").addResourceLocations(\"/resources/css/\").setCachePeriod(0);\n\t\tregistry.addResourceHandler(\"/fonts/**\").addResourceLocations(\"/resources/fonts/\").setCachePeriod(0);\n\t\t// this is one year cache period 31556926\n\t}", "public EmbeddedADS(File workDir) {\n initDirectoryService(workDir);\n }", "@Override\n public boolean handle(LruCache<String, CachedHandler> cache,\n Http.Method method,\n ServerRequest request,\n ServerResponse response,\n String requestedResource) throws IOException {\n if (!Files.exists(path)) {\n cache.remove(requestedResource);\n return false;\n }\n\n if (LOGGER.isLoggable(System.Logger.Level.TRACE)) {\n LOGGER.log(System.Logger.Level.TRACE, \"Sending static content from jar: \" + requestedResource);\n }\n\n // etag etc.\n if (lastModified != null) {\n processEtag(String.valueOf(lastModified.toEpochMilli()), request.headers(), response.headers());\n processModifyHeaders(lastModified, request.headers(), response.headers(), setLastModifiedHeader());\n }\n\n response.headers().contentType(mediaType);\n\n if (method == Http.Method.GET) {\n send(request, response, path);\n } else {\n response.headers().contentLength(contentLength(path));\n response.send();\n }\n\n return true;\n }", "public void init() {\n\t\tfilePath = getServletContext().getInitParameter(\"file-upload\");\n\t\tcreateDirIfDoesntExist(filePath);\n\t\ttmpFilePath = getServletContext().getInitParameter(\"tmp-file-upload\");\n\t\tcreateDirIfDoesntExist(tmpFilePath);\n\t}", "public void importMedia(){\r\n \r\n }", "@Override\r\n\tpublic void handleRequest(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\n\t\tcheckRequest(request);\r\n\r\n\t\t// Check whether a matching resource exists\r\n\t\tResource resource = getResource(request);\r\n\t\tif (resource == null) {\r\n\t\t\tlogger.trace(\"No matching resource found - returning 404\");\r\n\t\t\tresponse.sendError(HttpServletResponse.SC_NOT_FOUND);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Check the resource's media type\r\n\t\tMediaType mediaType = getMediaType(resource);\r\n\t\tif (mediaType != null) {\r\n\t\t\tif (logger.isTraceEnabled()) {\r\n\t\t\t\tlogger.trace(\"Determined media type '\" + mediaType + \"' for \" + resource);\r\n\t\t\t}\r\n\r\n\t\t\tif (Objects.equal(mediaType, MediaType.TEXT_HTML)) {\r\n\t\t\t\tWebRender render = new WebRender(beetlConfig.getGroupTemplate());\r\n\t\t\t\tif (resource instanceof ServletContextResource) {\r\n\t\t\t\t\trender.render(((ServletContextResource) resource).getPath(), request, response);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tif (logger.isTraceEnabled()) {\r\n\t\t\t\tlogger.trace(\"No media type found for \" + resource + \" - not sending a content-type header\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Header phase\r\n\t\tif (new ServletWebRequest(request, response).checkNotModified(resource.lastModified())) {\r\n\t\t\tlogger.trace(\"Resource not modified - returning 304\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Apply cache settings, if any\r\n\t\tprepareResponse(response);\r\n\r\n\t\t// Content phase\r\n\t\tif (METHOD_HEAD.equals(request.getMethod())) {\r\n\t\t\tsetHeaders(response, resource, mediaType);\r\n\t\t\tlogger.trace(\"HEAD request - skipping content\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (request.getHeader(HttpHeaders.RANGE) == null) {\r\n\t\t\tsetHeaders(response, resource, mediaType);\r\n\t\t\twriteContent(response, resource);\r\n\t\t} else {\r\n\t\t\twritePartialContent(request, response, resource, mediaType);\r\n\t\t}\r\n\t}", "private void load() {\n if (loaded) {\n return;\n }\n loaded = true;\n\n if(useDefault){\n ConfigFileLoader.setSource(\n new MhttpdBaseConfigurationSource(\n Bootstrap.getMhttpdBaseFile(), \"server-embed.xml\"));\n }else {\n ConfigFileLoader.setSource(\n new MhttpdBaseConfigurationSource(\n Bootstrap.getMhttpdBaseFile(), getConfigFile()));\n }\n Digester digester = createStartDigester();\n try (ConfigurationSource.Resource resource = ConfigFileLoader.getSource().getServerXml()) {\n InputStream inputStream = resource.getInputStream();\n InputSource inputSource = new InputSource(resource.getUri().toURL().toString());\n inputSource.setByteStream(inputStream);\n digester.push(this);\n digester.parse(inputSource);\n } catch (Exception e) {\n return;\n }\n\n }", "protected void initChannel(SocketChannel ch) throws Exception {\n ch.pipeline().addLast(\"FileServerHandler\", new FileServerHandler(transferFile));\n }", "protected void registerServlets(ServletContextHandler handler) {\n\t}" ]
[ "0.66382265", "0.64330083", "0.60958654", "0.606634", "0.5772826", "0.57618666", "0.5569732", "0.54676145", "0.54608005", "0.54446834", "0.54042697", "0.5315863", "0.53011703", "0.524966", "0.52326405", "0.5220784", "0.5204956", "0.518663", "0.51685864", "0.5158789", "0.51438844", "0.51433146", "0.504069", "0.50272965", "0.50267744", "0.50252426", "0.49978116", "0.49959105", "0.49835792", "0.4918318", "0.49026668", "0.48865506", "0.48525807", "0.48490587", "0.4845216", "0.48419708", "0.48113152", "0.47972408", "0.47599497", "0.47411308", "0.47146082", "0.46851102", "0.4670329", "0.4651706", "0.4634884", "0.46269387", "0.46014038", "0.45993277", "0.45708984", "0.45325938", "0.45322508", "0.45218703", "0.45218438", "0.45177287", "0.44964337", "0.44898072", "0.44894454", "0.44820285", "0.4469812", "0.4465936", "0.44545808", "0.44530138", "0.44442922", "0.4437956", "0.44339278", "0.44279292", "0.44279042", "0.4416455", "0.43947607", "0.43853024", "0.43836382", "0.43812537", "0.43746975", "0.4367897", "0.43619156", "0.43614656", "0.43607795", "0.435516", "0.4353729", "0.4348719", "0.43485457", "0.43434554", "0.43306503", "0.4327896", "0.4321066", "0.4316812", "0.43161917", "0.43133503", "0.4312149", "0.4304071", "0.43026608", "0.43012327", "0.42981339", "0.42967212", "0.42966974", "0.42943853", "0.42888385", "0.42882952", "0.42882165", "0.42854518" ]
0.6174167
2
Add the default handlers and serve files from the provided directory relative to the external storage directory.
public void addDefaultHandlers(String directoryPath) { try { synchronized (mImplMonitor) { checkServiceLocked(); mImpl.addDefaultHandlers(directoryPath); } } catch (RemoteException e) { throw new EmbeddedTestServerFailure( "Failed to add default handlers and start serving files from " + directoryPath + ": " + e.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void serveFilesFromDirectory(File directory) {\n serveFilesFromDirectory(directory.getPath());\n }", "public void addDefaultHandlers(File directory) {\n addDefaultHandlers(directory.getPath());\n }", "private void addHandlers()\n {\n handlers.add(new FileHTTPRequestHandler());\n }", "public void serveFilesFromDirectory(String directoryPath) {\n try {\n synchronized (mImplMonitor) {\n checkServiceLocked();\n mImpl.serveFilesFromDirectory(directoryPath);\n }\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to start serving files from \" + directoryPath + \": \" + e.toString());\n }\n }", "@Override\n public void loadRequestHandlers(List<String> list) {\n\n this.requestHandlers.add(\n new SoletDispatcher(\n this.workingDir,\n new ApplicationLoadingServiceImpl(\n new EmbeddedApplicationScanningService(configService, workingDir),\n this.configService,\n this.workingDir + configService.getConfigParam(ConfigConstants.ASSETS_DIR_NAME, String.class)\n ),\n this.configService\n ));\n\n this.requestHandlers.add(new ResourceHandler(workingDir, s -> Collections.singletonList(\"\"), this.configService));\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/resources/**\")\n .addResourceLocations(\"classpath:/static/\");\n /*\n * Static Resources store outside the project\n */\n registry.addResourceHandler(\"/files/**\")\n .addResourceLocations(\"file:/opt/FILES_MANAGEMENT/images/\");\n }", "private void startWebApp(Handler<AsyncResult<HttpServer>> next) {\n Router router = Router.router(vertx);\n\n router.route(\"/assets/*\").handler(StaticHandler.create(\"assets\"));\n router.route(\"/api/*\").handler(BodyHandler.create());\n\n router.route(\"/\").handler(this::handleRoot);\n router.get(\"/api/timer\").handler(this::timer);\n router.post(\"/api/c\").handler(this::_create);\n router.get(\"/api/r/:id\").handler(this::_read);\n router.put(\"/api/u/:id\").handler(this::_update);\n router.delete(\"/api/d/:id\").handler(this::_delete);\n\n // Create the HTTP server and pass the \"accept\" method to the request handler.\n vertx.createHttpServer().requestHandler(router).listen(8888, next);\n }", "@Override\r\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\r\n\t\tregistry.addResourceHandler(\"/static/**\").addResourceLocations(\r\n\t\t\t\t\"/static/\");\r\n\t}", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/app/**\").addResourceLocations(\"classpath:/static/\");\n }", "@Override\r\n\tprotected void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\tregistry.addResourceHandler(\"/static/**\").addResourceLocations(\"classpath:/hh/\");\r\n\t\tsuper.addResourceHandlers(registry);\r\n\t}", "public serverHttpHandler( String rootDir ) {\n this.serverHome = rootDir;\n }", "private void addResponseHandlers() {\n\t\t\n\t\tif (responseHandlers == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tresponseHandlers.put(ResponseType.DELETE_FILE, new ResponseHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\tSystem.out.println(reader.readLine());\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tresponseHandlers.put(ResponseType.FILE_LIST, new ResponseHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\t\n\t\t\t\tString pwd = reader.readLine();\n\t\t\t\tSystem.out.println(\"Present Working Directory: \" + pwd);\n\t\t\t\t\n\t\t\t\tInteger numFiles = Integer.parseInt(reader.readLine());\n\t\t\t\tSystem.out.println(\"# Files/Folders: \" + numFiles + \"\\n\");\n\t\t\t\t\n\t\t\t\tif (numFiles == -1) {\n\t\t\t\t\tSystem.out.println(\"End of stream reached\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor (int i=0; i<numFiles; i++) {\n\t\t\t\t\tSystem.out.println(\"\\t\" + reader.readLine());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\nAll contents listed.\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tresponseHandlers.put(ResponseType.FILE_TRANSFER, new ResponseHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\t\n\t\t\t\tString fileName = reader.readLine();\n\t\t\t\tif (checkForErrors(fileName)) {\n\t\t\t\t\tSystem.out.println(fileName);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tInteger fileSize = Integer.parseInt(reader.readLine());\n\t\t\t\tif (fileSize < 0) {\n\t\t\t\t\tSystem.err.println(\"Invalid file size: \" + fileSize);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbyte[] data = new byte[fileSize];\n\t\t\t\tint numRead = socket.getInputStream().read(data, 0, fileSize);\n\t\t\t\tif (numRead == -1) {\n\t\t\t\t\tSystem.out.println(\"End of stream reached.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tFile folder = new File(pwd);\n\t\t\t\tif (!folder.exists() && !folder.mkdir()) {\n\t\t\t\t\tSystem.err.println(\"Failed to create directory: \" + pwd);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Warning: If the file exists it will be overwritten.\");\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\tFile file = new File(pwd + fileName);\n\t\t\t\t\tfile.createNewFile();\n\t\t\t\t\t\n\t\t\t\t\tFileOutputStream fileOutputStream = new FileOutputStream(file);\n\t\t\t fileOutputStream.write(data);\n\t\t\t fileOutputStream.close();\n\t\t\t \n\t\t\t\t} catch (SecurityException | IOException e) {\n\t\t\t\t\tSystem.err.println(e.getLocalizedMessage());\n\t\t\t\t\tSystem.err.println(\"Failed to create file: \" + fileName + \" at pathname: \" + pwd);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t \t\t\n\t\t System.out.println(\"File successfully transferred.\");\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tresponseHandlers.put(ResponseType.EXIT, new ResponseHandler() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\t\n\t\t\t\tString response = reader.readLine();\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t});\n\t}", "@Override\r\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\r\n registry.addResourceHandler(\"/resources/**\").addResourceLocations(\"/resources/\");\r\n// registry.addResourceHandler(\"/static/**\").addResourceLocations(\"/static/\").setCachePeriod(31556926);\r\n }", "@Override\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\t//exposes photos in the user-photo directory\n\t\t\n\t\tString dirName = \"user-photos\";\n\t\t//directory path\n\t\tPath userPhotosDir = Paths.get(dirName);\n\t\t\n\t\t//get absolute path\n\t\tString userPhotosPath = userPhotosDir.toFile().getAbsolutePath();\n\t\t\n\t\tregistry.addResourceHandler(\"/\" + dirName + \"/**\")\n\t\t.addResourceLocations(\"file:/\" + userPhotosPath + \"/\");\n\t\t\n\t\t//exposes images in category-image directory\n\t\tString categoryImagesDirName = \"../category-images\";\n\t\t//directory path\n\t\tPath categoryImagesDir = Paths.get(categoryImagesDirName);\n\t\t\n\t\t//get absolute path\n\t\tString categoryImagesPath = categoryImagesDir.toFile().getAbsolutePath();\n\t\t\n\t\tregistry.addResourceHandler(\"/category-images/**\")\n\t\t.addResourceLocations(\"file:/\" + categoryImagesPath + \"/\");\n\t}", "@Override\n public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n String requestUri = req.getRequestURI();\n\n if (requestUri.startsWith(req.getContextPath())) {\n requestUri = requestUri.substring(req.getContextPath().length());\n }\n\n if (requestUri.equals(\"/\")) {\n requestUri = \"/index.html\";\n }\n\n String baseFilename = String.join(\"\", getPrefix(), requestUri);\n\n // This is the filename that AWS Lambda would use\n String lambdaFilename = baseFilename.replaceFirst(\"/+\", \"\");\n\n // This is the filename that a local debug environment would use\n String localFilename = baseFilename.replaceFirst(\"//\", \"/\");\n\n // Always try to get the AWS Lambda file first since performance counts the most there\n Option<InputStream> inputStreamOption = Option.of(getClass().getClassLoader().getResourceAsStream(lambdaFilename));\n\n if (inputStreamOption.isEmpty()) {\n // Didn't find the AWS Lambda file, maybe we are debugging locally\n inputStreamOption = Option.of(getServletContext().getResource(localFilename))\n .map(url -> Try.of(url::openStream).getOrNull());\n }\n\n if (inputStreamOption.isEmpty()) {\n // Didn't find the file in either place\n resp.setStatus(404);\n return;\n }\n\n InputStream inputStream = inputStreamOption.get();\n\n Optional<String> optionalMimeType = Optional.empty();\n\n if (requestUri.endsWith(\".js\")) {\n // For some reason the \"*.nocache.js\" file gets picked up by Tika as \"text/x-matlab\"\n optionalMimeType = Optional.of(\"application/javascript\");\n } else if (requestUri.endsWith(\".html\")) {\n optionalMimeType = Optional.of(\"text/html\");\n } else if (requestUri.endsWith(\".png\")) {\n optionalMimeType = Optional.of(\"image/png\");\n } else if (requestUri.endsWith(\".jpg\")) {\n optionalMimeType = Optional.of(\"image/jpeg\");\n } else if (requestUri.endsWith(\".css\")) {\n optionalMimeType = Optional.of(\"text/css\");\n } else {\n Optional<MimeHelper> optionalMimeHelper = getOptionalMimeHelper();\n\n if (optionalMimeHelper.isPresent()) {\n // No MIME type detected, use the optional MIME helper\n optionalMimeType = Optional.of(optionalMimeHelper.get().detect(requestUri, inputStream));\n }\n }\n\n // Only set the MIME type if we found it\n optionalMimeType.ifPresent(resp::setContentType);\n\n resp.setStatus(200);\n\n // Throw an exception if the stream copy fails\n Try.run(() -> copyStream(inputStream, resp.getOutputStream())).get();\n }", "public NettyHttpFileHandler() {\r\n synchronized(_lock) {\r\n if (mimeTypesMap == null) {\r\n InputStream is = this.getClass().getResourceAsStream(\"/server.mime.types\");\r\n if (is != null) {\r\n mimeTypesMap = new MimetypesFileTypeMap(is);\r\n } else {\r\n \tlogger.debug(\"Cannot load mime types!\");\r\n }\r\n }\r\n }\r\n }", "public void handleStaticResources(String handler, HttpServletResponse response) {\n String fileName = null;\n if (handler.equals(\"status\")) {\n response.setContentType(\"text/html\");\n fileName = \"overview.html\";\n } else if (handler.equals(\"detail\")) {\n response.setContentType(\"text/html\");\n fileName = \"detail.html\";\n } else if (handler.equals(\"base.css\")) {\n response.setContentType(\"text/css\");\n fileName = \"base.css\";\n } else if (handler.equals(\"jquery.js\")) {\n response.setContentType(\"text/javascript\");\n fileName = \"jquery-1.4.2.min.js\";\n } else if (handler.equals(\"status.js\")) {\n response.setContentType(\"text/javascript\");\n fileName = \"status.js\";\n } else {\n try {\n response.sendError(404);\n } catch (IOException e) {\n throw new RuntimeException(\"Encountered error sending 404\", e);\n }\n return;\n }\n \n response.setHeader(\"Cache-Control\", \"public; max-age=300\");\n \n try {\n InputStream resourceStream = MapReduceServlet.class.getResourceAsStream(\n \"/com/google/appengine/tools/mapreduce/\" + fileName);\n OutputStream responseStream = response.getOutputStream();\n byte[] buffer = new byte[1024];\n int bytesRead;\n while ((bytesRead = resourceStream.read(buffer)) != -1) {\n responseStream.write(buffer, 0, bytesRead);\n }\n responseStream.flush();\n } catch (FileNotFoundException e) {\n throw new RuntimeException(\"Couldn't find static file for MapReduce library\", e);\n } catch (IOException e) {\n throw new RuntimeException(\"Couldn't read static file for MapReduce library\", e);\n }\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/static/**\").addResourceLocations(\"/static/\");\n registry.addResourceHandler(\"/resources/**\").addResourceLocations(\"/resources/\");\n // swagger\n// registry.addResourceHandler(\"swagger-ui.html\").addResourceLocations(\"classpath:/META-INF/resources/\");\n// registry.addResourceHandler(\"/webjars/**\").addResourceLocations(\"classpath:/META-INF/resources/webjars/\");\n \n }", "@Override\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\n\t\tregistry.addResourceHandler(\"/photos/**\").addResourceLocations(\"file:///c:/dev/study/temp2/\")\n\t\t\t\t.setCacheControl(CacheControl.noCache());\n\t\t// .setCacheControl(CacheControl.masAge(Duration.ofDays(1));\n\t\tregistry.addResourceHandler(\"/swagger-ui/**\")\n\t\t.addResourceLocations(\"classpath:/META-INF/resources/webjars/springfox-swagger-ui/\")\n\t\t.resourceChain(false);\n\t}", "private void startServlets(){\n\t\ttry{\n\t\t\tserver = new Server();\n\t\t\tServerConnector c = new ServerConnector(server);\n\t\t\tc.setIdleTimeout(15000);\n\t\t\tc.setAcceptQueueSize(256);\n\t\t\tc.setPort(port);\n\t\t\tif(!bind.equals(\"*\")){\n\t\t\t\tc.setHost(bind);\n\t\t\t}\n\n\t\t\tServletContextHandler handler = new ServletContextHandler(server,\"/\", true, false);\n\t\t\tServletHolder servletHolder = new ServletHolder(StatusServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/status/*\");\n\n\t\t\tservletHolder = new ServletHolder(SampleAPIServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/sample/*\");\n\n\t\t\tservletHolder = new ServletHolder(FileServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/*\");\n\t\t\tFileServlet.sourceFolder=\"./site\";\t\t\t\n\n\t\t\tserver.addConnector(c);\n\t\t\tserver.start();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void configureDefaultServletHandling(\n DefaultServletHandlerConfigurer configurer) {\n\n // DispatcherServlet forwards requests for static resources\n // to the servlet's default servlet and\n // not try to handle them itself\n configurer.enable();\n }", "void whenServeFile(String fileName, HttpServletRequest request);", "@Override protected void configureServlets() {\n serveRegex(\"^/(?!_ah).*\").with(HandlerServlet.class);\n // serves xmpp urls\n serveRegex(\"/_ah/xmpp/.*\").with(HandlerServlet.class);\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/resources/**\")\n .addResourceLocations(\"/resources/\");\n }", "@Override\n public void addResourceHandlers(final ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/resources/**\").addResourceLocations(\"/resources/\").setCachePeriod(31556926);\n }", "private native void setDefaultRealmFileDirectory(String fileDir, AssetManager assets);", "@Override\n protected void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"swagger-ui.html\")\n .addResourceLocations(\"classpath:/META-INF/resources/\");\n \n registry.addResourceHandler(\"/webjars/**\")\n .addResourceLocations(\"classpath:/META-INF/resources/webjars/\");\n }", "public void filesLocation (String externalFolder) {\n externalStaticFileFolder = externalFolder;\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/resources/**\").addResourceLocations(\"/resources/\");\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry){\n// registry.addResourceHandler(\"/jsp/**\").addResourceLocations(\"classpath:/static/jsp/\");\n registry.addResourceHandler(\"/jsp/**\").addResourceLocations(\"classpath:/static/jsp/\");\n registry.addResourceHandler(\"/**.html\").addResourceLocations(\"classpath:/templates/\");\n registry.addResourceHandler(\"/js/**\").addResourceLocations(\"classpath:/static/js/\");\n// registry.addResourceHandler(\"*.jpg\").addResourceLocations(\"classpath:/static/img\");\n\n }", "public static void main(String[] args) {\n staticFiles.location(\"/public\"); // Static files\n get(\"/hello\", (req, res) -> \"Hello World\");\n System.out.println(\"http://localhost:4567/hello\");\n }", "@Override\r\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\tregistry.addResourceHandler(\"/resources/**\")\r\n\t\t\t\t.addResourceLocations(\"/resources/\");\r\n\t}", "private void startServer(String ip, int port, String contentFolder) throws IOException{\n HttpServer server = HttpServer.create(new InetSocketAddress(ip, port), 0);\n \n //Making / the root directory of the webserver\n server.createContext(\"/\", new Handler(contentFolder));\n //Making /log a dynamic page that uses LogHandler\n server.createContext(\"/log\", new LogHandler());\n //Making /online a dynamic page that uses OnlineUsersHandler\n server.createContext(\"/online\", new OnlineUsersHandler());\n server.setExecutor(null);\n server.start();\n \n //Needing loggin info here!\n }", "@Override\n public void handle(HttpExchange exchange) throws IOException {\n boolean wasSuccessful = false;\n try {\n // Only allow POST requests for this operation.\n // This operation requires a POST request, because the\n // client is \"posting\" information to the server for processing.\n if (exchange.getRequestMethod().toLowerCase().equals(\"get\")) {\n\n //String containing the url desired\n String URLrequested = exchange.getRequestURI().toString();\n\n //Checks to see if it is just the open URL as ex: localhost:8080, this is mapped to index.html, this is the case for nothing added.\n if (URLrequested.length() == 1){\n\n\n String location = \"web/index.html\";\n Path path = FileSystems.getDefault().getPath(location);\n\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0);\n\n Files.copy(path, exchange.getResponseBody());\n\n exchange.getResponseBody().close();\n\n } else if (URLrequested.equals(\"/\")) {\n\n //\n String location = \"web\" + URLrequested;\n\n //Obtain the file path, this is the same method used for the name and locations data draw\n Path filePath = FileSystems.getDefault().getPath(location);\n\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0);\n\n //Copies Files into the exchange's responsive body header\n Files.copy(filePath, exchange.getResponseBody());\n\n exchange.getResponseBody().close();\n\n }\n else if(URLrequested.equals(\"/css/main.css\")){\n String location = \"web/css/main.css\";\n //Obtain the file path, this is the same method used for the name and locations data draw\n Path filePath = FileSystems.getDefault().getPath(location);\n\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0);\n\n //Copies Files into the response body\n Files.copy(filePath, exchange.getResponseBody());\n\n exchange.getResponseBody().close();\n\n }\n else{\n String location = \"web/HTML/404.html\";\n\n //Obtain the file path, this is the same method used for the name and locations data draw\n Path filePath = FileSystems.getDefault().getPath(location);\n\n //Response header needs to come first.\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_NOT_FOUND, 0);\n\n //Copies Files into the response body\n Files.copy(filePath, exchange.getResponseBody());\n\n\n //Completes the exchange\n exchange.getResponseBody().close();\n }\n wasSuccessful = true;\n\n\n }\n\n if (!wasSuccessful) {\n //Bad Server Response\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_BAD_REQUEST, 0);\n\n //Completes the exchange\n exchange.getResponseBody().close();\n }\n }\n catch (IOException e) {\n //Bad Server Response\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_SERVER_ERROR, 0);\n //Completes the exchange\n exchange.getResponseBody().close();\n e.printStackTrace();\n }\n }", "private void serve() {\n\t\tif (request == null) {\n\t\t\tchannel.close();\n\t\t\treturn;\n\t\t}\n\t\tlogger.fine(\"Serving \" + type + \" request : \" + request.getPath());\n\t\tResponse resp = RequestHandler.handle(request);\n\t\tif (resp.getRespCode() == ResponseCode.NOT_FOUND) {\n\t\t\terror404(resp);\n\t\t\treturn;\n\t\t}\n\n\t\tStringBuilder header = new StringBuilder();\n\t\tif (type == Type.HTTP) {\n\t\t\theader.append(\"HTTP/1.0 200 OK\\r\\n\");\n\t\t\theader.append(\"Content-Length: \")\n\t\t\t\t\t.append(resp.getFileData().remaining()).append(\"\\r\\n\");\n\t\t\theader.append(\"Connection: close\\r\\n\");\n\t\t\theader.append(\"Server: Hyperion/1.0\\r\\n\");\n\t\t\theader.append(\"Content-Type: \" + resp.getMimeType() + \"\\r\\n\");\n\t\t\theader.append(\"\\r\\n\");\n\t\t}\n\t\tbyte[] headerBytes = header.toString().getBytes();\n\n\t\tByteBuffer bb = resp.getFileData();\n\t\tChannelBuffer ib = ChannelBuffers.buffer(bb.remaining()\n\t\t\t\t+ headerBytes.length);\n\t\tib.writeBytes(headerBytes);\n\t\tib.writeBytes(bb);\n\t\tchannel.write(ib).addListener(ChannelFutureListener.CLOSE);\n\t}", "@Override\n public void start() throws LifecycleException {\n logger.info(\"Start http server ... \");\n\n\n try {\n // create a resource config that scans for JAX-RS resources and providers\n final ResourceConfig rc = new ResourceConfig()\n .packages(PACKAGES_SCAN) // packages path for resources loading\n .property(MvcFeature.TEMPLATE_BASE_PATH, FREEMARKER_BASE) // config freemarker view files's base path\n .register(LoggingFeature.class)\n .register(FreemarkerMvcFeature.class)\n .register(JettisonFeature.class)\n .packages(\"org.glassfish.jersey.examples.multipart\")\n .register(MultiPartFeature.class)\n .registerInstances(new ApplicationBinder()); //\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n httpServer = GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n\n // Set StaticHttpHandler to handle http server's static resources\n String htmlPath = this.getClass().getResource(HTML_BASE).getPath(); // TODO, 部署后要根据实际目录修正!classes 同级目录下的 html 目录\n HttpHandler handler = new StaticHttpHandler(htmlPath);\n httpServer.getServerConfiguration().addHttpHandler(handler, \"/\");\n\n logger.info(\"Jersey app started with WADL available at {} application.wadl\\n \", BASE_URI);\n } catch (Exception e) {\n throw new LifecycleException(e); // just convert to self defined exception\n }\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/js/**\", \"/img/**\", \"/fonts/**\", \"/css/**\", \"/**\")\n // where the resource file is\n .addResourceLocations(\"/js/\", \"/img/\", \"/fonts/\", \"/css/\", \"/\")\n// .setCachePeriod(31556926);\n .setCachePeriod(30);\n }", "@Override\n public Iterable<File> list(File storageDirectory) {\n\treturn null;\n }", "public void doFiles(){\r\n serversDir = new File(rootDirPath+\"/servers/\");\r\n serverList = new File(rootDirPath+\"serverList.txt\");\r\n if(!serversDir.exists()){ //if server Directory doesn't exist\r\n serversDir.mkdirs(); //create it\r\n }\r\n updateServerList();\r\n }", "@Override\n public void process(Path path, FileStorage storage) {\n }", "@Routes( { @Route( method = Method.ANY, path = \":?path=(.*)\", binding = BindingType.raw ) } )\n public void handle( final HttpServerRequest request )\n {\n ResponseUtils.setStatus( ApplicationStatus.OK, request );\n\n request.pause();\n String path = request.params()\n .get( PathParam.path.key() );\n\n if ( path != null && ( path.length() < 1 || path.equals( \"/\" ) ) )\n {\n path = null;\n }\n\n VertXWebdavRequest req = null;\n final VertXWebdavResponse response = new VertXWebdavResponse( request.response() );\n\n try\n {\n String contextPath = masterRouter.getPrefix();\n if ( contextPath == null )\n {\n contextPath = \"\";\n }\n\n req = new VertXWebdavRequest( request, contextPath, \"/mavdav\", path, null );\n\n service.service( req, response );\n\n }\n catch ( WebdavException | IOException e )\n {\n logger.error( String.format( \"Failed to service mavdav request: %s\", e.getMessage() ), e );\n formatResponse( e, request );\n }\n finally\n {\n IOUtils.closeQuietly( req );\n IOUtils.closeQuietly( response );\n\n try\n {\n request.response()\n .end();\n }\n catch ( final IllegalStateException e )\n {\n }\n }\n }", "@Override\n public void handleRequest(HttpServerExchange exchange) throws Exception {\n if (exchange.isInIoThread()) {\n exchange.dispatch(this);\n return;\n }\n\n // We check if the engine was initially loaded or at least tried to be loaded\n if (currentEngine.get() == null) {\n Optional<ScriptRunner> optRunner = loadAndSetScriptRunner();\n if (Boolean.parseBoolean(refresh)) {\n optRunner.ifPresent(runner -> {\n reloadOnChange(runner.getFile());\n });\n }\n }\n\n Optional<ScriptRunner> runner = currentEngine.get();\n if (runner.isPresent()) {\n try {\n Invocable invocable = (Invocable) runner.get().getEngine();\n JSFilterData data = new JSFilterData(exchange, next, runner.get().getScriptLogger());\n invocable.invokeFunction(\"handleRequest\", data);\n } catch (ScriptException | NoSuchMethodException invocationException) {\n LOGGER.warning(\"undertow-jsfilters: failure calling method '\" + \"handleRequest\" + \"' in file => \" + this.fileName);\n LOGGER.throwing(fileName, \"handleRequest\", invocationException);\n next.handleRequest(exchange);\n return;\n }\n } else {\n next.handleRequest(exchange);\n return;\n }\n }", "@Override\n\tpublic void preServe() {\n\n\t}", "public static Handler<RoutingContext> serve(String spaDir, int port) {\n return serve(spaDir, port, \"npm\", \"start\", \"--\");\n }", "@Override\n public void fileNotFound(String path, Throwable cause) {\n headers.put(CONTENT_TYPE, MediaType.getType(\".html\"));\n send404NotFound(ctx, headers, \"404 NOT FOUND\".getBytes(), true);\n }", "@Override\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\t// add a cache period of one week to static resources returned by Tomcat\n\t\tregistry.addResourceHandler(\"/resources/**\")\n\t\t\t\t.addResourceLocations(\"/resources/\")\n\t\t\t\t.setCachePeriod( 604800 ); // one week in seconds\n\t}", "@Override\n public void addDefaultRoutes() {\n super.addDefaultRoutes();\n addRoute( \"/user\", UserResponder.class );\n addRoute( \"/user/:id\", UserResponder.class );\n addRoute( \"/user/help\", GeneralResponder.class );\n addRoute( \"/general/:param1/:param2\", GeneralResponder.class );\n addRoute( \"/photos/:customer_id/:photo_id\", null );\n addRoute( \"/test\", String.class );\n addRoute( \"/interface\", Responder.class ); // this will cause an error\n addRoute( \"/toBeDeleted\", String.class );\n removeRoute( \"/toBeDeleted\" );\n addRoute( \"/stream\", StreamUrl.class );\n addRoute( \"/browse/(.)+\", StaticPageTestResponder.class, new File( \"src/test/resources\" ).getAbsoluteFile() );\n }", "@Override\n public Iterable<File> list(File storageDirectory, FilenameFilter filter) {\n\treturn null;\n }", "@ExceptionHandler(StorageFileNotFoundException.class)\n public ResponseEntity<?> handleStorageFileNotFound(StorageFileNotFoundException exc) {\n return ResponseEntity.notFound().build();\n }", "@Override\n public void parseEmbedded(InputStream stream, ContentHandler handler, Metadata metadata, boolean outputHtml)\n throws SAXException, IOException {\n String name = metadata.get(Metadata.RESOURCE_NAME_KEY);\n\n if (name == null) {\n name = \"file_\" + fileCount++;\n } else {\n //make sure to select only the file name (not any directory paths\n //that might be included in the name) and make sure\n //to normalize the name\n name = FilenameUtils.normalize(FilenameUtils.getName(name));\n }\n\n //now try to figure out the right extension for the embedded file\n MediaType contentType = detector.detect(stream, metadata);\n\n if (name.indexOf('.') == -1 && contentType != null) {\n try {\n name += config.getMimeRepository().forName(\n contentType.toString()).getExtension();\n } catch (MimeTypeException e) {\n e.printStackTrace();\n }\n }\n //should add check to make sure that you aren't overwriting a file\n Path outputFile = outputDir.resolve(name);\n //do a better job than this of checking\n java.nio.file.Files.createDirectories(outputFile.getParent());\n java.nio.file.Files.copy(stream, outputFile, StandardCopyOption.REPLACE_EXISTING);\n\n //上传图片,返回Url,并建立一个映射表\n Calendar calendar = Calendar.getInstance();\n SimpleDateFormat DateFormat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n String dateStr = DateFormat.format(calendar.getTime());\n\n String key = dateStr+\"_\"+UUID.randomUUID().toString()+\"_\"+name;\n String qiniuurl = \"\";\n try {\n File file = new File(outputFile.toString());\n InputStream in = new FileInputStream(file);\n byte b[]=new byte[(int)file.length()];\n in.read(b);\n in.close();\n qiniuurl = fu.fileUpload(uploadManager, b, key, null, contentType.toString());\n imgPathMap.put(name,qiniuurl);\n logger.info(\"=====图片url:\"+qiniuurl);\n }catch (Exception e){\n e.printStackTrace();\n }\n }", "public StorageServer(File root)\n {\n this(root, 0, 0);\n }", "@Override\n\tpublic void handle() {\n\t\tPath p = Paths.get(pathName);\n\t\tFile file = null;\n\t\tString path = null;\n\n\t\tif (p.isAbsolute()) {\n\t\t\tpath = pathName;\n\t\t\tfile = new File(path);\n\t\t} else {\n\t\t\tpath = clientFtp.getCurrentDirectory() + \"/\" + pathName;\n\t\t\tfile = new File(path);\n\t\t}\n\t\t// Check if the client doesn't try to create a directory outside the root\n\t\t// directory\n\t\tif (path.contains(ServerFtp.home)) {\n\t\t\tif (file.exists()) {\n\t\t\t\tclientFtp.sendMessage(String.format(Response.MKD_NOK_EXIST, path));\n\t\t\t} else {\n\t\t\t\t// Creating the directory\n\t\t\t\tboolean bool = file.mkdir();\n\t\t\t\tif (bool) {\n\t\t\t\t\tclientFtp.sendMessage(String.format(Response.MKD_OK, path));\n\t\t\t\t} else {\n\t\t\t\t\tclientFtp.sendMessage(Response.FILE_NOT_FOUND);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tclientFtp.sendMessage(Response.FILE_NOT_FOUND);\n\t\t}\n\t}", "public void addResourceHandlers(ResourceHandlerRegistry registry){\n\t\tregistry.addResourceHandler(\"/resources/**\").addResourceLocations(\"/WEB-INF/resources/\");\n\t}", "public void handle(HttpExchange t) throws IOException {\n os = t.getResponseBody();\n urlString = t.getRequestURI().toString();\n this.url =t.getRequestURI().toString().split(\"/\"); //getRequestURI for URL and split\n\n System.out.println(\"Base URI Received: \"+t.getRequestURI().toString());\n\n if(urlString.contains(\".\")) {\n Helper.returnRequestedFile(t, urlString, os);\n } else {\n if(url.length == 0 || url[url.length-1].equals(\"index.html\")) {\n //Returns index.html\n basePage = new File(\"src/StockMarketServer/client/index/index.html\"); //Write index.html to file\n t.getResponseHeaders().add(\"Content-type\", \"text/html\");\n t.sendResponseHeaders(200, basePage.length()); //Return okay code and length of file\n Files.copy(Paths.get(basePage.getAbsolutePath()), os); //Write index.html to response\n os = t.getResponseBody();\n }\n else {\n //Returns pageNotFound.html\n basePage = new File(\"src/StockMarketServer/client/pageNotFound/pageNotFound.html\"); //Write index.html to file\n t.sendResponseHeaders(404, basePage.length()); //Return okay code and length of file\n Files.copy(Paths.get(basePage.getAbsolutePath()), os); //Write index.html to response\n os = t.getResponseBody();\n }\n }\n os.close();\n }", "protected void doFile(HttpServletRequest request, HttpServletResponse response, String path, String mimeType, boolean dynamic) throws IOException\n {\n if (!dynamic && isUpToDate(request, path))\n {\n response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);\n return;\n }\n \n String output;\n \n synchronized (scriptCache)\n {\n output = (String) scriptCache.get(path);\n if (output == null)\n {\n StringBuffer buffer = new StringBuffer();\n \n String resource = DwrConstants.PACKAGE + path;\n InputStream raw = getClass().getResourceAsStream(resource);\n if (raw == null)\n {\n throw new IOException(\"Failed to find resource: \" + resource); //$NON-NLS-1$\n }\n \n BufferedReader in = new BufferedReader(new InputStreamReader(raw));\n while (true)\n {\n String line = in.readLine();\n if (line == null)\n {\n break;\n }\n \n if (dynamic)\n {\n if (line.indexOf(PARAM_HTTP_SESSIONID) != -1)\n {\n line = LocalUtil.replace(line, PARAM_HTTP_SESSIONID, request.getSession(true).getId());\n }\n \n if (line.indexOf(PARAM_SCRIPT_SESSIONID) != -1)\n {\n line = LocalUtil.replace(line, PARAM_SCRIPT_SESSIONID, generator.generateId(pageIdLength));\n }\n }\n \n buffer.append(line);\n buffer.append('\\n');\n }\n \n output = buffer.toString();\n \n if (mimeType.equals(MimeConstants.MIME_JS) && scriptCompressed)\n {\n output = JavascriptUtil.compress(output, compressionLevel);\n }\n \n if (!dynamic)\n {\n scriptCache.put(path, output);\n }\n }\n }\n \n response.setContentType(mimeType);\n response.setDateHeader(HttpConstants.HEADER_LAST_MODIFIED, servletContainerStartTime);\n response.setHeader(HttpConstants.HEADER_ETAG, etag);\n \n PrintWriter out = response.getWriter();\n out.println(output);\n out.flush();\n }", "public IStatus prepareForServingDirectly(IPath baseDir, TomcatServer server, String tomcatVersion);", "private void loadBasePaths() {\n\n Log.d(TAG, \"****loadBasePaths*****\");\n List<FileInfo> paths = BaseMediaPaths.getInstance().getBasePaths();\n for (FileInfo path : paths) {\n\n }\n }", "private void loadExtensionResources() {\n\n for (String extensionType : ExtensionMgtUtils.getExtensionTypes()) {\n Path path = ExtensionMgtUtils.getExtensionPath(extensionType);\n if (log.isDebugEnabled()) {\n log.debug(\"Loading default templates from: \" + path);\n }\n\n // Check whether the given extension type directory exists.\n if (!Files.exists(path) || !Files.isDirectory(path)) {\n if (log.isDebugEnabled()) {\n log.debug(\"Default templates directory does not exist: \" + path);\n }\n continue;\n }\n\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addExtensionType(extensionType);\n\n // Load extensions from the given extension type directory.\n try (Stream<Path> directories = Files.list(path).filter(Files::isDirectory)) {\n directories.forEach(extensionDirectory -> {\n try {\n // Load extension info.\n ExtensionInfo extensionInfo = loadExtensionInfo(extensionDirectory);\n if (extensionInfo == null) {\n throw new ExtensionManagementException(\"Error while loading extension info from: \"\n + extensionDirectory);\n }\n extensionInfo.setType(extensionType);\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addExtension(extensionType,\n extensionInfo.getId(), extensionInfo);\n // Load templates.\n JSONObject template = loadTemplate(extensionDirectory);\n if (template != null) {\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addTemplate(extensionType,\n extensionInfo.getId(), template);\n }\n // Load metadata.\n JSONObject metadata = loadMetadata(extensionDirectory);\n if (metadata != null) {\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addMetadata(extensionType,\n extensionInfo.getId(), metadata);\n }\n } catch (ExtensionManagementException e) {\n log.error(\"Error while loading resource files in: \" + extensionDirectory, e);\n }\n });\n } catch (IOException e) {\n log.error(\"Error while loading resource files in: \" + path, e);\n }\n }\n }", "public StorageManager() {\n makeDirectory();\n }", "public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }", "private static void deployStaticHEResources(String targetDir, boolean bootstrappingEnabled) throws URISyntaxException, IOException{\r\n \t\r\n\t\tClassLoader loader = ServiceGenerator.class.getClassLoader();\r\n\t\tURI jniInterfaceFilePath = loader.getResource(Constants.HE_SERVICE_RESOURCES_FOLDER \r\n\t\t\t\t+ Constants.SERVICE_JNI_INTERFACE_FILE_NAME).toURI();\r\n\t\tURI jniInterfaceHeaderFilePath = loader.getResource(Constants.HE_SERVICE_RESOURCES_FOLDER \r\n\t\t\t\t+ Constants.SERVICE_JNI_INTERFACE_HEADER_FILE_NAME).toURI();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tFile origJniInterfaceFile = new File(jniInterfaceFilePath);\r\n\t\tFile newJniInterfaceFile = new File(targetDir + origJniInterfaceFile.getName());\r\n\t\t\r\n\t\tFile origJniInterfaceHeaderFile = new File(jniInterfaceHeaderFilePath);\r\n\t\tFile newJniInterfaceHeaderFile = new File(targetDir + origJniInterfaceHeaderFile.getName());\r\n\t\t\t\t\t\t\r\n\t\t \t\t\r\n\t\tUtils.deployStaticResource(origJniInterfaceFile, newJniInterfaceFile);\r\n\t\tUtils.deployStaticResource(origJniInterfaceHeaderFile, newJniInterfaceHeaderFile);\r\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n WebMvcConfigurer.super.addResourceHandlers(registry);\n registry.addResourceHandler(\"/resources/**\").addResourceLocations(\"WEB-INF/resources/\");\n }", "public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException\n {\n try\n {\n String pathInfo = request.getPathInfo();\n String servletPath = request.getServletPath();\n String contextPath = request.getContextPath();\n \n if (nullPathInfoWorkaround && pathInfo == null)\n {\n pathInfo = request.getServletPath();\n servletPath = PathConstants.PATH_ROOT;\n log.debug(\"Default servlet suspected. pathInfo=\" + pathInfo + \"; contextPath=\" + contextPath + \"; servletPath=\" + servletPath); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n }\n \n if (pathInfo == null ||\n pathInfo.length() == 0 ||\n pathInfo.equals(PathConstants.PATH_ROOT))\n {\n response.sendRedirect(contextPath + servletPath + PathConstants.FILE_INDEX);\n }\n else if (pathInfo.startsWith(PathConstants.FILE_INDEX))\n {\n String page = debugPageGenerator.generateIndexPage(contextPath + servletPath);\n \n response.setContentType(MimeConstants.MIME_HTML);\n PrintWriter out = response.getWriter();\n out.print(page);\n response.flushBuffer();\n }\n else if (pathInfo.startsWith(PathConstants.PATH_TEST))\n {\n String scriptName = pathInfo;\n scriptName = LocalUtil.replace(scriptName, PathConstants.PATH_TEST, \"\"); //$NON-NLS-1$\n scriptName = LocalUtil.replace(scriptName, PathConstants.PATH_ROOT, \"\"); //$NON-NLS-1$\n \n String page = debugPageGenerator.generateTestPage(contextPath + servletPath, scriptName);\n \n response.setContentType(MimeConstants.MIME_HTML);\n PrintWriter out = response.getWriter();\n out.print(page);\n response.flushBuffer();\n }\n else if (pathInfo.startsWith(PathConstants.PATH_INTERFACE))\n {\n String scriptName = pathInfo;\n scriptName = LocalUtil.replace(scriptName, PathConstants.PATH_INTERFACE, \"\"); //$NON-NLS-1$\n scriptName = LocalUtil.replace(scriptName, PathConstants.EXTENSION_JS, \"\"); //$NON-NLS-1$\n String path = contextPath + servletPath;\n \n String script = remoter.generateInterfaceScript(scriptName, path);\n \n // Officially we should use MimeConstants.MIME_JS, but if we cheat and\n // use MimeConstants.MIME_PLAIN then it will be easier to read in a\n // browser window, and will still work just fine.\n response.setContentType(MimeConstants.MIME_PLAIN);\n PrintWriter out = response.getWriter();\n out.print(script);\n response.flushBuffer();\n }\n else if (pathInfo.startsWith(PathConstants.PATH_PLAINJS))\n {\n Calls calls = plainJsMarshaller.marshallInbound(request, response);\n Replies replies = remoter.execute(calls);\n plainJsMarshaller.marshallOutbound(replies, request, response);\n }\n else if (pathInfo.startsWith(PathConstants.PATH_HTMLJS))\n {\n Calls calls = htmlJsMarshaller.marshallInbound(request, response);\n Replies replies = remoter.execute(calls);\n htmlJsMarshaller.marshallOutbound(replies, request, response);\n }\n else if (pathInfo.equalsIgnoreCase(PathConstants.FILE_ENGINE))\n {\n doFile(request, response, PathConstants.FILE_ENGINE, MimeConstants.MIME_JS, true);\n }\n else if (pathInfo.equalsIgnoreCase(PathConstants.FILE_UTIL))\n {\n doFile(request, response, PathConstants.FILE_UTIL, MimeConstants.MIME_JS, false);\n }\n else if (pathInfo.startsWith(PathConstants.PATH_STATUS))\n {\n Container container = WebContextFactory.get().getContainer();\n ScriptSessionManager manager = (ScriptSessionManager) container.getBean(ScriptSessionManager.class.getName());\n if (manager instanceof DefaultScriptSessionManager)\n {\n DefaultScriptSessionManager dssm = (DefaultScriptSessionManager) manager;\n dssm.debug();\n }\n }\n else\n {\n log.warn(\"Page not found (\" + pathInfo + \"). In debug/test mode try viewing /[WEB-APP]/dwr/\"); //$NON-NLS-1$ //$NON-NLS-2$\n response.sendError(HttpServletResponse.SC_NOT_FOUND);\n }\n }\n catch (Exception ex)\n {\n log.warn(\"Error: \" + ex); //$NON-NLS-1$\n if (ex instanceof SecurityException && log.isDebugEnabled())\n {\n log.debug(\"- User Agent: \" + request.getHeader(HttpConstants.HEADER_USER_AGENT)); //$NON-NLS-1$\n log.debug(\"- Remote IP: \" + request.getRemoteAddr()); //$NON-NLS-1$\n log.debug(\"- Request URL:\" + request.getRequestURL()); //$NON-NLS-1$\n log.debug(\"- Query: \" + request.getQueryString()); //$NON-NLS-1$\n log.debug(\"- Method: \" + request.getMethod()); //$NON-NLS-1$\n \n ex.printStackTrace();\n }\n \n response.setContentType(MimeConstants.MIME_HTML);\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\n PrintWriter out = response.getWriter();\n out.println(\"<html><head><title>Error</title</head><body>\"); //$NON-NLS-1$\n out.println(\"<p><b>Error</b>: \" + ex.getMessage() + \"</p>\"); //$NON-NLS-1$ //$NON-NLS-2$\n out.println(\"<p>For further information about DWR see:</p><ul>\"); //$NON-NLS-1$\n out.println(\"<li><a href='http://getahead.ltd.uk/dwr/documentation'>DWR Documentation</a></li>\"); //$NON-NLS-1$\n out.println(\"<li><a href='http://getahead.ltd.uk/dwr/support'>DWR Mailing List</a></li>\"); //$NON-NLS-1$\n out.println(\"</ul>\"); //$NON-NLS-1$\n out.println(\"<script type='text/javascript'>\"); //$NON-NLS-1$\n out.println(\"alert('\" + ex.getMessage() + \"');\"); //$NON-NLS-1$ //$NON-NLS-2$\n out.println(\"</script>\"); //$NON-NLS-1$\n out.println(\"</body></html>\"); //$NON-NLS-1$\n out.flush();\n }\n }", "@GetMapping(\"/files\")\n public ResponseEntity<List<FileInfo>> getListFiles() {\n List<FileInfo> fileInfos = storageService.loadAll().map(path -> {\n String filename = path.getFileName().toString();\n String url = MvcUriComponentsBuilder\n .fromMethodName(FilesController.class, \"getFile\", path.getFileName().toString()).build().toString();\n\n return new FileInfo(filename, url);\n }).collect(Collectors.toList());\n\n return ResponseEntity.status(HttpStatus.OK).body(fileInfos);\n }", "public void executelaunchDirectoryFiler() {\n \t\tif (conf.getProperty(\"rootDirectory\") == null)\n \t\t\tUtil.fatalError(\"You must provide a root directory for the filer with -r or --rootDirectory\");\n \t\tif (conf.getProperty(\"secret\") == null)\n \t\t\tUtil.fatalError(\"You must provide a shared secret to protect the server with -s or --secret\");\n \t\t\n \t\tfinal DirectoryFilerServer serv;\n \t\ttry {\n \t\t\tserv = new DirectoryFilerServer(conf.getProperty(\"rootDirectory\"),\n \t\t\t\tconf.getInteger(\"port\", 4263),\n \t\t\t\tconf.getProperty(\"secret\"));\n \t\t} catch (ClassNotFoundException e1) {\n \t\t\tUtil.fatalError(\"failed to load configuration\", e1);\n \t\t\treturn;\n \t\t}\n \t\t\n \t\tRuntime.getRuntime().addShutdownHook(new Thread(new Runnable(){\n \t\t\tpublic void run() {\n \t\t\t\tserv.close();\n \t\t\t}\n \t\t}));\n \t\t\n \t\tserv.launchServer();\n \t}", "protected void handleLs() {\r\n\t\tSystem.out.printf(\"Listing available files.%n\");\r\n\r\n\t\tFile[] availableFiles = new File(fileBase).listFiles();\r\n\r\n\t\tif (availableFiles == null) {\r\n\t\t\tSystem.err.printf(\"%s is not a directory.%n\", fileBase);\r\n\t\t\tsendMessage(String.valueOf(ERROR));\r\n\t\t} else {\r\n\t\t\tsendMessage(String.valueOf(availableFiles.length));\r\n\r\n\t\t\t/* send each file name */\r\n\t\t\tfor (File file : availableFiles) {\r\n\t\t\t\tsendMessage(file.getName());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public interface FilePostDownloadHandler {\n void onPostDownload();\n}", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n System.out.println(\"Adding answers...\");\n String assignmentKey = request.getParameter(\"assignment-key\");\n String questionKey = request.getParameter(\"question-key\");\n\n File folder = new File(\"images/answers\");\n File[] listOfFiles = folder.listFiles();\n\n for (File file : listOfFiles) {\n String path = \"images/answers/\" + file.getName();\n Database.addAnswer(path, parseAnswer(path), 0, assignmentKey, questionKey);\n }\n System.out.println(\"Done!\");\n response.setContentType(\"application/json;\");\n response.getWriter().println(\"\");\n }", "@Override\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\tWebMvcConfigurer.super.addResourceHandlers(registry);\n\t\tregistry.addResourceHandler(\"/resources/**\").addResourceLocations(\"/resources/\");\n\t}", "@Override\n public void scan() throws Exception {\n if (getContexts() == null) {\n throw new IllegalArgumentException(\"No HandlerContainer\");\n }\n\n Resource r = Resource.newResource(getWebAppDir());\n if (!r.exists()) {\n throw new IllegalArgumentException(\"No such webapps resource \" + r);\n }\n\n if (!r.isDirectory()) {\n throw new IllegalArgumentException(\"Not directory webapps resource \" + r);\n }\n\n String[] files = r.list();\n\n files:\n for (int f = 0; (files != null) && (f < files.length); f++) {\n String context = files[f];\n\n if (context.equalsIgnoreCase(\"CVS/\") || context.equalsIgnoreCase(\"CVS\") || context.startsWith(\".\")) {\n continue;\n }\n\n Resource app = r.addPath(r.encode(context));\n\n if (context.toLowerCase().endsWith(\".war\") || context.toLowerCase().endsWith(\".jar\")) {\n context = context.substring(0, context.length() - 4);\n Resource unpacked = r.addPath(context);\n\n if ((unpacked != null) && unpacked.exists() && unpacked.isDirectory()) {\n Log.debug(context + \" already exists.\");\n continue;\n }\n } else if (!app.isDirectory()) {\n Log.debug(app + \" Not directory\");\n continue;\n }\n\n if (context.equalsIgnoreCase(\"root\") || context.equalsIgnoreCase(\"root/\")) {\n context = URIUtil.SLASH;\n } else {\n context = \"/\" + context;\n }\n if (context.endsWith(\"/\") && (context.length() > 0)) {\n context = context.substring(0, context.length() - 1);\n }\n\n // Check the context path has not already been added or the webapp\n // itself is not already deployed\n if (!getAllowDuplicates()) {\n Handler[] installed = getContexts().getChildHandlersByClass(ContextHandler.class);\n for (int i = 0; i < installed.length; i++) {\n ContextHandler c = (ContextHandler) installed[i];\n\n if (context.equals(c.getContextPath())) {\n if (Log.isDebugEnabled()) {\n Log.debug(context + \" Context were equal; duplicate!\");\n }\n continue files;\n }\n\n String path;\n if (c instanceof WebAppContext) {\n path = Resource.newResource(((WebAppContext) c).getWar()).getFile().getAbsolutePath();\n } else {\n path = c.getBaseResource().getFile().getAbsolutePath();\n }\n\n if ((path != null) && path.equals(app.getFile().getAbsolutePath())) {\n if (Log.isDebugEnabled()) {\n Log.debug(path + \" Paths were equal; duplicate!\");\n }\n continue files;\n }\n\n }\n }\n\n // create a webapp\n WebAppContext wah = null;\n HandlerCollection contexts = getContexts();\n if ((contexts instanceof ContextHandlerCollection)\n && WebAppContext.class.isAssignableFrom(((ContextHandlerCollection) contexts).getContextClass())) {\n try {\n wah = (WebAppContext) ((ContextHandlerCollection) contexts).getContextClass().newInstance();\n } catch (Exception e) {\n throw new Error(e);\n }\n } else {\n wah = new WebAppContext();\n }\n\n // configure it\n wah.setContextPath(context);\n\n if (getConfigurationClasses() != null) {\n wah.setConfigurationClasses(getConfigurationClasses());\n }\n\n if (getDefaultsDescriptor() != null) {\n wah.setDefaultsDescriptor(getDefaultsDescriptor());\n }\n wah.setExtractWAR(isExtract());\n wah.setWar(app.toString());\n wah.setParentLoaderPriority(isParentLoaderPriority());\n\n Enumeration<?> names = _attributes.getAttributeNames();\n while (names.hasMoreElements()) {\n String name = (String) names.nextElement();\n wah.setAttribute(name, _attributes.getAttribute(name));\n }\n\n // add it\n Log.debug(\"AndroidWebAppDeployer: prepared \" + app.toString());\n contexts.addHandler(wah);\n _deployed.add(wah);\n //jetty-7.3.0 onwards need to start explicitly due to different startup time ordering\n wah.start();\n }\n }", "public void start() {\n \t\tinit();\n\t\tif(!checkBackend()){\n\t\t\tvertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() {\n\t\t\t\tpublic void handle(HttpServerRequest req) {\n\t\t\t\t String query_type = req.path();\t\t\n\t\t\t\t req.response().headers().set(\"Content-Type\", \"text/plain\");\n\t\t\t\t\n\t\t\t\t if(query_type.equals(\"/target\")){\n\t\t\t\t\t String key = req.params().get(\"targetID\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tprocessRequest(key,req);\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t else {\n\t\t\t\t\t String key = \"1\";\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tprocessRequestRange(key,req);\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t } \n\t\t\t}).listen(80);\n\t\t} else {\n\t\t\tSystem.out.println(\"Please make sure that both your DCI are up and running\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public void onNewDirLoaded(File dirFile);", "public static void sync() {\n\t\tUiApplication.getUiApplication().addFileSystemJournalListener(fileListener);\n\t\tnew Thread() {\n\t\t\tpublic void run() {\n\t\t\t\t// Find files sdcard\n\t\t\t\tif (ToolsBB.fsMounted(FILESYSTEM.SDCARD)) {\n\t\t\t\t\tlogger.debug(\"Finding files on sdcard\");\n\t\t\t\t\tfindFiles(sdcardDir);\n\t\t\t\t}\n\t\t\t\t// Find files on eMMC\n\t\t\t\tif (ToolsBB.fsMounted(FILESYSTEM.STORE)) {\n\t\t\t\t\tlogger.debug(\"Finding files on eMMC\");\n\t\t\t\t\tfindFiles(storeDir);\n\t\t\t\t}\n\n\t\t\t\t// Upload files to server\n\t\t\t\tFileLog.upload();\n\n\t\t\t}\n\t\t}.start();\n\t}", "public void run(){\n // first register the producer\n m_DirectoryQueue.registerProducer();\n\n enqueueFiles(f_Root);\n\n //lastly unregister the producer\n m_DirectoryQueue.unregisterProducer();\n }", "public FileHandlerImpl(){\n\t\tfilepath = null;\n\t}", "private void initializeHandler() {\n if (handler == null) {\n handler = AwsHelpers.initSpringBootHandler(Application.class);\n }\n }", "private void ingest(SnowflakeStreamingServiceConfig config)\n throws IngestResponseException, IOException, URISyntaxException {\n List<String> filesList = config.getFilesList();\n String stagingBucketDir = config.getStagingBucketDir();\n ingestManager = config.getIngestManager();\n\n Set<String> files =\n filesList.stream()\n .map(e -> e.replaceAll(String.valueOf(stagingBucketDir), \"\"))\n .map(e -> e.replaceAll(\"'\", \"\"))\n .collect(Collectors.toSet());\n\n if (!files.isEmpty()) {\n this.ingestManager.ingestFiles(SimpleIngestManager.wrapFilepaths(files), null);\n }\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n\n }", "@Override\n public void run() {\n\n\n try {\n WatchService watchService = FileSystems.getDefault().newWatchService();\n Path path = Paths.get(INPUT_FILES_DIRECTORY);\n\n path.register( watchService, StandardWatchEventKinds.ENTRY_CREATE); //just on create or add no modify?\n\n WatchKey key;\n while ((key = watchService.take()) != null) {\n for (WatchEvent<?> event : key.pollEvents()) {\n\n String fileName = event.context().toString();\n notifyController.processDetectedFile(fileName);\n\n }\n key.reset();\n }\n\n } catch (Exception e) {\n //Logger.getGlobal().setUseParentHandlers(false);\n //Logger.getGlobal().log(Level.SEVERE, e.toString(), e);\n\n }\n }", "public handleFileUpload() {\r\n\t\tsuper();\r\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_add_songs);\n\n Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n setSupportActionBar(toolbar);\n prefs = new PreferencesService(this);\n FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fabAddSongs);\n\n fab.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n APIService ServerAPI = new APIService();\n ServerAPI.mp3Upload(prefs.getDeviceID(), SongFile, new RequestHandler<Song>() {\n @Override\n public void callback(Song result) {\n }\n });\n Intent intent = new Intent(AddSongsActivity.this, MainActivity.class);\n finish();\n startActivity(intent);\n Toast.makeText(AddSongsActivity.this, \"Song Added!\", Toast.LENGTH_LONG).show();\n }\n });\n\n ActivityCompat.requestPermissions(AddSongsActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1);\n ActivityCompat.requestPermissions(AddSongsActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);\n\n if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {\n Toast.makeText(this, \"Error! No SDCARD Found!\", Toast.LENGTH_LONG).show();\n } else {\n fullPath = Environment.getExternalStorageDirectory().getAbsolutePath() + \"/JukeFit/\";\n boolean success = true;\n try {\n file = new File(fullPath);\n if (!file.exists())\n success = file.mkdirs();\n if (success) {\n System.out.println(\"Full Path: \" + fullPath);\n System.out.println(\"Success\");\n } else {\n System.out.println(\"Failure\");\n }\n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n if (file.listFiles() != null) {\n listFile = file.listFiles();\n int len = listFile.length;\n System.out.println(\"Length:\" + len);\n }\n }\n\n if (file.isDirectory() && file.listFiles() != null) {\n listFile = file.listFiles();\n FilePathStrings = new String[listFile.length];\n FileNameStrings = new String[listFile.length];\n\n for (int i = 0; i < listFile.length; i++) {\n System.out.println(\"List File Size: \" + listFile[i].length());\n if (listFile[i].length() != 0) {\n FilePathStrings[i] = listFile[i].getAbsolutePath();\n FileNameStrings[i] = listFile[i].getName();\n System.out.println(\"FilePathStrings: \" + FilePathStrings[i]);\n System.out.println(\"FileNameStrings: \" + FileNameStrings[i]);\n System.out.println(\"List File Size 2: \" + listFile[i].length());\n }\n }\n }\n if (FilePathStrings != null) {\n\n listview = (ListView) findViewById(R.id.SongListView);\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.songlistitem, R.id.SongName, FileNameStrings);\n listview.setAdapter(adapter);\n listview.setChoiceMode(ListView.CHOICE_MODE_SINGLE);\n }\n\n listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n\n @Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n CheckedTextView ctv = (CheckedTextView) view;\n SongFile = new File(listFile[position].getAbsolutePath());\n }\n });\n\n }", "public int handle(Request req, int handlerCode) throws IOException{\n if (fileCache == null) return Interceptor.CONTINUE;\n \n if (handlerCode == Interceptor.RESPONSE_PROCEEDED && fileCache.isEnabled()){\n String docroot = SelectorThread.getWebAppRootPath();\n MessageBytes mb = req.requestURI();\n String uri = req.requestURI().toString(); \n fileCache.add(FileCache.DEFAULT_SERVLET_NAME,docroot,uri,\n req.getResponse().getMimeHeaders(),false); \n } else if (handlerCode == Interceptor.REQUEST_LINE_PARSED) {\n ByteChunk requestURI = req.requestURI().getByteChunk(); \n if (fileCache.sendCache(requestURI.getBytes(), requestURI.getStart(),\n requestURI.getLength(), channel,\n keepAlive(req))){\n return Interceptor.BREAK; \n }\n } \n return Interceptor.CONTINUE;\n }", "List getFileUploads(HttpServletRequest request, File finalDir) throws ValidationException;", "public void startWatchingExternalStorage() {\n\t updateExternalStorageState(Environment.getExternalStorageState());\n\t\tmExternalStorageReceiver = new BroadcastReceiver() {\n\t\t\t@Override\n\t\t\tpublic void onReceive(Context context, Intent intent) {\n\t\t\t String action = intent.getAction();\n\t\t\t\tupdateExternalStorageState(action);\n\t\t synchronized (mObservers) {\n\t\t for (SdcardObserver observer : mObservers)\n\t\t observer.onSdcardChanged();\n\t\t }\n\t\t\t}\n\t\t};\n\t\tIntentFilter filter = new IntentFilter();\n\t\tfilter.addAction(Intent.ACTION_MEDIA_MOUNTED);\n\t\tfilter.addAction(Intent.ACTION_MEDIA_UNMOUNTED);\n\t\tfilter.addDataScheme(\"file\");\n\t\tmApplicationContext.registerReceiver(mExternalStorageReceiver, filter);\n\t}", "@Override\n public void handle(HttpExchange exchange) {\n \n try {\n String resource = exchange.getRequestURI().getPath();\n if (exchange.getRequestMethod().equals(\"HEAD\")){\n exchange.sendResponseHeaders(200, 0);\n return;\n }else if (resource.startsWith(\"/api/\")){\n api(resource, exchange);\n }else{\n if (redirect.containsKey(exchange.getRequestURI().getPath())) resource = redirect.get(exchange.getRequestURI().getPath());\n else resource = resource.substring(1);\n sendResource(resource, exchange);\n }\n System.out.println(exchange.getRequestMethod() + \":\" + exchange.getRequestURI().toString() + \", \" + resource);\n }catch(Exception e){\n System.out.println(exchange.getRequestMethod() + \":\" + exchange.getRequestURI().toString() + \", \" + e);\n e.printStackTrace();\n byte[] data = e.getMessage().getBytes(StandardCharsets.UTF_8);\n try {\n exchange.sendResponseHeaders(500, data.length);\n exchange.getResponseBody().write(data);\n exchange.getResponseBody().flush();\n }catch(Exception ignored){}\n }finally{\n exchange.close();\n }\n }", "@GET\r\n\t@Produces(MediaType.APPLICATION_OCTET_STREAM)\r\n\t@Path(\"assets/{filename}\")\r\n\tpublic Response staticResources(@PathParam(\"filename\") String filename) {\r\n\t\tSystem.out.println(\"Fichier : \" + filename);\r\n\t\t\r\n\t\tString assetsPath = \"./assets/\";\r\n\t\tFile fichier = new File(assetsPath + filename );\r\n\t\t\r\n\t\tif( !fichier.exists() ) {\r\n\t\t\treturn Response.status(404).build();\r\n\t\t}\r\n\t\treturn Response.ok(fichier, MediaType.APPLICATION_OCTET_STREAM)\r\n\t\t .header(\"Content-Disposition\", \"attachment; filename=\\\"\" + fichier.getName() + \"\\\"\")\r\n\t\t\t .build();\r\n\t}", "@Override\n\tpublic void setHandler(String defaultHandler, String handlerName) {\n\n\t}", "public void start()\n {\n FileVector = FileHandler.getFileList( harvesterDirName , filterArray, false );\n iter = FileVector.iterator();\n }", "public void setupLoggingEndpoint() {\n HttpHandler handler = (httpExchange) -> {\n httpExchange.getResponseHeaders().add(\"Content-Type\", \"text/html; charset=UTF-8\");\n httpExchange.sendResponseHeaders(200, serverLogsArray.toJSONString().length());\n OutputStream out = httpExchange.getResponseBody();\n out.write(serverLogsArray.toJSONString().getBytes());\n out.close();\n };\n this.endpointMap.put(this.loggingApiEndpoint, this.server.createContext(this.loggingApiEndpoint));\n this.setHandler(this.getLoggingApiEndpoint(), handler);\n System.out.println(\"Set handler for logging\");\n this.endpointVisitFrequency.put(this.getLoggingApiEndpoint(), 0);\n }", "public static void setUpExample(DatabaseClient client)\n throws IOException, ResourceNotFoundException, ForbiddenUserException, FailedRequestException {\n XMLDocumentManager docMgr = client.newXMLDocumentManager();\n\n InputStreamHandle contentHandle = new InputStreamHandle();\n\n for (String filename: filenames) {\n try ( InputStream docStream = Util.openStream(\"data\"+File.separator+filename) ) {\n if (docStream == null) throw new IOException(\"Could not read document example\");\n\n contentHandle.set(docStream);\n\n docMgr.write(\"/example/\"+filename, contentHandle);\n }\n }\n }", "public static void loadEndpoints(){\n\t\tStart.loadEndpoints();\n\t\t//add\t\t\n\t\t//e.g.: get(\"/my-endpoint\", (request, response) ->\t\tmyEndpointGet(request, response));\n\t\t//e.g.: post(\"/my-endpoint\", (request, response) ->\t\tmyEndpointPost(request, response));\n\t}", "@Override\n\tpublic void addResourceHandlers(final ResourceHandlerRegistry registry) {\n\n\t\tSystem.out.println(\"execution is reaching addResourceHandlers()\");\n\t\tsuper.addResourceHandlers(registry);\n\t\tregistry.addResourceHandler(\"/images/**\").addResourceLocations(\"/resources/images/\").setCachePeriod(0);\n\t\tregistry.addResourceHandler(\"/js/**\").addResourceLocations(\"/resources/js/\").setCachePeriod(0);\n\t\tregistry.addResourceHandler(\"/css/**\").addResourceLocations(\"/resources/css/\").setCachePeriod(0);\n\t\tregistry.addResourceHandler(\"/fonts/**\").addResourceLocations(\"/resources/fonts/\").setCachePeriod(0);\n\t\t// this is one year cache period 31556926\n\t}", "public EmbeddedADS(File workDir) {\n initDirectoryService(workDir);\n }", "@Override\n public boolean handle(LruCache<String, CachedHandler> cache,\n Http.Method method,\n ServerRequest request,\n ServerResponse response,\n String requestedResource) throws IOException {\n if (!Files.exists(path)) {\n cache.remove(requestedResource);\n return false;\n }\n\n if (LOGGER.isLoggable(System.Logger.Level.TRACE)) {\n LOGGER.log(System.Logger.Level.TRACE, \"Sending static content from jar: \" + requestedResource);\n }\n\n // etag etc.\n if (lastModified != null) {\n processEtag(String.valueOf(lastModified.toEpochMilli()), request.headers(), response.headers());\n processModifyHeaders(lastModified, request.headers(), response.headers(), setLastModifiedHeader());\n }\n\n response.headers().contentType(mediaType);\n\n if (method == Http.Method.GET) {\n send(request, response, path);\n } else {\n response.headers().contentLength(contentLength(path));\n response.send();\n }\n\n return true;\n }", "public void init() {\n\t\tfilePath = getServletContext().getInitParameter(\"file-upload\");\n\t\tcreateDirIfDoesntExist(filePath);\n\t\ttmpFilePath = getServletContext().getInitParameter(\"tmp-file-upload\");\n\t\tcreateDirIfDoesntExist(tmpFilePath);\n\t}", "public void importMedia(){\r\n \r\n }", "@Override\r\n\tpublic void handleRequest(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\n\t\tcheckRequest(request);\r\n\r\n\t\t// Check whether a matching resource exists\r\n\t\tResource resource = getResource(request);\r\n\t\tif (resource == null) {\r\n\t\t\tlogger.trace(\"No matching resource found - returning 404\");\r\n\t\t\tresponse.sendError(HttpServletResponse.SC_NOT_FOUND);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Check the resource's media type\r\n\t\tMediaType mediaType = getMediaType(resource);\r\n\t\tif (mediaType != null) {\r\n\t\t\tif (logger.isTraceEnabled()) {\r\n\t\t\t\tlogger.trace(\"Determined media type '\" + mediaType + \"' for \" + resource);\r\n\t\t\t}\r\n\r\n\t\t\tif (Objects.equal(mediaType, MediaType.TEXT_HTML)) {\r\n\t\t\t\tWebRender render = new WebRender(beetlConfig.getGroupTemplate());\r\n\t\t\t\tif (resource instanceof ServletContextResource) {\r\n\t\t\t\t\trender.render(((ServletContextResource) resource).getPath(), request, response);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tif (logger.isTraceEnabled()) {\r\n\t\t\t\tlogger.trace(\"No media type found for \" + resource + \" - not sending a content-type header\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Header phase\r\n\t\tif (new ServletWebRequest(request, response).checkNotModified(resource.lastModified())) {\r\n\t\t\tlogger.trace(\"Resource not modified - returning 304\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Apply cache settings, if any\r\n\t\tprepareResponse(response);\r\n\r\n\t\t// Content phase\r\n\t\tif (METHOD_HEAD.equals(request.getMethod())) {\r\n\t\t\tsetHeaders(response, resource, mediaType);\r\n\t\t\tlogger.trace(\"HEAD request - skipping content\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (request.getHeader(HttpHeaders.RANGE) == null) {\r\n\t\t\tsetHeaders(response, resource, mediaType);\r\n\t\t\twriteContent(response, resource);\r\n\t\t} else {\r\n\t\t\twritePartialContent(request, response, resource, mediaType);\r\n\t\t}\r\n\t}", "private void load() {\n if (loaded) {\n return;\n }\n loaded = true;\n\n if(useDefault){\n ConfigFileLoader.setSource(\n new MhttpdBaseConfigurationSource(\n Bootstrap.getMhttpdBaseFile(), \"server-embed.xml\"));\n }else {\n ConfigFileLoader.setSource(\n new MhttpdBaseConfigurationSource(\n Bootstrap.getMhttpdBaseFile(), getConfigFile()));\n }\n Digester digester = createStartDigester();\n try (ConfigurationSource.Resource resource = ConfigFileLoader.getSource().getServerXml()) {\n InputStream inputStream = resource.getInputStream();\n InputSource inputSource = new InputSource(resource.getUri().toURL().toString());\n inputSource.setByteStream(inputStream);\n digester.push(this);\n digester.parse(inputSource);\n } catch (Exception e) {\n return;\n }\n\n }", "protected void initChannel(SocketChannel ch) throws Exception {\n ch.pipeline().addLast(\"FileServerHandler\", new FileServerHandler(transferFile));\n }", "protected void registerServlets(ServletContextHandler handler) {\n\t}" ]
[ "0.64330083", "0.6174167", "0.60958654", "0.606634", "0.5772826", "0.57618666", "0.5569732", "0.54676145", "0.54608005", "0.54446834", "0.54042697", "0.5315863", "0.53011703", "0.524966", "0.52326405", "0.5220784", "0.5204956", "0.518663", "0.51685864", "0.5158789", "0.51438844", "0.51433146", "0.504069", "0.50272965", "0.50267744", "0.50252426", "0.49978116", "0.49959105", "0.49835792", "0.4918318", "0.49026668", "0.48865506", "0.48525807", "0.48490587", "0.4845216", "0.48419708", "0.48113152", "0.47972408", "0.47599497", "0.47411308", "0.47146082", "0.46851102", "0.4670329", "0.4651706", "0.4634884", "0.46269387", "0.46014038", "0.45993277", "0.45708984", "0.45325938", "0.45322508", "0.45218703", "0.45218438", "0.45177287", "0.44964337", "0.44898072", "0.44894454", "0.44820285", "0.4469812", "0.4465936", "0.44545808", "0.44530138", "0.44442922", "0.4437956", "0.44339278", "0.44279292", "0.44279042", "0.4416455", "0.43947607", "0.43853024", "0.43836382", "0.43812537", "0.43746975", "0.4367897", "0.43619156", "0.43614656", "0.43607795", "0.435516", "0.4353729", "0.4348719", "0.43485457", "0.43434554", "0.43306503", "0.4327896", "0.4321066", "0.4316812", "0.43161917", "0.43133503", "0.4312149", "0.4304071", "0.43026608", "0.43012327", "0.42981339", "0.42967212", "0.42966974", "0.42943853", "0.42888385", "0.42882952", "0.42882165", "0.42854518" ]
0.66382265
0
Configure the server to use a particular type of SSL certificate.
public void setSSLConfig(@ServerCertificate int serverCertificate) { try { synchronized (mImplMonitor) { checkServiceLocked(); mImpl.setSSLConfig(serverCertificate); } } catch (RemoteException e) { throw new EmbeddedTestServerFailure( "Failed to set server certificate: " + e.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@PostConstruct\n\t\tprivate void configureSSL() {\n\t\t\tSystem.setProperty(\"https.protocols\", \"TLSv1.2\");\n\n\t\t\t//load the 'javax.net.ssl.trustStore' and\n\t\t\t//'javax.net.ssl.trustStorePassword' from application.properties\n\t\t\tSystem.setProperty(\"javax.net.ssl.trustStore\", env.getProperty(\"server.ssl.trust-store\"));\n\t\t\tSystem.setProperty(\"javax.net.ssl.trustStorePassword\",env.getProperty(\"server.ssl.trust-store-password\"));\n\t\t}", "public void setSsl(SSLConfiguration ssl) {\n this.ssl = ssl;\n }", "private static void setupSSL() {\n\t\ttry {\n\t\t\tTrustManager[] trustAllCerts = createTrustAllCertsManager();\n\t\t\tSSLContext sslContext = SSLContext.getInstance(SSL_CONTEXT_PROTOCOL);\n\t\t\tSecureRandom random = new java.security.SecureRandom();\n\t\t\tsslContext.init(null, trustAllCerts, random);\n\t\t\tHttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tLOGGER.error(INVALID_PROTOCOL_ERROR_MESSAGE, e);\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t} catch (GeneralSecurityException e) {\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t}\n\n\t}", "@Override\n protected void createConnectionOptions(ClientOptions clientOptions) {\n if (clientOptions.getOption(ClientOptions.CON_SSL_TRUST_ALL).hasParsedValue()) {\n try {\n SSLContext ctx = SSLContext.getInstance(\"TLS\");\n ctx.init(new KeyManager[0], new TrustManager[]{new TrustingTrustManager()}, null);\n SSLContext.setDefault(ctx);\n } catch (NoSuchAlgorithmException | KeyManagementException e) {\n throw new RuntimeException(\"Could not set up the all-trusting TrustManager\", e);\n }\n }\n\n // Configure SSL options, which in case of activemq-client are set as Java properties\n // http://activemq.apache.org/how-do-i-use-ssl.html\n // https://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide.html#CustomizingStores\n\n if (clientOptions.getOption(ClientOptions.CON_SSL_KEYSTORE_LOC).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.keyStore\", relativize(clientOptions.getOption(ClientOptions.CON_SSL_KEYSTORE_LOC).getValue()));\n }\n if (clientOptions.getOption(ClientOptions.CON_SSL_KEYSTORE_PASS).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.keyStorePassword\", clientOptions.getOption(ClientOptions.CON_SSL_KEYSTORE_PASS).getValue());\n }\n// System.setProperty(\"javax.net.ssl.keyStorePassword\", \"secureexample\");\n if (clientOptions.getOption(ClientOptions.CON_SSL_TRUSTSTORE_LOC).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.trustStore\", relativize(clientOptions.getOption(ClientOptions.CON_SSL_TRUSTSTORE_LOC).getValue()));\n }\n if (clientOptions.getOption(ClientOptions.CON_SSL_TRUSTSTORE_PASS).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.trustStorePassword\", clientOptions.getOption(ClientOptions.CON_SSL_TRUSTSTORE_PASS).getValue());\n }\n if (clientOptions.getOption(ClientOptions.CON_SSL_STORE_TYPE).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.keyStoreType\", clientOptions.getOption(ClientOptions.CON_SSL_STORE_TYPE).getValue());\n System.setProperty(\"javax.net.ssl.trustStoreType\", clientOptions.getOption(ClientOptions.CON_SSL_STORE_TYPE).getValue());\n }\n\n super.createConnectionOptions(clientOptions);\n }", "public void setTlsCertPath(String tlsCertPath);", "public void setSsl(boolean ssl) {\n this.ssl = ssl;\n }", "public void setTlsCert(String tlsCert);", "public void setSslProtocol(String strUrl) throws Exception {\r\n \r\n URL url = new URL(strUrl);\r\n String host = url.getHost();\r\n int port = url.getPort();\r\n\r\n if (port <= 0) {\r\n port = SSL_PORT;\r\n }\r\n setSslHostPort(host, port);\r\n\r\n }", "public void setSSLConfiguration(String clientTruststore, String truststorePassword, boolean forConsumer) {\n\t\tProperties properties = forConsumer ? consumerProperties : producerProperties;\n\n\t\tproperties.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, \"SSL\");\n\t\tproperties.put(SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG, \"https\");\n\t\tproperties.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, clientTruststore);\n\t\tproperties.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, truststorePassword);\n\t}", "public interface SecurityConfigurator {\n\n /**\n * The provider to use for {@link SSLEngine}.\n */\n enum SslProvider {\n /**\n * Use the stock JDK implementation.\n */\n JDK,\n /**\n * Use the openssl implementation.\n */\n OPENSSL,\n /**\n * Auto detect which implementation to use.\n */\n AUTO\n }\n\n /**\n * Trusted certificates for verifying the remote endpoint's certificate. The input stream should\n * contain an {@code X.509} certificate chain in {@code PEM} format.\n *\n * @param trustCertChainSupplier a supplier for the certificate chain input stream.\n * <p>\n * The responsibility to call {@link InputStream#close()} is transferred to callers of the returned\n * {@link Supplier}. If this is not the desired behavior then wrap the {@link InputStream} and override\n * {@link InputStream#close()}.\n * @return {@code this}.\n */\n SecurityConfigurator trustManager(Supplier<InputStream> trustCertChainSupplier);\n\n /**\n * Trust manager for verifying the remote endpoint's certificate.\n * The {@link TrustManagerFactory} which take preference over any configured {@link Supplier}.\n *\n * @param trustManagerFactory the {@link TrustManagerFactory} to use.\n * @return {@code this}.\n */\n SecurityConfigurator trustManager(TrustManagerFactory trustManagerFactory);\n\n /**\n * The SSL protocols to enable, in the order of preference.\n *\n * @param protocols the protocols to use.\n * @return {@code this}.\n * @see SSLEngine#setEnabledProtocols(String[])\n */\n SecurityConfigurator protocols(String... protocols);\n\n /**\n * The cipher suites to enable, in the order of preference.\n *\n * @param ciphers the ciphers to use.\n * @return {@code this}.\n */\n SecurityConfigurator ciphers(Iterable<String> ciphers);\n\n /**\n * Set the size of the cache used for storing SSL session objects.\n *\n * @param sessionCacheSize the cache size.\n * @return {@code this}.\n */\n SecurityConfigurator sessionCacheSize(long sessionCacheSize);\n\n /**\n * Set the timeout for the cached SSL session objects, in seconds.\n *\n * @param sessionTimeout the session timeout.\n * @return {@code this}.\n */\n SecurityConfigurator sessionTimeout(long sessionTimeout);\n\n /**\n * Sets the {@link SslProvider} to use.\n *\n * @param provider the provider.\n * @return {@code this}.\n */\n SecurityConfigurator provider(SslProvider provider);\n}", "@Override\n public void setSSLParameters(SSLParameters sslP) {\n\n }", "public static final void registerTrustingSSLManager() {\n registerTrustingSSLManager(\"SSL\");\n }", "public boolean useSSL() {\n\t\treturn ssl;\n\t}", "private static void setAllowAllSSL(HttpsURLConnection httpsConn,\n KeyManager km) throws KeyManagementException, NoSuchAlgorithmException {\n TrustManager[] trustAllCerts = new TrustManager[] {\n new X509TrustManager() {\n @Override\n public java.security.cert.X509Certificate[] getAcceptedIssuers() {\n return new X509Certificate[]{};\n }\n\n @Override\n public void checkClientTrusted(\n java.security.cert.X509Certificate[] certs, String authType)\n throws CertificateException {\n }\n\n @Override\n public void checkServerTrusted(\n java.security.cert.X509Certificate[] certs, String authType)\n throws CertificateException {\n }\n }\n };\n KeyManager[] kms = (km == null) ? null : new KeyManager[]{km};\n SSLContext sc = SSLContext.getInstance(\"SSL\");\n sc.init(kms, trustAllCerts, new SecureRandom());\n httpsConn.setSSLSocketFactory(sc.getSocketFactory());\n // Don't check the hostname\n httpsConn.setHostnameVerifier(new NoopHostnameVerifier());\n }", "public void setSslProvider(String sslProvider) {\n this.sslProvider = sslProvider;\n }", "protected void init() throws Exception {\n if (this.sslConfiguration != null && this.sslConfiguration.enabled()) {\n if (this.sslConfiguration.certificatePath() != null && this.sslConfiguration.privateKeyPath() != null) {\n try (var cert = Files.newInputStream(this.sslConfiguration.certificatePath());\n var privateKey = Files.newInputStream(this.sslConfiguration.privateKeyPath())) {\n // begin building the new ssl context building based on the certificate and private key\n var builder = SslContextBuilder.forServer(cert, privateKey);\n\n // check if a trust certificate was given, if not just trusts all certificates\n if (this.sslConfiguration.trustCertificatePath() != null) {\n try (var stream = Files.newInputStream(this.sslConfiguration.trustCertificatePath())) {\n builder.trustManager(stream);\n }\n } else {\n builder.trustManager(InsecureTrustManagerFactory.INSTANCE);\n }\n\n // build the context\n this.sslContext = builder\n .clientAuth(this.sslConfiguration.clientAuth() ? ClientAuth.REQUIRE : ClientAuth.OPTIONAL)\n .build();\n }\n } else {\n // self-sign a certificate as no certificate was provided\n var selfSignedCertificate = new SelfSignedCertificate();\n this.sslContext = SslContextBuilder\n .forServer(selfSignedCertificate.certificate(), selfSignedCertificate.privateKey())\n .trustManager(InsecureTrustManagerFactory.INSTANCE)\n .build();\n }\n }\n }", "public static void initEncryption(EncryptionOptions options)\n { \n logger.info(\"Registering custom HTTPClient SSL configuration with Solr\");\n SSLSocketFactory socketFactory = \n (options.verifier == null) ?\n new SSLSocketFactory(options.ctx) :\n new SSLSocketFactory(options.ctx, options.verifier);\n HttpClientUtil.setConfigurer(new SSLHttpClientConfigurer(socketFactory)); \n }", "public NettySslServer(@Nullable SSLConfiguration sslConfiguration) {\n this.sslConfiguration = sslConfiguration;\n }", "private static void handleSSLCertificate() throws Exception {\n\t\tTrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\n\t\t\tpublic X509Certificate[] getAcceptedIssuers() {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic void checkClientTrusted(X509Certificate[] certs,\n\t\t\t\t\tString authType) {\n\t\t\t\t// Trust always\n\t\t\t}\n\n\t\t\tpublic void checkServerTrusted(X509Certificate[] certs,\n\t\t\t\t\tString authType) {\n\t\t\t\t// Trust always\n\t\t\t}\n\t\t} };\n\n\t\t// Install the all-trusting trust manager\n\t\tSSLContext sc = SSLContext.getInstance(\"SSL\");\n\t\t// Create empty HostnameVerifier\n\t\tHostnameVerifier hv = new HostnameVerifier() {\n\t\t\tpublic boolean verify(String arg0, SSLSession arg1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\n\t\tsc.init(null, trustAllCerts, new java.security.SecureRandom());\n\t\tHttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());\n\t\tHttpsURLConnection.setDefaultHostnameVerifier(hv);\n\t}", "@Override public ServerConfig https(final boolean enabled) {\n httpsEnabled = enabled;\n return this;\n }", "private SslContext buildServerSslContext()\n throws SSLException\n {\n SslContextBuilder builder = SslContextBuilder.forServer(certFile, keyFile);\n if (verifyMode == VerifyMode.NO_VERIFY) {\n builder.trustManager(InsecureTrustManagerFactory.INSTANCE);\n } else {\n builder.trustManager(caFile);\n }\n if (verifyMode == VerifyMode.VERIFY) {\n builder.clientAuth(ClientAuth.OPTIONAL);\n } else if (verifyMode == VerifyMode.VERIFY_REQ_CLIENT_CERT) {\n builder.clientAuth(ClientAuth.REQUIRE);\n }\n return builder.build();\n }", "public SSLConfig(@NonNull String pemCertificate, @NonNull String privateKey, @NonNull String password){\n this.sslCertificateType = PEM;\n this.pemCertificate = pemCertificate;\n this.privateKey = privateKey;\n this.password = password;\n }", "public boolean isSsl() {\n return ssl;\n }", "public static Configuration createServerSSLConfig(String serverKS,\n String password, String keyPassword, String trustKS, String trustPassword)\n throws IOException {\n return createSSLConfig(SSLFactory.Mode.SERVER,\n serverKS, password, keyPassword, trustKS, trustPassword, \"\");\n }", "public static String getServerSSLConfigFileName() {\n return getSSLConfigFileName(\"ssl-server\");\n }", "private void setTrustedCertificates() {\n TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {\n public java.security.cert.X509Certificate[] getAcceptedIssuers() {\n return null;\n }\n\n public void checkClientTrusted(X509Certificate[] certs, String authType) {\n }\n\n public void checkServerTrusted(X509Certificate[] certs, String authType) {\n }\n }};\n // Install the all-trusting trust manager\n final SSLContext sc;\n try {\n sc = SSLContext.getInstance(\"TLS\");\n sc.init(null, trustAllCerts, new java.security.SecureRandom());\n } catch (NoSuchAlgorithmException | KeyManagementException e) {\n e.printStackTrace();\n return;\n }\n\n HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());\n // Create all-trusting host name verifier\n HostnameVerifier allHostsValid = new HostnameVerifier() {\n public boolean verify(String hostname, SSLSession session) {\n return true;\n }\n };\n\n // Install the all-trusting host verifier\n HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);\n }", "public void setSslContext(SSLContext sslContext) {\n this.sslContext = sslContext;\n }", "protected void setupHttps(){\n try {\n if (!testKeystoreFile.exists()) {\n // Prepare a temporary directory for the tests\n BioUtils.delete(this.testDir, true);\n this.testDir.mkdir();\n // Copy the keystore into the test directory\n Response response = new Client(Protocol.CLAP)\n .handle(new Request(Method.GET,\n \"clap://class/org/restlet/test/engine/dummy.jks\"));\n\n if (response.getEntity() != null) {\n OutputStream outputStream = new FileOutputStream(\n testKeystoreFile);\n response.getEntity().write(outputStream);\n outputStream.flush();\n outputStream.close();\n } else {\n throw new Exception(\n \"Unable to find the dummy.jks file in the classpath.\");\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n }", "protected static void setCertificatePath(String certificatePath) {\n Program.certificatePath = certificatePath;\n Program.authType = AUTH_TYPE.CERT;\n }", "public boolean sslEnabled(){\n\t\treturn sslEnabled;\n\t}", "public void setSslContext(SslContext sslContext) {\n this.sslContext = sslContext;\n }", "@SuppressWarnings(\"checkstyle:parameternumber\")\n public static void setupSSLConfig(String keystoresDir, String sslConfDir,\n Configuration conf, boolean useClientCert, boolean trustStore,\n String excludeCiphers, String serverPassword, String clientPassword,\n String trustPassword) throws Exception {\n\n String clientKS = keystoresDir + \"/clientKS.jks\";\n String serverKS = keystoresDir + \"/serverKS.jks\";\n String trustKS = null;\n\n File sslClientConfFile = new File(sslConfDir, getClientSSLConfigFileName());\n File sslServerConfFile = new File(sslConfDir, getServerSSLConfigFileName());\n\n Map<String, X509Certificate> certs = new HashMap<String, X509Certificate>();\n\n if (useClientCert) {\n KeyPair cKP = KeyStoreTestUtil.generateKeyPair(\"RSA\");\n X509Certificate cCert =\n KeyStoreTestUtil.generateCertificate(\"CN=localhost, O=client\", cKP, 30,\n \"SHA1withRSA\");\n KeyStoreTestUtil.createKeyStore(clientKS, clientPassword, \"client\",\n cKP.getPrivate(), cCert);\n certs.put(\"client\", cCert);\n }\n\n KeyPair sKP = KeyStoreTestUtil.generateKeyPair(\"RSA\");\n X509Certificate sCert =\n KeyStoreTestUtil.generateCertificate(\"CN=localhost, O=server\", sKP, 30,\n \"SHA1withRSA\");\n KeyStoreTestUtil.createKeyStore(serverKS, serverPassword, \"server\",\n sKP.getPrivate(), sCert);\n certs.put(\"server\", sCert);\n\n if (trustStore) {\n trustKS = keystoresDir + \"/trustKS.jks\";\n KeyStoreTestUtil.createTrustStore(trustKS, trustPassword, certs);\n }\n\n Configuration clientSSLConf = createClientSSLConfig(clientKS,\n clientPassword, clientPassword, trustKS, trustPassword, excludeCiphers);\n Configuration serverSSLConf = createServerSSLConfig(serverKS,\n serverPassword, serverPassword, trustKS, trustPassword, excludeCiphers);\n\n saveConfig(sslClientConfFile, clientSSLConf);\n saveConfig(sslServerConfFile, serverSSLConf);\n\n conf.set(SSLFactory.SSL_HOSTNAME_VERIFIER_KEY, \"ALLOW_ALL\");\n conf.set(SSLFactory.SSL_CLIENT_CONF_KEY, sslClientConfFile.getName());\n conf.set(SSLFactory.SSL_SERVER_CONF_KEY, sslServerConfFile.getName());\n conf.setBoolean(SSLFactory.SSL_REQUIRE_CLIENT_CERT_KEY, useClientCert);\n }", "public abstract T useTransportSecurity(File certChain, File privateKey);", "public final void isSocketSSLConnection(boolean isSecure){\r\n isSocketSSL = isSecure;\r\n }", "private void m1388b(SSLSocket sSLSocket) {\n sSLSocket.setEnabledProtocols(new String[]{\"TLSv1.2\"});\n }", "private void installTrustStore() {\n if (trustStoreType != null) {\n System.setProperty(\"javax.net.ssl.trustStore\", trustStore);\n if (trustStoreType != null) {\n System.setProperty(\"javax.net.ssl.trustStoreType\", trustStoreType);\n }\n if (trustStorePassword != null) {\n System.setProperty(\"javax.net.ssl.trustStorePassword\", trustStorePassword);\n }\n }\n }", "public NcrackClient withSslEnabled() {\n this.sslEnabled = true;\n return this;\n }", "public SSLConfiguration getSsl() {\n if (ssl == null) {\n ssl = new SSLConfiguration();\n }\n return ssl;\n }", "Map<SSLConfiguration, SSLContextHolder> loadSSLConfigurations() {\n final Map<SSLConfiguration, SSLContextHolder> sslContextHolders = new HashMap<>();\n\n final Map<String, Settings> sslSettingsMap = new HashMap<>();\n sslSettingsMap.put(XPackSettings.HTTP_SSL_PREFIX, getHttpTransportSSLSettings(settings));\n sslSettingsMap.put(\"xpack.http.ssl\", settings.getByPrefix(\"xpack.http.ssl.\"));\n sslSettingsMap.putAll(getRealmsSSLSettings(settings));\n sslSettingsMap.putAll(getMonitoringExporterSettings(settings));\n sslSettingsMap.put(WatcherField.EMAIL_NOTIFICATION_SSL_PREFIX, settings.getByPrefix(WatcherField.EMAIL_NOTIFICATION_SSL_PREFIX));\n\n sslSettingsMap.forEach((key, sslSettings) -> loadConfiguration(key, sslSettings, sslContextHolders));\n\n final Settings transportSSLSettings = settings.getByPrefix(XPackSettings.TRANSPORT_SSL_PREFIX);\n final SSLConfiguration transportSSLConfiguration =\n loadConfiguration(XPackSettings.TRANSPORT_SSL_PREFIX, transportSSLSettings, sslContextHolders);\n this.transportSSLConfiguration.set(transportSSLConfiguration);\n Map<String, Settings> profileSettings = getTransportProfileSSLSettings(settings);\n profileSettings.forEach((key, profileSetting) -> loadConfiguration(key, profileSetting, sslContextHolders));\n\n for (String context : List.of(\"xpack.security.transport.ssl\", \"xpack.security.http.ssl\")) {\n validateServerConfiguration(context);\n }\n\n return Collections.unmodifiableMap(sslContextHolders);\n }", "public void init() throws Exception {\n\t\tString trustKeyStore = null;\n\t\tString trustKsPsword = null;\n\t\tString trustKsType = null;\n\t\t\n\t\t// Read ssl keystore properties from file\n\t\tProperties properties = new Properties();\n\t\tInputStream sslCertInput = Resources.getResourceAsStream(\"sslCertification.properties\");\n\t\ttry {\n\t\t\tproperties.load(sslCertInput);\n\t\t\ttrustKeyStore = properties.getProperty(\"trustKeyStore\");\n\t\t\ttrustKsPsword = properties.getProperty(\"trustKeyStorePass\");\n\t\t\ttrustKsType = properties.getProperty(\"trustKeyStoreType\");\n\t\t} catch (Exception e) {\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tsslCertInput.close();\n\t\t}\n \n // Set trust key store factory\n KeyStore trustKs = KeyStore.getInstance(trustKsType); \n FileInputStream trustKSStream = new FileInputStream(trustKeyStore);\n try {\n \ttrustKs.load(trustKSStream, trustKsPsword.toCharArray()); \n } catch (Exception e) {\n \tthrow e;\n } finally {\n \ttrustKSStream.close();\n }\n TrustManagerFactory trustKf = TrustManagerFactory.getInstance(\"SunX509\");\n trustKf.init(trustKs); \n \n // Init SSLContext\n SSLContext context = SSLContext.getInstance(\"TLSv1.2\"); \n context.init(null, trustKf.getTrustManagers(), null); \n sslFactory = context.getSocketFactory();\n \n\t\treturn;\n\t}", "public TrustingSSLSocketFactory() throws SSLException {\n\t\tSecurity.addProvider(new com.sun.net.ssl.internal.ssl.Provider());\n\t\tSystem.setProperty(\"java.protocol.handler.pkgs\", \"com.sun.net.ssl.internal.www.protocol\");\n\t\ttry {\n\t\t\tSSLContext sslContext;\n\t\t\tsslContext = SSLContext.getInstance(\"SSLv3\");\n\t\t\tsslContext.init(null, new TrustManager[]{new UtilSSLSocketFactory.TrustingX509TrustManager()}, null);\n\t\t\tfactory = sslContext.getSocketFactory();\n\t\t} catch (NoSuchAlgorithmException nsae) {\n\t\t\tthrow new SSLException(\"Unable to initialize the SSL context: \", nsae);\n\t\t} catch (KeyManagementException kme) {\n\t\t\tthrow new SSLException(\"Unable to register a trust manager: \", kme);\n\t\t}\n\t\tciphers = factory.getDefaultCipherSuites();\n\t}", "public void setTls(boolean tls) {\n this.tls = tls;\n }", "private SSLContext initSSLContext() {\n KeyStore ks = KeyStoreUtil.loadSystemKeyStore();\n if (ks == null) {\n _log.error(\"Key Store init error\");\n return null;\n }\n if (_log.shouldLog(Log.INFO)) {\n int count = KeyStoreUtil.countCerts(ks);\n _log.info(\"Loaded \" + count + \" default trusted certificates\");\n }\n\n File dir = new File(_context.getBaseDir(), CERT_DIR);\n int adds = KeyStoreUtil.addCerts(dir, ks);\n int totalAdds = adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n if (!_context.getBaseDir().getAbsolutePath().equals(_context.getConfigDir().getAbsolutePath())) {\n dir = new File(_context.getConfigDir(), CERT_DIR);\n adds = KeyStoreUtil.addCerts(dir, ks);\n totalAdds += adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n }\n dir = new File(System.getProperty(\"user.dir\"));\n if (!_context.getBaseDir().getAbsolutePath().equals(dir.getAbsolutePath())) {\n dir = new File(_context.getConfigDir(), CERT_DIR);\n adds = KeyStoreUtil.addCerts(dir, ks);\n totalAdds += adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n }\n if (_log.shouldLog(Log.INFO))\n _log.info(\"Loaded total of \" + totalAdds + \" new trusted certificates\");\n\n try {\n SSLContext sslc = SSLContext.getInstance(\"TLS\");\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());\n tmf.init(ks);\n X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0];\n _stm = new SavingTrustManager(defaultTrustManager);\n sslc.init(null, new TrustManager[] {_stm}, null);\n /****\n if (_log.shouldLog(Log.DEBUG)) {\n SSLEngine eng = sslc.createSSLEngine();\n SSLParameters params = sslc.getDefaultSSLParameters();\n String[] s = eng.getSupportedProtocols();\n Arrays.sort(s);\n _log.debug(\"Supported protocols: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getEnabledProtocols();\n Arrays.sort(s);\n _log.debug(\"Enabled protocols: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = params.getProtocols();\n if (s == null)\n s = new String[0];\n _log.debug(\"Default protocols: \" + s.length);\n Arrays.sort(s);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getSupportedCipherSuites();\n Arrays.sort(s);\n _log.debug(\"Supported ciphers: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getEnabledCipherSuites();\n Arrays.sort(s);\n _log.debug(\"Enabled ciphers: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = params.getCipherSuites();\n if (s == null)\n s = new String[0];\n _log.debug(\"Default ciphers: \" + s.length);\n Arrays.sort(s);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n }\n ****/\n return sslc;\n } catch (GeneralSecurityException gse) {\n _log.error(\"Key Store update error\", gse);\n } catch (ExceptionInInitializerError eiie) {\n // java 9 b134 see ../crypto/CryptoCheck for example\n // Catching this may be pointless, fetch still fails\n _log.error(\"SSL context error - Java 9 bug?\", eiie);\n }\n return null;\n }", "public static void setupSSLConfig(String keystoresDir, String sslConfDir,\n Configuration conf, boolean useClientCert,\n boolean trustStore)\n throws Exception {\n setupSSLConfig(keystoresDir, sslConfDir, conf, useClientCert, true,\"\");\n }", "@Override\npublic SSL_MODES getSSLMode() {\n\treturn null;\n}", "public void setSslEnabled(final boolean sslEnabled) {\n\t\tthis.sslEnabled = sslEnabled;\n\t}", "public static void setupSSLConfig(String keystoresDir, String sslConfDir,\n Configuration conf, boolean useClientCert) throws Exception {\n setupSSLConfig(keystoresDir, sslConfDir, conf, useClientCert, true);\n }", "@Override\r\n public SSLImplementation getSslImplementation() {\n return null;\r\n }", "private void connectUsingCertificate() {\n\t\tfinal String METHOD = \"connectUsingCertificate\";\n\t\tString protocol = null;\n\t\tint port = getPortNumber();\n\t\tif (isWebSocket()) {\n\t\t\tprotocol = \"wss://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = WSS_PORT;\n\t\t\t}\n\t\t} else {\n\t\t\tprotocol = \"ssl://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = MQTTS_PORT;\n\t\t\t}\n\t\t} \n\n\t\tString mqttServer = getMQTTServer();\n\t\t\n\t\tif(mqttServer != null){\n\t\t\tserverURI = protocol + mqttServer + \":\" + port;\n\t\t} else {\n\t\t\tserverURI = protocol + getOrgId() + \".\" + MESSAGING + \".\" + this.getDomain() + \":\" + port;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tmqttAsyncClient = new MqttAsyncClient(serverURI, clientId, DATA_STORE);\n\t\t\tmqttAsyncClient.setCallback(mqttCallback);\n\t\t\tmqttClientOptions = new MqttConnectOptions();\n\t\t\tif (clientUsername != null) {\n\t\t\t\tmqttClientOptions.setUserName(clientUsername);\n\t\t\t}\n\t\t\tif (clientPassword != null) {\n\t\t\t\tmqttClientOptions.setPassword(clientPassword.toCharArray());\n\t\t\t}\n\t\t\tmqttClientOptions.setCleanSession(this.isCleanSession());\n\t\t\tif(this.keepAliveInterval != -1) {\n\t\t\t\tmqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);\n\t\t\t}\n\t\t\t\n\t\t\tmqttClientOptions.setMaxInflight(getMaxInflight());\n\t\t\tmqttClientOptions.setAutomaticReconnect(isAutomaticReconnect());\n\t\t\t\n\t\t\t/* This isn't needed as the production messaging.internetofthings.ibmcloud.com \n\t\t\t * certificate should already be in trust chain.\n\t\t\t * \n\t\t\t * See: \n\t\t\t * http://stackoverflow.com/questions/859111/how-do-i-accept-a-self-signed-certificate-with-a-java-httpsurlconnection\n\t\t\t * https://gerrydevstory.com/2014/05/01/trusting-x509-base64-pem-ssl-certificate-in-java/\n\t\t\t * http://stackoverflow.com/questions/12501117/programmatically-obtain-keystore-from-pem\n\t\t\t * https://gist.github.com/sharonbn/4104301\n\t\t\t * \n\t\t\t * CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n\t\t\t * InputStream certFile = AbstractClient.class.getResourceAsStream(\"messaging.pem\");\n\t\t\t * Certificate ca = cf.generateCertificate(certFile);\n\t\t\t *\n\t\t\t * KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t\t * keyStore.load(null, null);\n\t\t\t * keyStore.setCertificateEntry(\"ca\", ca);\n\t\t\t * TrustManager trustManager = TrustManagerUtils.getDefaultTrustManager(keyStore);\n\t\t\t * SSLContext sslContext = SSLContextUtils.createSSLContext(\"TLSv1.2\", null, trustManager);\n\t\t\t * \n\t\t\t */\n\n\t\t\tSSLContext sslContext = SSLContext.getInstance(\"TLSv1.2\");\n\t\t\tsslContext.init(null, null, null);\n\t\t\t\n\t\t\t//Validate the availability of Server Certificate\n\t\t\t\n\t\t\tif (trimedValue(options.getProperty(\"Server-Certificate\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".pem\")||trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".der\")||trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".cer\")){\n\t\t\t\t\tserverCert = trimedValue(options.getProperty(\"Server-Certificate\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only PEM, DER & CER certificate formats are supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Server Certificate is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t//Validate the availability of Client Certificate\n\t\t\tif (trimedValue(options.getProperty(\"Client-Certificate\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".pem\")||trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".der\")||trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".cer\")){\n\t\t\t\t\tclientCert = trimedValue(options.getProperty(\"Client-Certificate\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only PEM, DER & CER certificate formats are supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Client Certificate is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t//Validate the availability of Client Certificate Key\n\t\t\tif (trimedValue(options.getProperty(\"Client-Key\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Client-Key\")).contains(\".key\")){\n\t\t\t\t\tclientCertKey = trimedValue(options.getProperty(\"Client-Key\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only Certificate key in .key format is supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Client Key is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t//Validate the availability of Certificate Password\n\t\t\ttry{\n\t\t\tif (trimedValue(options.getProperty(\"Certificate-Password\")) != null){\n\t\t\t\tcertPassword = trimedValue(options.getProperty(\"Certificate-Password\"));\n\t\t\t\t} else {\n\t\t\t\t\tcertPassword = \"\";\n\t\t\t\t}\n\t\t\t} catch (Exception e){\n\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Certificate Password is missing\", e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t\n\t\t\tmqttClientOptions.setSocketFactory(getSocketFactory(serverCert, clientCert, clientCertKey, certPassword));\n\n\t\t} catch (Exception e) {\n\t\t\tLoggerUtility.warn(CLASS_NAME, METHOD, \"Unable to configure TLSv1.2 connection: \" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "SslContext buildSslContext()\n throws SSLException\n {\n if (isClient) {\n return buildClientSslContext();\n } else {\n return buildServerSslContext();\n }\n }", "protected SSLContext() {}", "public static Configuration createServerSSLConfig(String serverKS,\n String password, String keyPassword, String trustKS, String trustPassword,\n String excludeCiphers) throws IOException {\n return createSSLConfig(SSLFactory.Mode.SERVER,\n serverKS, password, keyPassword, trustKS, trustPassword, excludeCiphers);\n }", "public void setCertiType(java.lang.String certiType) {\n this.certiType = certiType;\n }", "public String getTlsCert();", "public SSLContextParameters createServerSSLContextParameters() {\n SSLContextParameters sslContextParameters = new SSLContextParameters();\n\n KeyManagersParameters keyManagersParameters = new KeyManagersParameters();\n KeyStoreParameters keyStore = new KeyStoreParameters();\n keyStore.setPassword(\"changeit\");\n keyStore.setResource(\"ssl/keystore.jks\");\n keyManagersParameters.setKeyPassword(\"changeit\");\n keyManagersParameters.setKeyStore(keyStore);\n sslContextParameters.setKeyManagers(keyManagersParameters);\n\n return sslContextParameters;\n }", "public SSLConfig getSSLConfig() {\n return new SSLConfig(configPrefix + SERVER_SSL_CONFIG_PREFIX, configValues);\n }", "protected boolean configCert () {\n\t\t\n\t\tFile file = new File(\"confid\");\n\t\t\n\t\tif(!file.exists()) {\n\t\t\t\n\t\t\tfile.mkdir();\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Directory created...\");\n\t\t\t\n\t\t}\n\n\t\t//File fl = new File();\n\t\t\n\t\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tKeyPairGenerator keygen = KeyPairGenerator.getInstance(\"RSA\");\n\t\t\t\t\n\t\t\t\tkeygen.initialize(4096, new SecureRandom());\n\t\t\t\t\n\t\t\t\tKeyPair key = keygen.generateKeyPair();\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tX509Certificate cert = new GenCert().selfSignedCert(key.getPublic(), key.getPrivate(),\"DeepDiveCA\", \"DeepDiveCA\");\n\t\t\t\t\n\t\t\t\tX509Certificate[] chain = new X509Certificate[1];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\tKeyStore keystore = KeyStore.getInstance(\"jceks\");\n\t\t\t\t\n\t\t\t\tkeystore.load(null, \"winslygay\".toCharArray());\n\t\t\t\t\n\t\t\t\tchain[0] = cert;\n\t\t\t\t\n\t\t\t\tkeystore.setKeyEntry(\"rootPrivateKey\", key.getPrivate() , \"winslygay\".toCharArray(), chain );\n\t\t\t\t\t\t\t\n\t\t\t\tkeystore.store(new FileOutputStream(\"confid/keystore.jceks\"), \"winslygay\".toCharArray());\n\n\t\t\t\tif(keystore.size()!= 0||keystore.size()!=-1)\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"cert server all set up\");\n\t\t\t\t{\n\t\t\t\t\tisconfigured = true;\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (KeyStoreException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (CertificateException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn isconfigured;\n\t\t\n\n\t}", "public void setSslKeystore(String keystore) {\n\t\tsslKeystore = keystore;\n\t}", "@Override public ServerConfig keystore(final URL location, final String password) {\n keystoreLocation = location;\n keystorePass = password;\n return this;\n }", "public static final void registerTrustingSSLManager(String protocol) {\n Validate.notBlank(protocol, \"Invalid SSL protocol\");\n\n // Check SSL SocketFactory\n SSLSocketFactory trustingFact= getTrustingSocketFactory(protocol);\n SSLSocketFactory curFactory= HttpsURLConnection.getDefaultSSLSocketFactory();\n\n // Trusting factory not set?\n if (curFactory != trustingFact) {\n LOG.debug(\"Installing default trusting SSLSocketFactory!\");\n HttpsURLConnection.setDefaultSSLSocketFactory(trustingFact);\n }\n\n // Check HostnameVerifier\n HostnameVerifier trustingVerifier= getTrustingHostnameVerifier();\n HostnameVerifier curVerifier= HttpsURLConnection.getDefaultHostnameVerifier();\n\n // Install the all-trusting host verifier?\n if (curVerifier != trustingVerifier) {\n LOG.debug(\"Installing default trusting HostnameVertifier!\");\n HttpsURLConnection.setDefaultHostnameVerifier(trustingVerifier);\n }\n\n }", "public void setSslPort(String sslPort) {\r\n\t\tthis.sslPort = sslPort;\r\n\t}", "private void createClientKeyStoreServerTrustStore(KeyStore clientKeyStore, KeyStore serverTrustStore) throws Exception {\n X500Principal DN = new X500Principal(\"CN=testclient2.example.com, OU=JBoss, O=Red Hat, L=Raleigh, ST=North Carolina, C=US\");\n SelfSignedX509CertificateAndSigningKey selfSignedX509CertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder()\n .setKeyAlgorithmName(\"DSA\")\n .setSignatureAlgorithmName(\"SHA1withDSA\")\n .setDn(DN)\n .setKeySize(1024)\n .build();\n X509Certificate certificate = selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate();\n clientKeyStore.setKeyEntry(\"dnsincnclient\", selfSignedX509CertificateAndSigningKey.getSigningKey(), KEYSTORE_PASSWORD, new X509Certificate[]{certificate});\n serverTrustStore.setCertificateEntry(\"cn=testclient2.example.com,ou=jboss,o=red hat,l=raleigh,st=north carolina,c=us\", certificate);\n\n\n // Generate Test Authority self signed certificate\n final X500Principal CA_DN = new X500Principal(\"CN=Test Authority, OU=JBoss, O=Red Hat, L=Raleigh, ST=North Carolina, C=US\");\n selfSignedX509CertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder()\n .setDn(CA_DN)\n .setKeyAlgorithmName(\"RSA\")\n .setSignatureAlgorithmName(\"SHA256withRSA\")\n .addExtension(new BasicConstraintsExtension(false, true, -1))\n .build();\n final X509Certificate caCertificate = selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate();\n final PrivateKey caKey = selfSignedX509CertificateAndSigningKey.getSigningKey();\n\n // Generate Test Client 1 self signed certificate\n DN = new X500Principal(\"CN=Test Client 1, OU=JBoss, O=Red Hat, L=Raleigh, ST=North Carolina, C=US\");\n selfSignedX509CertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder()\n .setDn(DN)\n .setKeyAlgorithmName(\"RSA\")\n .setSignatureAlgorithmName(\"SHA256withRSA\")\n .addExtension(false, \"SubjectAlternativeName\", \"DNS:testclient1.example.com\")\n .build();\n certificate = selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate();\n clientKeyStore.setKeyEntry(\"testclient1\", selfSignedX509CertificateAndSigningKey.getSigningKey(), KEYSTORE_PASSWORD, new X509Certificate[]{certificate});\n serverTrustStore.setCertificateEntry(\"cn=test client 1,ou=jboss,o=red hat,l=raleigh,st=north carolina,c=us\", certificate);\n\n\n // Generate Signed Test Client certificate signed by Test Authority\n X500Principal subjectDN = new X500Principal(\"CN=Signed Test Client, OU=JBoss, O=Red Hat, ST=North Carolina, C=US\");\n\n KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(\"RSA\");\n KeyPair generatedKeys = keyPairGenerator.generateKeyPair();\n PrivateKey privateKey = generatedKeys.getPrivate();\n PublicKey publicKey = generatedKeys.getPublic();\n\n /*\n * The CA certificate is added using the alias of the client it is tested with, this is not really how the trust store should\n * be populated but as the test is also relying on the truststore to back the realm it needs to find an entry for the client\n * and we do not want to add the clients actual certificate as the test is testing CA signed certs.\n */\n serverTrustStore.setCertificateEntry(\"cn=signed test client,ou=jboss,o=red hat,st=north carolina,c=us\", caCertificate);\n\n certificate = new X509CertificateBuilder()\n .setIssuerDn(CA_DN)\n .setSubjectDn(subjectDN)\n .setSignatureAlgorithmName(\"SHA256withRSA\")\n .setSigningKey(caKey)\n .setPublicKey(publicKey)\n .build();\n clientKeyStore.setKeyEntry(\"testclientsignedbyca\", privateKey, KEYSTORE_PASSWORD, new X509Certificate[]{certificate});\n }", "public static void allowAllCertificates() {\n try {\n TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\n public X509Certificate[] getAcceptedIssuers() {\n X509Certificate[] myTrustedAnchors = new X509Certificate[0];\n return myTrustedAnchors;\n }\n\n @Override\n public void checkClientTrusted(X509Certificate[] certs,\n String authType) {}\n\n @Override\n public void checkServerTrusted(X509Certificate[] certs,\n String authType) {}\n } };\n\n SSLContext sc = SSLContext.getInstance(\"SSL\");\n sc.init(null, trustAllCerts, new SecureRandom());\n HttpsURLConnection\n .setDefaultSSLSocketFactory(sc.getSocketFactory());\n HttpsURLConnection\n .setDefaultHostnameVerifier(new HostnameVerifier() {\n\n @Override\n public boolean verify(String arg0, SSLSession arg1) {\n return true;\n }\n });\n } catch (Exception e) {}\n }", "private SSLContext createSSLContext() throws KeyStoreException,\n NoSuchAlgorithmException, KeyManagementException, IOException, CertificateException {\n TrustManager localTrustManager = new X509TrustManager() {\n @Override\n public X509Certificate[] getAcceptedIssuers() {\n System.out.println(\"X509TrustManager#getAcceptedIssuers\");\n return new X509Certificate[]{};\n }\n\n @Override\n public void checkServerTrusted(X509Certificate[] chain,\n String authType) throws CertificateException {\n System.out.println(\"X509TrustManager#checkServerTrusted\");\n }\n\n @Override\n public void checkClientTrusted(X509Certificate[] chain,\n String authType) throws CertificateException {\n System.out.println(\"X509TrustManager#checkClientTrusted\");\n }\n };\n\n\n SSLContext sslContext = SSLContext.getInstance(\"TLS\");\n sslContext.init(null, new TrustManager[]{localTrustManager}, new SecureRandom());\n\n return sslContext;\n }", "public void setTlsKey(String tlsKey);", "public AfdDomainHttpsParameters withCertificateType(AfdCertificateType certificateType) {\n this.certificateType = certificateType;\n return this;\n }", "public String getTlsCertPath();", "public void makeSecure(SSLServerSocketFactory sslServerSocketFactory, String[] sslProtocols) {\n\t\tthis.serverSocketFactory = new SecureServerSocketFactory(sslServerSocketFactory,\n\t\t\t\tsslProtocols);\n\t}", "public boolean isSslEnabled() {\n\t\treturn sslEnabled;\n\t}", "@Override\n public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {\n }", "public static void httpClientGetServerCertificate() {\n HttpResponseInterceptor certificateInterceptor = (httpResponse, context) -> {\n ManagedHttpClientConnection routedConnection = (ManagedHttpClientConnection) context.getAttribute(HttpCoreContext.HTTP_CONNECTION);\n SSLSession sslSession = routedConnection.getSSLSession();\n if (sslSession != null) {\n\n // get the server certificates from the {@Link SSLSession}\n Certificate[] certificates = sslSession.getPeerCertificates();\n\n // add the certificates to the context, where we can later grab it from\n context.setAttribute(HttpClientConstants.PEER_CERTIFICATES, certificates);\n }\n };\n try (\n // create closable http client and assign the certificate interceptor\n CloseableHttpClient httpClient = HttpClients.custom().addInterceptorLast(certificateInterceptor).build()) {\n\n // make HTTP GET request to resource server\n HttpGet httpget = new HttpGet(\"https://www.baidu.com\");\n System.out.println(\"Executing request \" + httpget.getRequestLine());\n\n // create http context where the certificate will be added\n HttpContext context = new BasicHttpContext();\n httpClient.execute(httpget, context);\n\n // obtain the server certificates from the context\n Certificate[] peerCertificates = (Certificate[]) context.getAttribute(HttpClientConstants.PEER_CERTIFICATES);\n\n // loop over certificates and print meta-data\n for (Certificate certificate : peerCertificates) {\n X509Certificate real = (X509Certificate) certificate;\n System.out.println(\"----------------------------------------\");\n System.out.println(\"Type: \" + real.getType());\n System.out.println(\"Signing Algorithm: \" + real.getSigAlgName());\n System.out.println(\"IssuerDN Principal: \" + real.getIssuerX500Principal());\n System.out.println(\"SubjectDN Principal: \" + real.getSubjectX500Principal());\n System.out.println(\"Not After: \" + DateUtils.formatDate(real.getNotAfter(), \"dd-MM-yyyy\"));\n System.out.println(\"Not Before: \" + DateUtils.formatDate(real.getNotBefore(), \"dd-MM-yyyy\"));\n System.out.println(\"----------------------------------------\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public SecureClientDriverRule(KeyStore keyStore, String password, String certAlias) {\n\t\tsuper(new SecureClientDriverFactory().createClientDriver(keyStore, password, certAlias));\n\t}", "public SSLService(Environment environment) {\n this.env = environment;\n this.settings = env.settings();\n this.diagnoseTrustExceptions = DIAGNOSE_TRUST_EXCEPTIONS_SETTING.get(environment.settings());\n this.sslConfigurations = new HashMap<>();\n this.sslContexts = loadSSLConfigurations();\n }", "public void setServerPort( int serverTcpPort, boolean enableSsl ){\n\t\t// 0 -- Precondition check\n\t\t\n\t\t//\t 0.1 -- Ensure server port is valid\n\t\tif( serverTcpPort < 1 )\n\t\t\tthrow new IllegalArgumentException(\"Server port is invalid\");\n\t\t\n\t\t// 1 -- Set the options\n\t\tserverPort = serverTcpPort;\n\t\tsslEnabled = enableSsl;\n\t\t//this.defaultDeny = defaultDeny;\n\t}", "private static Socket m39192a(Socket socket) {\n if (socket instanceof SSLSocket) {\n SSLSocket sSLSocket = (SSLSocket) socket;\n ArrayList arrayList = new ArrayList(Arrays.asList(sSLSocket.getSupportedProtocols()));\n arrayList.retainAll(Arrays.asList(new String[]{\"TLSv1.2\", \"TLSv1.1\", \"TLSv1\"}));\n sSLSocket.setEnabledProtocols((String[]) arrayList.toArray(new String[arrayList.size()]));\n }\n return socket;\n }", "public void setSSLImplementation( SSLImplementation sslImplementation) {\n this.sslImplementation = sslImplementation;\n }", "@DSSink({DSSinkKind.SENSITIVE_UNCATEGORIZED})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:02:01.395 -0500\", hash_original_method = \"886AE080148D5E5D7C66238C628CC678\", hash_generated_method = \"B59D430B54A9E84755CD1B8DE11AFB42\")\n \npublic void setSSLParameters(SSLParameters p) {\n String[] cipherSuites = p.getCipherSuites();\n if (cipherSuites != null) {\n setEnabledCipherSuites(cipherSuites);\n }\n String[] protocols = p.getProtocols();\n if (protocols != null) {\n setEnabledProtocols(protocols);\n }\n if (p.getNeedClientAuth()) {\n setNeedClientAuth(true);\n } else if (p.getWantClientAuth()) {\n setWantClientAuth(true);\n } else {\n setWantClientAuth(false);\n }\n }", "@Override\n \t\t\tpublic void checkServerTrusted(X509Certificate[] chain,\n \t\t\t\t\tString authType) throws CertificateException {\n \t\t\t\t\n \t\t\t}", "public void setTlsKeyPath(String tlsKeyPath);", "@Override\n public TelemetryExporterBuilder<T> setTrustedCertificates(byte[] certificates) {\n delegate.setTrustedCertificates(certificates);\n tlsConfigHelper.setTrustManagerFromCerts(certificates);\n return this;\n }", "public static void setupSSLConfig(String keystoresDir, String sslConfDir,\n Configuration conf, boolean useClientCert, boolean trustStore,\n String excludeCiphers) throws Exception {\n setupSSLConfig(keystoresDir, sslConfDir, conf, useClientCert, trustStore,\n excludeCiphers, SERVER_KEY_STORE_PASSWORD_DEFAULT,\n CLIENT_KEY_STORE_PASSWORD_DEFAULT, TRUST_STORE_PASSWORD_DEFAULT);\n }", "private static SSLContext createSSLContext() {\n\t try {\n\t SSLContext context = SSLContext.getInstance(\"SSL\");\n\t if (devMode) {\n\t \t context.init( null, new TrustManager[] {new RESTX509TrustManager(null)}, null); \n\t } else {\n\t TrustManager[] trustManagers = tmf.getTrustManagers();\n\t if ( kmf!=null) {\n\t KeyManager[] keyManagers = kmf.getKeyManagers();\n\t \n\t // key manager and trust manager\n\t context.init(keyManagers,trustManagers,null);\n\t }\n\t else\n\t \t// no key managers\n\t \tcontext.init(null,trustManagers,null);\n\t }\n\t return context;\n\t } \n\t catch (Exception e) {\n\t \t logger.error(e.toString());\n\t throw new HttpClientError(e.toString());\n\t \t }\n }", "private void initialiseSSLContext(KeyStore keystore, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException, KeyStoreException, KeyManagementException{\n\t\tKeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());\n\t\tkmf.init(keystore, password);\n\t\tSSLContext sc = SSLContext.getInstance(\"TLS\");\n\t\t// TODO use trust factory?\n\t\tsc.init(kmf.getKeyManagers(), null, null);\t\t\n\t}", "public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {\n\t\t\t }", "public SSLConfig(@NonNull File jksFile, @NonNull String storePassword, @NonNull String keyPassword){\n this.sslCertificateType = JKS;\n this.jksFile = jksFile;\n this.storePassword = storePassword;\n this.keyPassword = keyPassword;\n }", "void onSSLCertificateError(UnrecognizedCertificateException exception);", "private void createServerKeyStoreClientTrustStore(KeyStore serverKeyStore,KeyStore clientTrustStore) throws Exception {\n X500Principal DN = new X500Principal(\"CN=testserver2.example.com, OU=JBoss, O=Red Hat, L=Raleigh, ST=North Carolina, C=US\");\n SelfSignedX509CertificateAndSigningKey selfSignedX509CertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder()\n .setKeyAlgorithmName(\"DSA\")\n .setSignatureAlgorithmName(\"SHA1withDSA\")\n .setDn(DN)\n .setKeySize(1024)\n .build();\n X509Certificate certificate = selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate();\n serverKeyStore.setKeyEntry(\"dnsincnserver\", selfSignedX509CertificateAndSigningKey.getSigningKey(), KEYSTORE_PASSWORD, new X509Certificate[]{certificate});\n clientTrustStore.setCertificateEntry(\"dnsincnserver\", certificate);\n\n\n // Generate Test Server 1 self signed certificate\n DN = new X500Principal(\"CN=Test Server 1, OU=JBoss, O=Red Hat, L=Raleigh, ST=North Carolina, C=US\");\n selfSignedX509CertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder()\n .setDn(DN)\n .setKeyAlgorithmName(\"RSA\")\n .setSignatureAlgorithmName(\"SHA256withRSA\")\n .addExtension(false, \"SubjectAlternativeName\", \"DNS:testserver1.example.com\")\n .build();\n certificate = selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate();\n serverKeyStore.setKeyEntry(\"testserver1\", selfSignedX509CertificateAndSigningKey.getSigningKey(), KEYSTORE_PASSWORD, new X509Certificate[]{certificate});\n clientTrustStore.setCertificateEntry(\"testserver1\", certificate);\n }", "@Override\r\n\t\t\t\tpublic void checkServerTrusted(\r\n\t\t\t\t\t\tjava.security.cert.X509Certificate[] chain,\r\n\t\t\t\t\t\tString authType) throws CertificateException {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void checkServerTrusted(\r\n\t\t\t\t\t\tjava.security.cert.X509Certificate[] chain,\r\n\t\t\t\t\t\tString authType) throws CertificateException {\n\t\t\t\t\t\r\n\t\t\t\t}", "protected static void setKeyStorePath(String keyStorePath) {\n Program.keyStorePath = keyStorePath;\n Program.authType = AUTH_TYPE.CERT;\n }", "public void setMutualSSLConfiguration(String clientKeystore, String keystorePassword, String keyPassword,\n\t\t\tboolean forConsumer) {\n\t\tProperties properties = forConsumer ? consumerProperties : producerProperties;\n\n\t\tproperties.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, clientKeystore);\n\t\tproperties.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, keystorePassword);\n\t\tproperties.put(SslConfigs.SSL_KEY_PASSWORD_CONFIG, keyPassword);\n\t}", "@Override\npublic void checkServerTrusted(X509Certificate[] arg0, String arg1)\nthrows CertificateException {\n}", "public final boolean getIsSocketSSLConnection(){\r\n return isSocketSSL;\r\n }", "@Override\r\n\t\t\tpublic void checkServerTrusted(X509Certificate[] chain, String authType)\r\n\t\t\t\t\tthrows CertificateException {\n\t\t\t\t\r\n\t\t\t}", "public SingleCertKeyStoreProvider() {\r\n super(\"PKCS7\", PROVIDER_VERSION, \"KeyStore for a PKCS7 or X.509 certificate\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n AccessController.doPrivileged(new java.security.PrivilegedAction<Object>() {\r\n \t/** {@inheritdoc} */\r\n @Override\r\n\t\t\tpublic Object run() {\r\n put(\"KeyStore.PKCS7\", \"es.gob.afirma.keystores.single.SingleCertKeyStore\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n return null;\r\n }\r\n });\r\n }", "public void verifyServerCertificates(boolean yesno);", "public void setTrustStore(String trustStoreLocation) {\n if (!complete) {\n this.trustStoreLocation = trustStoreLocation;\n } else {\n log.warn(\"Connection Descriptor setter used outside of factory.\");\n }\n }", "public SecureClientDriverRule(int port, KeyStore keyStore, String password, String certAlias) {\n\t\tsuper(new SecureClientDriverFactory().createClientDriver(port, keyStore, password, certAlias));\n\t}", "public int configTLS( String url ) {\n if (tlsIsConfigured) {\n log.debug(\"Already configured! Omit call of HttpCfgService!\");\n return CFG_RSP_ALREADY;\n }\n try {\n int rsp = ((Integer) server.invoke(xdsHttpCfgServiceName,\n \"configTLS\",\n new Object[] { url },\n new String[] { String.class.getName() } ) ).intValue();\n if ( rsp == CFG_RSP_OK || rsp == CFG_RSP_ALREADY ) {\n tlsIsConfigured = true;\n }\n log.debug(\"configTLS of HttpCfgService return (1..OK, 2..already configured, 0..ignored, -1..error):\"+rsp);\n return rsp;\n } catch ( Exception x ) {\n log.error( \"Exception occured in configTLS: \"+x.getMessage(), x );\n return CFG_RSP_ERROR;\n }\n }", "@Property(name = \"staging:ssl\")\n public abstract boolean isSsl();" ]
[ "0.6962061", "0.65696096", "0.647338", "0.6461131", "0.645842", "0.64095795", "0.6402152", "0.62425494", "0.62022686", "0.61249495", "0.61200535", "0.6110889", "0.6053048", "0.5989734", "0.59379405", "0.5921896", "0.5911881", "0.58855796", "0.5808351", "0.57749325", "0.5758479", "0.5741771", "0.57177967", "0.5692366", "0.5665364", "0.5663604", "0.5642351", "0.56159574", "0.56138736", "0.5601354", "0.56012", "0.5584641", "0.5580615", "0.55659646", "0.55321896", "0.55271983", "0.5522456", "0.5516705", "0.55031985", "0.5477076", "0.5474078", "0.5469886", "0.545632", "0.54553473", "0.54443514", "0.54430246", "0.5441575", "0.5439759", "0.54363805", "0.5434325", "0.5405677", "0.53980994", "0.53704774", "0.53487474", "0.5335878", "0.53357536", "0.5327921", "0.53277975", "0.53272283", "0.5317086", "0.5299852", "0.52934855", "0.52854544", "0.527266", "0.5251655", "0.52495515", "0.52411675", "0.52263653", "0.5215983", "0.52053386", "0.51997536", "0.51900727", "0.51893634", "0.51866305", "0.5182136", "0.51821107", "0.51813847", "0.5176792", "0.5175742", "0.51756597", "0.5174409", "0.51675326", "0.516247", "0.51431084", "0.5134955", "0.5134603", "0.5123695", "0.5112241", "0.5112241", "0.51081526", "0.51074874", "0.51004887", "0.50991577", "0.5097806", "0.50969493", "0.507912", "0.50776875", "0.5073273", "0.5063895", "0.5052116" ]
0.64811325
2
Serve files from the provided directory.
public void serveFilesFromDirectory(File directory) { serveFilesFromDirectory(directory.getPath()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void serveFilesFromDirectory(String directoryPath) {\n try {\n synchronized (mImplMonitor) {\n checkServiceLocked();\n mImpl.serveFilesFromDirectory(directoryPath);\n }\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to start serving files from \" + directoryPath + \": \" + e.toString());\n }\n }", "private void serve() {\n\t\tif (request == null) {\n\t\t\tchannel.close();\n\t\t\treturn;\n\t\t}\n\t\tlogger.fine(\"Serving \" + type + \" request : \" + request.getPath());\n\t\tResponse resp = RequestHandler.handle(request);\n\t\tif (resp.getRespCode() == ResponseCode.NOT_FOUND) {\n\t\t\terror404(resp);\n\t\t\treturn;\n\t\t}\n\n\t\tStringBuilder header = new StringBuilder();\n\t\tif (type == Type.HTTP) {\n\t\t\theader.append(\"HTTP/1.0 200 OK\\r\\n\");\n\t\t\theader.append(\"Content-Length: \")\n\t\t\t\t\t.append(resp.getFileData().remaining()).append(\"\\r\\n\");\n\t\t\theader.append(\"Connection: close\\r\\n\");\n\t\t\theader.append(\"Server: Hyperion/1.0\\r\\n\");\n\t\t\theader.append(\"Content-Type: \" + resp.getMimeType() + \"\\r\\n\");\n\t\t\theader.append(\"\\r\\n\");\n\t\t}\n\t\tbyte[] headerBytes = header.toString().getBytes();\n\n\t\tByteBuffer bb = resp.getFileData();\n\t\tChannelBuffer ib = ChannelBuffers.buffer(bb.remaining()\n\t\t\t\t+ headerBytes.length);\n\t\tib.writeBytes(headerBytes);\n\t\tib.writeBytes(bb);\n\t\tchannel.write(ib).addListener(ChannelFutureListener.CLOSE);\n\t}", "void whenServeFile(String fileName, HttpServletRequest request);", "public void executelaunchDirectoryFiler() {\n \t\tif (conf.getProperty(\"rootDirectory\") == null)\n \t\t\tUtil.fatalError(\"You must provide a root directory for the filer with -r or --rootDirectory\");\n \t\tif (conf.getProperty(\"secret\") == null)\n \t\t\tUtil.fatalError(\"You must provide a shared secret to protect the server with -s or --secret\");\n \t\t\n \t\tfinal DirectoryFilerServer serv;\n \t\ttry {\n \t\t\tserv = new DirectoryFilerServer(conf.getProperty(\"rootDirectory\"),\n \t\t\t\tconf.getInteger(\"port\", 4263),\n \t\t\t\tconf.getProperty(\"secret\"));\n \t\t} catch (ClassNotFoundException e1) {\n \t\t\tUtil.fatalError(\"failed to load configuration\", e1);\n \t\t\treturn;\n \t\t}\n \t\t\n \t\tRuntime.getRuntime().addShutdownHook(new Thread(new Runnable(){\n \t\t\tpublic void run() {\n \t\t\t\tserv.close();\n \t\t\t}\n \t\t}));\n \t\t\n \t\tserv.launchServer();\n \t}", "public void parseDirectory(File directory) throws IOException {\n this.parsedFiles.clear();\n File[] contents = directory.listFiles();\n for (File file : contents) {\n if (file.isFile() && file.canRead() && file.canWrite()) {\n String fileName = file.getPath();\n if (fileName.endsWith(\".html\")) {\n Document parsed;\n parsed = Jsoup.parse(file, \"UTF-8\");\n if (this.isWhiteBearArticle(parsed)) {\n HTMLFile newParsedFile = new HTMLFile(parsed, false);\n String name = file.getName();\n this.parsedFiles.put(name, newParsedFile);\n } else if (this.isMenuPage(parsed)) {\n //HTMLFile newParsedFile = new HTMLFile(parsed, false);\n //String name = file.getName();\n //this.parsedFiles.put(name, newParsedFile);\n }\n }\n }\n }\n }", "AntiIterator<FsPath> listFilesAndDirectories(FsPath dir);", "public void doFiles(){\r\n serversDir = new File(rootDirPath+\"/servers/\");\r\n serverList = new File(rootDirPath+\"serverList.txt\");\r\n if(!serversDir.exists()){ //if server Directory doesn't exist\r\n serversDir.mkdirs(); //create it\r\n }\r\n updateServerList();\r\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString path= request.getRealPath(\"file\")+File.separatorChar;\n File file = new File(path);\n if(!file.exists()){//如果不存在这个路径\n file.mkdirs();//就创建\n }\n File[] fs = file.listFiles();\n for(int i=0; i<fs.length; i++){\n \t System.out.println(fs[i].getAbsolutePath());\n \t if(fs[i].isFile() && !fs[i].getName().contains(\"DS_Store\")){\n \t try{\n \t \tFileInputStream hFile = new FileInputStream(fs[i].getAbsolutePath()); \n \t \t\n \t //得到文件大小 \n \t int num=hFile.available(); \n \t byte data[]=new byte[num]; \n \t //读数据 \n \t hFile.read(data); \n \t response.setHeader(\"Content-Disposition\", \"attachment; filename=\" + java.net.URLEncoder.encode(fs[i].getName(), \"UTF-8\"));\n \t //得到向客户端输出二进制数据的对象\n \t OutputStream toClient=response.getOutputStream(); \n \t //输出数据 \n \t toClient.write(data); \n \t toClient.flush(); \n \t toClient.close(); \n \t hFile.close();\n \t }catch(Exception e){}\n \t break;\n \t }\n }\n\t}", "public static Handler<RoutingContext> serve(String spaDir, int port) {\n return serve(spaDir, port, \"npm\", \"start\", \"--\");\n }", "public static void main(String[] args) {\n staticFiles.location(\"/public\"); // Static files\n get(\"/hello\", (req, res) -> \"Hello World\");\n System.out.println(\"http://localhost:4567/hello\");\n }", "public static void processDirectory(String directory) {\n processDirectory(new File(directory));\n }", "public void parseFile(File dir) {\r\n\t\tFile[] files = dir.listFiles();\r\n\t\tfor(int i = 0; i < files.length; i++) {\r\n\t\t\tif(files[i].isDirectory()) {\r\n\t\t\t\tparseFile(files[i]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(!files[i].exists()) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tString fileName = files[i].getName();\r\n\t\t\t\tif(fileName.toLowerCase().endsWith(\".json\")) {\r\n\t\t\t\t\twq.execute(new Worker(library, files[i]));\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected void handleLs() {\r\n\t\tSystem.out.printf(\"Listing available files.%n\");\r\n\r\n\t\tFile[] availableFiles = new File(fileBase).listFiles();\r\n\r\n\t\tif (availableFiles == null) {\r\n\t\t\tSystem.err.printf(\"%s is not a directory.%n\", fileBase);\r\n\t\t\tsendMessage(String.valueOf(ERROR));\r\n\t\t} else {\r\n\t\t\tsendMessage(String.valueOf(availableFiles.length));\r\n\r\n\t\t\t/* send each file name */\r\n\t\t\tfor (File file : availableFiles) {\r\n\t\t\t\tsendMessage(file.getName());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void run() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket sock = ss.accept(); // 接受连接请求\n\t\t\t\tDataInputStream din = new DataInputStream(sock.getInputStream());\n\t\t\t\tbyte buffer[] = new byte[1024]; // 缓冲区\n\t\t\t\tint len = din.read(buffer);\n\t\t\t\tString filename = new String(buffer, 0, len); // 提取出想要获取的文件名\n\t\t\t\tSystem.out.println(\"Client01: received a file request from\" + sock.getInetAddress()+\":\"+sock.getPort()+\",filename:\"+ filename);\n\t\t\t\tDataOutputStream dout = new DataOutputStream(sock.getOutputStream());\n\t\t\t\tFileInputStream fis = new FileInputStream(new File(\"D:/networkExperiment/experiment04/host01/\" + filename));\n\t\t\t\tbyte b[] = new byte[1024];\n\t\t\t\tfis.read(b); // 从文件中将数据写入缓冲区\n\t\t\t\tdout.write(b); // 将缓冲区中的数据返回\n\t\t\t\tSystem.out.println(\"Client01: return file successfully!\");\n\t\t\t\tdout.close();\n\t\t\t\tsock.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}\n\t}", "@Routes( { @Route( method = Method.ANY, path = \":?path=(.*)\", binding = BindingType.raw ) } )\n public void handle( final HttpServerRequest request )\n {\n ResponseUtils.setStatus( ApplicationStatus.OK, request );\n\n request.pause();\n String path = request.params()\n .get( PathParam.path.key() );\n\n if ( path != null && ( path.length() < 1 || path.equals( \"/\" ) ) )\n {\n path = null;\n }\n\n VertXWebdavRequest req = null;\n final VertXWebdavResponse response = new VertXWebdavResponse( request.response() );\n\n try\n {\n String contextPath = masterRouter.getPrefix();\n if ( contextPath == null )\n {\n contextPath = \"\";\n }\n\n req = new VertXWebdavRequest( request, contextPath, \"/mavdav\", path, null );\n\n service.service( req, response );\n\n }\n catch ( WebdavException | IOException e )\n {\n logger.error( String.format( \"Failed to service mavdav request: %s\", e.getMessage() ), e );\n formatResponse( e, request );\n }\n finally\n {\n IOUtils.closeQuietly( req );\n IOUtils.closeQuietly( response );\n\n try\n {\n request.response()\n .end();\n }\n catch ( final IllegalStateException e )\n {\n }\n }\n }", "@GetMapping(\"/files\")\n public ResponseEntity<List<FileInfo>> getListFiles() {\n List<FileInfo> fileInfos = storageService.loadAll().map(path -> {\n String filename = path.getFileName().toString();\n String url = MvcUriComponentsBuilder\n .fromMethodName(FilesController.class, \"getFile\", path.getFileName().toString()).build().toString();\n\n return new FileInfo(filename, url);\n }).collect(Collectors.toList());\n\n return ResponseEntity.status(HttpStatus.OK).body(fileInfos);\n }", "@GET\n @Path(\"{filename}\")\n @Produces(MediaType.APPLICATION_OCTET_STREAM)\n public Response show(@PathParam(\"filename\") String filename) {\n ArrayList<String> serversClone = new ArrayList<>();\n this.cm.getServers().forEach(server -> {\n serversClone.add(server);\n });\n while (!serversClone.isEmpty()) {\n String selectedServer = this.cm.getServer();\n serversClone.remove(selectedServer);\n try{\n String endpoint = \"http://\" + selectedServer\n + \"/WebService/webresources/files\";\n URL url = new URL(endpoint + \"/\" + filename);\n String methodType = \"GET\";\n HttpURLConnection urlConnection = (HttpURLConnection) \n url.openConnection();\n urlConnection.setRequestMethod(methodType);\n urlConnection.setDoOutput(true);\n urlConnection.setRequestProperty(\n \"Content-type\", MediaType.APPLICATION_OCTET_STREAM\n );\n urlConnection.setRequestProperty(\n \"Accept\", MediaType.APPLICATION_OCTET_STREAM\n );\n int httpResponseCode = urlConnection.getResponseCode();\n if (httpResponseCode == HttpURLConnection.HTTP_OK) {\n return Response.ok(urlConnection.getInputStream()).build();\n } else {\n if (serversClone.isEmpty()) {\n return Response\n .status(httpResponseCode).build();\n }\n }\n } catch (IOException e) {\n System.err.println(e);\n return Response.serverError().build();\n }\n }\n return Response.status(HttpURLConnection.HTTP_UNAVAILABLE).build();\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void watchDirForNewFiles(Path dir) {\n\t\ttry (WatchService watcher = FileSystems.getDefault().newWatchService()) {\n\t\t\t// register for events on new files\n\t\t\tWatchKey key = dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE);\n\t\t\tlogger.info(\"Starting to watch on dir: \" + dir);\n\t\t\t\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\t// wait for key to be signaled\n\t\t\t\t\tkey = watcher.take();\n\t\t\t\t} catch (InterruptedException x) {\n\t\t\t\t\t// Executor shuts down by interrupting\n\t\t\t\t\tlogger.fine(\"watch dir (inotify) interrupted... shutting down\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tfor (WatchEvent<?> event : key.pollEvents()) {\n\t\t\t\t\t// an OVERFLOW event can occur, if events are lost or\n\t\t\t\t\t// discarded.\n\t\t\t\t\tif (event.kind() == OVERFLOW) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tWatchEvent.Kind<?> kind = event.kind();\n\n\t\t\t\t\t// The filename is the context of the event.\n\t\t\t\t\tPath newPath = ((WatchEvent<Path>) event).context();\n\t\t\t\t\tlogger.info(\"Event kind: \" + event.kind().name() + \" file: \" + newPath);\n\n\t\t\t\t\tif (kind == ENTRY_CREATE) {\n\t\t\t\t\t\tSubmittedFile file = new SubmittedFile(newPath);\n\t\t\t\t\t\tfile.setState(State.CREATED);\n\t\t\t\t\t\tcreatedFilesMap.put(newPath.getFileName().toString(), \n\t\t\t\t\t\t\t\tfile);\n\t\t\t\t\t}\n\t\t\t\t\telse if (kind == ENTRY_DELETE)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Intermediate stage, before it is transferred.\n\t\t\t\t\t\tSubmittedFile file = createdFilesMap.get(newPath.getFileName().toString());\n\t\t\t\t\t\tif (file != null){\n\t\t\t\t\t\t\tfile.setState(State.DELETED);\n\t\t\t\t\t\t\tfile.setTimeStamp(Instant.now());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Reset the key -- this step is critical if you want to\n\t\t\t\t// receive further watch events. If the key is no longer valid,\n\t\t\t\t// the directory is inaccessible so exit the loop.\n\t\t\t\tif (!key.reset()) {\n\t\t\t\t\tlogger.severe(\"watch service problem. reset key failed\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tlogger.severe(\"watch service problem: \" + e.getMessage());\n\t\t\tlogger.log(Level.FINE, \"\", e);\n\t\t}\n\n\t\t// finished - either by exception, or by key reset.\n\t}", "public boolean accept(File dir, String name);", "public void run() {\n while (!stoppen) {\n serveer(balie.pakMaaltijd());\n }\n }", "public static void processDirectory(File directory) {\n FlatFileProcessor processor = new FlatFileProcessor(directory);\n processor.processDirectory();\n }", "@Override\n\tpublic boolean accept(File dir, String filename) {\n\t\treturn filename.endsWith(\".html\");\n\t}", "Response serveFile(String uri, Map<String, String> header, File file, String mime) {\n\t\t\tResponse res;\n\t\t\ttry {\n\t\t\t\t// Calculate etag\n\t\t\t\tString etag = Integer.toHexString((file.getAbsolutePath() + file.lastModified()\n\t\t\t\t\t\t+ \"\" + file.length()).hashCode());\n\n\t\t\t\t// Support (simple) skipping:\n\t\t\t\tlong startFrom = 0;\n\t\t\t\tlong endAt = -1;\n\t\t\t\tString range = header.get(\"range\");\n\t\t\t\tif (range != null) {\n\t\t\t\t\tif (range.startsWith(\"bytes=\")) {\n\t\t\t\t\t\trange = range.substring(\"bytes=\".length());\n\t\t\t\t\t\tint minus = range.indexOf('-');\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (minus > 0) {\n\t\t\t\t\t\t\t\tstartFrom = Long.parseLong(range.substring(0, minus));\n\t\t\t\t\t\t\t\tendAt = Long.parseLong(range.substring(minus + 1));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (NumberFormatException ignored) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// get if-range header. If present, it must match etag or else\n\t\t\t\t// we\n\t\t\t\t// should ignore the range request\n\t\t\t\tString ifRange = header.get(\"if-range\");\n\t\t\t\tboolean headerIfRangeMissingOrMatching = (ifRange == null || etag.equals(ifRange));\n\n\t\t\t\tString ifNoneMatch = header.get(\"if-none-match\");\n\t\t\t\tboolean headerIfNoneMatchPresentAndMatching = ifNoneMatch != null\n\t\t\t\t\t\t&& (\"*\".equals(ifNoneMatch) || ifNoneMatch.equals(etag));\n\n\t\t\t\t// Change return code and add Content-Range header when skipping\n\t\t\t\t// is\n\t\t\t\t// requested\n\t\t\t\tlong fileLen = file.length();\n\n\t\t\t\tif (headerIfRangeMissingOrMatching && range != null && startFrom >= 0\n\t\t\t\t\t\t&& startFrom < fileLen) {\n\t\t\t\t\t// range request that matches current etag\n\t\t\t\t\t// and the startFrom of the range is satisfiable\n\t\t\t\t\tif (headerIfNoneMatchPresentAndMatching) {\n\t\t\t\t\t\t// range request that matches current etag\n\t\t\t\t\t\t// and the startFrom of the range is satisfiable\n\t\t\t\t\t\t// would return range from file\n\t\t\t\t\t\t// respond with not-modified\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, \"\");\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (endAt < 0) {\n\t\t\t\t\t\t\tendAt = fileLen - 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlong newLen = endAt - startFrom + 1;\n\t\t\t\t\t\tif (newLen < 0) {\n\t\t\t\t\t\t\tnewLen = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tFileInputStream fis = new FileInputStream(file);\n\t\t\t\t\t\tfis.skip(startFrom);\n\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.PARTIAL_CONTENT, mime, fis,\n\t\t\t\t\t\t\t\tnewLen);\n\t\t\t\t\t\tres.addHeader(\"Accept-Ranges\", \"bytes\");\n\t\t\t\t\t\tres.addHeader(\"Content-Length\", \"\" + newLen);\n\t\t\t\t\t\tres.addHeader(\"Content-Range\", \"bytes \" + startFrom + \"-\" + endAt + \"/\"\n\t\t\t\t\t\t\t\t+ fileLen);\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\n\t\t\t\t\tif (headerIfRangeMissingOrMatching && range != null && startFrom >= fileLen) {\n\t\t\t\t\t\t// return the size of the file\n\t\t\t\t\t\t// 4xx responses are not trumped by if-none-match\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.RANGE_NOT_SATISFIABLE,\n\t\t\t\t\t\t\t\tNanoHTTPDSingleFile.MIME_PLAINTEXT, \"\");\n\t\t\t\t\t\tres.addHeader(\"Content-Range\", \"bytes */\" + fileLen);\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else if (range == null && headerIfNoneMatchPresentAndMatching) {\n\t\t\t\t\t\t// full-file-fetch request\n\t\t\t\t\t\t// would return entire file\n\t\t\t\t\t\t// respond with not-modified\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, \"\");\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else if (!headerIfRangeMissingOrMatching\n\t\t\t\t\t\t\t&& headerIfNoneMatchPresentAndMatching) {\n\t\t\t\t\t\t// range request that doesn't match current etag\n\t\t\t\t\t\t// would return entire (different) file\n\t\t\t\t\t\t// respond with not-modified\n\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, \"\");\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// supply the file\n\t\t\t\t\t\tres = newFixedFileResponse(file, mime);\n\t\t\t\t\t\tres.addHeader(\"Content-Length\", \"\" + fileLen);\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t\tres = getForbiddenResponse(\"Reading file failed.\");\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}", "@PreAuthorize(\"hasAuthority('file:download')\")\n @GetMapping(\"/files/{filename:.+}\")\n @ResponseBody\n public ResponseEntity<Resource> serveFile(@PathVariable String filename) {\n Resource file = storageService.loadAsResource(filename);\n return ResponseEntity.ok().header(HttpHeaders.CONTENT_DISPOSITION,\n \"attachment; filename=\\\"\" + file.getFilename() + \"\\\"\").body(file);\n }", "public List listFiles(String path);", "public void start()\n {\n FileVector = FileHandler.getFileList( harvesterDirName , filterArray, false );\n iter = FileVector.iterator();\n }", "@Override\n\tpublic void run() {\n\t\trespond();\n\t\tlisten();\n\t}", "private void ViewFiles(ByteBuffer packet) throws IOException{\n\t\t// (view files req c->s) [header | page (4)]\n\t\t// (initial response) [header | num files to expect | total num (4)]\n\t\t// (list of available clients s->c) [header | size(8) | num_peers(4) | id(4) | name(?)]xNum files\n\t\tMap<ServerFile, Integer> files = totalFiles();\n\t\t\n\t\t//read payload / construct response\n\t\tif (packet.capacity() < 4)\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"page not correctly specified\");\n\t\t\n\t\tint page = packet.getInt(0);\n\t\t\n\t\tint num_to_send = files.size();\n\t\tif (files.size() > (Constants.PAGE_SIZE * page))\n\t\t\tnum_to_send = Constants.PAGE_SIZE;\n\t\telse if (files.size() > (Constants.PAGE_SIZE * (page - 1)))\n\t\t\tnum_to_send = files.size() % Constants.PAGE_SIZE;\n\t\telse {\n\t\t\tnum_to_send = files.size() % Constants.PAGE_SIZE;\n\t\t\tpage = (files.size() / Constants.PAGE_SIZE) + 1;\n\t\t}\n\t\t\t\n\t\tbuf = Utility.addHeader(1, 8, client.getId());\n\t\tbuf.putInt(Constants.HEADER_LEN, num_to_send);\n\t\tbuf.putInt(Constants.HEADER_LEN + 4, files.size());\n\t\tbyte[] sendData = buf.array();\n\t\t\n\t\t// send response\n\t\tout.write(sendData);\n\t\tout.flush();\n\t\t\n\t\t//construct/send file infos\n\t\tIterator<ServerFile> it = files.keySet().iterator();\n\t\tfor (int count = 0; count < ((page - 1) * Constants.PAGE_SIZE); count++)\n\t\t\tit.next();\n\t\tfor (int count = 0; count < num_to_send; count++) {\n\t\t\tServerFile f = it.next();\n\t\t\tString sent_name = f.name() + '\\0';\n\t\t\tbuf = Utility.addHeader(1, sent_name.length() + 16, client.getId());\n\t\t\tbuf.putLong(Constants.HEADER_LEN, f.size());\n\t\t\tbuf.putInt(Constants.HEADER_LEN + 8, files.get(f)); \n\t\t\tbuf.putInt(Constants.HEADER_LEN + 12, f.id());\n\t\t\tbyte[] sent_name_bytes = sent_name.getBytes();\n\t\t\tfor (int i = 0; i < sent_name.length(); i++)\n\t\t\t\tbuf.put(Constants.HEADER_LEN + 16 + i, sent_name_bytes[i]);\n\t\t\tsendData = buf.array();\n\t\t\tout.write(sendData);\n\t\t\tout.flush();\n\t\t}\t\t\n\t\tSystem.out.println(client.getAddress() + \": Correctly processed file req\");\n\t}", "public void directoryDropped(File dir, Point point)\n {\n // TODO Implement send directory\n }", "void listingFiles(String remoteFolder);", "public static void main(String[] args) throws IOException {\r\n\t\t\r\n\t\t// get the command line argument\r\n\t\t\r\n\t\tif (args.length < 1) {\r\n\t\t\tSystem.out.println(\"Error: expected 1 argument containing directory in 'files/'.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tString path = args[0];\r\n\t\t\r\n\t\tint port = 8000;\r\n\t\t\r\n\t\tif (args.length > 1) {\r\n\t\t\tport = Integer.parseInt(args[1]);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// setup the server and listen for incoming connections\r\n\t\t\r\n\t\tServerSocket serverSocket = new ServerSocket(port);\r\n\t\tSystem.out.println(\"Listening on port \" + port + \"...\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\twhile (true) {\r\n\t\t\t\tSocket socket = serverSocket.accept();\r\n\t\t\t\tnew Thread(new HttpConnection(socket, path)).start();\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\tserverSocket.close();\r\n\t\t}\r\n\t}", "private void listingPage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{\n\t\trequest.setAttribute(\"files\", new FilesDAO().getFiles());\n\t\trequest.setAttribute(\"path\", path);\n\t\trequest.getRequestDispatcher(\"listingPage.jsp\").forward(request, response);\n\t}", "List getFileUploads(HttpServletRequest request, File finalDir) throws ValidationException;", "public static Result servePackFile(String file)\n {\n\t\n\ttry {\n\t //note: the (virtual) 'file' is used as the cache key, see pack()\n\t Map<String, Object> cache = (Map<String, Object>) Cacher.fetchApplicationObject(CACHE_KEY);\n\t CachedPack pack = null;\n\t if (cache!=null && (pack = (CachedPack)cache.get(file))!=null) {\n\t\t/*\n\t\t * TODO: the packed files are stored gzipped to save memory and we return it as raw bytes,\n\t\t * but we should probably offer an alternative for browsers that don't support gzip?\n\t\t */\n\t\tresponse().setHeader(\"Content-Encoding\", \"gzip\");\n\t\tresponse().setHeader(\"Content-Length\", pack.content.length + \"\");\n\t\treturn ok(pack.content).as(pack.mimeType);\n\t }\n\t else {\n\t\t/*\n\t\t * Flush the cache; this shouldn't happen if some client doens't want to load random asset files.\n\t\t * Note: this can impact the performance, so I'm flagging this as 'error' so it pops up in the logs if it does. \n\t\t */\n\t\tLogger.error(\"Flushing the pack-cache, because we seem to miss an entry for \"+file+\" - this shouldn't happen!\");\n\t\tCacher.storeApplicationObject(CACHE_KEY, null);\n\t\treturn notFound();\n\t }\n\t}\n\tcatch (Exception e) {\n\t Logger.error(\"Error while serving pack file\", e);\n\t return internalServerError();\n\t}\n }", "private void startWebApp(Handler<AsyncResult<HttpServer>> next) {\n Router router = Router.router(vertx);\n\n router.route(\"/assets/*\").handler(StaticHandler.create(\"assets\"));\n router.route(\"/api/*\").handler(BodyHandler.create());\n\n router.route(\"/\").handler(this::handleRoot);\n router.get(\"/api/timer\").handler(this::timer);\n router.post(\"/api/c\").handler(this::_create);\n router.get(\"/api/r/:id\").handler(this::_read);\n router.put(\"/api/u/:id\").handler(this::_update);\n router.delete(\"/api/d/:id\").handler(this::_delete);\n\n // Create the HTTP server and pass the \"accept\" method to the request handler.\n vertx.createHttpServer().requestHandler(router).listen(8888, next);\n }", "private void startServlets(){\n\t\ttry{\n\t\t\tserver = new Server();\n\t\t\tServerConnector c = new ServerConnector(server);\n\t\t\tc.setIdleTimeout(15000);\n\t\t\tc.setAcceptQueueSize(256);\n\t\t\tc.setPort(port);\n\t\t\tif(!bind.equals(\"*\")){\n\t\t\t\tc.setHost(bind);\n\t\t\t}\n\n\t\t\tServletContextHandler handler = new ServletContextHandler(server,\"/\", true, false);\n\t\t\tServletHolder servletHolder = new ServletHolder(StatusServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/status/*\");\n\n\t\t\tservletHolder = new ServletHolder(SampleAPIServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/sample/*\");\n\n\t\t\tservletHolder = new ServletHolder(FileServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/*\");\n\t\t\tFileServlet.sourceFolder=\"./site\";\t\t\t\n\n\t\t\tserver.addConnector(c);\n\t\t\tserver.start();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException\n {\n resp.setContentType(\"text/html;charset=UTF-8\");\n\n final Part filePart = req.getPart(\"file\");\n final String fileName = getFileName(filePart);\n\n File file = new File(Config.fileDirectory + File.separator + fileName);\n\n // TODO: return error saying file exists\n if(file.exists())\n {\n resp.setStatus(resp.SC_BAD_REQUEST);\n req.getRequestDispatcher(\"/\").forward(req, resp);\n return;\n }\n\n OutputStream out = null;\n InputStream fileContent = null;\n final PrintWriter writer = resp.getWriter();\n\n try\n {\n out = new FileOutputStream(new File(Config.fileDirectory + File.separator\n + fileName));\n fileContent = filePart.getInputStream();\n\n int read = 0;\n final byte[] bytes = new byte[1024];\n\n while ((read = fileContent.read(bytes)) != -1)\n out.write(bytes, 0, read);\n\n log.info(\"File {} being uploaded to {}\", fileName, Config.fileDirectory);\n }\n catch (FileNotFoundException fne)\n {\n log.error(\"Problems during file upload. Error: {}\", fne.getMessage());\n }\n finally\n {\n req.getRequestDispatcher(\"/\").forward(req, resp);\n if (out != null)\n out.close();\n if (fileContent != null)\n fileContent.close();\n if (writer != null)\n writer.close();\n }\n }", "List<File> list(String directory) throws FindException;", "@Override\n public List<GEMFile> getLocalFiles(String directory) {\n File dir = new File(directory);\n List<GEMFile> resultList = Lists.newArrayList();\n File[] fList = dir.listFiles();\n if (fList != null) {\n for (File file : fList) {\n if (file.isFile()) {\n resultList.add(new GEMFile(file.getName(), file.getParent()));\n } else {\n resultList.addAll(getLocalFiles(file.getAbsolutePath()));\n }\n }\n gemFileState.put(STATE_SYNC_DIRECTORY, directory);\n }\n return resultList;\n }", "@Override\n\t\tpublic void run() {\n\t\t\tIndexServer is = new IndexServer(3002,\"/src/P2Pfile/Peer2/filefolder\" );\n\t\t\tSystem.out.println(\"Peer2Server Start\");\n\t\t\tis.ConnectionAccept();\n\t\t\t\n\t\t\n\t\t\t\n\t\t}", "private void startServer(String ip, int port, String contentFolder) throws IOException{\n HttpServer server = HttpServer.create(new InetSocketAddress(ip, port), 0);\n \n //Making / the root directory of the webserver\n server.createContext(\"/\", new Handler(contentFolder));\n //Making /log a dynamic page that uses LogHandler\n server.createContext(\"/log\", new LogHandler());\n //Making /online a dynamic page that uses OnlineUsersHandler\n server.createContext(\"/online\", new OnlineUsersHandler());\n server.setExecutor(null);\n server.start();\n \n //Needing loggin info here!\n }", "public static void main(String args[]) throws Exception\n {\n\n ServerSocket server = new ServerSocket(2000,10);\n\n System.out.println(\"Web Server Started. Listening on port number 2000\");\n String filespec;\n int ch;\n \n while (true)\n {\n // get connection from client \n Socket client = server.accept();\n\n BufferedReader br = new BufferedReader( new InputStreamReader(client.getInputStream()));\n\n OutputStream clientout = client.getOutputStream();\n\n // read filespec from client\n while ( (filespec = br.readLine()) == null);\n\n System.out.println(\"Processing request for file : \" + filespec);\n \n // open the file and send content back to client\n\n FileReader fr = new FileReader( filespec);\n\n while ( ( ch = fr.read()) != -1 )\n clientout.write(ch);\n\n clientout.write(-1); // write EOF\n clientout.close();\n \n fr.close();\n\n System.out.println(\"Process Completed Successfully\");\n\n } // end of while\n\n }", "@Test\n public void listFilesTest() throws ApiException {\n Integer devid = null;\n String path = null;\n List<FileOnDevice> response = api.listFiles(devid, path);\n\n // TODO: test validations\n }", "private void renderFolder(HttpServletResponse resp, String baseURL,\n\t\t\tFolder folder) throws IOException {\n\t\tPage startpage = null;\n\t\tfor (Page page : dc2f.getChildren(folder.getPath(), Page.class)) {\n\t\t\tif (\"index.html\".equals(page.getName())) {\n\t\t\t\tstartpage = page;\n\t\t\t\tbreak;\n\t\t\t} else if(startpage == null) {\n\t\t\t\tstartpage = page;\n\t\t\t}\n\t\t}\n\t\tif (startpage != null) {\n\t\t\tresp.sendRedirect(baseURL + \"/\" + startpage.getPath());\n\t\t}\n\t}", "public void getPeerFiles(){\n\t\t\n\t\tFile[] files = new File(path).listFiles();\n\t\tfor (File file : files) {\n\t\t\tfileNames.add(file.getName());\n\t\t}\n\t\tSystem.out.println(\"Number of Files Registerd to the server - \"+fileNames.size());\n\t\tSystem.out.println(\"To search for file give command: get <Filename>\");\n\t\tSystem.out.println(\"To refresh type command: refresh\");\n\t\tSystem.out.println(\"To disconnect type command: disconnect\");\n\t}", "public void addDefaultHandlers(String directoryPath) {\n try {\n synchronized (mImplMonitor) {\n checkServiceLocked();\n mImpl.addDefaultHandlers(directoryPath);\n }\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to add default handlers and start serving files from \" + directoryPath\n + \": \" + e.toString());\n }\n }", "public serverHttpHandler( String rootDir ) {\n this.serverHome = rootDir;\n }", "public CompletionStage<Result> index() {\n return fileService.list()\n .thenApplyAsync(personStream ->\n ok(views.html.index.render(personStream.collect(Collectors.toList()))), ec.current()\n );\n }", "@Deprecated\n\tpublic Response serve(String uri, Method method, Map<String, String> headers,\n\t\t\tMap<String, String> parms, Map<String, String> files) {\n\t\treturn newFixedLengthResponse(Response.Status.NOT_FOUND,\n\t\t\t\tNanoHTTPDSingleFile.MIME_PLAINTEXT, \"Not Found\");\n\t}", "public void run()\n {\n try\n {\n // Load the manifest file\n File manifest = new File(UploaderMain.getManifestName());\n if (!manifest.exists())\n {\n ErrorPrinter.printError(ErrorCode.fileNotFound, \"manifest does not exist\");\n System.exit(0);\n }\n\n // Read names of files from manifest\n Map<String, File> files = new HashMap<String, File>();\n BufferedReader manifestReader = new BufferedReader(new FileReader(manifest));\n String line;\n long totalLength = 0;\n while ((line = manifestReader.readLine()) != null)\n {\n if (line.startsWith(\"//\") || line.trim().isEmpty()) continue; // ignore comments\n StringTokenizer token = new StringTokenizer(line, \"@\");\n String destinationName = token.nextToken();\n String localName = token.nextToken();\n File f = new File(localName);\n if (!f.exists())\n {\n \tErrorPrinter.printError(ErrorCode.fileNotFound, \"file \" + localName + \" not found\");\n \tcontinue;\n }\n totalLength += f.length();\n files.put(destinationName, f);\n }\n manifestReader.close();\n\n dOut.writeInt(files.size());\n dOut.writeLong(totalLength);\n\n for (String s : files.keySet())\n {\n File f = files.get(s);\n \n try\n {\n // Send the name and length of the file\n dOut.writeUTF(s);\n dOut.writeLong(f.length());\n\n // Send the file over the network\n FileInputStream reader = new FileInputStream(f);\n byte[] buffer = new byte[BUFFER_SIZE];\n int numRead;\n long numSent = 0;\n while (numSent < f.length())\n {\n numRead = reader.read(buffer);\n dOut.write(buffer, 0, numRead);\n numSent += numRead;\n }\n\n reader.close();\n }\n catch (Exception e)\n {\n System.out.println(\"Error sending file \" + f.getName());\n }\n }\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }", "static void viewFiles()\r\n\t {\n\t\t File directoryPath = new File(\"D:\\\\java_project\");\r\n\t File filesList[] = directoryPath.listFiles();\r\n System.out.println(\"List of files and directories in the specified directory:\");\r\n\t for(File file : filesList) \r\n\t {\r\n\t System.out.println(\"File name: \"+file.getName());\r\n\t System.out.println(\"File path: \"+file.getAbsolutePath());\r\n\t System.out.println(\"Size :\"+file.getTotalSpace());\r\n\t System.out.println(\"last time file is modified :\"+new Date(file.lastModified()));\r\n System.out.println(\" \");\r\n\t }\r\n }", "@Override\n public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n String requestUri = req.getRequestURI();\n\n if (requestUri.startsWith(req.getContextPath())) {\n requestUri = requestUri.substring(req.getContextPath().length());\n }\n\n if (requestUri.equals(\"/\")) {\n requestUri = \"/index.html\";\n }\n\n String baseFilename = String.join(\"\", getPrefix(), requestUri);\n\n // This is the filename that AWS Lambda would use\n String lambdaFilename = baseFilename.replaceFirst(\"/+\", \"\");\n\n // This is the filename that a local debug environment would use\n String localFilename = baseFilename.replaceFirst(\"//\", \"/\");\n\n // Always try to get the AWS Lambda file first since performance counts the most there\n Option<InputStream> inputStreamOption = Option.of(getClass().getClassLoader().getResourceAsStream(lambdaFilename));\n\n if (inputStreamOption.isEmpty()) {\n // Didn't find the AWS Lambda file, maybe we are debugging locally\n inputStreamOption = Option.of(getServletContext().getResource(localFilename))\n .map(url -> Try.of(url::openStream).getOrNull());\n }\n\n if (inputStreamOption.isEmpty()) {\n // Didn't find the file in either place\n resp.setStatus(404);\n return;\n }\n\n InputStream inputStream = inputStreamOption.get();\n\n Optional<String> optionalMimeType = Optional.empty();\n\n if (requestUri.endsWith(\".js\")) {\n // For some reason the \"*.nocache.js\" file gets picked up by Tika as \"text/x-matlab\"\n optionalMimeType = Optional.of(\"application/javascript\");\n } else if (requestUri.endsWith(\".html\")) {\n optionalMimeType = Optional.of(\"text/html\");\n } else if (requestUri.endsWith(\".png\")) {\n optionalMimeType = Optional.of(\"image/png\");\n } else if (requestUri.endsWith(\".jpg\")) {\n optionalMimeType = Optional.of(\"image/jpeg\");\n } else if (requestUri.endsWith(\".css\")) {\n optionalMimeType = Optional.of(\"text/css\");\n } else {\n Optional<MimeHelper> optionalMimeHelper = getOptionalMimeHelper();\n\n if (optionalMimeHelper.isPresent()) {\n // No MIME type detected, use the optional MIME helper\n optionalMimeType = Optional.of(optionalMimeHelper.get().detect(requestUri, inputStream));\n }\n }\n\n // Only set the MIME type if we found it\n optionalMimeType.ifPresent(resp::setContentType);\n\n resp.setStatus(200);\n\n // Throw an exception if the stream copy fails\n Try.run(() -> copyStream(inputStream, resp.getOutputStream())).get();\n }", "public void run() {\n\t\tport(8080);\n\n\t\t// Main Page, welcome\n\t\tget(\"/\", (request, response) -> \"Welcome!\");\n\n\t\t// Date\n\t\tget(\"/date\", (request, response) -> {\n\t\t\tDate d = new Date(\"frida.org\", Calendar.getInstance().get(Calendar.YEAR),\n\t\t\t\t\tCalendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DAY_OF_MONTH));\n\t\t\treturn om.writeValueAsString(d);\n\t\t});\n\n\t\t// Time\n\t\tget(\"/time\", (request, response) -> {\n\t\t\tTime t = new Time(\"frida.org\", Calendar.getInstance().get(Calendar.HOUR),\n\t\t\t\t\tCalendar.getInstance().get(Calendar.MINUTE), Calendar.getInstance().get(Calendar.SECOND));\n\t\t\treturn om.writeValueAsString(t);\n\t\t});\n\t}", "public List<File> getFiles(String dir)\r\n\t{\r\n\t\tList<File> result = null;\r\n\t\tFile folder = new File(dir);\r\n\t\tif (folder.exists() && folder.isDirectory())\r\n\t\t{\r\n\t\t\tFile[] listOfFiles = folder.listFiles(); \r\n\t\t\t \r\n\t\t\tresult = new ArrayList<File>();\r\n\t\t\tfor (File file : listOfFiles)\r\n\t\t\t{\r\n\t\t\t\tif (file.isFile())\r\n\t\t\t\t\tresult.add(file);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tlogger.error(\"check to make sure that \" + dir + \" exists and you have permission to read its contents\");\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\tString path = \"/Users/amit/Documents/FileHandlingTesting/abcd\";\n\t\tFile file = new File(path);\n\t\t//File file = new File(path+\"/abcd/xyz/tt/pp\");\n//\t\tString allFiles[] = file.list();\n//\t\tfor(String f : allFiles){\n//\t\t\tSystem.out.println(f);\n//\t\t}\n\t\tFile files[] = file.listFiles(new MyFilter());\n\t\tSystem.out.println(\"U have \"+files.length+\" html files\");\n\t\tint counter = 1;\n\t\tfor(File f : files){\n\t\t\tf.renameTo(new File(path+\"/virus\"+counter+\".haha\"));\n\t\t\tcounter++;\n//\t\t\tif(f.isDirectory()){\n//\t\t\t\tSystem.out.println(\"<DIR> \"+f.getName() + \" \"+new Date(f.lastModified()));\n//\t\t\t}\n//\t\t\telse\n//\t\t\tif(f.isFile()){\n//\t\t\t\tif(f.isHidden()){\n//\t\t\t\t\t\n//\t\t\t\t}\n//\t\t\t\tif(!f.canWrite()){\n//\t\t\t\t\t\n//\t\t\t\t}\n//\t\t\t\t//f.delete();\n//\t\t\t\tf.setWritable(false);\n//\t\t\t\tSystem.out.println(\"<FILE> \"+f.getName()+\" \"+new Date(f.lastModified()));\n\t\t\t}\n\t\t}", "public void addDefaultHandlers(File directory) {\n addDefaultHandlers(directory.getPath());\n }", "@GET\n @Path(\"/data/{dir}/{name}\")\n @Produces(\"text/html\")\n public String getFile(@PathParam( \"name\" ) String name,@PathParam( \"dir\" ) String dir)throws IOException {\n\n if(!login)\n return logIn();\n\n System.out.println(commandes.getCurrentDir());\n if(commandes.CMDCWD(\"/data/\"+dir)){\n String result = AdditionnalResources.searchFile(name);\n if(commandes.getCurrentDir().equals(\"data/\"+dir)){\n result += \"<form action=\\\"/rest/tp2/ftp/\"+commandes.getCurrentDir()+\"/\"+name+\"/edit\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Edit\\\">\"+\n \"</form></br>\";\n result += \"<button onclick= \\\"p()\\\">Delete</button>\"+\n \"<script type=\\\"text/javascript\\\">\"+\n \"function p(){\"+\n \"console.log(\\\"Ici\\\");\"+\n \"xhr=window.ActiveXObject ? new ActiveXObject(\\\"Microsoft.XMLHTTP\\\") : new XMLHttpRequest();\"+\n \"xhr.onreadystatechange=function(){};\"+\n \"xhr.open(\\\"DELETE\\\", \\\"http://localhost:8080/rest/tp2/ftp/data/\"+dir+\"/\"+name+\"\\\");\"+\n \"xhr.send(null);\"+\n \"};\"+\n \"</script>\";\n result +=\"<form action=\\\"/rest/tp2/ftp/data/\"+dir+\"\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Return\\\">\"+\n \"</form></br>\";\n }else{\n result +=\"<form action=\\\"/rest/tp2/ftp/\"+commandes.getCurrentDir()+\"/add\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Add File\\\">\"+\n \"</form></br>\";\n result +=\"<form action=\\\"/rest/tp2/ftp/logout\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Logout\\\">\"+\n \"</form></br>\";\n }\n return result;\n\n }\n return \"<h1>PATH NOT FOUND</h1>\";\n }", "public static void main(String[] args) throws IOException {\n\t\tif(args.length != 2)\n\t\t{\n\t\t\tusage();\n\t\t\treturn;\n\t\t}\n\t\tHttpServer server = new HttpServer(Integer.parseInt(args[0]), new FileServer(args[1]));\n\t\tserver.setAllowedMethods(new String[] { \"GET\", \"HEAD\" });\n\t\tserver.setName(\"info.ziyan.net.httpserver.example.FileServer/1.0\");\n\t\tserver.start();\n\t}", "@GetMapping(\"/upload-files/{id}\")\n @Timed\n public ResponseEntity<UploadFilesDTO> getUploadFiles(@PathVariable Long id) {\n log.debug(\"REST request to get UploadFiles : {}\", id);\n Optional<UploadFilesDTO> uploadFilesDTO = uploadFilesService.findOne(id);\n return ResponseUtil.wrapOrNotFound(uploadFilesDTO);\n }", "@GetMapping(\"/all\")\r\n\tpublic List<FileModel> getListFiles() {\r\n\t\treturn fileRepository.findAll();\r\n\t}", "public Vector getTypedFilesForDirectory(File dir) {\r\n\tboolean useCache = dir.equals(getCurrentDirectory());\r\n\r\n\tif(useCache && currentFilesFresh) {\r\n\t return currentFiles;\r\n\t} else {\r\n\t Vector resultSet;\r\n\t if (useCache) {\r\n\t\tresultSet = currentFiles;\r\n\t\tresultSet.removeAllElements();\r\n\t } else {\r\n\t\tresultSet = new Vector();\r\n\t }\r\n\t \r\n\t String[] names = dir.list();\r\n\r\n\t int nameCount = names == null ? 0 : names.length;\r\n\t for (int i = 0; i < nameCount; i++) {\r\n\t\tTypedFile f;\r\n\t\tif (dir instanceof WindowsRootDir) {\r\n\t\t f = getTypedFile(names[i]);\r\n\t\t} else {\r\n\t\t f = getTypedFile(dir.getPath(), names[i]);\r\n\t\t}\r\n\r\n\t\tFileType t = f.getType();\r\n\t\tif ((shownType == null || t.isContainer() || shownType == t)\r\n\t\t && (hiddenRule == null || !hiddenRule.testFile(f))) {\r\n\t\t resultSet.addElement(f);\r\n\t\t}\r\n\t }\r\n\r\n\t // The fake windows root dir will get mangled by sorting\r\n\t if (!(dir instanceof DirectoryModel.WindowsRootDir)) {\r\n\t\tsort(resultSet);\r\n\t }\r\n\r\n\t if (useCache) {\r\n\t\tcurrentFilesFresh = true;\r\n\t }\r\n\r\n\t return resultSet;\r\n\t}\r\n }", "@GetMapping(\"/upload-files\")\n @Timed\n public ResponseEntity<List<UploadFilesDTO>> getAllUploadFiles(Pageable pageable) {\n log.debug(\"REST request to get a page of UploadFiles\");\n Page<UploadFilesDTO> page = uploadFilesService.findAll(pageable);\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/upload-files\");\n return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);\n }", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response index() {\n ArrayList<String> serversClone = new ArrayList<>();\n this.cm.getServers().forEach(server -> {\n serversClone.add(server);\n });\n while (!serversClone.isEmpty()) {\n String selectedServer = this.cm.getServer();\n serversClone.remove(selectedServer);\n try{\n String endpoint = \"http://\" + selectedServer\n + \"/WebService/webresources/files\";\n String methodType=\"GET\";\n URL url = new URL(endpoint);\n HttpURLConnection urlConnection = (HttpURLConnection) \n url.openConnection();\n urlConnection.setRequestMethod(methodType);\n urlConnection.setDoOutput(true);\n urlConnection.setRequestProperty(\n \"Content-type\", MediaType.APPLICATION_JSON\n );\n urlConnection.setRequestProperty(\n \"Accept\", MediaType.APPLICATION_JSON\n );\n int httpResponseCode = urlConnection.getResponseCode();\n if (httpResponseCode == HttpURLConnection.HTTP_OK) {\n BufferedReader in = new BufferedReader(\n new InputStreamReader(urlConnection.getInputStream()));\n String inputLine;\n StringBuilder content = new StringBuilder();\n while ((inputLine = in.readLine()) != null) {\n content.append(inputLine);\n }\n return Response.ok(content.toString()).build();\n } else {\n if (serversClone.isEmpty()) {\n return Response\n .status(httpResponseCode).build();\n }\n } \n } catch (IOException ex) {\n System.err.println(ex);\n return Response.serverError().build();\n }\n }\n return Response.status(HttpURLConnection.HTTP_UNAVAILABLE).build();\n }", "public ListImages(File directoryOfInterest, CentralController centralController)\n throws IOException {\n\n this.centralController = centralController;\n\n directory = directoryOfInterest;\n imagesInDirectory = new ArrayList<>();\n allImagesUnderDirectory = new ArrayList<>();\n\n // updates the imagesInDirectory list\n fillImagesInDirectory();\n\n // updates the allImagesUnderDirectory list\n fillAllImagesUnderDirectory(directory);\n }", "@Override\n public Iterable<File> list(File storageDirectory, FilenameFilter filter) {\n\treturn null;\n }", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n System.out.println(\"Adding answers...\");\n String assignmentKey = request.getParameter(\"assignment-key\");\n String questionKey = request.getParameter(\"question-key\");\n\n File folder = new File(\"images/answers\");\n File[] listOfFiles = folder.listFiles();\n\n for (File file : listOfFiles) {\n String path = \"images/answers/\" + file.getName();\n Database.addAnswer(path, parseAnswer(path), 0, assignmentKey, questionKey);\n }\n System.out.println(\"Done!\");\n response.setContentType(\"application/json;\");\n response.getWriter().println(\"\");\n }", "@RequestMapping(\"/web/*\")\n\tpublic String oneFolder() {\n\t System.out.println(\"In /web/*\");\n\t return \"success\";\n\t}", "public Response serve(IHTTPSession session) {\n\t\tMap<String, String> files = new HashMap<String, String>();\n\t\tMethod method = session.getMethod();\n\t\tif (Method.PUT.equals(method) || Method.POST.equals(method)) {\n\t\t\ttry {\n\t\t\t\tsession.parseBody(files);\n\t\t\t} catch (IOException ioe) {\n\t\t\t\treturn newFixedLengthResponse(Response.Status.INTERNAL_ERROR,\n\t\t\t\t\t\tNanoHTTPDSingleFile.MIME_PLAINTEXT, \"SERVER INTERNAL ERROR: IOException: \"\n\t\t\t\t\t\t\t\t+ ioe.getMessage());\n\t\t\t} catch (ResponseException re) {\n\t\t\t\treturn newFixedLengthResponse(re.getStatus(), NanoHTTPDSingleFile.MIME_PLAINTEXT,\n\t\t\t\t\t\tre.getMessage());\n\t\t\t}\n\t\t}\n\n\t\tMap<String, String> parms = session.getParms();\n\t\tparms.put(NanoHTTPDSingleFile.QUERY_STRING_PARAMETER, session.getQueryParameterString());\n\t\treturn serve(session.getUri(), method, session.getHeaders(), parms, files);\n\t}", "public void run() {\n\n ServerSocket ss = null;\n try {\n\n ss = new ServerSocket(port); // accept connection from other peers and send out blocks of images to others\n\n } catch (Exception e) {\n\n // e.printStackTrace();\n\n }\n\n while (true) {\n\n Socket s;\n\n try {\n\n s = ss.accept();\n\n new Thread(new uploader(s)).start(); // create an uploader thread for each incoming client\n\n } catch (Exception e){\n\n // e.printStackTrace();\n\n }\n\n }\n\n }", "public void setDir(File dir)\n {\n this.dir = dir;\n }", "List<String> getFiles(String path) throws IOException;", "private static Collection<File> listFiles(File directory, FilenameFilter filter, boolean recurse) {\n\t\tVector<File> files = new Vector<File>();\n\t\tFile[] entries = directory.listFiles();\n\n\t\tfor (File entry : entries) {\n\t\t\tif (filter == null || filter.accept(directory, entry.getName()))\n\t\t\t\tfiles.add(entry);\n\t\t\tif (recurse && entry.isDirectory())\n\t\t\t\tfiles.addAll(listFiles(entry, filter, recurse));\n\t\t}\n\t\treturn files;\n\t}", "static public void readServerFiles(DbxClientV2 client) throws Exception\n\t{\n ListFolderResult result = client.files().listFolder(\"\");\n while (true) {\n for (Metadata metadata : result.getEntries()) {\n System.out.println(metadata.getPathLower());\n }\n if (!result.getHasMore()) {\n break;\n }\n result = client.files().listFolderContinue(result.getCursor()); \n }\n\t}", "private void addResponseHandlers() {\n\t\t\n\t\tif (responseHandlers == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tresponseHandlers.put(ResponseType.DELETE_FILE, new ResponseHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\tSystem.out.println(reader.readLine());\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tresponseHandlers.put(ResponseType.FILE_LIST, new ResponseHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\t\n\t\t\t\tString pwd = reader.readLine();\n\t\t\t\tSystem.out.println(\"Present Working Directory: \" + pwd);\n\t\t\t\t\n\t\t\t\tInteger numFiles = Integer.parseInt(reader.readLine());\n\t\t\t\tSystem.out.println(\"# Files/Folders: \" + numFiles + \"\\n\");\n\t\t\t\t\n\t\t\t\tif (numFiles == -1) {\n\t\t\t\t\tSystem.out.println(\"End of stream reached\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor (int i=0; i<numFiles; i++) {\n\t\t\t\t\tSystem.out.println(\"\\t\" + reader.readLine());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\nAll contents listed.\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tresponseHandlers.put(ResponseType.FILE_TRANSFER, new ResponseHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\t\n\t\t\t\tString fileName = reader.readLine();\n\t\t\t\tif (checkForErrors(fileName)) {\n\t\t\t\t\tSystem.out.println(fileName);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tInteger fileSize = Integer.parseInt(reader.readLine());\n\t\t\t\tif (fileSize < 0) {\n\t\t\t\t\tSystem.err.println(\"Invalid file size: \" + fileSize);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbyte[] data = new byte[fileSize];\n\t\t\t\tint numRead = socket.getInputStream().read(data, 0, fileSize);\n\t\t\t\tif (numRead == -1) {\n\t\t\t\t\tSystem.out.println(\"End of stream reached.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tFile folder = new File(pwd);\n\t\t\t\tif (!folder.exists() && !folder.mkdir()) {\n\t\t\t\t\tSystem.err.println(\"Failed to create directory: \" + pwd);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Warning: If the file exists it will be overwritten.\");\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\tFile file = new File(pwd + fileName);\n\t\t\t\t\tfile.createNewFile();\n\t\t\t\t\t\n\t\t\t\t\tFileOutputStream fileOutputStream = new FileOutputStream(file);\n\t\t\t fileOutputStream.write(data);\n\t\t\t fileOutputStream.close();\n\t\t\t \n\t\t\t\t} catch (SecurityException | IOException e) {\n\t\t\t\t\tSystem.err.println(e.getLocalizedMessage());\n\t\t\t\t\tSystem.err.println(\"Failed to create file: \" + fileName + \" at pathname: \" + pwd);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t \t\t\n\t\t System.out.println(\"File successfully transferred.\");\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tresponseHandlers.put(ResponseType.EXIT, new ResponseHandler() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\t\n\t\t\t\tString response = reader.readLine();\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t});\n\t}", "public void run(){\n\t\t// Stop servlets\n\t\ttry{\n\t\t\tserver.stop();\n\t\t}catch(Exception e){}\n\t}", "public void run() {\n\t\ttry {\n\t\t\t// Get input and output streams to talk to the client\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(csocket.getInputStream()));\n\t\t\tPrintWriter out = new PrintWriter(csocket.getOutputStream());\n\t\t\t/*\n\t\t\t * read the input lines from client and perform respective action based on the\n\t\t\t * request\n\t\t\t */\n\t\t\tString line;\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\t// return if all the lines are read\n\t\t\t\tif (line.length() == 0)\n\t\t\t\t\tbreak;\n\t\t\t\telse if (line.contains(\"GET\") && line.contains(\"/index.html\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * get the respective file requested by the client i.e index.html\n\t\t\t\t\t */\n\t\t\t\t\tFile file = new File(WEB_ROOT, \"/index.html\");\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(\"Content-length: \" + file.length());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t\tout.write(FileUtils.readFileToString(file, \"UTF-8\"), 0, ((int) file.length()));\n\t\t\t\t} else if (line.contains(\"PUT\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * put the respective file at a location on local\n\t\t\t\t\t */\n\t\t\t\t\tString[] split = line.split(\" \");\n\t\t\t\t\tFile source = new File(split[1]);\n\t\t\t\t\tFile dest = new File(WEB_ROOT, \"clientFile.html\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// copy the file to local storage\n\t\t\t\t\t\tFileUtils.copyFile(source, dest);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t} else {\n\t\t\t\t\tout.print(line + \"\\r\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// closing the input and output streams\n\t\t\tout.close(); // Flush and close the output stream\n\t\t\tin.close(); // Close the input stream\n\t\t\tcsocket.close(); // Close the socket itself\n\t\t} // If anything goes wrong, print an error message\n\t\tcatch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t\tSystem.err.println(\"Usage: java HttpMirror <port>\");\n\t\t}\n\t}", "private void listFiles(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\r\n\t\tArrayList files=up.listAllFiles(appPath);\r\n\t\r\n\t\t\r\n\t RequestDispatcher dispatcher = request.getRequestDispatcher(\"display.jsp\");\r\n\t\t\trequest.setAttribute(\"listfiles\", files); \r\n\t dispatcher.forward(request, response);\r\n\t \t \r\n\t \t \r\n\t \t \r\n\t}", "public FileServer(int port) throws IOException {\n serverThread = new Thread(new RunningService(port));\n }", "public void setFileDirectory(String directory) {\n settings.put(\"fileDirectory\", directory);\n }", "public void writeToDir() {\n\t\ttry{\n\t\t\tString dirPath = Paths.get(\".\").toAbsolutePath().normalize().toString()+\"/\";\n\t\t\tString path = dirPath + filename; //get server dir path\n\t\t\tSystem.out.println(\"output file path is: \" + path);\n\t\t\tFileOutputStream out = new FileOutputStream(path);\n out.write(img);\n out.close();\n PL.fsync();\n\t\t}catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{\n File blueCheck = new File(request.getParameter(\"filename\"));\r\n String pathToWeb = getServletContext().getRealPath(\"/\" + blueCheck);\r\n\r\n ServletContext cntx= request.getServletContext();\r\n String mime = cntx.getMimeType(pathToWeb);\r\n\r\n response.setContentType(mime);\r\n try {\r\n File file = new File(pathToWeb);\r\n response.setContentLength((int) file.length());\r\n\r\n FileInputStream in = new FileInputStream(file);\r\n OutputStream out = response.getOutputStream();\r\n\r\n // Copy the contents of the file to the output stream\r\n byte[] buf = new byte[1024];\r\n int count;\r\n while ((count = in.read(buf)) >= 0) {\r\n out.write(buf, 0, count);\r\n }\r\n out.close();\r\n in.close();\r\n\r\n response.setHeader(\"Content-Transfer-Encoding\", \"binary\");\r\n response.setHeader(\"Content-Disposition\", \"attachment; filename=\\\"\" + blueCheck.getName() + \"\\\"\");//fileName;\r\n } catch(Exception e) {\r\n response.getWriter().write(e.getMessage());\r\n }\r\n\r\n\r\n }", "private void renderFile(HttpServletResponse resp, File file)\n\t\t\tthrows IOException {\n\t\tString mimetype = file.getMimetype();\n\t\tif (mimetype.startsWith(\"text/*\")) {\n\t\t\tmimetype += \"; charset=\" + Dc2fConstants.CHARSET.displayName();\n\t\t}\n\t\tresp.setHeader(\"Content-Type\", mimetype);\n\t\tIOUtils.copy(file.getContent(false), resp.getOutputStream());\n\t}", "void downloadingFile(String path);", "@Override\n public void serveDownload(ServletContext context, HttpServletResponse response, Download download)\n throws IOException {\n File file = FileUtility.getFromDrive(download);\n\n if (file != null) {\n try (FileInputStream inStream = new FileInputStream(file)) {\n String mimeType = context.getMimeType(file.getAbsolutePath());\n if (mimeType == null) {\n // set to binary type if MIME mapping not found\n mimeType = \"application/octet-stream\";\n }\n\n // modifies response\n response.setContentType(mimeType);\n response.setContentLength((int) file.length());\n\n // forces download\n String headerKey = \"Content-Disposition\";\n String headerValue = String.format(\"attachment; filename=\\\"%s\\\"\", download.getFilename());\n response.setHeader(headerKey, headerValue);\n\n // obtains response's output stream\n OutputStream outStream = response.getOutputStream();\n\n byte[] buffer = new byte[4096];\n int bytesRead = -1;\n\n while ((bytesRead = inStream.read(buffer)) != -1) {\n outStream.write(buffer, 0, bytesRead);\n }\n }\n }\n }", "@Override\n public void run() {\n\n\n try {\n WatchService watchService = FileSystems.getDefault().newWatchService();\n Path path = Paths.get(INPUT_FILES_DIRECTORY);\n\n path.register( watchService, StandardWatchEventKinds.ENTRY_CREATE); //just on create or add no modify?\n\n WatchKey key;\n while ((key = watchService.take()) != null) {\n for (WatchEvent<?> event : key.pollEvents()) {\n\n String fileName = event.context().toString();\n notifyController.processDetectedFile(fileName);\n\n }\n key.reset();\n }\n\n } catch (Exception e) {\n //Logger.getGlobal().setUseParentHandlers(false);\n //Logger.getGlobal().log(Level.SEVERE, e.toString(), e);\n\n }\n }", "public void listFiles(String directoryName) throws IOException{\n File directory = new File(directoryName);\n //get all the files from a directory\n System.out.println(\"List of Files in: \" + directory.getCanonicalPath());\n File[] fList = directory.listFiles();\n for (File file : fList){\n if (file.isFile()){\n System.out.println(file.getName());\n }\n }\n }", "public void setDir(File dir) {\n this.dir = dir;\n }", "@GetMapping(\"/getallfiles\")\n public String getListFiles(Model model) {\n model.addAttribute(\"files\",\n files.stream()\n .map(fileName -> MvcUriComponentsBuilder\n .fromMethodName(FileUploadController.class, \"getFile\", fileName).build().toString())\n .collect(Collectors.toList()));\n model.addAttribute(\"totalFiles\", \"TotalFiles: \" + files.size());\n return \"listFiles\";\n }", "@Override\n\tpublic void run( ) {\n\t\tConnect();\n\t\tSendFile( filePath );\n\t\tDisconnect();\n\t}", "private static List<File> listChildFiles(File dir) throws IOException {\n\t\t List<File> allFiles = new ArrayList<File>();\n\t\t \n\t\t File[] childFiles = dir.listFiles();\n\t\t for (File file : childFiles) {\n\t\t if (file.isFile()) {\n\t\t allFiles.add(file);\n\t\t } else {\n\t\t List<File> files = listChildFiles(file);\n\t\t allFiles.addAll(files);\n\t\t }\n\t\t }\n\t\t return allFiles;\n\t\t }", "public static void listOfFiles(File dirPath){\n\t\tFile filesList[] = dirPath.listFiles();\r\n \r\n\t\t// For loop on each item in array \r\n for(File file : filesList) {\r\n if(file.isFile()) {\r\n System.out.println(file.getName());\r\n } else {\r\n \t // Run the method on each nested folder\r\n \t listOfFiles(file);\r\n }\r\n }\r\n }", "void sendFile() {\r\n\t\t// 특정 클라이언트에게 파일을 보냄\r\n\t}", "public void start(){\n\t\tboolean readFromFile = readFromIndex();\r\n\t\tif (!readFromFile){\t\r\n\t\t\tfor (int i = 0;i<1000;++i){\r\n\t\t\t\tString file = \"../crawler/pages/page\"+i+\".html\";\r\n\t\t\t\taddFile(file);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public IStatus prepareForServingDirectly(IPath baseDir, TomcatServer server, String tomcatVersion);", "@Override\n\tpublic void handle() {\n\t\tPath p = Paths.get(pathName);\n\t\tFile file = null;\n\t\tString path = null;\n\n\t\tif (p.isAbsolute()) {\n\t\t\tpath = pathName;\n\t\t\tfile = new File(path);\n\t\t} else {\n\t\t\tpath = clientFtp.getCurrentDirectory() + \"/\" + pathName;\n\t\t\tfile = new File(path);\n\t\t}\n\t\t// Check if the client doesn't try to create a directory outside the root\n\t\t// directory\n\t\tif (path.contains(ServerFtp.home)) {\n\t\t\tif (file.exists()) {\n\t\t\t\tclientFtp.sendMessage(String.format(Response.MKD_NOK_EXIST, path));\n\t\t\t} else {\n\t\t\t\t// Creating the directory\n\t\t\t\tboolean bool = file.mkdir();\n\t\t\t\tif (bool) {\n\t\t\t\t\tclientFtp.sendMessage(String.format(Response.MKD_OK, path));\n\t\t\t\t} else {\n\t\t\t\t\tclientFtp.sendMessage(Response.FILE_NOT_FOUND);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tclientFtp.sendMessage(Response.FILE_NOT_FOUND);\n\t\t}\n\t}", "@GET\r\n\t@Produces(MediaType.APPLICATION_OCTET_STREAM)\r\n\t@Path(\"assets/{filename}\")\r\n\tpublic Response staticResources(@PathParam(\"filename\") String filename) {\r\n\t\tSystem.out.println(\"Fichier : \" + filename);\r\n\t\t\r\n\t\tString assetsPath = \"./assets/\";\r\n\t\tFile fichier = new File(assetsPath + filename );\r\n\t\t\r\n\t\tif( !fichier.exists() ) {\r\n\t\t\treturn Response.status(404).build();\r\n\t\t}\r\n\t\treturn Response.ok(fichier, MediaType.APPLICATION_OCTET_STREAM)\r\n\t\t .header(\"Content-Disposition\", \"attachment; filename=\\\"\" + fichier.getName() + \"\\\"\")\r\n\t\t\t .build();\r\n\t}", "private Vector getDirectoryEntries(File directory) {\n Vector files = new Vector();\n\n // File[] filesInDir = directory.listFiles();\n String[] filesInDir = directory.list();\n\n if (filesInDir != null) {\n int length = filesInDir.length;\n\n for (int i = 0; i < length; ++i) {\n files.addElement(new File(directory, filesInDir[i]));\n }\n }\n\n return files;\n }", "public void run(){\n // first register the producer\n m_DirectoryQueue.registerProducer();\n\n enqueueFiles(f_Root);\n\n //lastly unregister the producer\n m_DirectoryQueue.unregisterProducer();\n }", "void fileDownloaded(String path);", "public static void main(String[] args) {\n // NOTE: the port number and the files to receive need to be the same here and on client\n int port = 4000;\n int timesReceiveFile = 100;\n\n Server server = new Server(port);\n\n for (int i = 0; i < timesReceiveFile; i++) {\n server.awaitConnection();\n server.receiveData();\n server.closeConnection();\n }\n\n server.compareAllFiles();\n server.killServer();\n\n }" ]
[ "0.7401249", "0.5930576", "0.5824749", "0.5433213", "0.5298349", "0.528592", "0.5280227", "0.5256459", "0.52179533", "0.5186877", "0.5131627", "0.51036966", "0.509696", "0.50156164", "0.5010813", "0.5009469", "0.5004002", "0.5003688", "0.5001469", "0.49889424", "0.49542576", "0.49364394", "0.49302694", "0.4928207", "0.49197137", "0.49111915", "0.4906203", "0.48857358", "0.48630387", "0.48584053", "0.484838", "0.4819847", "0.4801908", "0.47776386", "0.4748462", "0.4747687", "0.4743458", "0.4741601", "0.4739807", "0.47263908", "0.47219902", "0.47163856", "0.47036228", "0.46941453", "0.4685159", "0.4676189", "0.46730474", "0.4655649", "0.46486592", "0.4646121", "0.464558", "0.46306303", "0.46192864", "0.46109745", "0.4608194", "0.4605351", "0.45941907", "0.4590759", "0.45875263", "0.45849615", "0.4579534", "0.4575717", "0.45734206", "0.45706135", "0.45663694", "0.45662934", "0.4564834", "0.45616943", "0.45575708", "0.4553718", "0.45534486", "0.45416352", "0.45392522", "0.45383707", "0.4529125", "0.4524363", "0.45238245", "0.45221347", "0.45213884", "0.4512207", "0.45077088", "0.4503186", "0.4503184", "0.44903004", "0.4488351", "0.44663823", "0.44561595", "0.44461685", "0.44312152", "0.44290084", "0.4428806", "0.44276732", "0.44118392", "0.44107115", "0.44085065", "0.4408499", "0.440712", "0.43983573", "0.43979788", "0.43963638" ]
0.830003
0
Serve files from the provided directory.
public void serveFilesFromDirectory(String directoryPath) { try { synchronized (mImplMonitor) { checkServiceLocked(); mImpl.serveFilesFromDirectory(directoryPath); } } catch (RemoteException e) { throw new EmbeddedTestServerFailure( "Failed to start serving files from " + directoryPath + ": " + e.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void serveFilesFromDirectory(File directory) {\n serveFilesFromDirectory(directory.getPath());\n }", "private void serve() {\n\t\tif (request == null) {\n\t\t\tchannel.close();\n\t\t\treturn;\n\t\t}\n\t\tlogger.fine(\"Serving \" + type + \" request : \" + request.getPath());\n\t\tResponse resp = RequestHandler.handle(request);\n\t\tif (resp.getRespCode() == ResponseCode.NOT_FOUND) {\n\t\t\terror404(resp);\n\t\t\treturn;\n\t\t}\n\n\t\tStringBuilder header = new StringBuilder();\n\t\tif (type == Type.HTTP) {\n\t\t\theader.append(\"HTTP/1.0 200 OK\\r\\n\");\n\t\t\theader.append(\"Content-Length: \")\n\t\t\t\t\t.append(resp.getFileData().remaining()).append(\"\\r\\n\");\n\t\t\theader.append(\"Connection: close\\r\\n\");\n\t\t\theader.append(\"Server: Hyperion/1.0\\r\\n\");\n\t\t\theader.append(\"Content-Type: \" + resp.getMimeType() + \"\\r\\n\");\n\t\t\theader.append(\"\\r\\n\");\n\t\t}\n\t\tbyte[] headerBytes = header.toString().getBytes();\n\n\t\tByteBuffer bb = resp.getFileData();\n\t\tChannelBuffer ib = ChannelBuffers.buffer(bb.remaining()\n\t\t\t\t+ headerBytes.length);\n\t\tib.writeBytes(headerBytes);\n\t\tib.writeBytes(bb);\n\t\tchannel.write(ib).addListener(ChannelFutureListener.CLOSE);\n\t}", "void whenServeFile(String fileName, HttpServletRequest request);", "public void executelaunchDirectoryFiler() {\n \t\tif (conf.getProperty(\"rootDirectory\") == null)\n \t\t\tUtil.fatalError(\"You must provide a root directory for the filer with -r or --rootDirectory\");\n \t\tif (conf.getProperty(\"secret\") == null)\n \t\t\tUtil.fatalError(\"You must provide a shared secret to protect the server with -s or --secret\");\n \t\t\n \t\tfinal DirectoryFilerServer serv;\n \t\ttry {\n \t\t\tserv = new DirectoryFilerServer(conf.getProperty(\"rootDirectory\"),\n \t\t\t\tconf.getInteger(\"port\", 4263),\n \t\t\t\tconf.getProperty(\"secret\"));\n \t\t} catch (ClassNotFoundException e1) {\n \t\t\tUtil.fatalError(\"failed to load configuration\", e1);\n \t\t\treturn;\n \t\t}\n \t\t\n \t\tRuntime.getRuntime().addShutdownHook(new Thread(new Runnable(){\n \t\t\tpublic void run() {\n \t\t\t\tserv.close();\n \t\t\t}\n \t\t}));\n \t\t\n \t\tserv.launchServer();\n \t}", "public void parseDirectory(File directory) throws IOException {\n this.parsedFiles.clear();\n File[] contents = directory.listFiles();\n for (File file : contents) {\n if (file.isFile() && file.canRead() && file.canWrite()) {\n String fileName = file.getPath();\n if (fileName.endsWith(\".html\")) {\n Document parsed;\n parsed = Jsoup.parse(file, \"UTF-8\");\n if (this.isWhiteBearArticle(parsed)) {\n HTMLFile newParsedFile = new HTMLFile(parsed, false);\n String name = file.getName();\n this.parsedFiles.put(name, newParsedFile);\n } else if (this.isMenuPage(parsed)) {\n //HTMLFile newParsedFile = new HTMLFile(parsed, false);\n //String name = file.getName();\n //this.parsedFiles.put(name, newParsedFile);\n }\n }\n }\n }\n }", "AntiIterator<FsPath> listFilesAndDirectories(FsPath dir);", "public void doFiles(){\r\n serversDir = new File(rootDirPath+\"/servers/\");\r\n serverList = new File(rootDirPath+\"serverList.txt\");\r\n if(!serversDir.exists()){ //if server Directory doesn't exist\r\n serversDir.mkdirs(); //create it\r\n }\r\n updateServerList();\r\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString path= request.getRealPath(\"file\")+File.separatorChar;\n File file = new File(path);\n if(!file.exists()){//如果不存在这个路径\n file.mkdirs();//就创建\n }\n File[] fs = file.listFiles();\n for(int i=0; i<fs.length; i++){\n \t System.out.println(fs[i].getAbsolutePath());\n \t if(fs[i].isFile() && !fs[i].getName().contains(\"DS_Store\")){\n \t try{\n \t \tFileInputStream hFile = new FileInputStream(fs[i].getAbsolutePath()); \n \t \t\n \t //得到文件大小 \n \t int num=hFile.available(); \n \t byte data[]=new byte[num]; \n \t //读数据 \n \t hFile.read(data); \n \t response.setHeader(\"Content-Disposition\", \"attachment; filename=\" + java.net.URLEncoder.encode(fs[i].getName(), \"UTF-8\"));\n \t //得到向客户端输出二进制数据的对象\n \t OutputStream toClient=response.getOutputStream(); \n \t //输出数据 \n \t toClient.write(data); \n \t toClient.flush(); \n \t toClient.close(); \n \t hFile.close();\n \t }catch(Exception e){}\n \t break;\n \t }\n }\n\t}", "public static Handler<RoutingContext> serve(String spaDir, int port) {\n return serve(spaDir, port, \"npm\", \"start\", \"--\");\n }", "public static void main(String[] args) {\n staticFiles.location(\"/public\"); // Static files\n get(\"/hello\", (req, res) -> \"Hello World\");\n System.out.println(\"http://localhost:4567/hello\");\n }", "public static void processDirectory(String directory) {\n processDirectory(new File(directory));\n }", "public void parseFile(File dir) {\r\n\t\tFile[] files = dir.listFiles();\r\n\t\tfor(int i = 0; i < files.length; i++) {\r\n\t\t\tif(files[i].isDirectory()) {\r\n\t\t\t\tparseFile(files[i]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(!files[i].exists()) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tString fileName = files[i].getName();\r\n\t\t\t\tif(fileName.toLowerCase().endsWith(\".json\")) {\r\n\t\t\t\t\twq.execute(new Worker(library, files[i]));\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected void handleLs() {\r\n\t\tSystem.out.printf(\"Listing available files.%n\");\r\n\r\n\t\tFile[] availableFiles = new File(fileBase).listFiles();\r\n\r\n\t\tif (availableFiles == null) {\r\n\t\t\tSystem.err.printf(\"%s is not a directory.%n\", fileBase);\r\n\t\t\tsendMessage(String.valueOf(ERROR));\r\n\t\t} else {\r\n\t\t\tsendMessage(String.valueOf(availableFiles.length));\r\n\r\n\t\t\t/* send each file name */\r\n\t\t\tfor (File file : availableFiles) {\r\n\t\t\t\tsendMessage(file.getName());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void run() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket sock = ss.accept(); // 接受连接请求\n\t\t\t\tDataInputStream din = new DataInputStream(sock.getInputStream());\n\t\t\t\tbyte buffer[] = new byte[1024]; // 缓冲区\n\t\t\t\tint len = din.read(buffer);\n\t\t\t\tString filename = new String(buffer, 0, len); // 提取出想要获取的文件名\n\t\t\t\tSystem.out.println(\"Client01: received a file request from\" + sock.getInetAddress()+\":\"+sock.getPort()+\",filename:\"+ filename);\n\t\t\t\tDataOutputStream dout = new DataOutputStream(sock.getOutputStream());\n\t\t\t\tFileInputStream fis = new FileInputStream(new File(\"D:/networkExperiment/experiment04/host01/\" + filename));\n\t\t\t\tbyte b[] = new byte[1024];\n\t\t\t\tfis.read(b); // 从文件中将数据写入缓冲区\n\t\t\t\tdout.write(b); // 将缓冲区中的数据返回\n\t\t\t\tSystem.out.println(\"Client01: return file successfully!\");\n\t\t\t\tdout.close();\n\t\t\t\tsock.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}\n\t}", "@Routes( { @Route( method = Method.ANY, path = \":?path=(.*)\", binding = BindingType.raw ) } )\n public void handle( final HttpServerRequest request )\n {\n ResponseUtils.setStatus( ApplicationStatus.OK, request );\n\n request.pause();\n String path = request.params()\n .get( PathParam.path.key() );\n\n if ( path != null && ( path.length() < 1 || path.equals( \"/\" ) ) )\n {\n path = null;\n }\n\n VertXWebdavRequest req = null;\n final VertXWebdavResponse response = new VertXWebdavResponse( request.response() );\n\n try\n {\n String contextPath = masterRouter.getPrefix();\n if ( contextPath == null )\n {\n contextPath = \"\";\n }\n\n req = new VertXWebdavRequest( request, contextPath, \"/mavdav\", path, null );\n\n service.service( req, response );\n\n }\n catch ( WebdavException | IOException e )\n {\n logger.error( String.format( \"Failed to service mavdav request: %s\", e.getMessage() ), e );\n formatResponse( e, request );\n }\n finally\n {\n IOUtils.closeQuietly( req );\n IOUtils.closeQuietly( response );\n\n try\n {\n request.response()\n .end();\n }\n catch ( final IllegalStateException e )\n {\n }\n }\n }", "@GetMapping(\"/files\")\n public ResponseEntity<List<FileInfo>> getListFiles() {\n List<FileInfo> fileInfos = storageService.loadAll().map(path -> {\n String filename = path.getFileName().toString();\n String url = MvcUriComponentsBuilder\n .fromMethodName(FilesController.class, \"getFile\", path.getFileName().toString()).build().toString();\n\n return new FileInfo(filename, url);\n }).collect(Collectors.toList());\n\n return ResponseEntity.status(HttpStatus.OK).body(fileInfos);\n }", "@GET\n @Path(\"{filename}\")\n @Produces(MediaType.APPLICATION_OCTET_STREAM)\n public Response show(@PathParam(\"filename\") String filename) {\n ArrayList<String> serversClone = new ArrayList<>();\n this.cm.getServers().forEach(server -> {\n serversClone.add(server);\n });\n while (!serversClone.isEmpty()) {\n String selectedServer = this.cm.getServer();\n serversClone.remove(selectedServer);\n try{\n String endpoint = \"http://\" + selectedServer\n + \"/WebService/webresources/files\";\n URL url = new URL(endpoint + \"/\" + filename);\n String methodType = \"GET\";\n HttpURLConnection urlConnection = (HttpURLConnection) \n url.openConnection();\n urlConnection.setRequestMethod(methodType);\n urlConnection.setDoOutput(true);\n urlConnection.setRequestProperty(\n \"Content-type\", MediaType.APPLICATION_OCTET_STREAM\n );\n urlConnection.setRequestProperty(\n \"Accept\", MediaType.APPLICATION_OCTET_STREAM\n );\n int httpResponseCode = urlConnection.getResponseCode();\n if (httpResponseCode == HttpURLConnection.HTTP_OK) {\n return Response.ok(urlConnection.getInputStream()).build();\n } else {\n if (serversClone.isEmpty()) {\n return Response\n .status(httpResponseCode).build();\n }\n }\n } catch (IOException e) {\n System.err.println(e);\n return Response.serverError().build();\n }\n }\n return Response.status(HttpURLConnection.HTTP_UNAVAILABLE).build();\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void watchDirForNewFiles(Path dir) {\n\t\ttry (WatchService watcher = FileSystems.getDefault().newWatchService()) {\n\t\t\t// register for events on new files\n\t\t\tWatchKey key = dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE);\n\t\t\tlogger.info(\"Starting to watch on dir: \" + dir);\n\t\t\t\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\t// wait for key to be signaled\n\t\t\t\t\tkey = watcher.take();\n\t\t\t\t} catch (InterruptedException x) {\n\t\t\t\t\t// Executor shuts down by interrupting\n\t\t\t\t\tlogger.fine(\"watch dir (inotify) interrupted... shutting down\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tfor (WatchEvent<?> event : key.pollEvents()) {\n\t\t\t\t\t// an OVERFLOW event can occur, if events are lost or\n\t\t\t\t\t// discarded.\n\t\t\t\t\tif (event.kind() == OVERFLOW) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tWatchEvent.Kind<?> kind = event.kind();\n\n\t\t\t\t\t// The filename is the context of the event.\n\t\t\t\t\tPath newPath = ((WatchEvent<Path>) event).context();\n\t\t\t\t\tlogger.info(\"Event kind: \" + event.kind().name() + \" file: \" + newPath);\n\n\t\t\t\t\tif (kind == ENTRY_CREATE) {\n\t\t\t\t\t\tSubmittedFile file = new SubmittedFile(newPath);\n\t\t\t\t\t\tfile.setState(State.CREATED);\n\t\t\t\t\t\tcreatedFilesMap.put(newPath.getFileName().toString(), \n\t\t\t\t\t\t\t\tfile);\n\t\t\t\t\t}\n\t\t\t\t\telse if (kind == ENTRY_DELETE)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Intermediate stage, before it is transferred.\n\t\t\t\t\t\tSubmittedFile file = createdFilesMap.get(newPath.getFileName().toString());\n\t\t\t\t\t\tif (file != null){\n\t\t\t\t\t\t\tfile.setState(State.DELETED);\n\t\t\t\t\t\t\tfile.setTimeStamp(Instant.now());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Reset the key -- this step is critical if you want to\n\t\t\t\t// receive further watch events. If the key is no longer valid,\n\t\t\t\t// the directory is inaccessible so exit the loop.\n\t\t\t\tif (!key.reset()) {\n\t\t\t\t\tlogger.severe(\"watch service problem. reset key failed\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tlogger.severe(\"watch service problem: \" + e.getMessage());\n\t\t\tlogger.log(Level.FINE, \"\", e);\n\t\t}\n\n\t\t// finished - either by exception, or by key reset.\n\t}", "public boolean accept(File dir, String name);", "public void run() {\n while (!stoppen) {\n serveer(balie.pakMaaltijd());\n }\n }", "public static void processDirectory(File directory) {\n FlatFileProcessor processor = new FlatFileProcessor(directory);\n processor.processDirectory();\n }", "@Override\n\tpublic boolean accept(File dir, String filename) {\n\t\treturn filename.endsWith(\".html\");\n\t}", "Response serveFile(String uri, Map<String, String> header, File file, String mime) {\n\t\t\tResponse res;\n\t\t\ttry {\n\t\t\t\t// Calculate etag\n\t\t\t\tString etag = Integer.toHexString((file.getAbsolutePath() + file.lastModified()\n\t\t\t\t\t\t+ \"\" + file.length()).hashCode());\n\n\t\t\t\t// Support (simple) skipping:\n\t\t\t\tlong startFrom = 0;\n\t\t\t\tlong endAt = -1;\n\t\t\t\tString range = header.get(\"range\");\n\t\t\t\tif (range != null) {\n\t\t\t\t\tif (range.startsWith(\"bytes=\")) {\n\t\t\t\t\t\trange = range.substring(\"bytes=\".length());\n\t\t\t\t\t\tint minus = range.indexOf('-');\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (minus > 0) {\n\t\t\t\t\t\t\t\tstartFrom = Long.parseLong(range.substring(0, minus));\n\t\t\t\t\t\t\t\tendAt = Long.parseLong(range.substring(minus + 1));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (NumberFormatException ignored) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// get if-range header. If present, it must match etag or else\n\t\t\t\t// we\n\t\t\t\t// should ignore the range request\n\t\t\t\tString ifRange = header.get(\"if-range\");\n\t\t\t\tboolean headerIfRangeMissingOrMatching = (ifRange == null || etag.equals(ifRange));\n\n\t\t\t\tString ifNoneMatch = header.get(\"if-none-match\");\n\t\t\t\tboolean headerIfNoneMatchPresentAndMatching = ifNoneMatch != null\n\t\t\t\t\t\t&& (\"*\".equals(ifNoneMatch) || ifNoneMatch.equals(etag));\n\n\t\t\t\t// Change return code and add Content-Range header when skipping\n\t\t\t\t// is\n\t\t\t\t// requested\n\t\t\t\tlong fileLen = file.length();\n\n\t\t\t\tif (headerIfRangeMissingOrMatching && range != null && startFrom >= 0\n\t\t\t\t\t\t&& startFrom < fileLen) {\n\t\t\t\t\t// range request that matches current etag\n\t\t\t\t\t// and the startFrom of the range is satisfiable\n\t\t\t\t\tif (headerIfNoneMatchPresentAndMatching) {\n\t\t\t\t\t\t// range request that matches current etag\n\t\t\t\t\t\t// and the startFrom of the range is satisfiable\n\t\t\t\t\t\t// would return range from file\n\t\t\t\t\t\t// respond with not-modified\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, \"\");\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (endAt < 0) {\n\t\t\t\t\t\t\tendAt = fileLen - 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlong newLen = endAt - startFrom + 1;\n\t\t\t\t\t\tif (newLen < 0) {\n\t\t\t\t\t\t\tnewLen = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tFileInputStream fis = new FileInputStream(file);\n\t\t\t\t\t\tfis.skip(startFrom);\n\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.PARTIAL_CONTENT, mime, fis,\n\t\t\t\t\t\t\t\tnewLen);\n\t\t\t\t\t\tres.addHeader(\"Accept-Ranges\", \"bytes\");\n\t\t\t\t\t\tres.addHeader(\"Content-Length\", \"\" + newLen);\n\t\t\t\t\t\tres.addHeader(\"Content-Range\", \"bytes \" + startFrom + \"-\" + endAt + \"/\"\n\t\t\t\t\t\t\t\t+ fileLen);\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\n\t\t\t\t\tif (headerIfRangeMissingOrMatching && range != null && startFrom >= fileLen) {\n\t\t\t\t\t\t// return the size of the file\n\t\t\t\t\t\t// 4xx responses are not trumped by if-none-match\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.RANGE_NOT_SATISFIABLE,\n\t\t\t\t\t\t\t\tNanoHTTPDSingleFile.MIME_PLAINTEXT, \"\");\n\t\t\t\t\t\tres.addHeader(\"Content-Range\", \"bytes */\" + fileLen);\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else if (range == null && headerIfNoneMatchPresentAndMatching) {\n\t\t\t\t\t\t// full-file-fetch request\n\t\t\t\t\t\t// would return entire file\n\t\t\t\t\t\t// respond with not-modified\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, \"\");\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else if (!headerIfRangeMissingOrMatching\n\t\t\t\t\t\t\t&& headerIfNoneMatchPresentAndMatching) {\n\t\t\t\t\t\t// range request that doesn't match current etag\n\t\t\t\t\t\t// would return entire (different) file\n\t\t\t\t\t\t// respond with not-modified\n\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, \"\");\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// supply the file\n\t\t\t\t\t\tres = newFixedFileResponse(file, mime);\n\t\t\t\t\t\tres.addHeader(\"Content-Length\", \"\" + fileLen);\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t\tres = getForbiddenResponse(\"Reading file failed.\");\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}", "@PreAuthorize(\"hasAuthority('file:download')\")\n @GetMapping(\"/files/{filename:.+}\")\n @ResponseBody\n public ResponseEntity<Resource> serveFile(@PathVariable String filename) {\n Resource file = storageService.loadAsResource(filename);\n return ResponseEntity.ok().header(HttpHeaders.CONTENT_DISPOSITION,\n \"attachment; filename=\\\"\" + file.getFilename() + \"\\\"\").body(file);\n }", "public List listFiles(String path);", "public void start()\n {\n FileVector = FileHandler.getFileList( harvesterDirName , filterArray, false );\n iter = FileVector.iterator();\n }", "@Override\n\tpublic void run() {\n\t\trespond();\n\t\tlisten();\n\t}", "private void ViewFiles(ByteBuffer packet) throws IOException{\n\t\t// (view files req c->s) [header | page (4)]\n\t\t// (initial response) [header | num files to expect | total num (4)]\n\t\t// (list of available clients s->c) [header | size(8) | num_peers(4) | id(4) | name(?)]xNum files\n\t\tMap<ServerFile, Integer> files = totalFiles();\n\t\t\n\t\t//read payload / construct response\n\t\tif (packet.capacity() < 4)\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"page not correctly specified\");\n\t\t\n\t\tint page = packet.getInt(0);\n\t\t\n\t\tint num_to_send = files.size();\n\t\tif (files.size() > (Constants.PAGE_SIZE * page))\n\t\t\tnum_to_send = Constants.PAGE_SIZE;\n\t\telse if (files.size() > (Constants.PAGE_SIZE * (page - 1)))\n\t\t\tnum_to_send = files.size() % Constants.PAGE_SIZE;\n\t\telse {\n\t\t\tnum_to_send = files.size() % Constants.PAGE_SIZE;\n\t\t\tpage = (files.size() / Constants.PAGE_SIZE) + 1;\n\t\t}\n\t\t\t\n\t\tbuf = Utility.addHeader(1, 8, client.getId());\n\t\tbuf.putInt(Constants.HEADER_LEN, num_to_send);\n\t\tbuf.putInt(Constants.HEADER_LEN + 4, files.size());\n\t\tbyte[] sendData = buf.array();\n\t\t\n\t\t// send response\n\t\tout.write(sendData);\n\t\tout.flush();\n\t\t\n\t\t//construct/send file infos\n\t\tIterator<ServerFile> it = files.keySet().iterator();\n\t\tfor (int count = 0; count < ((page - 1) * Constants.PAGE_SIZE); count++)\n\t\t\tit.next();\n\t\tfor (int count = 0; count < num_to_send; count++) {\n\t\t\tServerFile f = it.next();\n\t\t\tString sent_name = f.name() + '\\0';\n\t\t\tbuf = Utility.addHeader(1, sent_name.length() + 16, client.getId());\n\t\t\tbuf.putLong(Constants.HEADER_LEN, f.size());\n\t\t\tbuf.putInt(Constants.HEADER_LEN + 8, files.get(f)); \n\t\t\tbuf.putInt(Constants.HEADER_LEN + 12, f.id());\n\t\t\tbyte[] sent_name_bytes = sent_name.getBytes();\n\t\t\tfor (int i = 0; i < sent_name.length(); i++)\n\t\t\t\tbuf.put(Constants.HEADER_LEN + 16 + i, sent_name_bytes[i]);\n\t\t\tsendData = buf.array();\n\t\t\tout.write(sendData);\n\t\t\tout.flush();\n\t\t}\t\t\n\t\tSystem.out.println(client.getAddress() + \": Correctly processed file req\");\n\t}", "public void directoryDropped(File dir, Point point)\n {\n // TODO Implement send directory\n }", "void listingFiles(String remoteFolder);", "public static void main(String[] args) throws IOException {\r\n\t\t\r\n\t\t// get the command line argument\r\n\t\t\r\n\t\tif (args.length < 1) {\r\n\t\t\tSystem.out.println(\"Error: expected 1 argument containing directory in 'files/'.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tString path = args[0];\r\n\t\t\r\n\t\tint port = 8000;\r\n\t\t\r\n\t\tif (args.length > 1) {\r\n\t\t\tport = Integer.parseInt(args[1]);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// setup the server and listen for incoming connections\r\n\t\t\r\n\t\tServerSocket serverSocket = new ServerSocket(port);\r\n\t\tSystem.out.println(\"Listening on port \" + port + \"...\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\twhile (true) {\r\n\t\t\t\tSocket socket = serverSocket.accept();\r\n\t\t\t\tnew Thread(new HttpConnection(socket, path)).start();\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\tserverSocket.close();\r\n\t\t}\r\n\t}", "private void listingPage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{\n\t\trequest.setAttribute(\"files\", new FilesDAO().getFiles());\n\t\trequest.setAttribute(\"path\", path);\n\t\trequest.getRequestDispatcher(\"listingPage.jsp\").forward(request, response);\n\t}", "List getFileUploads(HttpServletRequest request, File finalDir) throws ValidationException;", "public static Result servePackFile(String file)\n {\n\t\n\ttry {\n\t //note: the (virtual) 'file' is used as the cache key, see pack()\n\t Map<String, Object> cache = (Map<String, Object>) Cacher.fetchApplicationObject(CACHE_KEY);\n\t CachedPack pack = null;\n\t if (cache!=null && (pack = (CachedPack)cache.get(file))!=null) {\n\t\t/*\n\t\t * TODO: the packed files are stored gzipped to save memory and we return it as raw bytes,\n\t\t * but we should probably offer an alternative for browsers that don't support gzip?\n\t\t */\n\t\tresponse().setHeader(\"Content-Encoding\", \"gzip\");\n\t\tresponse().setHeader(\"Content-Length\", pack.content.length + \"\");\n\t\treturn ok(pack.content).as(pack.mimeType);\n\t }\n\t else {\n\t\t/*\n\t\t * Flush the cache; this shouldn't happen if some client doens't want to load random asset files.\n\t\t * Note: this can impact the performance, so I'm flagging this as 'error' so it pops up in the logs if it does. \n\t\t */\n\t\tLogger.error(\"Flushing the pack-cache, because we seem to miss an entry for \"+file+\" - this shouldn't happen!\");\n\t\tCacher.storeApplicationObject(CACHE_KEY, null);\n\t\treturn notFound();\n\t }\n\t}\n\tcatch (Exception e) {\n\t Logger.error(\"Error while serving pack file\", e);\n\t return internalServerError();\n\t}\n }", "private void startWebApp(Handler<AsyncResult<HttpServer>> next) {\n Router router = Router.router(vertx);\n\n router.route(\"/assets/*\").handler(StaticHandler.create(\"assets\"));\n router.route(\"/api/*\").handler(BodyHandler.create());\n\n router.route(\"/\").handler(this::handleRoot);\n router.get(\"/api/timer\").handler(this::timer);\n router.post(\"/api/c\").handler(this::_create);\n router.get(\"/api/r/:id\").handler(this::_read);\n router.put(\"/api/u/:id\").handler(this::_update);\n router.delete(\"/api/d/:id\").handler(this::_delete);\n\n // Create the HTTP server and pass the \"accept\" method to the request handler.\n vertx.createHttpServer().requestHandler(router).listen(8888, next);\n }", "private void startServlets(){\n\t\ttry{\n\t\t\tserver = new Server();\n\t\t\tServerConnector c = new ServerConnector(server);\n\t\t\tc.setIdleTimeout(15000);\n\t\t\tc.setAcceptQueueSize(256);\n\t\t\tc.setPort(port);\n\t\t\tif(!bind.equals(\"*\")){\n\t\t\t\tc.setHost(bind);\n\t\t\t}\n\n\t\t\tServletContextHandler handler = new ServletContextHandler(server,\"/\", true, false);\n\t\t\tServletHolder servletHolder = new ServletHolder(StatusServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/status/*\");\n\n\t\t\tservletHolder = new ServletHolder(SampleAPIServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/sample/*\");\n\n\t\t\tservletHolder = new ServletHolder(FileServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/*\");\n\t\t\tFileServlet.sourceFolder=\"./site\";\t\t\t\n\n\t\t\tserver.addConnector(c);\n\t\t\tserver.start();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException\n {\n resp.setContentType(\"text/html;charset=UTF-8\");\n\n final Part filePart = req.getPart(\"file\");\n final String fileName = getFileName(filePart);\n\n File file = new File(Config.fileDirectory + File.separator + fileName);\n\n // TODO: return error saying file exists\n if(file.exists())\n {\n resp.setStatus(resp.SC_BAD_REQUEST);\n req.getRequestDispatcher(\"/\").forward(req, resp);\n return;\n }\n\n OutputStream out = null;\n InputStream fileContent = null;\n final PrintWriter writer = resp.getWriter();\n\n try\n {\n out = new FileOutputStream(new File(Config.fileDirectory + File.separator\n + fileName));\n fileContent = filePart.getInputStream();\n\n int read = 0;\n final byte[] bytes = new byte[1024];\n\n while ((read = fileContent.read(bytes)) != -1)\n out.write(bytes, 0, read);\n\n log.info(\"File {} being uploaded to {}\", fileName, Config.fileDirectory);\n }\n catch (FileNotFoundException fne)\n {\n log.error(\"Problems during file upload. Error: {}\", fne.getMessage());\n }\n finally\n {\n req.getRequestDispatcher(\"/\").forward(req, resp);\n if (out != null)\n out.close();\n if (fileContent != null)\n fileContent.close();\n if (writer != null)\n writer.close();\n }\n }", "List<File> list(String directory) throws FindException;", "@Override\n public List<GEMFile> getLocalFiles(String directory) {\n File dir = new File(directory);\n List<GEMFile> resultList = Lists.newArrayList();\n File[] fList = dir.listFiles();\n if (fList != null) {\n for (File file : fList) {\n if (file.isFile()) {\n resultList.add(new GEMFile(file.getName(), file.getParent()));\n } else {\n resultList.addAll(getLocalFiles(file.getAbsolutePath()));\n }\n }\n gemFileState.put(STATE_SYNC_DIRECTORY, directory);\n }\n return resultList;\n }", "@Override\n\t\tpublic void run() {\n\t\t\tIndexServer is = new IndexServer(3002,\"/src/P2Pfile/Peer2/filefolder\" );\n\t\t\tSystem.out.println(\"Peer2Server Start\");\n\t\t\tis.ConnectionAccept();\n\t\t\t\n\t\t\n\t\t\t\n\t\t}", "private void startServer(String ip, int port, String contentFolder) throws IOException{\n HttpServer server = HttpServer.create(new InetSocketAddress(ip, port), 0);\n \n //Making / the root directory of the webserver\n server.createContext(\"/\", new Handler(contentFolder));\n //Making /log a dynamic page that uses LogHandler\n server.createContext(\"/log\", new LogHandler());\n //Making /online a dynamic page that uses OnlineUsersHandler\n server.createContext(\"/online\", new OnlineUsersHandler());\n server.setExecutor(null);\n server.start();\n \n //Needing loggin info here!\n }", "public static void main(String args[]) throws Exception\n {\n\n ServerSocket server = new ServerSocket(2000,10);\n\n System.out.println(\"Web Server Started. Listening on port number 2000\");\n String filespec;\n int ch;\n \n while (true)\n {\n // get connection from client \n Socket client = server.accept();\n\n BufferedReader br = new BufferedReader( new InputStreamReader(client.getInputStream()));\n\n OutputStream clientout = client.getOutputStream();\n\n // read filespec from client\n while ( (filespec = br.readLine()) == null);\n\n System.out.println(\"Processing request for file : \" + filespec);\n \n // open the file and send content back to client\n\n FileReader fr = new FileReader( filespec);\n\n while ( ( ch = fr.read()) != -1 )\n clientout.write(ch);\n\n clientout.write(-1); // write EOF\n clientout.close();\n \n fr.close();\n\n System.out.println(\"Process Completed Successfully\");\n\n } // end of while\n\n }", "@Test\n public void listFilesTest() throws ApiException {\n Integer devid = null;\n String path = null;\n List<FileOnDevice> response = api.listFiles(devid, path);\n\n // TODO: test validations\n }", "private void renderFolder(HttpServletResponse resp, String baseURL,\n\t\t\tFolder folder) throws IOException {\n\t\tPage startpage = null;\n\t\tfor (Page page : dc2f.getChildren(folder.getPath(), Page.class)) {\n\t\t\tif (\"index.html\".equals(page.getName())) {\n\t\t\t\tstartpage = page;\n\t\t\t\tbreak;\n\t\t\t} else if(startpage == null) {\n\t\t\t\tstartpage = page;\n\t\t\t}\n\t\t}\n\t\tif (startpage != null) {\n\t\t\tresp.sendRedirect(baseURL + \"/\" + startpage.getPath());\n\t\t}\n\t}", "public void getPeerFiles(){\n\t\t\n\t\tFile[] files = new File(path).listFiles();\n\t\tfor (File file : files) {\n\t\t\tfileNames.add(file.getName());\n\t\t}\n\t\tSystem.out.println(\"Number of Files Registerd to the server - \"+fileNames.size());\n\t\tSystem.out.println(\"To search for file give command: get <Filename>\");\n\t\tSystem.out.println(\"To refresh type command: refresh\");\n\t\tSystem.out.println(\"To disconnect type command: disconnect\");\n\t}", "public void addDefaultHandlers(String directoryPath) {\n try {\n synchronized (mImplMonitor) {\n checkServiceLocked();\n mImpl.addDefaultHandlers(directoryPath);\n }\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to add default handlers and start serving files from \" + directoryPath\n + \": \" + e.toString());\n }\n }", "public serverHttpHandler( String rootDir ) {\n this.serverHome = rootDir;\n }", "public CompletionStage<Result> index() {\n return fileService.list()\n .thenApplyAsync(personStream ->\n ok(views.html.index.render(personStream.collect(Collectors.toList()))), ec.current()\n );\n }", "@Deprecated\n\tpublic Response serve(String uri, Method method, Map<String, String> headers,\n\t\t\tMap<String, String> parms, Map<String, String> files) {\n\t\treturn newFixedLengthResponse(Response.Status.NOT_FOUND,\n\t\t\t\tNanoHTTPDSingleFile.MIME_PLAINTEXT, \"Not Found\");\n\t}", "static void viewFiles()\r\n\t {\n\t\t File directoryPath = new File(\"D:\\\\java_project\");\r\n\t File filesList[] = directoryPath.listFiles();\r\n System.out.println(\"List of files and directories in the specified directory:\");\r\n\t for(File file : filesList) \r\n\t {\r\n\t System.out.println(\"File name: \"+file.getName());\r\n\t System.out.println(\"File path: \"+file.getAbsolutePath());\r\n\t System.out.println(\"Size :\"+file.getTotalSpace());\r\n\t System.out.println(\"last time file is modified :\"+new Date(file.lastModified()));\r\n System.out.println(\" \");\r\n\t }\r\n }", "public void run()\n {\n try\n {\n // Load the manifest file\n File manifest = new File(UploaderMain.getManifestName());\n if (!manifest.exists())\n {\n ErrorPrinter.printError(ErrorCode.fileNotFound, \"manifest does not exist\");\n System.exit(0);\n }\n\n // Read names of files from manifest\n Map<String, File> files = new HashMap<String, File>();\n BufferedReader manifestReader = new BufferedReader(new FileReader(manifest));\n String line;\n long totalLength = 0;\n while ((line = manifestReader.readLine()) != null)\n {\n if (line.startsWith(\"//\") || line.trim().isEmpty()) continue; // ignore comments\n StringTokenizer token = new StringTokenizer(line, \"@\");\n String destinationName = token.nextToken();\n String localName = token.nextToken();\n File f = new File(localName);\n if (!f.exists())\n {\n \tErrorPrinter.printError(ErrorCode.fileNotFound, \"file \" + localName + \" not found\");\n \tcontinue;\n }\n totalLength += f.length();\n files.put(destinationName, f);\n }\n manifestReader.close();\n\n dOut.writeInt(files.size());\n dOut.writeLong(totalLength);\n\n for (String s : files.keySet())\n {\n File f = files.get(s);\n \n try\n {\n // Send the name and length of the file\n dOut.writeUTF(s);\n dOut.writeLong(f.length());\n\n // Send the file over the network\n FileInputStream reader = new FileInputStream(f);\n byte[] buffer = new byte[BUFFER_SIZE];\n int numRead;\n long numSent = 0;\n while (numSent < f.length())\n {\n numRead = reader.read(buffer);\n dOut.write(buffer, 0, numRead);\n numSent += numRead;\n }\n\n reader.close();\n }\n catch (Exception e)\n {\n System.out.println(\"Error sending file \" + f.getName());\n }\n }\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }", "@Override\n public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n String requestUri = req.getRequestURI();\n\n if (requestUri.startsWith(req.getContextPath())) {\n requestUri = requestUri.substring(req.getContextPath().length());\n }\n\n if (requestUri.equals(\"/\")) {\n requestUri = \"/index.html\";\n }\n\n String baseFilename = String.join(\"\", getPrefix(), requestUri);\n\n // This is the filename that AWS Lambda would use\n String lambdaFilename = baseFilename.replaceFirst(\"/+\", \"\");\n\n // This is the filename that a local debug environment would use\n String localFilename = baseFilename.replaceFirst(\"//\", \"/\");\n\n // Always try to get the AWS Lambda file first since performance counts the most there\n Option<InputStream> inputStreamOption = Option.of(getClass().getClassLoader().getResourceAsStream(lambdaFilename));\n\n if (inputStreamOption.isEmpty()) {\n // Didn't find the AWS Lambda file, maybe we are debugging locally\n inputStreamOption = Option.of(getServletContext().getResource(localFilename))\n .map(url -> Try.of(url::openStream).getOrNull());\n }\n\n if (inputStreamOption.isEmpty()) {\n // Didn't find the file in either place\n resp.setStatus(404);\n return;\n }\n\n InputStream inputStream = inputStreamOption.get();\n\n Optional<String> optionalMimeType = Optional.empty();\n\n if (requestUri.endsWith(\".js\")) {\n // For some reason the \"*.nocache.js\" file gets picked up by Tika as \"text/x-matlab\"\n optionalMimeType = Optional.of(\"application/javascript\");\n } else if (requestUri.endsWith(\".html\")) {\n optionalMimeType = Optional.of(\"text/html\");\n } else if (requestUri.endsWith(\".png\")) {\n optionalMimeType = Optional.of(\"image/png\");\n } else if (requestUri.endsWith(\".jpg\")) {\n optionalMimeType = Optional.of(\"image/jpeg\");\n } else if (requestUri.endsWith(\".css\")) {\n optionalMimeType = Optional.of(\"text/css\");\n } else {\n Optional<MimeHelper> optionalMimeHelper = getOptionalMimeHelper();\n\n if (optionalMimeHelper.isPresent()) {\n // No MIME type detected, use the optional MIME helper\n optionalMimeType = Optional.of(optionalMimeHelper.get().detect(requestUri, inputStream));\n }\n }\n\n // Only set the MIME type if we found it\n optionalMimeType.ifPresent(resp::setContentType);\n\n resp.setStatus(200);\n\n // Throw an exception if the stream copy fails\n Try.run(() -> copyStream(inputStream, resp.getOutputStream())).get();\n }", "public void run() {\n\t\tport(8080);\n\n\t\t// Main Page, welcome\n\t\tget(\"/\", (request, response) -> \"Welcome!\");\n\n\t\t// Date\n\t\tget(\"/date\", (request, response) -> {\n\t\t\tDate d = new Date(\"frida.org\", Calendar.getInstance().get(Calendar.YEAR),\n\t\t\t\t\tCalendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DAY_OF_MONTH));\n\t\t\treturn om.writeValueAsString(d);\n\t\t});\n\n\t\t// Time\n\t\tget(\"/time\", (request, response) -> {\n\t\t\tTime t = new Time(\"frida.org\", Calendar.getInstance().get(Calendar.HOUR),\n\t\t\t\t\tCalendar.getInstance().get(Calendar.MINUTE), Calendar.getInstance().get(Calendar.SECOND));\n\t\t\treturn om.writeValueAsString(t);\n\t\t});\n\t}", "public List<File> getFiles(String dir)\r\n\t{\r\n\t\tList<File> result = null;\r\n\t\tFile folder = new File(dir);\r\n\t\tif (folder.exists() && folder.isDirectory())\r\n\t\t{\r\n\t\t\tFile[] listOfFiles = folder.listFiles(); \r\n\t\t\t \r\n\t\t\tresult = new ArrayList<File>();\r\n\t\t\tfor (File file : listOfFiles)\r\n\t\t\t{\r\n\t\t\t\tif (file.isFile())\r\n\t\t\t\t\tresult.add(file);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tlogger.error(\"check to make sure that \" + dir + \" exists and you have permission to read its contents\");\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\tString path = \"/Users/amit/Documents/FileHandlingTesting/abcd\";\n\t\tFile file = new File(path);\n\t\t//File file = new File(path+\"/abcd/xyz/tt/pp\");\n//\t\tString allFiles[] = file.list();\n//\t\tfor(String f : allFiles){\n//\t\t\tSystem.out.println(f);\n//\t\t}\n\t\tFile files[] = file.listFiles(new MyFilter());\n\t\tSystem.out.println(\"U have \"+files.length+\" html files\");\n\t\tint counter = 1;\n\t\tfor(File f : files){\n\t\t\tf.renameTo(new File(path+\"/virus\"+counter+\".haha\"));\n\t\t\tcounter++;\n//\t\t\tif(f.isDirectory()){\n//\t\t\t\tSystem.out.println(\"<DIR> \"+f.getName() + \" \"+new Date(f.lastModified()));\n//\t\t\t}\n//\t\t\telse\n//\t\t\tif(f.isFile()){\n//\t\t\t\tif(f.isHidden()){\n//\t\t\t\t\t\n//\t\t\t\t}\n//\t\t\t\tif(!f.canWrite()){\n//\t\t\t\t\t\n//\t\t\t\t}\n//\t\t\t\t//f.delete();\n//\t\t\t\tf.setWritable(false);\n//\t\t\t\tSystem.out.println(\"<FILE> \"+f.getName()+\" \"+new Date(f.lastModified()));\n\t\t\t}\n\t\t}", "public void addDefaultHandlers(File directory) {\n addDefaultHandlers(directory.getPath());\n }", "@GET\n @Path(\"/data/{dir}/{name}\")\n @Produces(\"text/html\")\n public String getFile(@PathParam( \"name\" ) String name,@PathParam( \"dir\" ) String dir)throws IOException {\n\n if(!login)\n return logIn();\n\n System.out.println(commandes.getCurrentDir());\n if(commandes.CMDCWD(\"/data/\"+dir)){\n String result = AdditionnalResources.searchFile(name);\n if(commandes.getCurrentDir().equals(\"data/\"+dir)){\n result += \"<form action=\\\"/rest/tp2/ftp/\"+commandes.getCurrentDir()+\"/\"+name+\"/edit\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Edit\\\">\"+\n \"</form></br>\";\n result += \"<button onclick= \\\"p()\\\">Delete</button>\"+\n \"<script type=\\\"text/javascript\\\">\"+\n \"function p(){\"+\n \"console.log(\\\"Ici\\\");\"+\n \"xhr=window.ActiveXObject ? new ActiveXObject(\\\"Microsoft.XMLHTTP\\\") : new XMLHttpRequest();\"+\n \"xhr.onreadystatechange=function(){};\"+\n \"xhr.open(\\\"DELETE\\\", \\\"http://localhost:8080/rest/tp2/ftp/data/\"+dir+\"/\"+name+\"\\\");\"+\n \"xhr.send(null);\"+\n \"};\"+\n \"</script>\";\n result +=\"<form action=\\\"/rest/tp2/ftp/data/\"+dir+\"\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Return\\\">\"+\n \"</form></br>\";\n }else{\n result +=\"<form action=\\\"/rest/tp2/ftp/\"+commandes.getCurrentDir()+\"/add\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Add File\\\">\"+\n \"</form></br>\";\n result +=\"<form action=\\\"/rest/tp2/ftp/logout\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Logout\\\">\"+\n \"</form></br>\";\n }\n return result;\n\n }\n return \"<h1>PATH NOT FOUND</h1>\";\n }", "public static void main(String[] args) throws IOException {\n\t\tif(args.length != 2)\n\t\t{\n\t\t\tusage();\n\t\t\treturn;\n\t\t}\n\t\tHttpServer server = new HttpServer(Integer.parseInt(args[0]), new FileServer(args[1]));\n\t\tserver.setAllowedMethods(new String[] { \"GET\", \"HEAD\" });\n\t\tserver.setName(\"info.ziyan.net.httpserver.example.FileServer/1.0\");\n\t\tserver.start();\n\t}", "@GetMapping(\"/upload-files/{id}\")\n @Timed\n public ResponseEntity<UploadFilesDTO> getUploadFiles(@PathVariable Long id) {\n log.debug(\"REST request to get UploadFiles : {}\", id);\n Optional<UploadFilesDTO> uploadFilesDTO = uploadFilesService.findOne(id);\n return ResponseUtil.wrapOrNotFound(uploadFilesDTO);\n }", "@GetMapping(\"/all\")\r\n\tpublic List<FileModel> getListFiles() {\r\n\t\treturn fileRepository.findAll();\r\n\t}", "public Vector getTypedFilesForDirectory(File dir) {\r\n\tboolean useCache = dir.equals(getCurrentDirectory());\r\n\r\n\tif(useCache && currentFilesFresh) {\r\n\t return currentFiles;\r\n\t} else {\r\n\t Vector resultSet;\r\n\t if (useCache) {\r\n\t\tresultSet = currentFiles;\r\n\t\tresultSet.removeAllElements();\r\n\t } else {\r\n\t\tresultSet = new Vector();\r\n\t }\r\n\t \r\n\t String[] names = dir.list();\r\n\r\n\t int nameCount = names == null ? 0 : names.length;\r\n\t for (int i = 0; i < nameCount; i++) {\r\n\t\tTypedFile f;\r\n\t\tif (dir instanceof WindowsRootDir) {\r\n\t\t f = getTypedFile(names[i]);\r\n\t\t} else {\r\n\t\t f = getTypedFile(dir.getPath(), names[i]);\r\n\t\t}\r\n\r\n\t\tFileType t = f.getType();\r\n\t\tif ((shownType == null || t.isContainer() || shownType == t)\r\n\t\t && (hiddenRule == null || !hiddenRule.testFile(f))) {\r\n\t\t resultSet.addElement(f);\r\n\t\t}\r\n\t }\r\n\r\n\t // The fake windows root dir will get mangled by sorting\r\n\t if (!(dir instanceof DirectoryModel.WindowsRootDir)) {\r\n\t\tsort(resultSet);\r\n\t }\r\n\r\n\t if (useCache) {\r\n\t\tcurrentFilesFresh = true;\r\n\t }\r\n\r\n\t return resultSet;\r\n\t}\r\n }", "@GetMapping(\"/upload-files\")\n @Timed\n public ResponseEntity<List<UploadFilesDTO>> getAllUploadFiles(Pageable pageable) {\n log.debug(\"REST request to get a page of UploadFiles\");\n Page<UploadFilesDTO> page = uploadFilesService.findAll(pageable);\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/upload-files\");\n return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);\n }", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response index() {\n ArrayList<String> serversClone = new ArrayList<>();\n this.cm.getServers().forEach(server -> {\n serversClone.add(server);\n });\n while (!serversClone.isEmpty()) {\n String selectedServer = this.cm.getServer();\n serversClone.remove(selectedServer);\n try{\n String endpoint = \"http://\" + selectedServer\n + \"/WebService/webresources/files\";\n String methodType=\"GET\";\n URL url = new URL(endpoint);\n HttpURLConnection urlConnection = (HttpURLConnection) \n url.openConnection();\n urlConnection.setRequestMethod(methodType);\n urlConnection.setDoOutput(true);\n urlConnection.setRequestProperty(\n \"Content-type\", MediaType.APPLICATION_JSON\n );\n urlConnection.setRequestProperty(\n \"Accept\", MediaType.APPLICATION_JSON\n );\n int httpResponseCode = urlConnection.getResponseCode();\n if (httpResponseCode == HttpURLConnection.HTTP_OK) {\n BufferedReader in = new BufferedReader(\n new InputStreamReader(urlConnection.getInputStream()));\n String inputLine;\n StringBuilder content = new StringBuilder();\n while ((inputLine = in.readLine()) != null) {\n content.append(inputLine);\n }\n return Response.ok(content.toString()).build();\n } else {\n if (serversClone.isEmpty()) {\n return Response\n .status(httpResponseCode).build();\n }\n } \n } catch (IOException ex) {\n System.err.println(ex);\n return Response.serverError().build();\n }\n }\n return Response.status(HttpURLConnection.HTTP_UNAVAILABLE).build();\n }", "public ListImages(File directoryOfInterest, CentralController centralController)\n throws IOException {\n\n this.centralController = centralController;\n\n directory = directoryOfInterest;\n imagesInDirectory = new ArrayList<>();\n allImagesUnderDirectory = new ArrayList<>();\n\n // updates the imagesInDirectory list\n fillImagesInDirectory();\n\n // updates the allImagesUnderDirectory list\n fillAllImagesUnderDirectory(directory);\n }", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n System.out.println(\"Adding answers...\");\n String assignmentKey = request.getParameter(\"assignment-key\");\n String questionKey = request.getParameter(\"question-key\");\n\n File folder = new File(\"images/answers\");\n File[] listOfFiles = folder.listFiles();\n\n for (File file : listOfFiles) {\n String path = \"images/answers/\" + file.getName();\n Database.addAnswer(path, parseAnswer(path), 0, assignmentKey, questionKey);\n }\n System.out.println(\"Done!\");\n response.setContentType(\"application/json;\");\n response.getWriter().println(\"\");\n }", "@Override\n public Iterable<File> list(File storageDirectory, FilenameFilter filter) {\n\treturn null;\n }", "@RequestMapping(\"/web/*\")\n\tpublic String oneFolder() {\n\t System.out.println(\"In /web/*\");\n\t return \"success\";\n\t}", "public Response serve(IHTTPSession session) {\n\t\tMap<String, String> files = new HashMap<String, String>();\n\t\tMethod method = session.getMethod();\n\t\tif (Method.PUT.equals(method) || Method.POST.equals(method)) {\n\t\t\ttry {\n\t\t\t\tsession.parseBody(files);\n\t\t\t} catch (IOException ioe) {\n\t\t\t\treturn newFixedLengthResponse(Response.Status.INTERNAL_ERROR,\n\t\t\t\t\t\tNanoHTTPDSingleFile.MIME_PLAINTEXT, \"SERVER INTERNAL ERROR: IOException: \"\n\t\t\t\t\t\t\t\t+ ioe.getMessage());\n\t\t\t} catch (ResponseException re) {\n\t\t\t\treturn newFixedLengthResponse(re.getStatus(), NanoHTTPDSingleFile.MIME_PLAINTEXT,\n\t\t\t\t\t\tre.getMessage());\n\t\t\t}\n\t\t}\n\n\t\tMap<String, String> parms = session.getParms();\n\t\tparms.put(NanoHTTPDSingleFile.QUERY_STRING_PARAMETER, session.getQueryParameterString());\n\t\treturn serve(session.getUri(), method, session.getHeaders(), parms, files);\n\t}", "public void run() {\n\n ServerSocket ss = null;\n try {\n\n ss = new ServerSocket(port); // accept connection from other peers and send out blocks of images to others\n\n } catch (Exception e) {\n\n // e.printStackTrace();\n\n }\n\n while (true) {\n\n Socket s;\n\n try {\n\n s = ss.accept();\n\n new Thread(new uploader(s)).start(); // create an uploader thread for each incoming client\n\n } catch (Exception e){\n\n // e.printStackTrace();\n\n }\n\n }\n\n }", "List<String> getFiles(String path) throws IOException;", "public void setDir(File dir)\n {\n this.dir = dir;\n }", "static public void readServerFiles(DbxClientV2 client) throws Exception\n\t{\n ListFolderResult result = client.files().listFolder(\"\");\n while (true) {\n for (Metadata metadata : result.getEntries()) {\n System.out.println(metadata.getPathLower());\n }\n if (!result.getHasMore()) {\n break;\n }\n result = client.files().listFolderContinue(result.getCursor()); \n }\n\t}", "private static Collection<File> listFiles(File directory, FilenameFilter filter, boolean recurse) {\n\t\tVector<File> files = new Vector<File>();\n\t\tFile[] entries = directory.listFiles();\n\n\t\tfor (File entry : entries) {\n\t\t\tif (filter == null || filter.accept(directory, entry.getName()))\n\t\t\t\tfiles.add(entry);\n\t\t\tif (recurse && entry.isDirectory())\n\t\t\t\tfiles.addAll(listFiles(entry, filter, recurse));\n\t\t}\n\t\treturn files;\n\t}", "private void addResponseHandlers() {\n\t\t\n\t\tif (responseHandlers == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tresponseHandlers.put(ResponseType.DELETE_FILE, new ResponseHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\tSystem.out.println(reader.readLine());\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tresponseHandlers.put(ResponseType.FILE_LIST, new ResponseHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\t\n\t\t\t\tString pwd = reader.readLine();\n\t\t\t\tSystem.out.println(\"Present Working Directory: \" + pwd);\n\t\t\t\t\n\t\t\t\tInteger numFiles = Integer.parseInt(reader.readLine());\n\t\t\t\tSystem.out.println(\"# Files/Folders: \" + numFiles + \"\\n\");\n\t\t\t\t\n\t\t\t\tif (numFiles == -1) {\n\t\t\t\t\tSystem.out.println(\"End of stream reached\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor (int i=0; i<numFiles; i++) {\n\t\t\t\t\tSystem.out.println(\"\\t\" + reader.readLine());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\nAll contents listed.\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tresponseHandlers.put(ResponseType.FILE_TRANSFER, new ResponseHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\t\n\t\t\t\tString fileName = reader.readLine();\n\t\t\t\tif (checkForErrors(fileName)) {\n\t\t\t\t\tSystem.out.println(fileName);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tInteger fileSize = Integer.parseInt(reader.readLine());\n\t\t\t\tif (fileSize < 0) {\n\t\t\t\t\tSystem.err.println(\"Invalid file size: \" + fileSize);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbyte[] data = new byte[fileSize];\n\t\t\t\tint numRead = socket.getInputStream().read(data, 0, fileSize);\n\t\t\t\tif (numRead == -1) {\n\t\t\t\t\tSystem.out.println(\"End of stream reached.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tFile folder = new File(pwd);\n\t\t\t\tif (!folder.exists() && !folder.mkdir()) {\n\t\t\t\t\tSystem.err.println(\"Failed to create directory: \" + pwd);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Warning: If the file exists it will be overwritten.\");\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\tFile file = new File(pwd + fileName);\n\t\t\t\t\tfile.createNewFile();\n\t\t\t\t\t\n\t\t\t\t\tFileOutputStream fileOutputStream = new FileOutputStream(file);\n\t\t\t fileOutputStream.write(data);\n\t\t\t fileOutputStream.close();\n\t\t\t \n\t\t\t\t} catch (SecurityException | IOException e) {\n\t\t\t\t\tSystem.err.println(e.getLocalizedMessage());\n\t\t\t\t\tSystem.err.println(\"Failed to create file: \" + fileName + \" at pathname: \" + pwd);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t \t\t\n\t\t System.out.println(\"File successfully transferred.\");\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tresponseHandlers.put(ResponseType.EXIT, new ResponseHandler() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void handleResponse(BufferedReader reader) throws Exception {\n\t\t\t\t\n\t\t\t\tString response = reader.readLine();\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t});\n\t}", "public void run(){\n\t\t// Stop servlets\n\t\ttry{\n\t\t\tserver.stop();\n\t\t}catch(Exception e){}\n\t}", "public void run() {\n\t\ttry {\n\t\t\t// Get input and output streams to talk to the client\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(csocket.getInputStream()));\n\t\t\tPrintWriter out = new PrintWriter(csocket.getOutputStream());\n\t\t\t/*\n\t\t\t * read the input lines from client and perform respective action based on the\n\t\t\t * request\n\t\t\t */\n\t\t\tString line;\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\t// return if all the lines are read\n\t\t\t\tif (line.length() == 0)\n\t\t\t\t\tbreak;\n\t\t\t\telse if (line.contains(\"GET\") && line.contains(\"/index.html\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * get the respective file requested by the client i.e index.html\n\t\t\t\t\t */\n\t\t\t\t\tFile file = new File(WEB_ROOT, \"/index.html\");\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(\"Content-length: \" + file.length());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t\tout.write(FileUtils.readFileToString(file, \"UTF-8\"), 0, ((int) file.length()));\n\t\t\t\t} else if (line.contains(\"PUT\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * put the respective file at a location on local\n\t\t\t\t\t */\n\t\t\t\t\tString[] split = line.split(\" \");\n\t\t\t\t\tFile source = new File(split[1]);\n\t\t\t\t\tFile dest = new File(WEB_ROOT, \"clientFile.html\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// copy the file to local storage\n\t\t\t\t\t\tFileUtils.copyFile(source, dest);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t} else {\n\t\t\t\t\tout.print(line + \"\\r\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// closing the input and output streams\n\t\t\tout.close(); // Flush and close the output stream\n\t\t\tin.close(); // Close the input stream\n\t\t\tcsocket.close(); // Close the socket itself\n\t\t} // If anything goes wrong, print an error message\n\t\tcatch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t\tSystem.err.println(\"Usage: java HttpMirror <port>\");\n\t\t}\n\t}", "private void listFiles(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\r\n\t\tArrayList files=up.listAllFiles(appPath);\r\n\t\r\n\t\t\r\n\t RequestDispatcher dispatcher = request.getRequestDispatcher(\"display.jsp\");\r\n\t\t\trequest.setAttribute(\"listfiles\", files); \r\n\t dispatcher.forward(request, response);\r\n\t \t \r\n\t \t \r\n\t \t \r\n\t}", "public FileServer(int port) throws IOException {\n serverThread = new Thread(new RunningService(port));\n }", "public void setFileDirectory(String directory) {\n settings.put(\"fileDirectory\", directory);\n }", "public void writeToDir() {\n\t\ttry{\n\t\t\tString dirPath = Paths.get(\".\").toAbsolutePath().normalize().toString()+\"/\";\n\t\t\tString path = dirPath + filename; //get server dir path\n\t\t\tSystem.out.println(\"output file path is: \" + path);\n\t\t\tFileOutputStream out = new FileOutputStream(path);\n out.write(img);\n out.close();\n PL.fsync();\n\t\t}catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{\n File blueCheck = new File(request.getParameter(\"filename\"));\r\n String pathToWeb = getServletContext().getRealPath(\"/\" + blueCheck);\r\n\r\n ServletContext cntx= request.getServletContext();\r\n String mime = cntx.getMimeType(pathToWeb);\r\n\r\n response.setContentType(mime);\r\n try {\r\n File file = new File(pathToWeb);\r\n response.setContentLength((int) file.length());\r\n\r\n FileInputStream in = new FileInputStream(file);\r\n OutputStream out = response.getOutputStream();\r\n\r\n // Copy the contents of the file to the output stream\r\n byte[] buf = new byte[1024];\r\n int count;\r\n while ((count = in.read(buf)) >= 0) {\r\n out.write(buf, 0, count);\r\n }\r\n out.close();\r\n in.close();\r\n\r\n response.setHeader(\"Content-Transfer-Encoding\", \"binary\");\r\n response.setHeader(\"Content-Disposition\", \"attachment; filename=\\\"\" + blueCheck.getName() + \"\\\"\");//fileName;\r\n } catch(Exception e) {\r\n response.getWriter().write(e.getMessage());\r\n }\r\n\r\n\r\n }", "private void renderFile(HttpServletResponse resp, File file)\n\t\t\tthrows IOException {\n\t\tString mimetype = file.getMimetype();\n\t\tif (mimetype.startsWith(\"text/*\")) {\n\t\t\tmimetype += \"; charset=\" + Dc2fConstants.CHARSET.displayName();\n\t\t}\n\t\tresp.setHeader(\"Content-Type\", mimetype);\n\t\tIOUtils.copy(file.getContent(false), resp.getOutputStream());\n\t}", "void downloadingFile(String path);", "@Override\n public void serveDownload(ServletContext context, HttpServletResponse response, Download download)\n throws IOException {\n File file = FileUtility.getFromDrive(download);\n\n if (file != null) {\n try (FileInputStream inStream = new FileInputStream(file)) {\n String mimeType = context.getMimeType(file.getAbsolutePath());\n if (mimeType == null) {\n // set to binary type if MIME mapping not found\n mimeType = \"application/octet-stream\";\n }\n\n // modifies response\n response.setContentType(mimeType);\n response.setContentLength((int) file.length());\n\n // forces download\n String headerKey = \"Content-Disposition\";\n String headerValue = String.format(\"attachment; filename=\\\"%s\\\"\", download.getFilename());\n response.setHeader(headerKey, headerValue);\n\n // obtains response's output stream\n OutputStream outStream = response.getOutputStream();\n\n byte[] buffer = new byte[4096];\n int bytesRead = -1;\n\n while ((bytesRead = inStream.read(buffer)) != -1) {\n outStream.write(buffer, 0, bytesRead);\n }\n }\n }\n }", "@Override\n public void run() {\n\n\n try {\n WatchService watchService = FileSystems.getDefault().newWatchService();\n Path path = Paths.get(INPUT_FILES_DIRECTORY);\n\n path.register( watchService, StandardWatchEventKinds.ENTRY_CREATE); //just on create or add no modify?\n\n WatchKey key;\n while ((key = watchService.take()) != null) {\n for (WatchEvent<?> event : key.pollEvents()) {\n\n String fileName = event.context().toString();\n notifyController.processDetectedFile(fileName);\n\n }\n key.reset();\n }\n\n } catch (Exception e) {\n //Logger.getGlobal().setUseParentHandlers(false);\n //Logger.getGlobal().log(Level.SEVERE, e.toString(), e);\n\n }\n }", "public void listFiles(String directoryName) throws IOException{\n File directory = new File(directoryName);\n //get all the files from a directory\n System.out.println(\"List of Files in: \" + directory.getCanonicalPath());\n File[] fList = directory.listFiles();\n for (File file : fList){\n if (file.isFile()){\n System.out.println(file.getName());\n }\n }\n }", "public void setDir(File dir) {\n this.dir = dir;\n }", "@GetMapping(\"/getallfiles\")\n public String getListFiles(Model model) {\n model.addAttribute(\"files\",\n files.stream()\n .map(fileName -> MvcUriComponentsBuilder\n .fromMethodName(FileUploadController.class, \"getFile\", fileName).build().toString())\n .collect(Collectors.toList()));\n model.addAttribute(\"totalFiles\", \"TotalFiles: \" + files.size());\n return \"listFiles\";\n }", "@Override\n\tpublic void run( ) {\n\t\tConnect();\n\t\tSendFile( filePath );\n\t\tDisconnect();\n\t}", "public static void listOfFiles(File dirPath){\n\t\tFile filesList[] = dirPath.listFiles();\r\n \r\n\t\t// For loop on each item in array \r\n for(File file : filesList) {\r\n if(file.isFile()) {\r\n System.out.println(file.getName());\r\n } else {\r\n \t // Run the method on each nested folder\r\n \t listOfFiles(file);\r\n }\r\n }\r\n }", "private static List<File> listChildFiles(File dir) throws IOException {\n\t\t List<File> allFiles = new ArrayList<File>();\n\t\t \n\t\t File[] childFiles = dir.listFiles();\n\t\t for (File file : childFiles) {\n\t\t if (file.isFile()) {\n\t\t allFiles.add(file);\n\t\t } else {\n\t\t List<File> files = listChildFiles(file);\n\t\t allFiles.addAll(files);\n\t\t }\n\t\t }\n\t\t return allFiles;\n\t\t }", "void sendFile() {\r\n\t\t// 특정 클라이언트에게 파일을 보냄\r\n\t}", "public void start(){\n\t\tboolean readFromFile = readFromIndex();\r\n\t\tif (!readFromFile){\t\r\n\t\t\tfor (int i = 0;i<1000;++i){\r\n\t\t\t\tString file = \"../crawler/pages/page\"+i+\".html\";\r\n\t\t\t\taddFile(file);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public IStatus prepareForServingDirectly(IPath baseDir, TomcatServer server, String tomcatVersion);", "@GET\r\n\t@Produces(MediaType.APPLICATION_OCTET_STREAM)\r\n\t@Path(\"assets/{filename}\")\r\n\tpublic Response staticResources(@PathParam(\"filename\") String filename) {\r\n\t\tSystem.out.println(\"Fichier : \" + filename);\r\n\t\t\r\n\t\tString assetsPath = \"./assets/\";\r\n\t\tFile fichier = new File(assetsPath + filename );\r\n\t\t\r\n\t\tif( !fichier.exists() ) {\r\n\t\t\treturn Response.status(404).build();\r\n\t\t}\r\n\t\treturn Response.ok(fichier, MediaType.APPLICATION_OCTET_STREAM)\r\n\t\t .header(\"Content-Disposition\", \"attachment; filename=\\\"\" + fichier.getName() + \"\\\"\")\r\n\t\t\t .build();\r\n\t}", "@Override\n\tpublic void handle() {\n\t\tPath p = Paths.get(pathName);\n\t\tFile file = null;\n\t\tString path = null;\n\n\t\tif (p.isAbsolute()) {\n\t\t\tpath = pathName;\n\t\t\tfile = new File(path);\n\t\t} else {\n\t\t\tpath = clientFtp.getCurrentDirectory() + \"/\" + pathName;\n\t\t\tfile = new File(path);\n\t\t}\n\t\t// Check if the client doesn't try to create a directory outside the root\n\t\t// directory\n\t\tif (path.contains(ServerFtp.home)) {\n\t\t\tif (file.exists()) {\n\t\t\t\tclientFtp.sendMessage(String.format(Response.MKD_NOK_EXIST, path));\n\t\t\t} else {\n\t\t\t\t// Creating the directory\n\t\t\t\tboolean bool = file.mkdir();\n\t\t\t\tif (bool) {\n\t\t\t\t\tclientFtp.sendMessage(String.format(Response.MKD_OK, path));\n\t\t\t\t} else {\n\t\t\t\t\tclientFtp.sendMessage(Response.FILE_NOT_FOUND);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tclientFtp.sendMessage(Response.FILE_NOT_FOUND);\n\t\t}\n\t}", "private Vector getDirectoryEntries(File directory) {\n Vector files = new Vector();\n\n // File[] filesInDir = directory.listFiles();\n String[] filesInDir = directory.list();\n\n if (filesInDir != null) {\n int length = filesInDir.length;\n\n for (int i = 0; i < length; ++i) {\n files.addElement(new File(directory, filesInDir[i]));\n }\n }\n\n return files;\n }", "void fileDownloaded(String path);", "public void run(){\n // first register the producer\n m_DirectoryQueue.registerProducer();\n\n enqueueFiles(f_Root);\n\n //lastly unregister the producer\n m_DirectoryQueue.unregisterProducer();\n }", "public static void main(String[] args) {\n // NOTE: the port number and the files to receive need to be the same here and on client\n int port = 4000;\n int timesReceiveFile = 100;\n\n Server server = new Server(port);\n\n for (int i = 0; i < timesReceiveFile; i++) {\n server.awaitConnection();\n server.receiveData();\n server.closeConnection();\n }\n\n server.compareAllFiles();\n server.killServer();\n\n }" ]
[ "0.8299594", "0.59317285", "0.582677", "0.5432846", "0.5298386", "0.52870446", "0.5281774", "0.52578187", "0.52175033", "0.5188943", "0.5130507", "0.5104747", "0.50972635", "0.50162387", "0.50113773", "0.5009629", "0.5004864", "0.50041413", "0.50018394", "0.49896538", "0.49541003", "0.49364087", "0.49316463", "0.49281675", "0.49209356", "0.49133152", "0.49065083", "0.4888043", "0.4863763", "0.48594368", "0.4849618", "0.48212352", "0.48019117", "0.47784892", "0.4749554", "0.4748333", "0.47447836", "0.4742419", "0.47392172", "0.47278216", "0.47230634", "0.47183645", "0.47041193", "0.4695052", "0.46861526", "0.467566", "0.46723655", "0.46563014", "0.46489555", "0.46473882", "0.46471763", "0.4631507", "0.4619571", "0.46108985", "0.46105924", "0.46043348", "0.45943287", "0.45927235", "0.4587067", "0.45850465", "0.45793244", "0.45759124", "0.45739707", "0.4570476", "0.45676607", "0.456624", "0.45658633", "0.45630622", "0.45584768", "0.45550376", "0.45532387", "0.45420063", "0.45412433", "0.45394725", "0.45282704", "0.4526391", "0.4524928", "0.45216814", "0.4519515", "0.4512805", "0.45090264", "0.4505207", "0.45048332", "0.44907117", "0.4489576", "0.44669443", "0.44558582", "0.44462186", "0.4432069", "0.4430214", "0.442983", "0.44296974", "0.44148248", "0.44113126", "0.44095513", "0.44090024", "0.44066322", "0.4399457", "0.43993846", "0.43983042" ]
0.7401141
1
Starts the server with an automatically selected port. Note that this should be called after handlers are set up, including any relevant calls serveFilesFromDirectory.
public boolean start() { return start(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void startServer(int port) throws Exception;", "public void startServer() {\n URLClassLoader loader = createClasspath(opts);\n X_Process.runInClassloader(loader, appServer\n .map(DevAppServer::doStartServer, getAppName() + \"Server\", getPort())\n .ignoreOut1().unsafe());\n }", "public void start(int port);", "public static void runServer(int port) throws IOException {\n\t\tserver = new CEMSServer(port);\n\t\tuiController.setServer(server);\n\t\tserver.listen(); // Start listening for connections\n\t}", "public void start(int port, Handler<AsyncResult<HttpServer>> handler) {\n init();\n logger.info(\"Starting REST HTTP server on port {}\", port);\n httpServer = vertx.createHttpServer()\n .requestHandler(router)\n .listen(port, handler);\n }", "public void startServer() {\n // configure the server properties\n int maxThreads = 20;\n int minThreads = 2;\n int timeOutMillis = 30000;\n\n // once routes are configured, the server automatically begins\n threadPool(maxThreads, minThreads, timeOutMillis);\n port(Integer.parseInt(this.port));\n this.configureRoutesAndExceptions();\n }", "public FileServer(int port) throws IOException {\n serverThread = new Thread(new RunningService(port));\n }", "public void startServerSocket(Integer port) throws IOException {\n this.port = port;\n startMEthod();\n }", "private void startServer(String ip, int port, String contentFolder) throws IOException{\n HttpServer server = HttpServer.create(new InetSocketAddress(ip, port), 0);\n \n //Making / the root directory of the webserver\n server.createContext(\"/\", new Handler(contentFolder));\n //Making /log a dynamic page that uses LogHandler\n server.createContext(\"/log\", new LogHandler());\n //Making /online a dynamic page that uses OnlineUsersHandler\n server.createContext(\"/online\", new OnlineUsersHandler());\n server.setExecutor(null);\n server.start();\n \n //Needing loggin info here!\n }", "public void startServer() {\n server.start();\n }", "private void startServer(int port) throws IOException {\n System.out.println(\"Booting the server!\");\n\n // Open the server channel.\n serverSocketChannel = ServerSocketChannel.open();\n serverSocketChannel.bind(new InetSocketAddress(port));\n serverSocketChannel.configureBlocking(false);\n\n // Register the channel into the selector.\n selector = Selector.open();\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n }", "public void start() {\n System.err.println(\"Server will listen on \" + server.getAddress());\n server.start();\n }", "private void startListen() {\n try {\n listeningSocket = new ServerSocket(listeningPort);\n } catch (IOException e) {\n throw new RuntimeException(\"Cannot open listeningPort \" + listeningPort, e);\n }\n }", "public ServerMain( int port )\r\n\t{\r\n\t\tthis.port = port;\r\n\t\tserver = new Server( this.port );\r\n\t}", "public Server(int port, mainViewController viewController, LogViewController consoleViewController){\n isRunningOnCLI = false;\n this.viewController = viewController;\n this.port = port;\n this.consoleViewController = consoleViewController;\n viewController.serverStarting();\n log = new LoggingSystem(this.getClass().getCanonicalName(),consoleViewController);\n log.infoMessage(\"New server instance.\");\n try{\n this.serverSocket = new ServerSocket(port);\n //this.http = new PersonServlet();\n log.infoMessage(\"main.Server successfully initialised.\");\n clients = Collections.synchronizedList(new ArrayList<>());\n ServerOn = true;\n log.infoMessage(\"Connecting to datastore...\");\n //mainStore = new DataStore();\n jettyServer = new org.eclipse.jetty.server.Server(8080);\n jettyContextHandler = new ServletContextHandler(jettyServer, \"/\");\n jettyContextHandler.addServlet(servlets.PersonServlet.class, \"/person/*\");\n jettyContextHandler.addServlet(servlets.LoginServlet.class, \"/login/*\");\n jettyContextHandler.addServlet(servlets.HomeServlet.class, \"/home/*\");\n jettyContextHandler.addServlet(servlets.DashboardServlet.class, \"/dashboard/*\");\n jettyContextHandler.addServlet(servlets.UserServlet.class, \"/user/*\");\n jettyContextHandler.addServlet(servlets.JobServlet.class, \"/job/*\");\n jettyContextHandler.addServlet(servlets.AssetServlet.class, \"/assets/*\");\n jettyContextHandler.addServlet(servlets.UtilityServlet.class, \"/utilities/*\");\n jettyContextHandler.addServlet(servlets.EventServlet.class, \"/events/*\");\n //this.run();\n } catch (IOException e) {\n viewController.showAlert(\"Error initialising server\", e.getMessage());\n viewController.serverStopped();\n log.errorMessage(e.getMessage());\n }\n }", "void startServer(String name, Config.ServerConfig config);", "public void start(int port)\n\t{\n\t\t// Initialize and start the server sockets. 08/10/2014, Bing Li\n\t\tthis.port = port;\n\t\ttry\n\t\t{\n\t\t\tthis.socket = new ServerSocket(this.port);\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Initialize a disposer which collects the server listener. 08/10/2014, Bing Li\n\t\tMyServerListenerDisposer disposer = new MyServerListenerDisposer();\n\t\t// Initialize the runner list. 11/25/2014, Bing Li\n\t\tthis.listenerRunnerList = new ArrayList<Runner<MyServerListener, MyServerListenerDisposer>>();\n\t\t\n\t\t// Start up the threads to listen to connecting from clients which send requests as well as receive notifications. 08/10/2014, Bing Li\n\t\tRunner<MyServerListener, MyServerListenerDisposer> runner;\n\t\tfor (int i = 0; i < ServerConfig.LISTENING_THREAD_COUNT; i++)\n\t\t{\n\t\t\trunner = new Runner<MyServerListener, MyServerListenerDisposer>(new MyServerListener(this.socket, ServerConfig.LISTENER_THREAD_POOL_SIZE, ServerConfig.LISTENER_THREAD_ALIVE_TIME), disposer, true);\n\t\t\tthis.listenerRunnerList.add(runner);\n\t\t\trunner.start();\n\t\t}\n\n\t\t// Initialize the server IO registry. 11/07/2014, Bing Li\n\t\tMyServerIORegistry.REGISTRY().init();\n\t\t// Initialize a client pool, which is used by the server to connect to the remote end. 09/17/2014, Bing Li\n\t\tClientPool.SERVER().init();\n\t}", "public void start() {\n\t\t\n\t\ttry {\n\t\t\tmainSocket = new DatagramSocket(PORT_NUMBER);\n\t\t}\n\t\tcatch(SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\t//Lambda expression to shorten the run method\n\t\tThread serverThread = new Thread( () -> {\n\t\t\tlisten();\n\t\t});\n\t\t\n\t\tserverThread.start();\n\t}", "public void startServer()\n\t{\n\t\twhile(true)\n\t\t{\n\t\t\tSystem.out.println(\"Listen\");\n\t\t\tif(listenInitialValuesRequest)\n\t\t\t{\n\t\t\t\tlistenInitialValuesRequest();\n\t\t\t}\n\t\t}\n\t}", "public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }", "public void listen(final int port) {\n listen(port, \"localhost\");\n }", "public void startServer() throws IOException {\n log.info(\"Starting server in port {}\", port);\n try {\n serverSocket = new ServerSocket(port);\n this.start();\n log.info(\"Started server. Server listening in port {}\", port);\n } catch (IOException e) {\n log.error(\"Error starting the server socket\", e);\n throw e;\n }\n }", "public void start() {\n System.out.println(\"server started\");\n mTerminalNetwork.listen(mTerminalConfig.port);\n }", "public void run() {\n ServerSocketChannelFactory acceptorFactory = new OioServerSocketChannelFactory();\n ServerBootstrap server = new ServerBootstrap(acceptorFactory);\n\n // The pipelines string together handlers, we set a factory to create\n // pipelines( handlers ) to handle events.\n // For Netty is using the reactor pattern to react to data coming in\n // from the open connections.\n server.setPipelineFactory(new EchoServerPipelineFactory());\n\n server.bind(new InetSocketAddress(port));\n }", "public void start() throws IOException {\n\t\tserverSocket = new ServerSocket(port);\n\t\tserverCallbacks.forEach(c -> c.onServerStarted(this, port));\n\t}", "public void runServer() throws IOException {\n runServer(0);\n }", "private void startServer() {\n\t\ttry {\n//\t\t\tserver = new Server();\n//\t\t\tserver.start();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: add message in UI for user\n\t\t}\n\t}", "public void start(String portArgument) {\n if (!Strings.isNullOrEmpty(portArgument)) {\n port(parsePort(portArgument));\n }\n mapExceptions();\n initAccountEndpoints();\n initUserEndpoints();\n initManagementEndpoints();\n }", "public IndexServer(int port, File fname) throws IOException {\n super(port, fname);\n }", "public static Handler<RoutingContext> serve(String spaDir, int port) {\n return serve(spaDir, port, \"npm\", \"start\", \"--\");\n }", "public Server(int port)\r\n\t\t{\r\n log(\"Initialising port \" + port);\r\n\r\n\t\t// Set the port\r\n\t\tthis.port = port;\r\n\r\n // Create the server socket\r\n createServerSocket();\r\n \t}", "public void run() {\n final Server server = new Server(8081);\n\n // Setup the basic RestApplication \"context\" at \"/\".\n // This is also known as the handler tree (in Jetty speak).\n final ServletContextHandler context = new ServletContextHandler(\n server, CONTEXT_ROOT);\n final ServletHolder restEasyServlet = new ServletHolder(\n new HttpServletDispatcher());\n restEasyServlet.setInitParameter(\"resteasy.servlet.mapping.prefix\",\n APPLICATION_PATH);\n restEasyServlet.setInitParameter(\"javax.ws.rs.Application\",\n \"de.kad.intech4.djservice.RestApplication\");\n context.addServlet(restEasyServlet, CONTEXT_ROOT);\n\n\n try {\n server.start();\n server.join();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "public static void start(int port) {\r\n\r\n SpringApplication app = new SpringApplication(DaprApplication.class);\r\n\r\n app.run(String.format(\"--server.port=%d\", port));\r\n }", "public boolean start(int port) {\n try {\n synchronized (mImplMonitor) {\n checkServiceLocked();\n return mImpl.start(port);\n }\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\"Failed to start server.\", e);\n }\n }", "public void run()\n\t{\n\t\trunning = true;\n\t\tSystem.out.println(\"Server started on port \" + port);\n\t}", "public void run(){\n\t\tstartServer();\n\t}", "public void start() throws RemoteException, AlreadyBoundException\n {\n start(DEFAULT_PORT);\n }", "private void runServer()\n {\n int port = Integer.parseInt(properties.getProperty(\"port\"));\n String ip = properties.getProperty(\"serverIp\");\n \n Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, \"Server started. Listening on: {0}, bound to: {1}\", new Object[]{port, ip});\n try\n {\n serverSocket = new ServerSocket();\n serverSocket.bind(new InetSocketAddress(ip, port));\n do\n {\n Socket socket = serverSocket.accept(); //Important Blocking call\n Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, \"Connected to a client. Waiting for username...\");\n ClientHandler ch = new ClientHandler(socket, this);\n clientList.add(ch);\n ch.start();\n } while (keepRunning);\n } catch (IOException ex)\n {\n Logger.getLogger(ChatServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public static void startServer() {\n clientListener.startListener();\n }", "public void run() {\n try {\n this.listener = new ServerSocket(port);\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n // On new connections, start a new thread to handle communications.\n try {\n while(true) {\n new Handler(this.listener.accept()).start();\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n this.listener.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "public void startServer() {\n\r\n try {\r\n echoServer = new ServerSocket(port);\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n // Whenever a connection is received, start a new thread to process the connection\r\n // and wait for the next connection.\r\n while (true) {\r\n try {\r\n clientSocket = echoServer.accept();\r\n numConnections++;\r\n ServerConnection oneconnection = new ServerConnection(clientSocket, numConnections, this);\r\n new Thread(oneconnection).start();\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }\r\n\r\n }", "public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static ServerSocket startServer(int port) {\n if (port != 0) {\n ServerSocket serverSocket;\n try {\n serverSocket = new ServerSocket(port);\n System.out.println(\"Server listening, port: \" + port + \".\");\n System.out.println(\"Waiting for connection... \");\n return serverSocket;\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return null;\n }", "public void runServer(){\n try {\n serverSocket = new ServerSocket(portNumber);\n } catch (IOException ioe){\n System.out.println(ioe.getMessage());\n }\n \n while (true) { \n try {\n Socket clientSocket = serverSocket.accept();\n InetAddress inetAddress = clientSocket.getInetAddress();\n System.out.println(\"Connected with \" + inetAddress.getHostName()+ \".\\n IP address: \" + inetAddress.getHostAddress() + \"\\n\");\n new Thread(new RequestHandlerRunnable(clientSocket, database)).start();\n } catch (IOException ioe){\n System.out.println(ioe.getMessage());\n }\n }\n \n }", "private static void openServerSocket(int port) {\n\t\ttry {\n\t\t\tserverSocket = new ServerSocket(port);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Server Error\");\n\t\t}\n\t}", "public DefaultTCPServer(int port) throws Exception {\r\n\t\tserverSocket = new ServerSocket(port);\t}", "public StaticServer(final int port) throws ConcordiaException {\n\t\t// Start the server.\n\t\tInetSocketAddress addr = new InetSocketAddress(port);\n\t\ttry {\n\t\t\tserver = HttpServer.create(addr, 0);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tthrow\n\t\t\t\tnew ConcordiaException(\n\t\t\t\t\t\"There was an error starting the server.\",\n\t\t\t\t\te);\n\t\t}\n\t\t\n\t\t// Create the handler and attach to the root of the domain.\n\t\thandler = new RequestHandler();\n\t\tserver.createContext(\"/\", handler);\n\t\t\n\t\t// Set the thread pool.\n\t\tserver.setExecutor(Executors.newCachedThreadPool());\n\t\t\n\t\t// Start the server.\n\t\tserver.start();\n\t}", "public static <T extends EmbeddedTestServer> T initializeAndStartServer(\n T server, Context context, int port) {\n server.initializeNative(context, ServerHTTPSSetting.USE_HTTP);\n server.addDefaultHandlers(\"\");\n if (!server.start(port)) {\n throw new EmbeddedTestServerFailure(\"Failed to start serving using default handlers.\");\n }\n return server;\n }", "private void startWebApp(Handler<AsyncResult<HttpServer>> next) {\n Router router = Router.router(vertx);\n\n router.route(\"/assets/*\").handler(StaticHandler.create(\"assets\"));\n router.route(\"/api/*\").handler(BodyHandler.create());\n\n router.route(\"/\").handler(this::handleRoot);\n router.get(\"/api/timer\").handler(this::timer);\n router.post(\"/api/c\").handler(this::_create);\n router.get(\"/api/r/:id\").handler(this::_read);\n router.put(\"/api/u/:id\").handler(this::_update);\n router.delete(\"/api/d/:id\").handler(this::_delete);\n\n // Create the HTTP server and pass the \"accept\" method to the request handler.\n vertx.createHttpServer().requestHandler(router).listen(8888, next);\n }", "public void openServer() {\n try {\n this.serverSocket = new ServerSocket(this.portNumber);\n } catch (IOException ex) {\n System.out.println(ex);\n }\n }", "private void listen() {\n\t\ttry {\n\t\t\tServerSocket servSocket = new ServerSocket(PORT);\n\t\t\tSocket clientSocket;\n\t\t\twhile(true) {\n\t\t\t\tclientSocket = servSocket.accept();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Error - Could not open connection\");\n\t\t}\n\t\t\n\t}", "public WebServer(int port) {\n\t\ttry {\n\t\t\tthis.listen_port = new ServerSocket(port);\n\t\t\tthis.pool = Executors.newFixedThreadPool(40);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n int port = 7788;\n Server server = new Server(port);\n server.listen();\n }", "public void startClientServer() {\n try {\n this.server_socket = new ServerSocket( port );\n this.start();\n } catch (IOException e ) {\n System.err.println( \"Failure: Socket couldn't OPEN! -> \" + e );\n } finally {\n System.out.println( \"Success: Server socket is now Listening on port \" + port + \"...\" );\n }\n }", "public static void main(String[] args) {\r\n int port = 5000;\r\n Server server = new Server(port);\r\n\r\n //Start the server thread:\r\n server.start();\r\n }", "@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// System.out.println(\"LocalProxy run on \" + port);\r\n\t}", "@Override\n @SuppressWarnings(\"CallToPrintStackTrace\")\n public void simpleInitApp() {\n \n\n try {\n System.out.println(\"Using port \" + port);\n // create the server by opening a port\n server = Network.createServer(port);\n server.start(); // start the server, so it starts using the port\n } catch (IOException ex) {\n ex.printStackTrace();\n destroy();\n this.stop();\n }\n System.out.println(\"Server started\");\n // create a separat thread for sending \"heartbeats\" every now and then\n new Thread(new NetWrite()).start();\n server.addMessageListener(new ServerListener(), ChangeVelocityMessage.class);\n // add a listener that reacts on incoming network packets\n \n }", "public Server(int port) {\n this.port = port;\n try {\n sock = new ServerSocket(port);\n clientSock = sock.accept();\n\n //Connection established, do some fancy stuff here\n processReq();\n } catch (IOException e) {\n System.err.println(\"ERROR: Sth failed while creating server socket :( \");\n }\n }", "public Server(){\n\t\ttry {\n\t\t\t// initialize the server socket with the specified port\n\t\t\tsetServerSocket(new ServerSocket(PORT));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO Exception while creating a server\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void startServers()\n {\n ExecutorService threads = Executors.newCachedThreadPool();\n threads.submit(new StartServer(host, port));\n threads.submit(new StartServer(host, port + 1));\n threads.shutdown();\n }", "public void startServer() throws Exception\n {\n\t\t\tString SERVERPORT = \"ServerPort\";\n\t\t\tint serverport = Integer.parseInt(ConfigurationManager.getConfig(SERVERPORT));\n\t\t\t\n \n Srvrsckt=new ServerSocket ( serverport );\n while ( true )\n {\n Sckt =Srvrsckt.accept();\n new Thread ( new ConnectionHandler ( Sckt ) ).start();\n }\n \n \n\n\n }", "@Override\n public void start(Future<Void> startFuture) {\n vertx.createHttpServer()\n .requestHandler(getRequestHandler()).listen(8080, http -> {\n if (http.succeeded()) {\n startFuture.complete();\n LOGGER.info(\"HTTP server started on http://localhost:8080\");\n } else {\n startFuture.fail(http.cause());\n }\n });\n }", "public void run() {\n running = true;\n System.out.println(\"Server started on port: \" + port);\n manageClients();\n receive();\n startConsole();\n }", "public static Server startServer(AvroSourceProtocol handler, int port, boolean enableCompression) {\n Responder responder = new SpecificResponder(AvroSourceProtocol.class,\n handler);\n Server server;\n if (enableCompression) {\n server = new NettyServer(responder,\n new InetSocketAddress(localhost, port),\n new NioServerSocketChannelFactory\n (Executors .newCachedThreadPool(), Executors.newCachedThreadPool()),\n new CompressionChannelPipelineFactory(), null);\n } else {\n server = new NettyServer(responder,\n new InetSocketAddress(localhost, port));\n }\n server.start();\n logger.info(\"Server started on hostname: {}, port: {}\",\n new Object[] { localhost, Integer.toString(server.getPort()) });\n\n try {\n\n Thread.sleep(300L);\n\n } catch (InterruptedException ex) {\n logger.error(\"Thread interrupted. Exception follows.\", ex);\n Thread.currentThread().interrupt();\n }\n\n return server;\n }", "public Server() {\n\t\t\n\t\ttry {\n\t\t\tss= new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace(); // Default\n\t\t}\n\t}", "private void start(String[] args){\n\t\tServerSocket listenSocket;\n\n\t\ttry {\n\t\t\tlistenSocket = new ServerSocket(Integer.parseInt(args[0])); //port\n\t\t\tSystem.out.println(\"Server ready...\");\n\t\t\twhile (true) {\n\t\t\t\tSocket clientSocket = listenSocket.accept();\n\t\t\t\tSystem.out.println(\"Connexion from:\" + clientSocket.getInetAddress());\n\t\t\t\tClientThread ct = new ClientThread(this,clientSocket);\n\t\t\t\tct.start();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Error in EchoServer:\" + e);\n\t\t}\n\t}", "public void listen(final int port, final String host) {\n server = Undertow.builder()\n .addHttpListener(port, host)\n .setHandler(new Listener(this)).build();\n server.start();\n }", "public static void main(String[] args) {\n\n try (ServerSocket ss = new ServerSocket(PORT)) {\n System.out.println(\"chat.Server is started...\");\n System.out.println(\"Server address: \" + getCurrentIP() + \":\" + PORT);\n\n while (true) {\n Socket socket = ss.accept();\n new Handler(socket).start();\n }\n\n } catch (IOException e) {\n System.out.println(\"chat.Server error.\");\n }\n }", "public void startListener() throws BindException, Exception{ // NOPMD by luke on 5/26/07 11:10 AM\n\t\tsynchronized (httpServerMutex){\n\t\t\t// 1 -- Shutdown the previous instances to prevent multiple listeners\n\t\t\tif( webServer != null )\n\t\t\t\twebServer.shutdownServer();\n\t\t\t\n\t\t\t// 2 -- Spawn the appropriate listener\n\t\t\twebServer = new HttpServer();\n\t\t\t\n\t\t\t// 3 -- Start the listener\n\t\t\twebServer.startServer( serverPort, sslEnabled);\n\t\t}\n\t}", "public static void main(String[] args) throws Exception {\n ServerSocket listener = new ServerSocket(PORT);\n try {\n while (true) {\n new Handler(listener.accept()).start();\n }\n } finally {\n listener.close();\n }\n }", "private boolean configureAndStart(int port) {\n\t\ttry {\n\t\t\t//get local host to bind\n\t\t\tString host = InetAddress.getLocalHost().getHostName();\n//\t\t\thost = \"localhost\";\n\t\t\tSystem.out.printf(\"Listening on: Host: %s, Port: %d%n\", host, port);\n\n\t\t\tselector = Selector.open();\n\n\t\t\tserverChannel = ServerSocketChannel.open();\n\t\t\tserverChannel.socket().bind( new InetSocketAddress( host, port ) );\n\t\t\tserverChannel.configureBlocking( false );\n\n\t\t\t//setup selector to listen for connections on this serverSocketChannel\n\t\t\tserverChannel.register( selector, SelectionKey.OP_ACCEPT );\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Configuration for Server failed. Exiting.\");\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\tSystem.out.println(\"Server Successfully configured\");\n\n\t\t//start up the ThreadPool\n\t\tmanager.start();\n\n\t\t//create timer to handle output, and timeout\n\t\ttimer = new Timer(\"Output_and_timeout\");\n\t\t//schedule output\n\t\ttimer.scheduleAtFixedRate(new ServerOutput(batchTime), Constants.OUTPUT_TIME * 1000,\n\t\t\t\tConstants.OUTPUT_TIME * 1000);\n\t\ttimeout = new ScheduleTimeout(this);\n\t\ttimer.scheduleAtFixedRate(timeout, batchTime * 1000, batchTime * 1000);\n\n\t\treturn true;\n\t}", "public void run() {\n try {\n this.initialize();\n Listener ln = new Listener(localDir, port);\n ln.run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void start(int port) {\r\n Thread thread = new Thread(this);\r\n this.port = port;\r\n thread.start();\r\n }", "public void start() {\n\t\tif (serverStarted.get()) {\n\t\t\tthrow new IllegalStateException(\"Server already started. \" + toString());\n\t\t}\n\t\tCallable<Boolean> task;\n\t\ttry {\n\t\t\tserverSocket = new ServerSocket(port);\n\t\t\tserverSocket.setSoTimeout(soTimeout);\n\t\t\tport = serverSocket.getLocalPort();\n\t\t\tnotifyListener(\"Server started. \" + toString());\n\t\t\tserverStarted.set(true);\n\t\t\ttask = new Callable<Boolean>() {\n\t\n\t\t\t\tpublic Boolean call() {\n\t\t\t\t\tnotifyListener(\"Starting server thread. \" + toString());\n\t\t\t\t\tstopFlag.set(false);\n\t\t\t\t\twhile (!stopFlag.get()) {\n\t\t\t\t\t\tSocket connection = null;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconnection = serverSocket.accept();\n\t\t\t\t\t\t\tnotifyListener(\"Connection accepted on port. \" + toString());\n\t\t\t\t\t\t\tconnection.close();\n\t\t\t\t\t\t\tnotifyListener(\"Connection closed on port. \" + toString());\n\t\t\t\t\t\t\tpingCounter.incrementAndGet();\n\t\t\t\t\t\t} catch (SocketTimeoutException e) {\n\t\t\t\t\t\t\tnotifyListener(\"Server accept timed out. Retrying. \" + toString());\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\tnotifyListener(\"Server accept caused exception [message=\" + e.getMessage() + \"]. Retrying. \" + toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnotifyListener(\"Server socket closed. \" + toString());\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t};\n\t\t} catch (IOException e) {\n\t\t\tstopFlag.set(true);\n\t\t\tthrow new IllegalStateException(\"Unable to open socket on port. \" + toString(), e);\n\t\t}\n\t\tserverActivity = scheduler.submit(task);\n\t\tnotifyListener(\"Waiting for server to fully complete start. \" + toString());\n\t\tfor (;;) {\n\t\t\ttry {\n\t\t\t\tThread.sleep(100);\n\t\t\t\tif (isStarted()) {\n\t\t\t\t\tnotifyListener(\"Server started. \" + toString());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} catch (InterruptedException e) {\n\n\t\t\t}\n\t\t}\n\t}", "public void run(){\n\n\t\tServerSocket socketEcoute;\n\t\ttry {\n\t\t\tsocketEcoute = new ServerSocket();\n\t\t\tsocketEcoute.bind(new InetSocketAddress(this.defaultPort));\n\t\t\tSystem.out.println(\"Port manager started on : \"+this.defaultPort);\n\t\t\twhile(true){\n\t\t\t\tSocket socketConnexion = socketEcoute.accept();\n\t\t\t\tSystem.out.println(\"Someone is connected on PortManager\");\n\t\t\t\t\n\t\t\t\tnew PortManagerThread(socketConnexion,this.ctrl).start();\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected void serverStarted()\n {\n // System.out.println\n // (\"Server listening for connections on port \" + getPort());\n }", "public static void main(String[] args) {\n Server server = new Server(1234);\n server.listen();\n \n // YOUR CODE HERE\n // It is not required (or recommended) to implement the server in\n // this runner class.\n }", "public static void main(String[] args) throws IOException {\r\n\t\t\r\n\t\t// get the command line argument\r\n\t\t\r\n\t\tif (args.length < 1) {\r\n\t\t\tSystem.out.println(\"Error: expected 1 argument containing directory in 'files/'.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tString path = args[0];\r\n\t\t\r\n\t\tint port = 8000;\r\n\t\t\r\n\t\tif (args.length > 1) {\r\n\t\t\tport = Integer.parseInt(args[1]);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// setup the server and listen for incoming connections\r\n\t\t\r\n\t\tServerSocket serverSocket = new ServerSocket(port);\r\n\t\tSystem.out.println(\"Listening on port \" + port + \"...\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\twhile (true) {\r\n\t\t\t\tSocket socket = serverSocket.accept();\r\n\t\t\t\tnew Thread(new HttpConnection(socket, path)).start();\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\tserverSocket.close();\r\n\t\t}\r\n\t}", "@Parameter(optional=true, description=\"Port number for the embedded Jetty HTTP server, default: \\\\\\\"\" + ServletEngine.DEFAULT_PORT + \"\\\\\\\". \"\n\t\t\t+ \"If the port is set to 0, the jetty server uses a free tcp port, and the metric `serverPort` delivers the actual value.\")\n\tpublic void setPort(int port) {}", "static void startServer(String tracker_file, int port, String file_location) throws IOException {\n\t\tTrackerInfo ctracker = new TrackerInfo(tracker_file);\n\t\tPeer peer = new Peer(InetAddress.getByName(\"127.0.0.1\"), port, ctracker, file_location);\n\t\tpeer.waitingForClient();\n\t\twhile(true) {\n\t\t\tif(peer.out_buf.size() > 0) {\n\t\t\t\tif(!peer.send()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!peer.recieve()) {\n\t\t\t\tif(peer.out_buf.size() == 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\tpeer.recieveHandle();\n\t\t\t}\n\t\t}\n\t\tpeer.closeTCP();\n\t}", "protected void serverStarted()\n {\n System.out.println(\"Server listening for connections on port \" + getPort());\n }", "protected void serverStarted()\r\n {\r\n System.out.println\r\n (\"Server listening for connections on port \" + getPort());\r\n }", "public void setServer(int port) {\n this.server = port;\n }", "@Override\n public void run() {\n try {\n registerWithServer();\n initServerSock(mPort);\n listenForConnection();\n\t} catch (IOException e) {\n Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, e);\n setTextToDisplay(\"run(): \" + e.getMessage());\n setConnectedStatus(false);\n\t}\n }", "public void setPort(int port);", "public void setPort(int port);", "private static void startServer(){\n try{\n MMServer server=new MMServer(50000);\n }catch (IOException ioe){\n System.exit(0);\n }\n \n }", "public TCPServer(int port) throws IOException {\n\tthis.socket = new ServerSocket(port);\n\tthis.clients = new ArrayList();\n\n\tSystem.out.println(\"SERVER: Started\");\n }", "@Override\n\t\tpublic void run() {\n\t\t\tIndexServer is = new IndexServer(3002,\"/src/P2Pfile/Peer2/filefolder\" );\n\t\t\tSystem.out.println(\"Peer2Server Start\");\n\t\t\tis.ConnectionAccept();\n\t\t\t\n\t\t\n\t\t\t\n\t\t}", "public Server(int port) throws IOException{\n\t\tsuper();\n\t\tthis.serversocket= new java.net.ServerSocket(port);\n\t\t\n\t\tif (DEBUG){\n\t\t\tSystem.out.println(\"Server socket created:\" + this.serversocket.getLocalPort());\n\t\t\tclient_list.add(String.valueOf(this.serversocket.getLocalPort()));\n\t\t}\n\t}", "public void startListening() {\r\n\t\tlisten.startListening();\r\n\t}", "public void startNetwork(int port);", "public Server(int port) {\n this.port = port;\n try {\n socket = new DatagramSocket(port);\n } catch (SocketException e) {\n e.printStackTrace();\n }\n run = new Thread(this, \"Server\");\n run.start();\n }", "public static void main(String[] args) {\n\t\tif (args != null && args.length > 0) {\n\t\t\tport = Integer.parseInt(args[0]);\n\t\t}\n\t\tlog.info(\"i am the main for JServer\");\n\t\tlog.info(\"Server will use port: \" + port);\n\t\ttry {\n\t\t\twebServer = new WebServer(port);\n\t\t\t\n\t\t\tjsystem = new JSystemServer();\n\t\t\t\n\t\t\t//create the instances of handlers in server\n\t\t\tapplicationHandler = new JApplicationHandler();\n\t\t\tscenarioHandler = new JScenarioHandler();\n\t\t\t\n\t\t\t\n\t\t\tlogsHandler = new JReporterHandler();\n\t\t\t//register handlers in server\n\t\t\twebServer.addHandler(JServerHandlers.SCENARIO.getHandlerClassName(),scenarioHandler);\n\t\t\twebServer.addHandler(JServerHandlers.APPLICATION.getHandlerClassName(),applicationHandler);\n\t\t\twebServer.addHandler(\"jsystem\", jsystem);\n\t\t\twebServer.addHandler(JServerHandlers.REPORTER.getHandlerClassName(), logsHandler);\n\t\t\twebServer.start();\n\t\t\tSystem.out.println(\"webserver successfully started!!! + listening on port \" + port);\n\t\t} catch (Exception e) {\n\t\t\tlog.warning(\"failed in webserver handler adding or creation on port= \"+port + \"\\n\\n\"+StringUtils.getStackTrace(e));\n\t\t}\n\t}", "public static HttpServer startServer() {\n // create a resource config that scans for JAX-RS resources and providers\n // in com.example.rest package\n final ResourceConfig rc = new ResourceConfig().packages(\"com.assignment.backend\");\n rc.register(org.glassfish.jersey.moxy.json.MoxyJsonFeature.class);\n rc.register(getAbstractBinder());\n rc.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);\n rc.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n return GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n }", "public void run()\n {\n Utilities.debugLine(\"WebServer.run(): Runing Web Server\", DEBUG);\n\n running = true;\n\n ServerSocketConnection ssc;\n try\n {\n ssc = (ServerSocketConnection) Connector.open(\"socket://:\" + PORT);\n\n do\n {\n Utilities.debugLine(\"WebServer.run(): Socket Opened, Waiting for Connection...\", DEBUG);\n SocketConnection sc = null;\n sc = (SocketConnection) ssc.acceptAndOpen();\n Thread t = new Thread(new ConnectionHandler(sc));\n t.setPriority(Thread.MIN_PRIORITY);\n t.start();\n\n//--------------------------------------- DEBUG THREAD NUMBER ---------------------------------\n try\n {\n System.out.println(\"Active Threads: \" + Thread.activeCount());\n }\n catch (Exception e)\n {\n System.out.println(\"There was an eror getting the thread count.\");\n }\n//--------------------------------------- DEBUG THREAD NUMBER ---------------------------------\n\n }\n while (running);\n ssc.close();\n }\n\n catch (Exception e)\n {\n Utilities.debugLine(e.toString() + e.getMessage(), true);\n }\n }", "public static void main(String [] args) throws IOException, SQLException, ClassNotFoundException, Exception {\n\t //get port and server from input if user has entered any values\n\t int port = args.length > 0 ? Integer.parseInt(args[0]) : 6066;\n\t String serverName = args.length > 1 ? args[1] : \"localhost\";\n\t Thread t = new ImageServer(port);\n\t t.start();\n }", "public void start()\r\n\t\t{\r\n\t\tDebug.assert(serverSocket != null, \"(Server/123)\");\r\n\r\n \t// flag the server as running\r\n \tstate = RUNNING;\r\n\r\n // Loop while still listening, accepting new connections from the server socket\r\n while (state == RUNNING)\r\n \t{\r\n // Get a connection from the server socket\r\n\t\t\tSocket socket = null;\r\n\t\t\ttry {\r\n socket = serverSocket.accept();\r\n \tif (state == RUNNING) \r\n \t createLogin(socket);\r\n }\r\n \r\n // The socket timeout allows us to check if the server has been shut down.\r\n // In this case the state will not be RUNNING and the loop will end.\r\n\t\t catch ( InterruptedIOException e )\r\n\t\t \t{\r\n\t\t \t// timeout happened\r\n\t\t \t}\r\n\t\t \r\n\t\t // This shouldn't happen...\r\n \t catch ( IOException e )\r\n \t \t{\r\n log(\"Server: Error creating Socket\");\r\n \t \tDebug.printStackTrace(e);\r\n \t }\r\n\t }\r\n\t \r\n\t // We've finished, clean up\r\n disconnect();\r\n\t\t}", "public Webserver(int listen_port) {\n port = listen_port;\n ip = getIP();\n //this makes a new thread, as mentioned before,it's to keep gui in\n //one thread, server in another. You may argue that this is totally\n //unnecessary, but we are gonna have this on the web so it needs to\n //be a bit macho! Another thing is that real pro webservers handles\n //each request in a new thread. This server dosen't, it handles each\n //request one after another in the same thread. This can be a good\n //assignment!! To redo this code so that each request to the server\n //is handled in its own thread. The way it is now it blocks while\n //one client access the server, ex if it transferres a big file the\n //client have to wait real long before it gets any response.\n this.start();\n }", "public RunMe() throws IOException {\n\n\t\t// Load data\n\t\tloadDataMap();\n\t\t\n\t\t// Start server\n\t\tcfg = createFreemarkerConfiguration();\n\t\tsetPort(8081);\n\t\tinitializeRoutes();\n\t}", "public void setServerPort(int serverPort) {\n this.serverPort = serverPort;\n }" ]
[ "0.72506833", "0.71646726", "0.7000556", "0.68901664", "0.6870146", "0.6828133", "0.6723189", "0.66930544", "0.6624694", "0.66174716", "0.6564847", "0.65072566", "0.64621395", "0.64279836", "0.6402457", "0.6344357", "0.63413745", "0.63334936", "0.63301486", "0.6322545", "0.6310477", "0.6298084", "0.6297177", "0.61985564", "0.619077", "0.61907595", "0.61852485", "0.6180142", "0.61717325", "0.61712015", "0.61678416", "0.61323583", "0.6123133", "0.6098932", "0.60900223", "0.6065214", "0.60611296", "0.602629", "0.6025918", "0.60111225", "0.600379", "0.60018176", "0.59990215", "0.5989378", "0.5981774", "0.59754485", "0.59735554", "0.59720415", "0.59676975", "0.5940294", "0.5939293", "0.5913988", "0.5912446", "0.5907158", "0.5891131", "0.58838063", "0.58755803", "0.5872086", "0.5871261", "0.58695966", "0.586594", "0.5855881", "0.58344436", "0.5803096", "0.5799208", "0.5798832", "0.57883364", "0.5781546", "0.5779986", "0.577198", "0.5765568", "0.5764957", "0.57624024", "0.5761074", "0.57526755", "0.57493824", "0.5742184", "0.573142", "0.5729416", "0.5723782", "0.57220006", "0.5719653", "0.57112575", "0.5698411", "0.56971914", "0.56971914", "0.56889296", "0.56873214", "0.5681979", "0.56787807", "0.56402606", "0.56387603", "0.5635618", "0.5634738", "0.5630848", "0.5629524", "0.56235987", "0.5615459", "0.5610972", "0.5608338", "0.5606561" ]
0.0
-1
Starts the server with the specified port. Note that this should be called after handlers are set up, including any relevant calls serveFilesFromDirectory.
public boolean start(int port) { try { synchronized (mImplMonitor) { checkServiceLocked(); return mImpl.start(port); } } catch (RemoteException e) { throw new EmbeddedTestServerFailure("Failed to start server.", e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void start(int port, Handler<AsyncResult<HttpServer>> handler) {\n init();\n logger.info(\"Starting REST HTTP server on port {}\", port);\n httpServer = vertx.createHttpServer()\n .requestHandler(router)\n .listen(port, handler);\n }", "void startServer(int port) throws Exception;", "public static void runServer(int port) throws IOException {\n\t\tserver = new CEMSServer(port);\n\t\tuiController.setServer(server);\n\t\tserver.listen(); // Start listening for connections\n\t}", "public void startServerSocket(Integer port) throws IOException {\n this.port = port;\n startMEthod();\n }", "public void start(int port);", "public FileServer(int port) throws IOException {\n serverThread = new Thread(new RunningService(port));\n }", "public void listen(final int port) {\n listen(port, \"localhost\");\n }", "private void startServer(String ip, int port, String contentFolder) throws IOException{\n HttpServer server = HttpServer.create(new InetSocketAddress(ip, port), 0);\n \n //Making / the root directory of the webserver\n server.createContext(\"/\", new Handler(contentFolder));\n //Making /log a dynamic page that uses LogHandler\n server.createContext(\"/log\", new LogHandler());\n //Making /online a dynamic page that uses OnlineUsersHandler\n server.createContext(\"/online\", new OnlineUsersHandler());\n server.setExecutor(null);\n server.start();\n \n //Needing loggin info here!\n }", "public void start(int port)\n\t{\n\t\t// Initialize and start the server sockets. 08/10/2014, Bing Li\n\t\tthis.port = port;\n\t\ttry\n\t\t{\n\t\t\tthis.socket = new ServerSocket(this.port);\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Initialize a disposer which collects the server listener. 08/10/2014, Bing Li\n\t\tMyServerListenerDisposer disposer = new MyServerListenerDisposer();\n\t\t// Initialize the runner list. 11/25/2014, Bing Li\n\t\tthis.listenerRunnerList = new ArrayList<Runner<MyServerListener, MyServerListenerDisposer>>();\n\t\t\n\t\t// Start up the threads to listen to connecting from clients which send requests as well as receive notifications. 08/10/2014, Bing Li\n\t\tRunner<MyServerListener, MyServerListenerDisposer> runner;\n\t\tfor (int i = 0; i < ServerConfig.LISTENING_THREAD_COUNT; i++)\n\t\t{\n\t\t\trunner = new Runner<MyServerListener, MyServerListenerDisposer>(new MyServerListener(this.socket, ServerConfig.LISTENER_THREAD_POOL_SIZE, ServerConfig.LISTENER_THREAD_ALIVE_TIME), disposer, true);\n\t\t\tthis.listenerRunnerList.add(runner);\n\t\t\trunner.start();\n\t\t}\n\n\t\t// Initialize the server IO registry. 11/07/2014, Bing Li\n\t\tMyServerIORegistry.REGISTRY().init();\n\t\t// Initialize a client pool, which is used by the server to connect to the remote end. 09/17/2014, Bing Li\n\t\tClientPool.SERVER().init();\n\t}", "private void startServer(int port) throws IOException {\n System.out.println(\"Booting the server!\");\n\n // Open the server channel.\n serverSocketChannel = ServerSocketChannel.open();\n serverSocketChannel.bind(new InetSocketAddress(port));\n serverSocketChannel.configureBlocking(false);\n\n // Register the channel into the selector.\n selector = Selector.open();\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n }", "public static Handler<RoutingContext> serve(String spaDir, int port) {\n return serve(spaDir, port, \"npm\", \"start\", \"--\");\n }", "public ServerMain( int port )\r\n\t{\r\n\t\tthis.port = port;\r\n\t\tserver = new Server( this.port );\r\n\t}", "public Server(int port)\r\n\t\t{\r\n log(\"Initialising port \" + port);\r\n\r\n\t\t// Set the port\r\n\t\tthis.port = port;\r\n\r\n // Create the server socket\r\n createServerSocket();\r\n \t}", "public static void start(int port) {\r\n\r\n SpringApplication app = new SpringApplication(DaprApplication.class);\r\n\r\n app.run(String.format(\"--server.port=%d\", port));\r\n }", "public StaticServer(final int port) throws ConcordiaException {\n\t\t// Start the server.\n\t\tInetSocketAddress addr = new InetSocketAddress(port);\n\t\ttry {\n\t\t\tserver = HttpServer.create(addr, 0);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tthrow\n\t\t\t\tnew ConcordiaException(\n\t\t\t\t\t\"There was an error starting the server.\",\n\t\t\t\t\te);\n\t\t}\n\t\t\n\t\t// Create the handler and attach to the root of the domain.\n\t\thandler = new RequestHandler();\n\t\tserver.createContext(\"/\", handler);\n\t\t\n\t\t// Set the thread pool.\n\t\tserver.setExecutor(Executors.newCachedThreadPool());\n\t\t\n\t\t// Start the server.\n\t\tserver.start();\n\t}", "public static <T extends EmbeddedTestServer> T initializeAndStartServer(\n T server, Context context, int port) {\n server.initializeNative(context, ServerHTTPSSetting.USE_HTTP);\n server.addDefaultHandlers(\"\");\n if (!server.start(port)) {\n throw new EmbeddedTestServerFailure(\"Failed to start serving using default handlers.\");\n }\n return server;\n }", "public void startServer() {\n URLClassLoader loader = createClasspath(opts);\n X_Process.runInClassloader(loader, appServer\n .map(DevAppServer::doStartServer, getAppName() + \"Server\", getPort())\n .ignoreOut1().unsafe());\n }", "public void startServer() {\n // configure the server properties\n int maxThreads = 20;\n int minThreads = 2;\n int timeOutMillis = 30000;\n\n // once routes are configured, the server automatically begins\n threadPool(maxThreads, minThreads, timeOutMillis);\n port(Integer.parseInt(this.port));\n this.configureRoutesAndExceptions();\n }", "public Server(int port) {\n this.port = port;\n try {\n sock = new ServerSocket(port);\n clientSock = sock.accept();\n\n //Connection established, do some fancy stuff here\n processReq();\n } catch (IOException e) {\n System.err.println(\"ERROR: Sth failed while creating server socket :( \");\n }\n }", "public IndexServer(int port, File fname) throws IOException {\n super(port, fname);\n }", "public WebServer(int port) {\n\t\ttry {\n\t\t\tthis.listen_port = new ServerSocket(port);\n\t\t\tthis.pool = Executors.newFixedThreadPool(40);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void listen(final int port, final String host) {\n server = Undertow.builder()\n .addHttpListener(port, host)\n .setHandler(new Listener(this)).build();\n server.start();\n }", "public WebServer(int port, Context context) throws IOException {\n this.server = HttpServer.create(new InetSocketAddress(port), 0);\n \n // handle concurrent requests with multiple threads\n server.setExecutor(Executors.newCachedThreadPool());\n \n List<Filter> logging = List.of(new ExceptionsFilter(), new LogFilter());\n\n StaticFileHandler.create(server, \"/static/\", \"static/\", \"invalid\");\n HttpContext eval = server.createContext(\"/eval/\", exchange -> handleEval(exchange, context));\n eval.getFilters().addAll(logging);\n }", "private static ServerSocket startServer(int port) {\n if (port != 0) {\n ServerSocket serverSocket;\n try {\n serverSocket = new ServerSocket(port);\n System.out.println(\"Server listening, port: \" + port + \".\");\n System.out.println(\"Waiting for connection... \");\n return serverSocket;\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return null;\n }", "public void start(String portArgument) {\n if (!Strings.isNullOrEmpty(portArgument)) {\n port(parsePort(portArgument));\n }\n mapExceptions();\n initAccountEndpoints();\n initUserEndpoints();\n initManagementEndpoints();\n }", "public void startServer() {\n server.start();\n }", "public void run()\n\t{\n\t\trunning = true;\n\t\tSystem.out.println(\"Server started on port \" + port);\n\t}", "public void start() {\n System.err.println(\"Server will listen on \" + server.getAddress());\n server.start();\n }", "public static EmbeddedTestServer createAndStartServerWithPort(Context context, int port) {\n Assert.assertNotEquals(\"EmbeddedTestServer should not be created on UiThread, \"\n + \"the instantiation will hang forever waiting for tasks to post to UI thread\",\n Looper.getMainLooper(), Looper.myLooper());\n EmbeddedTestServer server = new EmbeddedTestServer();\n return initializeAndStartServer(server, context, port);\n }", "public static Server startServer(AvroSourceProtocol handler, int port, boolean enableCompression) {\n Responder responder = new SpecificResponder(AvroSourceProtocol.class,\n handler);\n Server server;\n if (enableCompression) {\n server = new NettyServer(responder,\n new InetSocketAddress(localhost, port),\n new NioServerSocketChannelFactory\n (Executors .newCachedThreadPool(), Executors.newCachedThreadPool()),\n new CompressionChannelPipelineFactory(), null);\n } else {\n server = new NettyServer(responder,\n new InetSocketAddress(localhost, port));\n }\n server.start();\n logger.info(\"Server started on hostname: {}, port: {}\",\n new Object[] { localhost, Integer.toString(server.getPort()) });\n\n try {\n\n Thread.sleep(300L);\n\n } catch (InterruptedException ex) {\n logger.error(\"Thread interrupted. Exception follows.\", ex);\n Thread.currentThread().interrupt();\n }\n\n return server;\n }", "public void setServer(int port) {\n this.server = port;\n }", "@Parameter(optional=true, description=\"Port number for the embedded Jetty HTTP server, default: \\\\\\\"\" + ServletEngine.DEFAULT_PORT + \"\\\\\\\". \"\n\t\t\t+ \"If the port is set to 0, the jetty server uses a free tcp port, and the metric `serverPort` delivers the actual value.\")\n\tpublic void setPort(int port) {}", "public Server(int port, mainViewController viewController, LogViewController consoleViewController){\n isRunningOnCLI = false;\n this.viewController = viewController;\n this.port = port;\n this.consoleViewController = consoleViewController;\n viewController.serverStarting();\n log = new LoggingSystem(this.getClass().getCanonicalName(),consoleViewController);\n log.infoMessage(\"New server instance.\");\n try{\n this.serverSocket = new ServerSocket(port);\n //this.http = new PersonServlet();\n log.infoMessage(\"main.Server successfully initialised.\");\n clients = Collections.synchronizedList(new ArrayList<>());\n ServerOn = true;\n log.infoMessage(\"Connecting to datastore...\");\n //mainStore = new DataStore();\n jettyServer = new org.eclipse.jetty.server.Server(8080);\n jettyContextHandler = new ServletContextHandler(jettyServer, \"/\");\n jettyContextHandler.addServlet(servlets.PersonServlet.class, \"/person/*\");\n jettyContextHandler.addServlet(servlets.LoginServlet.class, \"/login/*\");\n jettyContextHandler.addServlet(servlets.HomeServlet.class, \"/home/*\");\n jettyContextHandler.addServlet(servlets.DashboardServlet.class, \"/dashboard/*\");\n jettyContextHandler.addServlet(servlets.UserServlet.class, \"/user/*\");\n jettyContextHandler.addServlet(servlets.JobServlet.class, \"/job/*\");\n jettyContextHandler.addServlet(servlets.AssetServlet.class, \"/assets/*\");\n jettyContextHandler.addServlet(servlets.UtilityServlet.class, \"/utilities/*\");\n jettyContextHandler.addServlet(servlets.EventServlet.class, \"/events/*\");\n //this.run();\n } catch (IOException e) {\n viewController.showAlert(\"Error initialising server\", e.getMessage());\n viewController.serverStopped();\n log.errorMessage(e.getMessage());\n }\n }", "public static void startServer(int port, int timeout) {\n RRCPServer.port = port;\n RRCPServer.timeout = timeout;\n clientListener.startListener();\n }", "public void start(int port) {\r\n Thread thread = new Thread(this);\r\n this.port = port;\r\n thread.start();\r\n }", "public Server(int port) {\n this.port = port;\n try {\n socket = new DatagramSocket(port);\n } catch (SocketException e) {\n e.printStackTrace();\n }\n run = new Thread(this, \"Server\");\n run.start();\n }", "private static void openServerSocket(int port) {\n\t\ttry {\n\t\t\tserverSocket = new ServerSocket(port);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Server Error\");\n\t\t}\n\t}", "private boolean configureAndStart(int port) {\n\t\ttry {\n\t\t\t//get local host to bind\n\t\t\tString host = InetAddress.getLocalHost().getHostName();\n//\t\t\thost = \"localhost\";\n\t\t\tSystem.out.printf(\"Listening on: Host: %s, Port: %d%n\", host, port);\n\n\t\t\tselector = Selector.open();\n\n\t\t\tserverChannel = ServerSocketChannel.open();\n\t\t\tserverChannel.socket().bind( new InetSocketAddress( host, port ) );\n\t\t\tserverChannel.configureBlocking( false );\n\n\t\t\t//setup selector to listen for connections on this serverSocketChannel\n\t\t\tserverChannel.register( selector, SelectionKey.OP_ACCEPT );\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Configuration for Server failed. Exiting.\");\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\tSystem.out.println(\"Server Successfully configured\");\n\n\t\t//start up the ThreadPool\n\t\tmanager.start();\n\n\t\t//create timer to handle output, and timeout\n\t\ttimer = new Timer(\"Output_and_timeout\");\n\t\t//schedule output\n\t\ttimer.scheduleAtFixedRate(new ServerOutput(batchTime), Constants.OUTPUT_TIME * 1000,\n\t\t\t\tConstants.OUTPUT_TIME * 1000);\n\t\ttimeout = new ScheduleTimeout(this);\n\t\ttimer.scheduleAtFixedRate(timeout, batchTime * 1000, batchTime * 1000);\n\n\t\treturn true;\n\t}", "public void startServer() throws IOException {\n log.info(\"Starting server in port {}\", port);\n try {\n serverSocket = new ServerSocket(port);\n this.start();\n log.info(\"Started server. Server listening in port {}\", port);\n } catch (IOException e) {\n log.error(\"Error starting the server socket\", e);\n throw e;\n }\n }", "@Override\r\n\tpublic boolean listenAt(int port) {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t\tsocket = serverSocket.accept();\r\n\t\t\toutStreamServer = socket.getOutputStream();\r\n\t\t\tinStreamServer = socket.getInputStream();\r\n\t\t\treturn true;\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t} finally {\r\n\t\t}\r\n\t}", "public Server(int port){\n\t\ttry {\n\t\t\tdatagramSocket = new DatagramSocket(port);\n\t\t\trequest = new byte[280];\n\t\t} catch (SocketException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\n\t}", "void startServer(String name, Config.ServerConfig config);", "public DefaultTCPServer(int port) throws Exception {\r\n\t\tserverSocket = new ServerSocket(port);\t}", "public TCPServer(int port) throws IOException {\n\tthis.socket = new ServerSocket(port);\n\tthis.clients = new ArrayList();\n\n\tSystem.out.println(\"SERVER: Started\");\n }", "public Server(int port) throws IOException{\n\t\tsuper();\n\t\tthis.serversocket= new java.net.ServerSocket(port);\n\t\t\n\t\tif (DEBUG){\n\t\t\tSystem.out.println(\"Server socket created:\" + this.serversocket.getLocalPort());\n\t\t\tclient_list.add(String.valueOf(this.serversocket.getLocalPort()));\n\t\t}\n\t}", "public void run() {\n ServerSocketChannelFactory acceptorFactory = new OioServerSocketChannelFactory();\n ServerBootstrap server = new ServerBootstrap(acceptorFactory);\n\n // The pipelines string together handlers, we set a factory to create\n // pipelines( handlers ) to handle events.\n // For Netty is using the reactor pattern to react to data coming in\n // from the open connections.\n server.setPipelineFactory(new EchoServerPipelineFactory());\n\n server.bind(new InetSocketAddress(port));\n }", "public void run() {\n try {\n this.listener = new ServerSocket(port);\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n // On new connections, start a new thread to handle communications.\n try {\n while(true) {\n new Handler(this.listener.accept()).start();\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n this.listener.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "public void launch(int port) {\n try {\n Registry registry = LocateRegistry.createRegistry( port );\n\n EchoService service = new ReversedEchoServiceImpl();\n EchoService stub = (EchoService) UnicastRemoteObject.exportObject(service, 0);\n\n registry.bind(\"com.anotheria.strel.rmi.EchoService\", stub);\n\n log.info(String.format(\"Service is now accessible on port %d with name com.anotheria.strel.rmi.EchoService\", port));\n }\n catch (RemoteException ex) {\n log.fatal(\"Remote Exception: \" + ex.getMessage());\n }\n catch (AlreadyBoundException ex) {\n log.fatal(\"Echo service is already bound with given name: \" + ex.getMessage());\n }\n }", "private void startListen() {\n try {\n listeningSocket = new ServerSocket(listeningPort);\n } catch (IOException e) {\n throw new RuntimeException(\"Cannot open listeningPort \" + listeningPort, e);\n }\n }", "public void setPort(int port) {\n this.port = port;\n }", "public void setPort(int port) {\n this.port = port;\n }", "public void setPort(int port) {\n this.port = port;\n }", "public void setPort(int port) {\n this.port = port;\n }", "public void setPort(int port) {\n this.port = port;\n }", "public void setPort(int port) {\n this.port = port;\n }", "public void setPort(String port) {\r\n this.port = port;\r\n }", "public void startLdapServer(int port) throws Exception {\n\n workDir = new File(System.getProperty(\"java.io.tmpdir\"), \"TEMP_APACHEDS-\" + System.currentTimeMillis());\n workDir.mkdirs();\n // Initialize the LDAP service\n ldapServer = new LdapServer();\n ldapServer.setTransports(new TcpTransport(port));\n\n service = new DefaultDirectoryService();\n ldapServer.setDirectoryService(service);\n service.setInstanceLayout(new InstanceLayout(workDir));\n\n // Disable the ChangeLog system\n service.getChangeLog().setEnabled(false);\n service.setDenormalizeOpAttrsEnabled(true);\n\n // Initialize a schema partition\n initSchemaPartition();\n\n // Initialize the system partition\n initSystemPartition();\n\n // Create a new partition named 'b7a'.\n Partition b7aPartition = addPartition(LDAP_AUTH_TEST_PARTITION_NAME,\n LDAP_AUTH_TEST_PARTITION_DN, service.getDnFactory());\n service.addPartition(b7aPartition);\n\n // Start the service\n service.startup();\n // Start the Ldap Server\n ldapServer.start();\n\n // Load the LDIF file\n String ldif = new File(\"src\" + File.separator + \"test\" + File.separator + \"resources\" + File.separator +\n \"auth\" + File.separator + \"src\" + File.separator + \"ldif\").getAbsolutePath() + File.separator +\n \"users-import.ldif\";\n LdifFileLoader ldifLoader = new LdifFileLoader(service.getAdminSession(), ldif);\n ldifLoader.execute();\n }", "public void setPort(int port) {\r\n this.port = port;\r\n }", "public void setServerPort(int serverPort) {\n this.serverPort = serverPort;\n }", "public void run() {\n final Server server = new Server(8081);\n\n // Setup the basic RestApplication \"context\" at \"/\".\n // This is also known as the handler tree (in Jetty speak).\n final ServletContextHandler context = new ServletContextHandler(\n server, CONTEXT_ROOT);\n final ServletHolder restEasyServlet = new ServletHolder(\n new HttpServletDispatcher());\n restEasyServlet.setInitParameter(\"resteasy.servlet.mapping.prefix\",\n APPLICATION_PATH);\n restEasyServlet.setInitParameter(\"javax.ws.rs.Application\",\n \"de.kad.intech4.djservice.RestApplication\");\n context.addServlet(restEasyServlet, CONTEXT_ROOT);\n\n\n try {\n server.start();\n server.join();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "final public void setPort(int port) {\n this.port = port;\n }", "public void setPort(int port);", "public void setPort(int port);", "public void setPort (int port) {\n this.port = port;\n }", "public void start() throws IOException {\n\t\tserverSocket = new ServerSocket(port);\n\t\tserverCallbacks.forEach(c -> c.onServerStarted(this, port));\n\t}", "public CertAuthHost setPort(int port)\n\t\t{\n\t\t\tif (this.started)\n\t\t\t\tthrow new IllegalStateException(\"Server already started!\");\n\t\t\tthis.port = port;\n\t\t\treturn this;\n\t\t}", "public void run() {\n running = true;\n System.out.println(\"Server started on port: \" + port);\n manageClients();\n receive();\n startConsole();\n }", "public void start() {\n System.out.println(\"server started\");\n mTerminalNetwork.listen(mTerminalConfig.port);\n }", "public void port (int port) {\n this.port = port;\n }", "public NanoHTTPDSingleFile(int port) {\n\t\tthis(null, port);\n\t}", "public void setPort(int port) {\n\t\tthis.port = port;\n\t}", "public void setPort(int port) {\n\t\tthis.port = port;\n\t}", "public void startNetwork(int port);", "public void start() {\n\t\t\n\t\ttry {\n\t\t\tmainSocket = new DatagramSocket(PORT_NUMBER);\n\t\t}\n\t\tcatch(SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\t//Lambda expression to shorten the run method\n\t\tThread serverThread = new Thread( () -> {\n\t\t\tlisten();\n\t\t});\n\t\t\n\t\tserverThread.start();\n\t}", "public void setPort(int port) {\r\n\t\tthis.port = port;\r\n\t}", "public void setPort(int port) {\r\n\t\tthis.port = port;\r\n\t}", "public void setPort(Integer port) {\n this.port = port;\n }", "public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }", "public Server(int port) {\n \ttry{\n \t\tserver = new ServerSocket(port);\n \t\tuserMap = new HashMap<Integer, User>();\n \t\troomMap = new HashMap<String, Channel>();\n \t\tnextId = 0;\n \t}\n \tcatch(Exception e){\n \t\te.printStackTrace(); \t\t\n \t}\n }", "public static ServerBuilder<?> forPort(int port) {\n return ServerProvider.provider().builderForPort(port);\n }", "public void setPort(Integer port) {\n this.port = port;\n }", "public void startServer()\n\t{\n\t\twhile(true)\n\t\t{\n\t\t\tSystem.out.println(\"Listen\");\n\t\t\tif(listenInitialValuesRequest)\n\t\t\t{\n\t\t\t\tlistenInitialValuesRequest();\n\t\t\t}\n\t\t}\n\t}", "public void runServer() throws IOException {\n runServer(0);\n }", "public static void serverConnection(String port) throws IOException{\n\t\t\n\t\t//Extract the port number\n\t\tint port_num;\n\t\tif (port.length() != 0) {\n\t\t\tport_num = Integer.parseInt(port); \n\t\t}\n\t\telse {\n\t\t\tport_num = 4444; \n\t\t}\n\t\t\n\t\t\n\t\t//Create server socket\n\t\tServerSocket serverSocket = null; \n\t\ttry {\n\t\t\tserverSocket = new ServerSocket(port_num);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Could not listen to port: \" + port); \n\t\t}\n\t\t\n\t\t//Accept client socket\n\t\tSocket clientSocket = null; \n\t\tboolean open = true;\n\t\twhile(open) {\n\t\t\ttry {\n\t\t\t\tclientSocket = serverSocket.accept(); \n\n\t\t\t}catch(IOException e) {\n\t\t\t\tif (!open) {\n\t\t\t\t\tSystem.err.println(\"Server not running\");\n\t\t\t}\t\n\t\t }\t\n\t\t}\t\t\n\t}", "public void run(){\n\t\tstartServer();\n\t}", "public SecureWebServer(int port)\n {\n this(port, null);\n }", "public void setPort(Integer port) {\n this.port = port;\n }", "public void setPort(Integer port) {\n this.port = port;\n }", "public void setPort(Integer port) {\n this.port = port;\n }", "public void setPort(Integer port) {\n this.port = port;\n }", "public void runServer(){\n try {\n serverSocket = new ServerSocket(portNumber);\n } catch (IOException ioe){\n System.out.println(ioe.getMessage());\n }\n \n while (true) { \n try {\n Socket clientSocket = serverSocket.accept();\n InetAddress inetAddress = clientSocket.getInetAddress();\n System.out.println(\"Connected with \" + inetAddress.getHostName()+ \".\\n IP address: \" + inetAddress.getHostAddress() + \"\\n\");\n new Thread(new RequestHandlerRunnable(clientSocket, database)).start();\n } catch (IOException ioe){\n System.out.println(ioe.getMessage());\n }\n }\n \n }", "public void setServerPort(int serverPort) {\n\t\tthis.serverPort = serverPort;\n\t}", "public void start() throws RemoteException, AlreadyBoundException\n {\n start(DEFAULT_PORT);\n }", "public RegistryImpl(int port) throws RemoteException\n {\n Skeleton skeleton = new Skeleton(this, \"127.0.0.1\", port, 0);\n skeleton.start();\n }", "public static void main(String[] args) {\r\n int port = 5000;\r\n Server server = new Server(port);\r\n\r\n //Start the server thread:\r\n server.start();\r\n }", "@Override\n public void start(Future<Void> startFuture) {\n vertx.createHttpServer()\n .requestHandler(getRequestHandler()).listen(8080, http -> {\n if (http.succeeded()) {\n startFuture.complete();\n LOGGER.info(\"HTTP server started on http://localhost:8080\");\n } else {\n startFuture.fail(http.cause());\n }\n });\n }", "private void runServer()\n {\n int port = Integer.parseInt(properties.getProperty(\"port\"));\n String ip = properties.getProperty(\"serverIp\");\n \n Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, \"Server started. Listening on: {0}, bound to: {1}\", new Object[]{port, ip});\n try\n {\n serverSocket = new ServerSocket();\n serverSocket.bind(new InetSocketAddress(ip, port));\n do\n {\n Socket socket = serverSocket.accept(); //Important Blocking call\n Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, \"Connected to a client. Waiting for username...\");\n ClientHandler ch = new ClientHandler(socket, this);\n clientList.add(ch);\n ch.start();\n } while (keepRunning);\n } catch (IOException ex)\n {\n Logger.getLogger(ChatServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public Server(){\n\t\ttry {\n\t\t\t// initialize the server socket with the specified port\n\t\t\tsetServerSocket(new ServerSocket(PORT));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO Exception while creating a server\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\r\n\t\t\r\n\t\t// get the command line argument\r\n\t\t\r\n\t\tif (args.length < 1) {\r\n\t\t\tSystem.out.println(\"Error: expected 1 argument containing directory in 'files/'.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tString path = args[0];\r\n\t\t\r\n\t\tint port = 8000;\r\n\t\t\r\n\t\tif (args.length > 1) {\r\n\t\t\tport = Integer.parseInt(args[1]);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// setup the server and listen for incoming connections\r\n\t\t\r\n\t\tServerSocket serverSocket = new ServerSocket(port);\r\n\t\tSystem.out.println(\"Listening on port \" + port + \"...\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\twhile (true) {\r\n\t\t\t\tSocket socket = serverSocket.accept();\r\n\t\t\t\tnew Thread(new HttpConnection(socket, path)).start();\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\tserverSocket.close();\r\n\t\t}\r\n\t}", "static void startServer(String tracker_file, int port, String file_location) throws IOException {\n\t\tTrackerInfo ctracker = new TrackerInfo(tracker_file);\n\t\tPeer peer = new Peer(InetAddress.getByName(\"127.0.0.1\"), port, ctracker, file_location);\n\t\tpeer.waitingForClient();\n\t\twhile(true) {\n\t\t\tif(peer.out_buf.size() > 0) {\n\t\t\t\tif(!peer.send()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!peer.recieve()) {\n\t\t\t\tif(peer.out_buf.size() == 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\tpeer.recieveHandle();\n\t\t\t}\n\t\t}\n\t\tpeer.closeTCP();\n\t}" ]
[ "0.73782605", "0.71821904", "0.7086662", "0.6914627", "0.68883955", "0.6872791", "0.68115354", "0.67106134", "0.6682079", "0.66554344", "0.6599183", "0.64969563", "0.64676386", "0.6440925", "0.638407", "0.63734984", "0.6370374", "0.6188826", "0.6174692", "0.616852", "0.61536956", "0.613477", "0.6107271", "0.6079892", "0.60793376", "0.60226554", "0.5951852", "0.59511966", "0.5944038", "0.59390813", "0.59353995", "0.59348106", "0.5930511", "0.5913191", "0.5912621", "0.5892289", "0.5873258", "0.58716613", "0.58617085", "0.5842791", "0.58289003", "0.5820383", "0.58073866", "0.57483774", "0.5743463", "0.57346094", "0.57211345", "0.5719821", "0.5714484", "0.5708983", "0.5708983", "0.5708983", "0.5708983", "0.5708983", "0.5708983", "0.56915534", "0.5682665", "0.5659826", "0.5651992", "0.5651127", "0.56060857", "0.5602109", "0.5602109", "0.5597349", "0.5578926", "0.5569665", "0.5568677", "0.55672956", "0.5553802", "0.5553445", "0.55460185", "0.55460185", "0.55406785", "0.5530468", "0.5530094", "0.5530094", "0.5515156", "0.55019474", "0.54950744", "0.54929924", "0.5484495", "0.54837424", "0.5478194", "0.54774714", "0.54754764", "0.54714596", "0.54625356", "0.54625356", "0.54625356", "0.54625356", "0.54619867", "0.54545027", "0.54520255", "0.5439195", "0.5436132", "0.54316086", "0.54113483", "0.5408224", "0.54020506", "0.5399388" ]
0.6747396
7
Create and initialize a server with the default handlers. This handles native object initialization, server configuration, and server initialization. On returning, the server is ready for use.
public static EmbeddedTestServer createAndStartServer(Context context) { return createAndStartServerWithPort(context, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Server() {\n\t\tinit(new Config());\n\t}", "private void initialize() throws IOException, ServletException, URISyntaxException {\n\n LOG.info(\"Initializing the internal Server\");\n Log.setLog(new Slf4jLog(Server.class.getName()));\n\n /*\n * Create and configure the server\n */\n this.server = new Server();\n this.serverConnector = new ServerConnector(server);\n this.serverConnector.setReuseAddress(Boolean.TRUE);\n\n LOG.info(\"Server configure ip = \" + DEFAULT_IP);\n LOG.info(\"Server configure port = \" + DEFAULT_PORT);\n\n this.serverConnector.setHost(DEFAULT_IP);\n this.serverConnector.setPort(DEFAULT_PORT);\n this.server.addConnector(serverConnector);\n\n /*\n * Setup the basic application \"context\" for this application at \"/iop-node\"\n */\n this.servletContextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);\n this.servletContextHandler.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n this.server.setHandler(servletContextHandler);\n\n /*\n * Initialize webapp layer\n */\n WebAppContext webAppContext = new WebAppContext();\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n\n URL webPath = JettyEmbeddedAppServer.class.getClassLoader().getResource(\"web\");\n LOG.info(\"webPath = \" + webPath.getPath());\n\n webAppContext.setResourceBase(webPath.toString());\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH+\"/web\");\n webAppContext.addBean(new ServletContainerInitializersStarter(webAppContext), true);\n webAppContext.setWelcomeFiles(new String[]{\"index.html\"});\n webAppContext.addFilter(AdminRestApiSecurityFilter.class, \"/rest/api/v1/admin/*\", EnumSet.of(DispatcherType.REQUEST));\n webAppContext.setInitParameter(\"org.eclipse.jetty.servlet.Default.dirAllowed\", \"false\");\n servletContextHandler.setHandler(webAppContext);\n server.setHandler(webAppContext);\n\n /*\n * Initialize restful service layer\n */\n ServletHolder restfulServiceServletHolder = new ServletHolder(new HttpServlet30Dispatcher());\n restfulServiceServletHolder.setInitParameter(\"javax.ws.rs.Application\", JaxRsActivator.class.getName());\n restfulServiceServletHolder.setInitParameter(\"resteasy.use.builtin.providers\", \"true\");\n restfulServiceServletHolder.setAsyncSupported(Boolean.TRUE);\n webAppContext.addServlet(restfulServiceServletHolder, \"/rest/api/v1/*\");\n\n this.server.dump(System.err);\n\n }", "private Server() {\r\n\r\n\t\t// Make sure that all exceptions are written to the log\r\n\t\tThread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler());\r\n\r\n\t\tnew Thread() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Find all controllers and initialize them\r\n\t\t\t\t * \r\n\t\t\t\t */\r\n\t\t\t\tReflections reflections = new Reflections(\"net.yourhome.server\");\r\n\t\t\t\tSet<Class<? extends IController>> controllerClasses = reflections.getSubTypesOf(IController.class);\r\n\r\n\t\t\t\tfor (final Class<? extends IController> controllerClass : controllerClasses) {\r\n\t\t\t\t\tif (!Modifier.isAbstract(controllerClass.getModifiers())) {\r\n\t\t\t\t\t\tnew Thread() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\tMethod factoryMethod;\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tfactoryMethod = controllerClass.getDeclaredMethod(\"getInstance\");\r\n\t\t\t\t\t\t\t\t\tIController controllerObject = (IController) factoryMethod.invoke(null, null);\r\n\t\t\t\t\t\t\t\t\tServer.this.controllers.put(controllerObject.getIdentifier(), controllerObject);\r\n\t\t\t\t\t\t\t\t\tSettingsManager.readSettings(controllerObject);\r\n\t\t\t\t\t\t\t\t\tcontrollerObject.init();\r\n\t\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t\tServer.log.error(\"Could not instantiate \" + controllerClass.getName() + \" because getInstance is missing\", e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}.start();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.start();\r\n\r\n\t}", "public void init() {\r\n\t\tthis.initWebAndSocketServer();\r\n\r\n\t\t/*\r\n\t\t * Set/update server info\r\n\t\t */\r\n\t\ttry {\r\n\t\t\tServerInfo serverInfo = Info.getServerInfo();\r\n\t\t\tserverInfo.setPort(Integer.parseInt(SettingsManager.getStringValue(GeneralController.getInstance().getIdentifier(), GeneralController.Settings.NET_HTTP_PORT.get())));\r\n\t\t\tserverInfo.setName(SettingsManager.getStringValue(GeneralController.getInstance().getIdentifier(), GeneralController.Settings.SERVER_NAME.get(), \"Home server\"));\r\n\t\t\tserverInfo.setVersion(BuildConfig.VERSION);\r\n\t\t\tInfo.writeServerInfo(serverInfo);\r\n\t\t} catch (IOException | JSONException e1) {\r\n\t\t\tServer.log.error(\"Could not update server info. Designer might not work as expected: \" + e1.getMessage());\r\n\t\t}\r\n\r\n\t\tRuleManager.init();\r\n\t}", "public Server() {\n\t\tsession = new WelcomeSession();\n\t\tmPort = DEFAULT_PORT;\n\t\texecutor = Executors.newCachedThreadPool();\n\t}", "public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}", "public void startServer() {\n // configure the server properties\n int maxThreads = 20;\n int minThreads = 2;\n int timeOutMillis = 30000;\n\n // once routes are configured, the server automatically begins\n threadPool(maxThreads, minThreads, timeOutMillis);\n port(Integer.parseInt(this.port));\n this.configureRoutesAndExceptions();\n }", "public static void initializeServer() {\n\t\tServer.initializeServerGUI();\n\t}", "@Override\n public void initialize() {\n\n try {\n /* Bring up the API server */\n logger.info(\"loading API server\");\n apiServer.start();\n logger.info(\"API server started. Say Hello!\");\n /* Bring up the Dashboard server */\n logger.info(\"Loading Dashboard Server\");\n if (dashboardServer.isStopped()) { // it may have been started when Flux is run in COMBINED mode\n dashboardServer.start();\n }\n logger.info(\"Dashboard server has started. Say Hello!\");\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "public static HttpServer startServer() {\n // create a resource config that scans for JAX-RS resources and providers\n // in com.example.rest package\n final ResourceConfig rc = new ResourceConfig().packages(\"com.assignment.backend\");\n rc.register(org.glassfish.jersey.moxy.json.MoxyJsonFeature.class);\n rc.register(getAbstractBinder());\n rc.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);\n rc.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n return GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n }", "public void startServer() {\n URLClassLoader loader = createClasspath(opts);\n X_Process.runInClassloader(loader, appServer\n .map(DevAppServer::doStartServer, getAppName() + \"Server\", getPort())\n .ignoreOut1().unsafe());\n }", "@Override\n @SuppressWarnings(\"CallToPrintStackTrace\")\n public void simpleInitApp() {\n \n\n try {\n System.out.println(\"Using port \" + port);\n // create the server by opening a port\n server = Network.createServer(port);\n server.start(); // start the server, so it starts using the port\n } catch (IOException ex) {\n ex.printStackTrace();\n destroy();\n this.stop();\n }\n System.out.println(\"Server started\");\n // create a separat thread for sending \"heartbeats\" every now and then\n new Thread(new NetWrite()).start();\n server.addMessageListener(new ServerListener(), ChangeVelocityMessage.class);\n // add a listener that reacts on incoming network packets\n \n }", "private ServerSocket setUpServer(){\n ServerSocket serverSocket = null;\n try{\n serverSocket = new ServerSocket(SERVER_PORT);\n\n }\n catch (IOException ioe){\n throw new RuntimeException(ioe.getMessage());\n }\n return serverSocket;\n }", "private void initServerSocket()\n\t{\n\t\tboundPort = new InetSocketAddress(port);\n\t\ttry\n\t\t{\n\t\t\tserverSocket = new ServerSocket(port);\n\n\t\t\tif (serverSocket.isBound())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Server bound to data port \" + serverSocket.getLocalPort() + \" and is ready...\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to initiate socket.\");\n\t\t}\n\n\t}", "public static <T extends EmbeddedTestServer> T initializeAndStartServer(\n T server, Context context, int port) {\n server.initializeNative(context, ServerHTTPSSetting.USE_HTTP);\n server.addDefaultHandlers(\"\");\n if (!server.start(port)) {\n throw new EmbeddedTestServerFailure(\"Failed to start serving using default handlers.\");\n }\n return server;\n }", "public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }", "public Server() {}", "private void init() {\n\n\t\tgroup = new NioEventLoopGroup();\n\t\ttry {\n\t\t\thandler = new MoocHandler();\n\t\t\tBootstrap b = new Bootstrap();\n\t\t\t\n\t\t\t\n\t\t\t//ManagementInitializer ci=new ManagementInitializer(false);\n\t\t\t\n\t\t\tMoocInitializer mi=new MoocInitializer(handler, false);\n\t\t\t\n\t\t\t\n\t\t\t//ManagemenetIntializer ci = new ManagemenetIntializer(handler, false);\n\t\t\t//b.group(group).channel(NioSocketChannel.class).handler(handler);\n\t\t\tb.group(group).channel(NioSocketChannel.class).handler(mi);\n\t\t\tb.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000);\n\t\t\tb.option(ChannelOption.TCP_NODELAY, true);\n\t\t\tb.option(ChannelOption.SO_KEEPALIVE, true);\n\n\t\t\t// Make the connection attempt.\n\t\t\tchannel = b.connect(host, port).syncUninterruptibly();\n\n\t\t\t// want to monitor the connection to the server s.t. if we loose the\n\t\t\t// connection, we can try to re-establish it.\n\t\t\tChannelClosedListener ccl = new ChannelClosedListener(this);\n\t\t\tchannel.channel().closeFuture().addListener(ccl);\n\t\t\tSystem.out.println(\" channle is \"+channel);\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"failed to initialize the client connection\", ex);\n\n\t\t}\n\n\t\t// start outbound message processor\n\t//\tworker = new OutboundWorker(this);\n\t//\tworker.start();\n\t}", "public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Server() {\n\t\t\n\t\ttry {\n\t\t\tss= new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace(); // Default\n\t\t}\n\t}", "public ServerService(){\n\t\tlogger.info(\"Initilizing the ServerService\");\n\t\tservers.put(1001, new Server(1001, \"Test Server1\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1002, new Server(1002, \"Test Server2\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1003, new Server(1003, \"Test Server3\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1004, new Server(1004, \"Test Server4\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tlogger.info(\"Initilizing the ServerService Done\");\n\t}", "public Server(){\n\t\ttry {\n\t\t\t// initialize the server socket with the specified port\n\t\t\tsetServerSocket(new ServerSocket(PORT));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO Exception while creating a server\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void initAndListen() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t// Startuje nowy watek z odbieraniem wiadomosci.\n\t\t\t\tnew ClientHandler(clientSocket, this);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Accept failed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void initialize() {\n\t\ttransportManager = newServerTransportManager();\n\t\ttransportServer = newTransportServer();\n\t\tserverStateMachine = newTransportServerStateMachine();\n\n\t\tserverStateMachine.setServerTransportComponentFactory(this);\n\t\ttransportManager.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerHostConfig(getServerHostConfig());\n\n\t\tsetInitialized(true);\n\t}", "@Override\r\n \tpublic void initialize() {\n \t\tThreadRenamingRunnable.setThreadNameDeterminer(ThreadNameDeterminer.CURRENT);\r\n \r\n \t\tInetSocketAddress address;\r\n \r\n \t\tif (m_host == null) {\r\n \t\t\taddress = new InetSocketAddress(m_port);\r\n \t\t} else {\r\n \t\t\taddress = new InetSocketAddress(m_host, m_port);\r\n \t\t}\r\n \r\n \t\tm_queue = new LinkedBlockingQueue<ChannelBuffer>(m_queueSize);\r\n \r\n \t\tExecutorService bossExecutor = Threads.forPool().getCachedThreadPool(\"Cat-TcpSocketReceiver-Boss-\" + address);\r\n \t\tExecutorService workerExecutor = Threads.forPool().getCachedThreadPool(\"Cat-TcpSocketReceiver-Worker\");\r\n \t\tChannelFactory factory = new NioServerSocketChannelFactory(bossExecutor, workerExecutor);\r\n \t\tServerBootstrap bootstrap = new ServerBootstrap(factory);\r\n \r\n \t\tbootstrap.setPipelineFactory(new ChannelPipelineFactory() {\r\n \t\t\tpublic ChannelPipeline getPipeline() {\r\n \t\t\t\treturn Channels.pipeline(new MyDecoder(), new MyHandler());\r\n \t\t\t}\r\n \t\t});\r\n \r\n \t\tbootstrap.setOption(\"child.tcpNoDelay\", true);\r\n \t\tbootstrap.setOption(\"child.keepAlive\", true);\r\n \t\tbootstrap.bind(address);\r\n \r\n \t\tm_logger.info(\"CAT server started at \" + address);\r\n \t\tm_factory = factory;\r\n \t}", "@Override\n public void initialize(ServerConfiguration config) {\n }", "public Server(int port, mainViewController viewController, LogViewController consoleViewController){\n isRunningOnCLI = false;\n this.viewController = viewController;\n this.port = port;\n this.consoleViewController = consoleViewController;\n viewController.serverStarting();\n log = new LoggingSystem(this.getClass().getCanonicalName(),consoleViewController);\n log.infoMessage(\"New server instance.\");\n try{\n this.serverSocket = new ServerSocket(port);\n //this.http = new PersonServlet();\n log.infoMessage(\"main.Server successfully initialised.\");\n clients = Collections.synchronizedList(new ArrayList<>());\n ServerOn = true;\n log.infoMessage(\"Connecting to datastore...\");\n //mainStore = new DataStore();\n jettyServer = new org.eclipse.jetty.server.Server(8080);\n jettyContextHandler = new ServletContextHandler(jettyServer, \"/\");\n jettyContextHandler.addServlet(servlets.PersonServlet.class, \"/person/*\");\n jettyContextHandler.addServlet(servlets.LoginServlet.class, \"/login/*\");\n jettyContextHandler.addServlet(servlets.HomeServlet.class, \"/home/*\");\n jettyContextHandler.addServlet(servlets.DashboardServlet.class, \"/dashboard/*\");\n jettyContextHandler.addServlet(servlets.UserServlet.class, \"/user/*\");\n jettyContextHandler.addServlet(servlets.JobServlet.class, \"/job/*\");\n jettyContextHandler.addServlet(servlets.AssetServlet.class, \"/assets/*\");\n jettyContextHandler.addServlet(servlets.UtilityServlet.class, \"/utilities/*\");\n jettyContextHandler.addServlet(servlets.EventServlet.class, \"/events/*\");\n //this.run();\n } catch (IOException e) {\n viewController.showAlert(\"Error initialising server\", e.getMessage());\n viewController.serverStopped();\n log.errorMessage(e.getMessage());\n }\n }", "private static void startWebSocketServer() {\n\n Server webSocketServer = new Server();\n ServerConnector connector = new ServerConnector(webSocketServer);\n connector.setPort(PORT);\n webSocketServer.addConnector(connector);\n log.info(\"Connector added\");\n\n // Setup the basic application \"context\" for this application at \"/\"\n // This is also known as the handler tree (in jetty speak)\n ServletContextHandler webSocketContext = new ServletContextHandler(\n ServletContextHandler.SESSIONS);\n webSocketContext.setContextPath(\"/\");\n webSocketServer.setHandler(webSocketContext);\n log.info(\"Context handler set\");\n\n try {\n ServerContainer serverContainer = WebSocketServerContainerInitializer\n .configureContext(webSocketContext);\n log.info(\"Initialize javax.websocket layer\");\n\n serverContainer.addEndpoint(GreeterEndpoint.class);\n log.info(\"Endpoint added\");\n\n webSocketServer.start();\n log.info(\"Server started\");\n\n webSocketServer.join();\n log.info(\"Server joined\");\n\n } catch (Throwable t) {\n log.error(\"Error startWebSocketServer {0}\", t);\n }\n }", "public static RoMServer createServer() throws IOException, Exception {\r\n \t\t// Ip and Port out of config\r\n \t\tIConfig cfg = ConfigurationFactory.getConfig();\r\n \r\n \t\treturn RoMServer.createServer(cfg.getIp(), cfg.getPort());\r\n \t}", "private void startServer() {\n\t\ttry {\n//\t\t\tserver = new Server();\n//\t\t\tserver.start();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: add message in UI for user\n\t\t}\n\t}", "public ServerDef() {}", "public void startServer() {\n server.start();\n }", "private static void setupServerContext(){\n\n serverContext.set(new ServerContext());\n serverContext.get().bgThreadIds = new int[GlobalContext.getNumTotalBgThreads()];\n serverContext.get().numShutdownBgs = 0;\n serverContext.get().serverObj = new Server();\n\n }", "public Server() {\n initComponents();\n }", "public Server() {\n initComponents();\n }", "@Override\n public void onCreate() {\n super.onCreate();\n singleton = this;\n try {\n /*TODO: Inicializar Server\n * */\n Server.getInstance(this).init();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void initServer() throws IOException {\r\n \t\tLogger.logMessage(\"Binding Server to \" + this.serverIpAddress + \":\" + this.serverPort);\r\n \r\n \t\tthis.isAlive = true;\r\n \t\tthis.serverSocket = new ServerSocket(this.serverPort, this.backLog, this.serverIpAddress);\r\n \t\tthis.dataLayer = DataLayerFactory.getDataLayer();\r\n \r\n \t\t// Generate the grouplist\r\n \t\tCollection<String> dbGroupList = this.dataLayer.getGroups();\r\n \r\n \t\tfor (String group : dbGroupList) {\r\n \t\t\tthis.groupList.addGroup(group);\r\n \t\t}\r\n \r\n \t\tLogger.logMessage(\"Server successfuly bound!\");\r\n \t}", "public Server() {\n try {\n welcomeSocket = new ServerSocket(PORT);\n System.out.println(\"Server listening on \" + PORT);\n } catch (IOException e) {\n System.out.println(\"Error creating welcome socket. Is this socket available?\");\n }\n }", "void startServer(String name, Config.ServerConfig config);", "public Client() {\n initComponents();\n \n Server server = new Server();\n server.start();\n \n }", "static private Server createServer(String args[]) throws Exception {\n if (args.length < 1) {\n usage();\n }\n\n int port = PORT;\n int backlog = BACKLOG;\n boolean secure = SECURE;\n\n for (int i = 1; i < args.length; i++) {\n if (args[i].equals(\"-port\")) {\n checkArgs(i, args.length);\n port = Integer.valueOf(args[++i]);\n } else if (args[i].equals(\"-backlog\")) {\n checkArgs(i, args.length);\n backlog = Integer.valueOf(args[++i]);\n } else if (args[i].equals(\"-secure\")) {\n secure = true;\n } else {\n usage();\n }\n }\n\n Server server = null;\n\n if (args[0].equals(\"B1\")) {\n server = new B1(port, backlog, secure);\n } else if (args[0].equals(\"BN\")) {\n server = new BN(port, backlog, secure);\n } else if (args[0].equals(\"BP\")) {\n server = new BP(port, backlog, secure);\n } else if (args[0].equals(\"N1\")) {\n server = new N1(port, backlog, secure);\n } else if (args[0].equals(\"N2\")) {\n server = new N2(port, backlog, secure);\n }\n\n return server;\n }", "public WebServer ()\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = DEF_HOST; \t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = DEF_PORT; \t\t\t\t\t\t\t\t\r\n\t}", "public void init() throws IOException {\r\n try {\r\n serverSocket = new ServerSocket(PORT);\r\n this.running = true;\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }", "public void start() {\n\n // server 환경설정\n EventLoopGroup bossGroup = new NioEventLoopGroup(bossCount);\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n\n try {\n\n ServerBootstrap b = new ServerBootstrap();\n b.group(bossGroup, workerGroup)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>() {\n @Override\n public void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n pipeline.addLast(new StringDecoder(CharsetUtil.UTF_8));\n pipeline.addLast(new StringEncoder(CharsetUtil.UTF_8));\n pipeline.addLast(new LoggingHandler(LogLevel.INFO));\n pipeline.addLast(SERVICE_HANDLER);\n }\n })\n .option(ChannelOption.SO_BACKLOG, backLog)\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\n ChannelFuture channelFuture = b.bind(tcpPort).sync();\n channelFuture.channel().closeFuture().sync();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n\n }", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n new Thread( ()-> {\n try {\n //Start the server\n ServerSocket serverSocket = new ServerSocket(8080);\n\n //show in terminal server has started\n System.out.println(\"Server Started: at \" + new Date() + \"\\n\");\n\n //main loop that will accept connections\n while (true) {\n //accept a new socket connection, this socket comes from client\n Socket clientSocket = serverSocket.accept();\n\n //thread that will handle what to do with new socket\n new Thread(new HandleAclient(clientSocket)).start();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }).start();\n\n }", "public Server() throws IOException{\n\t\tsuper();\n\t\tthis.serversocket = new java.net.ServerSocket(DEFAULTPORT);\n\t\tif (DEBUG){\n\t\t\tSystem.out.println(\"Server socket created:\" + this.serversocket.getLocalPort());\n\t\t\tclient_list.add(String.valueOf(this.serversocket.getLocalPort()));\n\t\t}\n\t}", "public OOXXServer(){\n\t\ttry\n\t\t{\n\t\t\tserver = new ServerSocket(port);\n\t\t\t\n\t\t}\n\t\tcatch(java.io.IOException e)\n\t\t{\n\t\t}\n\t}", "public void initializeNative(Context context, ServerHTTPSSetting httpsSetting) {\n mContext = context;\n\n Intent intent = new Intent(EMBEDDED_TEST_SERVER_SERVICE);\n setIntentClassName(intent);\n if (!mContext.bindService(intent, mConn, Context.BIND_AUTO_CREATE)) {\n throw new EmbeddedTestServerFailure(\n \"Unable to bind to the EmbeddedTestServer service.\");\n }\n synchronized (mImplMonitor) {\n Log.i(TAG, \"Waiting for EmbeddedTestServer service connection.\");\n while (mImpl == null) {\n try {\n mImplMonitor.wait(SERVICE_CONNECTION_WAIT_INTERVAL_MS);\n } catch (InterruptedException e) {\n // Ignore the InterruptedException. Rely on the outer while loop to re-run.\n }\n Log.i(TAG, \"Still waiting for EmbeddedTestServer service connection.\");\n }\n Log.i(TAG, \"EmbeddedTestServer service connected.\");\n boolean initialized = false;\n try {\n initialized = mImpl.initializeNative(httpsSetting == ServerHTTPSSetting.USE_HTTPS);\n } catch (RemoteException e) {\n Log.e(TAG, \"Failed to initialize native server.\", e);\n initialized = false;\n }\n\n if (!initialized) {\n throw new EmbeddedTestServerFailure(\"Failed to initialize native server.\");\n }\n if (!mDisableResetterForTesting) {\n ResettersForTesting.register(this::stopAndDestroyServer);\n }\n\n if (httpsSetting == ServerHTTPSSetting.USE_HTTPS) {\n try {\n String rootCertPemPath = mImpl.getRootCertPemPath();\n X509Util.addTestRootCertificate(CertTestUtil.pemToDer(rootCertPemPath));\n } catch (Exception e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to install root certificate from native server.\", e);\n }\n }\n }\n }", "public RentRPCServer() {\n\t\tsuper(null, null);\n\t\t// mocking purpose\n\t}", "@Override\n\tprotected void initInternal() throws LifecycleException {\n bootstrap = new ServerBootstrap();\n //初始化\n bootstrap.group(bossGroup, workGroup)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>(){\n\n\t @Override\n\t protected void initChannel(SocketChannel ch) throws Exception {\n\t // TODO Auto-generated method stub\n\t //目前是每次new出来 由于4.0不允许加入加入一个ChannelHandler超过一次,除非它由@Sharable注解,或者每次new出来\n\t //ch.pipeline().addLast(\"idleChannelTester\", new IdleStateHandler(10, 5, 30));\n\t //ch.pipeline().addLast(\"keepaliveTimeoutHandler\", keepaliveTimeoutHandler);\n\t \t \n\t // server端接收到的是httpRequest,所以要使用HttpRequestDecoder进行解码\n\t ch.pipeline().addLast(\"http-encoder\", new HttpRequestDecoder()); \n\t //将解析出来的http报文的数据组装成为封装好的httpRequest对象 \n\t ch.pipeline().addLast(\"http-aggregator\", new HttpObjectAggregator(1024 * 1024));\n\t // server端发送的是httpResponse,所以要使用HttpResponseEncoder进行编码\n\t ch.pipeline().addLast(\"http-decoder\", new HttpResponseEncoder());\n\t //主要用于处理大数据流\n\t ch.pipeline().addLast(\"http-chunkedWriter\", new ChunkedWriteHandler()); \n\t //加强业务逻辑处理效率\n\t if(null == eventExecutor){\n\t \tch.pipeline().addLast(\"http-processor\",new HttpHandler()); \n\t }else {\n\t\t ch.pipeline().addLast(eventExecutor,\"http-processor\",new HttpHandler()); \n\t }\n\t \n\t /**\n\t // 这里只允许增加无状态允许共享的ChannelHandler,对于有状态的channelHandler需要重写\n\t // getPipelineFactory()方法\n\t for (Entry<String, ChannelHandler> channelHandler : channelHandlers.entrySet()) {\n\t ch.pipeline().addLast(channelHandler.getKey(), channelHandler.getValue());\n\t }\n\t \n\t **/\n\t }\n \n }) \n .option(ChannelOption.SO_BACKLOG, 1024000)\n .option(ChannelOption.SO_REUSEADDR, true)\n .childOption(ChannelOption.SO_REUSEADDR, true)\n .childOption(ChannelOption.TCP_NODELAY, true) //tcp\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\t}", "public static <T extends EmbeddedTestServer> T initializeAndStartHTTPSServer(\n T server, Context context, @ServerCertificate int serverCertificate, int port) {\n server.initializeNative(context, ServerHTTPSSetting.USE_HTTPS);\n server.addDefaultHandlers(\"\");\n server.setSSLConfig(serverCertificate);\n if (!server.start(port)) {\n throw new EmbeddedTestServerFailure(\"Failed to start serving using default handlers.\");\n }\n return server;\n }", "protected Server() {\n super(\"Ublu Server\");\n }", "public ServerConfigImpl() {\n this.expectations = new ExpectationsImpl(globalEncoders, globalDecoders);\n this.requirements = new RequirementsImpl();\n }", "public Server() {\n\t\tthis.currentMode = Mode.TEST; // TODO: implement\n\t}", "public void startServer()\n\t{\n\t\twhile(true)\n\t\t{\n\t\t\tSystem.out.println(\"Listen\");\n\t\t\tif(listenInitialValuesRequest)\n\t\t\t{\n\t\t\t\tlistenInitialValuesRequest();\n\t\t\t}\n\t\t}\n\t}", "public Server(final Config config) {\n\t\tValidate.notNull(config);\n\t\tinit(config);\n\t}", "public static void main(String[] args) {\r\n new Server();\r\n }", "public TCPMessengerServer() {\n initComponents();\n customInitComponents();\n listenForClient(); \n }", "private static void startServer(){\n try{\n MMServer server=new MMServer(50000);\n }catch (IOException ioe){\n System.exit(0);\n }\n \n }", "public Server() throws Exception {\r\n\t}", "public WebServer()\n {\n if (!Variables.exists(\"w_DebugLog\"))\n Variables.setVariable(\"w_DebugLog\", true);\n\n if (!Variables.exists(\"w_Port\"))\n Variables.setVariable(\"w_Port\", 80);\n\n if (!Variables.exists(\"w_NetworkBufferSize\"))\n Variables.setVariable(\"w_NetworkBufferSize\", 2048);\n\n PORT = Variables.getInt(\"w_Port\");\n DEBUG = Variables.getBoolean(\"w_DebugLog\");\n BUFFER_SIZE = Variables.getInt(\"w_NetworkBufferSize\");\n }", "private Main startJndiServer() throws Exception {\n\t\tNamingServer namingServer = new NamingServer();\n\t\tNamingContext.setLocal(namingServer);\n\t\tMain namingMain = new Main();\n\t\tnamingMain.setInstallGlobalService(true);\n\t\tnamingMain.setPort( -1 );\n\t\tnamingMain.start();\n\t\treturn namingMain;\n\t}", "@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// System.out.println(\"LocalProxy run on \" + port);\r\n\t}", "@SubscribeEvent\n public void onServerStarting(FMLServerStartingEvent event) {\n // do something when the server starts\n Server server = new Server(event.getServer());\n }", "public void launch() throws NotBoundException, IOException\n\t{\n\t\t//call method to connect to server\t\t\n\t\tServerManager serverConnect = initialConnect();\t\n\t\n\t\t//get Setup menu from server\n\t\tSetUpMenu newSetup = new SetUpMenu(serverConnect);\n\t\tnewSetup.welcomeMenu();\n\t}", "public static void main(String[] args) {\n loadServer();\n\n }", "public static void main(String[] args) {\n\n Server server = new Server();\n \n\n }", "public MyServer() {\n try {\n \ttimer = new Timer(1000, timerListener());\n regularSocket = new ServerSocket(7777);\n webServer = new Server(new InetSocketAddress(\"127.0.0.1\", 80));\n WebSocketHandler wsHandler = new WebSocketHandler() {\n\t @Override\n\t public void configure(WebSocketServletFactory factory) {\n\t factory.register(HumanClientHandler.class);\n\t }\n\t };\n\t \n webServer.setHandler(wsHandler);\n\t webServer.start();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private Server()\n\t{\n\t}", "public void run() {\n ServerSocketChannelFactory acceptorFactory = new OioServerSocketChannelFactory();\n ServerBootstrap server = new ServerBootstrap(acceptorFactory);\n\n // The pipelines string together handlers, we set a factory to create\n // pipelines( handlers ) to handle events.\n // For Netty is using the reactor pattern to react to data coming in\n // from the open connections.\n server.setPipelineFactory(new EchoServerPipelineFactory());\n\n server.bind(new InetSocketAddress(port));\n }", "public static void main(String[] args) {\n\t\tnew Server();\n\t}", "public void start() throws IOException {\n\t\tserverSocket = new ServerSocket(port);\n\t\tserverCallbacks.forEach(c -> c.onServerStarted(this, port));\n\t}", "public ServerConnecter() {\r\n\r\n\t}", "private void initializeHandler() {\n if (handler == null) {\n handler = AwsHelpers.initSpringBootHandler(Application.class);\n }\n }", "public Server(GameManager gameManager) {\n this.gameManager = gameManager;\n this.clientHandlerMap = Collections.synchronizedMap(new HashMap<>());\n this.lock = new Object();\n this.isSizeSet = false;\n }", "public Server() {\r\n this(0);\r\n hashtable = new Hashtable<String,String>();\r\n }", "public Server() throws IOException {\n System.out.println(\"\\t Server Started \\n\");\n }", "public ServerA(){}", "private void startWebApp(Handler<AsyncResult<HttpServer>> next) {\n Router router = Router.router(vertx);\n\n router.route(\"/assets/*\").handler(StaticHandler.create(\"assets\"));\n router.route(\"/api/*\").handler(BodyHandler.create());\n\n router.route(\"/\").handler(this::handleRoot);\n router.get(\"/api/timer\").handler(this::timer);\n router.post(\"/api/c\").handler(this::_create);\n router.get(\"/api/r/:id\").handler(this::_read);\n router.put(\"/api/u/:id\").handler(this::_update);\n router.delete(\"/api/d/:id\").handler(this::_delete);\n\n // Create the HTTP server and pass the \"accept\" method to the request handler.\n vertx.createHttpServer().requestHandler(router).listen(8888, next);\n }", "public static void main(String[] args) {\n Server se = new Server();\n }", "public static void main(String[] args) throws Exception {\n Application app = new Application();\r\n\r\n // Plug the server resource.\r\n app.setInboundRoot(HelloServerResource.class);\r\n\r\n // Instantiating the HTTP server and listening on port 8111\r\n new Server(Protocol.HTTP, 8111, app).start();\r\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t//绑定服务时会调用onCreate方法,此时启动服务\n\t\tLocalProxy = new SynchronousProxyServer(Parameters.LocalProxyPort);\n\t\tLocalProxy.initial();\n\t\tLocalProxy.start();\n\t\tSystem.out.println(\"LocalProxy run on \" + Parameters.LocalProxyPort);\n\t}", "@Override\n public void start() throws LifecycleException {\n logger.info(\"Start http server ... \");\n\n\n try {\n // create a resource config that scans for JAX-RS resources and providers\n final ResourceConfig rc = new ResourceConfig()\n .packages(PACKAGES_SCAN) // packages path for resources loading\n .property(MvcFeature.TEMPLATE_BASE_PATH, FREEMARKER_BASE) // config freemarker view files's base path\n .register(LoggingFeature.class)\n .register(FreemarkerMvcFeature.class)\n .register(JettisonFeature.class)\n .packages(\"org.glassfish.jersey.examples.multipart\")\n .register(MultiPartFeature.class)\n .registerInstances(new ApplicationBinder()); //\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n httpServer = GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n\n // Set StaticHttpHandler to handle http server's static resources\n String htmlPath = this.getClass().getResource(HTML_BASE).getPath(); // TODO, 部署后要根据实际目录修正!classes 同级目录下的 html 目录\n HttpHandler handler = new StaticHttpHandler(htmlPath);\n httpServer.getServerConfiguration().addHttpHandler(handler, \"/\");\n\n logger.info(\"Jersey app started with WADL available at {} application.wadl\\n \", BASE_URI);\n } catch (Exception e) {\n throw new LifecycleException(e); // just convert to self defined exception\n }\n }", "public static void startServer() {\n clientListener.startListener();\n }", "@Override\n protected HotRodServer createHotRodServer() {\n HotRodServerConfigurationBuilder serverBuilder = new HotRodServerConfigurationBuilder();\n serverBuilder.adminOperationsHandler(new EmbeddedServerAdminOperationHandler());\n\n return HotRodClientTestingUtil.startHotRodServer(cacheManager, serverBuilder);\n }", "public StartupHandler(){\r\n\t\tloadGameFiles();\r\n\t\tnew Engine();\r\n\t}", "abstract public TelnetServerHandler createHandler(TelnetSocket s);", "public Server() throws IOException\n {\n socket = new ServerSocket(port);\n }", "@Override\r\n public void init() throws ServletException {\r\n try {\r\n s_server =\r\n Server.getInstance(new File(Constants.FEDORA_HOME), false);\r\n s_management =\r\n (Management) s_server\r\n .getModule(\"fedora.server.management.Management\");\r\n if (s_management == null) {\r\n throw new ServletException(\"Unable to get Management module from server.\");\r\n }\r\n } catch (InitializationException ie) {\r\n throw new ServletException(\"Unable to get Fedora Server instance.\"\r\n + ie.getMessage());\r\n }\r\n }", "public SocketServer() {\n \n super();\n start();\n\n }", "public Server() throws IOException {\n try {\n this.serverSocket = new ServerSocket(this.port,100, InetAddress.getByName(host));\n } catch (UnknownHostException e) {\n System.out.println(\"Erreur lors de la construction du serveur (Hôte inconnu) - Server Constructor Error\");\n e.printStackTrace();\n } catch(IOException e) {\n e.printStackTrace();\n }\n }", "public serverHttpHandler( String rootDir ) {\n this.serverHome = rootDir;\n }", "@PostConstruct\n public void init() {\n rest.put(\"http://authenticationServer:8080/bot\", info);\n AuthServerChecker checker = new AuthServerChecker(name);\n checker.start();\n }", "public void initChannel() {\n //or channelFactory\n bootstrap().channel(NioServerSocketChannel.class);\n }", "@Override\n public void init() throws LifecycleException {\n logger.info(\"Start to parse and config Web Server ...\");\n configParse();\n\n // TODO web server 是否应该关心 database 的状态? 当 database 连接断开后,相关接口返回 HTTP-Internal Server Error 是不是更合理一些\n // step 2: check database state\n\n // 注册为EventBus的订阅者\n Segads.register(this);\n }", "@Override\n public void initEndpoint() throws IOException, InstantiationException {\n SelectorThreadConfig.configure(this);\n \n initFileCacheFactory();\n initAlgorithm();\n initPipeline();\n initMonitoringLevel();\n \n setName(\"SelectorThread-\" + getPort());\n \n try{\n if (getInet() == null) {\n setServerSocket(getServerSocketFactory().createSocket(getPort(),\n getSsBackLog()));\n } else {\n setServerSocket(getServerSocketFactory().createSocket(getPort(), \n getSsBackLog(), getInet()));\n }\n getServerSocket().setReuseAddress(true); \n } catch (SocketException ex){\n throw new BindException(ex.getMessage() + \": \" + getPort());\n }\n \n getServerSocket().setSoTimeout(getServerTimeout());\n initReadBlockingTask(getMinReadQueueLength());\n \n setInitialized(true); \n getLogger().log(Level.FINE,\"Initializing Grizzly Blocking Mode\"); \n // Since NIO is not used, rely on Coyote for buffering the response.\n setBufferResponse(true);\n }", "public void run() {\n Runtime.getRuntime().addShutdownHook(new MNOSManagerShutdownHook(this));\n\n OFNiciraVendorExtensions.initialize();\n\n this.startDatabase();\n\n try {\n final ServerBootstrap switchServerBootStrap = this\n .createServerBootStrap();\n\n this.setServerBootStrapParams(switchServerBootStrap);\n\n switchServerBootStrap.setPipelineFactory(this.pfact);\n final InetSocketAddress sa = this.ofHost == null ? new InetSocketAddress(\n this.ofPort) : new InetSocketAddress(this.ofHost,\n this.ofPort);\n this.sg.add(switchServerBootStrap.bind(sa));\n }catch (final Exception e){\n throw new RuntimeException(e);\n }\n\n }", "public void openServer() {\n try {\n this.serverSocket = new ServerSocket(this.portNumber);\n } catch (IOException ex) {\n System.out.println(ex);\n }\n }", "protected static AuoServer getServer() {\n return server;\n }", "@Override\n public void start() {\n // only start once, this is not foolproof as the active flag is set only\n // when the watchdog loop is entered\n if ( isActive() ) {\n return;\n }\n\n Log.info( \"Running server with \" + server.getMappings().size() + \" mappings\" );\n try {\n server.start( HTTPD.SOCKET_READ_TIMEOUT, false );\n } catch ( IOException ioe ) {\n Log.append( HTTPD.EVENT, \"ERROR: Could not start server on port '\" + server.getPort() + \"' - \" + ioe.getMessage() );\n System.err.println( \"Couldn't start server:\\n\" + ioe );\n System.exit( 1 );\n }\n\n if ( redirectServer != null ) {\n try {\n redirectServer.start( HTTPD.SOCKET_READ_TIMEOUT, false );\n } catch ( IOException ioe ) {\n Log.append( HTTPD.EVENT, \"ERROR: Could not start redirection server on port '\" + redirectServer.getPort() + \"' - \" + ioe.getMessage() );\n System.err.println( \"Couldn't start redirection server:\\n\" + ioe );\n }\n }\n\n // Save the name of the thread that is running this class\n final String oldName = Thread.currentThread().getName();\n\n // Rename this thread to the name of this class\n Thread.currentThread().setName( NAME );\n\n // very important to get park(millis) to operate\n current_thread = Thread.currentThread();\n\n // Parse through the configuration and initialize all the components\n initComponents();\n\n // if we have no components defined, install a wedge to keep the server open\n if ( components.size() == 0 ) {\n Wedge wedge = new Wedge();\n wedge.setLoader( this );\n components.put( wedge, getConfig() );\n activate( wedge, getConfig() );\n }\n\n Log.info( LogMsg.createMsg( MSG, \"Loader.components_initialized\" ) );\n\n final StringBuffer b = new StringBuffer( NAME );\n b.append( \" v\" );\n b.append( VERSION.toString() );\n b.append( \" initialized - Loader:\" );\n b.append( Loader.API_NAME );\n b.append( \" v\" );\n b.append( Loader.API_VERSION );\n b.append( \" - Runtime: \" );\n b.append( System.getProperty( \"java.version\" ) );\n b.append( \" (\" );\n b.append( System.getProperty( \"java.vendor\" ) );\n b.append( \")\" );\n b.append( \" - Platform: \" );\n b.append( System.getProperty( \"os.arch\" ) );\n b.append( \" OS: \" );\n b.append( System.getProperty( \"os.name\" ) );\n b.append( \" (\" );\n b.append( System.getProperty( \"os.version\" ) );\n b.append( \")\" );\n Log.info( b );\n\n // enter a loop performing watchdog and maintenance functions\n watchdog();\n\n // The watchdog loop has exited, so we are done processing\n terminateComponents();\n\n Log.info( LogMsg.createMsg( MSG, \"Loader.terminated\" ) );\n\n // Rename the thread back to what it was called before we were being run\n Thread.currentThread().setName( oldName );\n\n }" ]
[ "0.71260804", "0.6727207", "0.6704662", "0.664984", "0.65888405", "0.65848535", "0.6518059", "0.65168446", "0.64236534", "0.64077616", "0.6365832", "0.63488203", "0.6338147", "0.6325697", "0.63105977", "0.63088787", "0.6294882", "0.6273713", "0.62421656", "0.6230019", "0.6224583", "0.6211303", "0.6186144", "0.618491", "0.61689043", "0.6147711", "0.61127305", "0.60810834", "0.60651946", "0.6062323", "0.6025681", "0.6022926", "0.60083175", "0.6005986", "0.6005986", "0.60003996", "0.5982886", "0.59667045", "0.5963873", "0.5932867", "0.59078753", "0.59067667", "0.5888347", "0.58774555", "0.58687395", "0.58667076", "0.586301", "0.585366", "0.5841324", "0.58258355", "0.58019114", "0.5798702", "0.5785227", "0.57838917", "0.57836986", "0.57697725", "0.5752315", "0.57474595", "0.5745689", "0.5743231", "0.5719778", "0.5719274", "0.5705873", "0.5705365", "0.570523", "0.5701827", "0.570139", "0.56944287", "0.56860244", "0.5684126", "0.5662557", "0.5648649", "0.5645354", "0.56440306", "0.5639709", "0.5634541", "0.56332713", "0.5629751", "0.5629023", "0.56210124", "0.56138325", "0.56016976", "0.559542", "0.55922925", "0.55920213", "0.5589105", "0.5570381", "0.5563918", "0.5553861", "0.55532634", "0.555103", "0.55401313", "0.55355316", "0.55327976", "0.55326223", "0.5529142", "0.55256987", "0.55125916", "0.55121875", "0.5509589" ]
0.58580923
47
Create and initialize a server with the default handlers and specified port. This handles native object initialization, server configuration, and server initialization. On returning, the server is ready for use.
public static EmbeddedTestServer createAndStartServerWithPort(Context context, int port) { Assert.assertNotEquals("EmbeddedTestServer should not be created on UiThread, " + "the instantiation will hang forever waiting for tasks to post to UI thread", Looper.getMainLooper(), Looper.myLooper()); EmbeddedTestServer server = new EmbeddedTestServer(); return initializeAndStartServer(server, context, port); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Server() {\n\t\tinit(new Config());\n\t}", "private void initServerSocket()\n\t{\n\t\tboundPort = new InetSocketAddress(port);\n\t\ttry\n\t\t{\n\t\t\tserverSocket = new ServerSocket(port);\n\n\t\t\tif (serverSocket.isBound())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Server bound to data port \" + serverSocket.getLocalPort() + \" and is ready...\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to initiate socket.\");\n\t\t}\n\n\t}", "public static <T extends EmbeddedTestServer> T initializeAndStartServer(\n T server, Context context, int port) {\n server.initializeNative(context, ServerHTTPSSetting.USE_HTTP);\n server.addDefaultHandlers(\"\");\n if (!server.start(port)) {\n throw new EmbeddedTestServerFailure(\"Failed to start serving using default handlers.\");\n }\n return server;\n }", "public Server(){\n\t\ttry {\n\t\t\t// initialize the server socket with the specified port\n\t\t\tsetServerSocket(new ServerSocket(PORT));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO Exception while creating a server\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void startServer() {\n // configure the server properties\n int maxThreads = 20;\n int minThreads = 2;\n int timeOutMillis = 30000;\n\n // once routes are configured, the server automatically begins\n threadPool(maxThreads, minThreads, timeOutMillis);\n port(Integer.parseInt(this.port));\n this.configureRoutesAndExceptions();\n }", "public Server() {\n\t\t\n\t\ttry {\n\t\t\tss= new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace(); // Default\n\t\t}\n\t}", "private ServerSocket setUpServer(){\n ServerSocket serverSocket = null;\n try{\n serverSocket = new ServerSocket(SERVER_PORT);\n\n }\n catch (IOException ioe){\n throw new RuntimeException(ioe.getMessage());\n }\n return serverSocket;\n }", "public Server() {\n\t\tsession = new WelcomeSession();\n\t\tmPort = DEFAULT_PORT;\n\t\texecutor = Executors.newCachedThreadPool();\n\t}", "private void initialize() throws IOException, ServletException, URISyntaxException {\n\n LOG.info(\"Initializing the internal Server\");\n Log.setLog(new Slf4jLog(Server.class.getName()));\n\n /*\n * Create and configure the server\n */\n this.server = new Server();\n this.serverConnector = new ServerConnector(server);\n this.serverConnector.setReuseAddress(Boolean.TRUE);\n\n LOG.info(\"Server configure ip = \" + DEFAULT_IP);\n LOG.info(\"Server configure port = \" + DEFAULT_PORT);\n\n this.serverConnector.setHost(DEFAULT_IP);\n this.serverConnector.setPort(DEFAULT_PORT);\n this.server.addConnector(serverConnector);\n\n /*\n * Setup the basic application \"context\" for this application at \"/iop-node\"\n */\n this.servletContextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);\n this.servletContextHandler.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n this.server.setHandler(servletContextHandler);\n\n /*\n * Initialize webapp layer\n */\n WebAppContext webAppContext = new WebAppContext();\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n\n URL webPath = JettyEmbeddedAppServer.class.getClassLoader().getResource(\"web\");\n LOG.info(\"webPath = \" + webPath.getPath());\n\n webAppContext.setResourceBase(webPath.toString());\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH+\"/web\");\n webAppContext.addBean(new ServletContainerInitializersStarter(webAppContext), true);\n webAppContext.setWelcomeFiles(new String[]{\"index.html\"});\n webAppContext.addFilter(AdminRestApiSecurityFilter.class, \"/rest/api/v1/admin/*\", EnumSet.of(DispatcherType.REQUEST));\n webAppContext.setInitParameter(\"org.eclipse.jetty.servlet.Default.dirAllowed\", \"false\");\n servletContextHandler.setHandler(webAppContext);\n server.setHandler(webAppContext);\n\n /*\n * Initialize restful service layer\n */\n ServletHolder restfulServiceServletHolder = new ServletHolder(new HttpServlet30Dispatcher());\n restfulServiceServletHolder.setInitParameter(\"javax.ws.rs.Application\", JaxRsActivator.class.getName());\n restfulServiceServletHolder.setInitParameter(\"resteasy.use.builtin.providers\", \"true\");\n restfulServiceServletHolder.setAsyncSupported(Boolean.TRUE);\n webAppContext.addServlet(restfulServiceServletHolder, \"/rest/api/v1/*\");\n\n this.server.dump(System.err);\n\n }", "@Override\n @SuppressWarnings(\"CallToPrintStackTrace\")\n public void simpleInitApp() {\n \n\n try {\n System.out.println(\"Using port \" + port);\n // create the server by opening a port\n server = Network.createServer(port);\n server.start(); // start the server, so it starts using the port\n } catch (IOException ex) {\n ex.printStackTrace();\n destroy();\n this.stop();\n }\n System.out.println(\"Server started\");\n // create a separat thread for sending \"heartbeats\" every now and then\n new Thread(new NetWrite()).start();\n server.addMessageListener(new ServerListener(), ChangeVelocityMessage.class);\n // add a listener that reacts on incoming network packets\n \n }", "public static RoMServer createServer() throws IOException, Exception {\r\n \t\t// Ip and Port out of config\r\n \t\tIConfig cfg = ConfigurationFactory.getConfig();\r\n \r\n \t\treturn RoMServer.createServer(cfg.getIp(), cfg.getPort());\r\n \t}", "public Server(int port, mainViewController viewController, LogViewController consoleViewController){\n isRunningOnCLI = false;\n this.viewController = viewController;\n this.port = port;\n this.consoleViewController = consoleViewController;\n viewController.serverStarting();\n log = new LoggingSystem(this.getClass().getCanonicalName(),consoleViewController);\n log.infoMessage(\"New server instance.\");\n try{\n this.serverSocket = new ServerSocket(port);\n //this.http = new PersonServlet();\n log.infoMessage(\"main.Server successfully initialised.\");\n clients = Collections.synchronizedList(new ArrayList<>());\n ServerOn = true;\n log.infoMessage(\"Connecting to datastore...\");\n //mainStore = new DataStore();\n jettyServer = new org.eclipse.jetty.server.Server(8080);\n jettyContextHandler = new ServletContextHandler(jettyServer, \"/\");\n jettyContextHandler.addServlet(servlets.PersonServlet.class, \"/person/*\");\n jettyContextHandler.addServlet(servlets.LoginServlet.class, \"/login/*\");\n jettyContextHandler.addServlet(servlets.HomeServlet.class, \"/home/*\");\n jettyContextHandler.addServlet(servlets.DashboardServlet.class, \"/dashboard/*\");\n jettyContextHandler.addServlet(servlets.UserServlet.class, \"/user/*\");\n jettyContextHandler.addServlet(servlets.JobServlet.class, \"/job/*\");\n jettyContextHandler.addServlet(servlets.AssetServlet.class, \"/assets/*\");\n jettyContextHandler.addServlet(servlets.UtilityServlet.class, \"/utilities/*\");\n jettyContextHandler.addServlet(servlets.EventServlet.class, \"/events/*\");\n //this.run();\n } catch (IOException e) {\n viewController.showAlert(\"Error initialising server\", e.getMessage());\n viewController.serverStopped();\n log.errorMessage(e.getMessage());\n }\n }", "void startServer(int port) throws Exception;", "public Server() throws IOException\n {\n socket = new ServerSocket(port);\n }", "public OOXXServer(){\n\t\ttry\n\t\t{\n\t\t\tserver = new ServerSocket(port);\n\t\t\t\n\t\t}\n\t\tcatch(java.io.IOException e)\n\t\t{\n\t\t}\n\t}", "public Server() throws IOException{\n\t\tsuper();\n\t\tthis.serversocket = new java.net.ServerSocket(DEFAULTPORT);\n\t\tif (DEBUG){\n\t\t\tSystem.out.println(\"Server socket created:\" + this.serversocket.getLocalPort());\n\t\t\tclient_list.add(String.valueOf(this.serversocket.getLocalPort()));\n\t\t}\n\t}", "public void startServer() {\n URLClassLoader loader = createClasspath(opts);\n X_Process.runInClassloader(loader, appServer\n .map(DevAppServer::doStartServer, getAppName() + \"Server\", getPort())\n .ignoreOut1().unsafe());\n }", "public ServerMain( int port )\r\n\t{\r\n\t\tthis.port = port;\r\n\t\tserver = new Server( this.port );\r\n\t}", "void startServer(String name, Config.ServerConfig config);", "public Server() {}", "private void createServerSocket()\r\n {\r\n\t\tDebug.assert(port != 0, \"(Server/105)\");\r\n try {\r\n serverSocket = new ServerSocket(port);\r\n serverSocket.setSoTimeout(TIMEOUT);\r\n\t }\r\n\t catch (IOException e)\r\n\t \t{\r\n log(\"Could not create ServerSocket on port \" + port);\r\n\t \tDebug.printStackTrace(e);\r\n System.exit(-1);\r\n\t }\r\n }", "public static HttpServer startServer() {\n // create a resource config that scans for JAX-RS resources and providers\n // in com.example.rest package\n final ResourceConfig rc = new ResourceConfig().packages(\"com.assignment.backend\");\n rc.register(org.glassfish.jersey.moxy.json.MoxyJsonFeature.class);\n rc.register(getAbstractBinder());\n rc.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);\n rc.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n return GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n }", "public WebServer ()\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = DEF_HOST; \t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = DEF_PORT; \t\t\t\t\t\t\t\t\r\n\t}", "@Override\r\n \tpublic void initialize() {\n \t\tThreadRenamingRunnable.setThreadNameDeterminer(ThreadNameDeterminer.CURRENT);\r\n \r\n \t\tInetSocketAddress address;\r\n \r\n \t\tif (m_host == null) {\r\n \t\t\taddress = new InetSocketAddress(m_port);\r\n \t\t} else {\r\n \t\t\taddress = new InetSocketAddress(m_host, m_port);\r\n \t\t}\r\n \r\n \t\tm_queue = new LinkedBlockingQueue<ChannelBuffer>(m_queueSize);\r\n \r\n \t\tExecutorService bossExecutor = Threads.forPool().getCachedThreadPool(\"Cat-TcpSocketReceiver-Boss-\" + address);\r\n \t\tExecutorService workerExecutor = Threads.forPool().getCachedThreadPool(\"Cat-TcpSocketReceiver-Worker\");\r\n \t\tChannelFactory factory = new NioServerSocketChannelFactory(bossExecutor, workerExecutor);\r\n \t\tServerBootstrap bootstrap = new ServerBootstrap(factory);\r\n \r\n \t\tbootstrap.setPipelineFactory(new ChannelPipelineFactory() {\r\n \t\t\tpublic ChannelPipeline getPipeline() {\r\n \t\t\t\treturn Channels.pipeline(new MyDecoder(), new MyHandler());\r\n \t\t\t}\r\n \t\t});\r\n \r\n \t\tbootstrap.setOption(\"child.tcpNoDelay\", true);\r\n \t\tbootstrap.setOption(\"child.keepAlive\", true);\r\n \t\tbootstrap.bind(address);\r\n \r\n \t\tm_logger.info(\"CAT server started at \" + address);\r\n \t\tm_factory = factory;\r\n \t}", "public Server() {\n try {\n welcomeSocket = new ServerSocket(PORT);\n System.out.println(\"Server listening on \" + PORT);\n } catch (IOException e) {\n System.out.println(\"Error creating welcome socket. Is this socket available?\");\n }\n }", "static private Server createServer(String args[]) throws Exception {\n if (args.length < 1) {\n usage();\n }\n\n int port = PORT;\n int backlog = BACKLOG;\n boolean secure = SECURE;\n\n for (int i = 1; i < args.length; i++) {\n if (args[i].equals(\"-port\")) {\n checkArgs(i, args.length);\n port = Integer.valueOf(args[++i]);\n } else if (args[i].equals(\"-backlog\")) {\n checkArgs(i, args.length);\n backlog = Integer.valueOf(args[++i]);\n } else if (args[i].equals(\"-secure\")) {\n secure = true;\n } else {\n usage();\n }\n }\n\n Server server = null;\n\n if (args[0].equals(\"B1\")) {\n server = new B1(port, backlog, secure);\n } else if (args[0].equals(\"BN\")) {\n server = new BN(port, backlog, secure);\n } else if (args[0].equals(\"BP\")) {\n server = new BP(port, backlog, secure);\n } else if (args[0].equals(\"N1\")) {\n server = new N1(port, backlog, secure);\n } else if (args[0].equals(\"N2\")) {\n server = new N2(port, backlog, secure);\n }\n\n return server;\n }", "private void initServerSock(int port) throws IOException {\n\tserver = new ServerSocket(port);\n\tserver.setReuseAddress(true);\n }", "public void init() throws IOException {\r\n try {\r\n serverSocket = new ServerSocket(PORT);\r\n this.running = true;\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }", "public void init() {\r\n\t\tthis.initWebAndSocketServer();\r\n\r\n\t\t/*\r\n\t\t * Set/update server info\r\n\t\t */\r\n\t\ttry {\r\n\t\t\tServerInfo serverInfo = Info.getServerInfo();\r\n\t\t\tserverInfo.setPort(Integer.parseInt(SettingsManager.getStringValue(GeneralController.getInstance().getIdentifier(), GeneralController.Settings.NET_HTTP_PORT.get())));\r\n\t\t\tserverInfo.setName(SettingsManager.getStringValue(GeneralController.getInstance().getIdentifier(), GeneralController.Settings.SERVER_NAME.get(), \"Home server\"));\r\n\t\t\tserverInfo.setVersion(BuildConfig.VERSION);\r\n\t\t\tInfo.writeServerInfo(serverInfo);\r\n\t\t} catch (IOException | JSONException e1) {\r\n\t\t\tServer.log.error(\"Could not update server info. Designer might not work as expected: \" + e1.getMessage());\r\n\t\t}\r\n\r\n\t\tRuleManager.init();\r\n\t}", "private Server() {\r\n\r\n\t\t// Make sure that all exceptions are written to the log\r\n\t\tThread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler());\r\n\r\n\t\tnew Thread() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Find all controllers and initialize them\r\n\t\t\t\t * \r\n\t\t\t\t */\r\n\t\t\t\tReflections reflections = new Reflections(\"net.yourhome.server\");\r\n\t\t\t\tSet<Class<? extends IController>> controllerClasses = reflections.getSubTypesOf(IController.class);\r\n\r\n\t\t\t\tfor (final Class<? extends IController> controllerClass : controllerClasses) {\r\n\t\t\t\t\tif (!Modifier.isAbstract(controllerClass.getModifiers())) {\r\n\t\t\t\t\t\tnew Thread() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\tMethod factoryMethod;\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tfactoryMethod = controllerClass.getDeclaredMethod(\"getInstance\");\r\n\t\t\t\t\t\t\t\t\tIController controllerObject = (IController) factoryMethod.invoke(null, null);\r\n\t\t\t\t\t\t\t\t\tServer.this.controllers.put(controllerObject.getIdentifier(), controllerObject);\r\n\t\t\t\t\t\t\t\t\tSettingsManager.readSettings(controllerObject);\r\n\t\t\t\t\t\t\t\t\tcontrollerObject.init();\r\n\t\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t\tServer.log.error(\"Could not instantiate \" + controllerClass.getName() + \" because getInstance is missing\", e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}.start();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.start();\r\n\r\n\t}", "public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }", "public static EmbeddedTestServer createAndStartServer(Context context) {\n return createAndStartServerWithPort(context, 0);\n }", "public Server(int port)\r\n\t\t{\r\n log(\"Initialising port \" + port);\r\n\r\n\t\t// Set the port\r\n\t\tthis.port = port;\r\n\r\n // Create the server socket\r\n createServerSocket();\r\n \t}", "public ServerService(){\n\t\tlogger.info(\"Initilizing the ServerService\");\n\t\tservers.put(1001, new Server(1001, \"Test Server1\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1002, new Server(1002, \"Test Server2\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1003, new Server(1003, \"Test Server3\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1004, new Server(1004, \"Test Server4\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tlogger.info(\"Initilizing the ServerService Done\");\n\t}", "public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}", "private static void startWebSocketServer() {\n\n Server webSocketServer = new Server();\n ServerConnector connector = new ServerConnector(webSocketServer);\n connector.setPort(PORT);\n webSocketServer.addConnector(connector);\n log.info(\"Connector added\");\n\n // Setup the basic application \"context\" for this application at \"/\"\n // This is also known as the handler tree (in jetty speak)\n ServletContextHandler webSocketContext = new ServletContextHandler(\n ServletContextHandler.SESSIONS);\n webSocketContext.setContextPath(\"/\");\n webSocketServer.setHandler(webSocketContext);\n log.info(\"Context handler set\");\n\n try {\n ServerContainer serverContainer = WebSocketServerContainerInitializer\n .configureContext(webSocketContext);\n log.info(\"Initialize javax.websocket layer\");\n\n serverContainer.addEndpoint(GreeterEndpoint.class);\n log.info(\"Endpoint added\");\n\n webSocketServer.start();\n log.info(\"Server started\");\n\n webSocketServer.join();\n log.info(\"Server joined\");\n\n } catch (Throwable t) {\n log.error(\"Error startWebSocketServer {0}\", t);\n }\n }", "public DefaultTCPServer(int port) throws Exception {\r\n\t\tserverSocket = new ServerSocket(port);\t}", "@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// System.out.println(\"LocalProxy run on \" + port);\r\n\t}", "public ServerDef() {}", "public Server(final Config config) {\n\t\tValidate.notNull(config);\n\t\tinit(config);\n\t}", "public StaticServer(final int port) throws ConcordiaException {\n\t\t// Start the server.\n\t\tInetSocketAddress addr = new InetSocketAddress(port);\n\t\ttry {\n\t\t\tserver = HttpServer.create(addr, 0);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tthrow\n\t\t\t\tnew ConcordiaException(\n\t\t\t\t\t\"There was an error starting the server.\",\n\t\t\t\t\te);\n\t\t}\n\t\t\n\t\t// Create the handler and attach to the root of the domain.\n\t\thandler = new RequestHandler();\n\t\tserver.createContext(\"/\", handler);\n\t\t\n\t\t// Set the thread pool.\n\t\tserver.setExecutor(Executors.newCachedThreadPool());\n\t\t\n\t\t// Start the server.\n\t\tserver.start();\n\t}", "public void openServer() {\n try {\n this.serverSocket = new ServerSocket(this.portNumber);\n } catch (IOException ex) {\n System.out.println(ex);\n }\n }", "public void start(int port, Handler<AsyncResult<HttpServer>> handler) {\n init();\n logger.info(\"Starting REST HTTP server on port {}\", port);\n httpServer = vertx.createHttpServer()\n .requestHandler(router)\n .listen(port, handler);\n }", "public static Server startServer(AvroSourceProtocol handler, int port, boolean enableCompression) {\n Responder responder = new SpecificResponder(AvroSourceProtocol.class,\n handler);\n Server server;\n if (enableCompression) {\n server = new NettyServer(responder,\n new InetSocketAddress(localhost, port),\n new NioServerSocketChannelFactory\n (Executors .newCachedThreadPool(), Executors.newCachedThreadPool()),\n new CompressionChannelPipelineFactory(), null);\n } else {\n server = new NettyServer(responder,\n new InetSocketAddress(localhost, port));\n }\n server.start();\n logger.info(\"Server started on hostname: {}, port: {}\",\n new Object[] { localhost, Integer.toString(server.getPort()) });\n\n try {\n\n Thread.sleep(300L);\n\n } catch (InterruptedException ex) {\n logger.error(\"Thread interrupted. Exception follows.\", ex);\n Thread.currentThread().interrupt();\n }\n\n return server;\n }", "public static <T extends EmbeddedTestServer> T initializeAndStartHTTPSServer(\n T server, Context context, @ServerCertificate int serverCertificate, int port) {\n server.initializeNative(context, ServerHTTPSSetting.USE_HTTPS);\n server.addDefaultHandlers(\"\");\n server.setSSLConfig(serverCertificate);\n if (!server.start(port)) {\n throw new EmbeddedTestServerFailure(\"Failed to start serving using default handlers.\");\n }\n return server;\n }", "public static ServerSocket createServerSocket() {\n \t\n try {\n listener = new ServerSocket(PORT,1, InetAddress.getByName(hostname));\n } catch (IOException e) {\n e.printStackTrace();\n }\n return listener;\n }", "public RentRPCServer() {\n\t\tsuper(null, null);\n\t\t// mocking purpose\n\t}", "private void initServer() throws IOException {\r\n \t\tLogger.logMessage(\"Binding Server to \" + this.serverIpAddress + \":\" + this.serverPort);\r\n \r\n \t\tthis.isAlive = true;\r\n \t\tthis.serverSocket = new ServerSocket(this.serverPort, this.backLog, this.serverIpAddress);\r\n \t\tthis.dataLayer = DataLayerFactory.getDataLayer();\r\n \r\n \t\t// Generate the grouplist\r\n \t\tCollection<String> dbGroupList = this.dataLayer.getGroups();\r\n \r\n \t\tfor (String group : dbGroupList) {\r\n \t\t\tthis.groupList.addGroup(group);\r\n \t\t}\r\n \r\n \t\tLogger.logMessage(\"Server successfuly bound!\");\r\n \t}", "public static RoMServer createServer(int serverPort) throws IOException, Exception {\r\n \t\treturn RoMServer.createServer(InetAddress.getLocalHost(), serverPort);\r\n \t}", "public Server() throws IOException {\n try {\n this.serverSocket = new ServerSocket(this.port,100, InetAddress.getByName(host));\n } catch (UnknownHostException e) {\n System.out.println(\"Erreur lors de la construction du serveur (Hôte inconnu) - Server Constructor Error\");\n e.printStackTrace();\n } catch(IOException e) {\n e.printStackTrace();\n }\n }", "public Server(int port) throws IOException{\n\t\tsuper();\n\t\tthis.serversocket= new java.net.ServerSocket(port);\n\t\t\n\t\tif (DEBUG){\n\t\t\tSystem.out.println(\"Server socket created:\" + this.serversocket.getLocalPort());\n\t\t\tclient_list.add(String.valueOf(this.serversocket.getLocalPort()));\n\t\t}\n\t}", "public void start() {\n\n // server 환경설정\n EventLoopGroup bossGroup = new NioEventLoopGroup(bossCount);\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n\n try {\n\n ServerBootstrap b = new ServerBootstrap();\n b.group(bossGroup, workerGroup)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>() {\n @Override\n public void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n pipeline.addLast(new StringDecoder(CharsetUtil.UTF_8));\n pipeline.addLast(new StringEncoder(CharsetUtil.UTF_8));\n pipeline.addLast(new LoggingHandler(LogLevel.INFO));\n pipeline.addLast(SERVICE_HANDLER);\n }\n })\n .option(ChannelOption.SO_BACKLOG, backLog)\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\n ChannelFuture channelFuture = b.bind(tcpPort).sync();\n channelFuture.channel().closeFuture().sync();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n\n }", "public void start() throws IOException {\n\t\tserverSocket = new ServerSocket(port);\n\t\tserverCallbacks.forEach(c -> c.onServerStarted(this, port));\n\t}", "public void startServer() {\n server.start();\n }", "private Main startJndiServer() throws Exception {\n\t\tNamingServer namingServer = new NamingServer();\n\t\tNamingContext.setLocal(namingServer);\n\t\tMain namingMain = new Main();\n\t\tnamingMain.setInstallGlobalService(true);\n\t\tnamingMain.setPort( -1 );\n\t\tnamingMain.start();\n\t\treturn namingMain;\n\t}", "public void run() {\n ServerSocketChannelFactory acceptorFactory = new OioServerSocketChannelFactory();\n ServerBootstrap server = new ServerBootstrap(acceptorFactory);\n\n // The pipelines string together handlers, we set a factory to create\n // pipelines( handlers ) to handle events.\n // For Netty is using the reactor pattern to react to data coming in\n // from the open connections.\n server.setPipelineFactory(new EchoServerPipelineFactory());\n\n server.bind(new InetSocketAddress(port));\n }", "private void startServer() {\n\t\ttry {\n//\t\t\tserver = new Server();\n//\t\t\tserver.start();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: add message in UI for user\n\t\t}\n\t}", "public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "void initAndListen() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t// Startuje nowy watek z odbieraniem wiadomosci.\n\t\t\t\tnew ClientHandler(clientSocket, this);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Accept failed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "public static void initializeServer() {\n\t\tServer.initializeServerGUI();\n\t}", "public WebServer()\n {\n if (!Variables.exists(\"w_DebugLog\"))\n Variables.setVariable(\"w_DebugLog\", true);\n\n if (!Variables.exists(\"w_Port\"))\n Variables.setVariable(\"w_Port\", 80);\n\n if (!Variables.exists(\"w_NetworkBufferSize\"))\n Variables.setVariable(\"w_NetworkBufferSize\", 2048);\n\n PORT = Variables.getInt(\"w_Port\");\n DEBUG = Variables.getBoolean(\"w_DebugLog\");\n BUFFER_SIZE = Variables.getInt(\"w_NetworkBufferSize\");\n }", "private void init() {\n\n\t\tgroup = new NioEventLoopGroup();\n\t\ttry {\n\t\t\thandler = new MoocHandler();\n\t\t\tBootstrap b = new Bootstrap();\n\t\t\t\n\t\t\t\n\t\t\t//ManagementInitializer ci=new ManagementInitializer(false);\n\t\t\t\n\t\t\tMoocInitializer mi=new MoocInitializer(handler, false);\n\t\t\t\n\t\t\t\n\t\t\t//ManagemenetIntializer ci = new ManagemenetIntializer(handler, false);\n\t\t\t//b.group(group).channel(NioSocketChannel.class).handler(handler);\n\t\t\tb.group(group).channel(NioSocketChannel.class).handler(mi);\n\t\t\tb.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000);\n\t\t\tb.option(ChannelOption.TCP_NODELAY, true);\n\t\t\tb.option(ChannelOption.SO_KEEPALIVE, true);\n\n\t\t\t// Make the connection attempt.\n\t\t\tchannel = b.connect(host, port).syncUninterruptibly();\n\n\t\t\t// want to monitor the connection to the server s.t. if we loose the\n\t\t\t// connection, we can try to re-establish it.\n\t\t\tChannelClosedListener ccl = new ChannelClosedListener(this);\n\t\t\tchannel.channel().closeFuture().addListener(ccl);\n\t\t\tSystem.out.println(\" channle is \"+channel);\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"failed to initialize the client connection\", ex);\n\n\t\t}\n\n\t\t// start outbound message processor\n\t//\tworker = new OutboundWorker(this);\n\t//\tworker.start();\n\t}", "private static ServerSocket startServer(int port) {\n if (port != 0) {\n ServerSocket serverSocket;\n try {\n serverSocket = new ServerSocket(port);\n System.out.println(\"Server listening, port: \" + port + \".\");\n System.out.println(\"Waiting for connection... \");\n return serverSocket;\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return null;\n }", "public ServerConnection()\n {\n //Initializing of the variables used in the constructor\n this.hostAddress = \"http://localhost\";\n this.port = 8882;\n }", "@Override\n public void initEndpoint() throws IOException, InstantiationException {\n SelectorThreadConfig.configure(this);\n \n initFileCacheFactory();\n initAlgorithm();\n initPipeline();\n initMonitoringLevel();\n \n setName(\"SelectorThread-\" + getPort());\n \n try{\n if (getInet() == null) {\n setServerSocket(getServerSocketFactory().createSocket(getPort(),\n getSsBackLog()));\n } else {\n setServerSocket(getServerSocketFactory().createSocket(getPort(), \n getSsBackLog(), getInet()));\n }\n getServerSocket().setReuseAddress(true); \n } catch (SocketException ex){\n throw new BindException(ex.getMessage() + \": \" + getPort());\n }\n \n getServerSocket().setSoTimeout(getServerTimeout());\n initReadBlockingTask(getMinReadQueueLength());\n \n setInitialized(true); \n getLogger().log(Level.FINE,\"Initializing Grizzly Blocking Mode\"); \n // Since NIO is not used, rely on Coyote for buffering the response.\n setBufferResponse(true);\n }", "@Override\n public void initialize() {\n\n try {\n /* Bring up the API server */\n logger.info(\"loading API server\");\n apiServer.start();\n logger.info(\"API server started. Say Hello!\");\n /* Bring up the Dashboard server */\n logger.info(\"Loading Dashboard Server\");\n if (dashboardServer.isStopped()) { // it may have been started when Flux is run in COMBINED mode\n dashboardServer.start();\n }\n logger.info(\"Dashboard server has started. Say Hello!\");\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "public void initializeNative(Context context, ServerHTTPSSetting httpsSetting) {\n mContext = context;\n\n Intent intent = new Intent(EMBEDDED_TEST_SERVER_SERVICE);\n setIntentClassName(intent);\n if (!mContext.bindService(intent, mConn, Context.BIND_AUTO_CREATE)) {\n throw new EmbeddedTestServerFailure(\n \"Unable to bind to the EmbeddedTestServer service.\");\n }\n synchronized (mImplMonitor) {\n Log.i(TAG, \"Waiting for EmbeddedTestServer service connection.\");\n while (mImpl == null) {\n try {\n mImplMonitor.wait(SERVICE_CONNECTION_WAIT_INTERVAL_MS);\n } catch (InterruptedException e) {\n // Ignore the InterruptedException. Rely on the outer while loop to re-run.\n }\n Log.i(TAG, \"Still waiting for EmbeddedTestServer service connection.\");\n }\n Log.i(TAG, \"EmbeddedTestServer service connected.\");\n boolean initialized = false;\n try {\n initialized = mImpl.initializeNative(httpsSetting == ServerHTTPSSetting.USE_HTTPS);\n } catch (RemoteException e) {\n Log.e(TAG, \"Failed to initialize native server.\", e);\n initialized = false;\n }\n\n if (!initialized) {\n throw new EmbeddedTestServerFailure(\"Failed to initialize native server.\");\n }\n if (!mDisableResetterForTesting) {\n ResettersForTesting.register(this::stopAndDestroyServer);\n }\n\n if (httpsSetting == ServerHTTPSSetting.USE_HTTPS) {\n try {\n String rootCertPemPath = mImpl.getRootCertPemPath();\n X509Util.addTestRootCertificate(CertTestUtil.pemToDer(rootCertPemPath));\n } catch (Exception e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to install root certificate from native server.\", e);\n }\n }\n }\n }", "@Override\n\tpublic void initialize() {\n\t\ttransportManager = newServerTransportManager();\n\t\ttransportServer = newTransportServer();\n\t\tserverStateMachine = newTransportServerStateMachine();\n\n\t\tserverStateMachine.setServerTransportComponentFactory(this);\n\t\ttransportManager.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerHostConfig(getServerHostConfig());\n\n\t\tsetInitialized(true);\n\t}", "private void startListen() {\n try {\n listeningSocket = new ServerSocket(listeningPort);\n } catch (IOException e) {\n throw new RuntimeException(\"Cannot open listeningPort \" + listeningPort, e);\n }\n }", "private static void startServer(){\n try{\n MMServer server=new MMServer(50000);\n }catch (IOException ioe){\n System.exit(0);\n }\n \n }", "public Server() throws Exception {\r\n\t}", "private ServerSocket createServerSocket() throws IOException {\n ServerSocket serverSocket = new ServerSocket(Constants.SERVER_PORT);\n System.out.printf(\"Server for chatting started at %d\\n\", Constants.SERVER_PORT);\n return serverSocket;\n }", "abstract public TelnetServerHandler createHandler(TelnetSocket s);", "public Server(int port) {\n this.port = port;\n try {\n sock = new ServerSocket(port);\n clientSock = sock.accept();\n\n //Connection established, do some fancy stuff here\n processReq();\n } catch (IOException e) {\n System.err.println(\"ERROR: Sth failed while creating server socket :( \");\n }\n }", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n new Thread( ()-> {\n try {\n //Start the server\n ServerSocket serverSocket = new ServerSocket(8080);\n\n //show in terminal server has started\n System.out.println(\"Server Started: at \" + new Date() + \"\\n\");\n\n //main loop that will accept connections\n while (true) {\n //accept a new socket connection, this socket comes from client\n Socket clientSocket = serverSocket.accept();\n\n //thread that will handle what to do with new socket\n new Thread(new HandleAclient(clientSocket)).start();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }).start();\n\n }", "public ServerSocket createServerSocket(int arg0, int arg1) throws IOException {\n return null;\n }", "public void startServer() throws IOException {\n log.info(\"Starting server in port {}\", port);\n try {\n serverSocket = new ServerSocket(port);\n this.start();\n log.info(\"Started server. Server listening in port {}\", port);\n } catch (IOException e) {\n log.error(\"Error starting the server socket\", e);\n throw e;\n }\n }", "private void startServer(int port) throws IOException {\n System.out.println(\"Booting the server!\");\n\n // Open the server channel.\n serverSocketChannel = ServerSocketChannel.open();\n serverSocketChannel.bind(new InetSocketAddress(port));\n serverSocketChannel.configureBlocking(false);\n\n // Register the channel into the selector.\n selector = Selector.open();\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n }", "public static void main(String[] args) {\n\t\tif (args != null && args.length > 0) {\n\t\t\tport = Integer.parseInt(args[0]);\n\t\t}\n\t\tlog.info(\"i am the main for JServer\");\n\t\tlog.info(\"Server will use port: \" + port);\n\t\ttry {\n\t\t\twebServer = new WebServer(port);\n\t\t\t\n\t\t\tjsystem = new JSystemServer();\n\t\t\t\n\t\t\t//create the instances of handlers in server\n\t\t\tapplicationHandler = new JApplicationHandler();\n\t\t\tscenarioHandler = new JScenarioHandler();\n\t\t\t\n\t\t\t\n\t\t\tlogsHandler = new JReporterHandler();\n\t\t\t//register handlers in server\n\t\t\twebServer.addHandler(JServerHandlers.SCENARIO.getHandlerClassName(),scenarioHandler);\n\t\t\twebServer.addHandler(JServerHandlers.APPLICATION.getHandlerClassName(),applicationHandler);\n\t\t\twebServer.addHandler(\"jsystem\", jsystem);\n\t\t\twebServer.addHandler(JServerHandlers.REPORTER.getHandlerClassName(), logsHandler);\n\t\t\twebServer.start();\n\t\t\tSystem.out.println(\"webserver successfully started!!! + listening on port \" + port);\n\t\t} catch (Exception e) {\n\t\t\tlog.warning(\"failed in webserver handler adding or creation on port= \"+port + \"\\n\\n\"+StringUtils.getStackTrace(e));\n\t\t}\n\t}", "public ServerSocket createServerSocket(int arg0) throws IOException {\n return null;\n }", "public void startServer()\n\t{\n\t\twhile(true)\n\t\t{\n\t\t\tSystem.out.println(\"Listen\");\n\t\t\tif(listenInitialValuesRequest)\n\t\t\t{\n\t\t\t\tlistenInitialValuesRequest();\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\r\n new Server();\r\n }", "@Override\n public void initialize(ServerConfiguration config) {\n }", "public void start() throws Exception {\n ServerSocket socket = new ServerSocket(0);\n port = socket.getLocalPort();\n socket.close();\n\n final String[] localArgs = {\"-inMemory\", \"-port\", String.valueOf(port)};\n server = ServerRunner.createServerFromCommandLineArgs(localArgs);\n server.start();\n url = \"http://localhost:\" + port;\n\n // internal client connection so we can easily stop, cleanup, etc. later\n this.dynamodb = getClient();\n }", "public Server() throws IOException {\n System.out.println(\"\\t Server Started \\n\");\n }", "public void start(int port)\n\t{\n\t\t// Initialize and start the server sockets. 08/10/2014, Bing Li\n\t\tthis.port = port;\n\t\ttry\n\t\t{\n\t\t\tthis.socket = new ServerSocket(this.port);\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Initialize a disposer which collects the server listener. 08/10/2014, Bing Li\n\t\tMyServerListenerDisposer disposer = new MyServerListenerDisposer();\n\t\t// Initialize the runner list. 11/25/2014, Bing Li\n\t\tthis.listenerRunnerList = new ArrayList<Runner<MyServerListener, MyServerListenerDisposer>>();\n\t\t\n\t\t// Start up the threads to listen to connecting from clients which send requests as well as receive notifications. 08/10/2014, Bing Li\n\t\tRunner<MyServerListener, MyServerListenerDisposer> runner;\n\t\tfor (int i = 0; i < ServerConfig.LISTENING_THREAD_COUNT; i++)\n\t\t{\n\t\t\trunner = new Runner<MyServerListener, MyServerListenerDisposer>(new MyServerListener(this.socket, ServerConfig.LISTENER_THREAD_POOL_SIZE, ServerConfig.LISTENER_THREAD_ALIVE_TIME), disposer, true);\n\t\t\tthis.listenerRunnerList.add(runner);\n\t\t\trunner.start();\n\t\t}\n\n\t\t// Initialize the server IO registry. 11/07/2014, Bing Li\n\t\tMyServerIORegistry.REGISTRY().init();\n\t\t// Initialize a client pool, which is used by the server to connect to the remote end. 09/17/2014, Bing Li\n\t\tClientPool.SERVER().init();\n\t}", "private static void openServerSocket(int port) {\n\t\ttry {\n\t\t\tserverSocket = new ServerSocket(port);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Server Error\");\n\t\t}\n\t}", "public KVServerHandler(int port, KVServer managerServer){\n this.port = port;\n master = managerServer;\n aliveinstancethreads = new Vector<Thread>();\n aliveInstances = new Vector<KVServerInstance>();\n isRunning = false;\n kv_out = managerServer.getLogger();\n }", "private void initBinding() throws IOException {\n serverSocketChannel.bind(new InetSocketAddress(0));\n serverSocketChannel.configureBlocking(false);\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n\n sc.configureBlocking(false);\n var key = sc.register(selector, SelectionKey.OP_CONNECT);\n uniqueContext = new ClientContext(key, this);\n key.attach(uniqueContext);\n sc.connect(serverAddress);\n }", "public static void runServer(int port) throws IOException {\n\t\tserver = new CEMSServer(port);\n\t\tuiController.setServer(server);\n\t\tserver.listen(); // Start listening for connections\n\t}", "public Configuration() {\r\n\t\tthis.serverAddress = \"127.0.0.1\";\r\n\t\tthis.serverPort = \"2586\";\r\n\t}", "@Test\r\n public void startServerAndThreads() throws IOException {\r\n //init\r\n InetAddress iPAddress = InetAddress.getByName(\"localhost\");\r\n int port = 99;\r\n\r\n Server server = new Server(port, iPAddress);\r\n server.start();\r\n }", "public WebServer (int port)\t\t\t\t\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = DEF_HOST; \t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = port; \t\t\t\t\t\t\t\t\t\t\r\n\t}", "public static void main(String[] args) {\n\n Server server = new Server();\n \n\n }", "public Server() {\n\t\tthis.currentMode = Mode.TEST; // TODO: implement\n\t}", "public Client() {\n initComponents();\n \n Server server = new Server();\n server.start();\n \n }", "public Server() {\n initComponents();\n }", "public Server() {\n initComponents();\n }", "public void start() throws RemoteException, AlreadyBoundException\n {\n start(DEFAULT_PORT);\n }", "public void start() {\n\t\t\n\t\ttry {\n\t\t\tmainSocket = new DatagramSocket(PORT_NUMBER);\n\t\t}\n\t\tcatch(SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\t//Lambda expression to shorten the run method\n\t\tThread serverThread = new Thread( () -> {\n\t\t\tlisten();\n\t\t});\n\t\t\n\t\tserverThread.start();\n\t}" ]
[ "0.69594574", "0.68519", "0.67705464", "0.6750232", "0.67060065", "0.66901827", "0.66768813", "0.6645247", "0.65189415", "0.6464315", "0.64398766", "0.643337", "0.6423466", "0.6415353", "0.6385627", "0.63514364", "0.6304477", "0.6256173", "0.6254466", "0.6246571", "0.62373674", "0.62371194", "0.6215611", "0.620272", "0.61754715", "0.61703557", "0.6143634", "0.614282", "0.6136149", "0.6131866", "0.61284333", "0.6111912", "0.6087803", "0.6083247", "0.60515535", "0.6049514", "0.6042326", "0.60090244", "0.59689057", "0.5947884", "0.5942391", "0.5938809", "0.5933435", "0.5925974", "0.59105253", "0.59052575", "0.5902212", "0.590084", "0.590073", "0.5900401", "0.5885385", "0.58827037", "0.58739823", "0.5873936", "0.58487433", "0.58478016", "0.58423704", "0.58403003", "0.58349556", "0.58294207", "0.58246106", "0.5809352", "0.5806715", "0.5796723", "0.5777451", "0.5771561", "0.57264495", "0.57254046", "0.57242316", "0.57216716", "0.5714316", "0.57108575", "0.5708237", "0.57059795", "0.569771", "0.5691102", "0.5684266", "0.56723803", "0.5660154", "0.5660023", "0.5652485", "0.5652231", "0.5646611", "0.5645331", "0.5634339", "0.5632349", "0.5628914", "0.56110805", "0.5609492", "0.56086874", "0.56068784", "0.5604043", "0.5599379", "0.5589826", "0.5586388", "0.5584184", "0.55837804", "0.55837804", "0.5580419", "0.55709213" ]
0.56747466
77
Create and initialize an HTTPS server with the default handlers. This handles native object initialization, server configuration, and server initialization. On returning, the server is ready for use.
public static EmbeddedTestServer createAndStartHTTPSServer( Context context, @ServerCertificate int serverCertificate) { return createAndStartHTTPSServerWithPort(context, serverCertificate, 0 /* port */); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <T extends EmbeddedTestServer> T initializeAndStartHTTPSServer(\n T server, Context context, @ServerCertificate int serverCertificate, int port) {\n server.initializeNative(context, ServerHTTPSSetting.USE_HTTPS);\n server.addDefaultHandlers(\"\");\n server.setSSLConfig(serverCertificate);\n if (!server.start(port)) {\n throw new EmbeddedTestServerFailure(\"Failed to start serving using default handlers.\");\n }\n return server;\n }", "public void initializeNative(Context context, ServerHTTPSSetting httpsSetting) {\n mContext = context;\n\n Intent intent = new Intent(EMBEDDED_TEST_SERVER_SERVICE);\n setIntentClassName(intent);\n if (!mContext.bindService(intent, mConn, Context.BIND_AUTO_CREATE)) {\n throw new EmbeddedTestServerFailure(\n \"Unable to bind to the EmbeddedTestServer service.\");\n }\n synchronized (mImplMonitor) {\n Log.i(TAG, \"Waiting for EmbeddedTestServer service connection.\");\n while (mImpl == null) {\n try {\n mImplMonitor.wait(SERVICE_CONNECTION_WAIT_INTERVAL_MS);\n } catch (InterruptedException e) {\n // Ignore the InterruptedException. Rely on the outer while loop to re-run.\n }\n Log.i(TAG, \"Still waiting for EmbeddedTestServer service connection.\");\n }\n Log.i(TAG, \"EmbeddedTestServer service connected.\");\n boolean initialized = false;\n try {\n initialized = mImpl.initializeNative(httpsSetting == ServerHTTPSSetting.USE_HTTPS);\n } catch (RemoteException e) {\n Log.e(TAG, \"Failed to initialize native server.\", e);\n initialized = false;\n }\n\n if (!initialized) {\n throw new EmbeddedTestServerFailure(\"Failed to initialize native server.\");\n }\n if (!mDisableResetterForTesting) {\n ResettersForTesting.register(this::stopAndDestroyServer);\n }\n\n if (httpsSetting == ServerHTTPSSetting.USE_HTTPS) {\n try {\n String rootCertPemPath = mImpl.getRootCertPemPath();\n X509Util.addTestRootCertificate(CertTestUtil.pemToDer(rootCertPemPath));\n } catch (Exception e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to install root certificate from native server.\", e);\n }\n }\n }\n }", "protected void init() throws Exception {\n if (this.sslConfiguration != null && this.sslConfiguration.enabled()) {\n if (this.sslConfiguration.certificatePath() != null && this.sslConfiguration.privateKeyPath() != null) {\n try (var cert = Files.newInputStream(this.sslConfiguration.certificatePath());\n var privateKey = Files.newInputStream(this.sslConfiguration.privateKeyPath())) {\n // begin building the new ssl context building based on the certificate and private key\n var builder = SslContextBuilder.forServer(cert, privateKey);\n\n // check if a trust certificate was given, if not just trusts all certificates\n if (this.sslConfiguration.trustCertificatePath() != null) {\n try (var stream = Files.newInputStream(this.sslConfiguration.trustCertificatePath())) {\n builder.trustManager(stream);\n }\n } else {\n builder.trustManager(InsecureTrustManagerFactory.INSTANCE);\n }\n\n // build the context\n this.sslContext = builder\n .clientAuth(this.sslConfiguration.clientAuth() ? ClientAuth.REQUIRE : ClientAuth.OPTIONAL)\n .build();\n }\n } else {\n // self-sign a certificate as no certificate was provided\n var selfSignedCertificate = new SelfSignedCertificate();\n this.sslContext = SslContextBuilder\n .forServer(selfSignedCertificate.certificate(), selfSignedCertificate.privateKey())\n .trustManager(InsecureTrustManagerFactory.INSTANCE)\n .build();\n }\n }\n }", "public Server() {\n\t\tinit(new Config());\n\t}", "private void initialize() throws IOException, ServletException, URISyntaxException {\n\n LOG.info(\"Initializing the internal Server\");\n Log.setLog(new Slf4jLog(Server.class.getName()));\n\n /*\n * Create and configure the server\n */\n this.server = new Server();\n this.serverConnector = new ServerConnector(server);\n this.serverConnector.setReuseAddress(Boolean.TRUE);\n\n LOG.info(\"Server configure ip = \" + DEFAULT_IP);\n LOG.info(\"Server configure port = \" + DEFAULT_PORT);\n\n this.serverConnector.setHost(DEFAULT_IP);\n this.serverConnector.setPort(DEFAULT_PORT);\n this.server.addConnector(serverConnector);\n\n /*\n * Setup the basic application \"context\" for this application at \"/iop-node\"\n */\n this.servletContextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);\n this.servletContextHandler.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n this.server.setHandler(servletContextHandler);\n\n /*\n * Initialize webapp layer\n */\n WebAppContext webAppContext = new WebAppContext();\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n\n URL webPath = JettyEmbeddedAppServer.class.getClassLoader().getResource(\"web\");\n LOG.info(\"webPath = \" + webPath.getPath());\n\n webAppContext.setResourceBase(webPath.toString());\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH+\"/web\");\n webAppContext.addBean(new ServletContainerInitializersStarter(webAppContext), true);\n webAppContext.setWelcomeFiles(new String[]{\"index.html\"});\n webAppContext.addFilter(AdminRestApiSecurityFilter.class, \"/rest/api/v1/admin/*\", EnumSet.of(DispatcherType.REQUEST));\n webAppContext.setInitParameter(\"org.eclipse.jetty.servlet.Default.dirAllowed\", \"false\");\n servletContextHandler.setHandler(webAppContext);\n server.setHandler(webAppContext);\n\n /*\n * Initialize restful service layer\n */\n ServletHolder restfulServiceServletHolder = new ServletHolder(new HttpServlet30Dispatcher());\n restfulServiceServletHolder.setInitParameter(\"javax.ws.rs.Application\", JaxRsActivator.class.getName());\n restfulServiceServletHolder.setInitParameter(\"resteasy.use.builtin.providers\", \"true\");\n restfulServiceServletHolder.setAsyncSupported(Boolean.TRUE);\n webAppContext.addServlet(restfulServiceServletHolder, \"/rest/api/v1/*\");\n\n this.server.dump(System.err);\n\n }", "private static void setupSSL() {\n\t\ttry {\n\t\t\tTrustManager[] trustAllCerts = createTrustAllCertsManager();\n\t\t\tSSLContext sslContext = SSLContext.getInstance(SSL_CONTEXT_PROTOCOL);\n\t\t\tSecureRandom random = new java.security.SecureRandom();\n\t\t\tsslContext.init(null, trustAllCerts, random);\n\t\t\tHttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tLOGGER.error(INVALID_PROTOCOL_ERROR_MESSAGE, e);\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t} catch (GeneralSecurityException e) {\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t}\n\n\t}", "public static HttpsServer createServer(String address, int port) throws Exception {\n KeyManagerFactory kmf = KeyStoreHelper.getKeyManagerFactory();\n\n SSLContext sslcontext = SSLContext.getInstance(\"SSLv3\");\n sslcontext.init(kmf.getKeyManagers(), null, null);\n\n InetSocketAddress addr = new InetSocketAddress(address, port);\n HttpsServer server = HttpsServer.create(addr, CONNECTIONS);\n server.setHttpsConfigurator(new HttpsConfigurator(sslcontext) {\n @Override\n public void configure(HttpsParameters params) {\n try {\n // initialise the SSL context\n SSLContext context = getSSLContext();\n SSLEngine engine = context.createSSLEngine();\n params.setNeedClientAuth(false);\n params.setCipherSuites(engine.getEnabledCipherSuites());\n params.setProtocols(engine.getEnabledProtocols());\n\n // Set the SSL parameters\n SSLParameters sslParameters = context.getSupportedSSLParameters();\n params.setSSLParameters(sslParameters);\n\n } catch (Exception e) {\n LOG.error(\"Failed to create HTTPS configuration!\", e);\n }\n }\n });\n return server;\n }", "public NettySslServer(@Nullable SSLConfiguration sslConfiguration) {\n this.sslConfiguration = sslConfiguration;\n }", "public HttpServerChannelInitializer(\n final ProxyAuthorizationManager authorizationManager, \n final ChannelGroup channelGroup, \n final ChainProxyManager chainProxyManager, \n final HandshakeHandlerFactory handshakeHandlerFactory,\n final RelayChannelInitializerFactory relayChannelInitializerFactory, \n final EventLoopGroup clientWorker) {\n \n this.handshakeHandlerFactory = handshakeHandlerFactory;\n this.relayChannelInitializerFactory = relayChannelInitializerFactory;\n this.clientWorker = clientWorker;\n \n log.debug(\"Creating server with handshake handler: {}\", \n handshakeHandlerFactory);\n this.authenticationManager = authorizationManager;\n this.channelGroup = channelGroup;\n this.chainProxyManager = chainProxyManager;\n //this.ksm = ksm;\n \n if (LittleProxyConfig.isUseJmx()) {\n setupJmx();\n }\n }", "public static HttpServer startServer() {\n // create a resource config that scans for JAX-RS resources and providers\n // in com.example.rest package\n final ResourceConfig rc = new ResourceConfig().packages(\"com.assignment.backend\");\n rc.register(org.glassfish.jersey.moxy.json.MoxyJsonFeature.class);\n rc.register(getAbstractBinder());\n rc.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);\n rc.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n return GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n }", "public void init() {\r\n\t\tthis.initWebAndSocketServer();\r\n\r\n\t\t/*\r\n\t\t * Set/update server info\r\n\t\t */\r\n\t\ttry {\r\n\t\t\tServerInfo serverInfo = Info.getServerInfo();\r\n\t\t\tserverInfo.setPort(Integer.parseInt(SettingsManager.getStringValue(GeneralController.getInstance().getIdentifier(), GeneralController.Settings.NET_HTTP_PORT.get())));\r\n\t\t\tserverInfo.setName(SettingsManager.getStringValue(GeneralController.getInstance().getIdentifier(), GeneralController.Settings.SERVER_NAME.get(), \"Home server\"));\r\n\t\t\tserverInfo.setVersion(BuildConfig.VERSION);\r\n\t\t\tInfo.writeServerInfo(serverInfo);\r\n\t\t} catch (IOException | JSONException e1) {\r\n\t\t\tServer.log.error(\"Could not update server info. Designer might not work as expected: \" + e1.getMessage());\r\n\t\t}\r\n\r\n\t\tRuleManager.init();\r\n\t}", "public static <T extends EmbeddedTestServer> T initializeAndStartServer(\n T server, Context context, int port) {\n server.initializeNative(context, ServerHTTPSSetting.USE_HTTP);\n server.addDefaultHandlers(\"\");\n if (!server.start(port)) {\n throw new EmbeddedTestServerFailure(\"Failed to start serving using default handlers.\");\n }\n return server;\n }", "private static void startWebSocketServer() {\n\n Server webSocketServer = new Server();\n ServerConnector connector = new ServerConnector(webSocketServer);\n connector.setPort(PORT);\n webSocketServer.addConnector(connector);\n log.info(\"Connector added\");\n\n // Setup the basic application \"context\" for this application at \"/\"\n // This is also known as the handler tree (in jetty speak)\n ServletContextHandler webSocketContext = new ServletContextHandler(\n ServletContextHandler.SESSIONS);\n webSocketContext.setContextPath(\"/\");\n webSocketServer.setHandler(webSocketContext);\n log.info(\"Context handler set\");\n\n try {\n ServerContainer serverContainer = WebSocketServerContainerInitializer\n .configureContext(webSocketContext);\n log.info(\"Initialize javax.websocket layer\");\n\n serverContainer.addEndpoint(GreeterEndpoint.class);\n log.info(\"Endpoint added\");\n\n webSocketServer.start();\n log.info(\"Server started\");\n\n webSocketServer.join();\n log.info(\"Server joined\");\n\n } catch (Throwable t) {\n log.error(\"Error startWebSocketServer {0}\", t);\n }\n }", "public Server() {\n\t\tsession = new WelcomeSession();\n\t\tmPort = DEFAULT_PORT;\n\t\texecutor = Executors.newCachedThreadPool();\n\t}", "public Server() {\n\t\t\n\t\ttry {\n\t\t\tss= new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace(); // Default\n\t\t}\n\t}", "private ServerSocket setUpServer(){\n ServerSocket serverSocket = null;\n try{\n serverSocket = new ServerSocket(SERVER_PORT);\n\n }\n catch (IOException ioe){\n throw new RuntimeException(ioe.getMessage());\n }\n return serverSocket;\n }", "public void startServer() {\n // configure the server properties\n int maxThreads = 20;\n int minThreads = 2;\n int timeOutMillis = 30000;\n\n // once routes are configured, the server automatically begins\n threadPool(maxThreads, minThreads, timeOutMillis);\n port(Integer.parseInt(this.port));\n this.configureRoutesAndExceptions();\n }", "public void run() throws Exception {\n InputStream certChainFile = this.getClass().getResourceAsStream(\"/ssl/server.crt\");\n InputStream keyFile = this.getClass().getResourceAsStream(\"/ssl/pkcs8_server.key\");\n InputStream rootFile = this.getClass().getResourceAsStream(\"/ssl/ca.crt\");\n SslContext sslCtx = SslContextBuilder.forServer(certChainFile, keyFile).trustManager(rootFile).clientAuth(ClientAuth.REQUIRE).build();\n //主线程(获取连接,分配给工作线程)\n EventLoopGroup bossGroup = new NioEventLoopGroup(1);\n //工作线程,负责收发消息\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n try {\n //netty封装的启动类\n ServerBootstrap b = new ServerBootstrap();\n //设置线程组,主线程和子线程\n b.group(bossGroup, workerGroup)\n .channel(NioServerSocketChannel.class)\n .handler(new LoggingHandler(LogLevel.INFO))\n //初始化处理器\n .childHandler(new Initializer(sslCtx));\n ChannelFuture f = b.bind(m_port).sync();\n f.channel().closeFuture().sync();\n } finally {\n //出现异常以后,优雅关闭线程组\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n }", "@PostConstruct\n\t\tprivate void configureSSL() {\n\t\t\tSystem.setProperty(\"https.protocols\", \"TLSv1.2\");\n\n\t\t\t//load the 'javax.net.ssl.trustStore' and\n\t\t\t//'javax.net.ssl.trustStorePassword' from application.properties\n\t\t\tSystem.setProperty(\"javax.net.ssl.trustStore\", env.getProperty(\"server.ssl.trust-store\"));\n\t\t\tSystem.setProperty(\"javax.net.ssl.trustStorePassword\",env.getProperty(\"server.ssl.trust-store-password\"));\n\t\t}", "private DefaultHttpClient createHttpsClient() throws HttpException {\n DefaultHttpClient client = new DefaultHttpClient();\n SSLContext ctx = null;\n X509TrustManager tm = new TrustAnyTrustManager();\n try {\n ctx = SSLContext.getInstance(\"TLS\");\n ctx.init(null, new TrustManager[] { tm }, null);\n } catch (NoSuchAlgorithmException | KeyManagementException e) {\n throw new HttpException(\"Can't create a Trust Manager.\", e);\n }\n SSLSocketFactory ssf = new SSLSocketFactory(ctx, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);\n client.getConnectionManager().getSchemeRegistry().register(new Scheme(\"https\", 443, ssf));\n return client;\n }", "private void initServerSocket()\n\t{\n\t\tboundPort = new InetSocketAddress(port);\n\t\ttry\n\t\t{\n\t\t\tserverSocket = new ServerSocket(port);\n\n\t\t\tif (serverSocket.isBound())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Server bound to data port \" + serverSocket.getLocalPort() + \" and is ready...\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to initiate socket.\");\n\t\t}\n\n\t}", "public HttpServerConfiguration() {\n this.sessionsEnabled = true;\n this.connectors = new ArrayList<HttpConnectorConfiguration>();\n this.sslConnectors = new ArrayList<HttpSslConnectorConfiguration>();\n this.minThreads = 5;\n this.maxThreads = 50;\n }", "@Override\n\tpublic void initialize() {\n\t\ttransportManager = newServerTransportManager();\n\t\ttransportServer = newTransportServer();\n\t\tserverStateMachine = newTransportServerStateMachine();\n\n\t\tserverStateMachine.setServerTransportComponentFactory(this);\n\t\ttransportManager.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerHostConfig(getServerHostConfig());\n\n\t\tsetInitialized(true);\n\t}", "public static void main(String[] args) {\n\t\tfinal String keyStoreType = \"jks\";\n\n\t\t/* This file is provided in class path. */\n\t\tfinal String keyStoreFile = \"C:\\\\Windows\\\\SystemD\\\\WorkSpaces\\\\workspace\\\\java-network-programming\\\\ssl-helloworld-server\\\\src\\\\main\\\\resource\\\\com\\\\rpsign\\\\net\\\\helloworld\\\\server\\\\app\\\\localkeystore.jks\";\n\n\t\t/* KeyStore password. */\n\t\tfinal String keyStorePass = \"passw0rd\";\n\t\tfinal char[] keyStorePassArray = keyStorePass.toCharArray();\n\n\t\t/* Alias in the KeyStore. */\n\t\t//final String alias = \"localserver\";\n\n\t\t/* SSL protocol to be used. */\n\t\tfinal String sslProtocol = \"TLS\";\n\n\t\t/* Server port. */\n\t\tfinal int serverPort = 54321;\n\t\ttry {\n\t\t\t/*\n\t\t\t * Prepare KeyStore instance for the type of KeyStore file we have.\n\t\t\t */\n\t\t\tfinal KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n\n\t\t\t/* Load the keyStore file */\n\t\t\t//final InputStream keyStoreFileIStream = SSLServerSocketApp.class.getResourceAsStream(keyStoreFile);\n\t\t\tfinal InputStream keyStoreFileIStream = new FileInputStream(keyStoreFile);\n\t\t\tkeyStore.load(keyStoreFileIStream, keyStorePassArray);\n\n\t\t\t/* Get the Private Key associated with given alias. */\n\t\t\t//final Key key = keyStore.getKey(alias, keyStorePassArray);\n\n\t\t\t/* */\n\t\t\tfinal String algorithm = KeyManagerFactory.getDefaultAlgorithm();\n\t\t\tfinal KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(algorithm);\n\t\t\tkeyManagerFactory.init(keyStore, keyStorePassArray);\n\n\t\t\t// Prepare SSL\n\t\t\tfinal SSLContext sslContext = SSLContext.getInstance(sslProtocol);\n\t\t\tsslContext.init(keyManagerFactory.getKeyManagers(), null, null);\n\n\t\t\t/* Server program to host itself on a specified port. */\n\t\t\tSSLServerSocketFactory sslServerSocketFactory = sslContext.getServerSocketFactory();\n\t\t\tServerSocket serverSocket = sslServerSocketFactory.createServerSocket(serverPort);\n\n\t\t\twhile (true) {\n\t\t\t\tSystem.out.print(\"Listening on \" + serverPort + \">>>\");\n\t\t\t\tSocket s = serverSocket.accept();\n\t\t\t\tPrintStream out = new PrintStream(s.getOutputStream());\n\t\t\t\tout.println(\"Hi\");\n\t\t\t\t/*System.out.println(\"HI\");*/\n\t\t\t\tout.close();\n\t\t\t\ts.close();\n\t\t\t\tSystem.out.println(\"Connection closed.\");\n\t\t\t}\n\n\t\t\t// ---------------------------------\n\t\t\t/*\n\t\t\t * String keystorePasswordCharArray=\"password\";\n\t\t\t * \n\t\t\t * KeyStore ks = KeyStore.getInstance(\"JKS\"); InputStream readStream\n\t\t\t * = new FileInputStream(\n\t\t\t * \"C:\\\\Users\\\\sandeshd\\\\Desktop\\\\Wk\\\\SSLServerSocket\\\\keystore\\\\keystore.jks\"\n\t\t\t * ); ks.load(readStream, keystorePasswordCharArray.toCharArray());\n\t\t\t * Key key = ks.getKey(\"serversocket\", \"password\".toCharArray());\n\t\t\t * \n\t\t\t * SSLContext context = SSLContext.getInstance(\"TLS\");\n\t\t\t * KeyManagerFactory kmf= KeyManagerFactory.getInstance(\"SunX509\");\n\t\t\t * kmf.init(ks, \"password\".toCharArray());\n\t\t\t * context.init(kmf.getKeyManagers(), null, null);\n\t\t\t * SSLServerSocketFactory ssf = context.getServerSocketFactory();\n\t\t\t * \n\t\t\t * ServerSocket ss = ssf.createServerSocket(5432); while (true) {\n\t\t\t * Socket s = ss.accept(); PrintStream out = new\n\t\t\t * PrintStream(s.getOutputStream()); out.println(\"Hi\"); out.close();\n\t\t\t * s.close(); }\n\t\t\t */\n\t\t} catch (Exception e) {\n\t\t\t//System.out.println(e.toString());\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public WebServer()\n {\n if (!Variables.exists(\"w_DebugLog\"))\n Variables.setVariable(\"w_DebugLog\", true);\n\n if (!Variables.exists(\"w_Port\"))\n Variables.setVariable(\"w_Port\", 80);\n\n if (!Variables.exists(\"w_NetworkBufferSize\"))\n Variables.setVariable(\"w_NetworkBufferSize\", 2048);\n\n PORT = Variables.getInt(\"w_Port\");\n DEBUG = Variables.getBoolean(\"w_DebugLog\");\n BUFFER_SIZE = Variables.getInt(\"w_NetworkBufferSize\");\n }", "public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }", "private final static void setup() {\r\n\r\n supportedSchemes = new SchemeRegistry();\r\n\r\n // Register the \"http\" and \"https\" protocol schemes, they are\r\n // required by the default operator to look up socket factories.\r\n SocketFactory sf = PlainSocketFactory.getSocketFactory();\r\n supportedSchemes.register(new Scheme(\"http\", sf, 80));\r\n sf = SSLSocketFactory.getSocketFactory();\r\n supportedSchemes.register(new Scheme(\"https\", sf, 80));\r\n\r\n // prepare parameters\r\n HttpParams params = new BasicHttpParams();\r\n HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);\r\n HttpProtocolParams.setContentCharset(params, \"UTF-8\");\r\n HttpProtocolParams.setUseExpectContinue(params, true);\r\n HttpProtocolParams.setHttpElementCharset(params, \"UTF-8\");\r\n HttpProtocolParams.setUserAgent(params, \"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9) Gecko/2008052906 Firefox/3.0\");\r\n defaultParameters = params;\r\n }", "private SslContext buildServerSslContext()\n throws SSLException\n {\n SslContextBuilder builder = SslContextBuilder.forServer(certFile, keyFile);\n if (verifyMode == VerifyMode.NO_VERIFY) {\n builder.trustManager(InsecureTrustManagerFactory.INSTANCE);\n } else {\n builder.trustManager(caFile);\n }\n if (verifyMode == VerifyMode.VERIFY) {\n builder.clientAuth(ClientAuth.OPTIONAL);\n } else if (verifyMode == VerifyMode.VERIFY_REQ_CLIENT_CERT) {\n builder.clientAuth(ClientAuth.REQUIRE);\n }\n return builder.build();\n }", "private Server() {\r\n\r\n\t\t// Make sure that all exceptions are written to the log\r\n\t\tThread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler());\r\n\r\n\t\tnew Thread() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Find all controllers and initialize them\r\n\t\t\t\t * \r\n\t\t\t\t */\r\n\t\t\t\tReflections reflections = new Reflections(\"net.yourhome.server\");\r\n\t\t\t\tSet<Class<? extends IController>> controllerClasses = reflections.getSubTypesOf(IController.class);\r\n\r\n\t\t\t\tfor (final Class<? extends IController> controllerClass : controllerClasses) {\r\n\t\t\t\t\tif (!Modifier.isAbstract(controllerClass.getModifiers())) {\r\n\t\t\t\t\t\tnew Thread() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\tMethod factoryMethod;\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tfactoryMethod = controllerClass.getDeclaredMethod(\"getInstance\");\r\n\t\t\t\t\t\t\t\t\tIController controllerObject = (IController) factoryMethod.invoke(null, null);\r\n\t\t\t\t\t\t\t\t\tServer.this.controllers.put(controllerObject.getIdentifier(), controllerObject);\r\n\t\t\t\t\t\t\t\t\tSettingsManager.readSettings(controllerObject);\r\n\t\t\t\t\t\t\t\t\tcontrollerObject.init();\r\n\t\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t\tServer.log.error(\"Could not instantiate \" + controllerClass.getName() + \" because getInstance is missing\", e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}.start();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.start();\r\n\r\n\t}", "private HttpProxy createHttpServerConnection() {\n\n final HttpProxy httpProxy = httpConnectionFactory.create();\n\n // TODO: add configurable number of attempts, instead of looping forever\n boolean connected = false;\n while (!connected) {\n LOGGER.debug(\"Attempting connection to HTTP server...\");\n connected = httpProxy.connect();\n }\n\n LOGGER.debug(\"Connected to HTTP server\");\n\n return httpProxy;\n }", "public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public StaticServer(final int port) throws ConcordiaException {\n\t\t// Start the server.\n\t\tInetSocketAddress addr = new InetSocketAddress(port);\n\t\ttry {\n\t\t\tserver = HttpServer.create(addr, 0);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tthrow\n\t\t\t\tnew ConcordiaException(\n\t\t\t\t\t\"There was an error starting the server.\",\n\t\t\t\t\te);\n\t\t}\n\t\t\n\t\t// Create the handler and attach to the root of the domain.\n\t\thandler = new RequestHandler();\n\t\tserver.createContext(\"/\", handler);\n\t\t\n\t\t// Set the thread pool.\n\t\tserver.setExecutor(Executors.newCachedThreadPool());\n\t\t\n\t\t// Start the server.\n\t\tserver.start();\n\t}", "public WebServer ()\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = DEF_HOST; \t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = DEF_PORT; \t\t\t\t\t\t\t\t\r\n\t}", "public static void initializeServer() {\n\t\tServer.initializeServerGUI();\n\t}", "public Server(){\n\t\ttry {\n\t\t\t// initialize the server socket with the specified port\n\t\t\tsetServerSocket(new ServerSocket(PORT));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO Exception while creating a server\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}", "protected void setupHttps(){\n try {\n if (!testKeystoreFile.exists()) {\n // Prepare a temporary directory for the tests\n BioUtils.delete(this.testDir, true);\n this.testDir.mkdir();\n // Copy the keystore into the test directory\n Response response = new Client(Protocol.CLAP)\n .handle(new Request(Method.GET,\n \"clap://class/org/restlet/test/engine/dummy.jks\"));\n\n if (response.getEntity() != null) {\n OutputStream outputStream = new FileOutputStream(\n testKeystoreFile);\n response.getEntity().write(outputStream);\n outputStream.flush();\n outputStream.close();\n } else {\n throw new Exception(\n \"Unable to find the dummy.jks file in the classpath.\");\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n }", "@Override\n @SuppressWarnings(\"CallToPrintStackTrace\")\n public void simpleInitApp() {\n \n\n try {\n System.out.println(\"Using port \" + port);\n // create the server by opening a port\n server = Network.createServer(port);\n server.start(); // start the server, so it starts using the port\n } catch (IOException ex) {\n ex.printStackTrace();\n destroy();\n this.stop();\n }\n System.out.println(\"Server started\");\n // create a separat thread for sending \"heartbeats\" every now and then\n new Thread(new NetWrite()).start();\n server.addMessageListener(new ServerListener(), ChangeVelocityMessage.class);\n // add a listener that reacts on incoming network packets\n \n }", "void doClientSide() throws Exception {\n\n\t\tSSLSocketFactory sslsf = (SSLSocketFactory) SSLSocketFactory\n\t\t\t\t.getDefault();\n\t\tSSLSocket sslSocket = (SSLSocket) sslsf.createSocket(theServerName,\n\t\t\t\t12345);\n\t\t\n\t\tOutputStream sslOS = sslSocket.getOutputStream();\n\t\tsslOS.write(\"Hello SSL Server\".getBytes()); // Write to the Server\n\t\tsslOS.flush();\n\t\tsslSocket.close();\n\t}", "@Override\n public void initialize(ServerConfiguration config) {\n }", "public static EmbeddedTestServer createAndStartHTTPSServerWithPort(\n Context context, @ServerCertificate int serverCertificate, int port) {\n Assert.assertNotEquals(\"EmbeddedTestServer should not be created on UiThread, \"\n + \"the instantiation will hang forever waiting for tasks\"\n + \" to post to UI thread\",\n Looper.getMainLooper(), Looper.myLooper());\n EmbeddedTestServer server = new EmbeddedTestServer();\n return initializeAndStartHTTPSServer(server, context, serverCertificate, port);\n }", "public Server(int port, mainViewController viewController, LogViewController consoleViewController){\n isRunningOnCLI = false;\n this.viewController = viewController;\n this.port = port;\n this.consoleViewController = consoleViewController;\n viewController.serverStarting();\n log = new LoggingSystem(this.getClass().getCanonicalName(),consoleViewController);\n log.infoMessage(\"New server instance.\");\n try{\n this.serverSocket = new ServerSocket(port);\n //this.http = new PersonServlet();\n log.infoMessage(\"main.Server successfully initialised.\");\n clients = Collections.synchronizedList(new ArrayList<>());\n ServerOn = true;\n log.infoMessage(\"Connecting to datastore...\");\n //mainStore = new DataStore();\n jettyServer = new org.eclipse.jetty.server.Server(8080);\n jettyContextHandler = new ServletContextHandler(jettyServer, \"/\");\n jettyContextHandler.addServlet(servlets.PersonServlet.class, \"/person/*\");\n jettyContextHandler.addServlet(servlets.LoginServlet.class, \"/login/*\");\n jettyContextHandler.addServlet(servlets.HomeServlet.class, \"/home/*\");\n jettyContextHandler.addServlet(servlets.DashboardServlet.class, \"/dashboard/*\");\n jettyContextHandler.addServlet(servlets.UserServlet.class, \"/user/*\");\n jettyContextHandler.addServlet(servlets.JobServlet.class, \"/job/*\");\n jettyContextHandler.addServlet(servlets.AssetServlet.class, \"/assets/*\");\n jettyContextHandler.addServlet(servlets.UtilityServlet.class, \"/utilities/*\");\n jettyContextHandler.addServlet(servlets.EventServlet.class, \"/events/*\");\n //this.run();\n } catch (IOException e) {\n viewController.showAlert(\"Error initialising server\", e.getMessage());\n viewController.serverStopped();\n log.errorMessage(e.getMessage());\n }\n }", "public InitialValuesConnectionCenter() \n\t{\n\t\ttry {\n\t\t\tserverSocket = new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"IOException ServerConnectionCenter.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void initialize() {\n\n try {\n /* Bring up the API server */\n logger.info(\"loading API server\");\n apiServer.start();\n logger.info(\"API server started. Say Hello!\");\n /* Bring up the Dashboard server */\n logger.info(\"Loading Dashboard Server\");\n if (dashboardServer.isStopped()) { // it may have been started when Flux is run in COMBINED mode\n dashboardServer.start();\n }\n logger.info(\"Dashboard server has started. Say Hello!\");\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "public Server() {\n try {\n welcomeSocket = new ServerSocket(PORT);\n System.out.println(\"Server listening on \" + PORT);\n } catch (IOException e) {\n System.out.println(\"Error creating welcome socket. Is this socket available?\");\n }\n }", "private void init() {\n\n\t\tgroup = new NioEventLoopGroup();\n\t\ttry {\n\t\t\thandler = new MoocHandler();\n\t\t\tBootstrap b = new Bootstrap();\n\t\t\t\n\t\t\t\n\t\t\t//ManagementInitializer ci=new ManagementInitializer(false);\n\t\t\t\n\t\t\tMoocInitializer mi=new MoocInitializer(handler, false);\n\t\t\t\n\t\t\t\n\t\t\t//ManagemenetIntializer ci = new ManagemenetIntializer(handler, false);\n\t\t\t//b.group(group).channel(NioSocketChannel.class).handler(handler);\n\t\t\tb.group(group).channel(NioSocketChannel.class).handler(mi);\n\t\t\tb.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000);\n\t\t\tb.option(ChannelOption.TCP_NODELAY, true);\n\t\t\tb.option(ChannelOption.SO_KEEPALIVE, true);\n\n\t\t\t// Make the connection attempt.\n\t\t\tchannel = b.connect(host, port).syncUninterruptibly();\n\n\t\t\t// want to monitor the connection to the server s.t. if we loose the\n\t\t\t// connection, we can try to re-establish it.\n\t\t\tChannelClosedListener ccl = new ChannelClosedListener(this);\n\t\t\tchannel.channel().closeFuture().addListener(ccl);\n\t\t\tSystem.out.println(\" channle is \"+channel);\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"failed to initialize the client connection\", ex);\n\n\t\t}\n\n\t\t// start outbound message processor\n\t//\tworker = new OutboundWorker(this);\n\t//\tworker.start();\n\t}", "@Override\n\tprotected void initInternal() throws LifecycleException {\n bootstrap = new ServerBootstrap();\n //初始化\n bootstrap.group(bossGroup, workGroup)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>(){\n\n\t @Override\n\t protected void initChannel(SocketChannel ch) throws Exception {\n\t // TODO Auto-generated method stub\n\t //目前是每次new出来 由于4.0不允许加入加入一个ChannelHandler超过一次,除非它由@Sharable注解,或者每次new出来\n\t //ch.pipeline().addLast(\"idleChannelTester\", new IdleStateHandler(10, 5, 30));\n\t //ch.pipeline().addLast(\"keepaliveTimeoutHandler\", keepaliveTimeoutHandler);\n\t \t \n\t // server端接收到的是httpRequest,所以要使用HttpRequestDecoder进行解码\n\t ch.pipeline().addLast(\"http-encoder\", new HttpRequestDecoder()); \n\t //将解析出来的http报文的数据组装成为封装好的httpRequest对象 \n\t ch.pipeline().addLast(\"http-aggregator\", new HttpObjectAggregator(1024 * 1024));\n\t // server端发送的是httpResponse,所以要使用HttpResponseEncoder进行编码\n\t ch.pipeline().addLast(\"http-decoder\", new HttpResponseEncoder());\n\t //主要用于处理大数据流\n\t ch.pipeline().addLast(\"http-chunkedWriter\", new ChunkedWriteHandler()); \n\t //加强业务逻辑处理效率\n\t if(null == eventExecutor){\n\t \tch.pipeline().addLast(\"http-processor\",new HttpHandler()); \n\t }else {\n\t\t ch.pipeline().addLast(eventExecutor,\"http-processor\",new HttpHandler()); \n\t }\n\t \n\t /**\n\t // 这里只允许增加无状态允许共享的ChannelHandler,对于有状态的channelHandler需要重写\n\t // getPipelineFactory()方法\n\t for (Entry<String, ChannelHandler> channelHandler : channelHandlers.entrySet()) {\n\t ch.pipeline().addLast(channelHandler.getKey(), channelHandler.getValue());\n\t }\n\t \n\t **/\n\t }\n \n }) \n .option(ChannelOption.SO_BACKLOG, 1024000)\n .option(ChannelOption.SO_REUSEADDR, true)\n .childOption(ChannelOption.SO_REUSEADDR, true)\n .childOption(ChannelOption.TCP_NODELAY, true) //tcp\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\t}", "public Server() {}", "public static RoMServer createServer() throws IOException, Exception {\r\n \t\t// Ip and Port out of config\r\n \t\tIConfig cfg = ConfigurationFactory.getConfig();\r\n \r\n \t\treturn RoMServer.createServer(cfg.getIp(), cfg.getPort());\r\n \t}", "@Override\n protected ServerBuilder<?> getServerBuilder() {\n try {\n ServerCredentials serverCreds = TlsServerCredentials.create(\n TlsTesting.loadCert(\"server1.pem\"), TlsTesting.loadCert(\"server1.key\"));\n NettyServerBuilder builder = NettyServerBuilder.forPort(0, serverCreds)\n .flowControlWindow(AbstractInteropTest.TEST_FLOW_CONTROL_WINDOW)\n .maxInboundMessageSize(AbstractInteropTest.MAX_MESSAGE_SIZE);\n // Disable the default census stats tracer, use testing tracer instead.\n InternalNettyServerBuilder.setStatsEnabled(builder, false);\n return builder.addStreamTracerFactory(createCustomCensusTracerFactory());\n } catch (IOException ex) {\n throw new RuntimeException(ex);\n }\n }", "@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n\n // add HTTPS support\n SSLEngine engine = SSLFactory.getInstance().sslContext().createSSLEngine();\n engine.setUseClientMode(false);\n pipeline.addLast(new SslHandler(engine));\n\n // add HTTP decoder and encoder\n pipeline.addLast(new HttpServerCodec());\n pipeline.addLast(new HttpObjectAggregator(Integer.MAX_VALUE));\n pipeline.addLast(new MockServerServerCodec(true));\n\n // add handlers\n pipeline.addLast(new HttpProxyHandler(logFilter, HttpProxy.this, securePort != null ? new InetSocketAddress(securePort) : null));\n }", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n new Thread( ()-> {\n try {\n //Start the server\n ServerSocket serverSocket = new ServerSocket(8080);\n\n //show in terminal server has started\n System.out.println(\"Server Started: at \" + new Date() + \"\\n\");\n\n //main loop that will accept connections\n while (true) {\n //accept a new socket connection, this socket comes from client\n Socket clientSocket = serverSocket.accept();\n\n //thread that will handle what to do with new socket\n new Thread(new HandleAclient(clientSocket)).start();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }).start();\n\n }", "abstract public TelnetServerHandler createHandler(TelnetSocket s);", "public ServerService(){\n\t\tlogger.info(\"Initilizing the ServerService\");\n\t\tservers.put(1001, new Server(1001, \"Test Server1\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1002, new Server(1002, \"Test Server2\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1003, new Server(1003, \"Test Server3\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1004, new Server(1004, \"Test Server4\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tlogger.info(\"Initilizing the ServerService Done\");\n\t}", "public interface SSLSessionInitializer {\n\n /**\n * Triggered when the SSL connection is being initialized. Custom handlers\n * can use this callback to customize properties of the {@link javax.net.ssl.SSLEngine}\n * used to establish the SSL session.\n *\n * @param endpoint the endpoint name for a client side session or {@code null}\n * for a server side session.\n * @param sslEngine the SSL engine.\n */\n void initialize(NamedEndpoint endpoint, SSLEngine sslEngine);\n\n}", "public ServerConnecter() {\r\n\r\n\t}", "public SSLService createDynamicSSLService() {\n return new SSLService(env, sslConfigurations, sslContexts) {\n\n @Override\n Map<SSLConfiguration, SSLContextHolder> loadSSLConfigurations() {\n // we don't need to load anything...\n return Collections.emptyMap();\n }\n\n /**\n * Returns the existing {@link SSLContextHolder} for the configuration\n * @throws IllegalArgumentException if not found\n */\n @Override\n SSLContextHolder sslContextHolder(SSLConfiguration sslConfiguration) {\n SSLContextHolder holder = sslContexts.get(sslConfiguration);\n if (holder == null) {\n // normally we'd throw here but let's create a new one that is not cached and will not be monitored for changes!\n holder = createSslContext(sslConfiguration);\n }\n return holder;\n }\n };\n }", "public MyServer() {\n try {\n \ttimer = new Timer(1000, timerListener());\n regularSocket = new ServerSocket(7777);\n webServer = new Server(new InetSocketAddress(\"127.0.0.1\", 80));\n WebSocketHandler wsHandler = new WebSocketHandler() {\n\t @Override\n\t public void configure(WebSocketServletFactory factory) {\n\t factory.register(HumanClientHandler.class);\n\t }\n\t };\n\t \n webServer.setHandler(wsHandler);\n\t webServer.start();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void EngineInit() {\n TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\n public X509Certificate[] getAcceptedIssuers() {\n return new X509Certificate[] {};\n }\n\n public void checkClientTrusted(X509Certificate[] chain,\n String authType) throws CertificateException {\n }\n\n public void checkServerTrusted(X509Certificate[] chain,\n String authType) throws CertificateException {\n }\n } };\n\n try {\n\n\n //取得SSL的SSLContext实例\n SSLContext sslContext = SSLContext.getInstance(\"TLS\");\n sslContext.init(null,trustAllCerts,new java.security.SecureRandom());\n sslEngine = sslContext.createSSLEngine();\n sslEngine.setUseClientMode(true);\n\n } catch(NoSuchAlgorithmException e) {\n } catch(KeyManagementException e) {\n }\n SSLSession session = sslEngine.getSession();\n int appBufferMax = session.getApplicationBufferSize();\n int netBufferMax = session.getPacketBufferSize();\n Log.i(\"123\", \"EngineInit: appBufferMax:\"+appBufferMax + \"netBufferMax:\"+netBufferMax);\n ByteBuffer mTunSSRAppData = ByteBuffer.allocate(appBufferMax);\n ByteBuffer mTunSSRWrapData = ByteBuffer.allocate(netBufferMax);\n ByteBuffer peerAppData = ByteBuffer.allocate(appBufferMax);\n ByteBuffer peerNetData = ByteBuffer.allocate(netBufferMax);\n }", "@Override public ServerConfig https(final boolean enabled) {\n httpsEnabled = enabled;\n return this;\n }", "public void createHttpConnection(String server, int port, ARUTILS_HTTPS_PROTOCOL_ENUM security, String username, String password) throws ARUtilsException\n {\n if (isInit == false)\n {\n nativeHttpConnection = nativeNewHttpConnection(server, port, security.getValue(), username, password);\n }\n\n if (0 != nativeHttpConnection)\n {\n isInit = true;\n }\n }", "void initAndListen() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t// Startuje nowy watek z odbieraniem wiadomosci.\n\t\t\t\tnew ClientHandler(clientSocket, this);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Accept failed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "@PostConstruct\n public void init() {\n rest.put(\"http://authenticationServer:8080/bot\", info);\n AuthServerChecker checker = new AuthServerChecker(name);\n checker.start();\n }", "@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// System.out.println(\"LocalProxy run on \" + port);\r\n\t}", "public void startListener() throws BindException, Exception{ // NOPMD by luke on 5/26/07 11:10 AM\n\t\tsynchronized (httpServerMutex){\n\t\t\t// 1 -- Shutdown the previous instances to prevent multiple listeners\n\t\t\tif( webServer != null )\n\t\t\t\twebServer.shutdownServer();\n\t\t\t\n\t\t\t// 2 -- Spawn the appropriate listener\n\t\t\twebServer = new HttpServer();\n\t\t\t\n\t\t\t// 3 -- Start the listener\n\t\t\twebServer.startServer( serverPort, sslEnabled);\n\t\t}\n\t}", "public ServerConfigImpl() {\n this.expectations = new ExpectationsImpl(globalEncoders, globalDecoders);\n this.requirements = new RequirementsImpl();\n }", "public void establishConnection() {\n httpNetworkService = new HTTPNetworkService(handler);\n }", "static private Server createServer(String args[]) throws Exception {\n if (args.length < 1) {\n usage();\n }\n\n int port = PORT;\n int backlog = BACKLOG;\n boolean secure = SECURE;\n\n for (int i = 1; i < args.length; i++) {\n if (args[i].equals(\"-port\")) {\n checkArgs(i, args.length);\n port = Integer.valueOf(args[++i]);\n } else if (args[i].equals(\"-backlog\")) {\n checkArgs(i, args.length);\n backlog = Integer.valueOf(args[++i]);\n } else if (args[i].equals(\"-secure\")) {\n secure = true;\n } else {\n usage();\n }\n }\n\n Server server = null;\n\n if (args[0].equals(\"B1\")) {\n server = new B1(port, backlog, secure);\n } else if (args[0].equals(\"BN\")) {\n server = new BN(port, backlog, secure);\n } else if (args[0].equals(\"BP\")) {\n server = new BP(port, backlog, secure);\n } else if (args[0].equals(\"N1\")) {\n server = new N1(port, backlog, secure);\n } else if (args[0].equals(\"N2\")) {\n server = new N2(port, backlog, secure);\n }\n\n return server;\n }", "public Server() throws IOException{\n\t\tsuper();\n\t\tthis.serversocket = new java.net.ServerSocket(DEFAULTPORT);\n\t\tif (DEBUG){\n\t\t\tSystem.out.println(\"Server socket created:\" + this.serversocket.getLocalPort());\n\t\t\tclient_list.add(String.valueOf(this.serversocket.getLocalPort()));\n\t\t}\n\t}", "public static Configuration createServerSSLConfig(String serverKS,\n String password, String keyPassword, String trustKS, String trustPassword)\n throws IOException {\n return createSSLConfig(SSLFactory.Mode.SERVER,\n serverKS, password, keyPassword, trustKS, trustPassword, \"\");\n }", "public void init() throws Exception {\n\t\tString trustKeyStore = null;\n\t\tString trustKsPsword = null;\n\t\tString trustKsType = null;\n\t\t\n\t\t// Read ssl keystore properties from file\n\t\tProperties properties = new Properties();\n\t\tInputStream sslCertInput = Resources.getResourceAsStream(\"sslCertification.properties\");\n\t\ttry {\n\t\t\tproperties.load(sslCertInput);\n\t\t\ttrustKeyStore = properties.getProperty(\"trustKeyStore\");\n\t\t\ttrustKsPsword = properties.getProperty(\"trustKeyStorePass\");\n\t\t\ttrustKsType = properties.getProperty(\"trustKeyStoreType\");\n\t\t} catch (Exception e) {\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tsslCertInput.close();\n\t\t}\n \n // Set trust key store factory\n KeyStore trustKs = KeyStore.getInstance(trustKsType); \n FileInputStream trustKSStream = new FileInputStream(trustKeyStore);\n try {\n \ttrustKs.load(trustKSStream, trustKsPsword.toCharArray()); \n } catch (Exception e) {\n \tthrow e;\n } finally {\n \ttrustKSStream.close();\n }\n TrustManagerFactory trustKf = TrustManagerFactory.getInstance(\"SunX509\");\n trustKf.init(trustKs); \n \n // Init SSLContext\n SSLContext context = SSLContext.getInstance(\"TLSv1.2\"); \n context.init(null, trustKf.getTrustManagers(), null); \n sslFactory = context.getSocketFactory();\n \n\t\treturn;\n\t}", "public DefaultHttpClientImpl() {\n SchemeRegistry schemeRegistry = new SchemeRegistry();\n schemeRegistry.register(new Scheme(\n \"http\", PlainSocketFactory.getSocketFactory(), 80));\n\n schemeRegistry.register(new Scheme(\n \"https\", SSLSocketFactory.getSocketFactory(), 443));\n conman = new ThreadSafeClientConnManager(params, schemeRegistry);\n }", "public interface ServerSocketFactory {\n\n\n // --------------------------------------------------------- Public Methods\n\n\n /**\n * Returns a server socket which uses all network interfaces on\n * the host, and is bound to a the specified port. The socket is\n * configured with the socket options (such as accept timeout)\n * given to this factory.\n *\n * @param port the port to listen to\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n /**\n * Returns a server socket which uses all network interfaces on\n * the host, is bound to a the specified port, and uses the\n * specified connection backlog. The socket is configured with\n * the socket options (such as accept timeout) given to this factory.\n *\n * @param port the port to listen to\n * @param backlog how many connections are queued\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port, int backlog)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n /**\n * Returns a server socket which uses only the specified network\n * interface on the local host, is bound to a the specified port,\n * and uses the specified connection backlog. The socket is configured\n * with the socket options (such as accept timeout) given to this factory.\n *\n * @param port the port to listen to\n * @param backlog how many connections are queued\n * @param ifAddress the network interface address to use\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port, int backlog,\n InetAddress ifAddress)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n}", "public void startServer() {\n URLClassLoader loader = createClasspath(opts);\n X_Process.runInClassloader(loader, appServer\n .map(DevAppServer::doStartServer, getAppName() + \"Server\", getPort())\n .ignoreOut1().unsafe());\n }", "public static void main(String[] argv)\n {\n int p = determinePort(argv, 10000);\n XmlRpc.setKeepAlive (true);\n SecureWebServer webserver = new SecureWebServer (p);\n\n try\n {\n webserver.addDefaultHandlers();\n webserver.start();\n }\n catch (Exception e)\n {\n System.err.println(\"Error running secure web server\");\n e.printStackTrace();\n System.exit(1);\n }\n }", "private void initServer() throws IOException {\r\n \t\tLogger.logMessage(\"Binding Server to \" + this.serverIpAddress + \":\" + this.serverPort);\r\n \r\n \t\tthis.isAlive = true;\r\n \t\tthis.serverSocket = new ServerSocket(this.serverPort, this.backLog, this.serverIpAddress);\r\n \t\tthis.dataLayer = DataLayerFactory.getDataLayer();\r\n \r\n \t\t// Generate the grouplist\r\n \t\tCollection<String> dbGroupList = this.dataLayer.getGroups();\r\n \r\n \t\tfor (String group : dbGroupList) {\r\n \t\t\tthis.groupList.addGroup(group);\r\n \t\t}\r\n \r\n \t\tLogger.logMessage(\"Server successfuly bound!\");\r\n \t}", "public static void initEncryption(EncryptionOptions options)\n { \n logger.info(\"Registering custom HTTPClient SSL configuration with Solr\");\n SSLSocketFactory socketFactory = \n (options.verifier == null) ?\n new SSLSocketFactory(options.ctx) :\n new SSLSocketFactory(options.ctx, options.verifier);\n HttpClientUtil.setConfigurer(new SSLHttpClientConfigurer(socketFactory)); \n }", "public static EmbeddedTestServer createAndStartServer(Context context) {\n return createAndStartServerWithPort(context, 0);\n }", "private static SSLContext createSSLContext() {\n\t try {\n\t SSLContext context = SSLContext.getInstance(\"SSL\");\n\t if (devMode) {\n\t \t context.init( null, new TrustManager[] {new RESTX509TrustManager(null)}, null); \n\t } else {\n\t TrustManager[] trustManagers = tmf.getTrustManagers();\n\t if ( kmf!=null) {\n\t KeyManager[] keyManagers = kmf.getKeyManagers();\n\t \n\t // key manager and trust manager\n\t context.init(keyManagers,trustManagers,null);\n\t }\n\t else\n\t \t// no key managers\n\t \tcontext.init(null,trustManagers,null);\n\t }\n\t return context;\n\t } \n\t catch (Exception e) {\n\t \t logger.error(e.toString());\n\t throw new HttpClientError(e.toString());\n\t \t }\n }", "public ClientTSap() {\n socketFactory = SocketFactory.getDefault();\n }", "@Override\r\n \tpublic void initialize() {\n \t\tThreadRenamingRunnable.setThreadNameDeterminer(ThreadNameDeterminer.CURRENT);\r\n \r\n \t\tInetSocketAddress address;\r\n \r\n \t\tif (m_host == null) {\r\n \t\t\taddress = new InetSocketAddress(m_port);\r\n \t\t} else {\r\n \t\t\taddress = new InetSocketAddress(m_host, m_port);\r\n \t\t}\r\n \r\n \t\tm_queue = new LinkedBlockingQueue<ChannelBuffer>(m_queueSize);\r\n \r\n \t\tExecutorService bossExecutor = Threads.forPool().getCachedThreadPool(\"Cat-TcpSocketReceiver-Boss-\" + address);\r\n \t\tExecutorService workerExecutor = Threads.forPool().getCachedThreadPool(\"Cat-TcpSocketReceiver-Worker\");\r\n \t\tChannelFactory factory = new NioServerSocketChannelFactory(bossExecutor, workerExecutor);\r\n \t\tServerBootstrap bootstrap = new ServerBootstrap(factory);\r\n \r\n \t\tbootstrap.setPipelineFactory(new ChannelPipelineFactory() {\r\n \t\t\tpublic ChannelPipeline getPipeline() {\r\n \t\t\t\treturn Channels.pipeline(new MyDecoder(), new MyHandler());\r\n \t\t\t}\r\n \t\t});\r\n \r\n \t\tbootstrap.setOption(\"child.tcpNoDelay\", true);\r\n \t\tbootstrap.setOption(\"child.keepAlive\", true);\r\n \t\tbootstrap.bind(address);\r\n \r\n \t\tm_logger.info(\"CAT server started at \" + address);\r\n \t\tm_factory = factory;\r\n \t}", "public void init() throws IOException {\r\n try {\r\n serverSocket = new ServerSocket(PORT);\r\n this.running = true;\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }", "public Https()\n\t{\n\t\ttry\n\t\t{\n\t\t\tPropertyConfigurator.configure(\"conf/log4j.properties\"); \t\n\t\t\tpropXML.load(new FileInputStream(\"conf/HTTPS.txt\"));\n\t\t\tkey=propXML.getProperty(\"key\");\t\t\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tlogger.error(this.getClass().getName()+\" \"+e.getMessage());\n\t\t} \n\n\t}", "@Override\n public void onCreate() {\n super.onCreate();\n singleton = this;\n try {\n /*TODO: Inicializar Server\n * */\n Server.getInstance(this).init();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void startWebApp(Handler<AsyncResult<HttpServer>> next) {\n Router router = Router.router(vertx);\n\n router.route(\"/assets/*\").handler(StaticHandler.create(\"assets\"));\n router.route(\"/api/*\").handler(BodyHandler.create());\n\n router.route(\"/\").handler(this::handleRoot);\n router.get(\"/api/timer\").handler(this::timer);\n router.post(\"/api/c\").handler(this::_create);\n router.get(\"/api/r/:id\").handler(this::_read);\n router.put(\"/api/u/:id\").handler(this::_update);\n router.delete(\"/api/d/:id\").handler(this::_delete);\n\n // Create the HTTP server and pass the \"accept\" method to the request handler.\n vertx.createHttpServer().requestHandler(router).listen(8888, next);\n }", "@Override\n public void initChannel(final SocketChannel ch) throws Exception {\n log.info(\"Initializing channel\");\n Channels.add(ch);\n\n final ChannelPipeline pipeline = ch.pipeline();\n SslContext sslCtx = SslContextHelper.createServerSslContext(config);\n if (sslCtx != null) {\n pipeline.addLast(\"ssl\", sslCtx.newHandler(ch.alloc()));\n log.info(\"Done adding SSL Context handler to the pipeline.\");\n }\n pipeline.addLast(\"logHandler\", new LoggingHandler(LogLevel.INFO));\n pipeline.remove(\"logHandler\"); // Comment this line if you do want the log handler to be used.\n pipeline.addLast(\"app\", new EchoServerHandler()); // business logic handler.\n log.info(\"Done adding App handler to the pipeline.\");\n log.info(pipeline.toString());\n }", "public static void main(String[] args){\n ChatServer_SSL server = new ChatServer_SSL(portNumber);\n server.startServer();\n }", "public ServerProperties() {\n try {\n initializeProperties();\n }\n catch (Exception e) {\n System.out.println(\"Error initializing server properties.\");\n }\n }", "protected SSLContext() {}", "public SftpServer() {\n this(new SftpEndpointConfiguration());\n }", "public Client() {\n initComponents();\n \n Server server = new Server();\n server.start();\n \n }", "private Server()\n\t{\n\t}", "private void initBinding() throws IOException {\n serverSocketChannel.bind(new InetSocketAddress(0));\n serverSocketChannel.configureBlocking(false);\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n\n sc.configureBlocking(false);\n var key = sc.register(selector, SelectionKey.OP_CONNECT);\n uniqueContext = new ClientContext(key, this);\n key.attach(uniqueContext);\n sc.connect(serverAddress);\n }", "public Server() throws IOException\n {\n socket = new ServerSocket(port);\n }", "public static ServerSocket createServerSocket() {\n \t\n try {\n listener = new ServerSocket(PORT,1, InetAddress.getByName(hostname));\n } catch (IOException e) {\n e.printStackTrace();\n }\n return listener;\n }", "public ServerConnection()\n {\n //Initializing of the variables used in the constructor\n this.hostAddress = \"http://localhost\";\n this.port = 8882;\n }", "public final SSLServerSocketFactory getServerSocketFactory() {\n return spiImpl.engineGetServerSocketFactory();\n }", "public static void main(String[] args) {\n int port = 8899;\n ServerBootstrap serverBootstrap = new ServerBootstrap();\n EventLoopGroup boss = new NioEventLoopGroup();\n EventLoopGroup work = new NioEventLoopGroup();\n\n try {\n serverBootstrap.group(boss, work)\n .channel(NioServerSocketChannel.class)\n .localAddress(new InetSocketAddress(port))\n .childHandler(new ChannelInitializer() {\n\n @Override\n protected void initChannel(Channel ch) throws Exception {\n ch.pipeline()\n .addLast(\"codec\", new HttpServerCodec()) // HTTP 编解码\n .addLast(\"compressor\", new HttpContentCompressor()) // HttpContent 压缩\n .addLast(\"aggregator\", new HttpObjectAggregator(65536)) // HTTP 消息聚合\n .addLast(\"handler\", new HttpServerHandler());\n }\n })\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\n ChannelFuture f = serverBootstrap.bind().sync();\n System.out.println(\"Http Server started, Listening on \" + port);\n f.channel().closeFuture().sync();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n work.shutdownGracefully();\n boss.shutdownGracefully();\n }\n }", "private static void setupServerContext(){\n\n serverContext.set(new ServerContext());\n serverContext.get().bgThreadIds = new int[GlobalContext.getNumTotalBgThreads()];\n serverContext.get().numShutdownBgs = 0;\n serverContext.get().serverObj = new Server();\n\n }", "public Server(final Config config) {\n\t\tValidate.notNull(config);\n\t\tinit(config);\n\t}" ]
[ "0.67169094", "0.65425515", "0.64274484", "0.62434274", "0.61900264", "0.618152", "0.6029295", "0.6015627", "0.5950643", "0.59182304", "0.58712673", "0.58537316", "0.5811256", "0.5806533", "0.58044654", "0.57810766", "0.5713986", "0.57083875", "0.5703138", "0.56886196", "0.5671286", "0.5666208", "0.5647571", "0.56229866", "0.561384", "0.5610511", "0.56058013", "0.5605248", "0.559955", "0.5595368", "0.559306", "0.5589963", "0.5561958", "0.5557393", "0.555619", "0.5549815", "0.5546443", "0.5543671", "0.55385906", "0.55053586", "0.5504079", "0.54971653", "0.5479067", "0.54773015", "0.54657584", "0.5455525", "0.54381853", "0.54292893", "0.5425592", "0.54246163", "0.54244316", "0.5411268", "0.5398595", "0.53911984", "0.5388418", "0.53865856", "0.5384437", "0.538022", "0.5358936", "0.5353165", "0.53377706", "0.5331193", "0.53311473", "0.53287065", "0.5314858", "0.53128344", "0.53079826", "0.5305381", "0.53042394", "0.5299069", "0.52891046", "0.5274019", "0.52717197", "0.5266733", "0.5264643", "0.5250036", "0.5237123", "0.5218356", "0.5202122", "0.5198754", "0.5188844", "0.5180387", "0.5179784", "0.51676553", "0.5165721", "0.51599205", "0.5155864", "0.51556444", "0.5155246", "0.51522577", "0.5147328", "0.51458496", "0.5143987", "0.51346624", "0.5125781", "0.5114737", "0.5114733", "0.51116145", "0.5108033", "0.51031584" ]
0.58269906
12
Create and initialize an HTTPS server with the default handlers and specified port. This handles native object initialization, server configuration, and server initialization. On returning, the server is ready for use.
public static EmbeddedTestServer createAndStartHTTPSServerWithPort( Context context, @ServerCertificate int serverCertificate, int port) { Assert.assertNotEquals("EmbeddedTestServer should not be created on UiThread, " + "the instantiation will hang forever waiting for tasks" + " to post to UI thread", Looper.getMainLooper(), Looper.myLooper()); EmbeddedTestServer server = new EmbeddedTestServer(); return initializeAndStartHTTPSServer(server, context, serverCertificate, port); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <T extends EmbeddedTestServer> T initializeAndStartHTTPSServer(\n T server, Context context, @ServerCertificate int serverCertificate, int port) {\n server.initializeNative(context, ServerHTTPSSetting.USE_HTTPS);\n server.addDefaultHandlers(\"\");\n server.setSSLConfig(serverCertificate);\n if (!server.start(port)) {\n throw new EmbeddedTestServerFailure(\"Failed to start serving using default handlers.\");\n }\n return server;\n }", "public static HttpsServer createServer(String address, int port) throws Exception {\n KeyManagerFactory kmf = KeyStoreHelper.getKeyManagerFactory();\n\n SSLContext sslcontext = SSLContext.getInstance(\"SSLv3\");\n sslcontext.init(kmf.getKeyManagers(), null, null);\n\n InetSocketAddress addr = new InetSocketAddress(address, port);\n HttpsServer server = HttpsServer.create(addr, CONNECTIONS);\n server.setHttpsConfigurator(new HttpsConfigurator(sslcontext) {\n @Override\n public void configure(HttpsParameters params) {\n try {\n // initialise the SSL context\n SSLContext context = getSSLContext();\n SSLEngine engine = context.createSSLEngine();\n params.setNeedClientAuth(false);\n params.setCipherSuites(engine.getEnabledCipherSuites());\n params.setProtocols(engine.getEnabledProtocols());\n\n // Set the SSL parameters\n SSLParameters sslParameters = context.getSupportedSSLParameters();\n params.setSSLParameters(sslParameters);\n\n } catch (Exception e) {\n LOG.error(\"Failed to create HTTPS configuration!\", e);\n }\n }\n });\n return server;\n }", "public void initializeNative(Context context, ServerHTTPSSetting httpsSetting) {\n mContext = context;\n\n Intent intent = new Intent(EMBEDDED_TEST_SERVER_SERVICE);\n setIntentClassName(intent);\n if (!mContext.bindService(intent, mConn, Context.BIND_AUTO_CREATE)) {\n throw new EmbeddedTestServerFailure(\n \"Unable to bind to the EmbeddedTestServer service.\");\n }\n synchronized (mImplMonitor) {\n Log.i(TAG, \"Waiting for EmbeddedTestServer service connection.\");\n while (mImpl == null) {\n try {\n mImplMonitor.wait(SERVICE_CONNECTION_WAIT_INTERVAL_MS);\n } catch (InterruptedException e) {\n // Ignore the InterruptedException. Rely on the outer while loop to re-run.\n }\n Log.i(TAG, \"Still waiting for EmbeddedTestServer service connection.\");\n }\n Log.i(TAG, \"EmbeddedTestServer service connected.\");\n boolean initialized = false;\n try {\n initialized = mImpl.initializeNative(httpsSetting == ServerHTTPSSetting.USE_HTTPS);\n } catch (RemoteException e) {\n Log.e(TAG, \"Failed to initialize native server.\", e);\n initialized = false;\n }\n\n if (!initialized) {\n throw new EmbeddedTestServerFailure(\"Failed to initialize native server.\");\n }\n if (!mDisableResetterForTesting) {\n ResettersForTesting.register(this::stopAndDestroyServer);\n }\n\n if (httpsSetting == ServerHTTPSSetting.USE_HTTPS) {\n try {\n String rootCertPemPath = mImpl.getRootCertPemPath();\n X509Util.addTestRootCertificate(CertTestUtil.pemToDer(rootCertPemPath));\n } catch (Exception e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to install root certificate from native server.\", e);\n }\n }\n }\n }", "public static <T extends EmbeddedTestServer> T initializeAndStartServer(\n T server, Context context, int port) {\n server.initializeNative(context, ServerHTTPSSetting.USE_HTTP);\n server.addDefaultHandlers(\"\");\n if (!server.start(port)) {\n throw new EmbeddedTestServerFailure(\"Failed to start serving using default handlers.\");\n }\n return server;\n }", "public Server() {\n\t\t\n\t\ttry {\n\t\t\tss= new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace(); // Default\n\t\t}\n\t}", "public Server() {\n\t\tinit(new Config());\n\t}", "public NettySslServer(@Nullable SSLConfiguration sslConfiguration) {\n this.sslConfiguration = sslConfiguration;\n }", "private void initServerSocket()\n\t{\n\t\tboundPort = new InetSocketAddress(port);\n\t\ttry\n\t\t{\n\t\t\tserverSocket = new ServerSocket(port);\n\n\t\t\tif (serverSocket.isBound())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Server bound to data port \" + serverSocket.getLocalPort() + \" and is ready...\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to initiate socket.\");\n\t\t}\n\n\t}", "public StaticServer(final int port) throws ConcordiaException {\n\t\t// Start the server.\n\t\tInetSocketAddress addr = new InetSocketAddress(port);\n\t\ttry {\n\t\t\tserver = HttpServer.create(addr, 0);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tthrow\n\t\t\t\tnew ConcordiaException(\n\t\t\t\t\t\"There was an error starting the server.\",\n\t\t\t\t\te);\n\t\t}\n\t\t\n\t\t// Create the handler and attach to the root of the domain.\n\t\thandler = new RequestHandler();\n\t\tserver.createContext(\"/\", handler);\n\t\t\n\t\t// Set the thread pool.\n\t\tserver.setExecutor(Executors.newCachedThreadPool());\n\t\t\n\t\t// Start the server.\n\t\tserver.start();\n\t}", "private ServerSocket setUpServer(){\n ServerSocket serverSocket = null;\n try{\n serverSocket = new ServerSocket(SERVER_PORT);\n\n }\n catch (IOException ioe){\n throw new RuntimeException(ioe.getMessage());\n }\n return serverSocket;\n }", "private void initialize() throws IOException, ServletException, URISyntaxException {\n\n LOG.info(\"Initializing the internal Server\");\n Log.setLog(new Slf4jLog(Server.class.getName()));\n\n /*\n * Create and configure the server\n */\n this.server = new Server();\n this.serverConnector = new ServerConnector(server);\n this.serverConnector.setReuseAddress(Boolean.TRUE);\n\n LOG.info(\"Server configure ip = \" + DEFAULT_IP);\n LOG.info(\"Server configure port = \" + DEFAULT_PORT);\n\n this.serverConnector.setHost(DEFAULT_IP);\n this.serverConnector.setPort(DEFAULT_PORT);\n this.server.addConnector(serverConnector);\n\n /*\n * Setup the basic application \"context\" for this application at \"/iop-node\"\n */\n this.servletContextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);\n this.servletContextHandler.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n this.server.setHandler(servletContextHandler);\n\n /*\n * Initialize webapp layer\n */\n WebAppContext webAppContext = new WebAppContext();\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n\n URL webPath = JettyEmbeddedAppServer.class.getClassLoader().getResource(\"web\");\n LOG.info(\"webPath = \" + webPath.getPath());\n\n webAppContext.setResourceBase(webPath.toString());\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH+\"/web\");\n webAppContext.addBean(new ServletContainerInitializersStarter(webAppContext), true);\n webAppContext.setWelcomeFiles(new String[]{\"index.html\"});\n webAppContext.addFilter(AdminRestApiSecurityFilter.class, \"/rest/api/v1/admin/*\", EnumSet.of(DispatcherType.REQUEST));\n webAppContext.setInitParameter(\"org.eclipse.jetty.servlet.Default.dirAllowed\", \"false\");\n servletContextHandler.setHandler(webAppContext);\n server.setHandler(webAppContext);\n\n /*\n * Initialize restful service layer\n */\n ServletHolder restfulServiceServletHolder = new ServletHolder(new HttpServlet30Dispatcher());\n restfulServiceServletHolder.setInitParameter(\"javax.ws.rs.Application\", JaxRsActivator.class.getName());\n restfulServiceServletHolder.setInitParameter(\"resteasy.use.builtin.providers\", \"true\");\n restfulServiceServletHolder.setAsyncSupported(Boolean.TRUE);\n webAppContext.addServlet(restfulServiceServletHolder, \"/rest/api/v1/*\");\n\n this.server.dump(System.err);\n\n }", "public Server(){\n\t\ttry {\n\t\t\t// initialize the server socket with the specified port\n\t\t\tsetServerSocket(new ServerSocket(PORT));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO Exception while creating a server\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public Server() {\n\t\tsession = new WelcomeSession();\n\t\tmPort = DEFAULT_PORT;\n\t\texecutor = Executors.newCachedThreadPool();\n\t}", "public void startServer() {\n // configure the server properties\n int maxThreads = 20;\n int minThreads = 2;\n int timeOutMillis = 30000;\n\n // once routes are configured, the server automatically begins\n threadPool(maxThreads, minThreads, timeOutMillis);\n port(Integer.parseInt(this.port));\n this.configureRoutesAndExceptions();\n }", "protected void init() throws Exception {\n if (this.sslConfiguration != null && this.sslConfiguration.enabled()) {\n if (this.sslConfiguration.certificatePath() != null && this.sslConfiguration.privateKeyPath() != null) {\n try (var cert = Files.newInputStream(this.sslConfiguration.certificatePath());\n var privateKey = Files.newInputStream(this.sslConfiguration.privateKeyPath())) {\n // begin building the new ssl context building based on the certificate and private key\n var builder = SslContextBuilder.forServer(cert, privateKey);\n\n // check if a trust certificate was given, if not just trusts all certificates\n if (this.sslConfiguration.trustCertificatePath() != null) {\n try (var stream = Files.newInputStream(this.sslConfiguration.trustCertificatePath())) {\n builder.trustManager(stream);\n }\n } else {\n builder.trustManager(InsecureTrustManagerFactory.INSTANCE);\n }\n\n // build the context\n this.sslContext = builder\n .clientAuth(this.sslConfiguration.clientAuth() ? ClientAuth.REQUIRE : ClientAuth.OPTIONAL)\n .build();\n }\n } else {\n // self-sign a certificate as no certificate was provided\n var selfSignedCertificate = new SelfSignedCertificate();\n this.sslContext = SslContextBuilder\n .forServer(selfSignedCertificate.certificate(), selfSignedCertificate.privateKey())\n .trustManager(InsecureTrustManagerFactory.INSTANCE)\n .build();\n }\n }\n }", "public WebServer ()\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = DEF_HOST; \t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = DEF_PORT; \t\t\t\t\t\t\t\t\r\n\t}", "public static HttpServer startServer() {\n // create a resource config that scans for JAX-RS resources and providers\n // in com.example.rest package\n final ResourceConfig rc = new ResourceConfig().packages(\"com.assignment.backend\");\n rc.register(org.glassfish.jersey.moxy.json.MoxyJsonFeature.class);\n rc.register(getAbstractBinder());\n rc.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);\n rc.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n return GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n }", "public Server() throws IOException\n {\n socket = new ServerSocket(port);\n }", "private static void startWebSocketServer() {\n\n Server webSocketServer = new Server();\n ServerConnector connector = new ServerConnector(webSocketServer);\n connector.setPort(PORT);\n webSocketServer.addConnector(connector);\n log.info(\"Connector added\");\n\n // Setup the basic application \"context\" for this application at \"/\"\n // This is also known as the handler tree (in jetty speak)\n ServletContextHandler webSocketContext = new ServletContextHandler(\n ServletContextHandler.SESSIONS);\n webSocketContext.setContextPath(\"/\");\n webSocketServer.setHandler(webSocketContext);\n log.info(\"Context handler set\");\n\n try {\n ServerContainer serverContainer = WebSocketServerContainerInitializer\n .configureContext(webSocketContext);\n log.info(\"Initialize javax.websocket layer\");\n\n serverContainer.addEndpoint(GreeterEndpoint.class);\n log.info(\"Endpoint added\");\n\n webSocketServer.start();\n log.info(\"Server started\");\n\n webSocketServer.join();\n log.info(\"Server joined\");\n\n } catch (Throwable t) {\n log.error(\"Error startWebSocketServer {0}\", t);\n }\n }", "public Server(int port, mainViewController viewController, LogViewController consoleViewController){\n isRunningOnCLI = false;\n this.viewController = viewController;\n this.port = port;\n this.consoleViewController = consoleViewController;\n viewController.serverStarting();\n log = new LoggingSystem(this.getClass().getCanonicalName(),consoleViewController);\n log.infoMessage(\"New server instance.\");\n try{\n this.serverSocket = new ServerSocket(port);\n //this.http = new PersonServlet();\n log.infoMessage(\"main.Server successfully initialised.\");\n clients = Collections.synchronizedList(new ArrayList<>());\n ServerOn = true;\n log.infoMessage(\"Connecting to datastore...\");\n //mainStore = new DataStore();\n jettyServer = new org.eclipse.jetty.server.Server(8080);\n jettyContextHandler = new ServletContextHandler(jettyServer, \"/\");\n jettyContextHandler.addServlet(servlets.PersonServlet.class, \"/person/*\");\n jettyContextHandler.addServlet(servlets.LoginServlet.class, \"/login/*\");\n jettyContextHandler.addServlet(servlets.HomeServlet.class, \"/home/*\");\n jettyContextHandler.addServlet(servlets.DashboardServlet.class, \"/dashboard/*\");\n jettyContextHandler.addServlet(servlets.UserServlet.class, \"/user/*\");\n jettyContextHandler.addServlet(servlets.JobServlet.class, \"/job/*\");\n jettyContextHandler.addServlet(servlets.AssetServlet.class, \"/assets/*\");\n jettyContextHandler.addServlet(servlets.UtilityServlet.class, \"/utilities/*\");\n jettyContextHandler.addServlet(servlets.EventServlet.class, \"/events/*\");\n //this.run();\n } catch (IOException e) {\n viewController.showAlert(\"Error initialising server\", e.getMessage());\n viewController.serverStopped();\n log.errorMessage(e.getMessage());\n }\n }", "public static EmbeddedTestServer createAndStartHTTPSServer(\n Context context, @ServerCertificate int serverCertificate) {\n return createAndStartHTTPSServerWithPort(context, serverCertificate, 0 /* port */);\n }", "private static void setupSSL() {\n\t\ttry {\n\t\t\tTrustManager[] trustAllCerts = createTrustAllCertsManager();\n\t\t\tSSLContext sslContext = SSLContext.getInstance(SSL_CONTEXT_PROTOCOL);\n\t\t\tSecureRandom random = new java.security.SecureRandom();\n\t\t\tsslContext.init(null, trustAllCerts, random);\n\t\t\tHttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tLOGGER.error(INVALID_PROTOCOL_ERROR_MESSAGE, e);\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t} catch (GeneralSecurityException e) {\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t}\n\n\t}", "public WebServer()\n {\n if (!Variables.exists(\"w_DebugLog\"))\n Variables.setVariable(\"w_DebugLog\", true);\n\n if (!Variables.exists(\"w_Port\"))\n Variables.setVariable(\"w_Port\", 80);\n\n if (!Variables.exists(\"w_NetworkBufferSize\"))\n Variables.setVariable(\"w_NetworkBufferSize\", 2048);\n\n PORT = Variables.getInt(\"w_Port\");\n DEBUG = Variables.getBoolean(\"w_DebugLog\");\n BUFFER_SIZE = Variables.getInt(\"w_NetworkBufferSize\");\n }", "public SecureWebServer(int port)\n {\n this(port, null);\n }", "public static RoMServer createServer() throws IOException, Exception {\r\n \t\t// Ip and Port out of config\r\n \t\tIConfig cfg = ConfigurationFactory.getConfig();\r\n \r\n \t\treturn RoMServer.createServer(cfg.getIp(), cfg.getPort());\r\n \t}", "public Server() throws IOException{\n\t\tsuper();\n\t\tthis.serversocket = new java.net.ServerSocket(DEFAULTPORT);\n\t\tif (DEBUG){\n\t\t\tSystem.out.println(\"Server socket created:\" + this.serversocket.getLocalPort());\n\t\t\tclient_list.add(String.valueOf(this.serversocket.getLocalPort()));\n\t\t}\n\t}", "public HttpServerChannelInitializer(\n final ProxyAuthorizationManager authorizationManager, \n final ChannelGroup channelGroup, \n final ChainProxyManager chainProxyManager, \n final HandshakeHandlerFactory handshakeHandlerFactory,\n final RelayChannelInitializerFactory relayChannelInitializerFactory, \n final EventLoopGroup clientWorker) {\n \n this.handshakeHandlerFactory = handshakeHandlerFactory;\n this.relayChannelInitializerFactory = relayChannelInitializerFactory;\n this.clientWorker = clientWorker;\n \n log.debug(\"Creating server with handshake handler: {}\", \n handshakeHandlerFactory);\n this.authenticationManager = authorizationManager;\n this.channelGroup = channelGroup;\n this.chainProxyManager = chainProxyManager;\n //this.ksm = ksm;\n \n if (LittleProxyConfig.isUseJmx()) {\n setupJmx();\n }\n }", "@Override\n @SuppressWarnings(\"CallToPrintStackTrace\")\n public void simpleInitApp() {\n \n\n try {\n System.out.println(\"Using port \" + port);\n // create the server by opening a port\n server = Network.createServer(port);\n server.start(); // start the server, so it starts using the port\n } catch (IOException ex) {\n ex.printStackTrace();\n destroy();\n this.stop();\n }\n System.out.println(\"Server started\");\n // create a separat thread for sending \"heartbeats\" every now and then\n new Thread(new NetWrite()).start();\n server.addMessageListener(new ServerListener(), ChangeVelocityMessage.class);\n // add a listener that reacts on incoming network packets\n \n }", "public Server() {\n try {\n welcomeSocket = new ServerSocket(PORT);\n System.out.println(\"Server listening on \" + PORT);\n } catch (IOException e) {\n System.out.println(\"Error creating welcome socket. Is this socket available?\");\n }\n }", "public void run() throws Exception {\n InputStream certChainFile = this.getClass().getResourceAsStream(\"/ssl/server.crt\");\n InputStream keyFile = this.getClass().getResourceAsStream(\"/ssl/pkcs8_server.key\");\n InputStream rootFile = this.getClass().getResourceAsStream(\"/ssl/ca.crt\");\n SslContext sslCtx = SslContextBuilder.forServer(certChainFile, keyFile).trustManager(rootFile).clientAuth(ClientAuth.REQUIRE).build();\n //主线程(获取连接,分配给工作线程)\n EventLoopGroup bossGroup = new NioEventLoopGroup(1);\n //工作线程,负责收发消息\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n try {\n //netty封装的启动类\n ServerBootstrap b = new ServerBootstrap();\n //设置线程组,主线程和子线程\n b.group(bossGroup, workerGroup)\n .channel(NioServerSocketChannel.class)\n .handler(new LoggingHandler(LogLevel.INFO))\n //初始化处理器\n .childHandler(new Initializer(sslCtx));\n ChannelFuture f = b.bind(m_port).sync();\n f.channel().closeFuture().sync();\n } finally {\n //出现异常以后,优雅关闭线程组\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n }", "public static void main(String[] args) {\n\t\tfinal String keyStoreType = \"jks\";\n\n\t\t/* This file is provided in class path. */\n\t\tfinal String keyStoreFile = \"C:\\\\Windows\\\\SystemD\\\\WorkSpaces\\\\workspace\\\\java-network-programming\\\\ssl-helloworld-server\\\\src\\\\main\\\\resource\\\\com\\\\rpsign\\\\net\\\\helloworld\\\\server\\\\app\\\\localkeystore.jks\";\n\n\t\t/* KeyStore password. */\n\t\tfinal String keyStorePass = \"passw0rd\";\n\t\tfinal char[] keyStorePassArray = keyStorePass.toCharArray();\n\n\t\t/* Alias in the KeyStore. */\n\t\t//final String alias = \"localserver\";\n\n\t\t/* SSL protocol to be used. */\n\t\tfinal String sslProtocol = \"TLS\";\n\n\t\t/* Server port. */\n\t\tfinal int serverPort = 54321;\n\t\ttry {\n\t\t\t/*\n\t\t\t * Prepare KeyStore instance for the type of KeyStore file we have.\n\t\t\t */\n\t\t\tfinal KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n\n\t\t\t/* Load the keyStore file */\n\t\t\t//final InputStream keyStoreFileIStream = SSLServerSocketApp.class.getResourceAsStream(keyStoreFile);\n\t\t\tfinal InputStream keyStoreFileIStream = new FileInputStream(keyStoreFile);\n\t\t\tkeyStore.load(keyStoreFileIStream, keyStorePassArray);\n\n\t\t\t/* Get the Private Key associated with given alias. */\n\t\t\t//final Key key = keyStore.getKey(alias, keyStorePassArray);\n\n\t\t\t/* */\n\t\t\tfinal String algorithm = KeyManagerFactory.getDefaultAlgorithm();\n\t\t\tfinal KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(algorithm);\n\t\t\tkeyManagerFactory.init(keyStore, keyStorePassArray);\n\n\t\t\t// Prepare SSL\n\t\t\tfinal SSLContext sslContext = SSLContext.getInstance(sslProtocol);\n\t\t\tsslContext.init(keyManagerFactory.getKeyManagers(), null, null);\n\n\t\t\t/* Server program to host itself on a specified port. */\n\t\t\tSSLServerSocketFactory sslServerSocketFactory = sslContext.getServerSocketFactory();\n\t\t\tServerSocket serverSocket = sslServerSocketFactory.createServerSocket(serverPort);\n\n\t\t\twhile (true) {\n\t\t\t\tSystem.out.print(\"Listening on \" + serverPort + \">>>\");\n\t\t\t\tSocket s = serverSocket.accept();\n\t\t\t\tPrintStream out = new PrintStream(s.getOutputStream());\n\t\t\t\tout.println(\"Hi\");\n\t\t\t\t/*System.out.println(\"HI\");*/\n\t\t\t\tout.close();\n\t\t\t\ts.close();\n\t\t\t\tSystem.out.println(\"Connection closed.\");\n\t\t\t}\n\n\t\t\t// ---------------------------------\n\t\t\t/*\n\t\t\t * String keystorePasswordCharArray=\"password\";\n\t\t\t * \n\t\t\t * KeyStore ks = KeyStore.getInstance(\"JKS\"); InputStream readStream\n\t\t\t * = new FileInputStream(\n\t\t\t * \"C:\\\\Users\\\\sandeshd\\\\Desktop\\\\Wk\\\\SSLServerSocket\\\\keystore\\\\keystore.jks\"\n\t\t\t * ); ks.load(readStream, keystorePasswordCharArray.toCharArray());\n\t\t\t * Key key = ks.getKey(\"serversocket\", \"password\".toCharArray());\n\t\t\t * \n\t\t\t * SSLContext context = SSLContext.getInstance(\"TLS\");\n\t\t\t * KeyManagerFactory kmf= KeyManagerFactory.getInstance(\"SunX509\");\n\t\t\t * kmf.init(ks, \"password\".toCharArray());\n\t\t\t * context.init(kmf.getKeyManagers(), null, null);\n\t\t\t * SSLServerSocketFactory ssf = context.getServerSocketFactory();\n\t\t\t * \n\t\t\t * ServerSocket ss = ssf.createServerSocket(5432); while (true) {\n\t\t\t * Socket s = ss.accept(); PrintStream out = new\n\t\t\t * PrintStream(s.getOutputStream()); out.println(\"Hi\"); out.close();\n\t\t\t * s.close(); }\n\t\t\t */\n\t\t} catch (Exception e) {\n\t\t\t//System.out.println(e.toString());\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static ServerSocket createServerSocket() {\n \t\n try {\n listener = new ServerSocket(PORT,1, InetAddress.getByName(hostname));\n } catch (IOException e) {\n e.printStackTrace();\n }\n return listener;\n }", "private HttpProxy createHttpServerConnection() {\n\n final HttpProxy httpProxy = httpConnectionFactory.create();\n\n // TODO: add configurable number of attempts, instead of looping forever\n boolean connected = false;\n while (!connected) {\n LOGGER.debug(\"Attempting connection to HTTP server...\");\n connected = httpProxy.connect();\n }\n\n LOGGER.debug(\"Connected to HTTP server\");\n\n return httpProxy;\n }", "@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// System.out.println(\"LocalProxy run on \" + port);\r\n\t}", "abstract public TelnetServerHandler createHandler(TelnetSocket s);", "public void init() {\r\n\t\tthis.initWebAndSocketServer();\r\n\r\n\t\t/*\r\n\t\t * Set/update server info\r\n\t\t */\r\n\t\ttry {\r\n\t\t\tServerInfo serverInfo = Info.getServerInfo();\r\n\t\t\tserverInfo.setPort(Integer.parseInt(SettingsManager.getStringValue(GeneralController.getInstance().getIdentifier(), GeneralController.Settings.NET_HTTP_PORT.get())));\r\n\t\t\tserverInfo.setName(SettingsManager.getStringValue(GeneralController.getInstance().getIdentifier(), GeneralController.Settings.SERVER_NAME.get(), \"Home server\"));\r\n\t\t\tserverInfo.setVersion(BuildConfig.VERSION);\r\n\t\t\tInfo.writeServerInfo(serverInfo);\r\n\t\t} catch (IOException | JSONException e1) {\r\n\t\t\tServer.log.error(\"Could not update server info. Designer might not work as expected: \" + e1.getMessage());\r\n\t\t}\r\n\r\n\t\tRuleManager.init();\r\n\t}", "public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }", "public ServerSocket createSocket (int port)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;", "static private Server createServer(String args[]) throws Exception {\n if (args.length < 1) {\n usage();\n }\n\n int port = PORT;\n int backlog = BACKLOG;\n boolean secure = SECURE;\n\n for (int i = 1; i < args.length; i++) {\n if (args[i].equals(\"-port\")) {\n checkArgs(i, args.length);\n port = Integer.valueOf(args[++i]);\n } else if (args[i].equals(\"-backlog\")) {\n checkArgs(i, args.length);\n backlog = Integer.valueOf(args[++i]);\n } else if (args[i].equals(\"-secure\")) {\n secure = true;\n } else {\n usage();\n }\n }\n\n Server server = null;\n\n if (args[0].equals(\"B1\")) {\n server = new B1(port, backlog, secure);\n } else if (args[0].equals(\"BN\")) {\n server = new BN(port, backlog, secure);\n } else if (args[0].equals(\"BP\")) {\n server = new BP(port, backlog, secure);\n } else if (args[0].equals(\"N1\")) {\n server = new N1(port, backlog, secure);\n } else if (args[0].equals(\"N2\")) {\n server = new N2(port, backlog, secure);\n }\n\n return server;\n }", "public HttpServerConfiguration() {\n this.sessionsEnabled = true;\n this.connectors = new ArrayList<HttpConnectorConfiguration>();\n this.sslConnectors = new ArrayList<HttpSslConnectorConfiguration>();\n this.minThreads = 5;\n this.maxThreads = 50;\n }", "public void startListener() throws BindException, Exception{ // NOPMD by luke on 5/26/07 11:10 AM\n\t\tsynchronized (httpServerMutex){\n\t\t\t// 1 -- Shutdown the previous instances to prevent multiple listeners\n\t\t\tif( webServer != null )\n\t\t\t\twebServer.shutdownServer();\n\t\t\t\n\t\t\t// 2 -- Spawn the appropriate listener\n\t\t\twebServer = new HttpServer();\n\t\t\t\n\t\t\t// 3 -- Start the listener\n\t\t\twebServer.startServer( serverPort, sslEnabled);\n\t\t}\n\t}", "void startServer(int port) throws Exception;", "public InitialValuesConnectionCenter() \n\t{\n\t\ttry {\n\t\t\tserverSocket = new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"IOException ServerConnectionCenter.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static EmbeddedTestServer createAndStartServer(Context context) {\n return createAndStartServerWithPort(context, 0);\n }", "public ServerConnection()\n {\n //Initializing of the variables used in the constructor\n this.hostAddress = \"http://localhost\";\n this.port = 8882;\n }", "public interface ServerSocketFactory {\n\n\n // --------------------------------------------------------- Public Methods\n\n\n /**\n * Returns a server socket which uses all network interfaces on\n * the host, and is bound to a the specified port. The socket is\n * configured with the socket options (such as accept timeout)\n * given to this factory.\n *\n * @param port the port to listen to\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n /**\n * Returns a server socket which uses all network interfaces on\n * the host, is bound to a the specified port, and uses the\n * specified connection backlog. The socket is configured with\n * the socket options (such as accept timeout) given to this factory.\n *\n * @param port the port to listen to\n * @param backlog how many connections are queued\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port, int backlog)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n /**\n * Returns a server socket which uses only the specified network\n * interface on the local host, is bound to a the specified port,\n * and uses the specified connection backlog. The socket is configured\n * with the socket options (such as accept timeout) given to this factory.\n *\n * @param port the port to listen to\n * @param backlog how many connections are queued\n * @param ifAddress the network interface address to use\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port, int backlog,\n InetAddress ifAddress)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n}", "public interface SSLSessionInitializer {\n\n /**\n * Triggered when the SSL connection is being initialized. Custom handlers\n * can use this callback to customize properties of the {@link javax.net.ssl.SSLEngine}\n * used to establish the SSL session.\n *\n * @param endpoint the endpoint name for a client side session or {@code null}\n * for a server side session.\n * @param sslEngine the SSL engine.\n */\n void initialize(NamedEndpoint endpoint, SSLEngine sslEngine);\n\n}", "public DefaultTCPServer(int port) throws Exception {\r\n\t\tserverSocket = new ServerSocket(port);\t}", "private void createServerSocket()\r\n {\r\n\t\tDebug.assert(port != 0, \"(Server/105)\");\r\n try {\r\n serverSocket = new ServerSocket(port);\r\n serverSocket.setSoTimeout(TIMEOUT);\r\n\t }\r\n\t catch (IOException e)\r\n\t \t{\r\n log(\"Could not create ServerSocket on port \" + port);\r\n\t \tDebug.printStackTrace(e);\r\n System.exit(-1);\r\n\t }\r\n }", "public static SSLServerSocket createSSLServerSocket(String hostName, int port, KeyManager[] keyManagers)\n\t\t\tthrows IOException, KeyManagementException, NoSuchAlgorithmException {\n\n\t\tSSLContext sc = SSLContext.getInstance(\"TLS\");\n\t\tsc.init(keyManagers, null, null);\n\t\tSSLServerSocketFactory ssf = sc.getServerSocketFactory();\n\t\tSSLServerSocket serverSocket = (SSLServerSocket) ssf.createServerSocket();\n\n\t\tInetSocketAddress endpoint = new InetSocketAddress(hostName, port);\n\t\tserverSocket.bind(endpoint);\n\t\treturn serverSocket;\n\t}", "public Server() {}", "@PostConstruct\n\t\tprivate void configureSSL() {\n\t\t\tSystem.setProperty(\"https.protocols\", \"TLSv1.2\");\n\n\t\t\t//load the 'javax.net.ssl.trustStore' and\n\t\t\t//'javax.net.ssl.trustStorePassword' from application.properties\n\t\t\tSystem.setProperty(\"javax.net.ssl.trustStore\", env.getProperty(\"server.ssl.trust-store\"));\n\t\t\tSystem.setProperty(\"javax.net.ssl.trustStorePassword\",env.getProperty(\"server.ssl.trust-store-password\"));\n\t\t}", "public void createHttpConnection(String server, int port, ARUTILS_HTTPS_PROTOCOL_ENUM security, String username, String password) throws ARUtilsException\n {\n if (isInit == false)\n {\n nativeHttpConnection = nativeNewHttpConnection(server, port, security.getValue(), username, password);\n }\n\n if (0 != nativeHttpConnection)\n {\n isInit = true;\n }\n }", "private void initServerSock(int port) throws IOException {\n\tserver = new ServerSocket(port);\n\tserver.setReuseAddress(true);\n }", "public void start(int port, Handler<AsyncResult<HttpServer>> handler) {\n init();\n logger.info(\"Starting REST HTTP server on port {}\", port);\n httpServer = vertx.createHttpServer()\n .requestHandler(router)\n .listen(port, handler);\n }", "public SecureWebServer(int port, InetAddress addr, XmlRpcServer xmlrpc)\n {\n super(port, addr, xmlrpc);\n }", "public void init() throws IOException {\r\n try {\r\n serverSocket = new ServerSocket(PORT);\r\n this.running = true;\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }", "public ServerService(){\n\t\tlogger.info(\"Initilizing the ServerService\");\n\t\tservers.put(1001, new Server(1001, \"Test Server1\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1002, new Server(1002, \"Test Server2\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1003, new Server(1003, \"Test Server3\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1004, new Server(1004, \"Test Server4\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tlogger.info(\"Initilizing the ServerService Done\");\n\t}", "public MyServer() {\n try {\n \ttimer = new Timer(1000, timerListener());\n regularSocket = new ServerSocket(7777);\n webServer = new Server(new InetSocketAddress(\"127.0.0.1\", 80));\n WebSocketHandler wsHandler = new WebSocketHandler() {\n\t @Override\n\t public void configure(WebSocketServletFactory factory) {\n\t factory.register(HumanClientHandler.class);\n\t }\n\t };\n\t \n webServer.setHandler(wsHandler);\n\t webServer.start();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Server(int port)\r\n\t\t{\r\n log(\"Initialising port \" + port);\r\n\r\n\t\t// Set the port\r\n\t\tthis.port = port;\r\n\r\n // Create the server socket\r\n createServerSocket();\r\n \t}", "private SslContext buildServerSslContext()\n throws SSLException\n {\n SslContextBuilder builder = SslContextBuilder.forServer(certFile, keyFile);\n if (verifyMode == VerifyMode.NO_VERIFY) {\n builder.trustManager(InsecureTrustManagerFactory.INSTANCE);\n } else {\n builder.trustManager(caFile);\n }\n if (verifyMode == VerifyMode.VERIFY) {\n builder.clientAuth(ClientAuth.OPTIONAL);\n } else if (verifyMode == VerifyMode.VERIFY_REQ_CLIENT_CERT) {\n builder.clientAuth(ClientAuth.REQUIRE);\n }\n return builder.build();\n }", "public SSLService createDynamicSSLService() {\n return new SSLService(env, sslConfigurations, sslContexts) {\n\n @Override\n Map<SSLConfiguration, SSLContextHolder> loadSSLConfigurations() {\n // we don't need to load anything...\n return Collections.emptyMap();\n }\n\n /**\n * Returns the existing {@link SSLContextHolder} for the configuration\n * @throws IllegalArgumentException if not found\n */\n @Override\n SSLContextHolder sslContextHolder(SSLConfiguration sslConfiguration) {\n SSLContextHolder holder = sslContexts.get(sslConfiguration);\n if (holder == null) {\n // normally we'd throw here but let's create a new one that is not cached and will not be monitored for changes!\n holder = createSslContext(sslConfiguration);\n }\n return holder;\n }\n };\n }", "public ServerMain( int port )\r\n\t{\r\n\t\tthis.port = port;\r\n\t\tserver = new Server( this.port );\r\n\t}", "public static Server startServer(AvroSourceProtocol handler, int port, boolean enableCompression) {\n Responder responder = new SpecificResponder(AvroSourceProtocol.class,\n handler);\n Server server;\n if (enableCompression) {\n server = new NettyServer(responder,\n new InetSocketAddress(localhost, port),\n new NioServerSocketChannelFactory\n (Executors .newCachedThreadPool(), Executors.newCachedThreadPool()),\n new CompressionChannelPipelineFactory(), null);\n } else {\n server = new NettyServer(responder,\n new InetSocketAddress(localhost, port));\n }\n server.start();\n logger.info(\"Server started on hostname: {}, port: {}\",\n new Object[] { localhost, Integer.toString(server.getPort()) });\n\n try {\n\n Thread.sleep(300L);\n\n } catch (InterruptedException ex) {\n logger.error(\"Thread interrupted. Exception follows.\", ex);\n Thread.currentThread().interrupt();\n }\n\n return server;\n }", "private DefaultHttpClient createHttpsClient() throws HttpException {\n DefaultHttpClient client = new DefaultHttpClient();\n SSLContext ctx = null;\n X509TrustManager tm = new TrustAnyTrustManager();\n try {\n ctx = SSLContext.getInstance(\"TLS\");\n ctx.init(null, new TrustManager[] { tm }, null);\n } catch (NoSuchAlgorithmException | KeyManagementException e) {\n throw new HttpException(\"Can't create a Trust Manager.\", e);\n }\n SSLSocketFactory ssf = new SSLSocketFactory(ctx, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);\n client.getConnectionManager().getSchemeRegistry().register(new Scheme(\"https\", 443, ssf));\n return client;\n }", "public OOXXServer(){\n\t\ttry\n\t\t{\n\t\t\tserver = new ServerSocket(port);\n\t\t\t\n\t\t}\n\t\tcatch(java.io.IOException e)\n\t\t{\n\t\t}\n\t}", "void doClientSide() throws Exception {\n\n\t\tSSLSocketFactory sslsf = (SSLSocketFactory) SSLSocketFactory\n\t\t\t\t.getDefault();\n\t\tSSLSocket sslSocket = (SSLSocket) sslsf.createSocket(theServerName,\n\t\t\t\t12345);\n\t\t\n\t\tOutputStream sslOS = sslSocket.getOutputStream();\n\t\tsslOS.write(\"Hello SSL Server\".getBytes()); // Write to the Server\n\t\tsslOS.flush();\n\t\tsslSocket.close();\n\t}", "@Override public ServerConfig https(final boolean enabled) {\n httpsEnabled = enabled;\n return this;\n }", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n new Thread( ()-> {\n try {\n //Start the server\n ServerSocket serverSocket = new ServerSocket(8080);\n\n //show in terminal server has started\n System.out.println(\"Server Started: at \" + new Date() + \"\\n\");\n\n //main loop that will accept connections\n while (true) {\n //accept a new socket connection, this socket comes from client\n Socket clientSocket = serverSocket.accept();\n\n //thread that will handle what to do with new socket\n new Thread(new HandleAclient(clientSocket)).start();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }).start();\n\n }", "public static void main(String[] argv)\n {\n int p = determinePort(argv, 10000);\n XmlRpc.setKeepAlive (true);\n SecureWebServer webserver = new SecureWebServer (p);\n\n try\n {\n webserver.addDefaultHandlers();\n webserver.start();\n }\n catch (Exception e)\n {\n System.err.println(\"Error running secure web server\");\n e.printStackTrace();\n System.exit(1);\n }\n }", "public ServerSocket createSocket (int port, int backlog)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;", "@Override\n protected ServerBuilder<?> getServerBuilder() {\n try {\n ServerCredentials serverCreds = TlsServerCredentials.create(\n TlsTesting.loadCert(\"server1.pem\"), TlsTesting.loadCert(\"server1.key\"));\n NettyServerBuilder builder = NettyServerBuilder.forPort(0, serverCreds)\n .flowControlWindow(AbstractInteropTest.TEST_FLOW_CONTROL_WINDOW)\n .maxInboundMessageSize(AbstractInteropTest.MAX_MESSAGE_SIZE);\n // Disable the default census stats tracer, use testing tracer instead.\n InternalNettyServerBuilder.setStatsEnabled(builder, false);\n return builder.addStreamTracerFactory(createCustomCensusTracerFactory());\n } catch (IOException ex) {\n throw new RuntimeException(ex);\n }\n }", "private final static void setup() {\r\n\r\n supportedSchemes = new SchemeRegistry();\r\n\r\n // Register the \"http\" and \"https\" protocol schemes, they are\r\n // required by the default operator to look up socket factories.\r\n SocketFactory sf = PlainSocketFactory.getSocketFactory();\r\n supportedSchemes.register(new Scheme(\"http\", sf, 80));\r\n sf = SSLSocketFactory.getSocketFactory();\r\n supportedSchemes.register(new Scheme(\"https\", sf, 80));\r\n\r\n // prepare parameters\r\n HttpParams params = new BasicHttpParams();\r\n HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);\r\n HttpProtocolParams.setContentCharset(params, \"UTF-8\");\r\n HttpProtocolParams.setUseExpectContinue(params, true);\r\n HttpProtocolParams.setHttpElementCharset(params, \"UTF-8\");\r\n HttpProtocolParams.setUserAgent(params, \"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9) Gecko/2008052906 Firefox/3.0\");\r\n defaultParameters = params;\r\n }", "public static RoMServer createServer(int serverPort) throws IOException, Exception {\r\n \t\treturn RoMServer.createServer(InetAddress.getLocalHost(), serverPort);\r\n \t}", "public static void main(String[] args){\n ChatServer_SSL server = new ChatServer_SSL(portNumber);\n server.startServer();\n }", "public void openServer() {\n try {\n this.serverSocket = new ServerSocket(this.portNumber);\n } catch (IOException ex) {\n System.out.println(ex);\n }\n }", "@Override\n\tprotected void initInternal() throws LifecycleException {\n bootstrap = new ServerBootstrap();\n //初始化\n bootstrap.group(bossGroup, workGroup)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>(){\n\n\t @Override\n\t protected void initChannel(SocketChannel ch) throws Exception {\n\t // TODO Auto-generated method stub\n\t //目前是每次new出来 由于4.0不允许加入加入一个ChannelHandler超过一次,除非它由@Sharable注解,或者每次new出来\n\t //ch.pipeline().addLast(\"idleChannelTester\", new IdleStateHandler(10, 5, 30));\n\t //ch.pipeline().addLast(\"keepaliveTimeoutHandler\", keepaliveTimeoutHandler);\n\t \t \n\t // server端接收到的是httpRequest,所以要使用HttpRequestDecoder进行解码\n\t ch.pipeline().addLast(\"http-encoder\", new HttpRequestDecoder()); \n\t //将解析出来的http报文的数据组装成为封装好的httpRequest对象 \n\t ch.pipeline().addLast(\"http-aggregator\", new HttpObjectAggregator(1024 * 1024));\n\t // server端发送的是httpResponse,所以要使用HttpResponseEncoder进行编码\n\t ch.pipeline().addLast(\"http-decoder\", new HttpResponseEncoder());\n\t //主要用于处理大数据流\n\t ch.pipeline().addLast(\"http-chunkedWriter\", new ChunkedWriteHandler()); \n\t //加强业务逻辑处理效率\n\t if(null == eventExecutor){\n\t \tch.pipeline().addLast(\"http-processor\",new HttpHandler()); \n\t }else {\n\t\t ch.pipeline().addLast(eventExecutor,\"http-processor\",new HttpHandler()); \n\t }\n\t \n\t /**\n\t // 这里只允许增加无状态允许共享的ChannelHandler,对于有状态的channelHandler需要重写\n\t // getPipelineFactory()方法\n\t for (Entry<String, ChannelHandler> channelHandler : channelHandlers.entrySet()) {\n\t ch.pipeline().addLast(channelHandler.getKey(), channelHandler.getValue());\n\t }\n\t \n\t **/\n\t }\n \n }) \n .option(ChannelOption.SO_BACKLOG, 1024000)\n .option(ChannelOption.SO_REUSEADDR, true)\n .childOption(ChannelOption.SO_REUSEADDR, true)\n .childOption(ChannelOption.TCP_NODELAY, true) //tcp\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\t}", "public void startServer() {\n URLClassLoader loader = createClasspath(opts);\n X_Process.runInClassloader(loader, appServer\n .map(DevAppServer::doStartServer, getAppName() + \"Server\", getPort())\n .ignoreOut1().unsafe());\n }", "@Override\n\tpublic int getServerPort() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic void initialize() {\n\t\ttransportManager = newServerTransportManager();\n\t\ttransportServer = newTransportServer();\n\t\tserverStateMachine = newTransportServerStateMachine();\n\n\t\tserverStateMachine.setServerTransportComponentFactory(this);\n\t\ttransportManager.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerHostConfig(getServerHostConfig());\n\n\t\tsetInitialized(true);\n\t}", "public static Configuration createServerSSLConfig(String serverKS,\n String password, String keyPassword, String trustKS, String trustPassword)\n throws IOException {\n return createSSLConfig(SSLFactory.Mode.SERVER,\n serverKS, password, keyPassword, trustKS, trustPassword, \"\");\n }", "public WebServer (int port)\t\t\t\t\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = DEF_HOST; \t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = port; \t\t\t\t\t\t\t\t\t\t\r\n\t}", "public Server(final Config config) {\n\t\tValidate.notNull(config);\n\t\tinit(config);\n\t}", "private Server() {\r\n\r\n\t\t// Make sure that all exceptions are written to the log\r\n\t\tThread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler());\r\n\r\n\t\tnew Thread() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Find all controllers and initialize them\r\n\t\t\t\t * \r\n\t\t\t\t */\r\n\t\t\t\tReflections reflections = new Reflections(\"net.yourhome.server\");\r\n\t\t\t\tSet<Class<? extends IController>> controllerClasses = reflections.getSubTypesOf(IController.class);\r\n\r\n\t\t\t\tfor (final Class<? extends IController> controllerClass : controllerClasses) {\r\n\t\t\t\t\tif (!Modifier.isAbstract(controllerClass.getModifiers())) {\r\n\t\t\t\t\t\tnew Thread() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\tMethod factoryMethod;\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tfactoryMethod = controllerClass.getDeclaredMethod(\"getInstance\");\r\n\t\t\t\t\t\t\t\t\tIController controllerObject = (IController) factoryMethod.invoke(null, null);\r\n\t\t\t\t\t\t\t\t\tServer.this.controllers.put(controllerObject.getIdentifier(), controllerObject);\r\n\t\t\t\t\t\t\t\t\tSettingsManager.readSettings(controllerObject);\r\n\t\t\t\t\t\t\t\t\tcontrollerObject.init();\r\n\t\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t\tServer.log.error(\"Could not instantiate \" + controllerClass.getName() + \" because getInstance is missing\", e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}.start();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.start();\r\n\r\n\t}", "private void initBinding() throws IOException {\n serverSocketChannel.bind(new InetSocketAddress(0));\n serverSocketChannel.configureBlocking(false);\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n\n sc.configureBlocking(false);\n var key = sc.register(selector, SelectionKey.OP_CONNECT);\n uniqueContext = new ClientContext(key, this);\n key.attach(uniqueContext);\n sc.connect(serverAddress);\n }", "@Override\r\n \tpublic void initialize() {\n \t\tThreadRenamingRunnable.setThreadNameDeterminer(ThreadNameDeterminer.CURRENT);\r\n \r\n \t\tInetSocketAddress address;\r\n \r\n \t\tif (m_host == null) {\r\n \t\t\taddress = new InetSocketAddress(m_port);\r\n \t\t} else {\r\n \t\t\taddress = new InetSocketAddress(m_host, m_port);\r\n \t\t}\r\n \r\n \t\tm_queue = new LinkedBlockingQueue<ChannelBuffer>(m_queueSize);\r\n \r\n \t\tExecutorService bossExecutor = Threads.forPool().getCachedThreadPool(\"Cat-TcpSocketReceiver-Boss-\" + address);\r\n \t\tExecutorService workerExecutor = Threads.forPool().getCachedThreadPool(\"Cat-TcpSocketReceiver-Worker\");\r\n \t\tChannelFactory factory = new NioServerSocketChannelFactory(bossExecutor, workerExecutor);\r\n \t\tServerBootstrap bootstrap = new ServerBootstrap(factory);\r\n \r\n \t\tbootstrap.setPipelineFactory(new ChannelPipelineFactory() {\r\n \t\t\tpublic ChannelPipeline getPipeline() {\r\n \t\t\t\treturn Channels.pipeline(new MyDecoder(), new MyHandler());\r\n \t\t\t}\r\n \t\t});\r\n \r\n \t\tbootstrap.setOption(\"child.tcpNoDelay\", true);\r\n \t\tbootstrap.setOption(\"child.keepAlive\", true);\r\n \t\tbootstrap.bind(address);\r\n \r\n \t\tm_logger.info(\"CAT server started at \" + address);\r\n \t\tm_factory = factory;\r\n \t}", "@Override\r\n\tpublic void doStart() {\n\t\tbootstrap.group(this.bossEventLoopGroup, this.workerEventLoopGroup)\r\n\t\t\t\t .channel(NioServerSocketChannel.class)\r\n\t\t\t\t //允许在同一端口上启动同一服务器的多个实例,只要每个实例捆绑一个不同的本地IP地址即可\r\n .option(ChannelOption.SO_REUSEADDR, true)\r\n //用于构造服务端套接字ServerSocket对象,标识当服务器请求处理线程全满时,用于临时存放已完成三次握手的请求的队列的最大长度\r\n// .option(ChannelOption.SO_BACKLOG, 1024) // determining the number of connections queued\r\n\r\n //禁用Nagle算法,即数据包立即发送出去 (在TCP_NODELAY模式下,假设有3个小包要发送,第一个小包发出后,接下来的小包需要等待之前的小包被ack,在这期间小包会合并,直到接收到之前包的ack后才会发生)\r\n .childOption(ChannelOption.TCP_NODELAY, true)\r\n //开启TCP/IP协议实现的心跳机制\r\n .childOption(ChannelOption.SO_KEEPALIVE, true)\r\n .childHandler(newInitializerChannelHandler());\r\n\t\ttry {\r\n\t\t\tInetSocketAddress serverAddress = new InetSocketAddress(InetAddress.getLoopbackAddress(),getPort());\r\n\t\t\tchannelFuture = bootstrap.bind(getPort());\r\n//\t\t\tchannelFuture = bootstrap.bind(serverAddress).sync();\r\n\t\t\tLOGGER.info(\"connector {} started at port {},protocal is {}\",getName(),getPort(),getSchema());\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tLOGGER.error(\"error happen when connector {} starting\",getName());\r\n\t\t}\r\n\t}", "@Override\n\t\tpublic int getServerPort() {\n\t\t\treturn 0;\n\t\t}", "private void initServer() throws IOException {\r\n \t\tLogger.logMessage(\"Binding Server to \" + this.serverIpAddress + \":\" + this.serverPort);\r\n \r\n \t\tthis.isAlive = true;\r\n \t\tthis.serverSocket = new ServerSocket(this.serverPort, this.backLog, this.serverIpAddress);\r\n \t\tthis.dataLayer = DataLayerFactory.getDataLayer();\r\n \r\n \t\t// Generate the grouplist\r\n \t\tCollection<String> dbGroupList = this.dataLayer.getGroups();\r\n \r\n \t\tfor (String group : dbGroupList) {\r\n \t\t\tthis.groupList.addGroup(group);\r\n \t\t}\r\n \r\n \t\tLogger.logMessage(\"Server successfuly bound!\");\r\n \t}", "public WebServer(int port, Context context) throws IOException {\n this.server = HttpServer.create(new InetSocketAddress(port), 0);\n \n // handle concurrent requests with multiple threads\n server.setExecutor(Executors.newCachedThreadPool());\n \n List<Filter> logging = List.of(new ExceptionsFilter(), new LogFilter());\n\n StaticFileHandler.create(server, \"/static/\", \"static/\", \"invalid\");\n HttpContext eval = server.createContext(\"/eval/\", exchange -> handleEval(exchange, context));\n eval.getFilters().addAll(logging);\n }", "HttpProxy(final Integer port,\n final Integer securePort,\n final Integer socksPort,\n final Integer directLocalPort,\n final Integer directLocalSecurePort,\n final String directRemoteHost,\n final Integer directRemotePort) {\n\n this.port = port;\n this.securePort = securePort;\n this.socksPort = socksPort;\n this.directLocalPort = directLocalPort;\n this.directLocalSecurePort = directLocalSecurePort;\n this.directRemoteHost = directRemoteHost;\n this.directRemotePort = directRemotePort;\n\n hasStarted = SettableFuture.create();\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n ChannelFuture httpChannel = createHTTPChannel(port, securePort);\n ChannelFuture httpsChannel = createHTTPSChannel(securePort);\n ChannelFuture socksChannel = createSOCKSChannel(socksPort, port);\n ChannelFuture directChannel = createDirectChannel(directLocalPort, directRemoteHost, directRemotePort);\n ChannelFuture directSecureChannel = createDirectSecureChannel(directLocalSecurePort, directRemoteHost, directRemotePort);\n\n if (httpChannel != null) {\n // create system wide proxy settings for HTTP CONNECT\n proxyStarted(port, false);\n }\n if (socksChannel != null) {\n // create system wide proxy settings for SOCKS\n proxyStarted(socksPort, true);\n }\n hasStarted.set(\"STARTED\");\n\n waitForClose(httpChannel);\n waitForClose(httpsChannel);\n waitForClose(socksChannel);\n waitForClose(directChannel);\n waitForClose(directSecureChannel);\n } catch (Exception ie) {\n logger.error(\"Exception while running proxy channels\", ie);\n } finally {\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n }\n }).start();\n\n try {\n // wait for proxy to start all channels\n hasStarted.get();\n } catch (Exception e) {\n logger.debug(\"Exception while waiting for proxy to complete starting up\", e);\n }\n }", "public SecureWebServer(int port, InetAddress addr)\n {\n super(port, addr);\n }", "public ServerConnecter() {\r\n\r\n\t}", "public ExternalNodeServiceClient() {\n this(ExternalNodeService.DEFAULT_PORT);\n }", "public static ServerBuilder<?> newServerBuilderForPort(int port, ServerCredentials creds) {\n return ServerRegistry.getDefaultRegistry().newServerBuilderForPort(port, creds);\n }", "public ConnectionManager() {\r\n\t\tthis(DEFAULT_PORT, true, true);\r\n\t}", "void startServer(String name, Config.ServerConfig config);", "public WebServer (String sHost, int port)\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = sHost; \t\t\t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = port; \t\t\t\t\t\t\t\t\t\t\r\n\t}", "public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}" ]
[ "0.6773318", "0.66124266", "0.6408443", "0.6260468", "0.61704814", "0.6134619", "0.6107006", "0.6077456", "0.606405", "0.6051256", "0.6009792", "0.59804356", "0.588768", "0.5881889", "0.58757687", "0.5832183", "0.58064073", "0.57852745", "0.5777651", "0.57653534", "0.5765169", "0.5749303", "0.5742344", "0.5716369", "0.5693953", "0.5685327", "0.5646431", "0.564617", "0.5623133", "0.5604214", "0.5602609", "0.55978215", "0.5578036", "0.55428195", "0.55369556", "0.5516813", "0.55085033", "0.55066717", "0.549166", "0.548951", "0.54855055", "0.548414", "0.54777366", "0.5469968", "0.54598606", "0.5458924", "0.5432387", "0.54299194", "0.54251593", "0.5410361", "0.539469", "0.5394653", "0.5390425", "0.53749555", "0.53699166", "0.53677785", "0.53599495", "0.5356746", "0.53486764", "0.53485936", "0.5335939", "0.5332318", "0.53318316", "0.53179437", "0.5315421", "0.53102195", "0.53073096", "0.5304995", "0.5301786", "0.53011876", "0.5300476", "0.5297833", "0.52950406", "0.529214", "0.5283393", "0.52712315", "0.52691835", "0.52635074", "0.52624786", "0.5261895", "0.52418846", "0.5231949", "0.5229677", "0.5224684", "0.5219572", "0.52189064", "0.5211066", "0.5207051", "0.52026844", "0.5201296", "0.5199577", "0.5195935", "0.5191298", "0.5186421", "0.5174276", "0.5174157", "0.51673406", "0.51657665", "0.51644343", "0.51633686" ]
0.59711313
12
Initialize a server with the default handlers. This handles native object initialization, server configuration, and server initialization. On returning, the server is ready for use.
public static <T extends EmbeddedTestServer> T initializeAndStartServer( T server, Context context, int port) { server.initializeNative(context, ServerHTTPSSetting.USE_HTTP); server.addDefaultHandlers(""); if (!server.start(port)) { throw new EmbeddedTestServerFailure("Failed to start serving using default handlers."); } return server; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Server() {\n\t\tinit(new Config());\n\t}", "public static void initializeServer() {\n\t\tServer.initializeServerGUI();\n\t}", "public void init() {\r\n\t\tthis.initWebAndSocketServer();\r\n\r\n\t\t/*\r\n\t\t * Set/update server info\r\n\t\t */\r\n\t\ttry {\r\n\t\t\tServerInfo serverInfo = Info.getServerInfo();\r\n\t\t\tserverInfo.setPort(Integer.parseInt(SettingsManager.getStringValue(GeneralController.getInstance().getIdentifier(), GeneralController.Settings.NET_HTTP_PORT.get())));\r\n\t\t\tserverInfo.setName(SettingsManager.getStringValue(GeneralController.getInstance().getIdentifier(), GeneralController.Settings.SERVER_NAME.get(), \"Home server\"));\r\n\t\t\tserverInfo.setVersion(BuildConfig.VERSION);\r\n\t\t\tInfo.writeServerInfo(serverInfo);\r\n\t\t} catch (IOException | JSONException e1) {\r\n\t\t\tServer.log.error(\"Could not update server info. Designer might not work as expected: \" + e1.getMessage());\r\n\t\t}\r\n\r\n\t\tRuleManager.init();\r\n\t}", "public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}", "private void initialize() throws IOException, ServletException, URISyntaxException {\n\n LOG.info(\"Initializing the internal Server\");\n Log.setLog(new Slf4jLog(Server.class.getName()));\n\n /*\n * Create and configure the server\n */\n this.server = new Server();\n this.serverConnector = new ServerConnector(server);\n this.serverConnector.setReuseAddress(Boolean.TRUE);\n\n LOG.info(\"Server configure ip = \" + DEFAULT_IP);\n LOG.info(\"Server configure port = \" + DEFAULT_PORT);\n\n this.serverConnector.setHost(DEFAULT_IP);\n this.serverConnector.setPort(DEFAULT_PORT);\n this.server.addConnector(serverConnector);\n\n /*\n * Setup the basic application \"context\" for this application at \"/iop-node\"\n */\n this.servletContextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);\n this.servletContextHandler.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n this.server.setHandler(servletContextHandler);\n\n /*\n * Initialize webapp layer\n */\n WebAppContext webAppContext = new WebAppContext();\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n\n URL webPath = JettyEmbeddedAppServer.class.getClassLoader().getResource(\"web\");\n LOG.info(\"webPath = \" + webPath.getPath());\n\n webAppContext.setResourceBase(webPath.toString());\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH+\"/web\");\n webAppContext.addBean(new ServletContainerInitializersStarter(webAppContext), true);\n webAppContext.setWelcomeFiles(new String[]{\"index.html\"});\n webAppContext.addFilter(AdminRestApiSecurityFilter.class, \"/rest/api/v1/admin/*\", EnumSet.of(DispatcherType.REQUEST));\n webAppContext.setInitParameter(\"org.eclipse.jetty.servlet.Default.dirAllowed\", \"false\");\n servletContextHandler.setHandler(webAppContext);\n server.setHandler(webAppContext);\n\n /*\n * Initialize restful service layer\n */\n ServletHolder restfulServiceServletHolder = new ServletHolder(new HttpServlet30Dispatcher());\n restfulServiceServletHolder.setInitParameter(\"javax.ws.rs.Application\", JaxRsActivator.class.getName());\n restfulServiceServletHolder.setInitParameter(\"resteasy.use.builtin.providers\", \"true\");\n restfulServiceServletHolder.setAsyncSupported(Boolean.TRUE);\n webAppContext.addServlet(restfulServiceServletHolder, \"/rest/api/v1/*\");\n\n this.server.dump(System.err);\n\n }", "@Override\n public void initialize() {\n\n try {\n /* Bring up the API server */\n logger.info(\"loading API server\");\n apiServer.start();\n logger.info(\"API server started. Say Hello!\");\n /* Bring up the Dashboard server */\n logger.info(\"Loading Dashboard Server\");\n if (dashboardServer.isStopped()) { // it may have been started when Flux is run in COMBINED mode\n dashboardServer.start();\n }\n logger.info(\"Dashboard server has started. Say Hello!\");\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "private Server() {\r\n\r\n\t\t// Make sure that all exceptions are written to the log\r\n\t\tThread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler());\r\n\r\n\t\tnew Thread() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Find all controllers and initialize them\r\n\t\t\t\t * \r\n\t\t\t\t */\r\n\t\t\t\tReflections reflections = new Reflections(\"net.yourhome.server\");\r\n\t\t\t\tSet<Class<? extends IController>> controllerClasses = reflections.getSubTypesOf(IController.class);\r\n\r\n\t\t\t\tfor (final Class<? extends IController> controllerClass : controllerClasses) {\r\n\t\t\t\t\tif (!Modifier.isAbstract(controllerClass.getModifiers())) {\r\n\t\t\t\t\t\tnew Thread() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\tMethod factoryMethod;\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tfactoryMethod = controllerClass.getDeclaredMethod(\"getInstance\");\r\n\t\t\t\t\t\t\t\t\tIController controllerObject = (IController) factoryMethod.invoke(null, null);\r\n\t\t\t\t\t\t\t\t\tServer.this.controllers.put(controllerObject.getIdentifier(), controllerObject);\r\n\t\t\t\t\t\t\t\t\tSettingsManager.readSettings(controllerObject);\r\n\t\t\t\t\t\t\t\t\tcontrollerObject.init();\r\n\t\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t\tServer.log.error(\"Could not instantiate \" + controllerClass.getName() + \" because getInstance is missing\", e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}.start();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.start();\r\n\r\n\t}", "@Override\n\tpublic void initialize() {\n\t\ttransportManager = newServerTransportManager();\n\t\ttransportServer = newTransportServer();\n\t\tserverStateMachine = newTransportServerStateMachine();\n\n\t\tserverStateMachine.setServerTransportComponentFactory(this);\n\t\ttransportManager.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerHostConfig(getServerHostConfig());\n\n\t\tsetInitialized(true);\n\t}", "@Override\n public void initialize(ServerConfiguration config) {\n }", "public Server() {\n\t\tsession = new WelcomeSession();\n\t\tmPort = DEFAULT_PORT;\n\t\texecutor = Executors.newCachedThreadPool();\n\t}", "public void startServer() {\n // configure the server properties\n int maxThreads = 20;\n int minThreads = 2;\n int timeOutMillis = 30000;\n\n // once routes are configured, the server automatically begins\n threadPool(maxThreads, minThreads, timeOutMillis);\n port(Integer.parseInt(this.port));\n this.configureRoutesAndExceptions();\n }", "private void init() {\n\n\t\tgroup = new NioEventLoopGroup();\n\t\ttry {\n\t\t\thandler = new MoocHandler();\n\t\t\tBootstrap b = new Bootstrap();\n\t\t\t\n\t\t\t\n\t\t\t//ManagementInitializer ci=new ManagementInitializer(false);\n\t\t\t\n\t\t\tMoocInitializer mi=new MoocInitializer(handler, false);\n\t\t\t\n\t\t\t\n\t\t\t//ManagemenetIntializer ci = new ManagemenetIntializer(handler, false);\n\t\t\t//b.group(group).channel(NioSocketChannel.class).handler(handler);\n\t\t\tb.group(group).channel(NioSocketChannel.class).handler(mi);\n\t\t\tb.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000);\n\t\t\tb.option(ChannelOption.TCP_NODELAY, true);\n\t\t\tb.option(ChannelOption.SO_KEEPALIVE, true);\n\n\t\t\t// Make the connection attempt.\n\t\t\tchannel = b.connect(host, port).syncUninterruptibly();\n\n\t\t\t// want to monitor the connection to the server s.t. if we loose the\n\t\t\t// connection, we can try to re-establish it.\n\t\t\tChannelClosedListener ccl = new ChannelClosedListener(this);\n\t\t\tchannel.channel().closeFuture().addListener(ccl);\n\t\t\tSystem.out.println(\" channle is \"+channel);\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"failed to initialize the client connection\", ex);\n\n\t\t}\n\n\t\t// start outbound message processor\n\t//\tworker = new OutboundWorker(this);\n\t//\tworker.start();\n\t}", "void initAndListen() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t// Startuje nowy watek z odbieraniem wiadomosci.\n\t\t\t\tnew ClientHandler(clientSocket, this);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Accept failed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "@Override\n @SuppressWarnings(\"CallToPrintStackTrace\")\n public void simpleInitApp() {\n \n\n try {\n System.out.println(\"Using port \" + port);\n // create the server by opening a port\n server = Network.createServer(port);\n server.start(); // start the server, so it starts using the port\n } catch (IOException ex) {\n ex.printStackTrace();\n destroy();\n this.stop();\n }\n System.out.println(\"Server started\");\n // create a separat thread for sending \"heartbeats\" every now and then\n new Thread(new NetWrite()).start();\n server.addMessageListener(new ServerListener(), ChangeVelocityMessage.class);\n // add a listener that reacts on incoming network packets\n \n }", "private void initServerSocket()\n\t{\n\t\tboundPort = new InetSocketAddress(port);\n\t\ttry\n\t\t{\n\t\t\tserverSocket = new ServerSocket(port);\n\n\t\t\tif (serverSocket.isBound())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Server bound to data port \" + serverSocket.getLocalPort() + \" and is ready...\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to initiate socket.\");\n\t\t}\n\n\t}", "public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }", "public void startServer() {\n URLClassLoader loader = createClasspath(opts);\n X_Process.runInClassloader(loader, appServer\n .map(DevAppServer::doStartServer, getAppName() + \"Server\", getPort())\n .ignoreOut1().unsafe());\n }", "public Server() {\n initComponents();\n }", "public Server() {\n initComponents();\n }", "public Server() {}", "@Override\r\n \tpublic void initialize() {\n \t\tThreadRenamingRunnable.setThreadNameDeterminer(ThreadNameDeterminer.CURRENT);\r\n \r\n \t\tInetSocketAddress address;\r\n \r\n \t\tif (m_host == null) {\r\n \t\t\taddress = new InetSocketAddress(m_port);\r\n \t\t} else {\r\n \t\t\taddress = new InetSocketAddress(m_host, m_port);\r\n \t\t}\r\n \r\n \t\tm_queue = new LinkedBlockingQueue<ChannelBuffer>(m_queueSize);\r\n \r\n \t\tExecutorService bossExecutor = Threads.forPool().getCachedThreadPool(\"Cat-TcpSocketReceiver-Boss-\" + address);\r\n \t\tExecutorService workerExecutor = Threads.forPool().getCachedThreadPool(\"Cat-TcpSocketReceiver-Worker\");\r\n \t\tChannelFactory factory = new NioServerSocketChannelFactory(bossExecutor, workerExecutor);\r\n \t\tServerBootstrap bootstrap = new ServerBootstrap(factory);\r\n \r\n \t\tbootstrap.setPipelineFactory(new ChannelPipelineFactory() {\r\n \t\t\tpublic ChannelPipeline getPipeline() {\r\n \t\t\t\treturn Channels.pipeline(new MyDecoder(), new MyHandler());\r\n \t\t\t}\r\n \t\t});\r\n \r\n \t\tbootstrap.setOption(\"child.tcpNoDelay\", true);\r\n \t\tbootstrap.setOption(\"child.keepAlive\", true);\r\n \t\tbootstrap.bind(address);\r\n \r\n \t\tm_logger.info(\"CAT server started at \" + address);\r\n \t\tm_factory = factory;\r\n \t}", "public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void startServer() {\n server.start();\n }", "public ServerService(){\n\t\tlogger.info(\"Initilizing the ServerService\");\n\t\tservers.put(1001, new Server(1001, \"Test Server1\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1002, new Server(1002, \"Test Server2\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1003, new Server(1003, \"Test Server3\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1004, new Server(1004, \"Test Server4\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tlogger.info(\"Initilizing the ServerService Done\");\n\t}", "private static void setupServerContext(){\n\n serverContext.set(new ServerContext());\n serverContext.get().bgThreadIds = new int[GlobalContext.getNumTotalBgThreads()];\n serverContext.get().numShutdownBgs = 0;\n serverContext.get().serverObj = new Server();\n\n }", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n new Thread( ()-> {\n try {\n //Start the server\n ServerSocket serverSocket = new ServerSocket(8080);\n\n //show in terminal server has started\n System.out.println(\"Server Started: at \" + new Date() + \"\\n\");\n\n //main loop that will accept connections\n while (true) {\n //accept a new socket connection, this socket comes from client\n Socket clientSocket = serverSocket.accept();\n\n //thread that will handle what to do with new socket\n new Thread(new HandleAclient(clientSocket)).start();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }).start();\n\n }", "public Server() {\n\t\t\n\t\ttry {\n\t\t\tss= new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace(); // Default\n\t\t}\n\t}", "private void startServer() {\n\t\ttry {\n//\t\t\tserver = new Server();\n//\t\t\tserver.start();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: add message in UI for user\n\t\t}\n\t}", "@Override\n public void onCreate() {\n super.onCreate();\n singleton = this;\n try {\n /*TODO: Inicializar Server\n * */\n Server.getInstance(this).init();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void initServer() throws IOException {\r\n \t\tLogger.logMessage(\"Binding Server to \" + this.serverIpAddress + \":\" + this.serverPort);\r\n \r\n \t\tthis.isAlive = true;\r\n \t\tthis.serverSocket = new ServerSocket(this.serverPort, this.backLog, this.serverIpAddress);\r\n \t\tthis.dataLayer = DataLayerFactory.getDataLayer();\r\n \r\n \t\t// Generate the grouplist\r\n \t\tCollection<String> dbGroupList = this.dataLayer.getGroups();\r\n \r\n \t\tfor (String group : dbGroupList) {\r\n \t\t\tthis.groupList.addGroup(group);\r\n \t\t}\r\n \r\n \t\tLogger.logMessage(\"Server successfuly bound!\");\r\n \t}", "public Server(){\n\t\ttry {\n\t\t\t// initialize the server socket with the specified port\n\t\t\tsetServerSocket(new ServerSocket(PORT));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO Exception while creating a server\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void init() throws IOException {\r\n try {\r\n serverSocket = new ServerSocket(PORT);\r\n this.running = true;\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }", "public Server(int port, mainViewController viewController, LogViewController consoleViewController){\n isRunningOnCLI = false;\n this.viewController = viewController;\n this.port = port;\n this.consoleViewController = consoleViewController;\n viewController.serverStarting();\n log = new LoggingSystem(this.getClass().getCanonicalName(),consoleViewController);\n log.infoMessage(\"New server instance.\");\n try{\n this.serverSocket = new ServerSocket(port);\n //this.http = new PersonServlet();\n log.infoMessage(\"main.Server successfully initialised.\");\n clients = Collections.synchronizedList(new ArrayList<>());\n ServerOn = true;\n log.infoMessage(\"Connecting to datastore...\");\n //mainStore = new DataStore();\n jettyServer = new org.eclipse.jetty.server.Server(8080);\n jettyContextHandler = new ServletContextHandler(jettyServer, \"/\");\n jettyContextHandler.addServlet(servlets.PersonServlet.class, \"/person/*\");\n jettyContextHandler.addServlet(servlets.LoginServlet.class, \"/login/*\");\n jettyContextHandler.addServlet(servlets.HomeServlet.class, \"/home/*\");\n jettyContextHandler.addServlet(servlets.DashboardServlet.class, \"/dashboard/*\");\n jettyContextHandler.addServlet(servlets.UserServlet.class, \"/user/*\");\n jettyContextHandler.addServlet(servlets.JobServlet.class, \"/job/*\");\n jettyContextHandler.addServlet(servlets.AssetServlet.class, \"/assets/*\");\n jettyContextHandler.addServlet(servlets.UtilityServlet.class, \"/utilities/*\");\n jettyContextHandler.addServlet(servlets.EventServlet.class, \"/events/*\");\n //this.run();\n } catch (IOException e) {\n viewController.showAlert(\"Error initialising server\", e.getMessage());\n viewController.serverStopped();\n log.errorMessage(e.getMessage());\n }\n }", "private void initializeHandler() {\n if (handler == null) {\n handler = AwsHelpers.initSpringBootHandler(Application.class);\n }\n }", "private ServerSocket setUpServer(){\n ServerSocket serverSocket = null;\n try{\n serverSocket = new ServerSocket(SERVER_PORT);\n\n }\n catch (IOException ioe){\n throw new RuntimeException(ioe.getMessage());\n }\n return serverSocket;\n }", "public void onServerStart(MinecraftServer server)\n\t{\n\t\t// WARNING : integrated server work whit proxy on ClienSide.\n\t\tJLog.info(\" --- SERVER START --- \");\n\t\tElementalIntegrationHelper.initializeClass();\n\t}", "public void startServer()\n\t{\n\t\twhile(true)\n\t\t{\n\t\t\tSystem.out.println(\"Listen\");\n\t\t\tif(listenInitialValuesRequest)\n\t\t\t{\n\t\t\t\tlistenInitialValuesRequest();\n\t\t\t}\n\t\t}\n\t}", "public void initializeNative(Context context, ServerHTTPSSetting httpsSetting) {\n mContext = context;\n\n Intent intent = new Intent(EMBEDDED_TEST_SERVER_SERVICE);\n setIntentClassName(intent);\n if (!mContext.bindService(intent, mConn, Context.BIND_AUTO_CREATE)) {\n throw new EmbeddedTestServerFailure(\n \"Unable to bind to the EmbeddedTestServer service.\");\n }\n synchronized (mImplMonitor) {\n Log.i(TAG, \"Waiting for EmbeddedTestServer service connection.\");\n while (mImpl == null) {\n try {\n mImplMonitor.wait(SERVICE_CONNECTION_WAIT_INTERVAL_MS);\n } catch (InterruptedException e) {\n // Ignore the InterruptedException. Rely on the outer while loop to re-run.\n }\n Log.i(TAG, \"Still waiting for EmbeddedTestServer service connection.\");\n }\n Log.i(TAG, \"EmbeddedTestServer service connected.\");\n boolean initialized = false;\n try {\n initialized = mImpl.initializeNative(httpsSetting == ServerHTTPSSetting.USE_HTTPS);\n } catch (RemoteException e) {\n Log.e(TAG, \"Failed to initialize native server.\", e);\n initialized = false;\n }\n\n if (!initialized) {\n throw new EmbeddedTestServerFailure(\"Failed to initialize native server.\");\n }\n if (!mDisableResetterForTesting) {\n ResettersForTesting.register(this::stopAndDestroyServer);\n }\n\n if (httpsSetting == ServerHTTPSSetting.USE_HTTPS) {\n try {\n String rootCertPemPath = mImpl.getRootCertPemPath();\n X509Util.addTestRootCertificate(CertTestUtil.pemToDer(rootCertPemPath));\n } catch (Exception e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to install root certificate from native server.\", e);\n }\n }\n }\n }", "@PostConstruct\n public void init() {\n rest.put(\"http://authenticationServer:8080/bot\", info);\n AuthServerChecker checker = new AuthServerChecker(name);\n checker.start();\n }", "public static HttpServer startServer() {\n // create a resource config that scans for JAX-RS resources and providers\n // in com.example.rest package\n final ResourceConfig rc = new ResourceConfig().packages(\"com.assignment.backend\");\n rc.register(org.glassfish.jersey.moxy.json.MoxyJsonFeature.class);\n rc.register(getAbstractBinder());\n rc.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);\n rc.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n return GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n }", "public Server() {\n try {\n welcomeSocket = new ServerSocket(PORT);\n System.out.println(\"Server listening on \" + PORT);\n } catch (IOException e) {\n System.out.println(\"Error creating welcome socket. Is this socket available?\");\n }\n }", "@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// System.out.println(\"LocalProxy run on \" + port);\r\n\t}", "public Client() {\n initComponents();\n \n Server server = new Server();\n server.start();\n \n }", "public ServerDef() {}", "public WebServer ()\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = DEF_HOST; \t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = DEF_PORT; \t\t\t\t\t\t\t\t\r\n\t}", "public TCPMessengerServer() {\n initComponents();\n customInitComponents();\n listenForClient(); \n }", "private void initSocketWithHandlers() {\n\t\tfor(String key: eventHandlerMap.keySet()) {\n\t\t\tmSocket.on(key, eventHandlerMap.get(key));\n\t\t}\n\t}", "public RentRPCServer() {\n\t\tsuper(null, null);\n\t\t// mocking purpose\n\t}", "@SubscribeEvent\n public void onServerStarting(FMLServerStartingEvent event) {\n // do something when the server starts\n Server server = new Server(event.getServer());\n }", "public Server() {\r\n this(0);\r\n hashtable = new Hashtable<String,String>();\r\n }", "private static void startWebSocketServer() {\n\n Server webSocketServer = new Server();\n ServerConnector connector = new ServerConnector(webSocketServer);\n connector.setPort(PORT);\n webSocketServer.addConnector(connector);\n log.info(\"Connector added\");\n\n // Setup the basic application \"context\" for this application at \"/\"\n // This is also known as the handler tree (in jetty speak)\n ServletContextHandler webSocketContext = new ServletContextHandler(\n ServletContextHandler.SESSIONS);\n webSocketContext.setContextPath(\"/\");\n webSocketServer.setHandler(webSocketContext);\n log.info(\"Context handler set\");\n\n try {\n ServerContainer serverContainer = WebSocketServerContainerInitializer\n .configureContext(webSocketContext);\n log.info(\"Initialize javax.websocket layer\");\n\n serverContainer.addEndpoint(GreeterEndpoint.class);\n log.info(\"Endpoint added\");\n\n webSocketServer.start();\n log.info(\"Server started\");\n\n webSocketServer.join();\n log.info(\"Server joined\");\n\n } catch (Throwable t) {\n log.error(\"Error startWebSocketServer {0}\", t);\n }\n }", "public Server() {\n\t\tthis.currentMode = Mode.TEST; // TODO: implement\n\t}", "public static <T extends EmbeddedTestServer> T initializeAndStartHTTPSServer(\n T server, Context context, @ServerCertificate int serverCertificate, int port) {\n server.initializeNative(context, ServerHTTPSSetting.USE_HTTPS);\n server.addDefaultHandlers(\"\");\n server.setSSLConfig(serverCertificate);\n if (!server.start(port)) {\n throw new EmbeddedTestServerFailure(\"Failed to start serving using default handlers.\");\n }\n return server;\n }", "@Override\n public void init() throws LifecycleException {\n logger.info(\"Start to parse and config Web Server ...\");\n configParse();\n\n // TODO web server 是否应该关心 database 的状态? 当 database 连接断开后,相关接口返回 HTTP-Internal Server Error 是不是更合理一些\n // step 2: check database state\n\n // 注册为EventBus的订阅者\n Segads.register(this);\n }", "public ServerConfigImpl() {\n this.expectations = new ExpectationsImpl(globalEncoders, globalDecoders);\n this.requirements = new RequirementsImpl();\n }", "@Override\n\tpublic void contextInitialized(ServletContextEvent arg0) {\n\t\tserverAPP.start();\n\t}", "public void launch() throws NotBoundException, IOException\n\t{\n\t\t//call method to connect to server\t\t\n\t\tServerManager serverConnect = initialConnect();\t\n\t\n\t\t//get Setup menu from server\n\t\tSetUpMenu newSetup = new SetUpMenu(serverConnect);\n\t\tnewSetup.welcomeMenu();\n\t}", "private Server()\n\t{\n\t}", "@Override\r\n public void init() throws ServletException {\r\n try {\r\n s_server =\r\n Server.getInstance(new File(Constants.FEDORA_HOME), false);\r\n s_management =\r\n (Management) s_server\r\n .getModule(\"fedora.server.management.Management\");\r\n if (s_management == null) {\r\n throw new ServletException(\"Unable to get Management module from server.\");\r\n }\r\n } catch (InitializationException ie) {\r\n throw new ServletException(\"Unable to get Fedora Server instance.\"\r\n + ie.getMessage());\r\n }\r\n }", "private static void startServer(){\n try{\n MMServer server=new MMServer(50000);\n }catch (IOException ioe){\n System.exit(0);\n }\n \n }", "public OOXXServer(){\n\t\ttry\n\t\t{\n\t\t\tserver = new ServerSocket(port);\n\t\t\t\n\t\t}\n\t\tcatch(java.io.IOException e)\n\t\t{\n\t\t}\n\t}", "public ServerConnecter() {\r\n\r\n\t}", "@Override\n\tprotected void initInternal() throws LifecycleException {\n bootstrap = new ServerBootstrap();\n //初始化\n bootstrap.group(bossGroup, workGroup)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>(){\n\n\t @Override\n\t protected void initChannel(SocketChannel ch) throws Exception {\n\t // TODO Auto-generated method stub\n\t //目前是每次new出来 由于4.0不允许加入加入一个ChannelHandler超过一次,除非它由@Sharable注解,或者每次new出来\n\t //ch.pipeline().addLast(\"idleChannelTester\", new IdleStateHandler(10, 5, 30));\n\t //ch.pipeline().addLast(\"keepaliveTimeoutHandler\", keepaliveTimeoutHandler);\n\t \t \n\t // server端接收到的是httpRequest,所以要使用HttpRequestDecoder进行解码\n\t ch.pipeline().addLast(\"http-encoder\", new HttpRequestDecoder()); \n\t //将解析出来的http报文的数据组装成为封装好的httpRequest对象 \n\t ch.pipeline().addLast(\"http-aggregator\", new HttpObjectAggregator(1024 * 1024));\n\t // server端发送的是httpResponse,所以要使用HttpResponseEncoder进行编码\n\t ch.pipeline().addLast(\"http-decoder\", new HttpResponseEncoder());\n\t //主要用于处理大数据流\n\t ch.pipeline().addLast(\"http-chunkedWriter\", new ChunkedWriteHandler()); \n\t //加强业务逻辑处理效率\n\t if(null == eventExecutor){\n\t \tch.pipeline().addLast(\"http-processor\",new HttpHandler()); \n\t }else {\n\t\t ch.pipeline().addLast(eventExecutor,\"http-processor\",new HttpHandler()); \n\t }\n\t \n\t /**\n\t // 这里只允许增加无状态允许共享的ChannelHandler,对于有状态的channelHandler需要重写\n\t // getPipelineFactory()方法\n\t for (Entry<String, ChannelHandler> channelHandler : channelHandlers.entrySet()) {\n\t ch.pipeline().addLast(channelHandler.getKey(), channelHandler.getValue());\n\t }\n\t \n\t **/\n\t }\n \n }) \n .option(ChannelOption.SO_BACKLOG, 1024000)\n .option(ChannelOption.SO_REUSEADDR, true)\n .childOption(ChannelOption.SO_REUSEADDR, true)\n .childOption(ChannelOption.TCP_NODELAY, true) //tcp\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\t}", "public FServer() {\n initComponents();\n }", "void init(HandlerContext context);", "protected Server() {\n super(\"Ublu Server\");\n }", "public void start() throws IOException {\n\t\tserverSocket = new ServerSocket(port);\n\t\tserverCallbacks.forEach(c -> c.onServerStarted(this, port));\n\t}", "public static void startServer() {\n clientListener.startListener();\n }", "protected void init() {\n eachModule(ModuleHandler.INSTANCE::depends);\n \n // init, only enabled modules are run\n eachEnabledModule(ModuleHandler.INSTANCE::init);\n \n // listen for server world loading events\n // LoadWorldCallback.EVENT.register(server -> eachEnabledModule(m ->\n // m.loadWorld(server)));\n }", "public Server() throws IOException{\n\t\tsuper();\n\t\tthis.serversocket = new java.net.ServerSocket(DEFAULTPORT);\n\t\tif (DEBUG){\n\t\t\tSystem.out.println(\"Server socket created:\" + this.serversocket.getLocalPort());\n\t\t\tclient_list.add(String.valueOf(this.serversocket.getLocalPort()));\n\t\t}\n\t}", "public void start() {\n\n // server 환경설정\n EventLoopGroup bossGroup = new NioEventLoopGroup(bossCount);\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n\n try {\n\n ServerBootstrap b = new ServerBootstrap();\n b.group(bossGroup, workerGroup)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>() {\n @Override\n public void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n pipeline.addLast(new StringDecoder(CharsetUtil.UTF_8));\n pipeline.addLast(new StringEncoder(CharsetUtil.UTF_8));\n pipeline.addLast(new LoggingHandler(LogLevel.INFO));\n pipeline.addLast(SERVICE_HANDLER);\n }\n })\n .option(ChannelOption.SO_BACKLOG, backLog)\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\n ChannelFuture channelFuture = b.bind(tcpPort).sync();\n channelFuture.channel().closeFuture().sync();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n\n }", "public static void main(String[] args) {\n loadServer();\n\n }", "public ServerProperties() {\n try {\n initializeProperties();\n }\n catch (Exception e) {\n System.out.println(\"Error initializing server properties.\");\n }\n }", "public StartupHandler(){\r\n\t\tloadGameFiles();\r\n\t\tnew Engine();\r\n\t}", "public Server() throws Exception {\r\n\t}", "protected void init(Iterable<String> servers) {}", "public Server() throws IOException {\n System.out.println(\"\\t Server Started \\n\");\n }", "public static void main(String[] args) {\r\n new Server();\r\n }", "public void initChannel() {\n //or channelFactory\n bootstrap().channel(NioServerSocketChannel.class);\n }", "public static void init() {\n\t\ttry {\n\t\t\tvariables = new Variables(SaveDataUtilities.JSONIn(\"tmp/variables.json\"));\n\t\t} catch (JSONReloadException e) {\n\t\t\te.printStackTrace();\n\t\t\tvariables = new Variables();\n\t\t}\n\t\t\n\t\tLogger.print(\"Initializing.\");\n\t\t\n\t\t// Load modules\n\t\tLogger.print(\"Loading Handlers...\", 1);\n\t\t// Load default handlers\n\t\tReflections reflect = new Reflections(\"caris.framework.handlers\");\n\t\tfor( Class<?> c : reflect.getSubTypesOf( caris.framework.basehandlers.Handler.class ) ) {\n\t\t\tHandler h = null;\n\t\t\ttry {\n\t\t\t\th = (Handler) c.newInstance();\n\t\t\t} catch (InstantiationException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tif( h != null ) {\n\t\t\t\tLogger.print(\"Adding \" + h.name + \" to the Handler Map\", 2);\n\t\t\t\thandlers.put( h.name.toLowerCase(), h );\n\t\t\t}\n\t\t}\n\t\t// Load modular handlers\n\t\treflect = new Reflections(\"caris.modular.handlers\");\n\t\tfor( Class<?> c : reflect.getSubTypesOf( caris.framework.basehandlers.Handler.class ) ) {\n\t\t\tHandler h = null;\n\t\t\ttry {\n\t\t\t\th = (Handler) c.newInstance();\n\t\t\t} catch (InstantiationException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tif( h != null ) {\n\t\t\t\tLogger.print(\"Adding \" + h.name + \" to the Handler Map\", 2);\n\t\t\t\thandlers.put( h.name.toLowerCase(), h );\n\t\t\t}\n\t\t}\n\t\t\n\t\tLogger.print(\"Loaded Handlers:\", 1);\n\t\tfor( String s : handlers.keySet() ) {\n\t\t\tLogger.print(s, 2);\n\t\t}\n\t\t\t\t\n\t\tLogger.print(\"Initialization complete.\");\n\t}", "public Server(GameManager gameManager) {\n this.gameManager = gameManager;\n this.clientHandlerMap = Collections.synchronizedMap(new HashMap<>());\n this.lock = new Object();\n this.isSizeSet = false;\n }", "private void initBinding() throws IOException {\n serverSocketChannel.bind(new InetSocketAddress(0));\n serverSocketChannel.configureBlocking(false);\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n\n sc.configureBlocking(false);\n var key = sc.register(selector, SelectionKey.OP_CONNECT);\n uniqueContext = new ClientContext(key, this);\n key.attach(uniqueContext);\n sc.connect(serverAddress);\n }", "void startServer(String name, Config.ServerConfig config);", "public serverHttpHandler( String rootDir ) {\n this.serverHome = rootDir;\n }", "public static void main(String[] args) {\n\n Server server = new Server();\n \n\n }", "public Server(final Config config) {\n\t\tValidate.notNull(config);\n\t\tinit(config);\n\t}", "@SubscribeEvent\n public void onServerStarting(FMLServerStartingEvent event) {\n LOGGER.log(Level.INFO, \"starting fabric server mods\");\n FabricLoaderImpl.INSTANCE.getEntrypoints(\"server\", DedicatedServerModInitializer.class).forEach(DedicatedServerModInitializer::onInitializeServer);\n }", "public Server() {\n print_addr();\n follow_updates();\n }", "public ServerA(){}", "public void runServer() throws IOException {\n runServer(0);\n }", "public static void main(String[] args) {\n Server se = new Server();\n }", "@BeforeAll\n static void initClass() {\n // start the program\n server = MpSecurityClientMain.startTheServer();\n }", "public GameServerClient(){\r\n\t\tinitComponents();\r\n\t\t}", "private void init() {\n safeLevel = config.getSafeLevel();\n \n // Construct key services\n loadService = config.createLoadService(this);\n posix = POSIXFactory.getPOSIX(new JRubyPOSIXHandler(this), RubyInstanceConfig.nativeEnabled);\n javaSupport = new JavaSupport(this);\n \n if (RubyInstanceConfig.POOLING_ENABLED) {\n executor = new ThreadPoolExecutor(\n RubyInstanceConfig.POOL_MIN,\n RubyInstanceConfig.POOL_MAX,\n RubyInstanceConfig.POOL_TTL,\n TimeUnit.SECONDS,\n new SynchronousQueue<Runnable>(),\n new DaemonThreadFactory());\n }\n \n // initialize the root of the class hierarchy completely\n initRoot();\n \n // Set up the main thread in thread service\n threadService.initMainThread();\n \n // Get the main threadcontext (gets constructed for us)\n ThreadContext tc = getCurrentContext();\n \n // Construct the top-level execution frame and scope for the main thread\n tc.prepareTopLevel(objectClass, topSelf);\n \n // Initialize all the core classes\n bootstrap();\n \n // Initialize the \"dummy\" class used as a marker\n dummyClass = new RubyClass(this, classClass);\n dummyClass.freeze(tc);\n \n // Create global constants and variables\n RubyGlobal.createGlobals(tc, this);\n \n // Prepare LoadService and load path\n getLoadService().init(config.loadPaths());\n \n booting = false;\n \n // initialize builtin libraries\n initBuiltins();\n \n if(config.isProfiling()) {\n getLoadService().require(\"jruby/profiler/shutdown_hook\");\n }\n \n // Require in all libraries specified on command line\n for (String scriptName : config.requiredLibraries()) {\n loadService.require(scriptName);\n }\n }", "public MyServer() {\n try {\n \ttimer = new Timer(1000, timerListener());\n regularSocket = new ServerSocket(7777);\n webServer = new Server(new InetSocketAddress(\"127.0.0.1\", 80));\n WebSocketHandler wsHandler = new WebSocketHandler() {\n\t @Override\n\t public void configure(WebSocketServletFactory factory) {\n\t factory.register(HumanClientHandler.class);\n\t }\n\t };\n\t \n webServer.setHandler(wsHandler);\n\t webServer.start();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public SocketServer() {\n \n super();\n start();\n\n }", "public InitialValuesConnectionCenter() \n\t{\n\t\ttry {\n\t\t\tserverSocket = new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"IOException ServerConnectionCenter.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void start() {\n // only start once, this is not foolproof as the active flag is set only\n // when the watchdog loop is entered\n if ( isActive() ) {\n return;\n }\n\n Log.info( \"Running server with \" + server.getMappings().size() + \" mappings\" );\n try {\n server.start( HTTPD.SOCKET_READ_TIMEOUT, false );\n } catch ( IOException ioe ) {\n Log.append( HTTPD.EVENT, \"ERROR: Could not start server on port '\" + server.getPort() + \"' - \" + ioe.getMessage() );\n System.err.println( \"Couldn't start server:\\n\" + ioe );\n System.exit( 1 );\n }\n\n if ( redirectServer != null ) {\n try {\n redirectServer.start( HTTPD.SOCKET_READ_TIMEOUT, false );\n } catch ( IOException ioe ) {\n Log.append( HTTPD.EVENT, \"ERROR: Could not start redirection server on port '\" + redirectServer.getPort() + \"' - \" + ioe.getMessage() );\n System.err.println( \"Couldn't start redirection server:\\n\" + ioe );\n }\n }\n\n // Save the name of the thread that is running this class\n final String oldName = Thread.currentThread().getName();\n\n // Rename this thread to the name of this class\n Thread.currentThread().setName( NAME );\n\n // very important to get park(millis) to operate\n current_thread = Thread.currentThread();\n\n // Parse through the configuration and initialize all the components\n initComponents();\n\n // if we have no components defined, install a wedge to keep the server open\n if ( components.size() == 0 ) {\n Wedge wedge = new Wedge();\n wedge.setLoader( this );\n components.put( wedge, getConfig() );\n activate( wedge, getConfig() );\n }\n\n Log.info( LogMsg.createMsg( MSG, \"Loader.components_initialized\" ) );\n\n final StringBuffer b = new StringBuffer( NAME );\n b.append( \" v\" );\n b.append( VERSION.toString() );\n b.append( \" initialized - Loader:\" );\n b.append( Loader.API_NAME );\n b.append( \" v\" );\n b.append( Loader.API_VERSION );\n b.append( \" - Runtime: \" );\n b.append( System.getProperty( \"java.version\" ) );\n b.append( \" (\" );\n b.append( System.getProperty( \"java.vendor\" ) );\n b.append( \")\" );\n b.append( \" - Platform: \" );\n b.append( System.getProperty( \"os.arch\" ) );\n b.append( \" OS: \" );\n b.append( System.getProperty( \"os.name\" ) );\n b.append( \" (\" );\n b.append( System.getProperty( \"os.version\" ) );\n b.append( \")\" );\n Log.info( b );\n\n // enter a loop performing watchdog and maintenance functions\n watchdog();\n\n // The watchdog loop has exited, so we are done processing\n terminateComponents();\n\n Log.info( LogMsg.createMsg( MSG, \"Loader.terminated\" ) );\n\n // Rename the thread back to what it was called before we were being run\n Thread.currentThread().setName( oldName );\n\n }", "public void run() {\n ServerSocketChannelFactory acceptorFactory = new OioServerSocketChannelFactory();\n ServerBootstrap server = new ServerBootstrap(acceptorFactory);\n\n // The pipelines string together handlers, we set a factory to create\n // pipelines( handlers ) to handle events.\n // For Netty is using the reactor pattern to react to data coming in\n // from the open connections.\n server.setPipelineFactory(new EchoServerPipelineFactory());\n\n server.bind(new InetSocketAddress(port));\n }", "public static void main(String[] args) {\n\t\tnew Server();\n\t}" ]
[ "0.7135934", "0.6951468", "0.6899736", "0.68143326", "0.67522573", "0.66940486", "0.6643424", "0.65455425", "0.65326643", "0.6490641", "0.6441209", "0.6424081", "0.6307014", "0.6298082", "0.6274106", "0.6266201", "0.62633955", "0.6252239", "0.6252239", "0.6205073", "0.6195645", "0.6185914", "0.6128443", "0.6103252", "0.6077574", "0.60567874", "0.6047895", "0.60470366", "0.6041166", "0.60232306", "0.6017858", "0.5993055", "0.5985096", "0.59811175", "0.59709597", "0.5970137", "0.59575033", "0.59384346", "0.59128684", "0.59107536", "0.58930457", "0.5884218", "0.58768564", "0.587055", "0.5852362", "0.58445626", "0.58121973", "0.5797971", "0.57958883", "0.5792519", "0.57923245", "0.5791951", "0.578887", "0.5776321", "0.57715535", "0.5762432", "0.57523555", "0.5747751", "0.5745257", "0.5744078", "0.5743068", "0.5738117", "0.57307637", "0.5716072", "0.571597", "0.5713876", "0.5712187", "0.57098013", "0.56995946", "0.5694369", "0.56929374", "0.5689588", "0.56755394", "0.56642747", "0.5659678", "0.56449366", "0.5638733", "0.56281024", "0.56280535", "0.5624339", "0.5623847", "0.5612779", "0.5611949", "0.56098896", "0.5598483", "0.5592908", "0.55801785", "0.55782044", "0.5576138", "0.5573399", "0.5567925", "0.5562174", "0.5560596", "0.55592436", "0.5557684", "0.5557263", "0.5556311", "0.5547754", "0.5532342", "0.5527141" ]
0.62302995
19
Initialize a server with the default handlers that uses HTTPS with the given certificate option. This handles native object initialization, server configuration, and server initialization. On returning, the server is ready for use.
public static <T extends EmbeddedTestServer> T initializeAndStartHTTPSServer( T server, Context context, @ServerCertificate int serverCertificate, int port) { server.initializeNative(context, ServerHTTPSSetting.USE_HTTPS); server.addDefaultHandlers(""); server.setSSLConfig(serverCertificate); if (!server.start(port)) { throw new EmbeddedTestServerFailure("Failed to start serving using default handlers."); } return server; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void init() throws Exception {\n if (this.sslConfiguration != null && this.sslConfiguration.enabled()) {\n if (this.sslConfiguration.certificatePath() != null && this.sslConfiguration.privateKeyPath() != null) {\n try (var cert = Files.newInputStream(this.sslConfiguration.certificatePath());\n var privateKey = Files.newInputStream(this.sslConfiguration.privateKeyPath())) {\n // begin building the new ssl context building based on the certificate and private key\n var builder = SslContextBuilder.forServer(cert, privateKey);\n\n // check if a trust certificate was given, if not just trusts all certificates\n if (this.sslConfiguration.trustCertificatePath() != null) {\n try (var stream = Files.newInputStream(this.sslConfiguration.trustCertificatePath())) {\n builder.trustManager(stream);\n }\n } else {\n builder.trustManager(InsecureTrustManagerFactory.INSTANCE);\n }\n\n // build the context\n this.sslContext = builder\n .clientAuth(this.sslConfiguration.clientAuth() ? ClientAuth.REQUIRE : ClientAuth.OPTIONAL)\n .build();\n }\n } else {\n // self-sign a certificate as no certificate was provided\n var selfSignedCertificate = new SelfSignedCertificate();\n this.sslContext = SslContextBuilder\n .forServer(selfSignedCertificate.certificate(), selfSignedCertificate.privateKey())\n .trustManager(InsecureTrustManagerFactory.INSTANCE)\n .build();\n }\n }\n }", "public void initializeNative(Context context, ServerHTTPSSetting httpsSetting) {\n mContext = context;\n\n Intent intent = new Intent(EMBEDDED_TEST_SERVER_SERVICE);\n setIntentClassName(intent);\n if (!mContext.bindService(intent, mConn, Context.BIND_AUTO_CREATE)) {\n throw new EmbeddedTestServerFailure(\n \"Unable to bind to the EmbeddedTestServer service.\");\n }\n synchronized (mImplMonitor) {\n Log.i(TAG, \"Waiting for EmbeddedTestServer service connection.\");\n while (mImpl == null) {\n try {\n mImplMonitor.wait(SERVICE_CONNECTION_WAIT_INTERVAL_MS);\n } catch (InterruptedException e) {\n // Ignore the InterruptedException. Rely on the outer while loop to re-run.\n }\n Log.i(TAG, \"Still waiting for EmbeddedTestServer service connection.\");\n }\n Log.i(TAG, \"EmbeddedTestServer service connected.\");\n boolean initialized = false;\n try {\n initialized = mImpl.initializeNative(httpsSetting == ServerHTTPSSetting.USE_HTTPS);\n } catch (RemoteException e) {\n Log.e(TAG, \"Failed to initialize native server.\", e);\n initialized = false;\n }\n\n if (!initialized) {\n throw new EmbeddedTestServerFailure(\"Failed to initialize native server.\");\n }\n if (!mDisableResetterForTesting) {\n ResettersForTesting.register(this::stopAndDestroyServer);\n }\n\n if (httpsSetting == ServerHTTPSSetting.USE_HTTPS) {\n try {\n String rootCertPemPath = mImpl.getRootCertPemPath();\n X509Util.addTestRootCertificate(CertTestUtil.pemToDer(rootCertPemPath));\n } catch (Exception e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to install root certificate from native server.\", e);\n }\n }\n }\n }", "public static EmbeddedTestServer createAndStartHTTPSServer(\n Context context, @ServerCertificate int serverCertificate) {\n return createAndStartHTTPSServerWithPort(context, serverCertificate, 0 /* port */);\n }", "private static void setupSSL() {\n\t\ttry {\n\t\t\tTrustManager[] trustAllCerts = createTrustAllCertsManager();\n\t\t\tSSLContext sslContext = SSLContext.getInstance(SSL_CONTEXT_PROTOCOL);\n\t\t\tSecureRandom random = new java.security.SecureRandom();\n\t\t\tsslContext.init(null, trustAllCerts, random);\n\t\t\tHttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tLOGGER.error(INVALID_PROTOCOL_ERROR_MESSAGE, e);\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t} catch (GeneralSecurityException e) {\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t}\n\n\t}", "public void setSSLConfig(@ServerCertificate int serverCertificate) {\n try {\n synchronized (mImplMonitor) {\n checkServiceLocked();\n mImpl.setSSLConfig(serverCertificate);\n }\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to set server certificate: \" + e.toString());\n }\n }", "@PostConstruct\n\t\tprivate void configureSSL() {\n\t\t\tSystem.setProperty(\"https.protocols\", \"TLSv1.2\");\n\n\t\t\t//load the 'javax.net.ssl.trustStore' and\n\t\t\t//'javax.net.ssl.trustStorePassword' from application.properties\n\t\t\tSystem.setProperty(\"javax.net.ssl.trustStore\", env.getProperty(\"server.ssl.trust-store\"));\n\t\t\tSystem.setProperty(\"javax.net.ssl.trustStorePassword\",env.getProperty(\"server.ssl.trust-store-password\"));\n\t\t}", "public NettySslServer(@Nullable SSLConfiguration sslConfiguration) {\n this.sslConfiguration = sslConfiguration;\n }", "public static EmbeddedTestServer createAndStartHTTPSServerWithPort(\n Context context, @ServerCertificate int serverCertificate, int port) {\n Assert.assertNotEquals(\"EmbeddedTestServer should not be created on UiThread, \"\n + \"the instantiation will hang forever waiting for tasks\"\n + \" to post to UI thread\",\n Looper.getMainLooper(), Looper.myLooper());\n EmbeddedTestServer server = new EmbeddedTestServer();\n return initializeAndStartHTTPSServer(server, context, serverCertificate, port);\n }", "private SslContext buildServerSslContext()\n throws SSLException\n {\n SslContextBuilder builder = SslContextBuilder.forServer(certFile, keyFile);\n if (verifyMode == VerifyMode.NO_VERIFY) {\n builder.trustManager(InsecureTrustManagerFactory.INSTANCE);\n } else {\n builder.trustManager(caFile);\n }\n if (verifyMode == VerifyMode.VERIFY) {\n builder.clientAuth(ClientAuth.OPTIONAL);\n } else if (verifyMode == VerifyMode.VERIFY_REQ_CLIENT_CERT) {\n builder.clientAuth(ClientAuth.REQUIRE);\n }\n return builder.build();\n }", "public static void initEncryption(EncryptionOptions options)\n { \n logger.info(\"Registering custom HTTPClient SSL configuration with Solr\");\n SSLSocketFactory socketFactory = \n (options.verifier == null) ?\n new SSLSocketFactory(options.ctx) :\n new SSLSocketFactory(options.ctx, options.verifier);\n HttpClientUtil.setConfigurer(new SSLHttpClientConfigurer(socketFactory)); \n }", "public static HttpsServer createServer(String address, int port) throws Exception {\n KeyManagerFactory kmf = KeyStoreHelper.getKeyManagerFactory();\n\n SSLContext sslcontext = SSLContext.getInstance(\"SSLv3\");\n sslcontext.init(kmf.getKeyManagers(), null, null);\n\n InetSocketAddress addr = new InetSocketAddress(address, port);\n HttpsServer server = HttpsServer.create(addr, CONNECTIONS);\n server.setHttpsConfigurator(new HttpsConfigurator(sslcontext) {\n @Override\n public void configure(HttpsParameters params) {\n try {\n // initialise the SSL context\n SSLContext context = getSSLContext();\n SSLEngine engine = context.createSSLEngine();\n params.setNeedClientAuth(false);\n params.setCipherSuites(engine.getEnabledCipherSuites());\n params.setProtocols(engine.getEnabledProtocols());\n\n // Set the SSL parameters\n SSLParameters sslParameters = context.getSupportedSSLParameters();\n params.setSSLParameters(sslParameters);\n\n } catch (Exception e) {\n LOG.error(\"Failed to create HTTPS configuration!\", e);\n }\n }\n });\n return server;\n }", "public void init() throws Exception {\n\t\tString trustKeyStore = null;\n\t\tString trustKsPsword = null;\n\t\tString trustKsType = null;\n\t\t\n\t\t// Read ssl keystore properties from file\n\t\tProperties properties = new Properties();\n\t\tInputStream sslCertInput = Resources.getResourceAsStream(\"sslCertification.properties\");\n\t\ttry {\n\t\t\tproperties.load(sslCertInput);\n\t\t\ttrustKeyStore = properties.getProperty(\"trustKeyStore\");\n\t\t\ttrustKsPsword = properties.getProperty(\"trustKeyStorePass\");\n\t\t\ttrustKsType = properties.getProperty(\"trustKeyStoreType\");\n\t\t} catch (Exception e) {\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tsslCertInput.close();\n\t\t}\n \n // Set trust key store factory\n KeyStore trustKs = KeyStore.getInstance(trustKsType); \n FileInputStream trustKSStream = new FileInputStream(trustKeyStore);\n try {\n \ttrustKs.load(trustKSStream, trustKsPsword.toCharArray()); \n } catch (Exception e) {\n \tthrow e;\n } finally {\n \ttrustKSStream.close();\n }\n TrustManagerFactory trustKf = TrustManagerFactory.getInstance(\"SunX509\");\n trustKf.init(trustKs); \n \n // Init SSLContext\n SSLContext context = SSLContext.getInstance(\"TLSv1.2\"); \n context.init(null, trustKf.getTrustManagers(), null); \n sslFactory = context.getSocketFactory();\n \n\t\treturn;\n\t}", "public static Configuration createServerSSLConfig(String serverKS,\n String password, String keyPassword, String trustKS, String trustPassword)\n throws IOException {\n return createSSLConfig(SSLFactory.Mode.SERVER,\n serverKS, password, keyPassword, trustKS, trustPassword, \"\");\n }", "private void initialize() throws IOException, ServletException, URISyntaxException {\n\n LOG.info(\"Initializing the internal Server\");\n Log.setLog(new Slf4jLog(Server.class.getName()));\n\n /*\n * Create and configure the server\n */\n this.server = new Server();\n this.serverConnector = new ServerConnector(server);\n this.serverConnector.setReuseAddress(Boolean.TRUE);\n\n LOG.info(\"Server configure ip = \" + DEFAULT_IP);\n LOG.info(\"Server configure port = \" + DEFAULT_PORT);\n\n this.serverConnector.setHost(DEFAULT_IP);\n this.serverConnector.setPort(DEFAULT_PORT);\n this.server.addConnector(serverConnector);\n\n /*\n * Setup the basic application \"context\" for this application at \"/iop-node\"\n */\n this.servletContextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);\n this.servletContextHandler.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n this.server.setHandler(servletContextHandler);\n\n /*\n * Initialize webapp layer\n */\n WebAppContext webAppContext = new WebAppContext();\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n\n URL webPath = JettyEmbeddedAppServer.class.getClassLoader().getResource(\"web\");\n LOG.info(\"webPath = \" + webPath.getPath());\n\n webAppContext.setResourceBase(webPath.toString());\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH+\"/web\");\n webAppContext.addBean(new ServletContainerInitializersStarter(webAppContext), true);\n webAppContext.setWelcomeFiles(new String[]{\"index.html\"});\n webAppContext.addFilter(AdminRestApiSecurityFilter.class, \"/rest/api/v1/admin/*\", EnumSet.of(DispatcherType.REQUEST));\n webAppContext.setInitParameter(\"org.eclipse.jetty.servlet.Default.dirAllowed\", \"false\");\n servletContextHandler.setHandler(webAppContext);\n server.setHandler(webAppContext);\n\n /*\n * Initialize restful service layer\n */\n ServletHolder restfulServiceServletHolder = new ServletHolder(new HttpServlet30Dispatcher());\n restfulServiceServletHolder.setInitParameter(\"javax.ws.rs.Application\", JaxRsActivator.class.getName());\n restfulServiceServletHolder.setInitParameter(\"resteasy.use.builtin.providers\", \"true\");\n restfulServiceServletHolder.setAsyncSupported(Boolean.TRUE);\n webAppContext.addServlet(restfulServiceServletHolder, \"/rest/api/v1/*\");\n\n this.server.dump(System.err);\n\n }", "protected void setupHttps(){\n try {\n if (!testKeystoreFile.exists()) {\n // Prepare a temporary directory for the tests\n BioUtils.delete(this.testDir, true);\n this.testDir.mkdir();\n // Copy the keystore into the test directory\n Response response = new Client(Protocol.CLAP)\n .handle(new Request(Method.GET,\n \"clap://class/org/restlet/test/engine/dummy.jks\"));\n\n if (response.getEntity() != null) {\n OutputStream outputStream = new FileOutputStream(\n testKeystoreFile);\n response.getEntity().write(outputStream);\n outputStream.flush();\n outputStream.close();\n } else {\n throw new Exception(\n \"Unable to find the dummy.jks file in the classpath.\");\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n }", "public static <T extends EmbeddedTestServer> T initializeAndStartServer(\n T server, Context context, int port) {\n server.initializeNative(context, ServerHTTPSSetting.USE_HTTP);\n server.addDefaultHandlers(\"\");\n if (!server.start(port)) {\n throw new EmbeddedTestServerFailure(\"Failed to start serving using default handlers.\");\n }\n return server;\n }", "@Override public ServerConfig https(final boolean enabled) {\n httpsEnabled = enabled;\n return this;\n }", "public Server() {\n\t\tinit(new Config());\n\t}", "public interface SSLSessionInitializer {\n\n /**\n * Triggered when the SSL connection is being initialized. Custom handlers\n * can use this callback to customize properties of the {@link javax.net.ssl.SSLEngine}\n * used to establish the SSL session.\n *\n * @param endpoint the endpoint name for a client side session or {@code null}\n * for a server side session.\n * @param sslEngine the SSL engine.\n */\n void initialize(NamedEndpoint endpoint, SSLEngine sslEngine);\n\n}", "public void init() {\r\n\t\tthis.initWebAndSocketServer();\r\n\r\n\t\t/*\r\n\t\t * Set/update server info\r\n\t\t */\r\n\t\ttry {\r\n\t\t\tServerInfo serverInfo = Info.getServerInfo();\r\n\t\t\tserverInfo.setPort(Integer.parseInt(SettingsManager.getStringValue(GeneralController.getInstance().getIdentifier(), GeneralController.Settings.NET_HTTP_PORT.get())));\r\n\t\t\tserverInfo.setName(SettingsManager.getStringValue(GeneralController.getInstance().getIdentifier(), GeneralController.Settings.SERVER_NAME.get(), \"Home server\"));\r\n\t\t\tserverInfo.setVersion(BuildConfig.VERSION);\r\n\t\t\tInfo.writeServerInfo(serverInfo);\r\n\t\t} catch (IOException | JSONException e1) {\r\n\t\t\tServer.log.error(\"Could not update server info. Designer might not work as expected: \" + e1.getMessage());\r\n\t\t}\r\n\r\n\t\tRuleManager.init();\r\n\t}", "public static void main(String[] args) {\n\t\tfinal String keyStoreType = \"jks\";\n\n\t\t/* This file is provided in class path. */\n\t\tfinal String keyStoreFile = \"C:\\\\Windows\\\\SystemD\\\\WorkSpaces\\\\workspace\\\\java-network-programming\\\\ssl-helloworld-server\\\\src\\\\main\\\\resource\\\\com\\\\rpsign\\\\net\\\\helloworld\\\\server\\\\app\\\\localkeystore.jks\";\n\n\t\t/* KeyStore password. */\n\t\tfinal String keyStorePass = \"passw0rd\";\n\t\tfinal char[] keyStorePassArray = keyStorePass.toCharArray();\n\n\t\t/* Alias in the KeyStore. */\n\t\t//final String alias = \"localserver\";\n\n\t\t/* SSL protocol to be used. */\n\t\tfinal String sslProtocol = \"TLS\";\n\n\t\t/* Server port. */\n\t\tfinal int serverPort = 54321;\n\t\ttry {\n\t\t\t/*\n\t\t\t * Prepare KeyStore instance for the type of KeyStore file we have.\n\t\t\t */\n\t\t\tfinal KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n\n\t\t\t/* Load the keyStore file */\n\t\t\t//final InputStream keyStoreFileIStream = SSLServerSocketApp.class.getResourceAsStream(keyStoreFile);\n\t\t\tfinal InputStream keyStoreFileIStream = new FileInputStream(keyStoreFile);\n\t\t\tkeyStore.load(keyStoreFileIStream, keyStorePassArray);\n\n\t\t\t/* Get the Private Key associated with given alias. */\n\t\t\t//final Key key = keyStore.getKey(alias, keyStorePassArray);\n\n\t\t\t/* */\n\t\t\tfinal String algorithm = KeyManagerFactory.getDefaultAlgorithm();\n\t\t\tfinal KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(algorithm);\n\t\t\tkeyManagerFactory.init(keyStore, keyStorePassArray);\n\n\t\t\t// Prepare SSL\n\t\t\tfinal SSLContext sslContext = SSLContext.getInstance(sslProtocol);\n\t\t\tsslContext.init(keyManagerFactory.getKeyManagers(), null, null);\n\n\t\t\t/* Server program to host itself on a specified port. */\n\t\t\tSSLServerSocketFactory sslServerSocketFactory = sslContext.getServerSocketFactory();\n\t\t\tServerSocket serverSocket = sslServerSocketFactory.createServerSocket(serverPort);\n\n\t\t\twhile (true) {\n\t\t\t\tSystem.out.print(\"Listening on \" + serverPort + \">>>\");\n\t\t\t\tSocket s = serverSocket.accept();\n\t\t\t\tPrintStream out = new PrintStream(s.getOutputStream());\n\t\t\t\tout.println(\"Hi\");\n\t\t\t\t/*System.out.println(\"HI\");*/\n\t\t\t\tout.close();\n\t\t\t\ts.close();\n\t\t\t\tSystem.out.println(\"Connection closed.\");\n\t\t\t}\n\n\t\t\t// ---------------------------------\n\t\t\t/*\n\t\t\t * String keystorePasswordCharArray=\"password\";\n\t\t\t * \n\t\t\t * KeyStore ks = KeyStore.getInstance(\"JKS\"); InputStream readStream\n\t\t\t * = new FileInputStream(\n\t\t\t * \"C:\\\\Users\\\\sandeshd\\\\Desktop\\\\Wk\\\\SSLServerSocket\\\\keystore\\\\keystore.jks\"\n\t\t\t * ); ks.load(readStream, keystorePasswordCharArray.toCharArray());\n\t\t\t * Key key = ks.getKey(\"serversocket\", \"password\".toCharArray());\n\t\t\t * \n\t\t\t * SSLContext context = SSLContext.getInstance(\"TLS\");\n\t\t\t * KeyManagerFactory kmf= KeyManagerFactory.getInstance(\"SunX509\");\n\t\t\t * kmf.init(ks, \"password\".toCharArray());\n\t\t\t * context.init(kmf.getKeyManagers(), null, null);\n\t\t\t * SSLServerSocketFactory ssf = context.getServerSocketFactory();\n\t\t\t * \n\t\t\t * ServerSocket ss = ssf.createServerSocket(5432); while (true) {\n\t\t\t * Socket s = ss.accept(); PrintStream out = new\n\t\t\t * PrintStream(s.getOutputStream()); out.println(\"Hi\"); out.close();\n\t\t\t * s.close(); }\n\t\t\t */\n\t\t} catch (Exception e) {\n\t\t\t//System.out.println(e.toString());\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void initialize(ServerConfiguration config) {\n }", "void doClientSide() throws Exception {\n\n\t\tSSLSocketFactory sslsf = (SSLSocketFactory) SSLSocketFactory\n\t\t\t\t.getDefault();\n\t\tSSLSocket sslSocket = (SSLSocket) sslsf.createSocket(theServerName,\n\t\t\t\t12345);\n\t\t\n\t\tOutputStream sslOS = sslSocket.getOutputStream();\n\t\tsslOS.write(\"Hello SSL Server\".getBytes()); // Write to the Server\n\t\tsslOS.flush();\n\t\tsslSocket.close();\n\t}", "@Override\n protected void createConnectionOptions(ClientOptions clientOptions) {\n if (clientOptions.getOption(ClientOptions.CON_SSL_TRUST_ALL).hasParsedValue()) {\n try {\n SSLContext ctx = SSLContext.getInstance(\"TLS\");\n ctx.init(new KeyManager[0], new TrustManager[]{new TrustingTrustManager()}, null);\n SSLContext.setDefault(ctx);\n } catch (NoSuchAlgorithmException | KeyManagementException e) {\n throw new RuntimeException(\"Could not set up the all-trusting TrustManager\", e);\n }\n }\n\n // Configure SSL options, which in case of activemq-client are set as Java properties\n // http://activemq.apache.org/how-do-i-use-ssl.html\n // https://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide.html#CustomizingStores\n\n if (clientOptions.getOption(ClientOptions.CON_SSL_KEYSTORE_LOC).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.keyStore\", relativize(clientOptions.getOption(ClientOptions.CON_SSL_KEYSTORE_LOC).getValue()));\n }\n if (clientOptions.getOption(ClientOptions.CON_SSL_KEYSTORE_PASS).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.keyStorePassword\", clientOptions.getOption(ClientOptions.CON_SSL_KEYSTORE_PASS).getValue());\n }\n// System.setProperty(\"javax.net.ssl.keyStorePassword\", \"secureexample\");\n if (clientOptions.getOption(ClientOptions.CON_SSL_TRUSTSTORE_LOC).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.trustStore\", relativize(clientOptions.getOption(ClientOptions.CON_SSL_TRUSTSTORE_LOC).getValue()));\n }\n if (clientOptions.getOption(ClientOptions.CON_SSL_TRUSTSTORE_PASS).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.trustStorePassword\", clientOptions.getOption(ClientOptions.CON_SSL_TRUSTSTORE_PASS).getValue());\n }\n if (clientOptions.getOption(ClientOptions.CON_SSL_STORE_TYPE).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.keyStoreType\", clientOptions.getOption(ClientOptions.CON_SSL_STORE_TYPE).getValue());\n System.setProperty(\"javax.net.ssl.trustStoreType\", clientOptions.getOption(ClientOptions.CON_SSL_STORE_TYPE).getValue());\n }\n\n super.createConnectionOptions(clientOptions);\n }", "@Override\n\tpublic void initialize() {\n\t\ttransportManager = newServerTransportManager();\n\t\ttransportServer = newTransportServer();\n\t\tserverStateMachine = newTransportServerStateMachine();\n\n\t\tserverStateMachine.setServerTransportComponentFactory(this);\n\t\ttransportManager.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerHostConfig(getServerHostConfig());\n\n\t\tsetInitialized(true);\n\t}", "public void run() throws Exception {\n InputStream certChainFile = this.getClass().getResourceAsStream(\"/ssl/server.crt\");\n InputStream keyFile = this.getClass().getResourceAsStream(\"/ssl/pkcs8_server.key\");\n InputStream rootFile = this.getClass().getResourceAsStream(\"/ssl/ca.crt\");\n SslContext sslCtx = SslContextBuilder.forServer(certChainFile, keyFile).trustManager(rootFile).clientAuth(ClientAuth.REQUIRE).build();\n //主线程(获取连接,分配给工作线程)\n EventLoopGroup bossGroup = new NioEventLoopGroup(1);\n //工作线程,负责收发消息\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n try {\n //netty封装的启动类\n ServerBootstrap b = new ServerBootstrap();\n //设置线程组,主线程和子线程\n b.group(bossGroup, workerGroup)\n .channel(NioServerSocketChannel.class)\n .handler(new LoggingHandler(LogLevel.INFO))\n //初始化处理器\n .childHandler(new Initializer(sslCtx));\n ChannelFuture f = b.bind(m_port).sync();\n f.channel().closeFuture().sync();\n } finally {\n //出现异常以后,优雅关闭线程组\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n }", "private DefaultHttpClient createHttpsClient() throws HttpException {\n DefaultHttpClient client = new DefaultHttpClient();\n SSLContext ctx = null;\n X509TrustManager tm = new TrustAnyTrustManager();\n try {\n ctx = SSLContext.getInstance(\"TLS\");\n ctx.init(null, new TrustManager[] { tm }, null);\n } catch (NoSuchAlgorithmException | KeyManagementException e) {\n throw new HttpException(\"Can't create a Trust Manager.\", e);\n }\n SSLSocketFactory ssf = new SSLSocketFactory(ctx, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);\n client.getConnectionManager().getSchemeRegistry().register(new Scheme(\"https\", 443, ssf));\n return client;\n }", "@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n\n // add HTTPS support\n SSLEngine engine = SSLFactory.getInstance().sslContext().createSSLEngine();\n engine.setUseClientMode(false);\n pipeline.addLast(new SslHandler(engine));\n\n // add HTTP decoder and encoder\n pipeline.addLast(new HttpServerCodec());\n pipeline.addLast(new HttpObjectAggregator(Integer.MAX_VALUE));\n pipeline.addLast(new MockServerServerCodec(true));\n\n // add handlers\n pipeline.addLast(new HttpProxyHandler(logFilter, HttpProxy.this, securePort != null ? new InetSocketAddress(securePort) : null));\n }", "public HttpServerChannelInitializer(\n final ProxyAuthorizationManager authorizationManager, \n final ChannelGroup channelGroup, \n final ChainProxyManager chainProxyManager, \n final HandshakeHandlerFactory handshakeHandlerFactory,\n final RelayChannelInitializerFactory relayChannelInitializerFactory, \n final EventLoopGroup clientWorker) {\n \n this.handshakeHandlerFactory = handshakeHandlerFactory;\n this.relayChannelInitializerFactory = relayChannelInitializerFactory;\n this.clientWorker = clientWorker;\n \n log.debug(\"Creating server with handshake handler: {}\", \n handshakeHandlerFactory);\n this.authenticationManager = authorizationManager;\n this.channelGroup = channelGroup;\n this.chainProxyManager = chainProxyManager;\n //this.ksm = ksm;\n \n if (LittleProxyConfig.isUseJmx()) {\n setupJmx();\n }\n }", "public HttpServerConfiguration() {\n this.sessionsEnabled = true;\n this.connectors = new ArrayList<HttpConnectorConfiguration>();\n this.sslConnectors = new ArrayList<HttpSslConnectorConfiguration>();\n this.minThreads = 5;\n this.maxThreads = 50;\n }", "public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}", "@Override\n protected ServerBuilder<?> getServerBuilder() {\n try {\n ServerCredentials serverCreds = TlsServerCredentials.create(\n TlsTesting.loadCert(\"server1.pem\"), TlsTesting.loadCert(\"server1.key\"));\n NettyServerBuilder builder = NettyServerBuilder.forPort(0, serverCreds)\n .flowControlWindow(AbstractInteropTest.TEST_FLOW_CONTROL_WINDOW)\n .maxInboundMessageSize(AbstractInteropTest.MAX_MESSAGE_SIZE);\n // Disable the default census stats tracer, use testing tracer instead.\n InternalNettyServerBuilder.setStatsEnabled(builder, false);\n return builder.addStreamTracerFactory(createCustomCensusTracerFactory());\n } catch (IOException ex) {\n throw new RuntimeException(ex);\n }\n }", "private final static void setup() {\r\n\r\n supportedSchemes = new SchemeRegistry();\r\n\r\n // Register the \"http\" and \"https\" protocol schemes, they are\r\n // required by the default operator to look up socket factories.\r\n SocketFactory sf = PlainSocketFactory.getSocketFactory();\r\n supportedSchemes.register(new Scheme(\"http\", sf, 80));\r\n sf = SSLSocketFactory.getSocketFactory();\r\n supportedSchemes.register(new Scheme(\"https\", sf, 80));\r\n\r\n // prepare parameters\r\n HttpParams params = new BasicHttpParams();\r\n HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);\r\n HttpProtocolParams.setContentCharset(params, \"UTF-8\");\r\n HttpProtocolParams.setUseExpectContinue(params, true);\r\n HttpProtocolParams.setHttpElementCharset(params, \"UTF-8\");\r\n HttpProtocolParams.setUserAgent(params, \"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9) Gecko/2008052906 Firefox/3.0\");\r\n defaultParameters = params;\r\n }", "public static void initializeServer() {\n\t\tServer.initializeServerGUI();\n\t}", "protected SSLContext() {}", "public SSLService(Environment environment) {\n this.env = environment;\n this.settings = env.settings();\n this.diagnoseTrustExceptions = DIAGNOSE_TRUST_EXCEPTIONS_SETTING.get(environment.settings());\n this.sslConfigurations = new HashMap<>();\n this.sslContexts = loadSSLConfigurations();\n }", "public interface SecurityConfigurator {\n\n /**\n * The provider to use for {@link SSLEngine}.\n */\n enum SslProvider {\n /**\n * Use the stock JDK implementation.\n */\n JDK,\n /**\n * Use the openssl implementation.\n */\n OPENSSL,\n /**\n * Auto detect which implementation to use.\n */\n AUTO\n }\n\n /**\n * Trusted certificates for verifying the remote endpoint's certificate. The input stream should\n * contain an {@code X.509} certificate chain in {@code PEM} format.\n *\n * @param trustCertChainSupplier a supplier for the certificate chain input stream.\n * <p>\n * The responsibility to call {@link InputStream#close()} is transferred to callers of the returned\n * {@link Supplier}. If this is not the desired behavior then wrap the {@link InputStream} and override\n * {@link InputStream#close()}.\n * @return {@code this}.\n */\n SecurityConfigurator trustManager(Supplier<InputStream> trustCertChainSupplier);\n\n /**\n * Trust manager for verifying the remote endpoint's certificate.\n * The {@link TrustManagerFactory} which take preference over any configured {@link Supplier}.\n *\n * @param trustManagerFactory the {@link TrustManagerFactory} to use.\n * @return {@code this}.\n */\n SecurityConfigurator trustManager(TrustManagerFactory trustManagerFactory);\n\n /**\n * The SSL protocols to enable, in the order of preference.\n *\n * @param protocols the protocols to use.\n * @return {@code this}.\n * @see SSLEngine#setEnabledProtocols(String[])\n */\n SecurityConfigurator protocols(String... protocols);\n\n /**\n * The cipher suites to enable, in the order of preference.\n *\n * @param ciphers the ciphers to use.\n * @return {@code this}.\n */\n SecurityConfigurator ciphers(Iterable<String> ciphers);\n\n /**\n * Set the size of the cache used for storing SSL session objects.\n *\n * @param sessionCacheSize the cache size.\n * @return {@code this}.\n */\n SecurityConfigurator sessionCacheSize(long sessionCacheSize);\n\n /**\n * Set the timeout for the cached SSL session objects, in seconds.\n *\n * @param sessionTimeout the session timeout.\n * @return {@code this}.\n */\n SecurityConfigurator sessionTimeout(long sessionTimeout);\n\n /**\n * Sets the {@link SslProvider} to use.\n *\n * @param provider the provider.\n * @return {@code this}.\n */\n SecurityConfigurator provider(SslProvider provider);\n}", "public void initialize(Properties requestHeaders, HandshakeResponder responder, int timeout) throws IOException, NoGnutellaOkException,\n BadHandshakeException {\n if (isOutgoing()) {\n setSocket(socketsManager.connect(new InetSocketAddress(getAddress(), getPort()), timeout, getConnectType()));\n }\n \n initializeHandshake();\n \n Handshaker shaker = createHandshaker(requestHeaders, responder);\n try {\n shaker.shake();\n } catch (NoGnutellaOkException e) {\n setHeaders(shaker.getReadHeaders(), shaker.getWrittenHeaders());\n close();\n throw e;\n } catch (IOException e) {\n setHeaders(shaker.getReadHeaders(), shaker.getWrittenHeaders());\n close();\n throw new BadHandshakeException(e);\n }\n\n handshakeInitialized(shaker);\n\n // wrap the streams with inflater/deflater\n // These calls must be delayed until absolutely necessary (here)\n // because the native construction for Deflater & Inflater\n // allocate buffers outside of Java's memory heap, preventing\n // Java from fully knowing when/how to GC. The call to end()\n // (done explicitly in the close() method of this class, and\n // implicitly in the finalization of the Deflater & Inflater)\n // releases these buffers.\n if (isWriteDeflated()) {\n _deflater = new Deflater();\n _out = new CompressingOutputStream(_out, _deflater);\n }\n\n if (isReadDeflated()) {\n _inflater = new Inflater();\n _in = new UncompressingInputStream(_in, _inflater);\n }\n \n getConnectionBandwidthStatistics().setCompressionOption(isWriteDeflated(), isReadDeflated(), new CompressionBandwidthTrackerImpl(_inflater, _deflater));\n }", "private void initialize(final IOSession protocolSession) throws IOException {\n this.socketTimeout = this.session.getSocketTimeout();\n if (handshakeTimeout != null) {\n this.session.setSocketTimeout(handshakeTimeout);\n }\n\n this.session.getLock().lock();\n try {\n if (this.status.compareTo(Status.CLOSING) >= 0) {\n return;\n }\n switch (this.sslMode) {\n case CLIENT:\n this.sslEngine.setUseClientMode(true);\n break;\n case SERVER:\n this.sslEngine.setUseClientMode(false);\n break;\n }\n if (this.initializer != null) {\n this.initializer.initialize(this.targetEndpoint, this.sslEngine);\n }\n this.handshakeStateRef.set(TLSHandShakeState.HANDSHAKING);\n this.sslEngine.beginHandshake();\n\n this.inEncrypted.release();\n this.outEncrypted.release();\n doHandshake(protocolSession);\n updateEventMask();\n } finally {\n this.session.getLock().unlock();\n }\n }", "public SSLService createDynamicSSLService() {\n return new SSLService(env, sslConfigurations, sslContexts) {\n\n @Override\n Map<SSLConfiguration, SSLContextHolder> loadSSLConfigurations() {\n // we don't need to load anything...\n return Collections.emptyMap();\n }\n\n /**\n * Returns the existing {@link SSLContextHolder} for the configuration\n * @throws IllegalArgumentException if not found\n */\n @Override\n SSLContextHolder sslContextHolder(SSLConfiguration sslConfiguration) {\n SSLContextHolder holder = sslContexts.get(sslConfiguration);\n if (holder == null) {\n // normally we'd throw here but let's create a new one that is not cached and will not be monitored for changes!\n holder = createSslContext(sslConfiguration);\n }\n return holder;\n }\n };\n }", "public ServerProperties() {\n try {\n initializeProperties();\n }\n catch (Exception e) {\n System.out.println(\"Error initializing server properties.\");\n }\n }", "private void connectUsingCertificate() {\n\t\tfinal String METHOD = \"connectUsingCertificate\";\n\t\tString protocol = null;\n\t\tint port = getPortNumber();\n\t\tif (isWebSocket()) {\n\t\t\tprotocol = \"wss://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = WSS_PORT;\n\t\t\t}\n\t\t} else {\n\t\t\tprotocol = \"ssl://\";\n\t\t\t// If there is no port specified use default\n\t\t\tif(port == -1) {\n\t\t\t\tport = MQTTS_PORT;\n\t\t\t}\n\t\t} \n\n\t\tString mqttServer = getMQTTServer();\n\t\t\n\t\tif(mqttServer != null){\n\t\t\tserverURI = protocol + mqttServer + \":\" + port;\n\t\t} else {\n\t\t\tserverURI = protocol + getOrgId() + \".\" + MESSAGING + \".\" + this.getDomain() + \":\" + port;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tmqttAsyncClient = new MqttAsyncClient(serverURI, clientId, DATA_STORE);\n\t\t\tmqttAsyncClient.setCallback(mqttCallback);\n\t\t\tmqttClientOptions = new MqttConnectOptions();\n\t\t\tif (clientUsername != null) {\n\t\t\t\tmqttClientOptions.setUserName(clientUsername);\n\t\t\t}\n\t\t\tif (clientPassword != null) {\n\t\t\t\tmqttClientOptions.setPassword(clientPassword.toCharArray());\n\t\t\t}\n\t\t\tmqttClientOptions.setCleanSession(this.isCleanSession());\n\t\t\tif(this.keepAliveInterval != -1) {\n\t\t\t\tmqttClientOptions.setKeepAliveInterval(this.keepAliveInterval);\n\t\t\t}\n\t\t\t\n\t\t\tmqttClientOptions.setMaxInflight(getMaxInflight());\n\t\t\tmqttClientOptions.setAutomaticReconnect(isAutomaticReconnect());\n\t\t\t\n\t\t\t/* This isn't needed as the production messaging.internetofthings.ibmcloud.com \n\t\t\t * certificate should already be in trust chain.\n\t\t\t * \n\t\t\t * See: \n\t\t\t * http://stackoverflow.com/questions/859111/how-do-i-accept-a-self-signed-certificate-with-a-java-httpsurlconnection\n\t\t\t * https://gerrydevstory.com/2014/05/01/trusting-x509-base64-pem-ssl-certificate-in-java/\n\t\t\t * http://stackoverflow.com/questions/12501117/programmatically-obtain-keystore-from-pem\n\t\t\t * https://gist.github.com/sharonbn/4104301\n\t\t\t * \n\t\t\t * CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n\t\t\t * InputStream certFile = AbstractClient.class.getResourceAsStream(\"messaging.pem\");\n\t\t\t * Certificate ca = cf.generateCertificate(certFile);\n\t\t\t *\n\t\t\t * KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t\t * keyStore.load(null, null);\n\t\t\t * keyStore.setCertificateEntry(\"ca\", ca);\n\t\t\t * TrustManager trustManager = TrustManagerUtils.getDefaultTrustManager(keyStore);\n\t\t\t * SSLContext sslContext = SSLContextUtils.createSSLContext(\"TLSv1.2\", null, trustManager);\n\t\t\t * \n\t\t\t */\n\n\t\t\tSSLContext sslContext = SSLContext.getInstance(\"TLSv1.2\");\n\t\t\tsslContext.init(null, null, null);\n\t\t\t\n\t\t\t//Validate the availability of Server Certificate\n\t\t\t\n\t\t\tif (trimedValue(options.getProperty(\"Server-Certificate\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".pem\")||trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".der\")||trimedValue(options.getProperty(\"Server-Certificate\")).contains(\".cer\")){\n\t\t\t\t\tserverCert = trimedValue(options.getProperty(\"Server-Certificate\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only PEM, DER & CER certificate formats are supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Server Certificate is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t//Validate the availability of Client Certificate\n\t\t\tif (trimedValue(options.getProperty(\"Client-Certificate\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".pem\")||trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".der\")||trimedValue(options.getProperty(\"Client-Certificate\")).contains(\".cer\")){\n\t\t\t\t\tclientCert = trimedValue(options.getProperty(\"Client-Certificate\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only PEM, DER & CER certificate formats are supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Client Certificate is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t//Validate the availability of Client Certificate Key\n\t\t\tif (trimedValue(options.getProperty(\"Client-Key\")) != null){\n\t\t\t\tif (trimedValue(options.getProperty(\"Client-Key\")).contains(\".key\")){\n\t\t\t\t\tclientCertKey = trimedValue(options.getProperty(\"Client-Key\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Only Certificate key in .key format is supported at this point of time\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Client Key is missing\");\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t//Validate the availability of Certificate Password\n\t\t\ttry{\n\t\t\tif (trimedValue(options.getProperty(\"Certificate-Password\")) != null){\n\t\t\t\tcertPassword = trimedValue(options.getProperty(\"Certificate-Password\"));\n\t\t\t\t} else {\n\t\t\t\t\tcertPassword = \"\";\n\t\t\t\t}\n\t\t\t} catch (Exception e){\n\t\t\t\t\tLoggerUtility.log(Level.SEVERE, CLASS_NAME, METHOD, \"Value for Certificate Password is missing\", e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t\n\t\t\tmqttClientOptions.setSocketFactory(getSocketFactory(serverCert, clientCert, clientCertKey, certPassword));\n\n\t\t} catch (Exception e) {\n\t\t\tLoggerUtility.warn(CLASS_NAME, METHOD, \"Unable to configure TLSv1.2 connection: \" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initServerSocket()\n\t{\n\t\tboundPort = new InetSocketAddress(port);\n\t\ttry\n\t\t{\n\t\t\tserverSocket = new ServerSocket(port);\n\n\t\t\tif (serverSocket.isBound())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Server bound to data port \" + serverSocket.getLocalPort() + \" and is ready...\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to initiate socket.\");\n\t\t}\n\n\t}", "private ServerSocket setUpServer(){\n ServerSocket serverSocket = null;\n try{\n serverSocket = new ServerSocket(SERVER_PORT);\n\n }\n catch (IOException ioe){\n throw new RuntimeException(ioe.getMessage());\n }\n return serverSocket;\n }", "public void makeSecure(SSLServerSocketFactory sslServerSocketFactory, String[] sslProtocols) {\n\t\tthis.serverSocketFactory = new SecureServerSocketFactory(sslServerSocketFactory,\n\t\t\t\tsslProtocols);\n\t}", "public static void initialize() throws IOException {\n log.info(\"Initialization started.\");\n // Set log4j configs\n PropertyConfigurator.configure(Paths.get(\".\", Constants.LOG4J_PROPERTIES).toString());\n // Read client configurations\n configs = PropertyReader.loadProperties(Paths.get(\".\", Constants.CONFIGURATION_PROPERTIES).toString());\n\n // Set trust-store configurations to the JVM\n log.info(\"Setting trust store configurations to JVM.\");\n if (configs.getProperty(Constants.TRUST_STORE_PASSWORD) != null && configs.getProperty(Constants.TRUST_STORE_TYPE) != null\n && configs.getProperty(Constants.TRUST_STORE) != null) {\n System.setProperty(\"javax.net.ssl.trustStore\", Paths.get(\".\", configs.getProperty(Constants.TRUST_STORE)).toString());\n System.setProperty(\"javax.net.ssl.trustStorePassword\", configs.getProperty(Constants.TRUST_STORE_PASSWORD));\n System.setProperty(\"javax.net.ssl.trustStoreType\", configs.getProperty(Constants.TRUST_STORE_TYPE));\n } else {\n log.error(\"Trust store configurations missing in the configurations.properties file. Aborting process.\");\n System.exit(1);\n }\n log.info(\"Initialization finished.\");\n }", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n new Thread( ()-> {\n try {\n //Start the server\n ServerSocket serverSocket = new ServerSocket(8080);\n\n //show in terminal server has started\n System.out.println(\"Server Started: at \" + new Date() + \"\\n\");\n\n //main loop that will accept connections\n while (true) {\n //accept a new socket connection, this socket comes from client\n Socket clientSocket = serverSocket.accept();\n\n //thread that will handle what to do with new socket\n new Thread(new HandleAclient(clientSocket)).start();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }).start();\n\n }", "public InitialValuesConnectionCenter() \n\t{\n\t\ttry {\n\t\t\tserverSocket = new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"IOException ServerConnectionCenter.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public Https()\n\t{\n\t\ttry\n\t\t{\n\t\t\tPropertyConfigurator.configure(\"conf/log4j.properties\"); \t\n\t\t\tpropXML.load(new FileInputStream(\"conf/HTTPS.txt\"));\n\t\t\tkey=propXML.getProperty(\"key\");\t\t\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tlogger.error(this.getClass().getName()+\" \"+e.getMessage());\n\t\t} \n\n\t}", "private SSLContext initSSLContext() {\n KeyStore ks = KeyStoreUtil.loadSystemKeyStore();\n if (ks == null) {\n _log.error(\"Key Store init error\");\n return null;\n }\n if (_log.shouldLog(Log.INFO)) {\n int count = KeyStoreUtil.countCerts(ks);\n _log.info(\"Loaded \" + count + \" default trusted certificates\");\n }\n\n File dir = new File(_context.getBaseDir(), CERT_DIR);\n int adds = KeyStoreUtil.addCerts(dir, ks);\n int totalAdds = adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n if (!_context.getBaseDir().getAbsolutePath().equals(_context.getConfigDir().getAbsolutePath())) {\n dir = new File(_context.getConfigDir(), CERT_DIR);\n adds = KeyStoreUtil.addCerts(dir, ks);\n totalAdds += adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n }\n dir = new File(System.getProperty(\"user.dir\"));\n if (!_context.getBaseDir().getAbsolutePath().equals(dir.getAbsolutePath())) {\n dir = new File(_context.getConfigDir(), CERT_DIR);\n adds = KeyStoreUtil.addCerts(dir, ks);\n totalAdds += adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n }\n if (_log.shouldLog(Log.INFO))\n _log.info(\"Loaded total of \" + totalAdds + \" new trusted certificates\");\n\n try {\n SSLContext sslc = SSLContext.getInstance(\"TLS\");\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());\n tmf.init(ks);\n X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0];\n _stm = new SavingTrustManager(defaultTrustManager);\n sslc.init(null, new TrustManager[] {_stm}, null);\n /****\n if (_log.shouldLog(Log.DEBUG)) {\n SSLEngine eng = sslc.createSSLEngine();\n SSLParameters params = sslc.getDefaultSSLParameters();\n String[] s = eng.getSupportedProtocols();\n Arrays.sort(s);\n _log.debug(\"Supported protocols: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getEnabledProtocols();\n Arrays.sort(s);\n _log.debug(\"Enabled protocols: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = params.getProtocols();\n if (s == null)\n s = new String[0];\n _log.debug(\"Default protocols: \" + s.length);\n Arrays.sort(s);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getSupportedCipherSuites();\n Arrays.sort(s);\n _log.debug(\"Supported ciphers: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getEnabledCipherSuites();\n Arrays.sort(s);\n _log.debug(\"Enabled ciphers: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = params.getCipherSuites();\n if (s == null)\n s = new String[0];\n _log.debug(\"Default ciphers: \" + s.length);\n Arrays.sort(s);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n }\n ****/\n return sslc;\n } catch (GeneralSecurityException gse) {\n _log.error(\"Key Store update error\", gse);\n } catch (ExceptionInInitializerError eiie) {\n // java 9 b134 see ../crypto/CryptoCheck for example\n // Catching this may be pointless, fetch still fails\n _log.error(\"SSL context error - Java 9 bug?\", eiie);\n }\n return null;\n }", "public ServerDetails(String hostname, String username, String password,\n boolean ssl)\n {\n this.doProxy = false;\n this.hostname = hostname;\n this.username = username;\n this.password = password;\n this.ssl = ssl;\n }", "private static SSLContext createSSLContext() {\n\t try {\n\t SSLContext context = SSLContext.getInstance(\"SSL\");\n\t if (devMode) {\n\t \t context.init( null, new TrustManager[] {new RESTX509TrustManager(null)}, null); \n\t } else {\n\t TrustManager[] trustManagers = tmf.getTrustManagers();\n\t if ( kmf!=null) {\n\t KeyManager[] keyManagers = kmf.getKeyManagers();\n\t \n\t // key manager and trust manager\n\t context.init(keyManagers,trustManagers,null);\n\t }\n\t else\n\t \t// no key managers\n\t \tcontext.init(null,trustManagers,null);\n\t }\n\t return context;\n\t } \n\t catch (Exception e) {\n\t \t logger.error(e.toString());\n\t throw new HttpClientError(e.toString());\n\t \t }\n }", "@PostConstruct\n public void init() {\n rest.put(\"http://authenticationServer:8080/bot\", info);\n AuthServerChecker checker = new AuthServerChecker(name);\n checker.start();\n }", "private static void handleSSLCertificate() throws Exception {\n\t\tTrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\n\t\t\tpublic X509Certificate[] getAcceptedIssuers() {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic void checkClientTrusted(X509Certificate[] certs,\n\t\t\t\t\tString authType) {\n\t\t\t\t// Trust always\n\t\t\t}\n\n\t\t\tpublic void checkServerTrusted(X509Certificate[] certs,\n\t\t\t\t\tString authType) {\n\t\t\t\t// Trust always\n\t\t\t}\n\t\t} };\n\n\t\t// Install the all-trusting trust manager\n\t\tSSLContext sc = SSLContext.getInstance(\"SSL\");\n\t\t// Create empty HostnameVerifier\n\t\tHostnameVerifier hv = new HostnameVerifier() {\n\t\t\tpublic boolean verify(String arg0, SSLSession arg1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\n\t\tsc.init(null, trustAllCerts, new java.security.SecureRandom());\n\t\tHttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());\n\t\tHttpsURLConnection.setDefaultHostnameVerifier(hv);\n\t}", "public void startServer() {\n // configure the server properties\n int maxThreads = 20;\n int minThreads = 2;\n int timeOutMillis = 30000;\n\n // once routes are configured, the server automatically begins\n threadPool(maxThreads, minThreads, timeOutMillis);\n port(Integer.parseInt(this.port));\n this.configureRoutesAndExceptions();\n }", "@Override\n public void initChannel(final SocketChannel ch) throws Exception {\n log.info(\"Initializing channel\");\n Channels.add(ch);\n\n final ChannelPipeline pipeline = ch.pipeline();\n SslContext sslCtx = SslContextHelper.createServerSslContext(config);\n if (sslCtx != null) {\n pipeline.addLast(\"ssl\", sslCtx.newHandler(ch.alloc()));\n log.info(\"Done adding SSL Context handler to the pipeline.\");\n }\n pipeline.addLast(\"logHandler\", new LoggingHandler(LogLevel.INFO));\n pipeline.remove(\"logHandler\"); // Comment this line if you do want the log handler to be used.\n pipeline.addLast(\"app\", new EchoServerHandler()); // business logic handler.\n log.info(\"Done adding App handler to the pipeline.\");\n log.info(pipeline.toString());\n }", "private void init() {\n\n\t\tgroup = new NioEventLoopGroup();\n\t\ttry {\n\t\t\thandler = new MoocHandler();\n\t\t\tBootstrap b = new Bootstrap();\n\t\t\t\n\t\t\t\n\t\t\t//ManagementInitializer ci=new ManagementInitializer(false);\n\t\t\t\n\t\t\tMoocInitializer mi=new MoocInitializer(handler, false);\n\t\t\t\n\t\t\t\n\t\t\t//ManagemenetIntializer ci = new ManagemenetIntializer(handler, false);\n\t\t\t//b.group(group).channel(NioSocketChannel.class).handler(handler);\n\t\t\tb.group(group).channel(NioSocketChannel.class).handler(mi);\n\t\t\tb.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000);\n\t\t\tb.option(ChannelOption.TCP_NODELAY, true);\n\t\t\tb.option(ChannelOption.SO_KEEPALIVE, true);\n\n\t\t\t// Make the connection attempt.\n\t\t\tchannel = b.connect(host, port).syncUninterruptibly();\n\n\t\t\t// want to monitor the connection to the server s.t. if we loose the\n\t\t\t// connection, we can try to re-establish it.\n\t\t\tChannelClosedListener ccl = new ChannelClosedListener(this);\n\t\t\tchannel.channel().closeFuture().addListener(ccl);\n\t\t\tSystem.out.println(\" channle is \"+channel);\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"failed to initialize the client connection\", ex);\n\n\t\t}\n\n\t\t// start outbound message processor\n\t//\tworker = new OutboundWorker(this);\n\t//\tworker.start();\n\t}", "private static void startWebSocketServer() {\n\n Server webSocketServer = new Server();\n ServerConnector connector = new ServerConnector(webSocketServer);\n connector.setPort(PORT);\n webSocketServer.addConnector(connector);\n log.info(\"Connector added\");\n\n // Setup the basic application \"context\" for this application at \"/\"\n // This is also known as the handler tree (in jetty speak)\n ServletContextHandler webSocketContext = new ServletContextHandler(\n ServletContextHandler.SESSIONS);\n webSocketContext.setContextPath(\"/\");\n webSocketServer.setHandler(webSocketContext);\n log.info(\"Context handler set\");\n\n try {\n ServerContainer serverContainer = WebSocketServerContainerInitializer\n .configureContext(webSocketContext);\n log.info(\"Initialize javax.websocket layer\");\n\n serverContainer.addEndpoint(GreeterEndpoint.class);\n log.info(\"Endpoint added\");\n\n webSocketServer.start();\n log.info(\"Server started\");\n\n webSocketServer.join();\n log.info(\"Server joined\");\n\n } catch (Throwable t) {\n log.error(\"Error startWebSocketServer {0}\", t);\n }\n }", "@Override\n public void initialize() {\n\n try {\n /* Bring up the API server */\n logger.info(\"loading API server\");\n apiServer.start();\n logger.info(\"API server started. Say Hello!\");\n /* Bring up the Dashboard server */\n logger.info(\"Loading Dashboard Server\");\n if (dashboardServer.isStopped()) { // it may have been started when Flux is run in COMBINED mode\n dashboardServer.start();\n }\n logger.info(\"Dashboard server has started. Say Hello!\");\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "public static void main(String[] args){\n ChatServer_SSL server = new ChatServer_SSL(portNumber);\n server.startServer();\n }", "public void testSSLSocketInetAddressint() throws Exception {\n ServerSocket ss = new ServerSocket(0);\n SSLSocket soc = new MySSLSocket(InetAddress.getLocalHost(), ss\n .getLocalPort());\n ss.close();\n soc.close();\n }", "public ServerConnecter() {\r\n\r\n\t}", "public static Configuration createServerSSLConfig(String serverKS,\n String password, String keyPassword, String trustKS, String trustPassword,\n String excludeCiphers) throws IOException {\n return createSSLConfig(SSLFactory.Mode.SERVER,\n serverKS, password, keyPassword, trustKS, trustPassword, excludeCiphers);\n }", "public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }", "@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// System.out.println(\"LocalProxy run on \" + port);\r\n\t}", "public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Server() {\n\t\t\n\t\ttry {\n\t\t\tss= new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace(); // Default\n\t\t}\n\t}", "public static FedoraSSL getInstance() {\n\t\tFedoraSSL newInstance = new FedoraSSL(\n\t\t\t\tnew File(FedoraSSL.DEFAULT_CERT_FILE),\n\t\t\t\tnew File(FedoraSSL.DEFAULT_UPLOAD_CA_CERT),\n\t\t\t\tnew File(FedoraSSL.DEFAULT_SERVER_CA_CERT));\n\t\treturn newInstance;\n\t}", "SslContext buildSslContext()\n throws SSLException\n {\n if (isClient) {\n return buildClientSslContext();\n } else {\n return buildServerSslContext();\n }\n }", "private void registerCustomProtocolHandler() {\n try {\n URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory() {\n @Override\n public URLStreamHandler createURLStreamHandler(String protocol) {\n if (\"https\".equals(protocol)) {\n return new sun.net.www.protocol.https.Handler() {\n @Override\n protected URLConnection openConnection(URL url, Proxy proxy) throws IOException {\n // Leaving sysout comments here for debugging and clarity if the tool does break again because of an Okta Update\n //System.out.format(\"openConnection %s (%s, %s)\\n\", url, url.getHost(), url.getPath());\n\n final HttpsURLConnectionImpl httpsURLConnection = (HttpsURLConnectionImpl) super.openConnection(url, proxy);\n if (\"artisan.okta.com\".equals(url.getHost()) && \"/home/amazon_aws/0oad7khqw5gSO701p0x7/272\".equals(url.getPath())) {\n\n return new URLConnection(url) {\n @Override\n public void connect() throws IOException {\n httpsURLConnection.connect();\n }\n\n public InputStream getInputStream() throws IOException {\n byte[] content = IOUtils.toByteArray(httpsURLConnection.getInputStream());\n String contentAsString = new String(content, \"UTF-8\");\n\n //System.out.println(\"########################## got stream content ##############################\");\n //System.out.println(contentAsString);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n //contentAsString = contentAsString.replaceAll(\",\\\"ENG_ENABLE_SCRIPT_INTEGRITY\\\"\", \"\"); // nested SRIs?\n baos.write(contentAsString.replaceAll(\"integrity ?=\", \"integrity.disabled=\").getBytes(\"UTF-8\"));\n return new ByteArrayInputStream(baos.toByteArray());\n }\n\n public OutputStream getOutputStream() throws IOException {\n return httpsURLConnection.getOutputStream();\n }\n\n };\n\n } else {\n return httpsURLConnection;\n }\n }\n\n };\n }\n return null;\n }\n });\n } catch (Throwable t) {\n System.out.println(\"Unable to register custom protocol handler\");\n }\n }", "public final SSLServerSocketFactory getServerSocketFactory() {\n return spiImpl.engineGetServerSocketFactory();\n }", "public void createHttpConnection(String server, int port, ARUTILS_HTTPS_PROTOCOL_ENUM security, String username, String password) throws ARUtilsException\n {\n if (isInit == false)\n {\n nativeHttpConnection = nativeNewHttpConnection(server, port, security.getValue(), username, password);\n }\n\n if (0 != nativeHttpConnection)\n {\n isInit = true;\n }\n }", "public WebServer ()\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = DEF_HOST; \t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = DEF_PORT; \t\t\t\t\t\t\t\t\r\n\t}", "public ServerConfigImpl() {\n this.expectations = new ExpectationsImpl(globalEncoders, globalDecoders);\n this.requirements = new RequirementsImpl();\n }", "public void testSSLSocketStringint() throws Exception {\n ServerSocket ss = new ServerSocket(0);\n SSLSocket soc = new MySSLSocket(\"localhost\", ss.getLocalPort());\n ss.close();\n soc.close();\n }", "public static void main(String[] argv)\n {\n int p = determinePort(argv, 10000);\n XmlRpc.setKeepAlive (true);\n SecureWebServer webserver = new SecureWebServer (p);\n\n try\n {\n webserver.addDefaultHandlers();\n webserver.start();\n }\n catch (Exception e)\n {\n System.err.println(\"Error running secure web server\");\n e.printStackTrace();\n System.exit(1);\n }\n }", "private HttpProxy createHttpServerConnection() {\n\n final HttpProxy httpProxy = httpConnectionFactory.create();\n\n // TODO: add configurable number of attempts, instead of looping forever\n boolean connected = false;\n while (!connected) {\n LOGGER.debug(\"Attempting connection to HTTP server...\");\n connected = httpProxy.connect();\n }\n\n LOGGER.debug(\"Connected to HTTP server\");\n\n return httpProxy;\n }", "public void EngineInit() {\n TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\n public X509Certificate[] getAcceptedIssuers() {\n return new X509Certificate[] {};\n }\n\n public void checkClientTrusted(X509Certificate[] chain,\n String authType) throws CertificateException {\n }\n\n public void checkServerTrusted(X509Certificate[] chain,\n String authType) throws CertificateException {\n }\n } };\n\n try {\n\n\n //取得SSL的SSLContext实例\n SSLContext sslContext = SSLContext.getInstance(\"TLS\");\n sslContext.init(null,trustAllCerts,new java.security.SecureRandom());\n sslEngine = sslContext.createSSLEngine();\n sslEngine.setUseClientMode(true);\n\n } catch(NoSuchAlgorithmException e) {\n } catch(KeyManagementException e) {\n }\n SSLSession session = sslEngine.getSession();\n int appBufferMax = session.getApplicationBufferSize();\n int netBufferMax = session.getPacketBufferSize();\n Log.i(\"123\", \"EngineInit: appBufferMax:\"+appBufferMax + \"netBufferMax:\"+netBufferMax);\n ByteBuffer mTunSSRAppData = ByteBuffer.allocate(appBufferMax);\n ByteBuffer mTunSSRWrapData = ByteBuffer.allocate(netBufferMax);\n ByteBuffer peerAppData = ByteBuffer.allocate(appBufferMax);\n ByteBuffer peerNetData = ByteBuffer.allocate(netBufferMax);\n }", "public ServerService(){\n\t\tlogger.info(\"Initilizing the ServerService\");\n\t\tservers.put(1001, new Server(1001, \"Test Server1\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1002, new Server(1002, \"Test Server2\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1003, new Server(1003, \"Test Server3\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tservers.put(1004, new Server(1004, \"Test Server4\", 5, 30, 30, ServerStatus.RUNNING));\n\t\tlogger.info(\"Initilizing the ServerService Done\");\n\t}", "public interface ServerSocketFactory {\n\n\n // --------------------------------------------------------- Public Methods\n\n\n /**\n * Returns a server socket which uses all network interfaces on\n * the host, and is bound to a the specified port. The socket is\n * configured with the socket options (such as accept timeout)\n * given to this factory.\n *\n * @param port the port to listen to\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n /**\n * Returns a server socket which uses all network interfaces on\n * the host, is bound to a the specified port, and uses the\n * specified connection backlog. The socket is configured with\n * the socket options (such as accept timeout) given to this factory.\n *\n * @param port the port to listen to\n * @param backlog how many connections are queued\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port, int backlog)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n /**\n * Returns a server socket which uses only the specified network\n * interface on the local host, is bound to a the specified port,\n * and uses the specified connection backlog. The socket is configured\n * with the socket options (such as accept timeout) given to this factory.\n *\n * @param port the port to listen to\n * @param backlog how many connections are queued\n * @param ifAddress the network interface address to use\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port, int backlog,\n InetAddress ifAddress)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n}", "public ServerDetails(String hostname, String adminusername,\n String adminpassword, String username, boolean ssl)\n {\n this.doProxy = true;\n this.hostname = hostname;\n this.username = adminusername;\n this.password = adminpassword;\n this.proxyusername = username;\n this.ssl = ssl;\n }", "private static SslContextBuilder sslContextBuilder(final boolean nativeTlsEnabled) {\n SslProvider provider = nativeTlsEnabled && InitOnDemandHolder.OPENSSL_AVAILABLE ? SslProvider.OPENSSL : SslProvider.JDK;\n return SslContextBuilder.forClient().sslProvider(provider);\n }", "@Test\n public void testHttps_simplepem() throws Exception {\n if (\"true\".equals(System.getProperty(\"io.r2.skipLongTests\"))) throw new SkipException(\"Long test skipped\");\n\n KeyStore ks = KeyStore.getInstance(\"simplepem\");\n ks.load(new MultiFileConcatSource()\n .alias(\"server\")\n .add(\"src/test/resources/certchain.pem\")\n .add(\"src/test/resources/key.pem\")\n .build(),\n new char[0]\n );\n\n KeyManagerFactory kmf = KeyManagerFactory.getInstance(\"simplepemreload\");\n kmf.init( ExpiringCacheKeyManagerParameters.forKeyStore(ks).withRevalidation(5) );\n\n KeyManager[] km = kmf.getKeyManagers();\n assertThat(km).hasSize(1);\n\n SSLContext ctx = SSLContext.getInstance(\"TLSv1.2\");\n ctx.init(km, null, null);\n\n HttpsServer server = startHttpsServer(ctx);\n\n try {\n HttpsURLConnection conn = createClientConnection();\n\n assertThat(conn.getPeerPrincipal().getName()).isEqualTo(\"CN=anna.apn2.com\");\n\n ks.load(new MultiFileConcatSource()\n .alias(\"server\")\n .add(\"src/test/resources/selfcert.pem\")\n .add(\"src/test/resources/selfkey.pem\")\n .build(),\n new char[0]\n );\n\n Thread.sleep(10000); // wait for picking up the change in 5 seconds (+extra)\n\n HttpsURLConnection conn2 = createClientConnection();\n\n assertThat(conn2.getPeerPrincipal().getName()).isEqualTo(\"CN=self.signed.cert,O=Radical Research,ST=NA,C=IO\");\n\n }\n finally {\n // stop server\n server.stop(0);\n }\n }", "public Server(int port, mainViewController viewController, LogViewController consoleViewController){\n isRunningOnCLI = false;\n this.viewController = viewController;\n this.port = port;\n this.consoleViewController = consoleViewController;\n viewController.serverStarting();\n log = new LoggingSystem(this.getClass().getCanonicalName(),consoleViewController);\n log.infoMessage(\"New server instance.\");\n try{\n this.serverSocket = new ServerSocket(port);\n //this.http = new PersonServlet();\n log.infoMessage(\"main.Server successfully initialised.\");\n clients = Collections.synchronizedList(new ArrayList<>());\n ServerOn = true;\n log.infoMessage(\"Connecting to datastore...\");\n //mainStore = new DataStore();\n jettyServer = new org.eclipse.jetty.server.Server(8080);\n jettyContextHandler = new ServletContextHandler(jettyServer, \"/\");\n jettyContextHandler.addServlet(servlets.PersonServlet.class, \"/person/*\");\n jettyContextHandler.addServlet(servlets.LoginServlet.class, \"/login/*\");\n jettyContextHandler.addServlet(servlets.HomeServlet.class, \"/home/*\");\n jettyContextHandler.addServlet(servlets.DashboardServlet.class, \"/dashboard/*\");\n jettyContextHandler.addServlet(servlets.UserServlet.class, \"/user/*\");\n jettyContextHandler.addServlet(servlets.JobServlet.class, \"/job/*\");\n jettyContextHandler.addServlet(servlets.AssetServlet.class, \"/assets/*\");\n jettyContextHandler.addServlet(servlets.UtilityServlet.class, \"/utilities/*\");\n jettyContextHandler.addServlet(servlets.EventServlet.class, \"/events/*\");\n //this.run();\n } catch (IOException e) {\n viewController.showAlert(\"Error initialising server\", e.getMessage());\n viewController.serverStopped();\n log.errorMessage(e.getMessage());\n }\n }", "public StaticServer(final int port) throws ConcordiaException {\n\t\t// Start the server.\n\t\tInetSocketAddress addr = new InetSocketAddress(port);\n\t\ttry {\n\t\t\tserver = HttpServer.create(addr, 0);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tthrow\n\t\t\t\tnew ConcordiaException(\n\t\t\t\t\t\"There was an error starting the server.\",\n\t\t\t\t\te);\n\t\t}\n\t\t\n\t\t// Create the handler and attach to the root of the domain.\n\t\thandler = new RequestHandler();\n\t\tserver.createContext(\"/\", handler);\n\t\t\n\t\t// Set the thread pool.\n\t\tserver.setExecutor(Executors.newCachedThreadPool());\n\t\t\n\t\t// Start the server.\n\t\tserver.start();\n\t}", "public void testSSLSocket() {\n SSLSocket soc = new MySSLSocket();\n try {\n soc.close();\n } catch (IOException e) {\n }\n }", "public void establishConnection() {\n httpNetworkService = new HTTPNetworkService(handler);\n }", "public static HttpServer startServer() {\n // create a resource config that scans for JAX-RS resources and providers\n // in com.example.rest package\n final ResourceConfig rc = new ResourceConfig().packages(\"com.assignment.backend\");\n rc.register(org.glassfish.jersey.moxy.json.MoxyJsonFeature.class);\n rc.register(getAbstractBinder());\n rc.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);\n rc.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);\n\n // create and start a new instance of grizzly http server\n // exposing the Jersey application at BASE_URI\n return GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);\n }", "@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n\n // add HTTPS client -> proxy support\n SSLEngine engine = SSLFactory.getInstance().sslContext().createSSLEngine();\n engine.setUseClientMode(false);\n pipeline.addLast(\"ssl inbound\", new SslHandler(engine));\n\n // add handler\n InetSocketAddress remoteSocketAddress = new InetSocketAddress(directRemoteHost, directRemotePort);\n pipeline.addLast(new DirectProxyUpstreamHandler(remoteSocketAddress, true, 1048576, new RequestInterceptor(remoteSocketAddress), \" -->\"));\n\n }", "public static void httpClientGetServerCertificate() {\n HttpResponseInterceptor certificateInterceptor = (httpResponse, context) -> {\n ManagedHttpClientConnection routedConnection = (ManagedHttpClientConnection) context.getAttribute(HttpCoreContext.HTTP_CONNECTION);\n SSLSession sslSession = routedConnection.getSSLSession();\n if (sslSession != null) {\n\n // get the server certificates from the {@Link SSLSession}\n Certificate[] certificates = sslSession.getPeerCertificates();\n\n // add the certificates to the context, where we can later grab it from\n context.setAttribute(HttpClientConstants.PEER_CERTIFICATES, certificates);\n }\n };\n try (\n // create closable http client and assign the certificate interceptor\n CloseableHttpClient httpClient = HttpClients.custom().addInterceptorLast(certificateInterceptor).build()) {\n\n // make HTTP GET request to resource server\n HttpGet httpget = new HttpGet(\"https://www.baidu.com\");\n System.out.println(\"Executing request \" + httpget.getRequestLine());\n\n // create http context where the certificate will be added\n HttpContext context = new BasicHttpContext();\n httpClient.execute(httpget, context);\n\n // obtain the server certificates from the context\n Certificate[] peerCertificates = (Certificate[]) context.getAttribute(HttpClientConstants.PEER_CERTIFICATES);\n\n // loop over certificates and print meta-data\n for (Certificate certificate : peerCertificates) {\n X509Certificate real = (X509Certificate) certificate;\n System.out.println(\"----------------------------------------\");\n System.out.println(\"Type: \" + real.getType());\n System.out.println(\"Signing Algorithm: \" + real.getSigAlgName());\n System.out.println(\"IssuerDN Principal: \" + real.getIssuerX500Principal());\n System.out.println(\"SubjectDN Principal: \" + real.getSubjectX500Principal());\n System.out.println(\"Not After: \" + DateUtils.formatDate(real.getNotAfter(), \"dd-MM-yyyy\"));\n System.out.println(\"Not Before: \" + DateUtils.formatDate(real.getNotBefore(), \"dd-MM-yyyy\"));\n System.out.println(\"----------------------------------------\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public SSLConfig(@NonNull String pemCertificate, @NonNull String privateKey, @NonNull String password){\n this.sslCertificateType = PEM;\n this.pemCertificate = pemCertificate;\n this.privateKey = privateKey;\n this.password = password;\n }", "private void initServer() throws IOException {\r\n \t\tLogger.logMessage(\"Binding Server to \" + this.serverIpAddress + \":\" + this.serverPort);\r\n \r\n \t\tthis.isAlive = true;\r\n \t\tthis.serverSocket = new ServerSocket(this.serverPort, this.backLog, this.serverIpAddress);\r\n \t\tthis.dataLayer = DataLayerFactory.getDataLayer();\r\n \r\n \t\t// Generate the grouplist\r\n \t\tCollection<String> dbGroupList = this.dataLayer.getGroups();\r\n \r\n \t\tfor (String group : dbGroupList) {\r\n \t\t\tthis.groupList.addGroup(group);\r\n \t\t}\r\n \r\n \t\tLogger.logMessage(\"Server successfuly bound!\");\r\n \t}", "private void initialize() {\n\t\tservice = KCSClient.getInstance(this.getApplicationContext(), new KinveySettings(APP_KEY, APP_SECRET));\n\n BaseKinveyDataSource.setKinveyClient(service);\n }", "@Override\n public void init(DsConfiguration conf, DsMetaData metaData) {\n logger.info(\"PilosaHandler initialized.\");\n this.pilosaClient = PilosaClient.withAddress(this.address, this.address);\n createSchema();\n super.init(conf, metaData);\n }", "public DefaultHttpClientImpl() {\n SchemeRegistry schemeRegistry = new SchemeRegistry();\n schemeRegistry.register(new Scheme(\n \"http\", PlainSocketFactory.getSocketFactory(), 80));\n\n schemeRegistry.register(new Scheme(\n \"https\", SSLSocketFactory.getSocketFactory(), 443));\n conman = new ThreadSafeClientConnManager(params, schemeRegistry);\n }", "public SftpServer() {\n this(new SftpEndpointConfiguration());\n }", "private Server() {\r\n\r\n\t\t// Make sure that all exceptions are written to the log\r\n\t\tThread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler());\r\n\r\n\t\tnew Thread() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * Find all controllers and initialize them\r\n\t\t\t\t * \r\n\t\t\t\t */\r\n\t\t\t\tReflections reflections = new Reflections(\"net.yourhome.server\");\r\n\t\t\t\tSet<Class<? extends IController>> controllerClasses = reflections.getSubTypesOf(IController.class);\r\n\r\n\t\t\t\tfor (final Class<? extends IController> controllerClass : controllerClasses) {\r\n\t\t\t\t\tif (!Modifier.isAbstract(controllerClass.getModifiers())) {\r\n\t\t\t\t\t\tnew Thread() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\tMethod factoryMethod;\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tfactoryMethod = controllerClass.getDeclaredMethod(\"getInstance\");\r\n\t\t\t\t\t\t\t\t\tIController controllerObject = (IController) factoryMethod.invoke(null, null);\r\n\t\t\t\t\t\t\t\t\tServer.this.controllers.put(controllerObject.getIdentifier(), controllerObject);\r\n\t\t\t\t\t\t\t\t\tSettingsManager.readSettings(controllerObject);\r\n\t\t\t\t\t\t\t\t\tcontrollerObject.init();\r\n\t\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t\tServer.log.error(\"Could not instantiate \" + controllerClass.getName() + \" because getInstance is missing\", e);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}.start();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.start();\r\n\r\n\t}", "public void setTlsCert(String tlsCert);", "public void setTlsCertPath(String tlsCertPath);", "public void init(boolean forward) throws CertPathValidatorException {\n }" ]
[ "0.67195386", "0.66491854", "0.6463039", "0.6223852", "0.5896187", "0.587535", "0.58705777", "0.58592474", "0.5845075", "0.5720947", "0.55490905", "0.55368525", "0.551807", "0.5484802", "0.5457563", "0.54541105", "0.5437633", "0.5416275", "0.5398296", "0.5386915", "0.5360261", "0.53484666", "0.53290194", "0.5321956", "0.52983993", "0.5282849", "0.527041", "0.5252144", "0.52479094", "0.5181045", "0.5171506", "0.5155863", "0.51443523", "0.51347125", "0.51251173", "0.5114352", "0.5112318", "0.5105274", "0.5105271", "0.50980526", "0.50803626", "0.5061851", "0.5059681", "0.5053662", "0.50485444", "0.5035741", "0.50287294", "0.5006141", "0.49800837", "0.4977818", "0.49757963", "0.49704385", "0.49557796", "0.4955243", "0.49531117", "0.49433082", "0.4923048", "0.49123737", "0.49001464", "0.48826113", "0.4882177", "0.4880711", "0.48638818", "0.48636806", "0.48552203", "0.4847957", "0.4846502", "0.48205453", "0.48100084", "0.47963014", "0.47931033", "0.47914535", "0.47883973", "0.47845566", "0.47811472", "0.47756743", "0.47734886", "0.47708598", "0.47678146", "0.47568384", "0.47561035", "0.47501433", "0.47460502", "0.4744757", "0.47438958", "0.47346836", "0.47284487", "0.4726489", "0.47259742", "0.47256923", "0.47242185", "0.47022533", "0.46916416", "0.46900225", "0.468515", "0.46747366", "0.46734357", "0.4661753", "0.4656462", "0.46553016" ]
0.7239087
0
Get the full URL for the given relative URL.
public String getURL(String relativeUrl) { try { synchronized (mImplMonitor) { checkServiceLocked(); return mImpl.getURL(relativeUrl); } } catch (RemoteException e) { throw new EmbeddedTestServerFailure("Failed to get URL for " + relativeUrl, e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getRelativeUrl() {\n return url;\n }", "public static String convertToRelativeUrl(String url) {\n\t\tif (url.startsWith(\"http\") || url.startsWith(\"https\")) {\n\t\t\ttry {\n\t\t\t\treturn new URL(url).getPath();\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\treturn url;\n\t\t\t}\n\t\t} else {\n\t\t\treturn url;\n\t\t}\n\t}", "public String getAbsoluteUrl() throws MalformedURLException {\r\n URL webUrl = new URL(webAbsluteUrl);\r\n URL urlRequest = new URL(webUrl.toString() + url);\r\n return urlRequest.toString();\r\n }", "private String get_url() {\n File file = new File(url);\n return file.getAbsolutePath();\n }", "public Uri getUrl() {\n return Uri.parse(urlString);\n }", "Uri getUrl();", "java.net.URL getUrl();", "String getBaseUri();", "public static String toRelativeURL(URL base, URL target) {\n\t\t// Precondition: If URL is a path to folder, then it must end with '/'\n\t\t// character.\n\t\tif ((base.getProtocol().equals(target.getProtocol()))\n\t\t\t\t|| (base.getHost().equals(target.getHost()))) { // changed this logic symbol\n\n\t\t\tString baseString = base.getFile();\n\t\t\tString targetString = target.getFile();\n\t\t\tString result = \"\";\n\n\t\t\t// remove filename from URL\n\t\t\tbaseString = baseString.substring(0,\n\t\t\t\t\tbaseString.lastIndexOf(\"/\") + 1);\n\n\t\t\t// remove filename from URL\n\t\t\ttargetString = targetString.substring(0,\n\t\t\t\t\ttargetString.lastIndexOf(\"/\") + 1);\n\n\t\t\tStringTokenizer baseTokens = new StringTokenizer(baseString, \"/\");// Maybe\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// this\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// causes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// problems\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// under\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// windows\n\t\t\tStringTokenizer targetTokens = new StringTokenizer(targetString,\n\t\t\t\t\t\"/\");// Maybe this causes problems under windows\n\n\t\t\tString nextBaseToken = \"\", nextTargetToken = \"\";\n\n\t\t\t// Algorithm\n\n\t\t\twhile (baseTokens.hasMoreTokens() && targetTokens.hasMoreTokens()) {\n\t\t\t\tnextBaseToken = baseTokens.nextToken();\n\t\t\t\tnextTargetToken = targetTokens.nextToken();\n\t\t\t\tif (!(nextBaseToken.equals(nextTargetToken))) {\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tresult = result.concat(\"../\");\n\t\t\t\t\t\tif (!baseTokens.hasMoreTokens()) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnextBaseToken = baseTokens.nextToken();\n\t\t\t\t\t}\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tresult = result.concat(nextTargetToken + \"/\");\n\t\t\t\t\t\tif (!targetTokens.hasMoreTokens()) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnextTargetToken = targetTokens.nextToken();\n\t\t\t\t\t}\n\t\t\t\t\tString temp = target.getFile(); // to string\n\t\t\t\t\tresult = result.concat(temp.substring(\n\t\t\t\t\t\t\ttemp.lastIndexOf(\"/\") + 1, temp.length()));\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile (baseTokens.hasMoreTokens()) {\n\t\t\t\tresult = result.concat(\"../\");\n\t\t\t\tbaseTokens.nextToken();\n\t\t\t}\n\n\t\t\twhile (targetTokens.hasMoreTokens()) {\n\t\t\t\tnextTargetToken = targetTokens.nextToken();\n\t\t\t\tresult = result.concat(nextTargetToken + \"/\");\n\t\t\t}\n\n\t\t\tString temp = target.getFile(); // to string\n\t\t\tresult = result.concat(temp.substring(temp.lastIndexOf(\"/\") + 1,\n\t\t\t\t\ttemp.length()));\n\t\t\treturn result;\n\t\t}\n\t\treturn target.toString();\n\t}", "public GiftCardProductQuery relativeUrl() {\n startField(\"relative_url\");\n\n return this;\n }", "protected String getAbsoluteURL(HttpServletRequest httpRequest, String url) {\r\n\t\t\r\n\t\tif (url == null)\r\n\t\t\treturn null;\r\n\t\tif (url.indexOf(\"://\") != -1)\t\t\t\r\n\t\t\treturn url;\r\n\r\n\t\tString scheme = httpRequest.getScheme();\r\n\t\tString serverName = httpRequest.getServerName();\r\n\t\tint port = httpRequest.getServerPort();\r\n\t\tboolean slashLeads = url.startsWith(\"/\");\r\n\r\n\t\tString absoluteURL = scheme + \"://\" + serverName;\r\n\t\t\r\n\t\tif ((scheme.equals(\"http\") && port != 80) || \r\n\t\t\t\t(scheme.equals(\"https\") && port != 443))\r\n\t\t\tabsoluteURL += \":\" + port;\r\n\t\tif (!slashLeads)\r\n\t\t\tabsoluteURL += \"/\";\r\n\r\n\t\tabsoluteURL += url;\r\n\t\t\r\n\t\treturn absoluteURL;\r\n\t}", "FullUriTemplateString baseUri();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "public String getURLWithHostName(String hostname, String relativeUrl) {\n try {\n synchronized (mImplMonitor) {\n checkServiceLocked();\n return mImpl.getURLWithHostName(hostname, relativeUrl);\n }\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to get URL for \" + hostname + \" and \" + relativeUrl, e);\n }\n }", "public URL getUrl() {\n try {\n StringBuilder completeUrlBuilder = new StringBuilder();\n completeUrlBuilder.append(getBaseEndpointPath());\n completeUrlBuilder.append(path);\n if (requestType == HttpRequest.NetworkOperationType.GET && parameters != null) {\n boolean first = true;\n for (String key : parameters.keySet()) {\n if (first) {\n first = false;\n completeUrlBuilder.append(\"?\");\n } else {\n completeUrlBuilder.append(\"&\");\n }\n completeUrlBuilder.append(key).append(\"=\").append(parameters.get(key));\n }\n }\n return new URL(completeUrlBuilder.toString());\n } catch (MalformedURLException exception) {\n LocalizableLog.error(exception);\n return null;\n }\n }", "URL getUrl();", "String url();", "@Override\n public String getUrl() {\n StringBuilder sb = new StringBuilder(baseUrl);\n if (mUrlParams.size() > 0) {\n sb.append(\"?\");\n for (String key : mUrlParams.keySet()) {\n sb.append(key);\n sb.append(\"=\");\n sb.append(mUrlParams.get(key));\n sb.append(\"&\");\n }\n }\n String result = sb.substring(0, sb.length() - 1);\n return result;\n }", "protected String getBaseUrl(HttpServletRequest request) {\n\t\tString retVal = \"\";\n\t\tif (request != null && request.getRequestURL() != null) {\n\t\t\tStringBuffer url = request.getRequestURL();\n\t\t\tString uri = request.getRequestURI();\n\t\t\t\n\t\t\tretVal = url.substring(0, url.length() - uri.length());\n\t\t}\n\t\t\n\t\treturn retVal;\n\t}", "String getUri( );", "String getUrl();", "String getUrl();", "String getUrl();", "String getUrl();", "String getUrl();", "java.lang.String getUri();", "java.lang.String getUri();", "public String getBaseLinkUrl() {\n return (String) get(\"base_link_url\");\n }", "public final static String getFullRequestUrl(final HttpServletRequest req) {\n return req.getRequestURL().toString() + (StringUtils.hasText(req.getQueryString()) ? \"?\"+req.getQueryString() : \"\");\n }", "public static String getRelativePath(URI base, File file) {\n\t\treturn toString(getRelativeURI(base, file.toURI()));\n\t}", "public URL makeBase(URL startingURL);", "public static String getBaseURL(URL url) throws MalformedURLException {\n return new URL(url.getProtocol(), url.getHost(), url.getPort(), \"/\").toString();\n }", "public static String relativeUrlTo(\n @SuppressWarnings(\"unused\") ModuleVersionIdentifier from,\n ModuleVersionIdentifier to\n ) {\n StringBuilder path = new StringBuilder();\n path.append(\"../../\");\n path.append(to.getName());\n path.append(\"/\");\n path.append(to.getVersion());\n path.append(\"/\");\n path.append(to.getName());\n path.append(\"-\");\n path.append(to.getVersion());\n path.append(\".module\");\n return path.toString();\n }", "private String getURL() {\n String url = profileLocation.getText().toString();\n if (url == null || url.length() == 0) {\n return url;\n }\n // if it's not the last (which should be \"Raw\") choice, we'll use the prefix\n if (!url.contains(\"://\")) { // if there is no (http|jr):// prefix, we'll assume it's a http://bit.ly/ URL\n url = \"http://bit.ly/\" + url;\n }\n return url;\n }", "public URL getBaseHref() {\n return baseHref;\n }", "public String getURL()\n {\n return getURL(\"http\");\n }", "@JsonIgnore\n\tpublic String getAbsoluteURI() {\n\t\treturn path.toUri().toString();\n\t}", "public static URI getRelativeURI(URI base, URI uri) {\n\t\tif (base != null && uri != null && (uri.getScheme() == null || uri.getScheme().equals(base.getScheme()))) {\n\t\t\tStringTokenizer baseParts = tokenizeBase(base);\n\t\t\tStringTokenizer uriParts = new StringTokenizer(uri.getSchemeSpecificPart(), \"/\");\n\t\t\tStringBuffer relativePath = new StringBuffer();\n\t\t\tString part = null;\n\t\t\tboolean first = true;\n\t\t\tif (!baseParts.hasMoreTokens()) {\n\t\t\t\treturn uri;\n\t\t\t}\n\t\t\twhile (baseParts.hasMoreTokens() && uriParts.hasMoreTokens()) {\n\t\t\t\tString baseDir = baseParts.nextToken();\n\t\t\t\tpart = uriParts.nextToken();\n\t\t\t\tif ((baseDir.equals(part) && baseDir.contains(\":\")) && first) {\n\t\t\t\t\tbaseDir = baseParts.nextToken();\n\t\t\t\t\tpart = uriParts.nextToken();\n\t\t\t\t}\n\t\t\t\tif (!baseDir.equals(part)) { // || (baseDir.equals(part) && baseDir.contains(\":\"))) {\n\t\t\t\t\tif (first) {\n\t\t\t\t\t\treturn uri;\n\t\t\t\t\t}\n\t\t\t\t\trelativePath.append(\"../\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tpart = null;\n\t\t\t\tfirst = false;\n\t\t\t}\n\t\t\twhile (baseParts.hasMoreTokens()) {\n\t\t\t\trelativePath.append(\"../\");\n\t\t\t\tbaseParts.nextToken();\n\t\t\t}\n\t\t\tif (part != null) {\n\t\t\t\trelativePath.append(part);\n\t\t\t\tif (uriParts.hasMoreTokens()) {\n\t\t\t\t\trelativePath.append(\"/\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (uriParts.hasMoreTokens()) {\n\t\t\t\trelativePath.append(uriParts.nextToken());\n\t\t\t\tif (uriParts.hasMoreTokens()) {\n\t\t\t\t\trelativePath.append(\"/\");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn createURI(relativePath.toString());\n\t\t}\n\t\treturn uri;\n\t}", "private static URL absolutize(URL baseURL, String href) \n throws MalformedURLException, BadHrefAttributeException {\n \n Element parent = new Element(\"c\");\n parent.setBaseURI(baseURL.toExternalForm());\n Element child = new Element(\"c\");\n parent.appendChild(child);\n child.addAttribute(new Attribute(\n \"xml:base\", \"http://www.w3.org/XML/1998/namespace\", href));\n URL result = new URL(child.getBaseURI());\n if (!\"\".equals(href) && result.equals(baseURL)) {\n if (! baseURL.toExternalForm().endsWith(href)) {\n throw new BadHrefAttributeException(href \n + \" is not a syntactically correct IRI\");\n }\n }\n return result;\n \n }", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n url_ = s;\n }\n return s;\n }\n }", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n url_ = s;\n }\n return s;\n }\n }", "public static String getModuleBaseUrl(HttpServletRequest request) {\n\t String requestedUri = request.getRequestURI();\n\t int contextEnd = request.getContextPath().length();\n\t int folderEnd = requestedUri.lastIndexOf('/') + 1;\n\t return requestedUri.substring(contextEnd, folderEnd);\n\t }", "@Nonnull public URL buildURL() throws MalformedURLException {\n installTrustStore();\n \n if (disableNameChecking) {\n final HostnameVerifier allHostsValid = new HostnameVerifier() {\n public boolean verify(final String hostname, final SSLSession session) {\n return true;\n }\n }; \n HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid); \n }\n \n final StringBuilder builder = new StringBuilder(getURL());\n if (getPath() != null) {\n builder.append(getPath());\n }\n\n return new URL(doBuildURL(builder).toString());\n }", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n url_ = s;\n }\n return s;\n }\n }", "String getJoinUrl();", "public static String determineBaseUrl(String url) {\r\n\t\t// Determine the index of the first slash after the first period.\r\n\t\tint firstSub = url.indexOf(\"/\", url.indexOf(\".\"));\r\n\t\t\r\n\t\tif (firstSub == -1)\r\n\t\t\t// There were no sub directories included in the URL.\r\n\t\t\treturn url;\r\n\t\telse\r\n\t\t\treturn url.substring(0, firstSub);\r\n\t}", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n url_ = s;\n return s;\n }\n }", "public String getRelativePath();", "public final String getUrl() {\n return properties.get(URL_PROPERTY);\n }", "public String getUrl() {\n Object ref = url_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n url_ = s;\n }\n return s;\n }\n }", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n url_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n url_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@java.lang.Override\n public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n url_ = s;\n return s;\n }\n }", "public URL makeFullUrl(String scrapedString, URL base);", "String getRequestURL();", "String getUri();", "@Override\n\tpublic URL getBaseURL() {\n\t\tURL url = null;\n\t\tString buri = getBaseURI();\n\t\tif (buri != null) {\n\t\t\ttry {\n\t\t\t\turl = new URL(buri);\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\ttry {\n\t\t\t\t\tString docuri = document.getDocumentURI();\n\t\t\t\t\tif (docuri != null) {\n\t\t\t\t\t\tURL context = new URL(docuri);\n\t\t\t\t\t\turl = new URL(context, buri);\n\t\t\t\t\t}\n\t\t\t\t} catch (MalformedURLException e1) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn url;\n\t}", "public static String getWorkRelativePath(String testURL) {\n int pound = testURL.lastIndexOf('#');\n if (pound == -1) // no test id\n {\n return getWorkRelativePath(testURL, null);\n } else {\n return getWorkRelativePath(testURL.substring(0, pound),\n testURL.substring(pound + 1));\n }\n }", "@Override\n\tpublic URL getURL(String uri) throws MalformedURLException {\n\t\tif (uri.length() == 0) {\n\t\t\tthrow new MalformedURLException(\"Empty URI\");\n\t\t}\n\t\tURL url;\n\t\tif (uri.indexOf(\"://\") < 0) {\n\t\t\turl = new URL(getBaseURL(), uri);\n\t\t} else {\n\t\t\turl = new URL(uri);\n\t\t}\n\t\treturn url;\n\t}", "public String getURL();", "private String getHref(HttpServletRequest request)\n {\n String respath = request.getRequestURI();\n if (respath == null)\n \trespath = \"\";\n String codebaseParam = getRequestParam(request, CODEBASE, null);\n int idx = respath.lastIndexOf('/');\n if (codebaseParam != null)\n if (respath.indexOf(codebaseParam) != -1)\n idx = respath.indexOf(codebaseParam) + codebaseParam.length() - 1;\n String href = respath.substring(idx + 1); // Exclude /\n href = href + '?' + request.getQueryString();\n return href;\n }", "public String getUrl() {\n Object ref = url_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n url_ = s;\n return s;\n }\n }", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n url_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getUrl() {\n\t\tif (prop.getProperty(\"url\") == null)\n\t\t\treturn \"\";\n\t\treturn prop.getProperty(\"url\");\n\t}", "public URL standardizeURL(URL startingURL);", "String getAbsolutePathWithinSlingHome(String relativePath);", "public static String getUriPathFromUrl(final String url) {\n // URI = scheme:[//authority]path[?query][#fragment]\n String uri = url;\n if(url != null && url.length() > 0) {\n final int ejbcaIndex = url.indexOf(\"/ejbca\");\n if (ejbcaIndex != -1) {\n uri = url.substring(ejbcaIndex);\n // TODO Temporary\n uri = uri.replaceAll(\"//\", \"/\");\n final int questionMarkIndex = uri.indexOf('?');\n uri = (questionMarkIndex == -1 ? uri : uri.substring(0, questionMarkIndex));\n final int semicolonIndex = uri.indexOf(';');\n uri = (semicolonIndex == -1 ? uri : uri.substring(0, semicolonIndex));\n final int numberSignIndex = uri.indexOf('#');\n uri = (numberSignIndex == -1 ? uri : uri.substring(0, numberSignIndex));\n }\n }\n return uri;\n }", "public static String composePath(URI base, String relativePath) {\n\t\tURI uri = composeURI(base, relativePath);\n\t\tif (uri.isAbsolute()) {\n\t\t\tFile file = new File(uri);\n\t\t\treturn file.toString();\n\t\t} else if (base != null) {\n\t\t\tFile file = new File(new File(base), uri.toString());\n\t\t\treturn file.toString();\n\t\t}\n\t\treturn relativePath;\n\t}", "public String getUrl() {\n Object ref = url_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n url_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "private String getURL() {\n\t\t// TODO : Generate URL\n\t\treturn null;\n\t}", "public static URL buildUrl() {\n Uri builtUri = Uri.parse(CONTENT_JSON_URL).buildUpon()\n .build();\n\n URL url = null;\n try {\n url = new URL(builtUri.toString());\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n return url;\n }", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n url_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n url_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getURL(Version version) {\n return getUrl() + version.getDocument().getDocumentURL();\n }", "public String getUrl() {\n Deque<String> urlDeque = (Deque<String>) httpSession.getAttribute( SessionVariable.SESSION_URL_SCOPE );\n return urlDeque.pollFirst();\n }", "protected abstract String getUrl();", "RaptureURI getBaseURI();", "public String getURL() {\n\t\treturn prop.getProperty(\"URL\");\n\t}", "public String getUrl();", "public String getUrl();", "public String getUrl();", "public String getUrl();", "public String getUrl() {\n Object ref = url_;\n if (!(ref instanceof String)) {\n String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n url_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "@Test\n public void testMakeRelativeURL3() throws Exception {\n URL base = new URL(\"http://ahost.invalid/a/b/c\");\n assertEquals(new URL(\"http://host.invalid/e\"),ConversionUtils.makeRelativeURL(base ,\"http://host.invalid/e\"));\n assertEquals(new URL(\"https://host.invalid/e\"),ConversionUtils.makeRelativeURL(base ,\"https://host.invalid/e\"));\n assertEquals(new URL(\"http://host.invalid:8081/e\"),ConversionUtils.makeRelativeURL(base ,\"http://host.invalid:8081/e\"));\n assertEquals(new URL(\"https://host.invalid:8081/e\"),ConversionUtils.makeRelativeURL(base ,\"https://host.invalid:8081/e\"));\n }", "public String url() {\n return server.baseUri().toString();\n }", "static public String getURI(HttpServletRequest request){\r\n\t\treturn request.getRequestURI();\r\n\t}", "public static String getWorkRelativePath(String baseURL, String testId) {\n StringBuilder sb = new StringBuilder(baseURL);\n\n // strip off extension\n stripExtn:\n for (int i = sb.length() - 1; i >= 0; i--) {\n switch (sb.charAt(i)) {\n case '.':\n sb.setLength(i);\n break stripExtn;\n case '/':\n break stripExtn;\n }\n }\n\n // add in uniquifying id if\n if (testId != null) {\n sb.append('_');\n sb.append(testId);\n }\n\n sb.append(EXTN);\n\n return sb.toString();\n }", "URI uri();", "public URL getURL()\n/* */ {\n/* 135 */ return ResourceUtils.getResourceAsURL(this, this);\n/* */ }", "String getRequestedUrl();", "URI getUri();", "public URL getUrl() throws MalformedURLException {\n StringBuilder pathAndQuery = new StringBuilder(100);\n String path = this.getPath();\n // Hack to allow entire URL to be provided in host field\n if (path.startsWith(HTTP_PREFIX)\n || path.startsWith(HTTPS_PREFIX)) {\n return new URL(path);\n }\n String domain = getDomain();\n String protocol = getProtocol();\n if (PROTOCOL_FILE.equalsIgnoreCase(protocol)) {\n domain = null; // allow use of relative file URLs\n } else {\n // HTTP URLs must be absolute, allow file to be relative\n if (!path.startsWith(\"/\")) { // $NON-NLS-1$\n pathAndQuery.append(\"/\"); // $NON-NLS-1$\n }\n }\n pathAndQuery.append(path);\n \n // Add the query string if it is a HTTP GET or DELETE request\n if (HTTPConstants.GET.equals(getMethod()) || HTTPConstants.DELETE.equals(getMethod())) {\n // Get the query string encoded in specified encoding\n // If no encoding is specified by user, we will get it\n // encoded in UTF-8, which is what the HTTP spec says\n String queryString = getQueryString(getContentEncoding());\n if (queryString.length() > 0) {\n if (path.contains(QRY_PFX)) {// Already contains a prefix\n pathAndQuery.append(QRY_SEP);\n } else {\n pathAndQuery.append(QRY_PFX);\n }\n pathAndQuery.append(queryString);\n }\n }\n // If default port for protocol is used, we do not include port in URL\n if (isProtocolDefaultPort()) {\n return new URL(protocol, domain, pathAndQuery.toString());\n }\n return new URL(protocol, domain, getPort(), pathAndQuery.toString());\n }", "public static String getAbsoluteFilePath(String relativePath) throws URISyntaxException {\n URL fileResource = BCompileUtil.class.getClassLoader().getResource(relativePath);\n String pathValue = \"\";\n if (null != fileResource) {\n Path path = Paths.get(fileResource.toURI());\n pathValue = path.toAbsolutePath().toString();\n }\n return pathValue;\n }", "public URL getCompleteURL (String fileName)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\treturn new URL (\"file:\" + System.getProperty (\"user.dir\") + \"/\" + fileName);\r\n\t\t}\r\n\t\tcatch (MalformedURLException e)\r\n\t\t{\r\n\t\t\tSystem.err.println (e.getMessage ());\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public String getUrl() {\n return _Web_search.getBaseUrl() + getQuery();\n }" ]
[ "0.7207375", "0.67728746", "0.65859437", "0.6511875", "0.64516556", "0.6447803", "0.6421528", "0.63587594", "0.6323731", "0.6289188", "0.6274617", "0.6160519", "0.60919225", "0.60919225", "0.60919225", "0.60919225", "0.60919225", "0.60919225", "0.6065754", "0.60149497", "0.5988949", "0.596126", "0.5958216", "0.59445816", "0.5921761", "0.57804257", "0.57804257", "0.57804257", "0.57804257", "0.57804257", "0.57735777", "0.57735777", "0.5772857", "0.576712", "0.5765279", "0.57588035", "0.57511896", "0.57372755", "0.57359844", "0.5710405", "0.5704295", "0.57000023", "0.5681476", "0.5663199", "0.56613976", "0.56613976", "0.56611145", "0.56541294", "0.56454134", "0.56412023", "0.56158584", "0.55972433", "0.55927116", "0.5581713", "0.55813646", "0.5578482", "0.5578482", "0.55731064", "0.5548898", "0.554869", "0.55463225", "0.5534968", "0.55343163", "0.5533466", "0.55259544", "0.5513821", "0.55108905", "0.55062896", "0.54968184", "0.5486729", "0.54795605", "0.5479234", "0.54718846", "0.5462983", "0.54601467", "0.54599047", "0.5456698", "0.5456698", "0.544084", "0.5440199", "0.5413371", "0.54111874", "0.5406653", "0.54056543", "0.54056543", "0.54056543", "0.54056543", "0.5405439", "0.53980654", "0.53936964", "0.5373774", "0.53670913", "0.536589", "0.53640884", "0.53634953", "0.5350903", "0.5342703", "0.53374827", "0.533392", "0.5330037" ]
0.7010205
1
Get the full URL for the given relative URL. Similar to the above method but uses the given hostname instead of 127.0.0.1. The hostname should be resolved to 127.0.0.1.
public String getURLWithHostName(String hostname, String relativeUrl) { try { synchronized (mImplMonitor) { checkServiceLocked(); return mImpl.getURLWithHostName(hostname, relativeUrl); } } catch (RemoteException e) { throw new EmbeddedTestServerFailure( "Failed to get URL for " + hostname + " and " + relativeUrl, e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getURL(String relativeUrl) {\n try {\n synchronized (mImplMonitor) {\n checkServiceLocked();\n return mImpl.getURL(relativeUrl);\n }\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\"Failed to get URL for \" + relativeUrl, e);\n }\n }", "protected String getAbsoluteURL(HttpServletRequest httpRequest, String url) {\r\n\t\t\r\n\t\tif (url == null)\r\n\t\t\treturn null;\r\n\t\tif (url.indexOf(\"://\") != -1)\t\t\t\r\n\t\t\treturn url;\r\n\r\n\t\tString scheme = httpRequest.getScheme();\r\n\t\tString serverName = httpRequest.getServerName();\r\n\t\tint port = httpRequest.getServerPort();\r\n\t\tboolean slashLeads = url.startsWith(\"/\");\r\n\r\n\t\tString absoluteURL = scheme + \"://\" + serverName;\r\n\t\t\r\n\t\tif ((scheme.equals(\"http\") && port != 80) || \r\n\t\t\t\t(scheme.equals(\"https\") && port != 443))\r\n\t\t\tabsoluteURL += \":\" + port;\r\n\t\tif (!slashLeads)\r\n\t\t\tabsoluteURL += \"/\";\r\n\r\n\t\tabsoluteURL += url;\r\n\t\t\r\n\t\treturn absoluteURL;\r\n\t}", "public String getAbsoluteUrl() throws MalformedURLException {\r\n URL webUrl = new URL(webAbsluteUrl);\r\n URL urlRequest = new URL(webUrl.toString() + url);\r\n return urlRequest.toString();\r\n }", "public static URL getHostUrl() {\n try {\n String protocol = getRequestsProtocol();\n return new URL(protocol + \"://\" + Controller.request().host());\n } catch (MalformedURLException e) {\n LOGGER.error(\".getHostUrl: couldn't get request's host URL\", e);\n }\n // Should never happen\n return null;\n }", "public static String getRelativeUrl() {\n return url;\n }", "@Nonnull public URL buildURL() throws MalformedURLException {\n installTrustStore();\n \n if (disableNameChecking) {\n final HostnameVerifier allHostsValid = new HostnameVerifier() {\n public boolean verify(final String hostname, final SSLSession session) {\n return true;\n }\n }; \n HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid); \n }\n \n final StringBuilder builder = new StringBuilder(getURL());\n if (getPath() != null) {\n builder.append(getPath());\n }\n\n return new URL(doBuildURL(builder).toString());\n }", "private static String getHostURL(String url) {\n URI uri = URI.create(url);\n int port = uri.getPort();\n if (port == -1) {\n return uri.getScheme() + \"://\" + uri.getHost() + \"/\";\n } else {\n return uri.getScheme() + \"://\" + uri.getHost() + \":\" + uri.getPort() + \"/\";\n }\n }", "java.net.URL getUrl();", "public Uri getUrl() {\n return Uri.parse(urlString);\n }", "public static String convertToRelativeUrl(String url) {\n\t\tif (url.startsWith(\"http\") || url.startsWith(\"https\")) {\n\t\t\ttry {\n\t\t\t\treturn new URL(url).getPath();\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\treturn url;\n\t\t\t}\n\t\t} else {\n\t\t\treturn url;\n\t\t}\n\t}", "Uri getUrl();", "public String getFullHost() {\n return \"http://\" + get(HOSTNAME_KEY) + \":\" + get(PORT_KEY) + \"/\" + get(CONTEXT_ROOT_KEY) + \"/\";\n }", "private String getUrlHost(String url) {\n // httpx://host/.....\n\n int hostStart = url.indexOf(\"//\");\n if (hostStart == -1) {\n return \"\";\n }\n int hostEnd = url.indexOf(\"/\", hostStart + 2);\n if (hostEnd == -1) {\n return url.substring(hostStart + 2);\n } else {\n return url.substring(hostStart + 2, hostEnd);\n }\n\n }", "public String getHostURL() {\n return getHostURL(PAActiveObject.getActiveObjectNodeUrl(PAActiveObject.getStubOnThis()));\n }", "private String get_url() {\n File file = new File(url);\n return file.getAbsolutePath();\n }", "public static String getBaseURL(URL url) throws MalformedURLException {\n return new URL(url.getProtocol(), url.getHost(), url.getPort(), \"/\").toString();\n }", "public URL getUrl() {\n try {\n StringBuilder completeUrlBuilder = new StringBuilder();\n completeUrlBuilder.append(getBaseEndpointPath());\n completeUrlBuilder.append(path);\n if (requestType == HttpRequest.NetworkOperationType.GET && parameters != null) {\n boolean first = true;\n for (String key : parameters.keySet()) {\n if (first) {\n first = false;\n completeUrlBuilder.append(\"?\");\n } else {\n completeUrlBuilder.append(\"&\");\n }\n completeUrlBuilder.append(key).append(\"=\").append(parameters.get(key));\n }\n }\n return new URL(completeUrlBuilder.toString());\n } catch (MalformedURLException exception) {\n LocalizableLog.error(exception);\n return null;\n }\n }", "private String getHost(String url)\r\n\t{\r\n\t\tif(url == null || url.length() == 0)\r\n\t\t\treturn \"\";\r\n\r\n\t\tint doubleslash = url.indexOf(\"//\");\r\n\t\tif(doubleslash == -1)\r\n\t\t\tdoubleslash = 0;\r\n\t\telse\r\n\t\t\tdoubleslash += 2;\r\n\r\n\t\tint end = url.indexOf('/', doubleslash);\r\n\t\tend = end >= 0 ? end : url.length();\r\n\r\n\t\tint port = url.indexOf(':', doubleslash);\r\n\t\tend = (port > 0 && port < end) ? port : end;\r\n\r\n\t\treturn url.substring(doubleslash, end);\r\n\t}", "private String resolveAbsoluteURL(String defaultUrlContext, String urlFromConfig, String tenantDomain) throws IdentityProviderManagementServerException {\n\n if (!IdentityTenantUtil.isTenantQualifiedUrlsEnabled() && StringUtils.isNotBlank(urlFromConfig)) {\n if (log.isDebugEnabled()) {\n log.debug(\"Resolved URL:\" + urlFromConfig + \" from file configuration for default url context: \" +\n defaultUrlContext);\n }\n return urlFromConfig;\n }\n\n try {\n ServiceURLBuilder serviceURLBuilder = ServiceURLBuilder.create().setTenant(tenantDomain);\n return serviceURLBuilder.addPath(defaultUrlContext).build().getAbsolutePublicURL();\n } catch (URLBuilderException e) {\n throw IdentityProviderManagementException.error(IdentityProviderManagementServerException.class,\n \"Error while building URL: \" + defaultUrlContext, e);\n }\n }", "private String getUrlBaseForLocalServer() {\n\t HttpServletRequest request = ((ServletRequestAttributes) \n\t\t\t RequestContextHolder.getRequestAttributes()).getRequest();\n\t String base = \"http://\" + request.getServerName() + ( \n\t (request.getServerPort() != 80) \n\t \t\t ? \":\" + request.getServerPort() \n\t\t\t\t : \"\");\n\t return base;\n\t}", "String getBaseUri();", "public static String getBaseUrl(HttpServletRequest request) {\n\t\tif ((request.getServerPort() == 80) || (request.getServerPort() == 443))\n\t\t{\n\t\t\treturn request.getScheme() + \"://\" + request.getServerName();\t\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\treturn request.getScheme() + \"://\" + request.getServerName() + \":\" + request.getServerPort();\n\t\t}\n\t}", "@Override\n public String getUrl() {\n StringBuilder sb = new StringBuilder(baseUrl);\n if (mUrlParams.size() > 0) {\n sb.append(\"?\");\n for (String key : mUrlParams.keySet()) {\n sb.append(key);\n sb.append(\"=\");\n sb.append(mUrlParams.get(key));\n sb.append(\"&\");\n }\n }\n String result = sb.substring(0, sb.length() - 1);\n return result;\n }", "protected String getBaseUrl(HttpServletRequest request) {\n\t\tString retVal = \"\";\n\t\tif (request != null && request.getRequestURL() != null) {\n\t\t\tStringBuffer url = request.getRequestURL();\n\t\t\tString uri = request.getRequestURI();\n\t\t\t\n\t\t\tretVal = url.substring(0, url.length() - uri.length());\n\t\t}\n\t\t\n\t\treturn retVal;\n\t}", "public String getURL()\n {\n return getURL(\"http\");\n }", "@Override\n\tpublic URL getURL(String uri) throws MalformedURLException {\n\t\tif (uri.length() == 0) {\n\t\t\tthrow new MalformedURLException(\"Empty URI\");\n\t\t}\n\t\tURL url;\n\t\tif (uri.indexOf(\"://\") < 0) {\n\t\t\turl = new URL(getBaseURL(), uri);\n\t\t} else {\n\t\t\turl = new URL(uri);\n\t\t}\n\t\treturn url;\n\t}", "public static String getBaseUrl() {\r\n if (baseUrl == null) {\r\n baseUrl = Constants.HTTP_PROTOCOL + \"://\" + getBaseHost() + \":\" + getBasePort();\r\n }\r\n return baseUrl;\r\n }", "public static String getRootUrl(String url) {\n String u = url;\n int in = u.indexOf(\"://\");\n if (in <= 0) {\n u = \"http://\" + u;\n }\n\n try {\n URL theUrl = new URL(u);\n return theUrl.getHost();\n } catch (MalformedURLException e) {\n return u;\n }\n }", "public String getBaseUrl() {\n StringBuffer buf = new StringBuffer();\n buf.append(getScheme());\n buf.append(\"://\");\n buf.append(getServerName());\n if ((isSecure() && getServerPort() != 443) ||\n getServerPort() != 80) {\n buf.append(\":\");\n buf.append(getServerPort());\n }\n return buf.toString();\n }", "URL getUrl();", "public URL getUrl() throws MalformedURLException {\n StringBuilder pathAndQuery = new StringBuilder(100);\n String path = this.getPath();\n // Hack to allow entire URL to be provided in host field\n if (path.startsWith(HTTP_PREFIX)\n || path.startsWith(HTTPS_PREFIX)) {\n return new URL(path);\n }\n String domain = getDomain();\n String protocol = getProtocol();\n if (PROTOCOL_FILE.equalsIgnoreCase(protocol)) {\n domain = null; // allow use of relative file URLs\n } else {\n // HTTP URLs must be absolute, allow file to be relative\n if (!path.startsWith(\"/\")) { // $NON-NLS-1$\n pathAndQuery.append(\"/\"); // $NON-NLS-1$\n }\n }\n pathAndQuery.append(path);\n \n // Add the query string if it is a HTTP GET or DELETE request\n if (HTTPConstants.GET.equals(getMethod()) || HTTPConstants.DELETE.equals(getMethod())) {\n // Get the query string encoded in specified encoding\n // If no encoding is specified by user, we will get it\n // encoded in UTF-8, which is what the HTTP spec says\n String queryString = getQueryString(getContentEncoding());\n if (queryString.length() > 0) {\n if (path.contains(QRY_PFX)) {// Already contains a prefix\n pathAndQuery.append(QRY_SEP);\n } else {\n pathAndQuery.append(QRY_PFX);\n }\n pathAndQuery.append(queryString);\n }\n }\n // If default port for protocol is used, we do not include port in URL\n if (isProtocolDefaultPort()) {\n return new URL(protocol, domain, pathAndQuery.toString());\n }\n return new URL(protocol, domain, getPort(), pathAndQuery.toString());\n }", "public String url() {\n return server.baseUri().toString();\n }", "FullUriTemplateString baseUri();", "public URL getUrl() throws MalformedURLException {\n StringBuilder pathAndQuery = new StringBuilder(100);\n String path = this.getPath();\n // Hack to allow entire URL to be provided in host field\n if (path.startsWith(HTTP_PREFIX)\n || path.startsWith(HTTPS_PREFIX)){\n return new URL(path);\n }\n String domain = getDomain();\n String protocol = getProtocol();\n if (PROTOCOL_FILE.equalsIgnoreCase(protocol)) {\n domain=null; // allow use of relative file URLs\n } else {\n // HTTP URLs must be absolute, allow file to be relative\n if (!path.startsWith(\"/\")){ // $NON-NLS-1$\n pathAndQuery.append(\"/\"); // $NON-NLS-1$\n }\n }\n pathAndQuery.append(path);\n \n // Add the query string if it is a HTTP GET or DELETE request\n if(HTTPConstants.GET.equals(getMethod()) || HTTPConstants.DELETE.equals(getMethod())) {\n // Get the query string encoded in specified encoding\n // If no encoding is specified by user, we will get it\n // encoded in UTF-8, which is what the HTTP spec says\n String queryString = getQueryString(getContentEncoding());\n if(queryString.length() > 0) {\n if (path.indexOf(QRY_PFX) > -1) {// Already contains a prefix\n pathAndQuery.append(QRY_SEP);\n } else {\n pathAndQuery.append(QRY_PFX);\n }\n pathAndQuery.append(queryString);\n }\n }\n // If default port for protocol is used, we do not include port in URL\n if(isProtocolDefaultPort()) {\n return new URL(protocol, domain, pathAndQuery.toString());\n }\n return new URL(protocol, domain, getPort(), pathAndQuery.toString());\n }", "private String baseUrl() {\n return \"http://\" + xosServerAddress + \":\" +\n Integer.toString(xosServerPort) + XOSLIB + baseUri;\n }", "public GiftCardProductQuery relativeUrl() {\n startField(\"relative_url\");\n\n return this;\n }", "String getUri( );", "public URL makeBase(URL startingURL);", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "String url();", "public final static String getFullRequestUrl(final HttpServletRequest req) {\n return req.getRequestURL().toString() + (StringUtils.hasText(req.getQueryString()) ? \"?\"+req.getQueryString() : \"\");\n }", "private String getFullRemoteURI(String uri) {\n return REMOTE_NS_PREFIX + \":\" + uri;\n }", "private static String getBaseUrl() {\n StringBuilder url = new StringBuilder();\n url.append(getProtocol());\n url.append(getHost());\n url.append(getPort());\n url.append(getVersion());\n url.append(getService());\n Log.d(TAG, \"url_base: \" + url.toString());\n return url.toString();\n }", "public String getEasyCoopURI() {\r\n String uri = \"\";\r\n\r\n try {\r\n javax.naming.Context ctx = new javax.naming.InitialContext();\r\n uri = (String) ctx.lookup(\"java:comp/env/easycoopbaseurl\");\r\n //BASE_URI = uri; \r\n } catch (NamingException nx) {\r\n System.out.println(\"Error number exception\" + nx.getMessage().toString());\r\n }\r\n\r\n return uri;\r\n }", "public static String toRelativeURL(URL base, URL target) {\n\t\t// Precondition: If URL is a path to folder, then it must end with '/'\n\t\t// character.\n\t\tif ((base.getProtocol().equals(target.getProtocol()))\n\t\t\t\t|| (base.getHost().equals(target.getHost()))) { // changed this logic symbol\n\n\t\t\tString baseString = base.getFile();\n\t\t\tString targetString = target.getFile();\n\t\t\tString result = \"\";\n\n\t\t\t// remove filename from URL\n\t\t\tbaseString = baseString.substring(0,\n\t\t\t\t\tbaseString.lastIndexOf(\"/\") + 1);\n\n\t\t\t// remove filename from URL\n\t\t\ttargetString = targetString.substring(0,\n\t\t\t\t\ttargetString.lastIndexOf(\"/\") + 1);\n\n\t\t\tStringTokenizer baseTokens = new StringTokenizer(baseString, \"/\");// Maybe\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// this\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// causes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// problems\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// under\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// windows\n\t\t\tStringTokenizer targetTokens = new StringTokenizer(targetString,\n\t\t\t\t\t\"/\");// Maybe this causes problems under windows\n\n\t\t\tString nextBaseToken = \"\", nextTargetToken = \"\";\n\n\t\t\t// Algorithm\n\n\t\t\twhile (baseTokens.hasMoreTokens() && targetTokens.hasMoreTokens()) {\n\t\t\t\tnextBaseToken = baseTokens.nextToken();\n\t\t\t\tnextTargetToken = targetTokens.nextToken();\n\t\t\t\tif (!(nextBaseToken.equals(nextTargetToken))) {\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tresult = result.concat(\"../\");\n\t\t\t\t\t\tif (!baseTokens.hasMoreTokens()) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnextBaseToken = baseTokens.nextToken();\n\t\t\t\t\t}\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tresult = result.concat(nextTargetToken + \"/\");\n\t\t\t\t\t\tif (!targetTokens.hasMoreTokens()) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnextTargetToken = targetTokens.nextToken();\n\t\t\t\t\t}\n\t\t\t\t\tString temp = target.getFile(); // to string\n\t\t\t\t\tresult = result.concat(temp.substring(\n\t\t\t\t\t\t\ttemp.lastIndexOf(\"/\") + 1, temp.length()));\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile (baseTokens.hasMoreTokens()) {\n\t\t\t\tresult = result.concat(\"../\");\n\t\t\t\tbaseTokens.nextToken();\n\t\t\t}\n\n\t\t\twhile (targetTokens.hasMoreTokens()) {\n\t\t\t\tnextTargetToken = targetTokens.nextToken();\n\t\t\t\tresult = result.concat(nextTargetToken + \"/\");\n\t\t\t}\n\n\t\t\tString temp = target.getFile(); // to string\n\t\t\tresult = result.concat(temp.substring(temp.lastIndexOf(\"/\") + 1,\n\t\t\t\t\ttemp.length()));\n\t\t\treturn result;\n\t\t}\n\t\treturn target.toString();\n\t}", "public String getHost() {\n\t\treturn url.getHost();\n }", "@Test\n public void testMakeRelativeURL3() throws Exception {\n URL base = new URL(\"http://ahost.invalid/a/b/c\");\n assertEquals(new URL(\"http://host.invalid/e\"),ConversionUtils.makeRelativeURL(base ,\"http://host.invalid/e\"));\n assertEquals(new URL(\"https://host.invalid/e\"),ConversionUtils.makeRelativeURL(base ,\"https://host.invalid/e\"));\n assertEquals(new URL(\"http://host.invalid:8081/e\"),ConversionUtils.makeRelativeURL(base ,\"http://host.invalid:8081/e\"));\n assertEquals(new URL(\"https://host.invalid:8081/e\"),ConversionUtils.makeRelativeURL(base ,\"https://host.invalid:8081/e\"));\n }", "public String determineURL(HttpServletRequest request)\n {\n String url = \"http://\"+request.getHeader(\"host\")+request.getContextPath()+\"/omserver\";\n return url;\n }", "public static URL adjustURL(URL resource) throws MalformedURLException {\n \t\tString urlStr = resource.getFile();\n \t\tif (urlStr.startsWith(\"file://\"))\n \t\t\turlStr.replaceFirst(\"file://localhost\", \"file://\");\n \t\telse\n \t\t\turlStr = \"file:///\" + urlStr;\n \t\treturn new URL(urlStr);\n \t}", "default HttpUrl getNodeUrl() {\n return HttpUrl.parse(getHost()).newBuilder().port(getPort()).build();\n }", "public URL getURL(String path) throws MalformedURLException {\n\t\treturn new URL(this.urlBase.getProtocol(), this.urlBase.getHost(), this.urlBase.getPort(), this.urlBase.getFile() + path);\n\t}", "private String getURL() {\n String url = profileLocation.getText().toString();\n if (url == null || url.length() == 0) {\n return url;\n }\n // if it's not the last (which should be \"Raw\") choice, we'll use the prefix\n if (!url.contains(\"://\")) { // if there is no (http|jr):// prefix, we'll assume it's a http://bit.ly/ URL\n url = \"http://bit.ly/\" + url;\n }\n return url;\n }", "@java.lang.Override\n public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n url_ = s;\n return s;\n }\n }", "public static String normalize(String url) {\n try {\n URL absoluteUrl = new URL(url);\n return new URL(\n absoluteUrl.getProtocol(), \n absoluteUrl.getHost(), \n absoluteUrl.getPort(),\n absoluteUrl.getPath())\n .toString();\n } catch (Exception ex) {\n return null;\n }\n }", "String getServerUrl();", "private String getFullLocalURI(String uri) {\n return LOCAL_NS_PREFIX + \":\" + uri;\n }", "public static String getModuleBaseUrl(HttpServletRequest request) {\n\t String requestedUri = request.getRequestURI();\n\t int contextEnd = request.getContextPath().length();\n\t int folderEnd = requestedUri.lastIndexOf('/') + 1;\n\t return requestedUri.substring(contextEnd, folderEnd);\n\t }", "public String getUrl() {\n Object ref = url_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n url_ = s;\n }\n return s;\n }\n }", "public static String getAppURL(HttpServletRequest request) {\n\t\tStringBuffer url = new StringBuffer();\n\t\tint port = request.getServerPort();\n\t\tif (port < 0) {\n\t\t\tport = 80; // Work around java.net.URL bug\n\t\t}\n\t\tString scheme = request.getScheme();\n\t\turl.append(scheme);\n\t\turl.append(\"://\");\n\t\turl.append(request.getServerName());\n\t\tif ((scheme.equals(\"http\") && (port != 80))\n\t\t\t\t|| (scheme.equals(\"https\") && (port != 443))) {\n\t\t\turl.append(':');\n\t\t\turl.append(port);\n\t\t}\n\t\turl.append(request.getContextPath());\n\t\treturn url.toString();\n\t}", "public String getBaseLinkUrl() {\n return (String) get(\"base_link_url\");\n }", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n url_ = s;\n }\n return s;\n }\n }", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n url_ = s;\n }\n return s;\n }\n }", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n url_ = s;\n }\n return s;\n }\n }", "String getRootServerBaseUrl();", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n url_ = s;\n return s;\n }\n }", "public String getUrl() {\n Object ref = url_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n url_ = s;\n return s;\n }\n }", "public URL getBaseHref() {\n return baseHref;\n }", "private String makeServerUrl(){\n\t\tURL url = null;\n\t\t\n\t\t//Make sure we have a valid url\n\t\tString complete = this.preferences.getString(\"server\", \"\");\n\t\ttry {\n\t\t\turl = new URL( complete );\n\t\t} catch( Exception e ) {\n\t\t\tonCreateDialog(DIALOG_INVALID_URL).show();\n\t\t\treturn null;\n\t\t}\n\t\treturn url.toExternalForm();\n\t}", "public String findRealUrl(String dataUrl) {\n Validate.notNull(dataUrl);\n RestTemplate restTemplate = new RestTemplate(new SimpleClientHttpRequestFactory() {\n @Override\n protected void prepareConnection(HttpURLConnection connection, String httpMethod) {\n connection.setInstanceFollowRedirects(false);\n }\n });\n ResponseEntity<String> result = restTemplate.exchange(dataUrl, HttpMethod.GET, new HttpEntity<String>(\"\"), String.class, new Object());\n String location = result.getHeaders().getLocation() == null ? \"\" : result.getHeaders().getLocation().toString();\n if (location != null) {\n location = StringUtils.replace(location, \"http://\", \"https://\");\n }\n return location;\n }", "String getServerBaseURL();", "java.lang.String getUri();", "java.lang.String getUri();", "public static String setURL(String endpoint) {\n String url = hostName + endpoint;\n\n log.info(\"Enpoint: \" + endpoint);\n\n return url;\n\n }", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n url_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n url_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public static String getBaseURL()\r\n {\r\n String savedUrl = P.getChoreoServicesUrl();\r\n return savedUrl.length() > 0 ? savedUrl : Config.DEFAULT_SERVER_URL;\r\n }", "public String getUrl() {\n Object ref = url_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n url_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getUnproxiedFieldDataServerUrl() {\n\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);\n\t\tString hostName = prefs.getString(\"serverHostName\", \"\");\n\t\tString context = \"bdrs-core\";//prefs.getString(\"contextName\", \"\");\n\t\tString path = prefs.getString(\"path\", \"\");\n\t\t\n\t\tStringBuilder url = new StringBuilder();\n\t\turl.append(\"http://\").append(hostName).append(\"/\").append(context);\n\t\t\n\t\tif (path.length() > 0) {\n\t\t\turl.append(\"/\").append(path);\n\t\t}\n\t\t\n\t\treturn url.toString();\n\t}", "public static String getURL() {\n\t return getURL(BackOfficeGlobals.ENV.NIS_USE_HTTPS, BackOfficeGlobals.ENV.NIS_HOST, BackOfficeGlobals.ENV.NIS_PORT);\n\t}", "public URL getURL(String location) throws MalformedURLException {\n Context envContext = null;\n try {\n envContext = (Context)this.context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);\n } catch (ContextException e){\n getLogger().error(\"ContextException in getURL\",e);\n }\n if (envContext == null) {\n getLogger().warn(\"no environment-context in application context (making an absolute URL)\");\n return new URL(location);\n }\n URL u = envContext.getResource(\"/\" + location);\n if (u != null)\n return u;\n else {\n getLogger().info(location + \" could not be found. (possible context problem)\");\n throw new MalformedURLException(location + \" could not be found. (possible context problem)\");\n }\n }", "public static String UrlToHit(){\n\t\treturn BaseURL;\n\t}", "protected abstract String getPublicUrl(URL url);", "@Override\n\tpublic URL getBaseURL() {\n\t\tURL url = null;\n\t\tString buri = getBaseURI();\n\t\tif (buri != null) {\n\t\t\ttry {\n\t\t\t\turl = new URL(buri);\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\ttry {\n\t\t\t\t\tString docuri = document.getDocumentURI();\n\t\t\t\t\tif (docuri != null) {\n\t\t\t\t\t\tURL context = new URL(docuri);\n\t\t\t\t\t\turl = new URL(context, buri);\n\t\t\t\t\t}\n\t\t\t\t} catch (MalformedURLException e1) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn url;\n\t}", "public static String getBaseURI() {\n\t\treturn getIP() + \":\" + getPort();\r\n//\t\tURIBuilder builder = new URIBuilder();\r\n//\t\tbuilder.setScheme(\"http\");\r\n//\t\tbuilder.setHost(getIP());\r\n//\t\tbuilder.setPort(Integer.valueOf(getPort()));\r\n//\t\tbuilder.setPath(\"/\"+getVersion());\r\n//\t\treturn builder.toString();\r\n//\t\treturn \"http://\" + getIP() + \":\" + getPort()\r\n//\t\t\t\t+ \"/\"+getVersion();\r\n\t}", "public String appBaseUrl() {\n int amtToTrim = request.getServletPath().length() + request.getPathInfo().length();\n String appBase = requestURL.substring(0, requestURL.length()-amtToTrim);\n return appBase;\n }", "public String getBaseUrl()\r\n {\r\n return this.url;\r\n }", "String getRequestURL();", "public final String getUrl() {\n return properties.get(URL_PROPERTY);\n }", "public java.lang.String getUrl() {\n java.lang.Object ref = url_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n url_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getUrl() {\n\t\tif (prop.getProperty(\"url\") == null)\n\t\t\treturn \"\";\n\t\treturn prop.getProperty(\"url\");\n\t}", "public String getUrl() {\n Object ref = url_;\n if (!(ref instanceof String)) {\n String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n url_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public static String determineBaseUrl(String url) {\r\n\t\t// Determine the index of the first slash after the first period.\r\n\t\tint firstSub = url.indexOf(\"/\", url.indexOf(\".\"));\r\n\t\t\r\n\t\tif (firstSub == -1)\r\n\t\t\t// There were no sub directories included in the URL.\r\n\t\t\treturn url;\r\n\t\telse\r\n\t\t\treturn url.substring(0, firstSub);\r\n\t}", "public String getURL();", "String getUrl();", "String getUrl();" ]
[ "0.68222845", "0.65912133", "0.65142065", "0.6478605", "0.637371", "0.63688034", "0.63179654", "0.6296165", "0.6252989", "0.62479186", "0.62334627", "0.61314255", "0.61016166", "0.6063193", "0.60526437", "0.605012", "0.6045805", "0.5906696", "0.5901631", "0.5868659", "0.5853198", "0.583889", "0.5811176", "0.57986987", "0.57772285", "0.57632715", "0.57546383", "0.574167", "0.5738169", "0.5720648", "0.5711196", "0.5694803", "0.56904954", "0.56833416", "0.5661654", "0.56577533", "0.56538785", "0.5604707", "0.5586804", "0.5586804", "0.5586804", "0.5586804", "0.5586804", "0.5586804", "0.5583908", "0.5581438", "0.5574034", "0.55562705", "0.55539393", "0.55482066", "0.5540528", "0.55386746", "0.5528653", "0.5517377", "0.5513651", "0.5489885", "0.5489412", "0.54860973", "0.5484157", "0.54794455", "0.5469912", "0.54680204", "0.54634446", "0.54625255", "0.54624313", "0.5460489", "0.5460489", "0.54504234", "0.5446739", "0.54396755", "0.54330486", "0.54266065", "0.5414465", "0.541042", "0.54022443", "0.539363", "0.539363", "0.5391356", "0.5391309", "0.5391309", "0.5376712", "0.537641", "0.5374371", "0.5369067", "0.5366346", "0.5364258", "0.5350445", "0.5342748", "0.5329543", "0.5326315", "0.5324645", "0.53223014", "0.5318575", "0.53132606", "0.53066725", "0.53002125", "0.5292453", "0.5280099", "0.5271996", "0.5271996" ]
0.72859377
0
Get the full URLs for the given relative URLs.
public String[] getURLs(String... relativeUrls) { String[] absoluteUrls = new String[relativeUrls.length]; for (int i = 0; i < relativeUrls.length; ++i) absoluteUrls[i] = getURL(relativeUrls[i]); return absoluteUrls; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<String> getURLs(List<WebElement> links) {\n\t\t List<String> ListHref = new ArrayList<String>();\n\t\t \n\t\t //loops through all links\n\t\t for(WebElement Webhref:links) {\n\t\t\t \n\t\t\t //if element isn't null\n\t\t\t if (Webhref.getAttribute(\"href\") != null) {\n\t\t\t\t String StringHref = (Webhref.getAttribute(\"href\")).toString();\n\n\t\t\t\t //if page isn't part of domain, ignore\n\t\t\t\t if (StringHref.startsWith(variables.domain)) {\n\t\t\t\t\t //System.out.println(StringHref);\n\t\t\t\t\t \n\t\t\t\t\t //if page doesn't have an octothorpe\n\t\t\t\t\t if (!StringHref.contains(\"#\")) {\n\t\t\t\t\t\t \n\t\t\t\t\t\t//if page doesn't ends with one of the file extensions to not use\n\t\t\t\t\t\t String extension = getExtension(StringHref);//gets TLD from URL\n\t\t\t\t\t\t if(!variables.list.stream().anyMatch(extension::contains)) {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t//if value isn't already part of this array or the already crawled array\n\t\t\t\t\t\t\t if(!ListHref.contains(StringHref) && !variables.crawled.contains(StringHref)) {\n\t\t\t\t\t\t\t\t ListHref.add(StringHref);\n\t\t\t\t\t\t\t\t //System.out.println(StringHref);\n\t\t\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\treturn ListHref;\n\t}", "public Stream<ParsedURL> urls() {\n return stream().map(req -> new ParsedURL(req.getUrl()));\n }", "private List<URL> getJsonUrls(\n TreeLogger treeLogger,\n URL[] urls\n ) throws UnableToCompleteException {\n List<URL> jsonUrls = new ArrayList<>();\n for (URL url : urls) {\n\n jsonUrls.add(url);\n\n /**\n * check if filename is in format that could indicate that we have\n * url series <resourceName>_0.json\n */\n final RegExp compile = RegExp.compile(\"(.+)_(\\\\d+)\\\\.(\\\\w+)\");\n final MatchResult exec = compile.exec(url.getPath().substring(url.getPath().lastIndexOf(\"/\") + 1));\n if (exec != null) {\n final String filePrefix = exec.getGroup(1);\n int fileSequenceIndex = Integer.valueOf(exec.getGroup(2));\n final String fileExtension = exec.getGroup(3);\n URL siblingUrl = null;\n\n try {\n while (true) {\n String siblingUri = filePrefix + \"_\" + (++fileSequenceIndex) + \".\" + fileExtension;\n siblingUrl = new URL(url, siblingUri);\n siblingUrl.openStream();\n if (!jsonUrls.contains(siblingUrl)) {\n jsonUrls.add(siblingUrl);\n }\n }\n } catch (MalformedURLException e) {\n treeLogger.log(TreeLogger.ERROR, \"Reading of sibling texture atlas failed \", e);\n throw new UnableToCompleteException();\n } catch (IOException e) {\n if (Objects.equals(siblingUrl, url)) {\n treeLogger.log(TreeLogger.ERROR, \"Reading of sibling texture atlas failed \", e);\n throw new UnableToCompleteException();\n } else {\n // all siblings found process is finished\n }\n }\n }\n }\n return jsonUrls;\n }", "public URL[] getUrls() {\n\t\treturn urls.toArray(new URL[urls.size()]);\n\t}", "private final Map<String, String> getUrls(String themeDir, UrlBuilder urlBuilder) {\n // The urls that are accessible to the templates. \n // NB We are not using our menu object mechanism to build menus here, because we want the \n // view to control which links go where, and the link text and title.\n Map<String, String> urls = new HashMap<String, String>();\n \n urls.put(\"home\", urlBuilder.getHomeUrl());\n \n urls.put(\"about\", urlBuilder.getPortalUrl(Route.ABOUT));\n if (ContactMailServlet.getSmtpHostFromProperties() != null) {\n urls.put(\"contact\", urlBuilder.getPortalUrl(Route.CONTACT));\n }\n urls.put(\"search\", urlBuilder.getPortalUrl(Route.SEARCH)); \n urls.put(\"termsOfUse\", urlBuilder.getPortalUrl(Route.TERMS_OF_USE)); \n urls.put(\"login\", urlBuilder.getPortalUrl(Route.LOGIN)); \n urls.put(\"logout\", urlBuilder.getLogoutUrl()); \n urls.put(\"siteAdmin\", urlBuilder.getPortalUrl(Route.LOGIN)); \n \n urls.put(\"siteIcons\", urlBuilder.getPortalUrl(themeDir + \"/site_icons\"));\n return urls;\n }", "public String[] getUrls() {\n\t\tif (results == null)\n\t\t\treturn null;\n\t\tWebSearchResult[] resultsArray = results.listResults();\n\t\tString[] urls = new String[resultsArray.length];\n\t\tfor (int i = 0; i < urls.length; i++) {\n\t\t\turls[i] = resultsArray[i].getUrl();\n\t\t}\n\t\treturn urls;\n\t}", "private Set<String> findNewUrls(Document doc) {\n Set<String> newUrlSet = new HashSet<>();\n\n for (Element ah : doc.select(\"a[href]\")) {\n String href = ah.attr(\"abs:href\");\n\n if (!urlSet.contains(href) // Check if this is a new URL\n && href.contains(domain) // Check if the URL is from the same domain\n && isValidExtension(href) // Check that the file extension is not in the list of excluded extensions\n && !href.contains(\"mailto:\") // Check that the href is not an email address\n ) {\n newUrlSet.add(href);\n }\n\n }\n\n processNewUrls(newUrlSet);\n return newUrlSet;\n }", "public void getLinks() {\n\n var client = HttpClient.newBuilder()\n .followRedirects(HttpClient.Redirect.ALWAYS)\n .build();\n\n HttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(URL_PREFIX))\n .build();\n client.sendAsync(request, HttpResponse.BodyHandlers.ofLines())\n .thenApply(HttpResponse::body)\n .thenApply(this::processLines)\n .thenApply(versions -> tasks(versions))\n .join();\n }", "public Map<String, URLValue> loadAllURLs()\n\t{\n\t\tEntityCursor<URLEntity> results = this.env.getEntityStore().getPrimaryIndex(String.class, URLEntity.class).entities();\n\t\tMap<String, URLValue> urls = new HashMap<String, URLValue>();\n\t\tURLValue url;\n\t\tfor (URLEntity entity : results)\n\t\t{\n\t\t\turl = new URLValue(entity.getKey(), entity.getURL(), entity.getUpdatingPeriod());\n\t\t\turls.put(url.getKey(), url);\n\t\t}\n\t\tresults.close();\n\t\treturn urls;\n\t}", "public List<String> getUrlsToCheck(CachedUrl cu) {\n List<String> res = new ArrayList<String>(3);\n Properties props;\n switch (detectNoSubstanceRedirectUrl) {\n case First:\n return ListUtil.list(cu.getUrl());\n case Last:\n props = cu.getProperties();\n String url = props.getProperty(CachedUrl.PROPERTY_CONTENT_URL);\n if (url == null) {\n\turl = cu.getUrl();\n }\n return ListUtil.list(url);\n case All:\n return AuUtil.getRedirectChain(cu);\n }\n return res;\n }", "public Set<URL> getTargetPageURLs(){\n\t\tSet<URL> urls = new HashSet<URL>();\n\t\tString url = \"http://www.infoq.com/news/2012/12/twemproxy;jsessionid=1652D82C3359CBAB67DA00B26BE7784B\";\n\t\turls.add(URL.valueOf(url));\n\t\treturn urls;\n\t}", "public static List<String> resolveURLs(final String css) {\n final Matcher matcher = URL.matcher(css);\n final List<String> urls = new ArrayList<String>();\n while (matcher.find()) {\n final String url = matcher.group(1);\n urls.add(url);\n }\n return urls;\n }", "public ExternalUrl getExternalUrls() {\n return externalUrls;\n }", "private void processUrls(){\n // Strip quoted tweet URL\n if(quotedTweetId > 0){\n if(entities.urls.size() > 0 &&\n entities.urls.get(entities.urls.size() - 1)\n .expandedUrl.endsWith(\"/status/\" + String.valueOf(quotedTweetId))){\n // Match! Remove that bastard.\n entities.urls.remove(entities.urls.size() - 1);\n }\n }\n\n // Replace minified URLs\n for(Entities.UrlEntity entity : entities.urls){\n // Find the starting index for this URL\n entity.indexStart = text.indexOf(entity.minifiedUrl);\n // Replace text\n text = text.replace(entity.minifiedUrl, entity.displayUrl);\n // Find the last index for this URL\n entity.indexEnd = entity.indexStart + entity.displayUrl.length();\n }\n }", "public URL[] getURLs(String mkey) {\n\t\tURL last;\n\t\tint i = 0;\n\t\tArrayList<URL> v = new ArrayList<>();\n\t\twhile (true) {\n\t\t\tlast = getURL(mkey + i);\n\t\t\ti++;\n\t\t\tif (last == null)\n\t\t\t\tbreak;\n\t\t\tv.add(last);\n\t\t}\n\t\tif (v.size() != 0) {\n\t\t\tURL[] path = new URL[v.size()];\n\t\t\treturn v.toArray(path);\n\t\t} else {\n\t\t\treturn (URL[]) getDefault(mkey);\n\t\t}\n\t}", "public List<String> getUrls() {\n\t\treturn urls;\n\t}", "Uri getUrl();", "Set<URI> fetchAllUris(ServicePath service);", "protected List<List<URL>> getDefaultUrlList() throws MalformedURLException {\n URL[] urls1 = { \n new URL(\"http://www.dre.vanderbilt.edu/~schmidt/ka.png\"),\n new URL(\"http://www.dre.vanderbilt.edu/~schmidt/uci.png\"),\n new URL(\"http://www.dre.vanderbilt.edu/~schmidt/gifs/dougs-small.jpg\")\n };\n URL[] urls2 = {\n new URL(\"http://www.cs.wustl.edu/~schmidt/gifs/lil-doug.jpg\"),\n new URL(\"http://www.cs.wustl.edu/~schmidt/gifs/wm.jpg\"),\n new URL(\"http://www.cs.wustl.edu/~schmidt/gifs/ironbound.jpg\")\n };\n\n \tList<List<URL>> variableNumberOfInputURLs = \n new ArrayList<List<URL>>();\n variableNumberOfInputURLs.add(Arrays.asList(urls1));\n variableNumberOfInputURLs.add(Arrays.asList(urls2));\n \treturn variableNumberOfInputURLs;\n }", "public List getLinks() {\r\n List links = getElements(\"a\");\r\n ArrayList result = new ArrayList();\r\n for (int i = 0; i < links.size(); i++) {\r\n try {\r\n StandAloneElement keep = ((StandAloneElement)links.get(i));\r\n result.add(parseUrl(keep.getAttribute(\"href\")));\r\n } catch (Exception e) {\r\n }\r\n }\r\n links = getElements(\"FRAME\");\r\n for (int i = 0; i < links.size(); i++) {\r\n try {\r\n StandAloneElement keep = ((StandAloneElement)links.get(i));\r\n result.add(parseUrl(keep.getAttribute(\"src\")));\r\n } catch (Exception e) {\r\n }\r\n }\r\n\r\n return result;\r\n }", "public static String toRelativeURL(URL base, URL target) {\n\t\t// Precondition: If URL is a path to folder, then it must end with '/'\n\t\t// character.\n\t\tif ((base.getProtocol().equals(target.getProtocol()))\n\t\t\t\t|| (base.getHost().equals(target.getHost()))) { // changed this logic symbol\n\n\t\t\tString baseString = base.getFile();\n\t\t\tString targetString = target.getFile();\n\t\t\tString result = \"\";\n\n\t\t\t// remove filename from URL\n\t\t\tbaseString = baseString.substring(0,\n\t\t\t\t\tbaseString.lastIndexOf(\"/\") + 1);\n\n\t\t\t// remove filename from URL\n\t\t\ttargetString = targetString.substring(0,\n\t\t\t\t\ttargetString.lastIndexOf(\"/\") + 1);\n\n\t\t\tStringTokenizer baseTokens = new StringTokenizer(baseString, \"/\");// Maybe\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// this\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// causes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// problems\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// under\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// windows\n\t\t\tStringTokenizer targetTokens = new StringTokenizer(targetString,\n\t\t\t\t\t\"/\");// Maybe this causes problems under windows\n\n\t\t\tString nextBaseToken = \"\", nextTargetToken = \"\";\n\n\t\t\t// Algorithm\n\n\t\t\twhile (baseTokens.hasMoreTokens() && targetTokens.hasMoreTokens()) {\n\t\t\t\tnextBaseToken = baseTokens.nextToken();\n\t\t\t\tnextTargetToken = targetTokens.nextToken();\n\t\t\t\tif (!(nextBaseToken.equals(nextTargetToken))) {\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tresult = result.concat(\"../\");\n\t\t\t\t\t\tif (!baseTokens.hasMoreTokens()) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnextBaseToken = baseTokens.nextToken();\n\t\t\t\t\t}\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tresult = result.concat(nextTargetToken + \"/\");\n\t\t\t\t\t\tif (!targetTokens.hasMoreTokens()) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnextTargetToken = targetTokens.nextToken();\n\t\t\t\t\t}\n\t\t\t\t\tString temp = target.getFile(); // to string\n\t\t\t\t\tresult = result.concat(temp.substring(\n\t\t\t\t\t\t\ttemp.lastIndexOf(\"/\") + 1, temp.length()));\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile (baseTokens.hasMoreTokens()) {\n\t\t\t\tresult = result.concat(\"../\");\n\t\t\t\tbaseTokens.nextToken();\n\t\t\t}\n\n\t\t\twhile (targetTokens.hasMoreTokens()) {\n\t\t\t\tnextTargetToken = targetTokens.nextToken();\n\t\t\t\tresult = result.concat(nextTargetToken + \"/\");\n\t\t\t}\n\n\t\t\tString temp = target.getFile(); // to string\n\t\t\tresult = result.concat(temp.substring(temp.lastIndexOf(\"/\") + 1,\n\t\t\t\t\ttemp.length()));\n\t\t\treturn result;\n\t\t}\n\t\treturn target.toString();\n\t}", "public List<String> getUris()\r\n/* 125: */ {\r\n/* 126:129 */ return this.uris;\r\n/* 127: */ }", "public List<Map<String,Object>> getURLs() {\n return urls;\n }", "public static String[] getHttpExportURLs() {\n\t\tif (xml == null) return new String[0];\n\t\treturn httpExportURLs;\n\t}", "public Set<String> getURLs() {\n return pageURLs;\n }", "public List<URL> getUrlsForCurrentClasspath() {\r\n ClassLoader loader = Thread.currentThread().getContextClassLoader();\r\n\r\n //is URLClassLoader?\r\n if (loader instanceof URLClassLoader) {\r\n return ImmutableList.of(((URLClassLoader) loader).getURLs());\r\n }\r\n\r\n List<URL> urls = Lists.newArrayList();\r\n\r\n //get from java.class.path\r\n String javaClassPath = System.getProperty(\"java.class.path\");\r\n if (javaClassPath != null) {\r\n\r\n for (String path : javaClassPath.split(File.pathSeparator)) {\r\n try {\r\n urls.add(new File(path).toURI().toURL());\r\n } catch (Exception e) {\r\n throw new ReflectionsException(\"could not create url from \" + path, e);\r\n }\r\n }\r\n }\r\n\r\n return urls;\r\n }", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "public static URL[] getClassLoaderURLs(ClassLoader cl)\n {\n URL[] urls = {};\n try\n {\n Class returnType = urls.getClass();\n Class[] parameterTypes = {};\n Method getURLs = cl.getClass().getMethod(\"getURLs\", parameterTypes);\n if( returnType.isAssignableFrom(getURLs.getReturnType()) )\n {\n Object[] args = {};\n urls = (URL[]) getURLs.invoke(cl, args);\n }\n }\n catch(Exception ignore)\n {\n }\n return urls;\n }", "@Override\n\tpublic String getUrls() throws TException {\n try {\n return DBUtils.getExternWebSite();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return null;\n\t}", "private RedirectUrls getRedirectURLs() {\n RedirectUrls redirectUrls = new RedirectUrls();\n redirectUrls.setReturnUrl(URL_RETURN);\n redirectUrls.setCancelUrl(URL_CANCEL);\n\n return redirectUrls;\n }", "public List<URL> newURLs() {\r\n // TODO: Implement this!\r\n return new LinkedList<URL>();\r\n }", "private ArrayList<ResultPair> InitializeManualUrls()\n {\n\t ArrayList<ResultPair> fileUrls = new ArrayList<ResultPair>();\n\t fileUrls.add(new ResultPair(\"https://www.google.com\", true));\n\t fileUrls.add(new ResultPair(\"https://///www.google.com\", false));\n\t fileUrls.add(new ResultPair(\"\", false));\n\t fileUrls.add(new ResultPair(\"http://74.125.224.72/\", true));\n\t fileUrls.add(new ResultPair(\"file:///C:/\", true));\n\t fileUrls.add(new ResultPair(\"http://WWW.GOOGLE.COM\", true));\n\t fileUrls.add(new ResultPair(\"http://www.google.com:80/test1\", true));\n\t fileUrls.add(new ResultPair(\"h3t://go.cc:65a/$23?action=edit&mode=up\", false));\n\t fileUrls.add(new ResultPair(\"12345\", false));\n\t fileUrls.add(new ResultPair(\"http://www.space in here.com\", false));\n\t fileUrls.add(new ResultPair(\"http://site.com/#citation\", true));\n\t fileUrls.add(new ResultPair(\"ftp://site.com\", true));\n\t fileUrls.add(new ResultPair(\"http://site.com/hyphen-here\", true));\n\t fileUrls.add(new ResultPair(\"http://www.example.com:8080\", true));\n\t fileUrls.add(new ResultPair(\"foo://example.com:80/over/there?name=ferret#nose\", true));\n\t fileUrls.add(new ResultPair(\"foo://example.com:80/over/there#nose\", true));\n\t fileUrls.add(new ResultPair(\"foo://example.com/there?name=ferret\", true));\n\t fileUrls.add(new ResultPair(\"foo://example.com:8042/over/there?name=ferret#nose\", true));\n\t fileUrls.add(new ResultPair(\"http://[email protected]\", true));\n\t fileUrls.add(new ResultPair(\"http://142.10.5.2:8080/\", true));\n\t return fileUrls;\n }", "@Test\n\tpublic void testGetLinksRelativeLink() {\n\t\tList<String> results = helper\n\t\t\t\t.getLinks(\"drop tables; <A HREF=\\\"/test\\\"> junk junk\", \"http://www.bobbylough.com\");\n\t\tassertEquals(1, results.size());\n\t\tassertEquals(\"http://www.bobbylough.com/test\", results.get(0));\n\t}", "@Override\n\tpublic Collection<URL> getUrlsToFilter() {\n\t\tSet<URL> filterSet = new HashSet<URL>();\n\t\tString url=\"http://www.infoq.com/news/2012/11/Panel-WinRT-Answers;jsessionid=91AB81A159E85692E6F1199644E2053C \";\n\t\tfilterSet.add(URL.valueOf(url));\n\t\treturn filterSet;\n\t}", "public Set<String> getFullTextUrls(final Record record)\n {\n \treturn MarcUtils.getFullTextUrls(record);\n }", "private URL[] urlsFromJARs(final String[] jarNames) throws MalformedURLException {\n URL[] urls = new URL[jarNames.length];\n for(int i = 0; i < urls.length; i++) {\n urls[i] = new URL(translateCodebase()+jarNames[i]);\n }\n return (urls);\n }", "private List<String> getApiEndpointUrls(final OperationHolder operationHolder, final List<Server> servers) {\r\n\t\tList<String> endpointUrls = null;\r\n\t\tif(!CollectionUtils.isEmpty(servers)) {\r\n\t\t\tendpointUrls = servers.stream().map(s -> s.getUrl() + operationHolder.getUrlPath()).collect(Collectors.toList());\r\n\t\t}\r\n\t\treturn endpointUrls;\r\n\t}", "public List<String> getLinks();", "@Test\n public void testMakeRelativeURL3() throws Exception {\n URL base = new URL(\"http://ahost.invalid/a/b/c\");\n assertEquals(new URL(\"http://host.invalid/e\"),ConversionUtils.makeRelativeURL(base ,\"http://host.invalid/e\"));\n assertEquals(new URL(\"https://host.invalid/e\"),ConversionUtils.makeRelativeURL(base ,\"https://host.invalid/e\"));\n assertEquals(new URL(\"http://host.invalid:8081/e\"),ConversionUtils.makeRelativeURL(base ,\"http://host.invalid:8081/e\"));\n assertEquals(new URL(\"https://host.invalid:8081/e\"),ConversionUtils.makeRelativeURL(base ,\"https://host.invalid:8081/e\"));\n }", "@Override\n protected List<String> convertDoisToUrls(Collection<String> dois) {\n List<String> urls = new ArrayList<String>();\n for(String doi:dois) {\n // Encode the doi, then revert the FIRST %2F (slash) back to a \"/\":\n // 10.1023/A%3A1026541510549, not\n // 10.1023%2FA%3A1026541510549\n String url = String.format(\"%sarticle/%s\", baseUrl, encodeDoi(doi).replaceFirst(\"%2F\",\"/\"));\n urls.add(url);\n }\n return urls;\n }", "public static URL[] HTMLLinks(String url) throws Exception\n\t{\n\t\t// Get the links\n\n\t\tURLConnection conn = (new java.net.URL(url)).openConnection();\n\t\tconn.setRequestProperty(\"User-Agent\",\"Mozilla/5.0 ( compatible ) \");\n\t\tconn.setRequestProperty(\"Accept\",\"*/*\");\n\n\t\tLinkBean sb = new LinkBean();\n\t\tsb.setURL(url);\n\t\tsb.setConnection(conn);\n\t\tURL[] outlinks = sb.getLinks();\n\n\t\t// make links fully qualified\n\t\tURI baseURI = null;\n\t\ttry\n\t\t{\n\t\t\tbaseURI = new URI(url);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tlogger.error(e.getMessage(), e);\n\t\t\treturn new URL[0];\n\t\t}\n\n\t\t// ----\n\t\tList<URL> fqurls = new ArrayList<URL>();\n\t\tfor (int i = 0; i < outlinks.length; i++)\n\t\t{\n\t\t\tURL fqurl = null;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tfqurl = baseURI.resolve(outlinks[i].toURI()).toURL();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tlogger.error(e.getMessage(), e);\n\t\t\t}\n\t\t\tif (fqurl != null)\n\t\t\t{\n\t\t\t\tfqurls.add(fqurl);\n\t\t\t}\n\t\t}\n\t\treturn fqurls.toArray(new URL[fqurls.size()]);\n\t}", "private @NotNull List<String> getAllLinks(final String text, final String urlStart) {\n List<String> links = new ArrayList<>();\n\n int i = 0;\n while (text.indexOf(urlStart, i) != -1) {\n int linkStart = text.indexOf(urlStart, i);\n int linkEnd = text.indexOf(\" \", linkStart);\n if (linkEnd != -1) {\n String link = text.substring(linkStart, linkEnd);\n links.add(link);\n } else {\n String link = text.substring(linkStart);\n links.add(link);\n }\n i = text.indexOf(urlStart, i) + urlStart.length();\n }\n\n return links;\n }", "public String getFinalUrls() {\r\n return finalUrls;\r\n }", "public static void AddUrls (List<String> links) {\n\t for(String LoopedLinks:links) { \n\t\n\t\t//if page isn't part of domain, ignore\n\t\t if (LoopedLinks.startsWith(variables.domain)) {\n\t\n\t\t\t //if page doesn't have an octothorpe\n\t\t\t if (!LoopedLinks.contains(\"#\")) {\n\t\t\t\t \n\t\t\t\t //if page doesn't ends with one of the file extensions to not use\n\t\t\t\t String extension = getExtension(LoopedLinks);//gets file extension from URL\n\t\t\t\t if(!variables.list.stream().anyMatch(extension::contains)) {\n\n\t\t\t\t\t //if link isn't already part of master list, add it.\n\t\t\t\t\t if(!variables.master.contains(LoopedLinks)) {\n\t\t\t\t\t\t Reporter.log(\"Adding to master list \"+LoopedLinks, variables.verboseReport);\n\t\t\t\t\t\t variables.master.add(LoopedLinks);\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t }\n\t}", "String getUrl();", "String getUrl();", "String getUrl();", "String getUrl();", "String getUrl();", "public static String getRelativeUrl() {\n return url;\n }", "public static List<String> extract(Document document) {\n Elements links = document.select(\"a[href]\");\n Elements media = document.select(\"[src]\");\n Elements imports = document.select(\"link[href]\");\n\n List<String> allLinks = new ArrayList<>();\n populateLinks(allLinks, media, \"abs:src\");\n populateLinks(allLinks, imports, \"abs:href\");\n populateLinks(allLinks, links, \"abs:href\");\n return allLinks;\n }", "@Override\n public List<RedirectUrl> findUrlsForAccountId(String accountId) {\n return redirectUrlRepository.findByAccountAccountId(accountId);\n }", "@Override\r\n public List<String> getMatchedURIs() {\n return null;\r\n }", "protected abstract String getUrl();", "public GiftCardProductQuery relativeUrl() {\n startField(\"relative_url\");\n\n return this;\n }", "public List<String> listAllRemoteSites () {\r\n\t\ttry {\r\n\t\t\tList<String> urls = new ArrayList<String>();\r\n\t\t\tpstmt = conn.prepareStatement(\"SELECT * FROM RemoteSite\");\r\n\t\t\trset = pstmt.executeQuery();\r\n\t\t\twhile (rset.next()) {\r\n\t\t\t\turls.add(rset.getString(\"url\"));\r\n\t\t\t}\r\n\t\t\treturn urls;\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t} finally {\r\n\t\t\tDatabaseConnection.closeStmt(pstmt, rset);\r\n\t\t}\r\n\t}", "public List<Path> toAbsPaths(Collection<Path> tipPaths) {\n\t\tList<Path> result = tipPaths.stream().map(this::tipPathToAbsPath).collect(Collectors.toList());\n\t\treturn result;\n\t}", "public static List<String> getAccessibleRelPaths(final String username)\n\t{\n\t\tList<String> relPaths = new ArrayList<String>();\n\t\t//--- return an empty list is the given username has not been assigned with any relative paths yet ---//\n\t\tif (!username2accesses.containsKey(username)) return relPaths;\n\t\tList<Access> accesses = username2accesses.get(username);\n\t\tfor (final Access access : accesses)\n\t\t{\n\t\t\trelPaths.add(access.getRelPath());\n\t\t}\n\t\treturn relPaths;\n\t}", "@Override\n\tpublic String[] getPublicUrlPatterns() {\n\t\treturn null;\n\t}", "public Uri getUrl() {\n return Uri.parse(urlString);\n }", "public URI[] getLinks(String expression, Map<String, String> namespaces) {\n String[] values = getValues(expression, namespaces);\n if (values == null) {\n return null;\n }\n URI[] uris = new URI[values.length];\n for (int i = 0; i < values.length; i++) {\n uris[i] = URI.create(values[i]);\n }\n return uris;\n }", "Collection<? extends Object> getHadithUrl();", "URL getUrl();", "java.net.URL getUrl();", "private URI findBaseUrl0(String stringUrl) throws URISyntaxException {\n stringUrl = stringUrl.replace(\"\\\\\", \"/\");\n int qindex = stringUrl.indexOf(\"?\");\n if (qindex != -1) {\n // stuff after the ? tends to make the Java URL parser burp.\n stringUrl = stringUrl.substring(0, qindex);\n }\n URI url = new URI(stringUrl);\n URI baseUrl = new URI(url.getScheme(), url.getAuthority(), url.getPath(), null, null);\n\n String path = baseUrl.getPath().substring(1); // toss the leading /\n String[] pieces = path.split(\"/\");\n List<String> urlSlashes = new ArrayList<String>();\n // reverse\n for (String piece : pieces) {\n urlSlashes.add(piece);\n }\n List<String> cleanedSegments = new ArrayList<String>();\n String possibleType = \"\";\n boolean del;\n\n for (int i = 0; i < urlSlashes.size(); i++) {\n String segment = urlSlashes.get(i);\n\n // Split off and save anything that looks like a file type.\n if (segment.indexOf(\".\") != -1) {\n possibleType = segment.split(\"\\\\.\")[1];\n\n /*\n * If the type isn't alpha-only, it's probably not actually a file extension.\n */\n if (!possibleType.matches(\"[^a-zA-Z]\")) {\n segment = segment.split(\"\\\\.\")[0];\n }\n }\n\n /**\n * EW-CMS specific segment replacement. Ugly. Example:\n * http://www.ew.com/ew/article/0,,20313460_20369436,00.html\n **/\n if (segment.indexOf(\",00\") != -1) {\n segment = segment.replaceFirst(\",00\", \"\");\n }\n\n // If our first or second segment has anything looking like a page\n // number, remove it.\n /* Javascript code has some /i's here, we might need to fiddle */\n Matcher pnMatcher = Patterns.PAGE_NUMBER_LIKE.matcher(segment);\n if (pnMatcher.matches() && ((i == 1) || (i == 0))) {\n segment = pnMatcher.replaceAll(\"\");\n }\n\n del = false;\n\n /*\n * If this is purely a number, and it's the first or second segment, it's probably a page number.\n * Remove it.\n */\n if (i < 2 && segment.matches(\"^\\\\d{1,2}$\")) {\n del = true;\n }\n\n /* If this is the first segment and it's just \"index\", remove it. */\n if (i == 0 && segment.toLowerCase() == \"index\")\n del = true;\n\n /*\n * If our first or second segment is smaller than 3 characters, and the first segment was purely\n * alphas, remove it.\n */\n /* /i again */\n if (i < 2 && segment.length() < 3 && !urlSlashes.get(0).matches(\"[a-z]\"))\n del = true;\n\n /* If it's not marked for deletion, push it to cleanedSegments. */\n if (!del) {\n cleanedSegments.add(segment);\n }\n }\n\n String cleanedPath = \"\";\n for (String s : cleanedSegments) {\n cleanedPath = cleanedPath + s;\n cleanedPath = cleanedPath + \"/\";\n }\n URI cleaned = new URI(url.getScheme(), url.getAuthority(), \"/\"\n + cleanedPath.substring(0, cleanedPath\n .length() - 1), null, null);\n return cleaned;\n }", "public List<URL> getURLList(final String key) {\n return getURLList(key, new ArrayList<>());\n }", "static List<String> read() {\n String fileName = getFilePath();\n List<String> urls = new ArrayList<>();\n \n if (Files.notExists(Paths.get(fileName))) {\n return urls;\n }\n \n try (Stream<String> stream = Files.lines(Paths.get(fileName))) {\n urls = stream\n // Excludes lines that start with # as that is used for comments\n // and must start with http:// as that is required by crawler4j.\n .filter(line -> !line.startsWith(\"#\") &&\n line.startsWith(\"http://\") || line.startsWith(\"https://\"))\n .map(String::trim)\n .map(String::toLowerCase)\n .collect(Collectors.toList());\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n return urls;\n }", "private void ExtractURLs(String line)\n {\n String matchedURL = \"\";\n Matcher urlMatcher = urlPattern.matcher(line);\n\n while (urlMatcher.find())\n {\n matchedURL = urlMatcher.group();\n\n if (!distinctURLs.containsKey(matchedURL))\n {\n distinctURLs.put(matchedURL,matchedURL);\n }\n }\n }", "@Override\n\tpublic List<URL> getPhotos() {\n\t\timages.clear(); //vide la liste des images\n\t\t\n\t\t\n\t\tList<URL> allImagesURL = new ArrayList<URL>();\n\t\t\n\t\t/* On initialise la liste de toutes les images */\n\t\tList<String> filelocations = null;\n\t\t\n\t\t/*Nous allons retrouver les fichiers images présent dans le répertoire et tous ses sous-répertoires*/\n\t\tPath start = Paths.get(path); //détermine le point de départ \n\t\ttry (Stream<Path> stream = Files.walk(start, Integer.MAX_VALUE)) {\n\t\t filelocations = stream\n\t\t .map(String::valueOf) //transforme les Path en string\n\t\t .filter(filename -> filename.contains(\".jpg\") || filename.contains(\".png\")) //ne prend que les images jpg et png\n\t\t .collect(Collectors.toList());\n\t\t \n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t/* Pour chaque fichier retrouvé, on essaie de retrouver son chemin absolu pour le stocker dans le allImagesURL */\n\t\tfor (String filelocation : filelocations) {\n\t\t\tString relativeLocation = filelocation.replace(path+\"/\", \"\"); // Pour ne pas partir de src mais de la classe courante\n\t\t\trelativeLocation = relativeLocation.replace(windowspath+\"\\\\\", \"\");\n\t\t\tallImagesURL.add(this.getClass().getResource(relativeLocation)); //on ajoute le chemin absolu dans la liste\n\t\t}\n\t\t\n\t\t\n\t\treturn allImagesURL; //on retourne la liste\n\t}", "public StringBuilder getLinks(Elements imgs) {\n\t\tStringBuilder links = new StringBuilder();\n\t\tString prefix = \"\";\n\t\tfor (Element item : imgs) {\n\t\t\tlinks.append(prefix);\n\t\t\tprefix = \"|\";\n\t\t\tlinks.append(item.attr(\"href\"));\n }\n\t\treturn links;\n\t}", "@Scheduled(fixedRate = checkRate - 1000) // Un minuto menos\n public void getUrls() {\n urlList = shortURLRepository.listAll();\n }", "private LinkedList<String> getFileURIs(IResource[] members, String fileExtension) throws CoreException {\r\n\t\tLinkedList<String> uriList = new LinkedList<String>();\r\n\r\n\t\tIFile tmpFile;\r\n\t\tIFolder tmpFolder;\r\n\r\n\t\tfor (IResource resource : members) {\r\n\t\t\tif (resource.getType() == IResource.FOLDER) {\r\n\t\t\t\ttmpFolder = (IFolder) resource;\r\n\t\t\t\turiList.addAll(getFileURIs(tmpFolder.members(), fileExtension));\r\n\t\t\t}\r\n\r\n\t\t\tif (resource.getType() == IResource.FILE) {\r\n\t\t\t\ttmpFile = (IFile) resource;\r\n\t\t\t\tif (tmpFile.getFileExtension().equals(fileExtension)) {\r\n\t\t\t\t\turiList.add(tmpFile.getLocationURI().toString());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn uriList;\r\n\t}", "List<Link> getLinks();", "public List<Diary> diaryUrlInflater(HashSet<String> analyzedUrls) {\r\n\t\tthis.analyzedUrls = analyzedUrls;\r\n\t\tIterator<String> iterator = null;\r\n\t\tfor (int i = 0; i < this.diaries.size(); i++) {\r\n\t\t\tDiary diary = this.diaries.get(i);\r\n\t\t\titerator = this.analyzedUrls.iterator();\r\n\t\t\twhile (iterator.hasNext()) {\r\n\t\t\t\tString url = iterator.next();\r\n\t\t\t\tif (url.contains(diary.getDiaryBasicUrl())) {\r\n\t\t\t\t\tdiary.addUrl(url);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this.diaries;\r\n\r\n\t}", "private List<String> getOfferPagesLinks(Document document) {\n return document.select(\"div[class=product-image loaded] > a[href]\").eachAttr(\"abs:href\");\n }", "public Collection<Map<String, String>> getLinks();", "public URL standardizeURL(URL startingURL);", "public URL makeFullUrl(String scrapedString, URL base);", "protected String[] determineUrlsForHandler(String beanName) {\r\n\t\t\r\n//\t\tList urls = new ArrayList();\r\n//\t\tif (beanName.startsWith(\"/\")) {\r\n//\t\t\turls.add(beanName);\r\n//\t\t}\r\n//\t\tString[] aliases = getApplicationContext().getAliases(beanName);\r\n//\t\tfor (int i = 0; i < aliases.length; i++) {\r\n//\t\t\tif (aliases[i].startsWith(\"/\")) {\r\n//\t\t\t\turls.add(aliases[i]);\r\n//\t\t\t}\r\n//\t\t}\r\n//\t\treturn StringUtil.toStringArray(urls);\r\n//\t\tboolean iscontroller = beanName != null && beanName.startsWith(\"/\");\r\n//\t\tPro pro = this.getApplicationContext().getProBean(beanName);\r\n//\t\tboolean restful = pro.getBooleanExtendAttribute(\"restful\", false);\r\n//\t\tif(iscontroller)\r\n//\t\t{\r\n//\t\t\t\r\n//\t\t\t\treturn beanName.split(\",\");\r\n//\t\t\t\r\n//\t\t}\r\n\t\t\r\n//\t\treturn null;\r\n//\t\treturn determineUrlsForHandler_(beanName);\r\n\t\treturn HandlerUtils.determineUrlsForHandler(getApplicationContext(), beanName, null);\r\n\t}", "@Override\r\n public List<String> getMatchedURIs(boolean arg0) {\n return null;\r\n }", "public Urls getUrls(ISelector selector) {\n\t\treturn (Urls) selectBySelector(selector);\n\t}", "protected List<BaseUrl> parseBaseUrl(\n XmlPullParser xpp, List<BaseUrl> parentBaseUrls, boolean dvbProfileDeclared)\n throws XmlPullParserException, IOException {\n @Nullable String priorityValue = xpp.getAttributeValue(null, \"dvb:priority\");\n int priority =\n priorityValue != null\n ? Integer.parseInt(priorityValue)\n : (dvbProfileDeclared ? DEFAULT_DVB_PRIORITY : PRIORITY_UNSET);\n @Nullable String weightValue = xpp.getAttributeValue(null, \"dvb:weight\");\n int weight = weightValue != null ? Integer.parseInt(weightValue) : DEFAULT_WEIGHT;\n @Nullable String serviceLocation = xpp.getAttributeValue(null, \"serviceLocation\");\n String baseUrl = parseText(xpp, \"BaseURL\");\n if (UriUtil.isAbsolute(baseUrl)) {\n if (serviceLocation == null) {\n serviceLocation = baseUrl;\n }\n return Lists.newArrayList(new BaseUrl(baseUrl, serviceLocation, priority, weight));\n }\n\n List<BaseUrl> baseUrls = new ArrayList<>();\n for (int i = 0; i < parentBaseUrls.size(); i++) {\n BaseUrl parentBaseUrl = parentBaseUrls.get(i);\n String resolvedBaseUri = UriUtil.resolve(parentBaseUrl.url, baseUrl);\n String resolvedServiceLocation = serviceLocation == null ? resolvedBaseUri : serviceLocation;\n if (dvbProfileDeclared) {\n // Inherit parent properties only if dvb profile is declared.\n priority = parentBaseUrl.priority;\n weight = parentBaseUrl.weight;\n resolvedServiceLocation = parentBaseUrl.serviceLocation;\n }\n baseUrls.add(new BaseUrl(resolvedBaseUri, resolvedServiceLocation, priority, weight));\n }\n return baseUrls;\n }", "public static Collection<String> getURLResources(URL dirURL) throws IOException {\n if (dirURL.getProtocol().equals(\"file\")) {\n /* A file path: easy enough, but need to decode when path contains \"blanks\" (tested under windows) */\n try {\n return Arrays.asList(new File(URLDecoder.decode(dirURL.getPath(), \"UTF-8\")).list());\n } catch (Exception ignore) {\n try {\n return Arrays.asList(new File(dirURL.getPath()).list());\n } catch (Exception ex) {\n throw new IOException(\"Cannot list directory \" + dirURL.getPath(), ex);\n }\n }\n } else if (dirURL.getProtocol().equals(\"jar\")) {\n /* A JAR path */\n String urlPath = dirURL.getPath();\n int idx2 = urlPath.indexOf(\"!\");\n String jarPath = urlPath.substring(5, idx2); //strip out only the JAR file\n String resourceDir = urlPath.substring(idx2 + 2, urlPath.length());\n if (!resourceDir.endsWith(\"/\")) resourceDir = resourceDir + \"/\";\n JarFile jar;\n try {\n // there that say so: http://stackoverflow.com/questions/6247144/how-to-load-a-folder-from-a-jar\n jar = new JarFile(URLDecoder.decode(jarPath, \"UTF-8\"));\n } catch (Exception ignore) {\n try {\n // but on my Mac this sometimes doesn't work, but this works:\n jar = new JarFile(jarPath);\n } catch (Exception ex) {\n throw new IOException(\"Cannot open jar \" + jarPath + \" in \" + dirURL, ex);\n }\n }\n Enumeration<JarEntry> entries = jar.entries(); //gives ALL entries in jar\n Set<String> result = new HashSet<String>(); //avoid duplicates in case it is a subdirectory\n while (entries.hasMoreElements()) {\n String name = entries.nextElement().getName();\n if (name.length() > resourceDir.length() &&\n name.startsWith(resourceDir)) { //filter according to the path\n result.add(new File(name).getName());\n }\n }\n return result;\n } else {\n return readLines(dirURL);\n }\n }", "List<WebURL> Filter(List<WebURL> urls){\n return null;\n }", "@RequestMapping(value = \"urls\", method = RequestMethod.GET)\n @ResponseBody\n @ResponseStatus(HttpStatus.OK)\n public List<MonitoredUrl> getUrls()\n {\n System.out.println(\"geturls\");\n return urlChecker.getMonitoredUrls();\n }", "public URL makeBase(URL startingURL);", "java.lang.String getHotelImageURLs(int index);", "public static List generateTimeUrls(DataSourceImpl datasource,\n String url) {\n List urls = new ArrayList();\n if (url.indexOf(RELATIVE_TIME) >= 0) {\n Object tmp = datasource.getProperty(NUM_RELATIVE_TIMES,\n new Integer(0));\n float timeInc =\n ((Number) datasource.getProperty(RELATIVE_TIME_INCREMENT,\n new Float(1))).floatValue();\n\n int[] timeIndices;\n if (tmp instanceof Integer) {\n int numTimes = ((Integer) tmp).intValue();\n timeIndices = new int[numTimes];\n for (int i = 0; i < numTimes; i++) {\n timeIndices[i] = i;\n }\n } else {\n timeIndices = (int[]) tmp;\n }\n String[] times = makeRelativeTimes(timeIndices, timeInc);\n for (int i = 0; i < times.length; i++) {\n String newUrl = url.replaceAll(RELATIVE_TIME, times[i]);\n // System.err.println (\"url:\" + newUrl);\n urls.add(newUrl);\n }\n\n } else {\n urls.add(url);\n }\n return urls;\n }", "String getBaseUri();", "private URLs() {\n }", "public static List<UrlInfo> searchAllUrl() {\n\n //getSynonyms(queryKeywords);\n\n ArrayList<Long> keywordIdList = new ArrayList<Long>();\n ArrayList<Long> finalIdList = new ArrayList<Long>();\n\n String email = Secured.getUser(ctx());\n List<UrlEntry> entryIdList = UrlEntry.find()\n .select(\"entryId\")\n .where()\n .eq(\"email\", email)\n .findList();\n for (UrlEntry entry : entryIdList) {\n finalIdList.add(entry.getEntryId());\n }\n System.out.println(\"finalIdList---\" + finalIdList);\n List<UrlInfo> urlList = UrlInfo.find().select(\"url\").where().in(\"urlEntryId\", finalIdList).findList();\n /*ArrayList<String> urls = new ArrayList<String>();\n for (UrlInfo urlInfo : urlList) {\n urls.add(urlInfo.getUrl());\n }\n System.out.println(\"urls in search----\" + urls);*/\n return urlList;\n }", "public String getURL(String relativeUrl) {\n try {\n synchronized (mImplMonitor) {\n checkServiceLocked();\n return mImpl.getURL(relativeUrl);\n }\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\"Failed to get URL for \" + relativeUrl, e);\n }\n }", "public ArrayList<ExternalLink> getExternalLinksRecursive() {\n\t\treturn getPageObjectsRecursive(ExternalLink.class);\n\t}", "public URL[] getURLArray(final String key) {\n return getURLArray(key, EMPTY_URL_ARRAY);\n }", "public static List<String> getPaths(String url, int limit) {\n List<String> list = new ArrayList<String>();\n if (StringUtils.isEmpty(url) || !isUrlHttp(url)) {\n return list;\n }\n \n String u = url;\n if (u.contains(\"?\")) {\n u = u.split(\"\\\\?\")[0];\n }\n String domain = com.buzzinate.common.util.string.UrlUtil.getDomainName(u);\n String fulldomain = com.buzzinate.common.util.string.UrlUtil.getFullDomainName(u);\n \n // add domain to list\n list.add(domain); \n \n // add subdomain to list\n String subdomain = StringUtils.substringBefore(fulldomain, domain);\n String[] subdomains = StringUtils.split(subdomain, '.');\n String temp = domain;\n for (int index = subdomains.length - 1; index >= 0; index--) {\n temp = subdomains[index] + \".\" + temp;\n list.add(temp);\n }\n \n // add namespace to list\n String namespace = StringUtils.substringAfter(u, fulldomain);\n String[] namespaces = namespace.split(\"/\", limit + 2);\n temp = fulldomain;\n for (int i = 1; i < namespaces.length - 1; i++) {\n //System.out.println(i+\"=\"+namespaces[i]);\n if (!StringUtils.isEmpty(namespaces[i])) {\n temp += \"/\" + namespaces[i];\n list.add(temp);\n }\n }\n return list;\n }" ]
[ "0.6242626", "0.6090639", "0.5958208", "0.58269477", "0.58121586", "0.5799115", "0.5769971", "0.5704151", "0.5681045", "0.5643118", "0.56405836", "0.5635148", "0.5622282", "0.5612148", "0.5609428", "0.55853444", "0.5571935", "0.5566884", "0.55564725", "0.5553402", "0.55058354", "0.54965365", "0.54500884", "0.5427386", "0.5411488", "0.5409785", "0.5393754", "0.5393754", "0.5393754", "0.5393754", "0.5393754", "0.5393754", "0.53877205", "0.53765756", "0.535821", "0.53479606", "0.53389716", "0.53387135", "0.5313456", "0.5309725", "0.52974176", "0.52910817", "0.5283595", "0.5278226", "0.5263159", "0.52580386", "0.5247073", "0.51942664", "0.51754135", "0.51549846", "0.51549846", "0.51549846", "0.51549846", "0.51549846", "0.5153115", "0.5100715", "0.50963837", "0.50927156", "0.50904787", "0.50816303", "0.5070388", "0.5070266", "0.50678015", "0.5067581", "0.5039355", "0.5035735", "0.50311613", "0.5025497", "0.50179183", "0.5015247", "0.501424", "0.499097", "0.49843958", "0.49839547", "0.4978255", "0.49643704", "0.49610934", "0.49607533", "0.4955291", "0.49546573", "0.49471906", "0.49287722", "0.49237", "0.49223515", "0.49211913", "0.49185604", "0.49080053", "0.49070483", "0.490672", "0.4889282", "0.48868966", "0.48851755", "0.48818132", "0.48817635", "0.48546964", "0.48511755", "0.48457482", "0.48281178", "0.48254028", "0.48250777" ]
0.79463
0
Stop and destroy the server. This handles stopping the server and destroying the native object.
public void stopAndDestroyServer() { synchronized (mImplMonitor) { // ResettersForTesting call can cause this to be called multiple times. if (mImpl == null) { return; } try { if (!mImpl.shutdownAndWaitUntilComplete()) { throw new EmbeddedTestServerFailure("Failed to stop server."); } mImpl.destroy(); mImpl = null; } catch (RemoteException e) { throw new EmbeddedTestServerFailure("Failed to shut down.", e); } finally { mContext.unbindService(mConn); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void stopServer() {\n stop();\n }", "public void stop () {\n if (server != null)\n server.shutDown ();\n server = null;\n }", "public void stop() {\n server.stop();\n }", "public void stop() {\n if (server != null) {\n server.shutdown();\n }\n }", "public void stop() {\n System.err.println(\"Server will stop\");\n server.stop(0);\n }", "public void stop() {\n System.err.println(\"Server will stop\");\n server.stop(0);\n }", "public void stopServer() {\r\n\t\tserverRunning = false;\r\n\t}", "public synchronized void shutdown() {\n server.stop();\n }", "private void stopServer() {\n\t\ttry {\n//\t\t\tserver.shutdown();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: add message in UI for user\n\t\t}\n\t}", "public void stop() {\n tcpServer.stopServer();\n ThreadExecutor.shutdownClient(this.getClass().getName());\n }", "public void kill() {\n this.server.stop();\n }", "public void shutdown() {\n\t\tserver.stop(0);\n\t}", "protected void stopAndReleaseGrpcServer() {\n final Server localServer = this.server;\n if (localServer != null) {\n localServer.shutdown();\n this.server = null;\n log.info(\"gRPC server shutdown.\");\n }\n }", "public void Stop() throws IOException {\n DisposeServer();\n }", "public void stop() {\n\t\tif (this.isRunning() && !this.isManagedExternally) {\n\t\t\ttry {\n\t\t\t\tHTTP.release(this.http.get(this.shutdown));\n\t\t\t} catch (IOException exception) {\n\t\t\t\tthis.processRunner.abort();\n\t\t\t}\n\n\t\t\tthis.isManagedExternally = null;\n\t\t}\n\t}", "public void stop() {\n\t\ttry {\n\t\t\tif (serverSocket != null)\n\t\t\t\tserverSocket.close();\n\t\t} catch (IOException ioe) {\n\t\t\t// shouldn't happen\n\t\t}\n\t}", "public void stop() {\n \n // first interrupt the server engine thread\n if (m_runner != null) {\n m_runner.interrupt();\n }\n\n // close server socket\n if (m_serverSocket != null) {\n try {\n m_serverSocket.close();\n }\n catch(IOException ex){\n }\n m_serverSocket = null;\n } \n \n // release server resources\n if (m_ftpConfig != null) {\n m_ftpConfig.dispose();\n m_ftpConfig = null;\n }\n\n // wait for the runner thread to terminate\n if( (m_runner != null) && m_runner.isAlive() ) {\n try {\n m_runner.join();\n }\n catch(InterruptedException ex) {\n }\n m_runner = null;\n }\n }", "public void stop() {\n while (currentState.get() == ServerConstants.SERVER_STATUS_STARTING) {\r\n try {\r\n Thread.sleep(500);\r\n } catch (InterruptedException e) {\r\n // Ignore.\r\n }\r\n }\r\n\r\n if (currentState.compareAndSet(ServerConstants.SERVER_STATUS_STARTED, ServerConstants.SERVER_STATUS_OFF)) {\r\n try {\r\n bossGroup.shutdownGracefully();\r\n workerGroup.shutdownGracefully();\r\n connectionPool.shutdownAll();\r\n\r\n failedTimes.set(0);\r\n\r\n logger.info(\"Netty server stopped\");\r\n } catch (Exception ex) {\r\n logger.warn(\"Failed to stop netty server (port={}), exception:\", port, ex);\r\n }\r\n }\r\n }", "@PreDestroy\n void destroy()\n {\n final org.apache.sshd.SshServer sshServer = this.sshServer;\n if( sshServer != null )\n {\n LOG.info( \"SSH server module is deactivating\" );\n stopSshServer( sshServer );\n }\n }", "public void stop() {\n\t\tstopFlag.set(true);\n\t\tif (serverStarted.get()) {\n\t\t\tnotifyListener(\"About to stop server. \" + toString());\n\t\t\ttry {\n\t\t\t\tserverActivity.get();\n\t\t\t\tserverSocket.close();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tnotifyListener(\"Interrupted whilst waiting for the server start to finish. [message=\" + e.getMessage() + \"]\" + toString());\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\tnotifyListener(\"Server start caused exception. [message=\" + e.getMessage() + \"]\" + toString());\n\t\t\t} catch (IOException e) {\n\t\t\t\tnotifyListener(\"Unable to close cleanly the server socket. [message=\" + e.getMessage() + \"]\" + toString());\n\t\t\t}\n\t\t\tserverStarted.set(false);\n\t\t} else {\n\t\t\tnotifyListener(\"Server already stopped. \" + toString());\n\t\t}\n\t}", "private void stopServer() {\n if (mBluetoothGattServer == null) return;\n\n mBluetoothGattServer.close();\n }", "public void stopLocalServer() {\n \t\tif (thread != null) {\n \t\t\tthread.stopProcess();\n \t\t\tthread.interrupt();\n \t\t\tthread = null;\n \t\t\tSystem.out.println(addeMcservl + \" was stopped\");\n \t\t} else {\n \t\t\tSystem.out.println(addeMcservl + \" is not running\");\n \t\t}\n \t}", "public void stop() {\n\t\tSystem.out.println(\"ClientModel.stop(): client is quitting.\");\n\t\ttry {\n\t\t\trmiUtils.stopRMI();\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"ClientModel.stop(): Error stopping class server: \" + e);\n\t\t}\n\t\tSystem.exit(0);\n\t}", "@Override\r\n public synchronized void stop() throws Exception {\r\n stopHelper();\r\n stopServers();\r\n stopClients();\r\n super.stop();\r\n }", "@Override\n public void stop() {\n lumenClient.shutdown();\n lumenClient = null;\n }", "public void stopCommunicationServer() {\n\t\t\tthis.running = false;\n\t\t}", "public static void stopServer() {\n try {\n clientListener.stopListener();\n server.close();\n connectionList.clear();\n } catch (IOException ex) {\n System.err.println(\"Error closing server: \\\"\" + ex.getMessage() + \"\\\"\");\n }\n System.out.println(\"SERVER SHUT DOWN\");\n }", "void stop()\n {\n this.service_skeleton.stop(0);\n this.registration_skeleton.stop(0);\n }", "public void stopServer() {\n\t\tthis.running=false;\t\t\t\t\t\t\t//the loop of the thread fails\n\t\ttry {\n\t\t\tthis.socket.close();\t\t\t\t\t//closes the socket\n\t\t}catch (Exception e) {\n\t\t\tSystem.out.println(\"TCPServer : Socket non fermé\");\n\t\t}\n\t}", "void shutDownServer() throws Exception;", "@Override\n public void onDestroy() {\n Log.d(TAG, \"Shutting Server\");\n busHandler.sendMessage(busHandler.obtainMessage(BusHandler.DISCONNECT));\n }", "public void shutdown() {\n try {\n infoServer.stop();\n } catch (Exception e) {\n }\n this.shouldRun = false;\n ((DataXceiveServer) this.dataXceiveServer.getRunnable()).kill();\n try {\n this.storage.closeAll();\n } catch (IOException ie) {\n }\n }", "public void stop() {\n try {\n mSessionBinder.stop(mContext.getPackageName(), mCbStub);\n } catch (RemoteException e) {\n Log.wtf(TAG, \"Error calling stop.\", e);\n }\n }", "@Override\n\tprotected void onDestroy() {\n\t\tif(AccessibilityServiceUtils.isAccessibilitySettingsOn(this)){\n\t\t\tstopServer();\n\t\t}\n\t\tunregisterReceiver(mServiceReceiver);\n\t\tsuper.onDestroy();\n\t}", "@Override\n public void onDestroy() {\n unregisterReceiver(reciever);\n mp.pause();\n mp.stop();\n mp.release();\n wifiManager.disableNetwork(wifiManager.getConnectionInfo().getNetworkId());\n wifiManager.removeNetwork(wifiManager.getConnectionInfo().getNetworkId());\n wifiManager.disconnect();\n try {\n\n serverSocket.close();\n }catch (Exception ex)\n {\n\n }\n super.onDestroy();\n\n }", "public void stopServer() throws IOException {\r\n b = false;\r\n serverSocket.close();\r\n }", "private void stop() {\n if (client != null) {\n this.client.close();\n }\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tSystem.err.println(\"*** shutting down gRPC server since JVM is shutting down\");\n\t\t\t\tHelloServer.this.stop();\n\t\t\t\tSystem.err.println(\"*** server shut down\");\n\t\t\t}", "public void stopServer() throws IOException {\n\t\tlistenThread.interrupt();\n\t\tlistenSocket.close();\n\t\tfor(TestInstance t: testInstances) t.abortTest();\n\t}", "public synchronized void shutdown() {\n try {\n stop();\n } catch (Exception ex) {\n }\n \n try {\n cleanup();\n } catch (Exception ex) {\n }\n }", "public synchronized void stop() throws DDEException\n {\n if (nativeDDEServer != 0) nativeStop();\n }", "synchronized public boolean stop() {\n if (standalone && zkServerMain != null) {\n zkServerMain.doShutdown();\n }\n if (!standalone && quorumPeer != null) {\n quorumPeer.doShutdown();\n }\n boolean ret = waitForServerDown(\"0.0.0.0\", config.getClientPortAddress()\n .getPort(), 5000);\n quorumPeer = null;\n zkServerMain = null;\n return ret;\n }", "@Override\n public void run() {\n System.err.println(\"*** shutting down gRPC server since JVM is shutting down\");\n WindowServer.this.stop();\n System.err.println(\"*** server shut down\");\n }", "public void serverStop() {\n\t\tJOptionPane.showMessageDialog(dlg, \"与服务器失去连接\");\n\t\tserver = null;\n\t\tconnectAction.setEnabled(false);\n\t\t\n\t}", "private void stopServer() {\n\t\tlogger.trace(\"stopServer() is called\");\n\n\t\tif (socketListeningTask != null){\n\t\t\tsocketListeningTask.stopServer();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t//Sleep time is needed to prevent connection counter being reset too soon before socketListeningTask.stopServer() is completed. Sleep time may need to be increased if not enough.\n\t\t\t\tThread.sleep(200);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tSystem.err.println(\"thread sleep method of KKServerGUI is being interrupted.\");\n\t\t\t\tlogger.error(\"thread sleep method of KKServerGUI is being interrupted.\");\n\t\t\t}\n\t\t\t\n\t\t\tConnectionCounter.resetConnectionCounter();\n\t\t\tsocketListeningTask = null;\n\t\t\tserverStatusLabel.setText(serverStopped);\n\t\t\ttotalClientConectionLabel.setText(\"Client connections: 0\");\n\n\t\t\tstartServerToolBarButton.setEnabled(true);\n\t\t\tstopServerToolBarButton.setEnabled(false);\n\n\t\t\tconnectionCheckingTask.stopCheckingConnection();\n\t\t}\n\t}", "public void destroy() throws RemoteException {\n\t\tlog.warning(\"destroy call, enabled: \"+destroy);\n\t\tif( destroy ) {\n\t\t\tnew Thread() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry { Thread.sleep(3); } catch( InterruptedException ex ) {}\n\t\t\t\t\tlog.log(Level.INFO, \"Service Stop requested: \"+new Date() );\n\t\t\t\t\tSystem.exit(1);\n\t\t\t\t}\n\t\t\t}.start();\n\t\t} else {\n\t\t\tthrow new RemoteException( \"Service Destroy Not Enabled, Operation Ignored\" );\n\t\t}\n\t}", "@PostMapping(value = \"/stop\")\n public ResponseEntity stop(){\n try {\n CommandExecutor.execute(Commands.shutdown);\n return ResponseEntity.ok().build();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n return ResponseEntity.status(500).build();\n }", "@Override\n\tpublic void stop() throws Exception {\n\t\tcontroller.stopClient();\n\t}", "private void shutdown() {\n\t\ttry {\n\t\t\tsock.close();\n\t\t\tgame.handleExit(this);\n\t\t\tstopped = true;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "public void shutdown() {\n _udpServer.stop();\n _registrationTimer.cancel();\n _registrationTimer.purge();\n }", "public void stop() throws IOException {\n kv_out.println_debug(\"Try to stop the handler\");\n isRunning = false;\n serverSocket.close();\n }", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tmNtApi.stop();\r\n\t}", "public void appiumStop() throws IOException {\n if (p != null) {\n p.destroy();\n }\n System.out.println(\"Appium server Is stopped now.\");\n }", "public void stop() {\n\t\tthis.controller.terminate();\n\t}", "public final void destroy()\n {\n log.info(\"PerformanceData Servlet: Done shutting down!\");\n }", "public void stopServers() {\n EventHandlerService.INSTANCE.reset();\n UserRegistryService.INSTANCE.reset();\n\n if ( eventDispatcher != null ) {\n eventDispatcher.shutdown();\n }\n if ( userClientDispatcher != null ) {\n userClientDispatcher.shutdown();\n }\n if ( eventDispatcherThread != null ) {\n eventDispatcherThread.interrupt();\n }\n if ( userClientDispatcherThread != null ) {\n userClientDispatcherThread.interrupt();\n }\n }", "public void destroy(){\n\t\tIterator toolIterator = tools.iterator();\n\t\twhile(toolIterator.hasNext()){\n\t\t\tToolBridge tb = (ToolBridge) toolIterator.next();\n\t\t\ttb.terminate();\n\t\t}\n\n\t\tmultiplexingClientServer.stopRunning();\n\t}", "@Override\n public void stop() {\n Thread t = new Thread(server::stopOrderProcess);\n t.setName(\"Server close task\");\n t.start();\n serverFrame.enableControls(false, false);\n enableControls(false, false);\n }", "public static void stopServer()\n {\n keepRunning = false;\n Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, \"Stop server!\");\n }", "public void run(){\n\t\t// Stop servlets\n\t\ttry{\n\t\t\tserver.stop();\n\t\t}catch(Exception e){}\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tSystem.err.println(\"*** shutting down gRPC server since JVM is shutting down\");\n\t\t\t\tNoteServer.this.stop();\n\t\t\t\tSystem.err.println(\"*** server shut down\");\n\t\t\t}", "public void shutdown() {\n mGameHandler.shutdown();\n mTerminalNetwork.terminate();\n }", "public static void closeServer() {\n\t\trun = false;\n\t}", "@Override\n public void run() {\n System.err.println(\"*** shutting down gRPC server since JVM is shutting down\");\n HelloWorldServer.this.stop();\n System.err.println(\"*** server shut down\");\n }", "public void stopServer(View view) {\n stopServerService();\n }", "public static void stopAppiumServer() throws IOException {\n\tif (process != null) {\n\tprocess.destroy();\n\n\t}\n\n\tSystem.out.println(\"Appium server stopped\");\n\n\t}", "public synchronized void stop() {\r\n\t\t//TODO read why stop is deprecated http://docs.oracle.com/javase/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html\r\n\t\tif (udplistener != null) {\r\n\t\t\tudplistener.datagramSocket.close();\r\n\t\t\tudpthread.stop();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tif (tcplistener != null) {\r\n\t\t\t\ttcplistener.serverSocket.close();\r\n\t\t\t\ttcpthread.stop();\r\n\t\t\t}\r\n\t\t} catch (IOException e) {e.printStackTrace();}\t\t\r\n\t}", "public void close() {\n\t\ttry {\n\t\t\tthis.stop();\n\t\t} catch (Exception e) {\n\t\t\tLOG.warn(\"Error closing Avro RPC server.\", e);\n\t\t}\n\t}", "@Override\n public void run() {\n System.err.println(\"*** shutting down gRPC server since JVM is shutting down\");\n try {\n GrpcServer.this.stop();\n } catch (InterruptedException e) {\n e.printStackTrace(System.err);\n }\n System.err.println(\"*** server shut down\");\n }", "public void stop() throws InterruptedException {\n if (server != null) {\n server.shutdown().awaitTermination(Constants.DEFAULT_SERVER_TIMEOUT, TimeUnit.SECONDS);\n }\n }", "public void stop() {\n log.info(\"Stopped\");\n execFactory.shutdown();\n cg.close();\n }", "public static void shutdown()\n\t{\n\t\tinstance = null;\n\t}", "@Override\n public void onDestroy() {\n mClient.terminate();\n mClient = null;\n \n super.onDestroy();\n }", "private void stopClient() {\n\n run = false;\n\n if (bufferOut != null) {\n bufferOut.flush();\n bufferOut.close();\n }\n\n messageListener = null;\n bufferIn = null;\n bufferOut = null;\n serverMessage = null;\n }", "public native int stopService(long nativeHandle);", "public static synchronized void stopServer(Object syncObject) {\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.stopServer\");\n stopServerImmediately(syncObject);\n }", "public void stop() {\n if (isStop.compareAndSet(false, true)) {\n if (bootstrap.config().group() != null) {\n Future future = bootstrap.config().group().shutdownGracefully();\n ((io.netty.util.concurrent.Future) future).syncUninterruptibly();\n }\n for (BrpcChannelGroup channelGroup : healthyInstances) {\n channelGroup.close();\n }\n for (BrpcChannelGroup channelGroup : unhealthyInstances) {\n channelGroup.close();\n }\n if (timeoutTimer != null) {\n timeoutTimer.stop();\n }\n if (namingService != null) {\n namingService.unsubscribe(subscribeInfo);\n }\n if (healthCheckTimer != null) {\n healthCheckTimer.stop();\n }\n if (loadBalanceStrategy != null) {\n loadBalanceStrategy.destroy();\n }\n if (callbackThread != null) {\n callbackThread.shutdown();\n }\n if (threadPool != null) {\n threadPool.stop();\n }\n }\n }", "public void stopListener(){\n\t\tsynchronized (httpServerMutex){\n\t\t\ttry{\n\t\t\t\tif( webServer != null ){\n\t\t\t\t\twebServer.shutdownServer();\n\t\t\t\t\twebServer = null; // NOPMD by luke on 5/26/07 11:10 AM\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( InterruptedException e){\n\t\t\t\t//Ignore, InterruptedException don't matter in this context.\n\t\t\t}\n\t\t\tcatch( Exception e){\n\t\t\t\t//Ignore, InterruptedException don't matter in this context.\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n protected void shutdownInternal() {\r\n service.stop();\r\n }", "public void stop() {}", "public void stop() throws LifecycleException {\n jmxClient.close();\n }", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void shutDownServer() throws IOException {\r\n \t\tthis.shutDownServer(true);\r\n \t}", "public void shutdown() {\n try {\n \t\n \tserverSocket.close();\n \t\n } catch (Exception e) {\n System.err.println(e.getMessage());\n e.printStackTrace();\n }\n }", "public void stop() {\n\t\tserver.saveObjectToFile(offlineMessagesFileName, _offlineMessages);\n\t\tserver.saveObjectToFile(onlineClientsFileName, _onlineClients);\n\t\tserver.saveObjectToFile(clientFriendsFileName, _clientFriends);\n\t\t_offlineMessages.clear();\n\t\t_onlineClients.clear();\n\t\t_clientFriends.clear();\n\t\tserver.stop();\n\t}", "public void stop() { \r\n\t if (remoteControlClient != null) {\r\n\t remoteControlClient\r\n\t .setPlaybackState(RemoteControlClient.PLAYSTATE_STOPPED);\r\n\t } \r\n\t }" ]
[ "0.7458327", "0.7361574", "0.7342352", "0.7296167", "0.7061536", "0.70483685", "0.704532", "0.6941907", "0.6893745", "0.68195015", "0.681331", "0.67648023", "0.6668692", "0.66659814", "0.66101235", "0.6586272", "0.6580145", "0.6577045", "0.6566445", "0.6560085", "0.65600586", "0.6534206", "0.6521677", "0.64868325", "0.64705735", "0.6458731", "0.6431005", "0.64175016", "0.6401633", "0.63684", "0.63660127", "0.63473517", "0.6298493", "0.6295354", "0.6271706", "0.6248406", "0.62300956", "0.6223671", "0.61925966", "0.61906165", "0.61819816", "0.617187", "0.6159996", "0.61580545", "0.6154744", "0.6148259", "0.614107", "0.61277074", "0.6126586", "0.6125205", "0.61233103", "0.6112883", "0.61080956", "0.60911304", "0.60887593", "0.60834324", "0.6074628", "0.6070038", "0.6069439", "0.60566723", "0.6056016", "0.6050815", "0.60487616", "0.6039926", "0.60371155", "0.60199434", "0.6018636", "0.6017757", "0.60018694", "0.59858716", "0.59799796", "0.59715074", "0.59706205", "0.5968491", "0.5958489", "0.59527725", "0.59428895", "0.5931119", "0.5917186", "0.5909723", "0.5900857", "0.5893928", "0.5893928", "0.5893928", "0.5893928", "0.5893928", "0.5893928", "0.5893928", "0.5893928", "0.5893928", "0.5893928", "0.5893928", "0.5893928", "0.5893928", "0.5893928", "0.5893928", "0.5882221", "0.58808553", "0.58712655", "0.58574474" ]
0.7533696
0
Get the path of the PEM file of the root cert.
public String getRootCertPemPath() { try { synchronized (mImplMonitor) { checkServiceLocked(); return mImpl.getRootCertPemPath(); } } catch (RemoteException e) { throw new EmbeddedTestServerFailure("Failed to get root cert's path", e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getUserCertificatesPath();", "public X509Certificate getRootCertificate() throws CertException;", "public Optional<String> caCertDir() {\n return Codegen.stringProp(\"caCertDir\").config(config).get();\n }", "public Optional<String> caCertFile() {\n return Codegen.stringProp(\"caCertFile\").config(config).get();\n }", "protected static String getCertificatePath() {\n return certificatePath;\n }", "public String getTlsCertPath();", "public String getApplicationCertificateStorage(String appId) throws ConfigurationException {\n return (new PropertiesConfiguration(\"push.properties\")).getString(PUSH_DIR) + appId;\n }", "public String getServerRootCaCertificate() {\n return this.serverRootCaCertificate;\n }", "public static String getCertificadoCliente() {\n\n\t\treturn NfeUtil.class.getResource(\"/CERTIFICADO.pfx\").getPath();\n\n\t}", "@Override\n public String getCACertificate() throws IOException {\n LOGGER.debug(\"Getting CA certificate.\");\n try {\n return getPEMEncodedString(\n scmCertificateServer.getCaCertPath());\n } catch (CertificateException e) {\n throw new SCMSecurityException(\"getRootCertificate operation failed. \",\n e, GET_CA_CERT_FAILED);\n }\n }", "public String getResourcePrincipalRoot() {\n return resourcePrincipalRoot;\n }", "public String getRootPath() {\n return root.getPath();\n }", "public CertPath getSignerCertPath() {\n return signerCertPath;\n }", "public CertPath getCertPath() {\n/* 99 */ return this.certPath;\n/* */ }", "public static String getPrivateKeyPath() {\n return privateKeyPath;\n }", "public String getRootCa();", "public java.lang.String getCertUri() {\n return certUri;\n }", "public File getConfigRoot()\r\n\t{\n\t\treturn file.getParentFile();\r\n\t}", "public String getRootPath() {\r\n return rootPath;\r\n }", "String getCertificate();", "private static String getKey(String filename) throws IOException {\n\t\tString strKeyPEM = \"\";\n\t\tBufferedReader br = new BufferedReader(new FileReader(filename));\n\t\tString line;\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tstrKeyPEM += line;\n\t\t}\n\t\tbr.close();\n\t\treturn strKeyPEM;\n\t}", "public URL getKeystoreLocation() {\n return keystoreLocation;\n }", "@Override\r\n public File getProfileConfigurationFile() {\n return new File(getConfigurablePath(ConfigurablePathId.PROFILE_ROOT), MAIN_CONFIGURATION_FILENAME);\r\n }", "public String getSslKeyStorePath()\n {\n return sslKeyStorePath;\n }", "public static String rootDir()\n {\n read_if_needed_();\n \n return _root;\n }", "Path getRootPath();", "public String getCurrentProfiledir()\r\n {\r\n String res = null, aux = \"\";\r\n File dir;\r\n Vector<String> profiles = getProfiledirs();\r\n\r\n for (Enumeration<String> e = profiles.elements(); e.hasMoreElements();)\r\n {\r\n aux = e.nextElement();\r\n dir = new File(aux + File.separator + _lockFile);\r\n if (dir.exists())\r\n {\r\n res = aux + File.separator;\r\n }\r\n }\r\n return res;\r\n }", "String rootPath();", "public static String getCurrentPath() {\n File file = new File(\"\");\n return file.getAbsolutePath();\n }", "liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate();", "public static String getClientSSLConfigFileName() {\n return getSSLConfigFileName(\"ssl-client\");\n }", "public String getUserPrincipalRoot() {\n return userPrincipalRoot;\n }", "public Path getProvLocation() {\n return getSimulationLocation().resolve(FileManager.PROV_FOLDER_NAME);\n }", "File getRootDir() {\n\t\treturn rootDirFile;\n\t}", "@ZAttr(id=1169)\n public String getMyoneloginSamlSigningCert() {\n return getAttr(Provisioning.A_zimbraMyoneloginSamlSigningCert, null);\n }", "public static PrivateKey load3tierTestRootCAPrivateKey() {\n return loadPrivateKeyFromResourcePath(\"classpath:attestation/3tier/private/3tier-test-root-CA.der\");\n }", "public String getPrincipalRoot() {\n return principalRoot;\n }", "protected final String getPrivateKeyLocation() {\n return this.privateKeyLocation;\n }", "byte[] getPackageCertificate() throws Exception {\n\t\tPackageInfo info;\n\t\tinfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);\n\t\tfor (Signature signature : info.signatures) {\n\t\t\treturn signature.toByteArray();\n\t\t}\n\t\treturn null;\n\t}", "public static String getServerSSLConfigFileName() {\n return getSSLConfigFileName(\"ssl-server\");\n }", "public static String generateCert(String certPem) {\n try {\n String tempPemPath = \"/tmp/tempPem\";\n Files.write(Paths.get(tempPemPath), certPem.getBytes());\n\n DefaultExecutor executor = new DefaultExecutor();\n CommandLine cmdLine = CommandLine.parse(\"openssl\");\n cmdLine.addArgument(\"x509\");\n cmdLine.addArgument(\"-in\");\n cmdLine.addArgument(tempPemPath);\n cmdLine.addArgument(\"-text\");\n\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n PumpStreamHandler streamHandler = new PumpStreamHandler(baos);\n executor.setStreamHandler(streamHandler);\n\n executor.execute(cmdLine);\n return baos.toString(\"UTF-8\");\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }", "public static String getKeyFile() {\n\t\tif (xml == null) return null;\n\t\treturn keyfile;\n\t}", "public String certificateUrl() {\n return this.certificateUrl;\n }", "public String getAbsoluteEncryptedPath(final String path) {\n return GDFileSystem.getAbsoluteEncryptedPath(path);\n }", "public static String getPropertyFile() {\n\t\treturn propertyFileAddress;\n\t}", "private static String getSSLConfigFileName(String base) {\n String testUniqueForkId = System.getProperty(\"test.unique.fork.id\");\n String fileSuffix = testUniqueForkId != null ? \"-\" + testUniqueForkId : \"\";\n return base + fileSuffix + \".xml\";\n }", "public static String getCertificadoCacert(String ambiente)\n\t\t\tthrows NfeException {\n\n\t\tif (ambiente.equals(\"DES\")) {\n\t\t\treturn NfeUtil.class.getResource(\"/ARQUIVO_JKS.jks\").getPath();\n\t\t} else if (ambiente.equals(\"PROD\")) {\n\t\t\treturn NfeUtil.class.getResource(\"/ARQUIVO_JKS.jks\").getPath();\n\t\t} else {\n\t\t\tthrow new NfeException(\"Selecione o ambiente PROD/DES\");\n\n\t\t}\n\t}", "public final String getCanonicalPath()\n {\n return FileUtilities.getCanonicalPath(getLocalFile());\n }", "@Override\n public InputStream getCertStream() {\n if (Strings.isEmpty(certPath)) {\n throw new NotFoundException(\"cert path not configured\");\n }\n if (certBytes == null) {\n Path path = Paths.get(certPath).toAbsolutePath();\n try {\n certBytes = readAllBytes(path);\n } catch (IOException e) {\n throw new UncheckedIOException(\"read cert failed\", e);\n }\n }\n return new ByteArrayInputStream(certBytes);\n }", "public String getCertificateEmail(X509Certificate certificate) throws CertException;", "public File getPersonFilePath() {\n Preferences prefs = Preferences.userNodeForPackage(LivrariaPrincipal.class);\n String filePath = prefs.get(\"filePath\", null);\n if (filePath != null) {\n return new File(filePath);\n } else {\n return null;\n }\n }", "protected File getRootDir() {\r\n\t\tif (rootDir == null) {\r\n\t\t\trootDir = new File(getProperties().getString(\"rootDir\"));\r\n\t\t\tif (! rootDir.exists())\r\n\t\t\t\tif (! rootDir.mkdirs())\r\n\t\t\t\t\tthrow new RuntimeException(\"Could not create root dir\");\r\n\t\t}\r\n\t\treturn rootDir;\r\n\t}", "@Override\n protected String getConfFile() {\n return Conf.instance().getProperty(\"alarm.root.cause.peer.end\");\n }", "public static String getEmailAttachmentsPath() {\n\t\t//return \"d:\\\\PBC\";\n\t\treturn \"/Users/anaswhb/Documents/Eclipse/Workspace\";\n\t\t\n\t}", "public File getJobFilePath() {\n Preferences prefs = Preferences.userNodeForPackage(MainApp.class);\n String filePath = prefs.get(powerdropshipDir, null);\n if (filePath != null) {\n return new File(filePath);\n } else {\n return null;\n }\n }", "public static String getPropertyPath(){\n\t\tString path = System.getProperty(\"user.dir\") + FILE_SEP + propertyName;\r\n\t\tLOGGER.info(\"properties path: \" + path);\r\n\t\treturn path;\r\n\t}", "public String getWalletFileDirectoryFull() {\r\n return dataDirectory + walletFileDirectory;\r\n }", "public String getCertificationRequest() {\n if (signingRequest == null) return null;\n return signingRequest.getCertificationRequest().getContent();\n }", "public final String getCredentialsFile() {\n return properties.get(CREDENTIALS_FILE_PROPERTY);\n }", "public String getLocalFilePath() {\n return loadConn.getProperty(\"filePath\");\n }", "public X509Certificate getAik() {\n log.debug(\"target: {}\", getTarget().getUri().toString());\n X509Certificate aik = getTarget()\n .path(\"/aik\")\n .request()\n .accept(CryptoMediaType.APPLICATION_PKIX_CERT)\n .get(X509Certificate.class);\n return aik;\n }", "static File getRootFile() {\n File root = new File(Constant.CONFIG_DIRECTORY_NAME);\n boolean directoryCreated = true;\n if (!root.exists()) {\n directoryCreated = root.mkdirs();\n }\n if (directoryCreated) {\n return root;\n } else {\n return null;\n }\n }", "liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder();", "public File getConfigFile() {\r\n\t\treturn new File(homeDir, \"tacos.config\");\r\n\t}", "private static String readPropertiesFile() {\n Properties prop = new Properties();\n\n try (InputStream inputStream = MembershipService.class.getClassLoader().getResourceAsStream(\"config.properties\")) {\n\n if (inputStream != null) {\n prop.load(inputStream);\n } else {\n throw new FileNotFoundException(\"property file 'config.properties' not found in the classpath\");\n }\n } catch (Exception e) {\n return \"\";\n }\n return prop.getProperty(\"introducer\");\n }", "public String getPath() {\n\t\treturn pfDir.getPath();\n\t}", "public String getCurrentPath() {\n\t\treturn DataManager.getCurrentPath();\n\t}", "Path getManageMeFilePath();", "public String getKeyFilePath();", "public String getTlsCert();", "public String getPath() {\n\t\treturn file.getPath();\n\t}", "public byte[] certificate() {\n return this.certificate;\n }", "public static Path getPath() {\n\t\tPath path = Paths.get(getManagerDir(), NAME);\n\t\treturn path;\n\t}", "public File getRootDir() {\n return rootDir;\n }", "public String getLocationOfFiles() {\n\t\ttry {\n\t\t\tFile f = new File(\n\t\t\t\t\tgetRepositoryManager().getMetadataRecordsLocation() + \"/\" + getFormatOfRecords() + \"/\" + getKey());\n\t\t\treturn f.getAbsolutePath();\n\t\t} catch (Throwable e) {\n\t\t\tprtlnErr(\"Unable to get location of files: \" + e);\n\t\t\treturn \"\";\n\t\t}\n\t}", "public File getCacheRoot()\r\n {\r\n return cache.getCacheRoot();\r\n }", "public URI getConfigurationDataRoot() {\n return configurationDataRoot;\n }", "public File getRootDir() {\r\n\t\treturn rootDir;\r\n\t}", "public static String getBasepath() {\n\t\treturn basepath;\n\t}", "public static String getBasepath() {\n\t\treturn basepath;\n\t}", "public static String getConfigFileLocation(String propertyFilePath) {\n String fileLoc = System.getProperty(\"user.dir\") + propertyFilePath;\n return fileLoc.replace(\"/\", File.separator);\n }", "protected String provideConfigFile(Properties rootProps,\n Properties configProps) {\n String configurationFile = getProperty(rootProps, configProps,\n CONFIG_FILE);\n if (configurationFile == null) {\n configurationFile = STANDARD_CONFIG_LOCATION;\n deployConfigIfNotexisting();\n }\n return configurationFile;\n }", "public String getProvFileURI() {\n return provOutputFileURI;\n }", "public liubaninc.m0.pki.CertificateOuterClass.CertificateOrBuilder getCertificateOrBuilder() {\n return getCertificate();\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n }", "private PcePath getPcePath(String resourceName) throws IOException {\n InputStream jsonStream = PcePathCodecTest.class\n .getResourceAsStream(resourceName);\n ObjectMapper mapper = new ObjectMapper();\n JsonNode json = mapper.readTree(jsonStream);\n assertThat(json, notNullValue());\n PcePath pcePath = pcePathCodec.decode((ObjectNode) json, context);\n assertThat(pcePath, notNullValue());\n return pcePath;\n }", "public File getApplicationPath()\n {\n return validateFile(ServerSettings.getInstance().getProperty(ServerSettings.APP_EXE));\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n if (certificateBuilder_ == null) {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : certificate_;\n } else {\n return certificateBuilder_.getMessage();\n }\n }", "public File getMySQLSSLClientStore() throws GuacamoleException {\n return getProperty(MySQLGuacamoleProperties.MYSQL_SSL_CLIENT_STORE);\n }", "public final String getFilename() {\n return properties.get(FILENAME_PROPERTY);\n }", "private static File getPropertiesFile()\r\n/* 57: */ throws IOException\r\n/* 58: */ {\r\n/* 59: 57 */ log.finest(\"OSHandler.getPropertiesFile\");\r\n/* 60: 58 */ ydfDirectory = getYdfDirectory();\r\n/* 61: 59 */ String fileName = ydfDirectory + \"/\" + getLocalFilePrefix() + \"cryptoloc.properties\";\r\n/* 62: 60 */ File file = new File(fileName);\r\n/* 63: 61 */ if (!file.exists()) {\r\n/* 64: 62 */ file.createNewFile();\r\n/* 65: */ }\r\n/* 66: 64 */ return file;\r\n/* 67: */ }", "public String getAbsPath();", "public String getTlsKeyPath();", "public static String getCommonImagePropertiesFullPath() throws IOException {\n return getImagePropertiesFullPath(COMMON_IMAGEPROP_FILEPATH);\n }", "public String getCertification() {\n return certification;\n }", "public String getAbsolutePath() {\n\t\treturn Util.getAbsolutePath();\n\t}", "public String getBasePath(){\r\n\t\t \r\n\t\t String basePath = properties.getProperty(\"getPath\");\r\n\t\t if(basePath != null) return basePath;\r\n\t\t else throw new RuntimeException(\"getPath not specified in the configuration.properties file.\");\r\n\t }", "protected static String getKeyStorePath() {\n return keyStorePath;\n }", "public File getMySQLSSLTrustStore() throws GuacamoleException {\n return getProperty(MySQLGuacamoleProperties.MYSQL_SSL_TRUST_STORE);\n }", "String getInstallRoot();" ]
[ "0.6526157", "0.62254715", "0.6156422", "0.6155347", "0.60061485", "0.59429055", "0.5713676", "0.5696833", "0.5693425", "0.56796694", "0.565185", "0.5603966", "0.5582726", "0.55397886", "0.5520644", "0.54625344", "0.5459248", "0.5414659", "0.53742826", "0.53161937", "0.53115803", "0.5298953", "0.5279724", "0.52670187", "0.5261505", "0.52212846", "0.5207357", "0.51665604", "0.5165296", "0.51213783", "0.511757", "0.51030135", "0.5098437", "0.5094953", "0.5084841", "0.5058977", "0.50498", "0.50473446", "0.5037699", "0.5033917", "0.5032835", "0.50295645", "0.49890304", "0.49881202", "0.497205", "0.4953941", "0.49524164", "0.49487254", "0.49441442", "0.49397194", "0.4934027", "0.49293774", "0.49231902", "0.49201477", "0.4904966", "0.48950368", "0.48661676", "0.48635355", "0.4862877", "0.48599058", "0.4837498", "0.48372096", "0.48198843", "0.4814897", "0.48119485", "0.48117796", "0.4800636", "0.47994256", "0.47975108", "0.4795124", "0.47934806", "0.4787299", "0.47841778", "0.4784129", "0.47767448", "0.47755137", "0.47738305", "0.47715726", "0.47710156", "0.47710156", "0.47661152", "0.4765084", "0.47629255", "0.47623205", "0.47561836", "0.47501907", "0.4749557", "0.4746733", "0.47466543", "0.4742808", "0.4741014", "0.47383875", "0.47362643", "0.47271186", "0.47247356", "0.4722405", "0.47186512", "0.47031537", "0.47008732", "0.4698383" ]
0.7988141
0
utility function to read from stdin, Provided by Programmingchallenges, edit for style only
static String ReadLn(int maxLength) { byte line[] = new byte[maxLength]; int length = 0; int input = -1; try { while (length < maxLength) { // Read untill maxlength input = System.in.read(); if ((input < 0) || (input == '\n')) break; // or untill end of line ninput line[length++] += input; } if ((input < 0) && (length == 0)) return null; // eof return new String(line, 0, length); } catch (java.io.IOException e) { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "OutputStream getStdin();", "public void read() {\n try {\n pw = new PrintWriter(System.out, true);\n br = new BufferedReader(new InputStreamReader(System.in));\n input = br.readLine();\n while (input != null) {\n CM.processCommand(input, pw, true);\n input = br.readLine();\n }\n } catch (IOException ioe) {\n pw.println(\"ERROR: Problem with reading user input.\");\n } finally {\n try {\n br.close();\n } catch (IOException ioe) {\n pw.println(\"ERROR: Buffer DNE\");\n }\n }\n }", "@Override\n public int read() throws IOException {\n int c;\n\n do {\n c = System.in.read();\n } while(c != -1 && (c == '\\n' || c == '\\r'));\n\n return c;\n }", "protected String readLine()\n { try { if (stdin!=null) return stdin.readLine(); } catch (IOException e) {}\n return null;\n }", "@Override\n\tpublic String read() \n\t{\n\t\tString res = \"\";\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tif (scan.hasNextLine())\n\t\t\tres = scan.nextLine();\n\t\t\n\t\treturn res;\n\t\t\n\n\t}", "static String read ()\r\n \t{\r\n \t\tString sinput;\r\n \r\n \t\ttry\r\n \t\t{\r\n \t\t\tsinput = br.readLine();\r\n \t\t}\r\n \t\tcatch (IOException e)\r\n \t\t{\r\n \t\t\tErrorLog.addError(\"Input exception occured in command line interface!\");\r\n \t\t\treturn null; //Menu will exit when fed a null\r\n \t\t}\r\n \t\treturn sinput;\r\n \t}", "public static String readUserInput() {\n return in.nextLine();\n }", "private String getInput(String prompt) throws IOException {\n System.out.print(prompt);\n BufferedReader in = new BufferedReader(\n new InputStreamReader(System.in));\n return in.readLine();\n }", "public String Get_Input()throws IOException{\r\n\t\tString input=\"\";\r\n\t\tInputStreamReader converter = new InputStreamReader(System.in);\r\n\t\tBufferedReader in = new BufferedReader(converter);\r\n\t\t\r\n\t\tinput = in.readLine();\r\n\t\t\r\n\t\treturn input;\r\n\t}", "protected String getInputFromConsole() throws IOException\n {\n BufferedReader consoleInput = new BufferedReader(new InputStreamReader(System.in));\n return consoleInput.readLine();\n }", "String readInput() {\n Scanner scanner = new Scanner(System.in);\n return scanner.nextLine();\n }", "void readInput() {\n\t\ttry {\n\t\t\tBufferedReader input = new BufferedReader(new InputStreamReader(System.in));\n\t\t\t\n\t\t\tString line = input.readLine();\n\t\t\tString [] numbers = line.split(\" \");\n\n\t\t\tlenA = Integer.parseInt(numbers[0]);\n\t\t\tlenB = Integer.parseInt(numbers[1]); \n\n\t\t\twordA = input.readLine().toLowerCase(); \n\t\t\twordB = input.readLine().toLowerCase();\n\n\t\t\tg = Integer.parseInt(input.readLine());\n\n\t\t\tString key; \n\t\t\tString [] chars;\n\t\t\tpenaltyMap = new HashMap<String, Integer>();\n\n\t\t\tfor(int i=0;i<676;i++) {\n\t\t\t\tline = input.readLine();\n\t\t\t\tchars = line.split(\" \");\n\t\t\t\tkey = chars[0] + \" \" + chars[1];\n\t\t\t\tpenaltyMap.put(key, Integer.parseInt(chars[2]));\n\n\t\t\t}\n\n\t\t\tinput.close();\n\n\t\t} catch (IOException io) {\n\t\t\tio.printStackTrace();\n\t\t}\n\t}", "static String readEntry(String prompt) {\n try {\n StringBuffer buffer = new StringBuffer();\n System.out.print(prompt);\n System.out.flush();\n int c = System.in.read();\n while(c != '\\n' && c != -1) {\n buffer.append((char)c);\n c = System.in.read();\n }\n return buffer.toString().trim();\n } catch (IOException e) {\n return \"\";\n }\n }", "public static String readInput() {\r\n return SCANNER.nextLine();\r\n }", "public static String readLine()\n\t{\n\t\tif (bJunit == true)\n\t\t{\n\t\t\tsLastLine = sJunitInput;\n\t\t\twriteLine(\"JUnit INPUT: \" + sJunitInput);\n\t\t\treturn sLastLine;\n\t\t}\n\t\n\t\ttry {\n\t\t\tsLastLine = br.readLine();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error reading from STDIN\");\n\t\t}\n\t\t\n\t\treturn sLastLine;\n\t\t\n\t}", "static String readString() throws Exception {\n\t\twhile (!st.hasMoreTokens()) {\n\t\t\tst = new StringTokenizer(stdin.readLine());\n\t\t}\n\t\treturn st.nextToken();\n\t}", "public synchronized void readInput() throws InterruptedException, IOException \n\t{\n\t\twhile (getDataSourceEOFlag())\n\t\t{\n\t\t\tcontent.set(incomingPipe.take());\n\t\t\t\n\t\t\t// Ensure thread-timing uniformity (a speed-limiter)\n\t\t\t//Thread.sleep(100);\n\t\t\t\n\t\t\tprocess();\n\t\t\t// Discard the text to free up memory.\n\t\t\tcontent.set(null);\n\t\t}\n\t}", "public String getInput() throws IOException {\n\t\tSystem.out.print(\">> \");\n\t\treturn consoleIn.readLine();\n\t}", "public static void main(String[] args) throws IOException{\n char c;\r\n do{\r\n c = (char)System.in.read();\r\n System.out.println(\"c: \"+c);\r\n }while(c!='.');\r\n //2 method: int read(byte data[]) & int read(byte data[],int min, int max)\r\n// byte data[] = new byte[10];// input char translated into byte numbers\r\n// System.out.println(\"nhap cac ki tu: \");\r\n// //System.in.read(data);\r\n// System.in.read(data,0,3);// read chars [0;3)\r\n// System.out.println(\"cac ki tu vua nhap\");\r\n// for(int i=0;i<data.length;i++)\r\n// System.out.println((char)data[i]);// empty positions filled with 0/empty space\r\n }", "public void readInput()\n\t{\n\t\t//wrap input stream read input from user\n\t\tBufferedReader in = new BufferedReader( new InputStreamReader( System.in ));\n\t\t\n\t\t//prompt user for input\n\t\tSystem.out.println( \"Please enter a letter or type Quit to end.\");\n\t\t\n\t\ttry{\n\t\t\tString userGuess = in.readLine();\n\t\t\t\n\t\t\t//loop until the user types \"Quit\"\n\t\t\tdo{\n\t\t\t\t//invoke guessletter function with String input\n\t\t\t\thangmanGame.guessLetter(userGuess);\n\t\t\t\t//update currentGuessText\n\t\t\t\tcurrentGuessText = hangmanGame.getCurrentGuess();\n\t\t\t\t//trace out current guess\n\t\t\t\tSystem.out.println(\"Your current guess is: \" + currentGuessText);\n\t\t\t\t//update remainingStrikes\n\t\t\t\thangmanGame.numberOfRemainingStrikes();\n\t\t\t\t//trace out remaining number of strikes\n\t\t\t\tSystem.out.println(\"You currently have \" + hangmanGame);\n\t\t\t\t//invoke revealAnswer function to check over gameOver, gameWon, and getAnswer\n\t\t\t\trevealAnswer();\n\t\t\t}while ( userGuess != \"Quit\" );\n\t\t}\n\t\t//catch IOException ioe\n\t\tcatch (IOException ioe)\n\t\t{\n\t\t\t//tell exception to print its error log\n\t\t\tioe.printStackTrace();\n\t\t}\n\t}", "protected final String _readTTYLine() {\n\n StringBuffer buf = new StringBuffer(80);\n int c = 0;\n try {\n while ((c = System.in.read()) != -1) {\n char ch = (char) c;\n if (ch == '\\r') {\n ch = (char) System.in.read();\n if (ch == '\\n') {\n break;\n } else {\n continue;\n }\n } else if (ch == '\\n') {\n break; // Unix flavors.\n }\n buf.append(ch);\n }\n } catch (IOException e) {\n this._logger.error(ERROR_TAG + e.getMessage());\n }\n return buf.toString();\n }", "public String readCommand() {\n String input = in.nextLine();\n while (input.trim().isEmpty()) {\n input = in.nextLine();\n }\n return input;\n }", "private String getClientInput() {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String input = null;\n try {\n input = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return input;\n }", "public static String acceptString() {\n\t\tString stringData = null;\r\n\t\tBufferedReader input = null;\r\n\t\ttry {\r\n\t\t\t// chaining the streams\r\n\t\t\tinput = new BufferedReader(new InputStreamReader(System.in));\r\n\r\n\t\t\t// reading data from the reader\r\n\t\t\tstringData = input.readLine();\r\n\t\t} catch (IOException ioException) {\r\n\t\t\tSystem.out.println(\"Error in accepting data.\");\r\n\t\t} finally {\r\n\t\t\tinput = null;\r\n\t\t}\r\n\t\treturn stringData;\r\n\t}", "public MyInputStream()\n {\n in = new BufferedReader\n (new InputStreamReader(System.in));\n }", "private static void readInput() { input = sc.nextLine().toLowerCase().toCharArray(); }", "public static String readString() {\n return in.nextLine();\n }", "public abstract String inReadLine() throws JVMIOException;", "private static void takeInput() throws IOException {\n\n System.out.println(\"Enter number 1\");\n BufferedReader br= new BufferedReader(new InputStreamReader(System.in));\n String number1=br.readLine();\n System.out.println(\"Enter number 2\");\n String number2=br.readLine();\n System.out.println(\"Operation\");\n String op=br.readLine();\n //WhiteHatHacker processes the input\n WhiteHatHacker hack=new WhiteHatHacker(number1,number2,op);\n hack.processInput();\n }", "private void processInput() {\r\n\t\ttry {\r\n\t\t\thandleInput(readLine());\r\n\t\t} catch (WrongFormatException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void readUserInput(){\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n try {\n String input = reader.readLine();\n while (!userValidation.validateUserInput(input)){\n input = reader.readLine();\n }\n elevatorController.configureNumberOfElevators(input);\n\n } catch (\n IOException e) {\n logger.error(e);\n }\n\n }", "private static Scanner determineInputSource(String[] args) throws FileNotFoundException{\n if (args.length > 0) {\n //Reading from file\n return new Scanner(new File(args[0]));\n }\n else {\n //Reading from standard Input\n return new Scanner(System.in);\n }\n }", "public static String readEntry(String prompt) {\n\n try {\n StringBuffer buffer = new StringBuffer();\n System.out.print(prompt);\n System.out.flush();\n int c = System.in.read();\n while (c != '\\n' && c != -1) // while not newline or EOF\n {\n buffer.append((char) c);\n c = System.in.read();\n }\n return buffer.toString().trim();\n } catch (IOException e) {\n return \"\";\n }\n }", "public static void main(String[] args) {\n RandomizedQueue<String> randomizedQueue = new RandomizedQueue<String>();\n while (!StdIn.isEmpty()) {\n String line = StdIn.readString();\n if (!line.isBlank()) {\n randomizedQueue.enqueue(line);\n }\n }\n Iterator<String> itr = randomizedQueue.iterator();\n while (itr.hasNext())\n System.out.println(itr.next());\n }", "private static String readMatrix(BufferedReader stdin) throws IOException {\n System.out.printf(\"For exit program print \\'%s\\' \\n\\n\", Utils.EXIT);\n\n System.out.print(\"Enter rows count: \");\n String read = stdin.readLine();\n if (read.equals(Utils.EXIT)) {\n return read;\n }\n int rows = Integer.valueOf(read);\n\n System.out.print(\"Enter columns count: \");\n read = stdin.readLine();\n if (read.equals(Utils.EXIT)) {\n return read;\n }\n int cols = Integer.valueOf(read);\n\n double[][] matrix = new double[rows][cols];\n\n System.out.println(\"Enter rows, dividing numbers with space. Double format using point.\");\n for (int i = 0; i < rows; i++) {\n System.out.print(\"Row \" + (i + 1) + \":\");\n read = stdin.readLine();\n if (read.equals(Utils.EXIT)) {\n return read;\n }\n String[] numbers = read.split(\" \");\n for (int j = 0; j < cols; j++) {\n matrix[i][j] = Double.valueOf(numbers[j]);\n }\n\n }\n return Utils.arrayToString(matrix);\n }", "private static String read(InputStream in) throws IOException {\n StringBuilder builder = new StringBuilder();\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\n String line = null;\n while ((line = reader.readLine()) != null)\n builder.append(line);\n\n return builder.toString();\n }", "public String readLine() throws ShellIOException;", "private static String readLine() {\r\n String input=\"\";\r\n try {\r\n input = in.readLine();\r\n } catch (IOException e) {\r\n System.out.println(e.getMessage());\r\n }\r\n return input;\r\n }", "public String readStringFromCmd() throws IOException {\r\n\t\tSystem.out.println(\"Enter your String:\");\r\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tString string = null;\t\t\r\n\t\tstring = br.readLine();\r\n\t\treturn string;\r\n\t}", "private static String readInput(){\n\t\ttry {\n\t\t\tInput = br.readLine();\n\t\t\t}\n\t\tcatch (IOException ioe) {\n\t\t\tSystem.out.println(\"IO error trying to read your name!\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\treturn Input;\n\t}", "public static void main( String[] args ) throws IOException {\n InputStreamReader reader =\n new InputStreamReader( System.in, StandardCharsets.UTF_8 );\n BufferedReader in = new BufferedReader( reader );\n String line;\n while ( ( line = in.readLine() ) != null ) {\n String print;\n if ( isValid( line ) ) {\n print = \"True\";\n } else {\n print = \"False\";\n }\n System.out.println( print );\n }\n }", "public int readInt(String prompt);", "abstract public String readLine() throws TerminalException;", "public String readCommand() {\n Scanner sc = new Scanner(System.in);\n return sc.nextLine();\n }", "public void readInput()\n\t{\n\t\tString userInput;\n\t\tChoices choice;\n\t\t\n\t\tdo {\n\t\t\tlog.log(Level.INFO, \"Please give the inputs as:\\n\"\n\t\t\t\t\t+ \"ADDACCOUNT to add the account\\n\" \n\t\t\t\t\t+ \"DISPLAYALL to display all accounts\\n\"\n\t\t\t\t\t+ \"SEARCHBYACCOUNT to search by account\\n\"\n\t\t\t\t\t+ \"DEPOSIT to deposit into account\\n\"\n\t\t\t\t\t+ \"WITHDRAW to withdraw from the account\\n\"\n\t\t\t\t\t+ \"EXIT to end the application\"\n\t\t\t\t\t);\n userInput = scan.next();\n choice = Choices.valueOf(userInput);\n\n switch (choice) {\n case ADDACCOUNT : \taddAccount();\n \t\t\t\t\t\tbreak;\n \n case DISPLAYALL :\t\tdisplayAll();\n \t\t\t\t\t\tbreak;\n\n case SEARCHBYACCOUNT :\tsearchByAccount();\n \t\t\t\t\t\tbreak;\n \n case DEPOSIT :\t\t\tdepositAmount();\n \t\t\t\t\t\tbreak;\n \n case WITHDRAW :\t\t\twithDrawAmount();\n \t\t\t\t\t\tbreak;\n \n case EXIT:\t\t\t\tlog.log(Level.INFO, \"Application has ended successfully\");\n \t\t\t\t\t\tbreak;\n \n default: break;\n }\n } while(choice != Choices.EXIT);\n\t\t\n\t\tscan.close();\n\t}", "public static String readLine(String format, Object... args) throws IOException {\n\t\tif (System.console() != null) {\n\t\t\treturn System.console().readLine(format, args);\n\t\t}\n\t\tlogger.info(String.format(format, args));\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\tSystem.in));\n\t\treturn reader.readLine();\n\t}", "public static void main(String[] args)\r\n\t\tthrows IOException\r\n\t{\n\t\tBufferedReader reader = new BufferedReader(\r\n\t\t\tnew InputStreamReader(System.in));\r\n\r\n\t\t// Reading data using readLine\r\n\t\tString name = reader.readLine();\r\n\r\n\t\t// Printing the read line\r\n\t\tSystem.out.println(name);\r\n\t}", "public static String le() throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n String texto = reader.readLine();\n return texto;\n }", "public Integer readIntegerFromCmd() throws IOException {\r\n\t\tSystem.out.println(\"Enter your number:\");\r\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tString number = null;\r\n\t\tnumber = br.readLine();\r\n\t\treturn new Integer(number);\r\n\t}", "String readLine() throws IOException\n\t{\n\t\tString line = null;\n\t\tif (haveStreams())\n\t\t\tline = m_in.readLine();\n\t\telse\n\t\t\tline = keyboardReadLine();\n\n\t\tsetCurrentLine(line);\n\t\treturn line;\n\t}", "String getLine();", "public static void main(String[] args) {\n\n\t\tInputStreamReader rd= new InputStreamReader(System.in);\n\t\ttry {\n\t\t\tSystem.out.println(\"enter a number\");\n\t\t\tint value=rd.read();\n\t\t\tSystem.out.println(\"you entered:-\"+(char)value);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public File getStdin() {\n return mStdin;\n }", "String getUserInput(String prompt) {\r\n System.out.print(prompt);\r\n try {\r\n return rdr.readLine();\r\n }\r\n catch (IOException ex) {\r\n return null;\r\n }\r\n }", "public static void main(String[] args) {\n Stack stack = new Stack();\n while (!StdIn.isEmpty()) {\n String s = StdIn.readString();\n if (s.equals(\"-\"))\n StdOut.print(stack.pop());\n else\n stack.push(s);\n }\n }", "private static String getUserInput(String prompt){ \r\n Scanner in = new Scanner(System.in);\r\n System.out.print(prompt);\r\n return in.nextLine();\r\n }", "public interface Input \n{\n\t/*\n\t * Use to initialise input\n\t */\n\tboolean initialise (String args);\n\t/*\n\t * Return a line or return null\n\t */\n\tString getLine ();\n\t\n}", "public static String inputReadText(){\r\n// Scanner scanner = new Scanner(\" if (true)\\n System.out.println(!false);\\nelse\\n System.out.println(false);\\n\");\r\n// Scanner scanner = new Scanner(\" { if (true) System.out.println(!false);else System.out.println(false); while (true) { System.out.println(!!false); System.out.println(true);}}\");\r\n Scanner scanner = new Scanner(System.in);\r\n scanner.useDelimiter(\"\");\r\n String content = new String();\r\n while (scanner.hasNext()){\r\n content += scanner.next();\r\n }\r\n return content;\r\n }", "static String ReadLn(int maxLength){\n byte line[] = new byte [maxLength];\n int length = 0;\n int input = -1;\n try{\n while (length < maxLength){//Read untill maxlength\n input = System.in.read();\n if ((input < 0) || (input == '\\n')) break; //or untill end of line ninput\n line [length++] += input;\n }\n\n if ((input < 0) && (length == 0)) return null; // eof\n return new String(line, 0, length);\n }catch (IOException e){\n return null;\n }\n }", "String getLine ();", "public String getInput(String message) throws IOException {\n\t\tSystem.out.print(\">> \"+message+\" \");\n\t\treturn consoleIn.readLine();\n\t}", "private void readFromConsole(){\n Scanner cin = new Scanner(System.in);\n\n if(cin.hasNext()){\n number = cin.nextInt();\n }\n array = new long[number];\n\n for(int num = 0; num < number; num++){\n if(cin.hasNext()){\n array[num] = cin.nextLong();\n }\n }\n }", "public static void main(String[] args) throws IOException{\n\t\ttry {\r\n\t\t\tDataInputStream inputStream = new DataInputStream(\r\n\t\t\t\t\tnew ByteArrayInputStream(\r\n\t\t\t\t\t\t\tBufferedInputFile.read(\r\n\t\t\t\t\t\t\t\t\t\"C:/Users/cyu088/workspace/javaIO/src/fileIO/BufferedInputFile.java\").getBytes()));\r\n\t\t\twhile(true)\r\n\t\t\t\tSystem.out.println((char)inputStream.readByte());//一次一个字节读取字符,返回值不能用来检测输入是否结束\r\n\t\t} catch (EOFException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tSystem.err.println(\"end of stream\");\r\n\t\t}\r\n\t}", "@Override\n public Ini read(InputStream in) throws IOException {\n return read(new InputStreamReader(in));\n }", "public static String readLine(String message){\n Scanner in = new Scanner(System.in);\n System.out.print(message);\n return in.nextLine();\n }", "public static String getString() throws IOException {\r\n InputStreamReader isr = new InputStreamReader(System.in);\r\n BufferedReader br = new BufferedReader(isr);\r\n String s = br.readLine();\r\n return s;\r\n }", "public static String readString(String prompt) throws IOException {\r\n\t\tString value = \"\";\r\n\t\twhile (true) {\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.print(prompt + \" _>\");\r\n\t\t\t\tvalue = reader.readLine();\r\n\t\t\t\tbreak;\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tSystem.err.println(ex.getLocalizedMessage());\r\n\t\t\t\tthrow ex;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn value;\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\tReader in = new InputStreamReader(System.in);\n\t\tint data = 0;\n\t\twhile((data=in.read()) != -1) {\n\t\t\tSystem.out.print((char)data);\n\t\t}\n\t\t//f가나다라마바사아자차가카\n\t}", "public static String readString(String prompt){ \n\t\tSystem.out.print(prompt+\": \");\n\t\tstringInput = readInput();\n\t\treturn stringInput; \n\t}", "public abstract String readLine() throws IOException, InterruptedException;", "public static String readString() {\n BufferedReader br\n = new BufferedReader(new InputStreamReader(System.in), 1);\n\n // Declare and initialize the string\n String string = \" \";\n\n // Get the string from the keyboard\n try {\n string = br.readLine();\n\n } catch (IOException ex) {\n System.out.println(ex);\n }\n\n // Return the string obtained from the keyboard\n return string;\n }", "public static int ReadNum(InputStream input,PrintStream output) {\r\n\t\t//Scanner in = new Scanner(System.in);\r\n\t\tScanner in = new Scanner(new FilterInputStream(input){public void close(){}});\r\n\t\tin.reset();\r\n\t\toutput.println(\"Please provide with a positive intiger.\\nNegative intiger will terminate the loop\");\r\n\t\tint num;\r\n\t\ttry {\r\n\t\t\tnum = Integer.parseInt(in.next()); // To do: Verify user input\r\n\t\t} catch (InputMismatchException e) { // Catch input mismatch Exception\r\n\t\t\toutput.printf(\"Invalid input:\\\"%s\\\" :( . Please provide an integer.\\n\",in.next());\r\n\t\t\tnum = ReadNum(input, output);\r\n\t\t}finally{\r\n\t\t\t//do nothing\r\n\t\t\t//\r\n\t\t}\r\n\t\tin.close();\r\n\t\treturn num;\r\n\t}", "private DecoderState readCommand(ByteBuf in) {\n\n DecoderState nextState = DecoderState.READ_COMMAND;\n String line = readLine(in);\n\n if (line != null) {\n command = Command.valueOf(line);\n nextState = DecoderState.READ_HEADERS;\n }\n\n return nextState;\n }", "public static String getString() throws IOException {\n InputStreamReader isr = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(isr);\n String s = br.readLine();\n return s;\n }", "private int readIntWithPrompt (String prompt) {\n System.out.print(prompt); System.out.flush();\n while (!in.hasNextInt()) {\n in.nextLine();\n System.out.print(prompt); System.out.flush();\n }\n int input = in.nextInt();\n in.nextLine();\n return input;\n }", "public static void main(String[] args) {\n\t\t\n\t\tScanner sc=new Scanner(System.in);\n\t\twhile(sc.hasNextLine()){\n\t\t\tString str=sc.nextLine();\n\t\t\t\n\t\t\t\n\t\t}\n\n\t}", "private String readInput(java.net.Socket socket) throws IOException {\n BufferedReader bufferedReader =\n new BufferedReader(\n new InputStreamReader(\n socket.getInputStream()));\n char[] buffer = new char[700];\n int charCount = bufferedReader.read(buffer, 0, 700);\n String input = new String(buffer, 0, charCount);\n return input;\n }", "String consoleInput();", "private String readStream(InputStream in) throws IOException {\n BufferedReader r = new BufferedReader(new InputStreamReader(in));\n\n StringBuilder sb = new StringBuilder();\n String line;\n\n // Reads every line and stores them in sb.\n while((line = r.readLine()) != null) {\n sb.append(line);\n }\n\n // Closes the input stream.\n in.close();\n\n return sb.toString();\n }", "public static void main(String[] args) throws java.io.IOException {\n if (args.length > 0) System.setIn(new java.io.FileInputStream(args[0]));\n Yylex lexer = new Yylex(new java.io.InputStreamReader(System.in));\n while ( ! lexer.zzAtEOF ) lexer.next_token();\n}", "public static void main(String[] args) throws IOException {\n\t\tInputStreamReader isreader = new InputStreamReader(System.in);\n\t\tBufferedReader breader = new BufferedReader(isreader);\n\t\tString input = breader.readLine();\n\t\tint n = Integer.parseInt(input);\n\t\tresetList(n);\n\t\t\n\t}", "public void accept(){\n\t\ttry{\n\t\t\tBufferedReader fromConsole = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString message;\n\t\t\twhile (true){\n\t\t\t\tmessage = fromConsole.readLine();\n\t\t\t\tthis.handleMessage(message);\n\t\t\t}\n\t\t} \n\t\tcatch (Exception exception){\n\t\t\tSystem.out.println\n\t\t\t(\"Unexpected error while reading from console!\");\n\t\t}\n\t}", "public static String getStringInput() {\n Scanner in = new Scanner(System.in);\n return in.next();\n }", "public static BufferedReader generateInputReader(String[] args) \n\t\t\tthrows IOException\n\t{\n\t\tif(args.length == 0)\n\t\t{\n\t\t\tInputStream stream = Main.class.getResourceAsStream(\"input.txt\");\n\t\t\treturn new BufferedReader(new InputStreamReader(stream));\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn new BufferedReader(new FileReader(args[0]));\n\t\t}\n\t}", "public static BufferedReader generateInputReader(String[] args) \n\t\t\tthrows IOException\n\t{\n\t\tif(args.length == 0)\n\t\t{\n\t\t\tInputStream stream = Main.class.getResourceAsStream(\"input.txt\");\n\t\t\treturn new BufferedReader(new InputStreamReader(stream));\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn new BufferedReader(new FileReader(args[0]));\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tLinkedStackOfStrings st = new LinkedStackOfStrings();\r\n\t\t\r\n\t\twhile( !StdIn.isEmpty() ){\r\n\t\t\tString s = StdIn.readString();\r\n\t\t\t\r\n\t\t\tif ( s.equals( \"-\" ) ) {\r\n\t\t\t\tif ( st.isEmpty() )\r\n\t\t\t\t\tSystem.out.println( \"Empty!\" );\r\n\t\t\t\telse\r\n\t\t\t\t\tSystem.out.println( st.pop() );\r\n\t\t\t}\t\t\t\t\r\n\t\t\telse\r\n\t\t\t\tst.push( s );\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tCreditCardProcess ccp = new CreditCardProcess();\n\t\ttry {\n\t\t\t// Read in the first line to check\n\t\t\tString line = br.readLine();\n\t\t\ttry {\n\t\t\t\t// Try use this first-line as file location\n\t\t\t\tBufferedReader fbr = new BufferedReader(new FileReader(line));\n\t\t\t\t// Success, then proceed to read in commands from file\n\t\t\t\twhile ((line = fbr.readLine()) != null) {\n\t\t\t\t\tccp.processCommand(line);\n\t\t\t\t}\n\t\t\t\tfbr.close();\n\t\t\t\t//Encountered error - file does not exist\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t//Use first line as command\n\t\t\t\tccp.processCommand(line);\n\t\t\t\t//Keep accepting command from console until an empty line is enter\n\t\t\t\twhile (!(line = br.readLine()).isEmpty()) {\n\t\t\t\t\tccp.processCommand(line);\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tccp.print();\n\t}", "public static void main(String[] args) {\n\n BufferedReader unreliableReader = new UnreliableBufferedReader(new InputStreamReader(System.in),\n 0.2);\n\n int linesSuccessfullyRead = 0;\n\n int linesAttemptedToBeRead = 0;\n\n while (linesSuccessfullyRead < MAX_LINES) {\n\n if (linesSuccessfullyRead < MAX_LINES) {\n System.out.println(\"Attempting to read input from unreliable reader...\");\n linesAttemptedToBeRead++;\n try {\n System.out.println(\"Successfully read input: \" + unreliableReader.readLine());\n linesSuccessfullyRead++;\n } catch (IOException exception) {\n System.out.println(\"Failed!\");\n }\n }\n\n }\n\n System.out.println(\"Took \" + linesAttemptedToBeRead + \" attempts to read \" + MAX_LINES\n + \" lines from unreliable reader\");\n\n try {\n unreliableReader.close();\n } catch (IOException exception) {\n System.out.println(\"Error closing unreliable reader.\");\n }\n\n }", "private void start() {\n Scanner scanner = new Scanner(System.in);\n \n // While there is input, read line and parse it.\n String input = scanner.nextLine();\n TokenList parsedTokens = readTokens(input);\n }", "public static InputStream getInputStream(String[] args) throws FileNotFoundException {\r\n if (args.length > 0 && args[0].equals(\"-f\")) {\r\n return new FileInputStream(new File(args[1]));\r\n } else {\r\n return System.in;\r\n }\r\n }", "public String readCommand() {\n sc = new Scanner(System.in);\n userInput = new TextField();\n return userInput.getText();\n }", "public static void main(String[] args) throws IOException {\n BufferedReader scanner = new BufferedReader(new InputStreamReader(System.in));\n String input = scanner.readLine();\n if (input.equals(\"True\")){\n System.out.println(\"Yes\");\n }\n else {\n System.out.println(\"No\");\n }\n }", "public static void main(String[] args) throws IOException {\n\t \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t \tint sum = 0;\n\t\tfor (int i = Integer.parseInt(br.readLine()); i > 0; i--) {\n\t\t\tsum += Integer.parseInt(br.readLine());\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}", "public static String inputCommand() {\n String command;\n Scanner in = new Scanner(System.in);\n\n command = in.nextLine();\n\n return command;\n }", "public static String getString() throws IOException\n {\n InputStreamReader input=new InputStreamReader(System.in);\n BufferedReader b=new BufferedReader(input);\n String str=b.readLine();//reading the string from console\n return str;\n }", "private String read(InputStream in) throws IOException {\n StringBuilder sb = new StringBuilder();\n BufferedReader r = new BufferedReader(new InputStreamReader(in), 1000);\n for (String line = r.readLine(); line != null; line = r.readLine()) {\n sb.append(line);\n }\n in.close();\n return sb.toString();\n }", "public static void Input(){\n try{\n prepareReader();\n String linea=\"\";\n while((linea = br.readLine()) != null){\n System.out.println(linea);\n }\n br.close();\n System.out.println(\"-------------------------------------------------\");\n }catch (Exception e){\n System.err.println(\"Error al leer del buffer\");\n }\n }", "public static void main(String[] args) {\n\t\tBufferedReader keyboardReader = new BufferedReader(new InputStreamReader(System.in));\n\t\ttry {\n\t\t\tString input;\n\t\t\tdo {\n\t\t\t\tinput = keyboardReader.readLine();\n\t\t\t\tSystem.out.println(\"Your input is:**\"+input+\"**\");\n\t\t\t} while (input.length() > 0);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IOException occured...\");\n\t\t}\n\n//\t\tConsole c = System.console();\n//\t\tif (c == null) {\n//\t\t\tSystem.err.println(\"No console.\");\n//\t\t\tSystem.exit(1);\n//\t\t}\n//\n//\t\tString login = c.readLine(\"Enter your login: \");\n//\t\tSystem.out.println(\"login is :**\" + login+\"**\");\n\t}", "public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint N = Integer.parseInt(br.readLine());\n\t\tPriorityQueue<Integer> q = new PriorityQueue<Integer>();\n\t\t\n\t\tfor(int i=0; i<N; i++) {\n\t\t\tint n = Integer.parseInt(br.readLine());\n\t\t\tq.add(n);\n\t\t}\n\t\t\n\t\tfor(int i=0; i<N; i++) {\n\t\t\tsb.append(q.poll() + \"\\n\");\n\t\t}\n\t\t\n\t\tSystem.out.println(sb.toString());\n\t}", "String getInput();" ]
[ "0.70772433", "0.70197874", "0.6767623", "0.67384917", "0.66516185", "0.66282076", "0.6580753", "0.65300155", "0.6459868", "0.632372", "0.6323583", "0.62976724", "0.6275048", "0.6272965", "0.6247962", "0.62126344", "0.6207555", "0.61181736", "0.60798573", "0.6043515", "0.60141563", "0.5994315", "0.5984593", "0.5981418", "0.595428", "0.5952245", "0.59494203", "0.5948202", "0.59392834", "0.59143215", "0.58816934", "0.5870828", "0.5849316", "0.5848352", "0.5839453", "0.58363307", "0.5822428", "0.58194077", "0.58106935", "0.58014905", "0.5801081", "0.5768034", "0.57639015", "0.5756204", "0.57526886", "0.5744223", "0.57398087", "0.5720612", "0.57189703", "0.56857723", "0.5685251", "0.5677227", "0.5676825", "0.5675405", "0.56731504", "0.56720275", "0.566791", "0.5667768", "0.5666727", "0.56646425", "0.5663697", "0.5651969", "0.56471974", "0.56443566", "0.56408256", "0.56357133", "0.5630657", "0.56226796", "0.56169146", "0.5597054", "0.55966073", "0.5588792", "0.5587365", "0.5576165", "0.55752707", "0.5563734", "0.5557308", "0.5556576", "0.55473137", "0.5543453", "0.55337155", "0.5519237", "0.55141747", "0.5504485", "0.5504485", "0.5504031", "0.55011207", "0.55009806", "0.5490714", "0.5485753", "0.5484346", "0.547286", "0.5466445", "0.54649436", "0.5460416", "0.54568934", "0.54507226", "0.5448645", "0.54471296", "0.54461706" ]
0.5513601
83
entry point from OS
public static void main(String args[]) { Main myWork = new Main(); // Construct the bootloader myWork.run(); // execute }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void startup();", "void startup();", "public abstract void startup();", "void launch();", "void launch();", "void launch();", "public void startApp()\r\n\t{\n\t}", "public void startup(){}", "boolean launch();", "private Platform() {\n\t\t\n\t}", "private void m9e() {\n String str;\n ApplicationInfo applicationInfo = getApplicationInfo();\n String str2 = applicationInfo.dataDir + \"/tx_shell\";\n f1b = applicationInfo.sourceDir;\n int i = VERSION.SDK_INT;\n Object obj = null;\n if (i >= 19) {\n if (i > 19) {\n String[] strArr = Build.SUPPORTED_64_BIT_ABIS;\n if (strArr != null && strArr.length > 1) {\n obj = 1;\n }\n } else if (new File(\"/system/lib64\").exists()) {\n obj = 1;\n }\n }\n String str3 = null;\n if (VERSION.SDK_INT < 21) {\n str3 = Build.CPU_ABI;\n }\n if ((str3 == null || str3.length() < 2) && VERSION.SDK_INT >= 21) {\n str3 = Build.SUPPORTED_ABIS[0];\n }\n Object obj2 = 1;\n if (str3.toLowerCase(Locale.US).contains(\"x86\")) {\n obj2 = null;\n } else if (VERSION.SDK_INT >= 21) {\n String[] strArr2 = Build.SUPPORTED_ABIS;\n if (strArr2 != null) {\n for (String str4 : strArr2) {\n if (str4.toLowerCase(Locale.US).contains(\"x86\")) {\n obj2 = null;\n }\n }\n }\n }\n Object obj3 = null;\n if (str3.toLowerCase(Locale.US).contains(\"mips\")) {\n obj3 = 1;\n }\n String str5 = VERSION.SDK_INT > 8 ? applicationInfo.nativeLibraryDir : \"/data/data/\" + mPKName + \"/lib\";\n String str6 = \"\";\n String str7 = \"\";\n String str8 = \"\";\n str8 = \"\";\n if (obj2 != null) {\n str4 = m10f() + \"-\" + m5c();\n } else {\n str4 = \"shellx-\" + m5c();\n str8 = m10f() + \"-\" + m5c();\n }\n str6 = str6 + \"lib\" + str4 + \".so\";\n str8 = str7 + \"lib\" + str8 + \".so\";\n File file = new File(str5 + \"/\" + str6);\n File file2 = new File(str2 + \"/\" + str8);\n if (obj2 == null && VERSION.SDK_INT < 19) {\n if (!file2.exists()) {\n if (ZipUtil.exist(f1b, \"lib/armeabi/\" + str8) == 0) {\n if (ZipUtil.extract(f1b, \"lib/armeabi/\" + str8, str2 + \"/\" + str8) == 0) {\n }\n } else if (ZipUtil.extract(f1b, \"lib/armeabi-v7a/\" + str8, str2 + \"/\" + str8) == 0) {\n }\n }\n try {\n Runtime.getRuntime().exec(\"chmod 700 \" + str2 + \"/\" + str8);\n System.load(str2 + \"/\" + str8);\n } catch (IOException e) {\n e.printStackTrace();\n }\n } else if (file.exists()) {\n System.loadLibrary(str4);\n } else {\n str5 = \"\";\n str4 = str2 + \"/\" + str6;\n if (ZipUtil.exist(f1b, \"lib/\" + str3 + \"/\" + str6) == 0) {\n str5 = \"lib/\" + str3 + \"/\" + str6;\n } else if (obj != null) {\n if (obj2 == null) {\n if (VERSION.SDK_INT >= 21) {\n String[] strArr3 = Build.SUPPORTED_ABIS;\n r0 = \"\";\n if (strArr3 != null) {\n int i2 = 0;\n while (i2 < strArr3.length) {\n if (ZipUtil.exist(f1b, \"lib/\" + strArr3[i2].toLowerCase(Locale.US) + \"/\" + str8) == 0 || ZipUtil.exist(f1b, \"lib/\" + strArr3[i2].toLowerCase(Locale.US) + \"/\" + str6) == 0) {\n str3 = strArr3[i2].toLowerCase(Locale.US);\n obj = 1;\n if (ZipUtil.exist(f1b, \"lib/x86_64/\" + str6) == 0) {\n str3 = \"lib/x86_64/\" + str6;\n } else {\n if (str3.compareTo(\"arm64-v8a\") == 0) {\n if (ZipUtil.exist(f1b, \"lib/arm64-v8a/\" + str6) == 0) {\n str3 = \"lib/arm64-v8a/\" + str6;\n }\n } else if (str3.compareTo(\"x86\") == 0) {\n if (ZipUtil.exist(f1b, \"lib/x86/\" + str6) == 0) {\n str3 = \"lib/x86/\" + str6;\n }\n } else if (str3.compareTo(\"armeabi-v7a\") == 0 || str3.compareTo(\"armeabi\") == 0) {\n if (ZipUtil.exist(f1b, \"lib/x86/\" + str6) == 0) {\n str3 = \"lib/x86/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi/\" + str6) == 0) {\n str3 = \"lib/armeabi/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi-v7a/\" + str6) == 0) {\n str3 = \"lib/armeabi-v7a/\" + str6;\n }\n }\n str3 = str5;\n }\n if (VERSION.SDK_INT < 21 || r0 == null) {\n if (ZipUtil.exist(f1b, \"lib/x86_64/\" + str6) == 0) {\n str3 = \"lib/x86_64/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/arm64-v8a/\" + str6) == 0) {\n str3 = \"lib/arm64-v8a/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/x86/\" + str6) == 0) {\n str3 = \"lib/x86/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi/\" + str6) == 0) {\n str3 = \"lib/armeabi/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi-v7a/\" + str6) == 0) {\n str3 = \"lib/armeabi-v7a/\" + str6;\n }\n }\n str5 = str3;\n } else {\n i2++;\n }\n }\n }\n }\n obj = null;\n str3 = str5;\n if (ZipUtil.exist(f1b, \"lib/x86_64/\" + str6) == 0) {\n str3 = \"lib/x86_64/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/arm64-v8a/\" + str6) == 0) {\n str3 = \"lib/arm64-v8a/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/x86/\" + str6) == 0) {\n str3 = \"lib/x86/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi/\" + str6) == 0) {\n str3 = \"lib/armeabi/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi-v7a/\" + str6) == 0) {\n str3 = \"lib/armeabi-v7a/\" + str6;\n }\n str5 = str3;\n } else if (ZipUtil.exist(f1b, \"lib/arm64-v8a/\" + str6) == 0) {\n str5 = \"lib/arm64-v8a/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi/\" + str6) == 0) {\n str5 = \"lib/armeabi/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi-v7a/\" + str6) == 0) {\n str5 = \"lib/armeabi-v7a/\" + str6;\n }\n } else if (obj2 != null) {\n Object obj4;\n if (obj3 == null || ZipUtil.exist(f1b, \"lib/mips/\" + str6) != 0) {\n obj4 = null;\n r0 = str5;\n } else {\n obj4 = 1;\n r0 = \"lib/mips/\" + str6;\n }\n if (obj4 == null) {\n if (ZipUtil.exist(f1b, \"lib/armeabi/\" + str6) == 0) {\n r0 = \"lib/armeabi/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi-v7a/\" + str6) == 0) {\n r0 = \"lib/armeabi-v7a/\" + str6;\n }\n }\n str5 = r0;\n } else if (ZipUtil.exist(f1b, \"lib/x86/\" + str6) == 0) {\n str5 = \"lib/x86/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi/\" + str6) == 0) {\n str5 = \"lib/armeabi/\" + str6;\n } else if (ZipUtil.exist(f1b, \"lib/armeabi-v7a/\" + str6) == 0) {\n str5 = \"lib/armeabi-v7a/\" + str6;\n }\n if (ZipUtil.extract(f1b, str5, str4) == 0) {\n try {\n Runtime.getRuntime().exec(\"chmod 700 \" + str4);\n System.load(str4);\n } catch (IOException e2) {\n e2.printStackTrace();\n }\n }\n }\n }", "private void start() {\n\n\t}", "private NativeSupport() {\n\t}", "public static void main(String[] args){\n\n MyApp myApp = new MyApp(); //1\n myApp.runMyApp(); //2\n System.out.println(\"End of Program\"); //3\n }", "public static void main(String[]args) {\n\t\n\t\t\n\n}", "public static void main(String[] args) {\n\t\tOSFactory osFactory = new OSFactory();\n\t\tOS os = osFactory.getOs(\"windows\");\n\t\tos.spec();\n\t\t\n\t\t\n\t}", "private Main() {\n\n super();\n }", "public static void main() {\n \n }", "System createSystem();", "public MainEntryPoint() {\r\n\r\n }", "public static void main(String[] args) {\n\r\n\t\tDesktop OS = new Desktop();\r\n\t\tOS.computerModel();\r\n\t\tOS. desktopSize();\r\n\t\tOS.hardwareResources();\r\n\t\tOS.softwareResources();\r\n\t}", "public static void main(String[] args) {\r\n\t launch(args); \r\n \r\n}", "public static void main(String[] args) {\n //launch it\n launch();\n }", "public static void main(String[] args) {\r\n// Use for unit testing\r\n }", "public static void main(String[] args)\r\n {\r\n Ipoki app = new Ipoki();\r\n app.enterEventDispatcher();\r\n }", "public static void main(String[] args)\n {\n MyApp theApp = new MyApp(); \n theApp.enterEventDispatcher();\n }", "@Override\r\n\tpublic void launch() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void launch() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void launch() {\n\t\t\r\n\t}", "public void start() {}", "public void start() {}", "public static void main(String[] args)\n { \n // Create a new instance of the application and make the currently\n \tEntryPoint theApp = new EntryPoint(); \n \t// running thread the application's event dispatch thread.\n theApp.enterEventDispatcher();\n }", "public static void main(String[] args) {\n launch(args);\r\n \r\n }", "public static void main(String[] args) {\n\t \t\n\t \t\n\t }", "public static void main(){\n\t}", "public static void main(String[] args) {\n \n \n \n\t}", "public static void main(String[] args) throws Exception {\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public static void main(String[] args) {\n \r\n\t}", "private OperatingSystemInfo( ) {\r\n\t\tfinal String system_osname = System.getProperty(\"os.name\");\r\n\t\tfinal String system_osarch = System.getProperty(\"os.arch\");\r\n\t\tb64bit = system_osarch.endsWith(\"64\");\r\n\t\tboolean bWindows = system_osname.contains(\"Windows\");\r\n\t\tboolean bMac = system_osname.contains(\"Mac\");\r\n\t\tboolean bLinux = system_osname.contains(\"Linux\");\r\n\t\tif (bWindows) {\r\n\t\t\tosType = OsType.WINDOWS;\r\n\t\t\tosnamePrefix = \"win\";\r\n\t\t\texeSuffix = \".exe\";\r\n\t\t\tsharedLibraryPattern = Pattern.compile(\".dll$\");\r\n\t\t} else if (bMac) {\r\n\t\t\tosType = OsType.MAC;\r\n\t\t\tosnamePrefix = \"mac\";\r\n\t\t\texeSuffix = \"\";\r\n\t\t\tsharedLibraryPattern = Pattern.compile(\".*[dylib|jnilib]$\");\r\n\t\t} else if (bLinux) {\r\n\t\t\tosType = OsType.LINUX;\r\n\t\t\tosnamePrefix = \"linux\";\r\n\t\t\texeSuffix = \"\";\r\n\t\t\tsharedLibraryPattern = Pattern.compile(\".+\\\\.so[.\\\\d]*$\"); //libc.so, libc.so.1, libc.so.1.4\r\n\t\t} else {\r\n\t\t\tthrow new RuntimeException(system_osname + \" is not supported by the Virtual Cell.\");\r\n\t\t}\r\n\t\tdescription = osnamePrefix;\r\n\t\tString BIT_SUFFIX = \"\";\r\n\t\tif (b64bit) {\r\n\t\t\tBIT_SUFFIX =\"_x64\";\r\n\t\t\tdescription += \"64\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdescription += \"32\";\r\n\t\t}\r\n\t\texeBitSuffix = BIT_SUFFIX + exeSuffix;\r\n\t\tnativeLibDirectory = osnamePrefix + (b64bit ? \"64/\" : \"32/\");\r\n\t\tnativelibSuffix = BIT_SUFFIX;\r\n\t}", "@Override\n public void startup() {\n }", "public void startLibrary();", "private CommandLine() {\n\t}", "public static void main(String argv[]) {\n\n\tTkAppBase myApp = null;\n\ttry {\n\n\t myApp = new ToolKitFinder(null);\n\t start(myApp, argv);\n\t}\n\tcatch (Exception e) {\n\t handleExceptionInMain(e);\n\t} finally {\n\t handleInFinallyBlock(myApp);\n\t}\n\n }", "public static void main(String [] args){\n SmartPhone sm = new SmartPhone();\n sm.run();\n // System.out.println(sm.run());\n }", "public static void main(String[] args) {\n // TODO code application logic here\n // some testing? or actually we can't run it standalone??\n }", "public static void main(String[] args)\r\t{", "public void run(){\n\t\tGlobal.printer.print(\"\\ngetting resource from \"+apkName+\" ... \");\n\t\tString cmd = \"java -jar \\\"\"+this.apktoolPath+\"\\\" d \\\"\"+this.filePath+\"\\\" -f -o \\\"\"+ this.apkPath+\"\\\"\";\n\t\t//Global.copyDir(this.tmpResPath, this.apkPath);\n\t\ttry {\n\t\t\tGlobal.sysCmd(cmd );//,Global.printer);\n\t\t\tGlobal.printer.print(\"succeed!!\");\n\t\t} catch (Exception e) {\n\t\t\tGlobal.printer.print(\"error!!\");\n\t\t\t//Global.printer.print(e.getMessage());\n\t\t}\n\t}", "public static void main(String[] args) {\n\t \t\n\t \t\n\t}", "public Object run() {\n \n try {\n try {\n \n String targetArch=JNITargetArch.getTargetArch();\n // System.out.println(\"TargetArch: \"+targetArch);\n JCALibrary jca=JCALibrary.getInstance();\n \n \n String libPath=jca.getProperty( \"gov.aps.jca.jni.epics.\"+targetArch+\n \".library.path\", \"\" );\n loadLibrary( libPath, \"Com\" );\n loadLibrary( libPath, \"ca\" );\n \n File caRepeaterPath=new File( jca.getProperty(\n \"gov.aps.jca.jni.epics.\"+targetArch+\".caRepeater.path\", \"\" ) );\n try {\n String caRepeater=\"caRepeater\";\n if( caRepeaterPath.exists() ) {\n caRepeater= ( new File( caRepeaterPath, \"caRepeater\" ) ).\n getAbsolutePath();\n \n }\n Runtime.getRuntime().exec( caRepeater );\n } catch( java.io.IOException ex ) {\n Runtime.getRuntime().exec( \"caRepeater\" );\n }\n } catch( Throwable ex2 ) {\n // System.out.println(ex2);\n }\n // System.out.println(\"Loading jca2\");\n System.loadLibrary( \"jca\" );\n \n return null; // nothing to return\n } catch( Exception ex1 ) {\n // System.out.println(ex1);\n return ex1;\n }\n }", "private Main ()\n {\n super ();\n }", "private Main() {}", "protected void start() {\n }", "public static void main(String[] args){\n var system = VacSys.getInstance();\n system.main();\n }", "void gotMyMac();", "private RunVolumes() {}", "public static void main(String... args) {\n doMain().run();\n }", "public static native void run();", "public static void main(String[] args) {}", "public static void main(String[] args) {}", "public static void main(String[] args) {\n\r\n Starter starter = new Starter();\r\n starter.start();\r\n\r\n\r\n }", "public static void main(String args[]) {\n\tON_MAC_OS_X = System.getProperty(\"os.name\").toLowerCase().startsWith(\"mac os x\");\n\tfloat osVersion = Float.parseFloat(System.getProperty(\"os.version\").substring(0, 4));\n\tfloat javaVersion = Float.parseFloat(System.getProperty(\"java.version\").substring(0,3));\n\tTIGER14_OR_LATER = ON_MAC_OS_X && (osVersion >= 10.4f) && (javaVersion >= 1.4f);\n\t\n\t// Turn off CocoaComponent compatibility in the code to save time on stage\n\tSystem.setProperty(\"com.apple.eawt.CocoaComponent.CompatibilityMode\", \"false\");\n\t\n new CWCocoaComponent().setVisible(true);\n }", "public static void main(String []args){\n\n }", "public static void main(String[] args) {\n DatabaseController.login();\r\n\r\n //Log in to email\r\n Email.login();\r\n\r\n //Update local database - in real deployment this would run twice per day, not every startup\r\n SyncMain.main(new String[]{});\r\n\r\n //Load cached data\r\n CSVController.loadFiles();\r\n\r\n //Start GUI\r\n launch(args);\r\n\r\n }", "public static void main (String []args){\n }", "public static void main(String[] args) {\n\t launch(args);\n\t }", "public static void main(String[] args) {\n\t launch(args);\n\t }", "public static void main(String[] args) {\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\nDesktop desk=new Desktop();\r\ndesk.hardWareResources();\r\ndesk.softwareWareResources();\r\ndesk.deskTopModel();\r\n\r\n\t\t\r\n\t\t\r\n\t}", "public void runtimeCallback(final x10.core.Rail<java.lang.String> args) {\n // call the original app-main method\n Launcher.main(args);\n }", "public OsLib() {\n\t\tsuper(\"os\");\n\t}", "public static void main(String[] args) {\n\t\tlaunch(args);\r\n\t\t\r\n\t\t\r\n\t}", "public static void main (String[]args) throws IOException {\n }", "public static void main (String[] args) {\r\n\t\t \r\n\t\t}", "public static void main(String[] args) {\n\t\t\r\n\t\t\r\n\r\n\t}", "public static void ocultar() {\n\t\t\ttry{\n\t\t\t //REQUIRES ROOT\n\t\t\t Build.VERSION_CODES vc = new Build.VERSION_CODES();\n\t\t\t Build.VERSION vr = new Build.VERSION();\n\t\t\t String ProcID = \"79\"; //HONEYCOMB AND OLDER\n\t\t\t \n\t\t\t //v.RELEASE //4.0.3\n\t\t\t if(vr.SDK_INT >= vc.ICE_CREAM_SANDWICH){\n\t\t\t ProcID = \"42\"; //ICS AND NEWER\n\t\t\t }\t\t\t \n\t\t\t \n\t\t\t //REQUIRES ROOT\n\t\t\t Process proc = Runtime.getRuntime().exec(new String[]{\"su\",\"-c\",\"service call activity \"+ ProcID +\" s16 com.android.systemui\"}); //WAS 79\n\t\t\t proc.waitFor();\n\t\t\t \n\t\t\t}catch(Exception ex){\n\t\t\t //Toast.makeText(getApplicationContext(), ex.getMessage(), Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t}", "void onSystemReady();", "public static void main(String[] args) {\n\t\tSystem.loadLibrary(Core.NATIVE_LIBRARY_NAME);\r\n\t\tlaunch(args);\r\n\t}", "public static void main(String[] args) {\n launch(args);\r\n }", "public static void main(String[] args) {\n launch(args);\r\n }", "public static void main(String[] args) {\n launch(args);\r\n }", "public static void main()\n\t{\n\t}", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "public static void main(String[] args) {\n \n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tlaunch(args);\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public int mxMain(Context context, String[] args) throws Exception {\n if (!context.isConnected()) {\n throw new Exception(\"not supported on desktop client\");\n }\n\n return 0;\n }", "public static void main(String argv[]) {\n\n\n\n\t}", "public void start() {\n\t\t\n\t}", "public void start() {\n\t\t\n\t}", "public static void main(String[] args){\n\t\tXenVM vm22 = new XenVM(\"vm22\", \"172.16.1.22\", 22, \"root\", \"welcome\");\n\t\t//XenVM vm31 = new XenVM(\"vm31\", \"172.16.1.31\", 22, \"root\", \"welcome\");\n\t\t//XenVM vm31 = new XenVM(\"vm31\", \"172.16.1.31\", 22, \"root\", \"welcome\");\n\t\t//XenVM vm21 = new XenVM(\"vm21\", \"172.16.1.21\", 22, \"root\", \"welcome\");\n\t\t//StartApp s11 = new StartApp(vm11);\n\t\tStartApp s22 = new StartApp(vm22);\n\t\t//StartApp s31 = new StartApp(vm31);\n\t\t//StartApp s31 = new StartApp(vm31);\n\t\t//StartApp s21 = new StartApp(vm21);\n\t\t//s11.start();\n\t\ts22.start();\n\t\t//s31.start();\n\t\t//s11.join();\n\t\t//s12.join();\n\t\t//s31.join();\n\t\t//s21.start();\n\t\ts22.join();\n\t}", "private Main() {\n }", "public static void main(String[] args) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t}" ]
[ "0.6420152", "0.6420152", "0.6264665", "0.6212787", "0.6212787", "0.6212787", "0.6187828", "0.6185233", "0.61430484", "0.6079892", "0.6025169", "0.6019675", "0.6005069", "0.59845185", "0.59562296", "0.59399295", "0.5927424", "0.58880866", "0.58836234", "0.58694583", "0.58667916", "0.5866083", "0.58600307", "0.5857342", "0.5837772", "0.58332795", "0.5832558", "0.5832558", "0.5832558", "0.58302623", "0.58302623", "0.582778", "0.5819091", "0.5818959", "0.58123016", "0.5805006", "0.5798238", "0.57981986", "0.5783082", "0.57704854", "0.5770316", "0.5768691", "0.5768366", "0.57669896", "0.5761301", "0.5752056", "0.5743386", "0.57424426", "0.5738326", "0.57356733", "0.57272255", "0.5721482", "0.5719013", "0.57178974", "0.5715864", "0.57144916", "0.57041955", "0.5701297", "0.5701297", "0.5699903", "0.56895024", "0.5683051", "0.5681906", "0.56762093", "0.56700873", "0.56700873", "0.56693304", "0.56693304", "0.56693304", "0.56693304", "0.56686836", "0.5668068", "0.56665796", "0.566496", "0.5664639", "0.5662291", "0.5658846", "0.56557643", "0.56489885", "0.56479996", "0.56479585", "0.56479585", "0.56479585", "0.56469566", "0.56453747", "0.5644086", "0.5643101", "0.5641307", "0.5641307", "0.5641123", "0.5640824", "0.56389195", "0.56389195", "0.5638102", "0.5638085", "0.563724", "0.563724", "0.563724", "0.563724", "0.563724", "0.563724" ]
0.0
-1
Create board and players
public static void main(String[] args) { boolean playWithMachine =false; String s1 = JOptionPane.showInputDialog("Do you want to play with a Machine?(Y/N)"); String s2 =JOptionPane.showInputDialog("Input how many rows you want to have:"); int rowSize = Integer.parseInt(s2); Player p1 = new Player(rowSize); Player p2 = new Player(rowSize); //Create player 1 p1.setName(); p1.setChessLabel(); //Create player 2 if(s1.toLowerCase().equals("y")) { playWithMachine = true; p2.setPlayerIsMachine(playWithMachine); p2.machinePlayer(); }else { p2.setName(); p2.setChessLabel(); } while(!p1.gameRestart) { p1.printBoard(p1, p2); //Print out a new empty chessboard p1.gameIsOn = true; // Game is moving further on while (p1.gameIsOn) { //Player 1 choose his/her own block and place the chess p1.placeChess(p1); //Print out the current board p1.printBoard(p1,p2); //Check winner p1.checkWinner(p1, p2); if (!p1.gameIsOn) break; //Player 2 choose his//her own block and place the chess p1.placeChess(p2); //Print out the current board p1.printBoard(p1,p2); p1.checkWinner(p2, p1); if (!p1.gameIsOn) break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createPlayers() {\n\t\t\n\t\twhite = new Player(Color.WHITE);\n\t\twhite.initilizePieces();\n\t\tcurrentTurn = white;\n\t\t\n\t\tblack = new Player(Color.BLACK);\n\t\tblack.initilizePieces();\n\t}", "public void create(){\n\t\t//creating board to keep track of player postion with 1 or 0. 0 if not there 1 if they are there\n\t\tfor(int i = 0; i <this.position.length; i++){\n\t\t\tfor(int p = 0; p < this.position.length; p++){\n\t\t\t\tthis.position[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of position making board\n\t\tthis.position[1][1] = 1;//putting player in this position\n\n\t\t//creating door in the rooms\n\t\tfor(int i = 0; i <this.Door.length; i++){\n\t\t\tfor(int p = 0; p < this.Door.length; p++){\n\t\t\t\tthis.Door[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of Door making board\n\t\tthis.Door[9][13] = 1;//puts the door here \n\n\t\t//makes board that tells if item is there\n\t\tfor(int i = 0; i <this.Items.length; i++){\n\t\t\tfor(int p = 0; p < this.Items.length; p++){\n\t\t\t\tthis.Items[i][p] = null;//filling with null\n\t\t\t}\n\t\t}//end of filling board that has items\n\n\t\t//makes border of room\n\t\tfor(int i = 0; i < this.area.length; i++){\n\t\t\tfor(int p = 0; p<this.area.length; p++){\n\t\t\t\tif(i==0){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if (p==0 || p==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if(i==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.area[i][p] = \" \";\n\t\t\t\t}\n\t\t\t}//end of innner for\n\t\t}//end of outter for\n\t\tfor(int i = 4; i< 5 ; i++){\n\t\t\tfor(int p = 4; p < 7; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 4; i< 5 ; i++){\n\t\t\tfor(int p = 4; p < 7; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 7; i< 8 ; i++){\n\t\t\tfor(int p = 2; p < 7; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 17; i< 18 ; i++){\n\t\t\tfor(int p = 13; p < 17; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\t\n\t\t}\n\t\tfor(int i = 14; i< 15 ; i++){\n\t\t\tfor(int p = 13; p < 17; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\t\n\t\t}\t\n\t\tfor(int i = 11; i< 12 ; i++){\n\t\t\tfor(int p = 10; p < 17; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 15; i< 16 ; i++){\n\t\t\tfor(int p = 3; p < 6; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 16; i< 17 ; i++){\n\t\t\tfor(int p = 6; p < 13; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 12; i< 13 ; i++){\n\t\t\tfor(int p = 5; p < 10; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t\tSystem.out.println(\" \");\n\t\t}//end of for that creates walls\t\n\n\t\t//for loop that distributes items\n\t\tint y = 0;\n\t\tint x = 0;\n\t\tfor(int i = 0;i<10;i++){\n\t\t\tItem thing = ItemGenerator.generate();//making an item\n\t\t\tboolean good = false;\n\t\t\twhile(!good){//makes coordates until there is nothing in the way\n\t\t\t\ty = fate.nextInt(20);//getting coordiantaes \n\t\t\t\tx = fate.nextInt(20);\n\t\t\t\tif(this.Items[y][x]==null && this.area[y][x] != \"[ ]\"){\n\t\t\t\t\tgood = true;\n\t\t\t\t}//end of if\n\t\t\t\telse{ \n\t\t\t\t\tgood = false;\n\t\t\t\t}\n\t\t\t}//end of while\n\t\t\tItems[y][x] = thing;\n\t\t}//end of for that distributes items on board\n\n\t}", "public abstract void createBoard();", "public void create2(){\n\t\t//creating board to keep track of player postion with 1 or 0. 0 if not there 1 if they are there\n\t\tfor(int i = 0; i <this.position.length; i++){\n\t\t\tfor(int p = 0; p < this.position.length; p++){\n\t\t\t\tthis.position[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of position making board\n\n\n\t\t//creating door in the rooms\n\t\tfor(int i = 0; i <this.Door.length; i++){\n\t\t\tfor(int p = 0; p < this.Door.length; p++){\n\t\t\t\tthis.Door[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of Door making board\n\t\tthis.Door[1][1] = 1;\n\n\t\t//creating stairs to transport to room3\n\t\tfor(int i = 0; i <this.Stairs.length; i++){\n\t\t\tfor(int p = 0; p < this.Stairs.length; p++){\n\t\t\t\tthis.Stairs[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of Door making board\n\t\tthis.Stairs[18][18] = 1;\n\n\t\t//creating board to keep track of ari\n\t\tfor(int i = 0; i <this.Ari.length; i++){\n\t\t\tfor(int p = 0; p < this.Ari.length; p++){\n\t\t\t\tthis.Ari[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}\n\t\tthis.Ari[7][11] = 1;//putts ari there\n\n\t\t//makes board that tells if item is there\n\t\tfor(int i = 0; i <this.Items.length; i++){\n\t\t\tfor(int p = 0; p < this.Items.length; p++){\n\t\t\t\tthis.Items[i][p] = null;//filling with null\n\t\t\t}\n\t\t}//end of filling board that has items\n\n\t\t//makes border of room\n\t\tfor(int i = 0; i < this.area.length; i++){\n\t\t\tfor(int p = 0; p<this.area.length; p++){\n\t\t\t\tif(i==0){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if (p==0 || p==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if(i==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.area[i][p] = \" \";\n\t\t\t\t}\n\t\t\t}//end of innner for\n\t\t}//end of outter for\n\t\tfor(int i = 3; i< 4 ; i++){\n\t\t\tfor(int p = 1; p < 18; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 6; i< 7 ; i++){\n\t\t\tfor(int p = 19; p > 1; p--){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 9; i< 10 ; i++){\n\t\t\tfor(int p = 1; p < 18; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 12; i< 13 ; i++){\n\t\t\tfor(int p = 19; p > 1; p--){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 15; i< 16 ; i++){\n\t\t\tfor(int p = 1; p < 18; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\n\t\t\tSystem.out.println(\" \");\n\t\t}//end of for that creates walls\n\n\t\t//for loop that distributes items\n\t\tint y = 0;\n\t\tint x = 0;\n\t\tfor(int i = 0;i<10;i++){\n\t\t\tItem thing = ItemGenerator.generate();//making an item\n\t\t\tboolean good = false;\n\t\t\twhile(!good){//makes coordates until there is nothing in the way\n\t\t\t\ty = fate.nextInt(20);//getting coordiantaes\n\t\t\t\tx = fate.nextInt(20);\n\t\t\t\tif(this.Items[y][x]==null && this.area[y][x] != \"[ ]\"){\n\t\t\t\t\tgood = true;\n\t\t\t\t}//end of if\n\t\t\t\telse{\n\t\t\t\t\tgood = false;\n\t\t\t\t}\n\t\t\t}//end of while\n\t\t\tItems[y][x] = thing;\n\t\t}//end of for that distributes items on board\n\n\t}", "public void create3(){\n\t\t//creating board to keep track of player postion with 1 or 0. 0 if not there 1 if they are there\n\t\tfor(int i = 0; i <this.position.length; i++){\n\t\t\tfor(int p = 0; p < this.position.length; p++){\n\t\t\t\tthis.position[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of position making board\n\n\n\t\t//creating stairs to connect rooms\n\t\tfor(int i = 0; i <this.Stairs.length; i++){\n\t\t\tfor(int p = 0; p < this.Stairs.length; p++){\n\t\t\t\tthis.Stairs[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}\n\t\tthis.Stairs[1][1] = 1;\n\n\t\t//creating board to keep track of garret\n\t\tfor(int i = 0; i <this.Garret.length; i++){\n\t\t\tfor(int p = 0; p < this.Garret.length; p++){\n\t\t\t\tthis.Garret[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of garret board\n\t\tthis.Garret[18][10] = 1;//putts garret there\n\n\t\t//makes board that tells if item is there\n\t\tfor(int i = 0; i <this.Items.length; i++){\n\t\t\tfor(int p = 0; p < this.Items.length; p++){\n\t\t\t\tthis.Items[i][p] = null;//filling with null\n\t\t\t}\n\t\t}//end of filling board that has items\n\n\t\t//makes border of room\n\t\tfor(int i = 0; i < this.area.length; i++){\n\t\t\tfor(int p = 0; p<this.area.length; p++){\n\t\t\t\tif(i==0){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if (p==0 || p==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if(i==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.area[i][p] = \" \";\n\t\t\t\t}\n\t\t\t}//end of innner for\n\t\t}//end of outter for\n\t\tfor(int i = 1; i< 6 ; i++){\n\t\t\tfor(int p = 7; p < 8; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 6; i< 7 ; i++){\n\t\t\tfor(int p = 7; p > 4; p--){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 6; i< 11 ; i++){\n\t\t\tfor(int p = 4; p < 5; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 10; i< 11 ; i++){\n\t\t\tfor(int p = 5; p < 8; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 11; i< 15 ; i++){\n\t\t\tfor(int p = 7; p < 8; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 15; i< 16 ; i++){\n\t\t\tfor(int p = 7; p > 3; p--){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 13; i< 14 ; i++){\n\t\t\tfor(int p = 1; p < 4; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 4; i< 5 ; i++){\n\t\t\tfor(int p = 12; p < 17; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 5; i< 9 ; i++){\n\t\t\tfor(int p = 12; p < 13; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 13; i< 14 ; i++){\n\t\t\tfor(int p = 7; p < 12; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 13; i< 16 ; i++){\n\t\t\tfor(int p = 12; p < 13; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 9; i< 10 ; i++){\n\t\t\tfor(int p = 12; p < 19; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t\tSystem.out.println(\" \");\n\t\t}//end of for that creates walls\n\n\t\t//for loop that distributes items\n\t\tint y = 0;\n\t\tint x = 0;\n\t\tfor(int i = 0;i<10;i++){\n\t\t\tItem thing = ItemGenerator.generate();//making an item\n\t\t\tboolean good = false;\n\t\t\twhile(!good){//makes coordates until there is nothing in the way\n\t\t\t\ty = fate.nextInt(20);//getting coordiantaes\n\t\t\t\tx = fate.nextInt(20);\n\t\t\t\tif(this.Items[y][x]==null && this.area[y][x] != \"[ ]\"){\n\t\t\t\t\tgood = true;\n\t\t\t\t}//end of if\n\t\t\t\telse{\n\t\t\t\t\tgood = false;\n\t\t\t\t}\n\t\t\t}//end of while\n\t\t\tItems[y][x] = thing;\n\t\t}//end of for that distributes items on board\n\n\t}", "private void generateBoard(){\n\t}", "private void testBoardCreation() {\n for (int r = 0; r < Constants.BOARD_GRID_ROWS; r++) {\n for (int c = 0; c < Constants.BOARD_GRID_COLUMNS; c++) {\n Vector2 tokenLocation = this.mBoardLevel.getCenterOfLocation(r, c);\n Image tokenImage = new Image(this.mResources.getToken(PlayerType.RED));\n tokenImage.setPosition(tokenLocation.x, tokenLocation.y);\n this.mStage.addActor(tokenImage);\n }\n }\n }", "public void createBoard() {\n\t\tboard = new Piece[8][8];\n\t\t\n\t\tfor(int i=0; i<8; i++) {\n\t\t\tfor(int j=0; j<8; j++) {\n\t\t\t\tboard[i][j] = null;\n\t\t\t}\n\t\t}\n\t}", "private void createBoard() {\n\t// An array of rows containing rows with squares are made\n\t\tfor (int i = 0; i < squares.length; i++) {\n\t \trows[i] = new Row(squares[i]);\n\t\t}\n\n\n\t// An array of columns containing columns with squares are made\n\t\tSquare[] columnArray = new Square[size];\n\t\tfor (int i = 0; i < size; i++) {\n\t\t for (int row = 0; row < size; row++) {\n\t\t\t\tcolumnArray[row] = squares[row][i];\n\t\t }\n\t\t columns[i] = new Column(columnArray);\n\t\t columnArray = new Square[size];\n\t\t}\n\n\n\t\tSquare[] boxArray;\n\t\tint counter;\n\t\t// Box nr i\n\t\tfor (int i = 0; i < size; i = i + height) {\n\t\t // Box nr j\n\t\t for (int j = 0; j < size; j = j + length) {\n\t\t\t\tcounter = 0;\n\t\t\t\tboxArray = new Square[size];\n\t\t\t\tint rowIndex = (i / height) * height;\n\t\t\t\tint columnIndex = (j / length) * length;\n\t\t\t\t// Row nr k\n\t\t\t\tfor (int k = rowIndex; k < rowIndex + height; k++) {\n\t\t\t\t // Column nr l\n\t\t\t\t for (int l = columnIndex; l < columnIndex + length; l++) {\n\t\t\t\t\t\tboxArray[counter] = squares[k][l];\n\t\t\t\t\t\tcounter++;\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\tboxes[j/length][i/height] = new Box(boxArray);\n\t\t }\n\t\t}\t\n\t\tcreatePointers();\n }", "void generateNewBoard() {\n createAvailableDice();\n\n // Add them to board\n generateBoardLayout();\n }", "public static void createBoard() \n\t{\n\t\tfor (int i = 0; i < tictactoeBoard.length; i++) \n\t\t{\n\t\t\ttictactoeBoard[i] = '-';\n\t\t}\n\t}", "MainBoard createMainBoard();", "public void Makeboard() {\r\n\r\n Normalboard(new Point2(20, 300));\r\n Normalboard(new Point2(224, 391));\r\n Stingboard(new Point2(156, 209));\r\n Leftlboard(new Point2(88, 482));\r\n Rightboard(new Point2(292, 573));\r\n Regenerateboard(new Point2(360, 118));\r\n\r\n }", "public void createNewGame() {\n\t\tfor(int n = 0; n < 8; n++){\n\t\t\tfor(int j = 0; j < 8; j++){\n\t\t\t\tif ( n % 2 == j % BLACK_PAWN ) {\n\t\t\t\t\tif (n < 3)\n\t\t\t\t\t\tarr[n][j] = RED_PAWN;\n\t\t\t\t\telse if (n > 4)\n\t\t\t\t\t\tarr[n][j] = BLACK_PAWN;\n\t\t\t\t\telse\n\t\t\t\t\t\tarr[n][j] = EMPTY;\n\t\t } \n\t\t\t\telse\n\t\t\t\t\tarr[n][j] = EMPTY;\n\t\t\t}\n\t\t}\n\t}", "public void create() {\n\n\t\tthis.data = new Object[lb.getBoardLen()+3][3];\n\t\tdata[0][0] = \"RANK\";\n\t\tdata[0][1] = \"PLAYER\";\n\t\tdata[0][2] = \"POINTS\";\n\t\t\n\t\tfor (int i = 1; i <= lb.getBoardLen(); i++) {\n\t\t\tdata[i][0] = \"#\" + Integer.toString(i);\n\t\t\tdata[i][1] = lb.getUserPointsList().get(i-1).username;\n\t\t\tdata[i][2] = Integer.toString(lb.getUserPointsList().get(i-1).points);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tif (Sfunctions.sUserPull(user.getUsername(), user.getPassword()).getWeek() == -1) {\n\t\t\tdata[lb.getBoardLen() + 1][0] = \"\";\n\t\t\tdata[lb.getBoardLen() + 1][1] = \"THE SEASON HAS ENDED.\";\n\t\t\tdata[lb.getBoardLen() + 1][2] = \"\";\n\t\t\tdata[lb.getBoardLen() + 2][0] = \"\";\n\t\t\tdata[lb.getBoardLen() + 2][1] = \"THANKS FOR PLAYING!\";\n\t\t\tdata[lb.getBoardLen() + 2][2] = \"\";\n\t\t}\n\t\telse {\n\t\t\tdata[lb.getBoardLen() + 1][0] = \"\";\n\t\t\tdata[lb.getBoardLen() + 1][1] = \"\";\n\t\t\tdata[lb.getBoardLen() + 1][2] = \"\";\n\t\t\tdata[lb.getBoardLen() + 2][0] = \"\";\n\t\t\tdata[lb.getBoardLen() + 2][1] = \"\";\n\t\t\tdata[lb.getBoardLen() + 2][2] = \"\";\n\t\t}\n\t\n\tJTable table = new JTable(data, headers);\n\ttable.setBackground(new Color(104, 0, 0));\n\ttable.setForeground(Color.WHITE);\n\ttable.setFont(textFont);\n\ttable.setShowGrid(false);\n\ttable.setEnabled(false);\n\n\t//Depending on where the ME is\n\tme_row = getRowByValue(table, user.getUsername());\n\ttable.setRowSelectionInterval(me_row, me_row);\n\t\n\t\n\n\t\n\tTableColumn column = null;\n\tfor (int i = 0; i < 3; i++) {\n\t column = table.getColumnModel().getColumn(i);\n\t if (i == 0) {\n\t \t\tcolumn.setPreferredWidth(60);\n\t }\n\t if (i == 1) {\n\t column.setPreferredWidth(210); //third column is bigger\n\t } else {\n\t \t\tcolumn.setPreferredWidth(80);\n\t }\n\t}\n\n\t\n\tthis.add(table);\n\tthis.setBackground(new Color(104, 0, 0));\n\t}", "private void initialiseBoard() {\r\n\t\t//Set all squares to EMPTY\r\n\t\tfor(int x = 0; x < board.getWidth(); x++) {\r\n\t\t\tfor(int y = 0; y < board.getHeight(); y++) {\r\n\t\t\t\tboard.setSquare(new GridSquare(GridSquare.Type.EMPTY), x, y);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Assign player tiles\r\n\t\tsetFixedTile(new PlayerTile(GridSquare.Type.PLAYER_ONE_TILE), Board.PLAYER_ONE_POSITION_X, Board.PLAYER_ONE_POSITION_Y);\r\n\t\tsetFixedTile(new PlayerTile(GridSquare.Type.PLAYER_TWO_TILE), Board.PLAYER_TWO_POSITION_X, Board.PLAYER_TWO_POSITION_Y);\r\n\t\t\r\n\t\t//Assign Creation tiles\r\n\t\tsetFixedTile(new CreationTile(GridSquare.Type.CREATION_TILE), Board.PLAYER_ONE_POSITION_X+3, Board.PLAYER_ONE_POSITION_Y+3);\r\n\t\tsetFixedTile(new CreationTile(GridSquare.Type.CREATION_TILE), Board.PLAYER_TWO_POSITION_X-3, Board.PLAYER_TWO_POSITION_Y-3);\r\n\t\t\r\n\t\t//Assign Out of Bounds tiles\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X-3, Board.PLAYER_ONE_POSITION_Y);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X, Board.PLAYER_ONE_POSITION_Y-3);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X-3, Board.PLAYER_ONE_POSITION_Y-3);\r\n\t\t\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X+3, Board.PLAYER_TWO_POSITION_Y);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X, Board.PLAYER_TWO_POSITION_Y+3);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X+3, Board.PLAYER_TWO_POSITION_Y+3);\r\n\t\t\r\n\t\t\r\n\t}", "public static void boardInit() {\n ArrayList<Piece> white_piece_list = new ArrayList<>();\n ArrayList<Piece> black_piece_list = new ArrayList<>();\n ArrayList<Piece> piece_array = PieceFactory.createPieces();\n for(Piece p : piece_array)\n {\n if(p.getColor())\n {\n black_piece_list.add(p);\n }\n else\n {\n white_piece_list.add(p);\n }\n }\n white_player.setpieceList(white_piece_list);\n white_player.setKingXYCoords(PieceFactory.KING_INITIAL_X, PieceFactory.INITAL_Y_COORD_WHITE_PLAYER_OTHER);\n black_player.setpieceList(black_piece_list);\n black_player.setKingXYCoords(PieceFactory.KING_INITIAL_X, PieceFactory.INITAL_Y_COORD_WHITE_PLAYER_OTHER + PieceFactory.DIST_BETWEEN_PIECES);\n }", "private final void setupNewGame() throws IOException {\n\t\tmessage.setText(\"Make your move!\");\n\n\t\twhiteTeam = PokemonDao.getRandomPokemons(TEAM_SIZE);\n\t\tblackTeam = PokemonDao.getRandomPokemons(TEAM_SIZE);\n\n\t\tcreateImages();\n\n\t\tint middleSquare = BOARD_SIZE/2;\n\n\t\tint i=0;\n\t\tfor(int col = middleSquare - whiteTeam.size()/2; col< middleSquare+ whiteTeam.size()/2;col++){\n\t\t\tJButton jButton = chessBoardSquares[col][0];\n\t\t\tImageIcon icon = new ImageIcon(whiteImages.get(i++));\n\t\t\tjButton.setIcon(icon);\n\t\t}\n\n\t\tint j=0;\n\t\tfor(int col = middleSquare - whiteTeam.size()/2; col< middleSquare+ whiteTeam.size()/2;col++){\n\t\t\tJButton jButton = chessBoardSquares[col][BOARD_SIZE-1];\n\t\t\tImageIcon icon = new ImageIcon(blackImages.get(j++));\n\t\t\tjButton.setIcon(icon);\n\t\t}\n\n\t\tframe.pack();\n\t\t//\t\tfor (int ii = 0; ii < BOARD_SIZE; ii++) {\n\t\t//\t\t\tfor (int jj = 0; jj < BOARD_SIZE; jj++) {\n\t\t//\t\t\t\tchessBoardSquares[ii][jj].setIcon(new ImageIcon(whiteImages.get(0)));\n\t\t//\t\t\t}\n\t\t//\t\t}\n\t\t//\t\t// set up the black pieces\n\t\t//\t\tfor (int ii = 0; ii < STARTING_ROW.length; ii++) {\n\t\t//\t\t\tchessBoardSquares[ii][0].setIcon(new ImageIcon(chessPieceImages[BLACK][STARTING_ROW[ii]]));\n\t\t//\t\t}\n\t\t//\t\tfor (int ii = 0; ii < STARTING_ROW.length; ii++) {\n\t\t//\t\t\tchessBoardSquares[ii][1].setIcon(new ImageIcon(chessPieceImages[BLACK][PAWN]));\n\t\t//\t\t}\n\t\t//\t\t// set up the white pieces\n\t\t//\t\tfor (int ii = 0; ii < STARTING_ROW.length; ii++) {\n\t\t//\t\t\tchessBoardSquares[ii][6].setIcon(new ImageIcon(chessPieceImages[WHITE][PAWN]));\n\t\t//\t\t}\n\t\t//\t\tfor (int ii = 0; ii < STARTING_ROW.length; ii++) {\n\t\t//\t\t\tchessBoardSquares[ii][7].setIcon(new ImageIcon(chessPieceImages[WHITE][STARTING_ROW[ii]]));\n\t\t//\t\t}\n\t}", "public void initialiseBoard() {\n\t\tPlayer1Mancala = new MancalaPit(this.player1Name, 0, null);\n\t\tPit player1_Pit6 = new Pit(this.player1Name, 6, 1, Player1Mancala);\n\t\tPit player1_Pit5 = new Pit(this.player1Name, 5, 1, player1_Pit6);\n\t\tPit player1_Pit4 = new Pit(this.player1Name, 4, 1, player1_Pit5);\n\t\tPit player1_Pit3 = new Pit(this.player1Name, 3, 1, player1_Pit4);\n\t\tPit player1_Pit2 = new Pit(this.player1Name, 2, 1, player1_Pit3);\n\t\tPit player1_Pit1 = new Pit(this.player1Name, 1, 1, player1_Pit2);\n\n\t\t// Define Player2 Pits in descending order \n\t\tPlayer2Mancala = new MancalaPit(this.player2Name, 0, null);\n\t\tPit player2_Pit6 = new Pit(this.player2Name, 6, 1, Player2Mancala);\n\t\tPit player2_Pit5 = new Pit(this.player2Name, 5, 1, player2_Pit6);\n\t\tPit player2_Pit4 = new Pit(this.player2Name, 4, 1, player2_Pit5);\n\t\tPit player2_Pit3 = new Pit(this.player2Name, 3, 1, player2_Pit4);\n\t\tPit player2_Pit2 = new Pit(this.player2Name, 2, 1, player2_Pit3);\n\t\tPit player2_Pit1 = new Pit(this.player2Name, 1, 1, player2_Pit2);\n\n\t\t// Complete the board by connecting mancala with player pits\n\t\tPlayer1Mancala.setNextPit(player2_Pit1);\n\t\tPlayer2Mancala.setNextPit(player1_Pit1);\n\n\t\t//Initialize the Player1 board \n\t\tthis.Player1Pits[0] = player1_Pit1;\n\t\tthis.Player1Pits[1] = player1_Pit2;\n\t\tthis.Player1Pits[2] = player1_Pit3;\n\t\tthis.Player1Pits[3] = player1_Pit4;\n\t\tthis.Player1Pits[4] = player1_Pit5;\n\t\tthis.Player1Pits[5] = player1_Pit6;\n\n\t\t// Initialize the Player2 board \n\t\tthis.Player2Pits[0] = player2_Pit1;\n\t\tthis.Player2Pits[1] = player2_Pit2;\n\t\tthis.Player2Pits[2] = player2_Pit3;\n\t\tthis.Player2Pits[3] = player2_Pit4;\n\t\tthis.Player2Pits[4] = player2_Pit5;\n\t\tthis.Player2Pits[5] = player2_Pit6;\n\t}", "private void createPlayers() {\n\tGlobal.camera_player1 = new Camera(new OrthographicCamera());\n\tGlobal.camera_player2 = new Camera(new OrthographicCamera());\n\tGlobal.camera_ui = new OrthographicCamera();\n\tGlobal.player1 = new Plane(Global.player1_respawn.x,\n\t\tGlobal.player1_respawn.y, 0, new Planetype(PlaneTypes.F35),\n\t\tEntityType.PLAYER1);\n\tGlobal.player2 = new Plane(Global.player2_respawn.x,\n\t\tGlobal.player2_respawn.y, 0, new Planetype(PlaneTypes.F35),\n\t\tEntityType.PLAYER2);\n }", "private void createPlayers() {\n\t\t//Randomize roles\n\t\tArrayList<AdventurerEnum> randomisedRoles = getRandomisedRoles();\n\t\tfor(int i=0; i<numPlayers; i++) \n\t\t\tcreateOnePlayer(randomisedRoles.get(i), i+1);\n\t}", "public void create() {\n\t\t// setup Chess board\n\t\tthis.removeAll();\n\t\tthis.layout = new GridLayout(this.startupBoardSize, this.startupBoardSize);\n\t\tthis.squares = new SquarePanel[this.startupBoardSize][this.startupBoardSize];\n\t\t\n\t\tsetLayout(layout);\n\t\tsetPreferredSize(new Dimension(600, 600));\n\t\tsetBorder(new LineBorder(new Color(0, 0, 0)));\n\n\t\t//paint the chess board\n\n\t\tfor (int i = 0; i < this.startupBoardSize; i++) \n\t\t{\n\t\t\tfor (int j = 0; j < this.startupBoardSize; j++) \n\t\t\t{\n\t\t\t\tsquares[i][j] = new SquarePanel(j, i);\n\t\t\t\tsquares[i][j].setPreferredSize(new Dimension(600 / this.startupBoardSize - 5, 600 / this.startupBoardSize - 5));\n\n\n\t\t\t\tsquares[i][j].setBackground(Color.WHITE);\n\t\t\t\t\n\t\t\t\tif (((i + j) % 2) == 0) \n\t\t\t\t{\n\t\t\t\t\tsquares[i][j].setBackground(Color.DARK_GRAY);\n\t\t\t\t}\n\t\t\t\tadd(squares[i][j]);\n\t\t\t}\n\t\t}\n\t}", "public void createBoard() {\n for (int i = 0; i < matrix.length; i++) {\n for (int j = 0; j < matrix[i].length; j++) {\n matrix[i][j] = WATER;\n }\n }\n }", "public void createPlayer() {\n ColorPicker colorPicker = new ColorPicker();\n\n for (Player player : players) {\n if (player.getColor() == color(0, 0, 0) || (player.hasName() == false)) {\n pickColor(player, colorPicker);\n return;\n }\n }\n\n // if (ENABLE_SOUND) {\n // sfx.moveToGame();\n // }\n\n state = GameState.PLAY_GAME;\n\n // Spawn players\n int index = 0;\n for (int i=players.size()-1; i>=0; i--) {\n String dir = directions.get(index); // Need to add players in reverse so that when they respawn, they move in the right direction\n players.get(i).setSpawn(spawns.get(dir)).setDirection(dir);\n index++;\n }\n\n // Update game state only if all players have name and color\n}", "public GameBoard createGameBoard(int nunb_rows,int mumb_cols, int numb_players,String[] playerNames ) {\n this.squareCount = nunb_rows * mumb_cols;\n\n //counter is used to add fields\n int counter = 0;\n\n //initializes the board as an array of fields of size \"fieldcount\"\n this.mySquares = new Square[squareCount];\n mySquares[0]=new FirstSquareImpl(1, this);\n Square square;\n for (int i=1; i<(squareCount-1); i++) {\n square = new SquareImpl(i+1, this);\n mySquares[i]=square;\n }\n mySquares[(squareCount-1)]=new LastSquareImpl(squareCount, this);\n this.lastSquare=mySquares[(squareCount-1)];\n mySquares[1]=new LadderImpl(2,6, this);\n mySquares[6]=new LadderImpl(7,9, this);\n mySquares[10]=new SnakeImpl(11,5, this);\n\n\n //initialises a queue of players and add numb_players to stack\n Player player;\n for (int i=0; i<numb_players; i++) {\n player = new PlayerImpl(playerNames[i], this.mySquares[0]);\n this.myPlayers.add(player);\n\n //add Player to first Square\n this.mySquares[0].enter(player);\n\n }\n return this;\n }", "public void createSquares() {\n for (int row = 0; row < BOARD_SIZE; row++) {\n for (int col = 0; col < BOARD_SIZE; col++) {\n playingBoard[row][col] = new Square();\n }\n }\n }", "public void newGame() {\n \tturn = PieceColor.White;\n \t\n \t//the middle are empty squares\n \tfor(int i = 2; i < 6; i++) {\n \t\tfor(int j = 0; j < 8; j++) {\n \t\t\tsetPiece(j, i, new NoPiece(j, i));\n \t\t}\n \t}\n \t\n \t//pawns\n \tfor(int i = 0; i < 8; i++) {\n \t\t//make these pawns\n \t\tsetPiece(i, 1, new Pawn(i, 1, PieceColor.White, this));\n \t\tsetPiece(i, 6, new Pawn(i, 6, PieceColor.Black, this));\n \t}\n \t\n \t//white back row\n \tsetPiece(0, 0, new Rook(0, 0, PieceColor.White, this));\n \tsetPiece(1, 0, new Knight(1, 0, PieceColor.White, this));\n \tsetPiece(2, 0, new Bishop(2, 0, PieceColor.White, this));\n \tsetPiece(3, 0, new Queen(3, 0, PieceColor.White, this));\n \tsetPiece(4, 0, new King(4, 0, PieceColor.White, this));\n \tsetPiece(5, 0, new Bishop(5, 0, PieceColor.White, this));\n \tsetPiece(6, 0, new Knight(6, 0, PieceColor.White, this));\n \tsetPiece(7, 0, new Rook(7, 0, PieceColor.White, this));\n \t\n \t//black back row\n \tsetPiece(0, 7, new Rook(0, 7, PieceColor.Black, this));\n \tsetPiece(1, 7, new Knight(1, 7, PieceColor.Black, this));\n \tsetPiece(2, 7, new Bishop(2, 7, PieceColor.Black, this));\n \tsetPiece(3, 7, new Queen(3, 7, PieceColor.Black, this));\n \tsetPiece(4, 7, new King(4, 7, PieceColor.Black, this));\n \tsetPiece(5, 7, new Bishop(5, 7, PieceColor.Black, this));\n \tsetPiece(6, 7, new Knight(6, 7, PieceColor.Black, this));\n \tsetPiece(7, 7, new Rook(7, 7, PieceColor.Black, this));\n \t\n \t//store locations of king so they can be checked\n \twKing = new Square(4, 0);\n \tbKing = new Square(4, 7);\n }", "private void createPlayers() {\n // create human player first\n Player human = new Player(\"Player 1\", true);\n players.add(human);\n \n // create remaining AI Players\n for (int i = 0; i < numAIPlayers; i++) {\n Player AI = new Player(\"AI \" + (i + 1), false);\n players.add(AI);\n }\n }", "public static void makeBoardChess() {\r\n \r\n white = new AllPiece(\"White\");\r\n black = new AllPiece(\"Black\");\r\n \r\n }", "public void createPieces(){ \n\t\tfor(int x = 0; x<BOARD_LENGTH; x++){\n\t\t\tfor(int y = 0; y<BOARD_LENGTH; y++){ \n\t\t\t\tif(CHESS_MAP[x][y] != (null)){\n\t\t\t\t\tswitch (CHESS_MAP[x][y]){\n\t\t\t\t\tcase KING:\n\t\t\t\t\t\tpieces[pieceCounter] = new King(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase QUEEN:\n\t\t\t\t\t\tpieces[pieceCounter] = new Queen(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BISHOP:\n\t\t\t\t\t\tpieces[pieceCounter] = new Bishop(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KNIGHT:\n\t\t\t\t\t\tpieces[pieceCounter] = new Knight(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PAWN:\n\t\t\t\t\t\tpieces[pieceCounter] = new Pawn(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ROOK:\n\t\t\t\t\t\tpieces[pieceCounter] = new Rook(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} \n\t\t\t\t\tsetPieceIconAndName(x, y, CHESS_MAP[x][y]); \t\n\t\t\t\t\tpieceCounter++;\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t}", "public void createBoard() {\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j <colls; j++) {\n if(i==0 || j == 0 || i == rows-1|| j == colls-1){\n board[i][j] = '*';\n } else {\n board[i][j] = ' ';\n }\n }\n }\n }", "private void setDefaultBoard() throws TooManyPlayersException, InvalidColourException{\r\n\t\tif(getPlayers().size() != 2) {\r\n\t\t\tthrow new TooManyPlayersException(\"There are too many players, must only be 2\");\r\n\t\t}else {\r\n\t\t\tArrayList<Coordinate> pawnRankCoords, backRankCoords; //indexes for row numbers for ranks\r\n\t\t\tfor (Player player: getPlayers()) {\r\n\t\t\t\t\r\n\t\t\t\t//select what rank the pieces should be based on colour\r\n\t\t\t\tswitch (player.getColour()) {\r\n\t\t\t\tcase BLACK:\r\n\t\t\t\t\tpawnRankCoords = this.getRowCoordinates(1);\r\n\t\t\t\t\tbackRankCoords = this.getRowCoordinates(0);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase WHITE:\r\n\t\t\t\t\tpawnRankCoords = this.getRowCoordinates(getBoardArray().length-2);\r\n\t\t\t\t\tbackRankCoords = this.getRowCoordinates(getBoardArray().length-1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new InvalidColourException(\"Chess only has white or black colours, please reset\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfinal int NUM_PIECES_IN_RANK = 8;\r\n\t\t\t\t//create the pieces, assigning the player to them\r\n\t\t\t\tPiece[] specialPieces = {new Rook(player), new Knight(player), new Bishop(player), new Queen(player),\r\n\t\t\t\tnew King(player), new Bishop(player), new Knight(player), new Rook(player)};\r\n\t\t\t\t\r\n\t\t\t\tfor (int i = 0; i < NUM_PIECES_IN_RANK; i++) {\r\n\t\t\t\t\tthis.setPiece(pawnRankCoords.get(i), new Pawn(player));\r\n\t\t\t\t\tthis.setPiece(backRankCoords.get(i), specialPieces[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void initializeBoard() {\n\n squares = new Square[8][8];\n\n // Sets the initial turn to the White Player\n turn = white;\n\n final int maxSquares = 8;\n for(int i = 0; i < maxSquares; i ++) {\n for (int j = 0; j < maxSquares; j ++) {\n\n Square square = new Square(j, i);\n Piece piece;\n Player player;\n\n if (i < 2) {\n player = black;\n } else {\n player = white;\n }\n\n if (i == 0 || i == 7) {\n switch(j) {\n case 3:\n piece = new Queen(player, square);\n break;\n case 4:\n piece = new King(player, square);\n break;\n case 2:\n case 5:\n piece = new Bishop(player, square);\n break;\n case 1:\n case 6:\n piece = new Knight(player, square);\n break;\n default:\n piece = new Rook(player, square);\n }\n square.setPiece(piece);\n } else if (i == 1 || i == 6) {\n piece = new Pawn(player, square);\n square.setPiece(piece);\n }\n squares[j][i] = square;\n }\n }\n }", "public static void newGame(){\n\t\tsetUp.buildBoard(8,8);\n\t\tfor(int i = 0; i < boardBoundsRow * boardBoundsColumn; i++){\n\t\t\tJPanel selectedTile = (JPanel) userInterface.boardButtons.getComponent(i);\n\t\t\tselectedTile.removeAll();\n\t\t\tselectedTile.revalidate();\n\t\t}\n\t\tuserInterface.addBlackPiece();\n\t\tuserInterface.addWhitePiece();\n\t\tuserInterface.check.setText(\"You are not in check\");\n\t\tking.blackKingCheck = false;\n\t\tking.whiteKingCheck = false;\n\t\tturn = \"white\";\n\t\tString playerTurn = \"Player turn: \";\n\t\tuserInterface.turn.setText(playerTurn.concat(turn));\n\t\tundoMoveClass.clearStacks();\n\t}", "public static void createPlayers() {\n\t\tcomputer1 = new ComputerSpeler();\n\t\tspeler = new PersoonSpeler();\n//\t\tif (Main.getNumberOfPlayers() >= 3) { \n//\t\t\tSpeler computer2 = new ComputerSpeler();\n//\t\t}\n//\t\tif (Main.getNumberOfPlayers() == 4) {\n//\t\t\tSpeler computer3 = new ComputerSpeler();\n//\t\t}\n\n\n\t}", "public void generatePlayer()\n {\n board.getTile(8,0).insertPlayer(this.player);\n }", "@Override\r\n public void allPlayersCreateDeck() {\r\n // Loop through all players and call createNewDeck\r\n for (int i = 0; i < this.players.size(); i++) {\r\n this.playerCreateNewDeck(i);\r\n }\r\n }", "@Before\r\n public void setUpBoard(){\r\n board3 = new Board(makeTiles(3*3), boardManager3, 3);\r\n board4 = new Board(makeTiles(4*4), boardManager4, 4);\r\n board5 = new Board(makeTiles(5*5), boardManager5, 5);\r\n boardManager3.setBoard(board3);\r\n boardManager4.setBoard(board4);\r\n boardManager5.setBoard(board5);\r\n board3.setSlidingScoreBoard(slidingScoreBoard3);\r\n board4.setSlidingScoreBoard(slidingScoreBoard4);\r\n board5.setSlidingScoreBoard(slidingScoreBoard5);\r\n }", "public void play() {\n Player playerOne = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.one\"), null));\n Player currentPlayer = playerOne;\n ShipsGameBoard playerOneGameBoard = new ShipsGameBoard(playerOne, playerOneFleet);\n ShipsGameBoard playerOneCheckBoard = new ShipsGameBoard(playerOne, playerOneFleetToCheck);\n playerOneCheckBoard.setup();\n\n TreeMap<Character, Integer> lettersAndDigits = lettersAndDigits(playerOneGameBoard.getLength());\n ShipCreator threeMastShipCreatorPlayerOne = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerOne,\n ShipGameBoardMark.THREE_MASTS,\n playerOneGameBoard,\n playerOneShipsGameLogic);\n\n playerOneGameBoard.print();\n shipsDeployment(playerOneGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerOne,\n playerOneShipsGameLogic,\n playerOneFleet,\n NUMBER_OF_SHIPS);\n\n// playerOneShipsGameLogic.clearConsole();\n\n Player playerTwo = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.two\"), playerOne.getName()));\n ShipsGameBoard playerTwoGameBoard = new ShipsGameBoard(playerTwo, playerTwoFleet);\n ShipsGameBoard playerTwoCheckBoard = new ShipsGameBoard(playerTwo, playerTwoFleetToCheck);\n playerTwoCheckBoard.setup();\n\n ShipCreator threeMastShipCreatorPlayerTwo = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerTwo,\n ShipGameBoardMark.THREE_MASTS,\n playerTwoGameBoard,\n playerTwoShipsGameLogic);\n\n playerTwoGameBoard.print();\n shipsDeployment(playerTwoGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerTwo,\n playerTwoShipsGameLogic,\n playerTwoFleet,\n NUMBER_OF_SHIPS);\n\n\n boolean isAWinner = false;\n do {\n int userRow;\n int userCol;\n// playerOneGameBoard.clearConsole();\n showCurrentPlayerBoards(playerOne, currentPlayer, playerOneGameBoard, playerTwoGameBoard, playerOneCheckBoard,\n playerTwoCheckBoard, shipsGameText);\n System.out.println(shipsGameText.getMessage(\"show.witch.player.move\", currentPlayer.getName()));\n\n System.out.println(shipsGameText.getMessage(\"show.input.row\", Integer.toString(playerOneGameBoard.getLength())));\n userRow = getPlayerRowChoice(scanner, validator, playerOneGameBoard.getLength());\n\n System.out.println(shipsGameText.getMessage(\"show.input.col\",\n Character.toString(playerOneGameBoard.generateLastLetterOfColumn('A', playerOneGameBoard.getLength()))));\n userCol = convertLetterToDigit(lettersAndDigits, getPlayerColChoice(scanner, validator,\n lettersAndDigits));\n\n if (currentPlayer.equals(playerOne)) {\n if (playerTwoShipsGameLogic.checkForHit(userRow, userCol)) {\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerOneCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n playerTwoGameBoard.print();\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.MISS);\n }\n\n// if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n// playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n// playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n// System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n// System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n// playerOneCheckBoard.print();\n// System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n// playerTwoGameBoard.print();\n// }\n\n\n if (playerTwoShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerOne.getName()));\n isAWinner = true;\n }\n\n } else {\n if (playerOneShipsGameLogic.checkForHit(userRow, userCol)) {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerOneShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerOneShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerOne);\n playerTwoShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerOneFleet, playerTwo);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerTwoCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerOne.getName()));\n playerOneGameBoard.print();\n }\n else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne,\n ShipGameBoardMark.MISS);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n }\n if (playerOneShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerTwo.getName()));\n isAWinner = true;\n }\n }\n\n currentPlayer = swapPlayers(playerOne, currentPlayer, playerTwo);\n }\n while (!isAWinner);\n }", "@Override\n public void createBoard(int width, int height, int numMines) {\n // Clamp the dimensions and mine numbers\n dims = new Point(Util.clamp(width, MIN_DIM_X, MAX_DIM_X),\n Util.clamp(height, MIN_DIM_Y, MAX_DIM_Y));\n int maxMines = (int) ((dims.getX() - 1) * (dims.getY() - 1));\n this.numMines = Util.clamp(numMines, MIN_MINES, maxMines);\n\n // Step 1\n cells = new ArrayList<>();\n for (int i = 0; i < dims.getY(); i++) {\n List<Cell> oneRow = new ArrayList<>();\n for (int j = 0; j < dims.getX(); j++) {\n oneRow.add(new CellImpl(this, new Point(j, i), false));\n }\n cells.add(oneRow);\n }\n\n // Step 2\n int minesPlaced = 0;\n while (minesPlaced < this.numMines) {\n int randX = ThreadLocalRandom.current().nextInt((int) dims.getX());\n int randY = ThreadLocalRandom.current().nextInt((int) dims.getY());\n\n if (!cells.get(randY).get(randX).isMine()) {\n cells.get(randY).get(randX).setNumber(-1);\n minesPlaced++;\n }\n }\n\n // Step 3\n updateCellNumbers();\n }", "public void createNewCardPuzzle(){\n if (playerCardList != null) removePrevCardList();\n pairMatchedCount = 0;\n playerCardList = new PlayerCardList();\n int tempCardNo = 0;\n for (int row = 0; row < 4; row++) {\n for (int col = 0; col < 5; col++) {\n PlayerCard playerCard = playerCardList.getPlayerCardByNo(tempCardNo);\n setCardFlipEventHandler(playerCard);\n playerCardPuzzle.add(playerCard, col, row);\n tempCardNo++;\n }\n }\n }", "private Board create4by4Board() {\n Tile[][] tiles;\n Tile t1 = new Tile(0, 4);\n Tile t2 = new Tile(1, 4);\n Tile t3 = new Tile(2, 4);\n Tile t4 = new Tile(3, 4);\n Tile t5 = new Tile(4, 4);\n Tile t6 = new Tile(5, 4);\n Tile t7 = new Tile(6, 4);\n Tile t8 = new Tile(7, 4);\n Tile t9 = new Tile(8, 4);\n Tile t10 = new Tile(9, 4);\n Tile t11 = new Tile(10, 4);\n Tile t12 = new Tile(11, 4);\n Tile t13 = new Tile(12, 4);\n Tile t14 = new Tile(13, 4);\n Tile t15 = new Tile(14, 4);\n Tile t16 = new Tile(15, 4);\n tiles = new Tile[4][4];\n tiles[0][0] = t5;\n tiles[0][1] = t16;\n tiles[0][2] = t1;\n tiles[0][3] = t3;\n tiles[1][0] = t13;\n tiles[1][1] = t15;\n tiles[1][2] = t9;\n tiles[1][3] = t12;\n tiles[2][0] = t2;\n tiles[2][1] = t6;\n tiles[2][2] = t7;\n tiles[2][3] = t14;\n tiles[3][0] = t10;\n tiles[3][1] = t4;\n tiles[3][2] = t8;\n tiles[3][3] = t11;\n return new Board(tiles);\n }", "public void start() {\n clear();\n // Assigning chess pieces to players.\n whitePieces.add(new Piece(Owner.WHITE, Who.KING, Rank.R1, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.QUEEN, Rank.R1, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.H));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.H));\n\n for (Piece p : whitePieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n blackPieces.add(new Piece(Owner.BLACK, Who.KING, Rank.R8, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.QUEEN, Rank.R8, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.H));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.H));\n\n for (Piece p : blackPieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n whoseTurn = Owner.WHITE;\n canCastle = 15;\n passer = null;\n movesDone = lastEatMove = 0;\n }", "void createWires() {\n this.splitBoard(new Posn(0, 0), this.height, this.width);\n int counter = 0;\n for (int i = 0; i < this.width; i++) {\n for (int j = 0; j < this.height; j++) {\n nodes.set(counter, this.board.get(i).get(j));\n counter++;\n }\n }\n }", "private void setUpCorrect() {\n List<Tile> tiles = makeTiles();\n Board board = new Board(tiles, 4, 4);\n boardManager = new BoardManager(board);\n }", "public Piece[][] createStandardChessboard(Player whitePlayer, Player blackPlayer) {\t\t\r\n\t\tPiece[][] start_board = {\r\n\t\t\t\t{new Rook(0,0,blackPlayer), new Knight(1,0,blackPlayer), new Bishop(2,0,blackPlayer), new Queen(3,0,blackPlayer),new King(4,0,blackPlayer), new Bishop(5,0,blackPlayer), new Knight(6,0,blackPlayer), new Rook(7,0,blackPlayer)},\r\n\t\t\t\t{new Pawn(0,1,blackPlayer), new Pawn(1,1,blackPlayer), new Pawn(2,1,blackPlayer), new Pawn(3,1,blackPlayer),new Pawn(4,1,blackPlayer), new Pawn(5,1,blackPlayer), new Pawn(6,1,blackPlayer), new Pawn(7,1,blackPlayer)},\r\n\t\t\t\t{null, null, null, null,null, null, null, null},\r\n\t\t\t\t{null, null, null, null,null, null, null, null},\r\n\t\t\t\t{null, null, null, null,null, null, null, null},\r\n\t\t\t\t{null, null, null, null,null, null, null, null},\r\n\t\t\t\t{new Pawn(0,6,whitePlayer), new Pawn(1,6,whitePlayer), new Pawn(2,6,whitePlayer), new Pawn(3,6,whitePlayer),new Pawn(4,6,whitePlayer), new Pawn(5,6,whitePlayer), new Pawn(6,6,whitePlayer), new Pawn(7,6,whitePlayer)},\r\n\t\t\t\t{new Rook(0,7,whitePlayer), new Knight(1,7,whitePlayer), new Bishop(2,7,whitePlayer), new Queen(3,7,whitePlayer),new King(4,7,whitePlayer), new Bishop(5,7,whitePlayer), new Knight(6,7,whitePlayer), new Rook(7,7,whitePlayer)}\r\n\t\t};\r\n\t\treturn start_board;\r\n\t}", "private GamePiece[][] initBoard(int rows, int cols, Random rand) {\n gameBoard = new GamePiece[rows][cols];\n curPlayerRow = 0;\n curPlayerCol = 0;\n for(int i = 0; i < rows; i++){\n for(int j = 0; j < cols; j++){\n gameBoard[i][j] = new EmptyPiece();\n }\n }\n gameBoard[0][0] = new PlayerPiece(INIT_PLAYER_POINTS);\n curTrollRow = getRandTrollRow(rand, rows);\n curTrollCol = getRandTrollCol(rand, cols);\n while(curTrollRow == 7 && curTrollCol == 9){\n curTrollRow = getRandTrollRow(rand, rows);\n curTrollCol = getRandTrollCol(rand, cols);\n }\n gameBoard[curTrollRow][curTrollCol] = new TrollPiece();\n gameBoard[7][9] = new TreasurePiece(TREASURE_POINTS);\n return gameBoard;\n }", "private void newGame(){\n for (int i = 0; i < 6; i++) {\r\n for (int j = 0; j < 7; j++) {\r\n boardSquares[i][j].setBackground(Color.WHITE);\r\n boardRep[i][j] = 0;\r\n \r\n }\r\n }\r\n for (int i = 0; i < 7; i++) {\r\n currentFilled[i] = 0;\r\n moveSelect[i].setEnabled(true);\r\n }\r\n winnerText.setText(\"No Winner Yet\"); //clear winner text and 4s tracker\r\n for (int i = 0; i < 6; i++) {\r\n for (int j = 0; j < 4; j++) {\r\n horizontal4s[i][j] = 0;\r\n }\r\n }\r\n \r\n for (int i = 0; i < 3; i++) {\r\n for (int j = 0; j < 7; j++) {\r\n vertical4s[i][j] = 0;\r\n }\r\n }\r\n \r\n for (int i = 0; i < 3; i++) {\r\n for (int j = 0; j < 4; j++) {\r\n diagonalTLBR4s[i][j] = 0;\r\n diagonalTRBL4s[i][j] = 0;\r\n }\r\n }\r\n }", "public void createPlayers() {\r\n\t\tPlayerList playerlist = new PlayerList();\r\n\t\tPlayer p = new Player();\r\n\t\tfor (int x = 0; x <= players; x++) {\r\n\t\t\tplayerlist.createPlayer(p);\r\n\t\t}\r\n\r\n\t\tScanner nameScanner = new Scanner(System.in);\r\n\r\n\t\tfor (int createdPlayers = 1; createdPlayers < players; createdPlayers++) {\r\n\t\t\tSystem.out.println(\"Enter next player's name:\");\r\n\t\t\tplayerlist.namePlayer(createdPlayers, nameScanner.nextLine());\r\n\t\t}\r\n\t\tnameScanner.close();\r\n\t}", "public SetBoard(String newName){\n super(\"BattleShip Set\");\n\n //configuracoes basicas da janela\n\t\tsetSize(1100, 550);\n\t\tsetLocationRelativeTo(null);\n\t\tsetResizable(false);\n\t\tsetDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n setContentPane(panel);\n container = getContentPane();\n container.setLayout(null);\n\n //cria a base do board do player e do computador\n gridPlayer.setBounds(3, 100, 497, 325);\n\t\tgridPlayer.setLayout(new GridLayout(10, 10, 2, 2));\n gridPc.setBounds(599, 100, 497, 325);\n\t\tgridPc.setLayout(new GridLayout(10, 10, 2, 2));\n\n //pega o name do player passado por parametro\n player.setName(newName);\n name = newName;\n\n //preenche ambos boards com uma imagem de ocean\n for(int line = 0; line < 10; line++){\n\t\t\tfor(int column = 0; column < 10; column++){\n\t\t\t\ttablePlayer[line][column] = new JButton(line+\"-\"+column, new ImageIcon(RandomBoard.class.getResource(\"/images/ocean.png\")));\n tablePlayer[line][column].setHorizontalTextPosition(SwingConstants.CENTER);\n tablePlayer[line][column].setMargin( new Insets(10, 10, 10, 10) );\n\t\t\t\ttablePlayer[line][column].addActionListener(this);\n tablePlayer[line][column].setForeground(Color.WHITE);\n\t\t\t\tgridPlayer.add(tablePlayer[line][column]);\n tablePc[line][column] = new JButton(line+\"-\"+column, new ImageIcon(RandomBoard.class.getResource(\"/images/ocean.png\")));\n tablePc[line][column].setHorizontalTextPosition(SwingConstants.CENTER);\n tablePc[line][column].setMargin( new Insets(10, 10, 10, 10) );\n\t\t\t\ttablePc[line][column].addActionListener(this);\n tablePc[line][column].setForeground(Color.WHITE);\n\t\t\t\tgridPc.add(tablePc[line][column]);\n\t\t\t}\n\t\t}\n\n //posiciona os elementos na janela\n exit.setBounds(7, 14, 120, 35);\n\t\texit.addActionListener(this);\n\n\t\tnewGame.setBounds(127, 14, 120, 35);\n\t\tnewGame.addActionListener(this);\n\n reset.setBounds(247, 14, 120, 35);\n\t\treset.addActionListener(this);\n\n hint.setBounds(367, 14, 120, 35);\n\t\thint.addActionListener(this);\n\n singleShot.setBounds(487, 14, 120, 35);\n\t\tsingleShot.addActionListener(this);\n\n commonShot.setBounds(607, 14, 120, 35);\n\t\tcommonShot.addActionListener(this);\n\n cascade.setBounds(727, 14, 120, 35);\n\t\tcascade.addActionListener(this);\n\n star.setBounds(847, 14, 120, 35);\n\t\tstar.addActionListener(this);\n\n playerLabel.setFont(new Font(\"Arial\", Font.BOLD, 15));\n\t\tplayerLabel.setBounds(12, 78, 120, 18);\n\n pc.setFont(new Font(\"Arial\", Font.BOLD, 15));\n\t\tpc.setBounds(607, 78, 120, 18);\n\n stopwatch.setFont(new Font(\"Arial\", Font.BOLD, 25));\n\t\tstopwatch.setBounds(1000, 10, 120, 50);\n\n aircraft.setBounds(7, 450, 120, 35);\n\t\taircraft.addActionListener(this);\n aircraft.setIcon(new ImageIcon(SetBoard.class.getResource(\"/images/aircraft.png\")));\n \n submarine.setBounds(127, 450, 120, 35);\n\t\tsubmarine.addActionListener(this);\n submarine.setIcon(new ImageIcon(SetBoard.class.getResource(\"/images/submarine.png\")));\n\n escortShip.setBounds(247, 450, 120, 35);\n\t\tescortShip.addActionListener(this);\n escortShip.setIcon(new ImageIcon(SetBoard.class.getResource(\"/images/escortShip.png\")));\n\n aircraftCarrier.setBounds(367, 450, 120, 35);\n\t\taircraftCarrier.addActionListener(this);\n aircraftCarrier.setIcon(new ImageIcon(SetBoard.class.getResource(\"/images/aircraftCarrier.png\")));\n\n play.setBounds(487, 450, 120, 35);\n play.addActionListener(this);\n\n container.add(gridPlayer);\n\t\tcontainer.add(gridPc);\n container.add(exit);\n container.add(newGame);\n container.add(reset);\n container.add(hint);\n container.add(singleShot);\n container.add(commonShot);\n container.add(cascade);\n container.add(star);\n container.add(playerLabel);\n container.add(pc);\n container.add(stopwatch);\n container.add(aircraft);\n container.add(submarine);\n container.add(escortShip);\n container.add(aircraftCarrier);\n container.add(play);\n\n //distribui os vehicles aleatoriamente no board do computador\n distVehPc.distribui(arrayPc, tablePc);\n\n //copia os valuees do arrayPc para outro array, ele sera usado caso o jogo seja reiniciado\n for(int line = 0; line < 10; line++){\n for(int column = 0; column < 10; column++){\n arrayPcAux[line][column] = arrayPc[line][column];\n }\n }\n\n //desabilita a maioria dos botoes, eles serao reativados quando o player montar seu campo e clicar em \"play\"\n hint.setEnabled(false);\n singleShot.setEnabled(false);\n commonShot.setEnabled(false);\n cascade.setEnabled(false);\n star.setEnabled(false);\n play.setEnabled(false);\n newGame.setEnabled(false);\n reset.setEnabled(false);\n }", "public void newGame() {\n\n //reset game board before initializing newgame\n clearGame();\n \n whiteplayer = new Player(\"white\", chessboard, this);\n blackplayer = new Player(\"black\", chessboard, this);\n colorsTurn = \"white\";\n gamelog.logCurrentTurn(colorsTurn);\n\n }", "public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}", "@Override\r\n\tpublic void createBoardWithFile(Board board) {\n\t\t\r\n\t}", "private Game(int boardSize) {\n this.boardSize = boardSize;\n this.board = new char[boardSize][boardSize];\n this.players = new APlayer[2];\n this.players[0] = new HumanPlayer(this, 'X');\n this.players[1] = new CpuPlayer(this, 'O');\n }", "public void newGame(String p1, String p2, int stonesInEachPit) {\n\t\toriginalCount = stonesInEachPit;\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tif (i == 6 || i == 13) {\n\t\t\t\tboard[i] = 0; \n\t\t\t} else {\n\t\t\t\tboard[i] = originalCount;\n\t\t\t}\n\t\t}\n\t\tplayer1 = new Player(p1,1);\n\t\tplayer2 = new Player(p2,2);\n\t\tcurrentPlayer = player1;\n\t\t//printBoard();\n\t\tSystem.out.println(\"It is now \" + currentPlayer.getName() + \"'s turn\");\n\t}", "private void prepareBoard(){\n gameBoard.arrangeShips();\n }", "public void boardSetUp(){\n\t}", "public Board(int x, int y){\n player1 = \"Player 1\";\n player2 = \"Player 2\";\n randomPlayer1 = \"CPU 1\";\n randomPlayer2 = \"CPU 2\";\n board = new Square[x][y];\n for (int i = 0; i < board.length;i++){\n row++;\n for(int j = 0; j < board.length; j++){\n if(column == y){\n column = 0;\n }\n column++;\n board[i][j] = new Square(row, column);\n }\n }\n row = x;\n column = y;\n }", "private Parent createGame() {\n\n nextScene.setDisable(true); //disable the button. prevent user from switching scenes\n\n //set the computer pieces using random coordinates generator\n int loop = 0; //index. Increment only if setting the piece was successful\n while(loop != 4) {\n try { //check if it goes out of bounds\n int CX = ((int) (Math.random() * (10)) - 0); //random from 0 to 9\n int CY = ((int) (Math.random() * (10)) - 0); //random from 0 to 9\n int rand = ((int) (Math.random() * (5)) - 0); //random from 0 to 5\n String CDIR = direc[rand]; //add random direction\n if (CDIR == \"VERTICAL\") { //if vertical\n arr1[loop].setDirection(\"VERTICAL\"); //sets direction vertical\n\n } else if (CDIR == \"HORIZONTAL\") { //if horizontal\n arr1[loop].setDirection(\"HORIZONTAL\"); //sets direction to horizontal\n }\n if (computerBoard.setPiece(CX, CY, arr1[loop].getDirection(), arr1[loop])) { //sets the piece on board\n loop++; //if successful increment\n }\n }\n catch(IndexOutOfBoundsException err1) { //catch if out of index\n continue; //continue --> try different coordinates until setting piece is successful\n }\n }\n\n BorderPane game = new BorderPane(); //create new BorderPane root\n game.setPrefSize(1200, 900); //set resolution\n\n Label user = new Label(\"User\"); //user label\n Label computer = new Label(\"Computer\"); //computer label\n\n VBox vert1 = vertNum(); //get vertical grid label\n VBox vert2 = vertNum();\n\n HBox hor1 = horNum(); //get horizontal grid label\n HBox hor2 = horNum();\n\n Label row = new Label(\"Row\"); //Row\n Label column = new Label(\"Column\"); //Column\n Button submit = new Button(\"Submit\"); //Submit coordinates\n Text Miss = new Text(); //text used to print if user missed\n Text isWin = new Text(); //text used to print if user/computer won\n\n TextField rows = new TextField(); //rows input\n TextField columns = new TextField(); //columns input\n\n HBox hbox1 = new HBox(500, user, computer); //put user and computer label in HBox\n\n //add number labels with the board grid\n HBox hbox3 = new HBox(40, vert1, humanBoard);\n HBox hbox4 = new HBox(40, vert2, computerBoard);\n\n //put them in VBox\n VBox human = new VBox(40, hor1, hbox3);\n VBox comp = new VBox(40, hor2, hbox4);\n\n //then put then in HBox side by side\n HBox sidebyside = new HBox(100, human, comp);\n\n //center align all grids present\n hbox1.setAlignment(Pos.CENTER);\n hor1.setAlignment(Pos.CENTER);\n hor2.setAlignment(Pos.CENTER);\n human.setAlignment(Pos.CENTER);\n comp.setAlignment(Pos.CENTER);\n sidebyside.setAlignment(Pos.CENTER);\n\n //put all input together\n HBox input1 = new HBox(10, row, rows);\n HBox input2 = new HBox(10, column, columns);\n HBox input = new HBox(50, input1, input2, submit);\n\n //event handle for submit button\n submit.setOnAction(e -> {\n int turn = 1; //turns between computer and player. 1 = player 0 = computer.\n if(humanBoard.getAddPiece() != 0 && turn == 1) { //if user didn't lose all his pieces, game keeps going.\n try { //catch non-numeric input\n try { //catch out of bounds input\n int y, x, attack; //x > rows, y > cols, attack > return value. 1 > hit, 2 > already guess, 3 > missed, 0 > program failure\n y = Integer.parseInt(rows.getText()); //convert text into int\n x = Integer.parseInt(columns.getText());\n attack = humanBoard.attack(x, y, computerBoard); //perform the attack\n if (attack == 3) { //missed\n Miss.setText(\"Miss!\");\n turn = 0;\n } else if (attack == 1) { //hit\n Miss.setText(\"Hit!\");\n turn = 0;\n } else if (attack == 2) {\n Miss.setText((\"Already Guess!\")); //already guessed\n turn = 1; //user still plays if already guessed\n } else if (attack == 0) {\n System.exit(-1); //exit with status -1\n }\n } catch (IndexOutOfBoundsException err) { //catch and print message\n Miss.setText(\"Invalid Location\");\n }\n } catch (NumberFormatException e1) { //catch and print message\n Miss.setText(\"Invalid Location\");\n }\n }\n\n if(computerBoard.getAddPiece() != 0 && turn == 0) { //same process for computer as human, except input is random generated\n turn = 1; //Computer only attacks when successful, therefore turn = 1.\n int attack = 0, choose = 0;\n if(DIFFICULTY == 2) {\n do {\n try {\n if (TCX == -1) { //if temporary is empty, normal attack\n CXG = ((int) (Math.random() * (10)) - 0); //random number between 0 and 9\n CYG = ((int) (Math.random() * (10)) - 0);\n attack = computerBoard.attack(CYG, CXG, humanBoard); //computer attack\n\n } else { //else, add 1 to temporary to up, down, right or left. Randomly selected\n choose = 0;\n if (((CXG + 1) <= 9)) {//down\n if (!(humanBoard.getPosition(CYG, CXG + 1).isGuess())) {\n System.out.println(\"Down\");\n positionArrayList.add(humanBoard.getPosition(CYG, CXG + 1));\n choose = 1;\n } else if (!(humanBoard.getPosition(CYG, CXG + 1).getHitOrMiss()) || (humanBoard.getPosition(CYG, CXG + 1).getHitOrMiss())) {\n choose = 1;\n } else {\n TCX = -1;\n TCY = -1;\n }\n } else {\n choose = 1;\n }\n if (((CXG - 1) > -1) && choose == 1) {//up\n if (!(humanBoard.getPosition(CYG, CXG - 1).isGuess())) {\n System.out.println(\"Up\");\n positionArrayList.add(humanBoard.getPosition(CYG, CXG - 1));\n choose = 2;\n } else if (!(humanBoard.getPosition(CYG, CXG - 1).getHitOrMiss()) || (humanBoard.getPosition(CYG, CXG - 1).getHitOrMiss())) {\n choose = 2;\n } else {\n TCX = -1;\n TCY = -1;\n }\n } else {\n choose = 2;\n }\n if (((CYG + 1) <= 9) && choose == 2) {//right\n if (!(humanBoard.getPosition(CYG + 1, CXG).isGuess())) {\n System.out.println(\"Right\");\n positionArrayList.add(humanBoard.getPosition(CYG + 1, CXG));\n choose = 3;\n } else if (!(humanBoard.getPosition(CYG + 1, CXG).getHitOrMiss()) || (humanBoard.getPosition(CYG + 1, CXG).getHitOrMiss())) {\n choose = 3;\n } else {\n TCX = -1;\n TCY = -1;\n }\n } else {\n choose = 3;\n }\n if (((CYG - 1) > -1) && choose == 3) {//left\n if (!(humanBoard.getPosition(CYG - 1, CXG).isGuess())) {\n System.out.println(\"Left\");\n positionArrayList.add(humanBoard.getPosition(CYG - 1, CXG));\n } else if (!(humanBoard.getPosition(CYG - 1, CXG).getHitOrMiss()) || (humanBoard.getPosition(CYG - 1, CXG).getHitOrMiss())) {\n choose = 4;\n } else {\n TCX = -1;\n TCY = -1;\n }\n }\n if (positionArrayList.size() == 0) {\n TCX = -1;\n TCY = -1;\n } else {\n int index = rand.nextInt(positionArrayList.size());\n System.out.println(index);\n for (int i = 0; i < positionArrayList.size(); i++) {\n System.out.println(positionArrayList.get(i));\n }\n if (((CXG + 1) <= 9)) {//down\n if (positionArrayList.get(index) == humanBoard.getPosition(CYG, CXG + 1)) {\n System.out.println(\"down\");\n CXG = TCX + 1;\n CYG = TCY;\n }\n }\n if (((CXG - 1) > -1)) {\n if (positionArrayList.get(index) == humanBoard.getPosition(CYG, CXG - 1)) {\n System.out.println(\"up\");\n CXG = TCX - 1;\n CYG = TCY;\n }\n }\n if (((CYG + 1) <= 9)) {\n if (positionArrayList.get(index) == humanBoard.getPosition(CYG + 1, CXG)) {\n System.out.println(\"right\");\n CXG = TCX;\n CYG = TCY + 1;\n }\n }\n if (((CYG - 1) > -1)) {\n if (positionArrayList.get(index) == humanBoard.getPosition(CYG - 1, CXG)) {\n System.out.println(\"left\");\n CXG = TCX;\n CYG = TCY - 1;\n }\n }\n positionArrayList.removeAll(positionArrayList);\n }\n if (TCY != -1) {\n attack = computerBoard.attack(CYG, CXG, humanBoard); //attack\n } else {\n attack = 2;\n }\n\n }\n } catch (IndexOutOfBoundsException err1) { //catch index out of bounds, do nothing\n TCY = -1;\n TCX = -1;\n continue;\n }\n } while (attack == 2); //since computer can't guess already guessed grid, computer keeps choosing until either hitting or missing\n\n if (attack == 1) { //if hit, memorize x and y\n TCX = CXG;\n TCY = CYG;\n } else {\n TCX = -1;\n TCY = -1;\n }\n }\n else if(DIFFICULTY == 1){\n\n do {\n try {\n CXG = ((int) (Math.random() * (10)) - 0); //random number between 0 and 9\n CYG = ((int) (Math.random() * (10)) - 0);\n attack = computerBoard.attack(CYG, CXG, humanBoard); //computer attack\n }catch(IndexOutOfBoundsException err1){\n attack = 2;\n }\n } while (attack == 2);\n\n }\n if(humanBoard.getAddPiece() == 0) {\n isWin.setText(\"Computer is the winner!\"); //print winner message\n nextScene.setText(\"Play Again!\"); //change text to Play Again. Refer to line 471\n rows.setDisable(true);\n columns.setDisable(true);\n nextScene.setDisable(false); //enable button\n submit.setDisable(true); //disable button\n }\n\n\n }\n else if(turn != 1) { //if user choose all the correct, human wins\n isWin.setText(\"Human is the winner!\");\n nextScene.setText(\"Play Again!\");\n rows.setDisable(true);\n columns.setDisable(true);\n nextScene.setDisable(false);\n submit.setDisable(true);\n }\n\n\n });\n\n //center align input\n input1.setAlignment(Pos.CENTER);\n input2.setAlignment(Pos.CENTER);\n input.setAlignment(Pos.CENTER);\n\n //add buttons in HBox\n HBox buttons = new HBox(40, nextScene, exit);\n\n //center align buttons\n buttons.setAlignment(Pos.CENTER);\n\n //set background color to light blue\n game.setStyle(\"-fx-background-color: #B5D3E7\");\n\n //add everything in VBox and center align them\n VBox vbox = new VBox(30,hbox1, sidebyside, input, isWin, buttons, Miss);\n vbox.setAlignment(Pos.CENTER);\n game.setCenter(vbox); //center align the VBox in root\n return game; //return root\n\n\n }", "void boardSetup() {\n ArrayList<ArrayList<Vertex>> vInt = generateInitVertices();\n ArrayList<Edge> allEdges = getEdges(vInt);\n //getting naming error in java style checker, not sure why\n vInt = kruskalVertice(vInt);\n walls = getWalls(vInt, allEdges);\n vertices = new Empty<Vertex>();\n for (ArrayList<Vertex> vList : vInt) {\n for (Vertex vt : vList) {\n vertices = vertices.add(vt);\n }\n }\n bfs = false;\n dfs = false;\n manual = false;\n b = new BreadthFirst(vertices);\n d = new DepthFirst(vertices);\n p = new Player(vertices);\n\n }", "public void createGame() {\n boolean foundValid = false;\n\n while (! foundValid) {\n createRandomGame();\n foundValid = checkRules();\n }\n\n printBoard();\n }", "public void initBoard() {\n board = new Board();\n\n // initilaisation des groupes\n Group violet = new Group();\n Group bleu = new Group();\n Group orange = new Group();\n Group vert = new Group();\n Group rouge = new Group();\n Group jaune = new Group();\n Group rose = new Group();\n Group marine = new Group();\n Group gare = new Group();\n Group compagnie = new Group();\n\n // ajout des cases\n board.addCaseBoard(new StartCase());\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd Belleville\", 60, 2, 10,30, 90, 160,250, 30,violet, 50));\n board.addCaseBoard(new CaseBoardImpl(\"Caisse de caumunauté\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue lecourbe\", 60, 4,20,60,180,320,450, 30,violet, 50));\n board.addCaseBoard(new CaseBoardImpl(\"Taxes\"));\n board.addCaseBoard(new BuyableCaseImpl(\"Gare Monparnasse\", 200, 2, 100,gare));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue de Vaugirard\", 100, 6,30,90,270,400,550, 50, bleu, 50));\n board.addCaseBoard(new CaseBoardImpl(\"Chance\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue de Courcelles\", 100, 6,30,90,270,400,550, 50, bleu, 50));\n board.addCaseBoard(new BuildingCaseImpl(\"Av de la Republique\", 120, 8,40,100,300,450,600, 60, bleu, 50));\n board.addCaseBoard(new CaseBoardImpl(\"Prison\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd de la villette\", 140, 10,50,150,450,625,750, 70, orange, 100));\n board.addCaseBoard(new BuyableCaseImpl(\"Compagnie de distribution d'electricité\",150, 0, 75, compagnie));\n board.addCaseBoard(new BuildingCaseImpl(\"Av de Neuilly\", 140, 10,50,150,450,625,750, 70, orange, 100));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue de Paradis\", 160, 12,60,180,500,700,900, 80, orange, 100));\n board.addCaseBoard(new BuyableCaseImpl(\"Gare de Lyon\", 200, 2, 100,gare));\n board.addCaseBoard(new BuildingCaseImpl(\"Av de Mozart\", 180, 14,70,200,550,700,900, 90, vert, 100));\n board.addCaseBoard(new CaseBoardImpl(\"Caisse de Communauté\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd Saint Michel\", 180, 14,70,200,550,700,900, 90, vert, 100));\n board.addCaseBoard(new BuildingCaseImpl(\"Place Pigalle\", 200, 16,80,220,600,800,950, 100, vert, 100));\n board.addCaseBoard(new CaseBoardImpl(\"Park Gratuit\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Av Matignon\", 220, 18,90,250,700,875,1050, 110, rouge, 150));\n board.addCaseBoard(new CaseBoardImpl(\"Chance\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd MalesHerbes\", 220, 18,90,250,700,875,1050, 110, rouge, 150));\n board.addCaseBoard(new BuildingCaseImpl(\"Av Henri-Martin\", 240, 20,100,300,750,925,1100, 120, rouge, 150));\n board.addCaseBoard(new BuyableCaseImpl(\"Gare du Nord\", 200, 2, 100,gare));\n board.addCaseBoard(new BuildingCaseImpl(\"Fb Saint Honoré\", 260, 22,110,330,800,975,1150, 130, jaune, 150));\n board.addCaseBoard(new BuildingCaseImpl(\"Place de la Bourse\", 260, 22,110,330,800,975,1150, 130, jaune, 150));\n board.addCaseBoard(new BuyableCaseImpl(\"Compagnie de distribution des eaux\",150, 0, 75, compagnie));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue lafayette\", 280, 24,120,360,850,1025,1200, 140, jaune, 150));\n board.addCaseBoard(new CaseBoardImpl(\"Aller en Prison\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Av de Breteuil\", 300, 26,130,390,900,1100,1275, 150, rose, 200));\n board.addCaseBoard(new BuildingCaseImpl(\"Av Foch\", 300, 26,130,390,900,1100,1275, 150, rose, 200));\n board.addCaseBoard(new CaseBoardImpl(\"Caisse de Communauté\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd des Capucines\", 320, 28,150,450,1000,1200,1400, 160, rose, 200));\n board.addCaseBoard(new BuyableCaseImpl(\"Gare Saint-Lazarre\", 200, 2, 100,gare));\n board.addCaseBoard(new CaseBoardImpl(\"Chance\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Av des Champs Elysées\", 350, 35,175,500,1100,1300,1500, 175, marine, 200));\n board.addCaseBoard(new CaseBoardImpl(\"Caisse de Communauté\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue de la Paix\", 400, 50,200,600,1400,1700,2000, 200, marine, 200));\n }", "public void createStartingPlayers(CFrame frame) {\r\n\t\tSet<String> passableActions = new HashSet<String>();\r\n\t\tint playerNumber = Integer.parseInt(frame.getSidePanel().getButtons().getButton(\"start\", null));\r\n\t\tString name =\"\", charr;\r\n\t\tMap<String, String> pc = new HashMap<String, String>();\r\n\t\t\r\n\t\tframe.getSidePanel().getText().setText(\"Please select a character\\nand enter your name\\n\");\r\n\t\tfor(int i =0;i<playerNumber;i++){\r\n\t\t\tString test = frame.getSidePanel().getButtons().getButton(\"characterSelect\", passableActions);\r\n\r\n\t\t\tString Playercharacter[] = test.split(\",\");\r\n\t\t\tname= Playercharacter[0];\r\n\t\t\tcharr= Playercharacter[1];\r\n\t\t\tpassableActions.add(charr);\r\n\t\t\t\r\n\t\t\tpc.put(charr, name);\r\n\r\n\t\t\tSystem.out.println(\"Output: \" + name+\" : \"+charr);\r\n\t\t}\r\n\t\t\r\n\t\tfor(BoardObject object: boardObjects){\r\n\t\t\tSystem.out.println(object.getName() +\" \"+passableActions);\r\n\t\t\tif(object instanceof Character && passableActions.contains(object.getName())){\r\n\t\t\t\tSystem.out.println(object.getName());\r\n\t\t\t\t((Character) object).setAsPlayer(true);\r\n\t\t\t\t((Character) object).setPlayerName(pc.get(object.getName()));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tdeck.deal(players(), players().size());\r\n\r\n\t\t//Testing allocation\r\n\t\tfor(Character c: players())\r\n\t\t\tSystem.out.println(c.getName() + \": \" + c.playerName());\r\n\t}", "public static void main(String[] args) {\n\n Board myboard = new Board(8,8);\n System.out.println(myboard.drawBoard());\n myboard.boardToLetters();\n //System.out.println(myboard.drawBoard());\n // myboard.boardToFigures();\n // System.out.println(myboard.drawBoard());\n\n System.out.println(\"------------------- Movimientos Posibles\");\n //myboard.obtenerPiezasPorColor();\n\n Coordinate coordinate = new Coordinate(4,3);\n Piece pieza = myboard.obtenerPiezaCoordenadas(coordinate);\n Movimientos movimientos = new Movimientos(pieza, myboard);\n ArrayList<Coordinate> listaMovimientos = new ArrayList<>(movimientos.obtenerMovimientos());\n\n //System.out.println(piece.toString());\n for(Coordinate coordenadas : listaMovimientos)\n {\n System.out.println(coordenadas.toString());\n }\n\n if(listaMovimientos.isEmpty())\n {\n System.out.println(\"Esta vacia\");\n }\n }", "public void run() {\n GameBoard board = new GameBoard(nrows, ncols);\n\n\n }", "public int[] setUpBoard(int noOfPlayers)\r\n\t{\r\n\t\tswitch(noOfPlayers)\r\n\t\t{\r\n\t\t//One player\r\n\t\tcase 1:\r\n\t\t\tfillTriangle(-1, board, 1, 16, 12);\r\n\t\t\treturn new int[] {1};\r\n\t\t//Two players opposite to one another\r\n\t\tcase 2:\r\n\t\t\tfillTriangle(-1, board, 1, 16, 12);\r\n\t\t\tfillTriangle(1, board, 4, 0, 4);\r\n\t\t\treturn new int[] {1,4};\r\n\t\t//Three players arranged in a triangle\r\n\t\tcase 3:\r\n\t\t\tfillTriangle(1, board, 2, 9, 13);\r\n\t\t\tfillTriangle(1, board, 4, 0, 4);\r\n\t\t\tfillTriangle(1, board, 6, 9, 4);\r\n\t\t\treturn new int[] {2,4,6};\r\n\t\t//Four players with two empty spots opposite from one another\r\n\t\tcase 4:\r\n\t\t\tfillTriangle(1, board, 2, 9, 13);\r\n\t\t\tfillTriangle(-1, board, 3, 7, 12);\r\n\t\t\tfillTriangle(-1, board, 5, 7, 3);\r\n\t\t\tfillTriangle(1, board, 6, 9, 4);\r\n\t\t\treturn new int[] {2,3,5,6};\r\n\t\t//Five players\r\n\t\tcase 5:\r\n\t\t\tfillTriangle(-1, board, 1, 16, 12);\r\n\t\t\tfillTriangle(1, board, 2, 9, 13);\r\n\t\t\tfillTriangle(-1, board, 3, 7, 12);\r\n\t\t\tfillTriangle(1, board, 4, 0, 4);\r\n\t\t\tfillTriangle(-1, board, 5, 7, 3);\r\n\t\t\treturn new int[] {1,2,3,4,5};\r\n\t\t//All six positions occupied by players\r\n\t\tdefault:\r\n\t\t\tfillTriangle(-1, board, 1, 16, 12);\r\n\t\t\tfillTriangle(1, board, 2, 9, 13);\r\n\t\t\tfillTriangle(-1, board, 3, 7, 12);\r\n\t\t\tfillTriangle(1, board, 4, 0, 4);\r\n\t\t\tfillTriangle(-1, board, 5, 7, 3);\r\n\t\t\tfillTriangle(1, board, 6, 9, 4);\r\n\t\t\treturn new int[] {1,2,3,4,5,6};\r\n\t\t}\r\n\t}", "public void createTiles() {\r\n Session session = sessionService.getCurrentSession();\r\n Campaign campaign = session.getCampaign();\r\n\r\n tilePane.getChildren().clear();\r\n List<Pc> pcs = null;\r\n try {\r\n pcs = characterService.getPlayerCharacters();\r\n } catch (MultiplePlayersException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n if (pcs != null) {\r\n pcs = pcs.stream().filter(pc -> campaign.getPcs().stream().anyMatch(\r\n campaignPc -> campaignPc.getId().equalsIgnoreCase(pc.getId())\r\n )).collect(Collectors.toList());\r\n\r\n for (Pc pc : pcs) {\r\n SortedMap<String, String> items = getTileItems(pc);\r\n Tile tile = new Tile(pc.getId(), pc.getName(), items);\r\n tile.setOnMouseClicked(mouseEvent -> {\r\n try {\r\n sessionService.updateParticipant(playerManagementService.getRegisteredPlayer().getId(), tile.getObjectId());\r\n } catch (EntityNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n parentController.updateSession(sessionService.getCurrentSession());\r\n parentController.switchView();\r\n });\r\n tilePane.getChildren().add(tile);\r\n }\r\n }\r\n }", "public BoardTest() {\n initComponents();\n \n createSudoku();\n //createBoggle();\n }", "public void setPieces(){\r\n Pawn[] arrwPawn = new Pawn[8];\r\n for (int i=0 ; i<8 ; i++){\r\n pos.setPosition(6,i);\r\n arrwPawn[i] = new Pawn (pos , piece.Colour.WHITE);\r\n GameBoard.putPiece(arrwPawn[i]);\r\n }\r\n\r\n Pawn[] arrbPawn = new Pawn[8];\r\n for(int i=0 ; i<8 ; i++){\r\n pos.setPosition(0,i);\r\n arrbPawn[i] = new Pawn(pos , piece.Colour.BLACK);\r\n GameBoard.putPiece(arrbPawn[i]);\r\n }\r\n\r\n\r\n //set black pieces in the board\r\n\r\n pos.setPosition(0,0);\r\n Rook bRook1 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook1);;\r\n\r\n pos.setPosition(0,7);\r\n Rook bRook2 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook2);\r\n\r\n\r\n pos.setPosition(0,1);\r\n Knight bKnight1 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,6);\r\n Knight bKnight2 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,2);\r\n Bishop bBishop1 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop1);\r\n\r\n pos.setPosition(0,5);\r\n Bishop bBishop2 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop2);\r\n\r\n pos.setPosition(0,3);\r\n Queen bQueen = new Queen(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bQueen);\r\n\r\n pos.setPosition(0,4);\r\n King bKing = new King(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKing);\r\n\r\n //set white pieces in the board\r\n\r\n pos.setPosition(7,0);\r\n Rook wRook1 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook1);\r\n\r\n pos.setPosition(7,7);\r\n Rook wRook2 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook2);\r\n\r\n pos.setPosition(7,1);\r\n Knight wKnight1 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,6);\r\n Knight wKnight2 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,2);\r\n Bishop wBishop1 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop1);\r\n\r\n pos.setPosition(7,5);\r\n Bishop wBishop2 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop2);\r\n\r\n pos.setPosition(7,3);\r\n Queen wQueen = new Queen(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wQueen);\r\n\r\n pos.setPosition(7,4);\r\n King wKing = new King(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKing);\r\n\r\n\r\n\r\n Rook arrwRook[] = {wRook1,wRook2};\r\n Rook arrbRook[] = {bRook1,bRook2};\r\n Queen arrwQueen[] = {wQueen};\r\n Queen arrbQueen[] = {bQueen};\r\n Knight arrwKnight[] = {wKnight1,wKnight2};\r\n Knight arrbKnight[] = {bKnight1,bKnight2};\r\n King arrwKing[] = {wKing};\r\n King arrbKing[] = {bKing};\r\n Bishop arrwBishop[] = {wBishop1,wBishop2};\r\n Bishop arrbBishop[] = {bBishop1,bBishop2};\r\n }", "public static void createBoard() {\n Checkers[] CheckerBoard = new Checkers[24];\n CheckerBoard[0] = new Checkers(0,1,\"black\");\n CheckerBoard[1] = new Checkers(0,3,\"black\");\n CheckerBoard[2] = new Checkers(0,5,\"black\");\n CheckerBoard[3] = new Checkers(0,7,\"black\");\n CheckerBoard[4] = new Checkers(1,0,\"black\");\n CheckerBoard[5] = new Checkers(1,2,\"black\");\n CheckerBoard[6] = new Checkers(1,4,\"black\");\n CheckerBoard[7] = new Checkers(1,6,\"black\");\n CheckerBoard[8] = new Checkers(2,1,\"black\");\n CheckerBoard[9] = new Checkers(2,3,\"black\");\n CheckerBoard[10] = new Checkers(2,5,\"black\");\n CheckerBoard[11] = new Checkers(2,7,\"black\");\n CheckerBoard[12] = new Checkers(5,1,\"red\");\n CheckerBoard[13] = new Checkers(5,3,\"red\");\n CheckerBoard[14] = new Checkers(5,5,\"red\");\n CheckerBoard[15] = new Checkers(5,7,\"red\");\n CheckerBoard[16] = new Checkers(6,0,\"red\");\n CheckerBoard[17] = new Checkers(6,2,\"red\");\n CheckerBoard[18] = new Checkers(6,4,\"red\");\n CheckerBoard[19] = new Checkers(6,6,\"red\");\n CheckerBoard[20] = new Checkers(7,1,\"red\");\n CheckerBoard[21] = new Checkers(7,3,\"red\");\n CheckerBoard[22] = new Checkers(7,5,\"red\");\n CheckerBoard[23] = new Checkers(7,7,\"red\");\n\n\n\n }", "public Board createBoard(Square[][] grid) {Collect.Hit(\"BoardFactory.java\",\"createBoard(Square[][] grid)\");assert grid != null; Collect.Hit(\"BoardFactory.java\",\"createBoard(Square[][] grid)\", \"1053\"); Board board = new Board(grid); Collect.Hit(\"BoardFactory.java\",\"createBoard(Square[][] grid)\", \"1079\"); int width = board.getWidth(); Collect.Hit(\"BoardFactory.java\",\"createBoard(Square[][] grid)\", \"1115\"); int height = board.getHeight(); Collect.Hit(\"BoardFactory.java\",\"createBoard(Square[][] grid)\", \"1148\"); for (int x = 0; x < width; x++) {\n\t\t\tfor (int y = 0; y < height; y++) {\n\t\t\t\tSquare square = grid[x][y];\n\t\t\t\tfor (Direction dir : Direction.values()) {\n\t\t\t\t\tint dirX = (width + x + dir.getDeltaX()) % width;\n\t\t\t\t\tint dirY = (height + y + dir.getDeltaY()) % height;\n\t\t\t\t\tSquare neighbour = grid[dirX][dirY];\n\t\t\t\t\tsquare.link(neighbour, dir);\n\t\t\t\t}\n\t\t\t}\n\t\t} Collect.Hit(\"BoardFactory.java\",\"createBoard(Square[][] grid)\", \"1183\"); Collect.Hit(\"BoardFactory.java\",\"createBoard(Square[][] grid)\", \"1552\");return board ; }", "public static void main(String[] args) {\n\t\tBoard gameBoard = new Board();\n\t\tDisplay screen = new TextDisplay();\n\n\t\t// give each player some pieces\n\t\tPieces blackPieces = new Pieces(gameBoard, PieceCode.BLACK);\n\t\tPieces whitePieces = new Pieces(gameBoard, PieceCode.WHITE);\n\n\t\t// Player blackPlayer = new HumanPlayer(\"Black\", blackPieces, gameBoard, null);\n\t\t// Player blackPlayer = new RandomPlayer(\"Black\", blackPieces, gameBoard, null);\n\t\tPlayer blackPlayer = new AggressivePlayer(\"Black\", blackPieces, gameBoard, null);\n\n\t\tPlayer whitePlayer = new HumanPlayer(\"White\", whitePieces, gameBoard, null);\n\t\t// Player whitePlayer = new RandomPlayer(\"White\", whitePieces, gameBoard,null);\n\t\t// Player whitePlayer = new AggressivePlayer(\"White\", whitePieces,\n\t\t// gameBoard,null);\n\n\t\tblackPlayer.setOpponent(whitePlayer);\n\t\twhitePlayer.setOpponent(blackPlayer);\n\n\t\tPlayer activePlayer = whitePlayer;\n\t\t// while both kings are alive\n\t\twhile (blackPlayer.getPieces().getPiece(blackPlayer.getPieces().getNumPieces() - 1).getValue() == PieceCode.KING\n\t\t\t\t&& whitePlayer.getPieces().getPiece(whitePlayer.getPieces().getNumPieces() - 1)\n\t\t\t\t\t\t.getValue() == PieceCode.KING) {\n\n\t\t\tscreen.displayBoard(activePlayer.getPieces());\n\t\t\tBoolean madeMove = false;\n\n\t\t\twhile (!madeMove) {\n\t\t\t\tmadeMove = activePlayer.makeMove();\n\t\t\t}\n\n\t\t\tactivePlayer = activePlayer.getOpponent();\n\t\t}\n\t\t// Display the end board\n\t\tscreen.displayBoard(activePlayer.getPieces());\n\n\t\t// Find out who's king died\n\t\tPlayer winner = null;\n\t\tif (blackPlayer.getPieces().getPiece(blackPlayer.getPieces().getNumPieces() - 1).getValue() == PieceCode.KING) {\n\t\t\twinner = blackPlayer;\n\t\t} else {\n\t\t\twinner = whitePlayer;\n\t\t}\n\t\t// and crown them champion\n\t\tSystem.out.println(winner + \" Wins!\");\n\t}", "public BoardState(int typeOfPlayer){\n board = new char[boardSize][boardSize];\n //ai\n if(typeOfPlayer == 0){\n aiInitBoard();\n }\n //human\n else if(typeOfPlayer == 1){\n initBoard();\n }\n }", "void initializeGame() {\n // Initialize players\n // Put the pieces on the board\n }", "public XOBoard() {\n\t\t// initialise the boards\n\t\tboard = new int[4][4];\n\t\trenders = new XOPiece[4][4];\n\t\tfor (int i = 0; i < 4; i++)\n\t\t\tfor (int j = 0; j < 4; j++) {\n\t\t\t\tboard[i][j] = EMPTY;\n\t\t\t\trenders[i][j] = null;\n\t\t\t}\n\t\tcurrent_player = XPIECE;\n\n\t\t// initialise the rectangle and lines\n\t\tback = new Rectangle();\n\t\tback.setFill(Color.GREEN);\n\t\th1 = new Line();\n\t\th2 = new Line();\n\t\th3 = new Line();\n\t\tv1 = new Line();\n\t\tv2 = new Line();\n\t\tv3 = new Line();\n\t\th1.setStroke(Color.WHITE);\n\t\th2.setStroke(Color.WHITE);\n\t\th3.setStroke(Color.WHITE);\n\t\tv1.setStroke(Color.WHITE);\n\t\tv2.setStroke(Color.WHITE);\n\t\tv3.setStroke(Color.WHITE);\n\n\t\t// the horizontal lines only need the endx value modified the rest of //\n\t\t// the values can be zero\n\t\th1.setStartX(0);\n\t\th1.setStartY(0);\n\t\th1.setEndY(0);\n\t\th2.setStartX(0);\n\t\th2.setStartY(0);\n\t\th2.setEndY(0);\n\t\th3.setStartX(0);\n\t\th3.setStartY(0);\n\t\th3.setEndY(0);\n\n\t\t// the vertical lines only need the endy value modified the rest of the\n\t\t// values can be zero\n\t\tv1.setStartX(0);\n\t\tv1.setStartY(0);\n\t\tv1.setEndX(0);\n\t\tv2.setStartX(0);\n\t\tv2.setStartY(0);\n\t\tv2.setEndX(0);\n\t\tv3.setStartX(0);\n\t\tv3.setStartY(0);\n\t\tv3.setEndX(0);\n\n\t\t// setup the translation of one cell height and two cell heights\n\t\tch_one = new Translate(0, 0);\n\t\tch_two = new Translate(0, 0);\n\t\tch_three = new Translate(0, 0);\n\t\th1.getTransforms().add(ch_one);\n\t\th2.getTransforms().add(ch_two);\n\t\th3.getTransforms().add(ch_three);\n\n\t\t// setup the translation of one cell width and two cell widths\n\t\tcw_one = new Translate(0, 0);\n\t\tcw_two = new Translate(0, 0);\n\t\tcw_three = new Translate(0, 0);\n\t\tv1.getTransforms().add(cw_one);\n\t\tv2.getTransforms().add(cw_two);\n\t\tv3.getTransforms().add(cw_three);\n\n\t\t// add the rectangles and lines to this group\n\t\tgetChildren().addAll(back, h1, h2, h3, v1, v2, v3);\n\n\t}", "public ComputerPlayer(Board board) \n {\n this.board = board;\n }", "public Board(){\n for(int holeIndex = 0; holeIndex<holes.length; holeIndex++)\n holes[holeIndex] = new Hole(holeIndex);\n for(int kazanIndex = 0; kazanIndex<kazans.length; kazanIndex++)\n kazans[kazanIndex] = new Kazan(kazanIndex);\n nextToPlay = Side.WHITE;\n }", "@Test\n\tpublic void testgetPlayers() {\n\t\tList<Character> characters = new ArrayList<Character>();\n\t\tcharacters.add(new Character(\"Miss Scarlet\", Color.red, new Point(7,24), \"assets/cards/character/MissScarlet.jpg\"));\n\t\tcharacters.add(new Character(\"Colonel Mustard\", Color.yellow, new Point(0,17),\"assets/cards/character/ColonelMustard.jpg\"));\n\t\tcharacters.add(new Character(\"Mrs. White\", Color.white, new Point(9,0), \"assets/cards/character/MrsWhite.jpg\"));\n\t\tcharacters.add(new Character(\"The Reverend Green\", Color.green, new Point(14,0),\"assets/cards/character/MrGreen.jpg\"));\n\t\tcharacters.add(new Character(\"Mrs. Peacock\", Color.blue, new Point(23,6), \"assets/cards/character/MrsPeacock.jpg\"));\n\t\tcharacters.add(new Character(\"Professor Plum\", Color.pink, new Point(23,19),\"assets/cards/character/ProfessorPlum.jpg\"));\n\t\tPlayer p = new Player(\"Chris\");\n\t\tcharacters.get(1).setPlayer(p);\t\t\n\t\tBoard b = new Board(characters);\n\t\tassertTrue(b.getPlayers().contains(p));\n\t\tassertTrue(b.getPlayers().size() ==1);\n\t\t\n\t}", "private Board create3by3Board() {\n Tile[][] tiles;\n Tile t1 = new Tile(0, 3);\n Tile t2 = new Tile(1, 3);\n Tile t3 = new Tile(2, 3);\n Tile t4 = new Tile(3, 3);\n Tile t5 = new Tile(4, 3);\n Tile t6 = new Tile(5, 3);\n Tile t7 = new Tile(6, 3);\n Tile t8 = new Tile(7, 3);\n Tile t9 = new Tile(8, 3);\n tiles = new Tile[3][3];\n tiles[0][0] = t7;\n tiles[0][1] = t6;\n tiles[0][2] = t2;\n tiles[1][0] = t5;\n tiles[1][1] = t9;\n tiles[1][2] = t3;\n tiles[2][0] = t1;\n tiles[2][1] = t8;\n tiles[2][2] = t4;\n return new Board(tiles);\n }", "public ChessRunner(){\n\t\taddMouseListener(this);\n\t\tfor(int i=0;i<8;i++){\n\t\t\tfor (int j=1;j<7;j++)\n\t\t\t\tif(j==1)\n\t\t\t\t\tboard[i][j] = new BlackPawn();\n\t\t\t\telse if(j==6)\n\t\t\t\t\tboard[i][j] = new WhitePawn();\n\t\t\t\telse\n\t\t\t\t\tboard[i][j]= new BlankPiece();\n\t\t}\n\t\tboard[1][0] = new BlackKnight();\n\t\tboard[6][0] = new BlackKnight();\n\t\tboard[0][0] = new BlackRook();\n\t\tboard[7][0] = new BlackRook();\n\t\tboard[2][0] = new BlackBishop();\n\t\tboard[5][0] = new BlackBishop();\n\t\tboard[4][0] = new BlackKing();\n\t\tboard[3][0] = new BlackQueen();\n\t\t\n\t\tboard[1][7] = new WhiteKnight();\n\t\tboard[6][7] = new WhiteKnight();\n\t\tboard[0][7] = new WhiteRook();\n\t\tboard[7][7] = new WhiteRook();\n\t\tboard[2][7] = new WhiteBishop();\n\t\tboard[5][7] = new WhiteBishop();\n\t\tboard[4][7] = new WhiteKing();\n\t\tboard[3][7] = new WhiteQueen();\n\t\t\n\t}", "public Board(Player p1, Player p2) {\r\n try {\r\n crownImage = ImageIO.read(new File(\"crown.jpg\"));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n checks = new int[8][8];\r\n currentPlayer = p2;\r\n nextPlayer = p1;\r\n whiteQueens = 0;\r\n whiteChecks = 12;\r\n blackQueens = 0;\r\n blackChecks = 12;\r\n winner = null;\r\n isGame = true;\r\n window(this);\r\n initializeBoard();\r\n swapPlayer();\r\n repaint();\r\n\r\n }", "public ChessBoard() {\n initComponents();\n createChessBoard();\n\n }", "public void newgame() {\n\t\tthis.player = 1;\n\t\t\n\n\t\tSystem.out.println(\"made a pice\");\n\t\tthis.piece = new String [9] [9];\n\t\tfor (int i=0; i<8 ;i++) {\n\t\t\tfor (int j= 0; j<8; j++) {\n\t\t\tpiece[i] [j] = \" \";\n\t\t\t}\n\t\t}\n\t\tint p = 0;\n\t\tfor (int i=0; i<=2 ;i++) {\n\t\t\tfor (int j= 0; j<8; j++) {\t\t\t\t\n\t\t\tif (p%2==1) {\n\t\t\t\tpiece[i][j]= \"1\";\n\t\t\t\tpiece[i+5][j+1] = \"2\";\n\t\t\t\tj +=1;}\n\t\t\telse {\n\t\t\t\tpiece[i][j+1]= \"1\";\n\t\t\t\tpiece[i+5][j] = \"2\";\n\t\t\t\tj +=1;\n\t\t\t\t}\n\t\t\t}p +=1;\n\t\t}\n\t\t\n\t}", "Player(String name, Board myBoard, Board opponentsBoard) {\n this.name = name;\n this.myBoard = myBoard;\n this.opponentsBoard = opponentsBoard;\n }", "public abstract boolean createGame(int nbplayers, boolean status, String creator) throws SQLException;", "void generateBoard(){\r\n rearrangeSolution();\r\n makeInitial();\r\n }", "public Board(C4.Canvas gameContext, String player1Colour, String player2Colour) {\r\n game = gameContext;\r\n players = new Player[2];\r\n players[0] = new Player(player1Colour);\r\n players[1] = new Player(player2Colour);\r\n boardArray = new Piece[7][7];\r\n for (int nx = 0; nx < 7; nx++) {\r\n for (int ny = 0; ny < 7; ny++) {\r\n boardArray[nx][ny] = new Piece();\r\n }\r\n }\r\n }", "void createPlayer(Player player);", "public Board(int height, int width, Player... players) {\n this.players = new ArrayList<>(Arrays.asList(players));\n this.docks = new ArrayList<>();\n this.lasers = new ArrayList<>();\n this.height = height;\n this.width = width;\n\n layTiles();\n\n for (Player player : players) {\n getTile(player).setPlayer(player);\n }\n }", "private Board create5by5Board() {\n Tile[][] tiles;\n Tile t1 = new Tile(0, 5);\n Tile t2 = new Tile(1, 5);\n Tile t3 = new Tile(2, 5);\n Tile t4 = new Tile(3, 5);\n Tile t5 = new Tile(4, 5);\n Tile t6 = new Tile(5, 5);\n Tile t7 = new Tile(6, 5);\n Tile t8 = new Tile(7, 5);\n Tile t9 = new Tile(8, 5);\n Tile t10 = new Tile(9, 5);\n Tile t11 = new Tile(10, 5);\n Tile t12 = new Tile(11, 5);\n Tile t13 = new Tile(12, 5);\n Tile t14 = new Tile(13, 5);\n Tile t15 = new Tile(14, 5);\n Tile t16 = new Tile(15, 5);\n Tile t17 = new Tile(16, 5);\n Tile t18 = new Tile(17, 5);\n Tile t19 = new Tile(18, 5);\n Tile t20 = new Tile(19, 5);\n Tile t21 = new Tile(20, 5);\n Tile t22 = new Tile(21, 5);\n Tile t23 = new Tile(22, 5);\n Tile t24 = new Tile(23, 5);\n Tile t25 = new Tile(24, 5);\n tiles = new Tile[5][5];\n tiles[0][0] = t7;\n tiles[0][1] = t6;\n tiles[0][2] = t2;\n tiles[0][3] = t5;\n tiles[0][4] = t9;\n tiles[1][0] = t3;\n tiles[1][1] = t1;\n tiles[1][2] = t8;\n tiles[1][3] = t4;\n tiles[1][4] = t11;\n tiles[2][0] = t17;\n tiles[2][1] = t18;\n tiles[2][2] = t10;\n tiles[2][3] = t25;\n tiles[2][4] = t20;\n tiles[3][0] = t23;\n tiles[3][1] = t21;\n tiles[3][2] = t12;\n tiles[3][3] = t15;\n tiles[3][4] = t13;\n tiles[4][0] = t22;\n tiles[4][1] = t24;\n tiles[4][2] = t14;\n tiles[4][3] = t16;\n tiles[4][4] = t19;\n return new Board(tiles);\n }", "void createNewGame(Player player);", "public void setUp()\r\n {\r\n board = new MineSweeperBoard(4, 4, 1);\r\n }", "private char[] createBoard() {\n for (int i = 1; i < 10; i++) {\n board[i] = 0;\n }\n return board;\n }", "public static int[][] createBoard() {\r\n\t\t\r\n\t\tint[][] board = new int [8][8];\r\n\t\t//printing the red solduers\r\n\t\tfor (int line =0,column=0;line<3;line=line+1){\r\n\t\t\tif (line%2==0){column=0;}\r\n\t\t\telse {column=1;}\r\n\t\t\tfor (;column<8;column=column+2){\r\n\t\t\t\tboard [line][column] = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//printing the blu solduers\r\n\t\tfor (int line =5,column=0;line<8;line=line+1){\r\n\t\t\tif (line%2==0){column=0;}\r\n\t\t\telse {column=1;}\r\n\t\t\tfor (;column<8;column=column+2){\r\n\t\t\t\tboard [line][column] = -1;\r\n\t\t\t}\r\n\t\t}\t\t\t\r\n\t\treturn board;\r\n\t}", "public Player() { \n grid = new Cell[GRID_DIMENSIONS][GRID_DIMENSIONS]; //size of grid\n for (int i = 0; i < GRID_DIMENSIONS; i++) {\n for (int j = 0; j < GRID_DIMENSIONS; j++) {\n grid[i][j] = new Cell(); //creating all Cells for a new grid\n }\n }\n \n fleet = new LinkedList<Boat>(); //number of boats in fleet\n for (int i = 0; i < NUM_BOATS; i++) {\n Boat temp = new Boat(BOAT_LENGTHS[i]); \n fleet.add(temp);\n }\n shipsSunk = new LinkedList<Boat>();\n }", "@Before\n public void setUp(){\n board = new ChessPiece[8][8];\n p = new Pawn(Player.BLACK);\n board[1][0] = p;\n move = new Move(1,0,2,0);\n }", "public void initChessBoardAutomaticly() {\r\n\t\tthis.initPieces();\r\n\t\tthis.clearBoard();\r\n\t\tfor (int i=0; i<board.size(); i++) {\r\n\t\t\tChessBoardBlock b = board.get(order[i]);\r\n\t\t\tb.setBorderPainted(false);\r\n\t\t}\r\n\t\tfor (int i = 0, w = 0, b = 0, s = 0; i < 8 * 8; i++) {\r\n\r\n\t\t\t// Assign1, Disable board clickable\r\n\t\t\tChessBoardBlock block = board.get(order[i]);\r\n\t\t\tblock.setEnabled(false);\r\n\r\n\t\t\t// Assign1, Put black pieces and record the position\r\n\t\t\tif (i % 2 != 1 && i >= 8 && i < 16) {\r\n\t\t\t\tChessPiece blackPiece = blackPieces[b];\r\n\t\t\t\tblackPiece.position = order[i];\r\n\t\t\t\tpiece.put(order[i], blackPiece);\r\n\t\t\t\tbody.add(blackPiece);\r\n\t\t\t\tb++;\r\n\t\t\t} else if (i % 2 != 0 && (i < 8 || (i > 16 && i < 24))) {\r\n\t\t\t\tChessPiece blackPiece = blackPieces[b];\r\n\t\t\t\tblackPiece.position = order[i];\r\n\r\n\t\t\t\tpiece.put(order[i], blackPiece);\r\n\t\t\t\tbody.add(blackPiece);\r\n\t\t\t\tb++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Assign1, Put white pieces and record the position\r\n\t\t\telse if (i % 2 != 0 && i > 48 && i < 56) {\r\n\t\t\t\tChessPiece whitePiece = whitePieces[w];\r\n\t\t\t\twhitePiece.position = order[i];\r\n\t\t\t\tpiece.put(order[i], whitePiece);\r\n\t\t\t\tbody.add(whitePiece);\r\n\t\t\t\tw++;\r\n\t\t\t} else if (i % 2 != 1\r\n\t\t\t\t\t&& ((i >= 40 && i < 48) || (i >= 56 && i < 64))) {\r\n\t\t\t\tChessPiece whitePiece = whitePieces[w];\r\n\t\t\t\twhitePiece.position = order[i];\r\n\t\t\t\t\r\n\t\t\t\tpiece.put(order[i], whitePiece);\r\n\t\t\t\tbody.add(whitePiece);\r\n\t\t\t\tw++;\r\n\t\t\t}\r\n\r\n\t\t\t// Assign1, Put empty pieces on the board\r\n\t\t\t// Actually, empty pieces will not display on the board, they are\r\n\t\t\t// not existing\r\n\t\t\t// to chess players, just for calculation\r\n\t\t\telse {\r\n\t\t\t\tChessPiece spacePiece = spacePieces[s];\r\n\t\t\t\tspacePiece.position = order[i];\r\n\t\t\t\tbody.add(spacePiece);\r\n\t\t\t\tpiece.put(order[i], spacePiece);\r\n\t\t\t\tspacePiece.setVisible(false);\r\n\t\t\t\ts++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tt.setText(\"Chess Board has been initialized automatically\");\r\n\t\tthis.startGame();\r\n\t}", "private static void createEmptyBoard()\n {\n for (int index = 1; index < board.length; index++)\n {\n board[index] = ' ';\n }\n }", "public void makeBoard2d() {\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n this.board2d[i][j] = this.board[(i * 3) + j];\n }\n }\n }", "public void newBoard(LiteBoard board) {\n }", "Board createLayout();" ]
[ "0.7536933", "0.7466134", "0.7314537", "0.7310296", "0.72619146", "0.7191631", "0.7173919", "0.7161878", "0.71337676", "0.7129777", "0.7109955", "0.70890105", "0.70487064", "0.7002292", "0.69988436", "0.6929204", "0.6884942", "0.6884829", "0.6855479", "0.68313086", "0.68172693", "0.6805851", "0.6782562", "0.6774971", "0.67097753", "0.66943663", "0.6693871", "0.6673544", "0.66538185", "0.6652734", "0.66512406", "0.6643557", "0.6637505", "0.660383", "0.66015166", "0.65772444", "0.656182", "0.65488684", "0.6516278", "0.650874", "0.6471586", "0.64635307", "0.6458215", "0.6447588", "0.6438964", "0.6437653", "0.6424235", "0.64225453", "0.6421412", "0.64042234", "0.6403589", "0.6378673", "0.63696355", "0.6363965", "0.6361891", "0.6346733", "0.63384026", "0.63377035", "0.63355917", "0.633461", "0.6333841", "0.63225585", "0.63071835", "0.6300666", "0.6279761", "0.6274247", "0.62722576", "0.6269196", "0.6265573", "0.62651485", "0.6264704", "0.6263768", "0.62632185", "0.62594384", "0.62574095", "0.6256258", "0.6255957", "0.6251187", "0.624322", "0.6236597", "0.62267613", "0.621739", "0.6216361", "0.62101287", "0.6198018", "0.61931825", "0.6190884", "0.6190767", "0.6185647", "0.6182582", "0.6178941", "0.61761796", "0.61739314", "0.6172626", "0.61724967", "0.6170001", "0.6164598", "0.61634564", "0.6142755", "0.6140049", "0.6138772" ]
0.0
-1
Rolls a dice for max. given amount
public int rollDice(int amount) { int randomNum = ThreadLocalRandom.current().nextInt(1, amount + 1); return randomNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int roll(int max)\n {\n // roll between 1 and the max\n int r = (int)(Math.random() * max) + 1;\n return r;\n }", "public static int diceRoll() {\n int max = 20;\n int min = 1;\n int range = max - min + 1;\n int rand = (int) (Math.random() * range) + min;\n return rand;\n }", "public int generateRoll() {\n\t\tint something = (int) (Math.random() * 100) + 1;\n\t\tif (something <= 80) {\n\t\t\tint allNumRoll = (int) (Math.random() * getNumSides()) + 1;\n\t\t\tint roll = allNumRoll * 2 - 1;\n\t\t\treturn roll;\n\t\t} else {\n\t\t\tint allNumRoll = (int) (Math.random() * getNumSides()) + 1;\n\t\t\tint roll = allNumRoll * 2;\t\t\n\t\t\treturn roll;\n\t\t}\n\t}", "public static int diceRoll() {\n Random roller = new Random();//Create a random number generator\r\n return roller.nextInt(6) + 1;//Generate a number between 0-5 and add 1 to it\r\n }", "static int roll() {\n\t\tRandom rand = new Random();\t\t\t\t//get large random number\n\t\tint num2 = rand.nextInt();\t\t\t\t//convert from long to int\n\t\treturn Math.abs(num2%6)+1;\t\t\t\t//num between 1 and 6\n\t}", "public static int rollDice(){\n return (int)(Math.random()*6) + 1;\n // Math.random returns a double number >=0.0 and <1.0\n }", "private void roll() {\n value = (int) (Math.random() * MAXVALUE) + 1;\n }", "public int roll_the_dice() {\n Random r = new Random();\n int number = r.nextInt(6) + 1;\n\n return number;\n }", "public void roll()\r\n\t{\r\n\t\tthis.value = rnd.nextInt(6) + 1;\r\n\t}", "public static int rollDice()\n\t{\n\t\tint roll = (int)(Math.random()*6)+1;\n\t\t\n\t\treturn roll;\n\n\t}", "private int rollDie() {\r\n final SecureRandom random = new SecureRandom();\r\n return random.nextInt(6 - 1) + 1;\r\n }", "public int rollResult(){\r\n return rand.nextInt(6) + 1;\r\n }", "public void roll(){\n currentValue = rand.nextInt(6)+1;\n }", "public int roll() {\n int result = ThreadLocalRandom.current().nextInt(SIDES+1) + 1;// standard 1-7\n if(result == 7){ //LoadedDie 6 occurs twice as often\n return 6;\n } else{\n return result;\n }\n }", "public int roll() {\n if(!debug)\n this.result = random.nextInt(6) + 1;\n else{\n scanner = new Scanner(showInputDialog(\"Enter dice value (1-6):\"));\n try{int res = scanner.nextInt()%7;\n this.result = res!=0? res:6;\n }\n catch(NoSuchElementException ne){this.result=6;} \n }\n return this.result;\n }", "int RollDice ()\n {\n\tint roll = (int) (Math.random () * 6) + 1;\n\treturn roll;\n }", "public int roll() {\n return random.nextInt(6) + 1;\n }", "public int rollDice() {\n\t\td1 = r.nextInt(6) + 1;\n\t\td2 = r.nextInt(6) + 1;\n\t\trepaint();\n\t\treturn d1 + d2;\n\t}", "public int rollDice() {\n\t\td1 = (int)rand.nextInt(6)+1;\n\t\td2 = (int)rand.nextInt(6)+1;\n\t\treturn d1+d2;\n\t}", "public int rollDice();", "public int roll() {\n Random r;\n if (hasSeed) {\n r = new Random();\n }\n else {\n r = new Random();\n }\n prevRoll = r.nextInt(range) + 1;\n return prevRoll;\n }", "public static int rollDie() {\n int n = ThreadLocalRandom.current().nextInt(1, 7);\n return n;\n }", "public int roll() {\n this.assuerNN_random();\n //Roll once\n int result = random.nextInt(this.sides)+1;\n //TODO Save the roll somewhere\n\n //Return the roll\n return result;\n }", "public int rollDie() {\n\t\treturn (int) (Math.random()*6)+1;\n\t}", "public static int rollFairDie(){\n\t\t\n\t\tdouble rand = Math.random();\n\t\tint roll = (int) (rand * 6); // [0,5] what above code does.\n\t\treturn roll + 1;\n\t}", "public void setPlayerRoll20()\r\n {\r\n \r\n roll2 = ((int)(Math.random() * 100) % HIGHEST_DIE_VALUE20 + LOWEST_DIE_VALUE20);\r\n \r\n }", "public int throwDice() {\n //create new random number between 1 and 6\n int nr = ThreadLocalRandom.current().nextInt(1, 6 + 1);\n //throw the number\n throwDice(nr);\n //return number\n return nr;\n }", "@Override\r\n\tpublic int rollDice() {\n\t\treturn 0;\r\n\t}", "public void Diceroll()\n\t{\n\t\tdice1 = rand.nextInt(6)+1;\n\t\tdice2 = rand.nextInt(6)+1;\n\t\ttotal = dice1+dice2;\n\t}", "void roll(int noOfPins);", "public int rollDice(){\r\n\t\tString playerResponse;\r\n\t\tplayerResponse=JOptionPane.showInputDialog(name+\". \"+\"Type anything to roll\");\r\n\t\t//System.out.println(name+\"'s response: \"+playerResponse);\r\n\t\tdice1=(int)(Math.random() * ((6 - 1) + 1)) + 1;\r\n\t\tdice2=(int)(Math.random() * ((6 - 1) + 1)) + 1;\r\n\t\tdicetotal=dice1+dice2;\r\n\t\tnumTurns++;\r\n\t\treturn dicetotal;\r\n\t}", "private int diceRoll(int sides) {\n return (int) ((Math.random() * sides) + 1);\n }", "public void roll()\r\n\t{\r\n\t\tRandom rand = new Random();\r\n\r\n\t\trollNumber = rand.nextInt(numOfSides) + 1;\r\n\t}", "public int roll() \r\n {\r\n \r\n die1FaceValue = die1.roll();\r\n die2FaceValue = die2.roll();\r\n \r\n diceTotal = die1FaceValue + die2FaceValue;\r\n \r\n return diceTotal;\r\n }", "public void roll(){\n Random rand = new Random();\n this.rollVal = rand.nextInt(this.faces) + 1;\n }", "public int roll()\n {\n int r = (int)(Math.random() * sides) + 1;\n return r;\n }", "public void roll() {\n\t\tthis.currentValue = ThreadLocalRandom.current().nextInt(1, this.numSides + 1);\n\t}", "public void setPlayerRoll10()\r\n {\r\n \r\n roll1 = ((int)(Math.random() * 100) % HIGHEST_DIE_VALUE10 + LOWEST_DIE_VALUE10);\r\n }", "public static int diceRoll() {\n\t\t\n\t\t//the outcome of the die is stored as an integer and returned\n\t\t\n\t\tint diceNumber = (int)((6 * (Math.random())) + 1);\n\t\treturn diceNumber;\n\t}", "int roll();", "void rollDice();", "public void throwDices() throws DiceException {\n /**generator of random numbers(in this case integer numbers >1)*/\n Random generator = new Random();\n /**mode of logic*/\n String mode = this.getMode();\n\n if (!mode.equals(\"sum\") && !mode.equals(\"max\")) {\n throw new DiceException(\"Wrong throw mode!!! Third argument should be 'max' or 'sum'!\");\n } else if (this.getNumOfDices() < 1) {\n throw new DiceException(\"Wrong numeber of dices!!! Number of dices should equals 1 or more!\");\n } else if (this.getNumOfWalls() < 4) {\n throw new DiceException(\"Wrong numeber of walls!!! Number of walls should equals 4 or more!\");\n } else {\n if (mode.equals(\"sum\")) {\n for (int i = 0; i < this.getNumOfDices(); i++) {\n result += (generator.nextInt(this.getNumOfWalls()) + 1);\n }\n } else if (mode.equals(\"max\")) {\n for (int i = 0; i < this.getNumOfDices(); i++) {\n int buff = (generator.nextInt(this.getNumOfWalls()) + 1);\n if (this.result < buff) {\n this.result = buff;\n }\n }\n }\n }\n }", "public int roll(int dices){\n int faces[] = new int[dices];\n int total = 0;\n Dice dice = new Dice();\n for(int i = 0; i < dices; i++){\n faces[i] = (dice.rand.nextInt(6) + 1);\n }\n for(int i = 0; i < faces.length-1; i++){\n if(faces[i] != faces[i+1]){\n this.isDouble = false;\n break;\n }\n else{\n this.isDouble = true;\n }\n }\n if(this.isDouble == true){\n this.twiceCounter++;\n }\n for(int i = 1; i < faces.length+1; i++){\n System.out.print(\"The \" + i + \". dice: \" + faces[i-1] + \" \");\n total += faces[i-1];\n }\n System.out.println(\" and the sum is \" + total);\n\n return total;\n }", "private static void roll()\n {\n rand = (int)(((Math.random())*6)+1); // dice roll #1\n rand2 = (int)(((Math.random())*6)+1);// dice roll #2\n }", "RollingResult roll(Player player);", "public static void roll()\n {\n Random no = new Random();\n Integer dice = no.nextInt(7);\n System.out.println(dice);\n }", "public int attackRoll(){\r\n\t\treturn (int) (Math.random() * 100);\r\n\t}", "public int roll3D6()\n {\n Random random1 = new Random();\n int r = random1.nextInt(6) +1;\n r += random1.nextInt(6) +1;\n r += random1.nextInt(6) +1;\n return r;\n }", "public int rollMult(){\r\n\t\treturn dieClass.rollMultiplier();\r\n\t}", "public int roll() {\n Random random = new Random();\n faceValue = random.nextInt(sides)+1;\n return faceValue;\n }", "public int randomWithRange(){\n\r\n\t\tint[] diceRolls = new int[4];//roll four 6-sided dices\r\n\t\tint range;\r\n\t\tfor(int i = 0; i<diceRolls.length;i++) {\r\n\t\t\t//add each dice i rolled into an array\r\n\t\t\trange = 6;\r\n\t\t\tdiceRolls[i] = (int)(Math.random() * range) + 1;//assign a number btw 1-6\r\n\t\t}\r\n\t\tint smallest=diceRolls[0];\r\n\t\tfor(int i = 1; i<diceRolls.length; i++) {//will check for the smallest rolled dice\r\n\t\t\tif(diceRolls[i]<smallest) \r\n\t\t\t\tsmallest=diceRolls[i];\t\t\r\n\t\t}\r\n\t\tint sum=0;\r\n\t\tfor(int i = 0; i<diceRolls.length;i++) {//adds up all the sum\r\n\t\t\tsum = sum+diceRolls[i];\r\n\t\t}\r\n\t\treturn sum-smallest;//subtract by the smallest dice from the sum\r\n\t}", "public abstract int rollDice();", "public int rollNumber() throws ClientException{\n\t\t//if(canRollNumber()){\n\t\t\thasRolled = true;\n\t\t\tRandom rand = new Random();\n\t\t\tint roll = rand.nextInt(6)+1;\n\t\t\troll += rand.nextInt(6)+1;\n\t\t\treturn roll == 7 ? 6:roll;\n\n\t}", "public int dieSimulator(int n, int[] rollMax) {\n return (int) (findResults(n, rollMax, Arrays.copyOf(rollMax, 6), -1) % (Math\n .pow(10, 9) + 7));\n }", "public int tossDice(){\n\t\tRandom r = new Random();\n\t\tdiceValue = r.nextInt(6)+1;\n\t\tdiceTossed = true;\n\t\treturn diceValue;\n\t}", "public int roll() {\n\t\treturn 3;\n\t}", "public int roll(){\r\n myFaceValue = (int)(Math.random() * myNumSides) + 1;\r\n return myFaceValue;\r\n }", "private void rollDie() {\n if (mTimer != null) {\n mTimer.cancel();\n }\n mTimer = new CountDownTimer(1000, 100) {\n public void onTick(long millisUntilFinished) {\n die.roll();\n showDice();\n }\n public void onFinish() {\n afterRoll();\n }\n }.start();\n }", "public void throwDice() {\n\n Random r = new Random();\n\n if (color == DiceColor.NEUTRAL) {\n this.value = 0;\n } else {\n this.value = 1 + r.nextInt(6);\n }\n\n }", "public void Roll() // Roll() method\n {\n // Roll the dice by setting each of the dice to be\n // \ta random number between 1 and 6.\n die1Rand = (int)(Math.random()*6) + 1;\n die2Rand = (int)(Math.random()*6) + 1;\n }", "public int rollAttack()\n {\n Random random2 = new Random();\n int atk = random2.nextInt(20) +1 + attackBonus;\n return atk;\n }", "public int roll()\r\n\t{\r\n\t return die1.roll() + die2.roll();\r\n \t}", "void rollNumber(int d1, int d2);", "public void rollDie(){\r\n\t\tthis.score = score + die.roll();\r\n\t}", "private static int rollAmountOfCurrency(float chance)\n {\n boolean done = false;\n int count = 0;\n Random r = SylverRandom.random;\n\n while (!done){\n\n //Loop until we stop adding additional items\n if (r.nextFloat() < chance){\n chance *= .75;\n count++;\n }\n else\n done = true;\n\n }\n return count;\n }", "public int setRollResult(int diceAmount, int diceSides) {\n\t\tint result = 0;\n\t\tfor (int i = 0; i < diceAmount; i++) {\n\t\t\tresult += diceBag.rollDice(diceSides);\n\t\t}\n\t\treturn result;\n\t}", "public int setDiceValue(int num){\r\n\t\trollNumber = num;\r\n\r\n\t\treturn rollNumber;\r\n\t}", "public static int rollStrength(){\n num1 = (int)(Math.random()*(20-0+1)+0);\n return num1;\n }", "DiceRoll modifyRoll(DiceRoll roll, Die die);", "private int controll(int max){\n int nr = 0;\n boolean numberOK = true;\n \n do{\n \tSystem.out.println(\"välj alternativ 0-\" + max + \" för att fortsätta, tack:\");\n \tString in = scanna.nextLine();\n \t\n \ttry{\n \t\tnr = Integer.parseInt(in);\n \t\tnumberOK = true;\n \t\tif(0<=nr && nr<=max){\n \t\t\treturn nr;\n \t\t}else{\n \t\t\tSystem.out.println(in + \" är inget alternativ, ju!\");\n \t\t\tnumberOK = false;\n \t\t}\n \t\t}catch (NumberFormatException e){\n \t\tSystem.out.println(in + \" är i nget alternativ, ju!\");\n \t\tnumberOK = false; \n \t}\n }while(!numberOK);\n\n return nr;\n }", "public void chooseDefenderDice(int maxDice, String owner, String territoryName){\n gameState = GameState.DICEFIGHTDEFENDERCHOICE;\n currentMessage = \"\" + maxDice + \",\" + owner + \",\" + territoryName;\n notifyObservers();\n }", "public int diceValue()\r\n\t{\r\n\t\treturn rollNumber;\r\n\t}", "public void roll() { \n this.value = (int)(Math.random() * this.faces()) + 1; \n }", "public int roll(int roll) {\n \t\tappendAction(R.string.player_roll, Integer.toString(roll));\n \t\tboard.roll(roll);\n \n \t\treturn roll;\n \t}", "public Dice getMaxAgeDice() {\n return maxAgeDice;\n }", "public boolean rollTheDice() {\n\t\tboolean result;\n\t\tint randomDiceRoll = (int)(Math.random() * 6) + 1;\n\t\tif(randomDiceRoll>=5) {\n\t\t\tresult=true;\n\t\t}\n\t\telse {\n\t\t\tresult=false;\n\t\t}\n\t\treturn result;\n\t}", "public static int diceRoll(){\n Random rd = new Random();\n int dice1, dice2;\n\n dice1 = rd.nextInt(6) + 1; //assigns random integer between 1 and 6 inclusive to dice 1\n dice2 = rd.nextInt(6) + 1; //assigns random integer between 1 and 6 inclusive to dice 2\n\n System.out.println(\"You rolled \" + dice1 + \" + \" + dice2 + \" = \" + (dice1+dice2)); //print result\n\n return dice1 + dice2; //returns sum of dice rolls\n\n }", "@Override\n public int rollNumber() throws ModelException {\n // the range is 10 (2 - 12)\n final int ROLL_NUMBERS_RANGE = 10;\n final int MINIMUM_ROLL = 2;\n final Random randomNumberGenerator = new Random();\n\n int rolledNumber = randomNumberGenerator.nextInt(ROLL_NUMBERS_RANGE) + MINIMUM_ROLL;\n assert rolledNumber >= 2 && rolledNumber <= 12;\n\n IPlayer p = GameModelFacade.instance().getLocalPlayer();\n if (GameModelFacade.instance().getGame().getGameState() != GameState.Rolling || !p.equals(GameModelFacade.instance().getGame().getCurrentPlayer())) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.rollNumber(p.getIndex(), rolledNumber);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n }\n catch (NetworkException e) {\n throw new ModelException(e);\n }\n\n return rolledNumber;\n }", "public void roll() {\n\t\tthis.faceValue = (int)(NUM_SIDES*Math.random()) + 1;\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tint[] totals = new int[11];\r\n\t\tint dice;\r\n\t\tint diceTwo;\r\n\t\tint total;\r\n\r\n\t\t\r\n\r\n\t\tfor (int i = 0; i < 10000; i++) {\r\n\t\t\tdice = (int) (Math.random() * 6) + 1;\r\n\t\t\tdiceTwo = (int) (Math.random() * 6) + 1;\r\n\t\t\ttotal = dice + diceTwo; \r\n\t\t\tif (total == 2) {\r\n\r\n\t\t\t\ttotals[0]++;\r\n\t\t\t}\r\n\r\n\t\t\telse if (total == 3) {\r\n\r\n\t\t\t\ttotals[1]++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (total == 4) {\r\n\r\n\t\t\t\ttotals[2]++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (total == 5) {\r\n\r\n\t\t\t\ttotals[3]++;\r\n\t\t\t}\r\n\t\t\telse if (total == 6) {\r\n\r\n\t\t\t\ttotals[4]++;\r\n\t\t\t}\r\n\t\t\telse if (total == 7) {\r\n\r\n\t\t\t\ttotals[5]++;\r\n\t\t\t}\r\n\t\t\telse if (total == 8) {\r\n\r\n\t\t\t\ttotals[6]++;\r\n\t\t\t}\r\n\t\t\telse if (total == 9) {\r\n\r\n\t\t\t\ttotals[7]++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (total == 10) {\r\n\r\n\t\t\t\ttotals[8]++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (total == 11) {\r\n\r\n\t\t\t\ttotals[9]++;\r\n\t\t\t}\r\n\t\t\telse if (total == 12) {\r\n\r\n\t\t\t\ttotals[10]++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"Total - Number of Rolls\");\r\n\t\tSystem.out.println(\"2 \" + totals[0] );\r\n\t\tSystem.out.println(\"3 \" + totals[1] );\r\n\t\tSystem.out.println(\"4 \" + totals[2] );\r\n\t\tSystem.out.println(\"5 \" + totals[3] );\r\n\t\tSystem.out.println(\"6 \" + totals[4] );\r\n\t\tSystem.out.println(\"7 \" + totals[5] );\r\n\t\tSystem.out.println(\"8 \" + totals[6] );\r\n\t\tSystem.out.println(\"9 \" + totals[7] );\r\n\t\tSystem.out.println(\"10 \" + totals[8] );\r\n\t\tSystem.out.println(\"11 \" + totals[9] );\r\n\t\tSystem.out.println(\"12 \" + totals[10] );\r\n\t}", "private void otherRolls() {\n\t\t// program tells that player should select dices to re-roll.\n\t\tdisplay.printMessage(\"Select the dice you wish to re-roll and click \"\n\t\t\t\t+ '\\\"' + \"Roll Again\" + '\\\"');\n\t\t// program will wait until player clicks \"roll again\" button.\n\t\tdisplay.waitForPlayerToSelectDice();\n\t\t// we randomly get six integers, from one to six, and we do it N_DICE\n\t\t// times and every time we write our random integer in the array.\n\t\tfor (int i = 0; i < N_DICE; i++) {\n\t\t\tif (display.isDieSelected(i) == true) {\n\t\t\t\tint dice = rgen.nextInt(1, 6);\n\t\t\t\tdiceResults[i] = dice;\n\t\t\t}\n\t\t}\n\t\t// program will display dice, that depends on our randomly taken\n\t\t// integers.\n\t\tdisplay.displayDice(diceResults);\n\t}", "public void reRoll() {\n this.result = this.roll();\n this.isSix = this.result == 6;\n }", "private static byte roll6SidedDie() {\n\t\tint test = (int)Math.floor(Math.random() * 6) + 1;\n\t\tbyte roll = (byte)test;\n\t\treturn roll;\n\t}", "public void rollStats() {\n\t\tRandom roll = new Random();\n\t\tint rolled;\n\t\tint sign;\n\t\t\n\t\t\n\t\trolled = roll.nextInt(4);\n\t\tsign = roll.nextInt(2);\n\t\tif (sign == 0) {\n\t\t\tsetMaxHealth(getMaxHealth() + rolled*(getDifficulty()+5/5));\n\t\t\tsetHealth(getMaxHealth());\n\t\t} else {\n\t\t\tsetMaxHealth(getMaxHealth() - rolled*(getDifficulty()+5/5));\n\t\t\tsetHealth(getMaxHealth());\n\t\t}\n\t\t\n\t\trolled = roll.nextInt(2);\n\t\tsign = roll.nextInt(2);\n\t\tif (sign == 0) {\n\t\t\tsetAttack(getAttack() + rolled*(getDifficulty()+5/5));\n\t\t} else {\n\t\t\tsetAttack(getAttack() - rolled*(getDifficulty()+5/5));\n\t\t}\n\t\t\n\t\trolled = roll.nextInt(2);\n\t\tsign = roll.nextInt(2);\n\t\tif (sign == 0) {\n\t\t\tsetDefense(getDefense() + rolled*(getDifficulty()+5/5));\n\t\t} else {\n\t\t\tsetDefense(getDefense() - rolled*(getDifficulty()+5/5));\n\t\t}\n\t\t\n\t\trolled = roll.nextInt(2);\n\t\tsign = roll.nextInt(2);\n\t\tif (sign == 0) {\n\t\t\tsetSpeed(getSpeed() + rolled*(getDifficulty()+5/5));\n\t\t} else {\n\t\t\tsetSpeed(getSpeed() - rolled*(getDifficulty()+5/5));\n\t\t}\n\t\t\n\t}", "public static int roll(int c, int s, int m){\n int sum = m;\n for(int i = 0; i < c; i++)\n sum += Rand.getInt(1, s);\n return sum;\n }", "float getRoll();", "float getRoll();", "public void chooseAttackerDice(int maxDice, String owner, String territoryName){\n gameState = GameState.DICEFIGHTATTACKERCHOICE;\n currentMessage = \"\" + maxDice + \",\" + owner + \",\" + territoryName;\n notifyObservers();\n currentMessage = \"\";\n }", "int getRent(Player owner, int tenantDiceRoll);", "@Override\r\n\tpublic int randOfMax(int max) {\n\t\tRandom r = new Random();\r\n\t\t\r\n\t\tint i = r.nextInt(max);\r\n\t\twhile(0==i){//the restriction of the Random Number\r\n\t\t\ti = r.nextInt(max);\r\n\t\t}\r\n\t\treturn i;\r\n\t}", "public int rollDice()\n{\n int die1, die2, sum; \n\n // pick random die values\n die1 = 1 + ( int ) ( Math.random() * 6 );\n die2 = 1 + ( int ) ( Math.random() * 6 );\n\n sum = die1 + die2; // sum die values\n\n // display results\n die1Field.setText( Integer.toString( die1 ) );\n die2Field.setText( Integer.toString( die2 ) );\n sumField.setText( Integer.toString( sum ) );\n\n return sum; // return sum of dice\n\n\n}", "public void roll() {\n int number = new Random().nextInt(MAXIMUM_FACE_NUMBER);\n FaceValue faceValue = FaceValue.values()[number];\n setFaceValue(faceValue);\n }", "public BigInteger getWaysToRoll(int sum){\n\n if ( sum < dice.size() || sum > getMaxDiceRoll().intValue() ) {\n return BigInteger.ZERO;\n }\n \n return distribution.get(sum-dice.size());\n }", "void roll(int pins);", "public int takeTurn(Dice theDice){\n \n this.turnCounter++;\n \n return(theDice.rollDice());\n \n }", "public static void main(String[] args) {\n int x = 10;\r\n \r\n System.out.println(Math.pow(x, 3)); //1000\r\n System.out.println(Math.sqrt(x)); //square root 10\r\n double y = 8.9876;\r\n System.out.println(Math.round(y)); //rounds to nearest (9)\r\n System.out.println(Math.max(x, y)); //10 also min\r\n \r\n int roll = (int)(Math.random() * 6 + 1); //from 1 to 6\r\n //Math.random() * range + start number\r\n //ex --> 30 and 50 (int)(Math.random() * 21 + 30);\r\n System.out.println(roll);\r\n // System.out.println((int)(Math.random() * 10 + 20));\r\n \r\n System.out.println(\"\\n\\nSHORTCUTS\\n============\");\r\n \r\n int a = 10;\r\n a += 10; //a - 20\r\n System.out.println(\"a is \" + a);\r\n int b = a;\r\n b++; //21\r\n System.out.println(\"b is \" + b);\r\n a *= 2; //a = a * 2\r\n System.out.println(\"a is \" + a); //40\r\n int c = b++; //c = 21, b = 22\r\n System.out.format(\"c = %d and b = %d\", c, b);\r\n int d = ++b; //d = 23, b = 23\r\n System.out.format(\"d = %d and b = %d\\n\", d, b);\r\n \r\n \r\n }", "public static void main(String[] args) {\n CDice dice = new CDice();\n dice.init(1, 2, 3, 4, 5, 6);\n int random = dice.roll();\n System.out.println(\"dice roll side number: \"+random);\n }", "private void updateRoll(float dt) {\n\n\t\trollRate = (speed / turnRadius) * rollMax;\n\n\t\t// special case if speed is zero - glider landed but still has\n\t\t// to roll level !\n\t\tif (speed == 0) {\n\t\t\trollRate = 1 / 1 * rollMax;\n\t\t}\n\n\t\tif (nextTurn != 0) {\n\n\t\t\t// turning\n\t\t\troll += nextTurn * rollRate * dt;\n\n\t\t\tif (roll > rollMax)\n\t\t\t\troll = rollMax;\n\t\t\tif (roll < -rollMax)\n\t\t\t\troll = -rollMax;\n\n\t\t} else if (roll != 0) {\n\n\t\t\t// roll back towards level\n\t\t\tfloat droll = rollRate * dt;\n\n\t\t\tif (roll > droll) {\n\t\t\t\troll -= droll;\n\t\t\t} else if (roll < -droll) {\n\t\t\t\troll += droll;\n\t\t\t} else {\n\t\t\t\troll = 0;\n\t\t\t}\n\t\t}\n\t}", "public static int rollDice (int a, int b)\r\n\t\t\t{\n\t\t\t\tint count=0;\r\n\t\t\t\tint total=0;\r\n\t\t\t\twhile(count<a)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint roll=(int)((Math.random()*b)+1);\t\r\n\t\t\t\t\t\ttotal=total+roll;\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t}\r\n\t\t\t\treturn total;\r\n\t\t\t\t\r\n\t\t\t}", "private void setMaxPayRaise ()\r\n {\r\n Random randomizer = new Random ();\r\n int[] randValues = {\r\n randomizer.nextInt (4) + 5, randomizer.nextInt (4) + 4,\r\n randomizer.nextInt (5) + 3, randomizer.nextInt (4) + 5,\r\n randomizer.nextInt (4) + 1, randomizer.nextInt (7) + 2,\r\n randomizer.nextInt (6) + 1\r\n };\r\n\r\n for (int j = 0; j < CAREERS.length; j++)\r\n if (CAREERS[j].equalsIgnoreCase (name))\r\n maxPayRaise = randValues[j];\r\n }" ]
[ "0.71324974", "0.68847585", "0.6759647", "0.67465746", "0.6712805", "0.6700411", "0.6607518", "0.6593367", "0.65907794", "0.65830535", "0.65796804", "0.65739685", "0.6562253", "0.6535717", "0.6533497", "0.65297145", "0.6488531", "0.64665335", "0.63905364", "0.6382174", "0.6352633", "0.6338274", "0.6318915", "0.63123614", "0.6265681", "0.6256213", "0.62523985", "0.62469065", "0.6187274", "0.61613715", "0.61359864", "0.613162", "0.6122518", "0.6113503", "0.6112005", "0.6098082", "0.60959315", "0.60952544", "0.60760397", "0.60454", "0.6034309", "0.5996536", "0.59933627", "0.59866685", "0.59674764", "0.59671986", "0.59616244", "0.5958292", "0.59505963", "0.5908329", "0.5906095", "0.5886033", "0.5875509", "0.5875186", "0.58263654", "0.58183324", "0.58105755", "0.57832223", "0.5780819", "0.57561", "0.5730313", "0.5713684", "0.56872857", "0.5682147", "0.56743914", "0.5660161", "0.56454647", "0.56240577", "0.5621212", "0.5616313", "0.56100875", "0.56077147", "0.56064475", "0.5606206", "0.5596808", "0.5593828", "0.55899084", "0.55857056", "0.5573404", "0.5571361", "0.5569489", "0.554119", "0.5521496", "0.55188245", "0.5506171", "0.5502947", "0.5502947", "0.5492306", "0.54913473", "0.5475206", "0.5453727", "0.54479903", "0.5437585", "0.5437015", "0.5417271", "0.5414276", "0.5410214", "0.5404006", "0.5402642", "0.5399899" ]
0.68211246
2
Takes sql query and execute
public ResultSet executeQueryCmd(String sql) { try { return stmt.executeQuery(sql); } catch (SQLException e) { e.printStackTrace(); return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void executeQuery() {\n }", "private void executeRequest(String sql) {\n\t}", "private void executeSelect(String query){\n try {\n statement = connection.createStatement();\n rs = statement.executeQuery(query);\n } catch (SQLException e) {\n throw new RuntimeException(e);\n } \n }", "public abstract ResultList executeSQL(RawQuery rawQuery);", "public abstract ResultList executeQuery(DatabaseQuery query);", "ResultSet runSQL(String query) {\n try {\n return connection.prepareStatement(query).executeQuery();\n }\n catch (SQLException e) {\n System.err.println(e.getMessage());\n return null;\n }\n }", "public void executeQuery_Other(String query) {\n\n \n Connection con = DBconnect.connectdb();\n Statement st;\n\n try {\n st = con.createStatement();\n st.executeUpdate(query);\n\n \n } catch (Exception e) {\n //JOptionPane.showMessageDialog(null, e);\n\n }\n\n }", "Object executeSelectQuery(String sql) { return null;}", "public ORM executeQuery(String query) {\n ResultSet rs = null;\n this.query =query;\n System.out.println(\"run: \" + this.query);\n //this.curId = 0;\n Statement statement;\n try {\n statement = this.conn.createStatement();\n rs = statement.executeQuery(this.query);\n //this.saveLog(0,\"\",query);\n } catch (SQLException e) {\n System.out.println( ColorCodes.ANSI_RED +\"ERROR in SQL: \" + this.query);\n // e.printStackTrace();\n }\n lastResultSet=rs;\n this.fields_values = \"\";\n return this;\n\n }", "@Override\n\t\tpublic void executeQuery(String query) {\n\t\t\t\n\t\t}", "public void execute (String query) throws java.sql.SQLException {\n try {\n /*\n if (query.indexOf('(') != -1)\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query.substring(0,query.indexOf('(')) + \"...\\\")\");\n else\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query.substring(0,20) + \"...\\\")\");\n */\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query + \"\\\")\");\n \n Statement statement = dbConnection.createStatement();\n statement.setQueryTimeout(30);\n dbConnection.setAutoCommit(false);\n statement.executeUpdate(query);\n dbConnection.commit();\n dbConnection.setAutoCommit(true);\n } catch (java.sql.SQLException e) {\n Logger.write(\"ERROR\", \"DB\", \"SQLException: \" + e);\n throw e;\n }\n }", "void runQueries();", "public void exec(String sql) {\r\n try (Statement stmt = connection.createStatement()) {\r\n stmt.execute(sql);\r\n } catch (SQLException e) {\r\n throw new DbException(connectionString + \"\\nError executing \" + sql, e);\r\n }\r\n }", "protected void execSQL(String sql) throws Exception {\n\t\tPreparedStatement statement = null;\n\t\ttry {\n\t\t\tstatement = connection.prepareStatement(sql);\n\t\t\tstatement.execute();\n\t\t} catch (Exception e) {\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tPersistenceUtils.closeStatement(statement);\n\t\t}\n\n\t}", "public void ejecutarSql(String query) throws Exception {\n stmt.executeUpdate(query);\n }", "@Override\n\tvoid executeQuery(String query) {\n\t\tSystem.out.println(\"Mssql ==> \" + query);\n\t}", "public ResultSet runQuery(String sql){\n\n try {\n\n Statement stmt = conn.createStatement();\n\n return stmt.executeQuery(sql);\n\n } catch (SQLException e) {\n e.printStackTrace(System.out);\n return null;\n }\n\n }", "public ResultSet executeQuery(String sql) throws Exception {\n\n\t\tResultSet rs = stmt.executeQuery(sql);\n\t\t// stmt.close();\n\t\treturn rs;\n\t}", "public ResultSet execute(String query)\n\t{\n\t\tResultSet resultSet = null;\n\t\ttry {\n\t\tStatement statement = this.connection.createStatement();\n\t\tresultSet = statement.executeQuery(query);\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Error while executing query.\" +e.getMessage());\n\t\t}\n\t\treturn resultSet;\n\t}", "private ResultSet executeQuery(String query) {\r\n Statement stmt;\r\n ResultSet result = null;\r\n try {\r\n// System.out.print(\"Connect DB .... \");\r\n conn = openConnect();\r\n// System.out.println(\"successfully \");\r\n stmt = conn.createStatement();\r\n result = stmt.executeQuery(query);\r\n } catch (SQLException | ClassNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return result;\r\n }", "public ResultSet executeQuery(String query) {\n ResultSet rs = null;\n \ttry {\n rs = st.executeQuery(query);\n } catch(Exception e) {\n \te.printStackTrace();\n }\n return rs;\n }", "protected ResultSet executeQuery(String query) {\n ResultSet rs = null;\n \n try {\n Statement stmt = getConnection().createStatement();\n rs = stmt.executeQuery(query);\n } catch (SQLException e) {\n String msg = \"Failed to execute query: \" + query;\n _logger.error(msg, e);\n throw new TSSException(msg, e);\n } \n \n return rs;\n }", "@Override\n\tpublic void executeQuery(String query) {\n\t\tStatement statement;\n\t\ttry {\n\t\t\tstatement=connection.createStatement();\n\t\t\tstatement.executeUpdate(query);\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}", "public void execSQL(String sql) {\n\t\ttry ( Connection con = getConnection() ){\n\t\t\tStatement stmt = con.createStatement();\n\t\t\tstmt.execute(sql);\n\t\t} catch (SQLException e) {\n\t\t\tthrow new RuntimeException(\"SQL error (SQLException)\", e);\n\t\t}\n\t}", "Query query();", "protected final void executeQuery() {\n\ttry {\n\t executeQuery(queryBox.getText());\n\t} catch(SQLException e) {\n\t e.printStackTrace();\n\t clearTable();\n\t JOptionPane.showMessageDialog(\n\t\tnull, e.getMessage(),\n\t\t\"Database Error\",\n\t\tJOptionPane.ERROR_MESSAGE);\n\t}\n }", "protected static void execute(ReviewDb db, String sql) throws SQLException {\n try (Statement s = newStatement(db)) {\n s.execute(sql);\n }\n }", "public static ResultSet executeQuery(String query) {\n\t\t\n\t\tString url = \"jdbc:postgresql://localhost:5432/postgres\";\n String user = \"postgres\";\n String password = \"admin\";\n \n ResultSet rs = null;\n\n try {\n \tConnection con = DriverManager.getConnection(url, user, password);\n \t\tStatement st = con.createStatement();\n \t\n rs = st.executeQuery(query);\n\n\t\t\t/*\n\t\t\t * if (rs.next()) { System.out.println(rs.getString(1)); }\n\t\t\t */\n \n \n\n } catch (SQLException ex) {\n \n System.out.println(\"Exception occured while running query\");\n ex.printStackTrace();\n }\n \n return rs;\n\t}", "@Override\n public boolean execute(String sql) throws SQLException {\n\n // a result set object\n //\n tsResultSet r;\n\n // execute the query \n //\n r = connection.executetinySQL(this);\n\n // check for a null result set. If it wasn't null,\n // use it to create a tinySQLResultSet, and return whether or\n // not it is null (not null returns true).\n //\n if( r == null ) {\n result = null;\n } else {\n result = new tinySQLResultSet(r, this);\n }\n return (result != null);\n\n }", "public void execute() throws SQLException {\n\t\ttry {\n\t\t\tselect.setUsername(\"INTRANET\");\n\t\t\tselect.setPassword(\"INTRANET\");\n\t\t\tselect.execute();\n\t\t}\n\n\t\t// Liberar recursos del objeto select.\n\t\tfinally {\n\t\t\tselect.close();\n\t\t}\n\t}", "public ResultSet executeQuery(String query)\n\t{\n\t\tStatement statement = null;\n\t\tResultSet resultSet = null;\n\t\t\n\t\ttry\n\t\t{\n\t\t\t//System.out.println(\"Performing query: \" + query);\n\t\t\tstatement = getConnection().createStatement();\n\t\t\tresultSet = statement.executeQuery(query);\n\t\t\t//System.out.println(\"Query performed\");\n\t\t\t\n\t\t\treturn resultSet;\n\t\t}\n\t\tcatch(SQLException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "public static void execute(Connection conn, String query) throws SQLException {\n Statement newState;\n try {\n newState = conn.createStatement();\n newState.execute(query);\n newState.close();\n } catch (SQLException e) {\n System.err.println(e);\n }\n }", "public void executeQuery(String q) throws HiveQueryExecutionException;", "ResultSet executeQuery() throws SQLException;", "@Override\n public synchronized ResultSet executeQuery(String sql)\n throws SQLException {\n\n // tinySQL only supports one result set at a time, so\n // don't let them get another one, just in case it's\n // hanging out.\n //\n tinySQLResultSet trs;\n result = null; \n statementString = sql;\n\n // create a new tinySQLResultSet with the tsResultSet\n // returned from connection.executetinySQL()\n //\n if ( debug ) {\n System.out.println(\"executeQuery conn is \" + connection.toString());\n }\n trs = new tinySQLResultSet(connection.executetinySQL(this), this);\n return trs; \n }", "public ResultSet executeSQL() {\t\t\n\t\tif (rs != null) {\n\t\t\ttry {\n\t\t\t\trs.close();\n\t\t\t} catch(SQLException se) {\n\t\t\t} finally {\n\t\t\t\trs = null;\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\trs = pstmt.executeQuery();\n\t\t} catch (SQLException se) {\n\t\t\tse.printStackTrace();\n\t\t}\n\t\treturn rs;\n\t}", "private void sendQuery(String sqlQuery) {\n getRemoteConnection();\n try {\n statement = conn.createStatement();{\n // Execute a SELECT SQL statement.\n resultSet = statement.executeQuery(sqlQuery);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void executeQuery(Statement stmt, String query) throws SQLException {\n //check if it is select\n Boolean ret = stmt.execute(query);\n if (ret) {\n ResultSet result = stmt.executeQuery(query);\n ResultSetMetaData rsmd = result.getMetaData();\n int columnCount = rsmd.getColumnCount();\n // The column count starts from 1\n\n //ArrayList<String> column_names = new ArrayList<String>();\n for (int i = 1; i <= columnCount; i++) {\n String name = rsmd.getColumnName(i);\n //column_names.add(name);\n System.out.format(\"|%-30s \",name);\n // Do stuff with name\n }\n System.out.println();\n\n while (result.next()) {\n for (int i = 0; i < columnCount; i++) {\n System.out.format(\"|%-30s \",result.getString(i+1));\n }\n System.out.println();\n }\n // STEP 5: Clean-up environment\n result.close();\n }\n }", "public static void executeSqlQuery(String spOrQueryName) {\r\n\t\ttry {\r\n\t\t\topenCon();\r\n\t\t\ts = conn.createStatement();\r\n\t\t\ts.executeQuery(spOrQueryName);\r\n\t\t\tcloseCon();\r\n\t\r\n\t\t} catch (Exception e) {\r\n\t//\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "public static ResultSet Execute(String query) throws SQLException{\r\n\t\ttry {\r\n\t\t\tinitConnection();\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(e.toString());\r\n\t\t}\r\n\t\tStatement state = dbCon.createStatement();\r\n\t\treturn state.executeQuery(query);\t\t\t\r\n\t}", "Result execute(String sql) {\n\n Result result;\n String token;\n int cmd;\n\n JavaSystem.gc();\n\n result = null;\n cmd = Token.UNKNOWNTOKEN;\n\n try {\n tokenizer.reset(sql);\n\n while (true) {\n tokenizer.setPartMarker();\n session.setScripting(false);\n\n token = tokenizer.getSimpleToken();\n\n if (token.length() == 0) {\n session.endSchemaDefinition();\n\n break;\n }\n\n cmd = Token.get(token);\n\n if (cmd == Token.SEMICOLON) {\n session.endSchemaDefinition();\n\n continue;\n }\n\n result = executePart(cmd, token);\n\n if (result.isError()) {\n session.endSchemaDefinition();\n\n break;\n }\n\n if (session.getScripting()) {\n database.logger.writeToLog(session,\n tokenizer.getLastPart());\n }\n }\n } catch (Throwable t) {\n try {\n if (session.isSchemaDefintion()) {\n HsqlName schemaName = session.getSchemaHsqlName(null);\n\n database.schemaManager.dropSchema(schemaName.name, true);\n database.logger.writeToLog(session,\n Token.T_DROP + ' '\n + Token.T_SCHEMA + ' '\n + schemaName.statementName\n + ' ' + Token.T_CASCADE);\n database.logger.synchLog();\n session.endSchemaDefinition();\n }\n } catch (HsqlException e) {}\n\n result = new Result(t, tokenizer.getLastPart());\n }\n\n return result == null ? Session.emptyUpdateCount\n : result;\n }", "public void execSql(String sql) {\n\t\tjdbcTemplate.execute(sql);\n\t}", "@Override\n\tpublic ResultSet executeQuery(final String sql) throws SQLException {\n\n\t\tfinal String transformedSQL = transformSQL(sql);\n\n\t\tif (transformedSQL.length() > 0) {\n\n\t\t\tfinal Statement statement = new SimpleStatement(transformedSQL);\n\n\t\t\tif (getMaxRows() > 0)\n\t\t\t\tstatement.setFetchSize(getMaxRows());\n\n\t\t\tresultSet = session.execute(statement);\n\n\t\t\twarnings.add(resultSet);\n\n\t\t\treturn new CassandraResultSet(driverContext, resultSet);\n\t\t}\n\n\t\treturn null;\n\t}", "@Override\r\n public void query(String strSQL)\r\n {\r\n try\r\n {\r\n dbRecordset = dbCmdText.executeQuery(strSQL);\r\n status(\"epic wonder \"+ strSQL);\r\n }\r\n catch (Exception ex)\r\n {status(\"Query fail\");\r\n }\r\n }", "public ResultSet ejecutarQuery(String query) throws Exception {\n ResultSet rs = null;\n rs = stmt.executeQuery(query);\n return rs;\n }", "public int execute(String sql) throws Exception {\n\t\treturn 0;\r\n\t}", "public void ExecutaSqlLi(String sql) {\n try {\n stm = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n rs = stm.executeQuery(sql);\n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(null, \"Falha ao executar query:\\n\" + ex);\n }\n }", "public void runQuery(String query) throws SQLException {\n runQuery(query, \"default\");\n }", "CommandResult execute();", "protected void runSQL(String sql) {\n\t\ttry {\n\t\t\tDataSource dataSource = itemPublicacaoPersistence.getDataSource();\n\n\t\t\tDB db = DBManagerUtil.getDB();\n\n\t\t\tsql = db.buildSQL(sql);\n\t\t\tsql = PortalUtil.transformSQL(sql);\n\n\t\t\tSqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,\n\t\t\t\t\tsql);\n\n\t\t\tsqlUpdate.update();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new SystemException(e);\n\t\t}\n\t}", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "public abstract ExecuteResult<T> execute() throws SQLException;", "void execute(Context context) throws SQLException;", "public void callQuery(String query) throws SQLException {\n for(int i = 0; i < queryHistory.size(); i++) {\n if(queryHistory.get(i).equalsIgnoreCase(query))\n data.get(i).OUPUTQUERY(data.get(i).getConversionArray(), data.get(i).getResultSet());\n }\n }", "@Override\r\n\tpublic boolean excuteSql(String sql) {\n\t\tint result = 0;\r\n\t\ttry {\r\n\t\t\tconn = DriverManager.getConnection(URL, USER, PASS);\r\n\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\tresult = ps.executeUpdate();\r\n\t\t\tif(result == 0) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public ResultSet execute(PreparedStatement query)\r\n {\r\n try\r\n {\r\n return query.executeQuery();\r\n } catch(SQLException exception)\r\n {\r\n LOG.log(Level.SEVERE, \"\", exception);\r\n }\r\n return null;\r\n }", "public ResultSet executeQuery(String request) {\n try {\r\n return st.executeQuery(request);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(Database.class.getName()).log(Level.SEVERE, null, ex);\r\n return null;\r\n }\r\n }", "public void execute() throws SQLException {\n\t\tif (this.ds == null) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\"Please pass a DataSource to the ListSqlHelper!\");\n\t\t}\n\t\t\n\t\texecuteCountSql();\n\t\texecuteItemRangeSql();\n\t}", "public ResultSet executeQuery(String sql) throws SQLException {\n return currentPreparedStatement.executeQuery(sql);\n }", "protected void runSQL(String sql) {\n\t\ttry {\n\t\t\tDataSource dataSource = monthlyTradingPersistence.getDataSource();\n\n\t\t\tDB db = DBManagerUtil.getDB();\n\n\t\t\tsql = db.buildSQL(sql);\n\t\t\tsql = PortalUtil.transformSQL(sql);\n\n\t\t\tSqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,\n\t\t\t\t\tsql);\n\n\t\t\tsqlUpdate.update();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new SystemException(e);\n\t\t}\n\t}", "public boolean querySql(String sql){\r\n boolean result = true;\r\n try{\r\n stm = con.createStatement();\r\n rss = stm.executeQuery(sql);\r\n }catch(SQLException e){\r\n report = e.toString();\r\n result = false;\r\n }\r\n return result;\r\n }", "public int executeQuery (String query) throws SQLException {\n // creates a statement object\n Statement stmt = this._connection.createStatement ();\n\n // issues the query instruction\n ResultSet rs = stmt.executeQuery (query);\n\n int rowCount = 0;\n\n // iterates through the result set and count nuber of results.\n if(rs.next()){\n rowCount++;\n }//end while\n stmt.close ();\n return rowCount;\n }", "public void testExecuteSQL() {\n\t\tsqlExecUtil.setDriver(\"com.mysql.jdbc.Driver\");\n\t\tsqlExecUtil.setUser(\"root\");\n\t\tsqlExecUtil.setPassword(\"\");\n\t\tsqlExecUtil.setUrl(\"jdbc:mysql://localhost/sysadmin?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=gb2312\");\n\t\tsqlExecUtil.setSqlText(\"select * from t_role\");\n\t\tsqlExecUtil.executeSQL();\n\t\t\n\t\tsqlExecUtil.setSqlText(\"select * from t_user\");\n\t\tsqlExecUtil.executeSQL();\n\t}", "DBCursor execute();", "public ResultSet doQuery( String sql) throws SQLException {\r\n\t\tif (dbConnection == null)\r\n\t\t\treturn null;\r\n\t\t// prepare sql statement\r\n\t\toutstmt = dbConnection.prepareStatement(sql);\r\n\t\tif (outstmt == null)\r\n\t\t\treturn null;\r\n\t\tif (outstmt.execute()){\r\n\t\t\t//return stmt.getResultSet(); //old\r\n\t\t\toutrs = outstmt.getResultSet();\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn null;\r\n\t\treturn outrs;\r\n\t}", "public boolean execute(String sql) throws SQLException {\n return false;\r\n }", "public void query(String sql) throws SQLException {\r\n Statement st = con.createStatement();\r\n ResultSet rs = st.executeQuery(sql);\r\n\r\n while (rs.next()){\r\n System.out.println(rs.getInt(\"id\")+\" \"+rs.getString(\"name\")+\" \"+rs.getString(\"surname\")+\" \"+rs.getFloat(\"grade\"));\r\n }\r\n\r\n }", "public void executeSql(String sql) throws SQLException {\n executeSql(sql, true, AppConstants.DEFAULT_FETCH_SIZE, AppConstants.DEFAULT_FETCH_DIRN);\n }", "public abstract int execUpdate(String query) ;", "boolean execute() throws SQLException;", "protected void runSQL(String sql) {\n\t\ttry {\n\t\t\tDataSource dataSource = wfms_Position_AuditPersistence.getDataSource();\n\n\t\t\tDB db = DBManagerUtil.getDB();\n\n\t\t\tsql = db.buildSQL(sql);\n\t\t\tsql = PortalUtil.transformSQL(sql);\n\n\t\t\tSqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,\n\t\t\t\t\tsql);\n\n\t\t\tsqlUpdate.update();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new SystemException(e);\n\t\t}\n\t}", "public QueryExecution createQueryExecution(Query qry);", "protected void runSQL(String sql) throws SystemException {\n try {\n DataSource dataSource = libroPersistence.getDataSource();\n\n SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,\n sql, new int[0]);\n\n sqlUpdate.update();\n } catch (Exception e) {\n throw new SystemException(e);\n }\n }", "@Override\r\n public void runCode(String sql)\r\n throws DatabaseException {\r\n try {\r\n Class.forName(driverClassName);\r\n conn = DriverManager.getConnection(url, userName, password);\r\n \r\n } catch (ClassNotFoundException ex) {\r\n throw new DatabaseException(\"Could not load JDBC driver\");\r\n }\r\n catch(SQLException sq){\r\n throw new DatabaseException(\"Connection Failed\");\r\n }\r\n \r\n try {\r\n stmt = conn.createStatement();\r\n stmt.executeUpdate(sql); \r\n } catch (SQLException sqle) {\r\n throw new DatabaseException(\"Execution of SQL failed\");\r\n } catch (Exception e) {\r\n } finally {\r\n try {\r\n stmt.close();\r\n conn.close();\r\n } catch (Exception e) {\r\n throw new DatabaseException(\"Unknown error\");\r\n }\r\n }\r\n }", "abstract protected void execute();", "public void executeSQL(String sql) {\n\t\tgetWritableDatabase().execSQL(sql);\n\t}", "protected void execute() {\n \t\n }", "protected void execute() {\n \t\n }", "public ResultSet executeQuery(String query) throws SQLException {\n Connection con = this.getConnection();\n\n if (con == null) {\n throw new SQLException(\"Can't get database connection\");\n }\n\n Statement statement = con.createStatement();\n\n ResultSet result = statement.executeQuery(query);\n con.close(); // Not sure if allowed to close connection before result.\n // MAKE SURE to close result after using it! result.close();\n return result;\n }", "public ResultSet executeSaleQuery(String query){\r\n\t\tResultSet rs = null;\r\n\t\tStatement st=null;\r\n\t\ttry {\r\n\t\t\tst = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);\r\n\t\t\trs = st.executeQuery(query);\r\n\t\t}catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn rs;\r\n\t}", "public void execute();", "public void execute();", "public void execute();", "public void execute();", "protected void runSQL(String sql) throws SystemException {\n try {\n DataSource dataSource = barPersistence.getDataSource();\n\n SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,\n sql, new int[0]);\n\n sqlUpdate.update();\n } catch (Exception e) {\n throw new SystemException(e);\n }\n }", "Object executeQuery(String sparqlQuery);", "public int execute();", "public List sqlQuery(String sql,Object... params);", "public boolean execute(String sql) throws SQLException {\n return currentPreparedStatement.execute(sql);\n }", "protected void execute() {}", "protected abstract void execute();", "Query queryOn(Connection connection);", "public int executeHql(String hql) {\n return this.getCurrentSession().createQuery(hql).executeUpdate();\n }", "public ResultSet executeQuery() throws SQLException {\n return statement.executeQuery();\n }" ]
[ "0.794241", "0.764295", "0.75547755", "0.72824633", "0.7253862", "0.72493476", "0.7245652", "0.7171224", "0.7147325", "0.71461934", "0.7123872", "0.70517814", "0.70334846", "0.70261025", "0.6937007", "0.69243324", "0.69186056", "0.688662", "0.6874216", "0.686801", "0.6863353", "0.6830167", "0.6794428", "0.6792053", "0.67876333", "0.676818", "0.6748027", "0.6731471", "0.67282933", "0.6699083", "0.66930354", "0.6679973", "0.6641387", "0.66312623", "0.65806174", "0.6572893", "0.65727043", "0.65670127", "0.6557586", "0.6551286", "0.65462744", "0.65384763", "0.6534972", "0.65327805", "0.65051335", "0.64896005", "0.64784336", "0.6474702", "0.6467293", "0.64593357", "0.6457397", "0.6457397", "0.6457397", "0.6457397", "0.6457397", "0.6457397", "0.6457397", "0.6453357", "0.6421764", "0.64166373", "0.6410361", "0.63990927", "0.639728", "0.6344158", "0.6340075", "0.63372356", "0.6332211", "0.6325351", "0.6323657", "0.6317574", "0.63107055", "0.6300097", "0.6296266", "0.62880033", "0.6269024", "0.626895", "0.62596333", "0.62588394", "0.6254385", "0.6242895", "0.62323266", "0.622632", "0.6222037", "0.6222037", "0.6220263", "0.62174976", "0.62037754", "0.62037754", "0.62037754", "0.62037754", "0.62001836", "0.6196278", "0.61944956", "0.619239", "0.61872035", "0.61760634", "0.6173018", "0.6170881", "0.6170845", "0.6168088" ]
0.658536
34
Take sql update and execute
public int executeUpdateCmd(String sql) { try { return stmt.executeUpdate(sql); } catch (SQLException e) { e.printStackTrace(); return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract int execUpdate(String query) ;", "Integer update(final String sql);", "public void executeUpdate();", "void executeUpdate();", "@Override\n\tpublic void executeUpdateDinamicSQL(String s) throws Exception {\n\t\t\n\t}", "void executeUpdate(String noParamQuery, Connection conn);", "@Override\n public synchronized int executeUpdate(String sql) throws SQLException {\n\n statementString = sql;\n return connection.executetinyUpdate(this);\n\n }", "@Override\n\tpublic void executeUpdateDinamicQuery(String s) throws Exception {\n\t\t\n\t}", "public void executeUpdate(String sql) {\n\t\ttry {\n\t\t\tstm = connection.createStatement();\n\t\t\tstm.executeUpdate(sql);\n\t\t\tSystem.out.println(\"Database update complete.\");\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public int executeUpdate(String sql) throws Exception {\n\t\tint result = stmt.executeUpdate(sql);\n\t\t// stmt.close();\n\t\treturn result;\n\t}", "public void executeUpdate (String sql) throws SQLException {\n // creates a statement object\n Statement stmt = this._connection.createStatement ();\n\n // issues the update instruction\n stmt.executeUpdate (sql);\n\n // close the instruction\n stmt.close ();\n }", "public void executeUpdate(String request) {\n try {\r\n st.executeUpdate(request);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(Database.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "public void executeUpdate(String query) {\n \ttry {\n\t\t\tst.executeUpdate(query);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n }", "int executeUpdate() throws SQLException;", "public static int executeUpdate(final String sql, final Object... args)\n {\n return new SqlClosure<Integer>()\n {\n @Override\n protected Integer execute(Connection connection) throws SQLException\n {\n return OrmElf.executeUpdate(connection, sql, args);\n }\n }.execute();\n }", "public void update(String hql) {\n\r\n\t}", "public CustomSql getCustomSqlUpdate();", "protected void runSQL(String sql) {\n\t\ttry {\n\t\t\tDataSource dataSource = wfms_Position_AuditPersistence.getDataSource();\n\n\t\t\tDB db = DBManagerUtil.getDB();\n\n\t\t\tsql = db.buildSQL(sql);\n\t\t\tsql = PortalUtil.transformSQL(sql);\n\n\t\t\tSqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,\n\t\t\t\t\tsql);\n\n\t\t\tsqlUpdate.update();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new SystemException(e);\n\t\t}\n\t}", "protected void runSQL(String sql) {\n\t\ttry {\n\t\t\tDataSource dataSource = itemPublicacaoPersistence.getDataSource();\n\n\t\t\tDB db = DBManagerUtil.getDB();\n\n\t\t\tsql = db.buildSQL(sql);\n\t\t\tsql = PortalUtil.transformSQL(sql);\n\n\t\t\tSqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,\n\t\t\t\t\tsql);\n\n\t\t\tsqlUpdate.update();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new SystemException(e);\n\t\t}\n\t}", "public synchronized void update(String expression) throws SQLException {\n\n Statement st = null;\n\n st = conn.createStatement(); // statements\n\n int i = st.executeUpdate(expression); // run the query\n\n if (i == -1) {\n System.out.println(\"db error : \" + expression);\n }\n\n st.close();\n }", "protected void runSQL(String sql) throws SystemException {\n try {\n DataSource dataSource = libroPersistence.getDataSource();\n\n SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,\n sql, new int[0]);\n\n sqlUpdate.update();\n } catch (Exception e) {\n throw new SystemException(e);\n }\n }", "public int executeSQLUpdate(final String sql) {\n\n long start = System.currentTimeMillis();\n int updateResult = txTemplate\n .execute(new TransactionCallback<Integer>() {\n @Override\n public Integer doInTransaction(TransactionStatus status) {\n return getSession(false).createSQLQuery(sql)\n .executeUpdate();\n }\n });\n logger.debug(\"executeSQLUpdate took: \"\n + (System.currentTimeMillis() - start) + \" ms\");\n return updateResult;\n }", "public int executeUpdate(String sql)\r\n throws SQLException {\n return 0;\r\n }", "public void executeUpdate(T databaseConnection, String query, Connection connection) throws SQLException {\n query = this.removeIllegalCharactersForSingleQuery(databaseConnection, query);\n query = refactorLimitAndOffset(query);\n // query = prepareQuery(query);\n log.info(databaseConnection.getConnectionURL() + \":\" + query);\n\n Statement statement = connection.createStatement();\n statement.executeUpdate(query);\n statement.close();\n }", "CustomUpdateQuery update(String table);", "protected void runSQL(String sql) {\n\t\ttry {\n\t\t\tDataSource dataSource = monthlyTradingPersistence.getDataSource();\n\n\t\t\tDB db = DBManagerUtil.getDB();\n\n\t\t\tsql = db.buildSQL(sql);\n\t\t\tsql = PortalUtil.transformSQL(sql);\n\n\t\t\tSqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,\n\t\t\t\t\tsql);\n\n\t\t\tsqlUpdate.update();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new SystemException(e);\n\t\t}\n\t}", "<T extends BaseDto> void executeUpdate(String reqQuery, T req, Connection conn);", "public void update(String expression) {\r\n \t\tStatement st = null;\r\n \t\ttry {\r\n \t\t\tst = conn.createStatement();\r\n \t\t\tint i = st.executeUpdate(expression); // run the query\r\n \t\t\tif (i == -1) {\r\n \t\t\t\tSystem.out.println(\"db error : \" + expression);\r\n \t\t\t}\r\n \r\n \t\t} catch (SQLException e) {\r\n \t\t\te.printStackTrace();\r\n \t\t} finally {\r\n \t\t\ttry {\r\n \t\t\t\tst.close();\r\n \t\t\t} catch (SQLException e) {\r\n \t\t\t\te.printStackTrace();\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t}", "protected void runSQL(String sql) throws SystemException {\n try {\n DataSource dataSource = barPersistence.getDataSource();\n\n SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,\n sql, new int[0]);\n\n sqlUpdate.update();\n } catch (Exception e) {\n throw new SystemException(e);\n }\n }", "@Test\n public void commonUpdateTest() {\n\n String sql2 = \"UPDATE `order` SET order_name=? WHERE order_id=?\";\n commonUpdate(sql2, \"abc\", \"2\");\n }", "@Test\n public void test() throws Exception{\n update(\"update user set username=? where id=?\",\"wangjian\",\"4\");\n }", "protected void runSQL(String sql) throws SystemException {\n try {\n DataSource dataSource = banking_organizationPersistence.getDataSource();\n\n SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,\n sql, new int[0]);\n\n sqlUpdate.update();\n } catch (Exception e) {\n throw new SystemException(e);\n }\n }", "@TargetMetric\n @Override\n public RespResult<SqlExecRespDto> executeUpdate(String username, SqlExecReqDto update) {\n return null;\n }", "protected void runSQL(String sql) {\n\t\ttry {\n\t\t\tDataSource dataSource = csclPollsChoicePersistence.getDataSource();\n\n\t\t\tDB db = DBManagerUtil.getDB();\n\n\t\t\tsql = db.buildSQL(sql);\n\t\t\tsql = PortalUtil.transformSQL(sql);\n\n\t\t\tSqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(\n\t\t\t\tdataSource, sql);\n\n\t\t\tsqlUpdate.update();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new SystemException(e);\n\t\t}\n\t}", "public void executeUpdate(final String s){\n\n new AsyncTask<Void,Void,Void>() {\n\n @Override\n protected Void doInBackground(Void... voids) {\n mySql = new MySql();\n //Obtengo los resultados de la consulta\n ResultBaseDeDatosUpdates result = mySql.executeUpdate(s);\n if (result != null) {\n if (result.Conecto()) {\n int rs = result.getResultado();\n Log.v(\"MySql\", String.valueOf(rs));\n } else {\n Log.v(\"MySql\", \"Error de conexión\");\n }\n }else {\n Log.v(\"MySql\", \"Error de conexión\");\n }\n\n\n\n return null;\n }\n }.execute();\n\n\n\n }", "private void executeRequest(String sql) {\n\t}", "protected void runSQL(String sql) {\n\t\ttry {\n\t\t\tDataSource dataSource = localRichPersistence.getDataSource();\n\n\t\t\tDB db = DBManagerUtil.getDB();\n\n\t\t\tsql = db.buildSQL(sql);\n\t\t\tsql = PortalUtil.transformSQL(sql);\n\n\t\t\tSqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,\n\t\t\t\t\tsql);\n\n\t\t\tsqlUpdate.update();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new SystemException(e);\n\t\t}\n\t}", "private int executeUpdateInternal(List<Object> values) {\r\n\t\tif (logger.isDebugEnabled()) {\r\n\t\t\tlogger.debug(\"The following parameters are used for update \" + getUpdateString() + \" with: \" + values);\r\n\t\t}\r\n\t\tint updateCount = jdbcTemplate.update(updateString, values.toArray(), columnTypes);\r\n\t\treturn updateCount;\r\n\t}", "protected synchronized void pureSQLUpdate(String query) {\n if(this.connect()) {\n try {\n this.statement = this.connection.createStatement();\n this.statement.executeUpdate(query);\n } catch(SQLException ex) {\n Logger.getLogger(MySQLMariaDBConnector.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n this.close();\n }\n }\n }", "public static int update( String sql )\n \t{\n \t\tint rowsModified = -1;\n \t\t\n \t\tConnection conn = getConnection();\n \t\n \t\t\ttry {\n \t\t\t\tStatement st = conn.createStatement();\n \t\t\t\trowsModified = st.executeUpdate( sql );\n \t\t\t\tst.close();\n \t\t\t}\n \t\t\tcatch (SQLException ex) {\n \t\t\t\tthrow new RuntimeException( ex );\n \t\t\t}\n \t\t\n \t\treturnConnection( conn );\n \t\t\n \t\treturn rowsModified; \n \t}", "public int req(Long req_id)throws SQLException {\nint i=DbConnect.getStatement().executeUpdate(\"update requested set status='processed',remark='bought fail' where reqid=\"+req_id+\"\");\t\r\n\treturn i;\r\n}", "public static void editDatabase(String sql){\n Connection connection = dbConnection();\n\n try{\n PreparedStatement pst = connection.prepareStatement(sql);\n pst.executeUpdate();\n pst.close();\n connection.close();\n }catch (Exception e){\n e.printStackTrace();\n }\n }", "public static void executingUpdate(String query1) {\r\n try {\r\n //Apertura de conexion:\r\n Connection con = iniciarConexion();\r\n PreparedStatement pst = con.prepareStatement(query1);\r\n con.setAutoCommit(false);\r\n //Añadimos todas las setencias del ArrayList a la batería de queries:\r\n\r\n pst.addBatch(query1);\r\n\r\n //Recogemos los datos de filas modificadas por cada query y los mostramos:\r\n int[] registrosAfectados = pst.executeBatch();\r\n for (int i = 0; i < registrosAfectados.length; i++) {\r\n System.out.println(\"Filas modificadas: \" + registrosAfectados[i]);\r\n }\r\n //Se confirma la transacción a la base de datos:\r\n con.commit();\r\n con.close();\r\n //Se limpia el ArrayList para una sesión posterior:\r\n\r\n } catch (SQLException ex) {\r\n System.err.print(\"SQLException: \" + ex.getMessage());\r\n }\r\n }", "public boolean updateSql(String sql){\r\n try {\r\n stm = con.createStatement();\r\n stm.executeUpdate(sql);\r\n }\r\n catch (SQLException ex) {\r\n report = ex.toString();\r\n return false;\r\n }\r\n return true;\r\n }", "public int executeUpdate(String sql) throws SQLException {\n return currentPreparedStatement.executeUpdate(sql);\n }", "public boolean doExecuteUpdate( String sql, Object[] params){\r\n\t\tboolean temp = false;\r\n\t\tif (dbConnection == null)\r\n\t\t\treturn temp;\r\n\t\tPreparedStatement stmt = null;\r\n\t\ttry {\r\n\r\n\t\t\tstmt = dbConnection.prepareStatement(sql);\r\n\t\t\t// stuff parameters in\r\n\t\t\tfor (int i=0; i<params.length; i++){\r\n\t\t\t\tstmt.setObject(i + 1,params[i]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (stmt == null)\r\n\t\t\t\treturn temp;\r\n\t\t\tint count = stmt.executeUpdate(); //返回值为0表示执行出错。仅对INSERT、UPDATE 或 DELETE\r\n\r\n\t\t\t//System.out.println(\"delete:\" +count);\r\n\t\t\t\r\n\t\t\tif (count > 0) \r\n\t\t\t\ttemp= true;\r\n\t\t} catch (SQLException e) {\r\n\t\t\tErrorLog.log(\"Database->doExecuteUpdate3:\" + e.getMessage()+\"//\"+ e);\r\n\t\t}finally{\r\n\t\t\ttry {\r\n\t\t\t\tif(stmt != null){ \r\n\t\t\t\t\tstmt.close();\r\n\t\t\t\t\tstmt = null;\r\n\t\t\t\t}\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tErrorLog.log(\"Database->doExecuteUpdate4:\" + e.getMessage()+\"//\"+ e);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn temp;\t\r\n\t}", "public void test_update() throws Exception {\n\t\tConnection conn = null;\r\n\t\tPreparedStatement stmt = null;\r\n\t\ttry {\r\n conn = jdbcutils.getConnection();\r\n //定义sql\r\n String sql = \"update employee set salary=? where EMP_id = ?\";\r\n //获取执行sql的对象\r\n stmt = conn.prepareStatement(sql);\r\n stmt.setInt(1,10000);\r\n stmt.setInt(2,1);\r\n \r\n //执行sql\r\n stmt.executeUpdate(); \r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }finally {\r\n jdbcutils.close(stmt,conn);\r\n }\r\n\t\t test_select a = new test_select();\r\n\t a.test_select();\r\n\t}", "@Override\r\n\tpublic boolean updateSQL(String sql, Connection con) {\n\t\treturn false;\r\n\t}", "public void editar(String update){\n try {\n Statement stm = Conexion.getInstancia().createStatement();\n stm.executeUpdate(update);\n }\n catch (Exception ex){\n ex.printStackTrace();\n }\n }", "protected void runSQL(String sql) throws SystemException {\n try {\n DataSource dataSource = mbMobilePhonePersistence.getDataSource();\n\n SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,\n sql, new int[0]);\n\n sqlUpdate.update();\n } catch (Exception e) {\n throw new SystemException(e);\n }\n }", "private void executeUpdate()\n\t\t\tthrows TranslatorException {\n\t\tUpdate ucommand = (Update) command;\t\n\t\t\n\t\tTable t = metadata.getTable(ucommand.getTable().getMetadataObject().getFullName());\n//\t\tList<ForeignKey> fks = t.getForeignKeys();\n\t\t\n\t\t// if the table has a foreign key, its must be a child (contained) object in the root\n\t\tif (t.getForeignKeys() != null && t.getForeignKeys().size() > 0) {\n\t\t\t updateChildObject(t);\n\t\t\t return;\n\t\t}\n\n\t}", "public void dbUpdate(String query) {\n try {\n tryDbUpdate(query);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void update(String query) {\n\t\ttry {\n\t\t\tStatement st = Database.getInstance().getDBConn().createStatement();\n\t\t\tst.executeUpdate(query);\n\t\t\t\n\t\t\tst.close();\n\t\t} catch(Exception err) {\n\t\t\terr.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic boolean update(String sql) {\n\t\treturn false;\n\t}", "public void ejecutarSql(String query) throws Exception {\n stmt.executeUpdate(query);\n }", "private void tryDbUpdate(String query) throws SQLException {\n Statement s = null;\n try {\n s = rawDataSource.getConnection().createStatement();\n s.executeUpdate(query);\n } finally {\n s.close();\n }\n }", "public void updates(String hql, Object... param) {\n\t\tthis.rsDAO.updates(hql, param) ;\n\t}", "private int execRawSqlPrivate(String sql, boolean isNative, Object params) {\r\n\t\tQuery query = createQuery(sql, null, isNative, 0, 0, params);\r\n\t\tint executeUpdate = query.executeUpdate();\r\n\t\treturn executeUpdate;\r\n\t}", "public void UpdatePlace(iconnectionpool connectionPool, String id_user, String id_place, String ip, String id_similar_place){\n try{\n Connection con=null;\n //get connection from Pool\n con=connectionPool.getConnection();\n Statement stmt=con.createStatement();\n String datesubmit=new java.text.SimpleDateFormat(\"yyyy-MM-dd-hh-mm-ss\").format(new java.util.Date());\n String sql=\"update similarplaces set id_similar_place='\"+id_similar_place+\"', dateupdate='\"+datesubmit+\"', ip_update='\"+ip+\"' where id_user='\"+id_user+\"' and id_place='\"+id_place+\"'\";\n stmt.executeUpdate(sql); \n }catch(Exception e){}\n }", "@Override\r\n\tpublic void update() throws SQLException {\n\r\n\t}", "public int update(String sql, Object... args) throws DataAccessException {\n\t\tSystem.out.println(sql + \" - \" + Arrays.toString(args));\r\n\t\treturn new PreparedStatementCallback<Integer>() {\r\n\t\t\t@Override\r\n\t\t\tprotected Integer doInPreparedStatement(PreparedStatement ps) throws SQLException {\r\n\t\t\t\tint ret = ps.executeUpdate();\r\n\t\t\t\treturn ret;\r\n\t\t\t}\r\n\t\t}.execute(txManager, sql, args);\r\n\t}", "@Test\n public void update2()\n {\n int zzz = getJdbcTemplate().update(\"UPDATE account SET NAME =?,money=money-? WHERE id =?\", \"ros\", \"100\", 2);\n System.out.println(zzz);\n }", "private int sendUpdate(String sqlQuery) {\n int result = 0;\n getRemoteConnection();\n try {\n statement = conn.createStatement();{\n // Execute a SELECT SQL statement.\n result = statement.executeUpdate(sqlQuery);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return result;\n }", "public void executeUpdateQuery(String hql) throws RepositoryException {\n\t\tDatanucleusCRUDUtils.executeUpdateQuery(hql);\n\t}", "public void executeUpdateQuery(String hql, Map params) throws RepositoryException {\n\t\tDatanucleusCRUDUtils.executeUpdateQuery(hql, params); \n\t\tparams.clear();\n\t}", "public void updateRawSQL(String sql) throws SQLException {\n // Directly inserting from the Raw\n mysql.update(sql);\n }", "public void updateSQL(String SQL) {\r\n\t\ttry { \r\n\t statement.executeUpdate(SQL); \r\n\t }\r\n\t\tcatch (Exception e){\r\n\t\t e.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "public static Boolean executeManipulationQuery(String sql, Object... params) {\n Update update = new Update(sql, result -> {\n }, params);\n getInstance().add(update);\n\n while (update.getResult() == null) {\n getInstance().executeThread();\n }\n return update.getResult();\n }", "public int Appbr(Long broker_id)throws SQLException {\nint i=DbConnect.getStatement().executeUpdate(\"update login set status='approved' where login_id=\"+broker_id+\"\");\r\n\treturn i;\r\n}", "@Override\n\tpublic void update(String sql, Object... parameters) {\n\t\tConnection conn = null;\n\t PreparedStatement stm = null;\n\t try {\n\t\t\tconn = getConnection();\n\t\t conn.setAutoCommit(false);\n\t\t stm = conn.prepareStatement(sql);\n\t\t setParameter(stm, parameters);\n\t\t stm.executeUpdate();\n\t\t conn.commit();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO: handle exception\n\t\t\ttry {\n\t\t\t\tconn.rollback();\n\t\t\t} catch (SQLException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t e.printStackTrace();\n\t\t \n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (conn != null) {\n\t\t\t\t\tconn.close();\n\t\t\t\t}\n\n\t\t\t\tif (stm != null) {\n\t\t\t\t\tstm.close();\n\t\t\t\t}\n\n\t\t\t} catch (Exception e2) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\te2.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@Override\n public int executeUpdate(String sql, int columnIndexes[]) \n throws SQLException {\n return 0;\n }", "@Override\r\n\tpublic void updateForHql(String hql, Object[] params) throws Exception {\n\r\n\t\ttry {\r\n\t\t\tQuery q = this.getcurrentSession().createQuery(hql);\r\n\t\t\tif (params != null && params.length > 0) {\r\n\t\t\t\tfor (int i = 0; i < params.length; i++) {\r\n\t\t\t\t\tq.setParameter(i, params[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tq.executeUpdate();\r\n\t\t} catch (DataAccessException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tthrow new Exception(\"update error for updateForHql\", e);\r\n\t\t}\r\n\t}", "public void execSql(String sql) {\n\t\tjdbcTemplate.execute(sql);\n\t}", "public static void main(String[] args) throws SQLException {\n\n\t\t\n\t\t\n\t\tMySQL mySQL=new MySQL();\n\t\tmySQL.search(\"1234\");\n\t\ttry {\n\t\t\t\n\t\t\tmySQL.update(\"1600300830\", \"2\", \"100\");\n\t\t} catch (SQLException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tConnection con = null;\r\n\t\ttry {\r\n\t\t\tcon = DBUtil.getCon();\r\n\t\t\tcon.setAutoCommit(false);\r\n\t\t\tString update1 = \"Update emp1 set emp_name='KaushalGarg' where emp_id=111\";\r\n\r\n\t\t\tStatement st = con.createStatement();\r\n\t\t\tst.addBatch(update1);\r\n\t\t\tint[] a = st.executeBatch();\r\n\t\t\tfor (int i = 0; i < a.length; i++)\r\n\t\t\t\tSystem.out.println(a[i]);\r\n\t\t\tcon.commit();\r\n\t\t\tSystem.out.println(\"Updated Successfully\");\r\n\r\n\t\t} catch (SQLException e) {\r\n\r\n\t\t\ttry {\r\n\t\t\t\tcon.rollback();\r\n\t\t\t} catch (SQLException e1) {\r\n\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "protected void execSQL(String sql) throws Exception {\n\t\tPreparedStatement statement = null;\n\t\ttry {\n\t\t\tstatement = connection.prepareStatement(sql);\n\t\t\tstatement.execute();\n\t\t} catch (Exception e) {\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tPersistenceUtils.closeStatement(statement);\n\t\t}\n\n\t}", "public void update(String sql) {\n\t\tjdbcTemplate.update(sql);\n\t}", "public int Editcomp(Long comp_id, String compname, String address, String city,\r\n\t\tString state, Long offno, Long faxno, String website, String e_mail) throws SQLException {\nint i =DbConnect.getStatement().executeUpdate(\"update company set address='\"+address+\"',city='\"+city+\"',state='\"+state+\"',offno=\"+offno+\",faxno=\"+faxno+\",website='\"+website+\"',email='\"+e_mail+\"'where comp_id=\"+comp_id+\" \");\r\n\treturn i;\r\n}", "public int updateDb (final String sql) throws DataAccessException;", "private void executeUpdate(final String sqlStatement, final String keyValue, final String eiffelevent)\n throws ConnectException, SQLException {\n try (PreparedStatement preparedStatement = prepareStatmentForResourceBlock(sqlStatement)) {\n preparedStatement.setString(1, eiffelevent);\n preparedStatement.setString(2, keyValue);\n int updateCount = preparedStatement.executeUpdate();\n\n if (updateCount == 0) {\n throw new SQLException(\"No changes was saved in the database.\");\n }\n\n } catch (SQLException e) {\n LOGGER.error(\"Error when trying to add value into database: {}\\n{}\", e.getMessage(), e);\n throw e;\n }\n }", "public void executeQuery_Other(String query) {\n\n \n Connection con = DBconnect.connectdb();\n Statement st;\n\n try {\n st = con.createStatement();\n st.executeUpdate(query);\n\n \n } catch (Exception e) {\n //JOptionPane.showMessageDialog(null, e);\n\n }\n\n }", "public void doUpdate(T objectToUpdate) throws SQLException;", "@Override\n public int executeUpdate(String sql, String columnNames[]) \n throws SQLException {\n return 0;\n }", "public void exec(String sql) {\r\n try (Statement stmt = connection.createStatement()) {\r\n stmt.execute(sql);\r\n } catch (SQLException e) {\r\n throw new DbException(connectionString + \"\\nError executing \" + sql, e);\r\n }\r\n }", "public static int executeUpdate( Connection conn, String sqlString )\n throws SQLException {\n Statement stmt = conn.createStatement();\n int res = stmt.executeUpdate( sqlString );\n return res;\n }", "public int update(String theQuery) throws SQLException {\r\n Statement st = this.connector.createStatement();\r\n return st.executeUpdate(theQuery);\r\n }", "public int queryUpdate(String query) throws SQLException {\n\t \t\t// Création de l'objet gérant les requêtes\n\t \t\tstatement = cnx.createStatement();\n\t \t\t\t\t\n\t \t\t// Exécution d'une requête d'écriture\n\t \t\tint statut = statement.executeUpdate(query);\n\t \t\t\n\t \t\treturn statut;\n\t \t}", "public static int executeUpdate(ISQLConnection con, \n String SQL,\n boolean writeSQL) throws SQLException {\n Statement stmt = null;\n int result = 0;\n try {\n stmt = con.createStatement();\n if (writeSQL) {\n ScriptWriter.write(SQL);\n }\n if (log.isDebugEnabled()) {\n // i18n[DBUtil.info.executeupdate=executeupdate: Running SQL:\\n '{0}']\n String msg = \n s_stringMgr.getString(\"DBUtil.info.executeupdate\", SQL);\n log.debug(msg);\n }\n lastStatement = SQL;\n result = stmt.executeUpdate(SQL);\n } finally {\n SQLUtilities.closeStatement(stmt);\n }\n return result;\n }", "private <T> void executeUpdate(T value, Object key, String query) {\r\n\t\tlogger.entering(CLASSNAME, \"executeUpdate\", new Object[] {key, value, query});\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement statement = null;\r\n\t\tByteArrayOutputStream baos = null;\r\n\t\tObjectOutputStream oout = null;\r\n\t\tbyte[] b;\r\n\t\ttry {\r\n\t\t\tconn = getConnection();\r\n\t\t\tstatement = conn.prepareStatement(query);\r\n\t\t\tbaos = new ByteArrayOutputStream();\r\n\t\t\toout = new ObjectOutputStream(baos);\r\n\t\t\toout.writeObject(value);\r\n\r\n\t\t\tb = baos.toByteArray();\r\n\r\n\t\t\tstatement.setBytes(1, b);\r\n\t\t\tstatement.setObject(2, key);\r\n\t\t\tstatement.executeUpdate();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new PersistenceException(e);\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new PersistenceException(e);\r\n\t\t} finally {\r\n\t\t\tif (baos != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tbaos.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tthrow new PersistenceException(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (oout != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\toout.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tthrow new PersistenceException(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcleanupConnection(conn, null, statement);\r\n\t\t}\r\n\t\tlogger.exiting(CLASSNAME, \"executeUpdate\");\r\n\t}", "public void update(T instance) throws Exception {\n String primaryKeyValue=ReflectionUtils.getFieldValue(instance,instance.getPrimaryKeyName());\n if(null==primaryKeyValue){\n throw new Exception(\"This is no primary key value\");\n }\n\n initDBTableMeta(instance);\n String setClause=buildSQLKeyValueMap(instance,\",\");\n String whereClause =instance.getPrimaryKeyName()+\"=\"+primaryKeyValue;\n String sql = UPDATE+tableName+SET+setClause+WHERE+whereClause;\n logger.info(\"usedSql={}\", sql);\n\n }", "public int executeUpdate(final String stmt) throws SQLException {\n return connection.createStatement().executeUpdate(stmt);\n }", "protected void update() throws SQLException {\n\t\tProperties whereClause = new Properties();\n\t\twhereClause.setProperty(\"1\", \"1\");\n\t\tupdatePersistentState(getSchema(), persistentState, whereClause);\n\t}", "public void executeUpdate(String query) throws SQLException{\n Connection con = this.getConnection();\n\n if (con == null) {\n throw new SQLException(\"Can't get database connection\");\n }\n con.setAutoCommit(false);\n\n Statement statement = con.createStatement();\n statement.executeUpdate(query);\n statement.close();\n con.commit();\n con.close();\n }", "@Override\n public int executeUpdate(String sql) throws SQLException {\n throw new SQLFeatureNotSupportedException();\n }", "public static <T> T update(T object)\n {\n return SqlClosure.sqlExecute(connection -> update(connection, object));\n }", "@Test @Ignore\n\tpublic void testSQLUpdate() {\n\t\tlog.info(\"*** testSQLUpdate ***\");\n\t}", "@Override\n\tpublic String updateStatement() throws Exception {\n\t\treturn null;\n\t}", "@Override\n public RespResult<List<SqlExecRespDto>> batchExecuteUpdate(String username, List<SqlExecReqDto> updates) {\n return null;\n }", "public void testBatchUpdate() {\n template.getJdbcOperations().batchUpdate(new String[]{websource.method2()});\n\n //Test SimpleJdbcOperations execute\n template.getJdbcOperations().execute(websource.method2());\n }", "@Override\n public void doUpdate(FasciaOrariaBean bean) throws SQLException {\n Connection con = null;\n PreparedStatement statement = null;\n String sql = \"UPDATE fasciaoraria SET fascia=? WHERE id=?\";\n try {\n con = DriverManagerConnectionPool.getConnection();\n statement = con.prepareStatement(sql);\n statement.setString(1, bean.getFascia());\n statement.setInt(2, bean.getId());\n System.out.println(\"doUpdate=\" + statement);\n statement.executeUpdate();\n con.commit();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n\n try {\n\n statement.close();\n DriverManagerConnectionPool.releaseConnection(con);\n\n } catch (SQLException e) {\n\n e.printStackTrace();\n }\n }\n }" ]
[ "0.7850035", "0.76661676", "0.76499844", "0.75152993", "0.74357885", "0.7372024", "0.72385687", "0.71707636", "0.7055584", "0.70029366", "0.69716483", "0.6929302", "0.69183743", "0.688047", "0.6845198", "0.6828947", "0.68249804", "0.6789596", "0.678834", "0.67872924", "0.67839235", "0.67823213", "0.6747491", "0.6731159", "0.6705927", "0.6701994", "0.6699048", "0.6696199", "0.66419154", "0.6601268", "0.6600961", "0.6578805", "0.65736973", "0.6545138", "0.65357953", "0.65318453", "0.6523477", "0.6505596", "0.6492921", "0.64884615", "0.6464047", "0.6463452", "0.6459619", "0.6441223", "0.64360523", "0.64219874", "0.64077914", "0.64074004", "0.63826615", "0.63689464", "0.6367904", "0.6366482", "0.6354028", "0.6353009", "0.6344941", "0.63443214", "0.6305951", "0.6302594", "0.6301768", "0.6285057", "0.6265499", "0.6261584", "0.62608653", "0.62490314", "0.6246613", "0.6246434", "0.6220378", "0.6211293", "0.6196352", "0.6192026", "0.61908025", "0.6169109", "0.6163189", "0.61608386", "0.6150475", "0.61494213", "0.6145527", "0.6143225", "0.6142667", "0.61379534", "0.6122699", "0.611958", "0.61149925", "0.61146945", "0.61132807", "0.61091155", "0.6107764", "0.60983133", "0.60978615", "0.6093189", "0.6092227", "0.6089211", "0.60866696", "0.6081768", "0.6058619", "0.60536087", "0.6051509", "0.6044069", "0.60437936", "0.60436547" ]
0.6723893
24
This is the constructor for the Road class and takes the input of integers. They determine the width, height, Top Left X Coordinate, and Top Left Y Coordinate
public Road(int x, int y, int width, int height) { screenWidth = width; screenHeight = height; xTopLeft = x; yTopLeft = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Rectangle(int length, int width) {\n }", "public RoadRagePanel(final int theWidth, final int theHeight) {\n super();\n\n myVehicles = new ArrayList<Vehicle>();\n myGrid = new Terrain[0][0];\n setLightColor(Light.GREEN);\n setPreferredSize(new Dimension(theWidth * SQUARE_SIZE,\n theHeight * SQUARE_SIZE));\n setBackground(Color.GREEN);\n setFont(FONT);\n }", "public Road(String name) {\n this.name = name;\n this.points = new ArrayList<>();\n }", "public Road(Place A, Place B)\n\t{\n\t\tEmpire roadEmpire = Empire.getInstance();\n\t\t\n\t\tint intXA, intYA, intXB, intYB;\n\t\tdouble xA, yA, xB, yB;\n\t\t\n\t\tintXA = A.getXPosition();\n\t\tintYA = A.getYPosition();\n\t\tintXB = B.getXPosition();\n\t\tintYB = B.getYPosition();\n\t\t\n\t\txA = (double) intXA;\n\t\tyA = (double) intYA;\n\t\txB = (double) intXB;\n\t\tyB = (double) intYB;\n\t\t\n\t\taPoint = new Point((int) xA, (int) yA);\n\t\tbPoint = new Point((int) xB, (int) yB);\n\t\t\n\t\taName = A.getName();\n\t\tbName = B.getName();\n\t\t\n\t\tlength = Math.sqrt((((xA-xB)*(xA-xB) + (yA - yB)*(yA - yB))));\n\t\tkFactor = (yB - yA)/(xB-xA);\n\t\t\n\t\troad.add(new Point(intXA, intYA));\n\t\t\n\t\tString keyA = String.valueOf(intXA) + \"-\" + String.valueOf(intYA);\n\t\tif(!roadEmpire.POINTS.containsKey(keyA));\n\t\t{\n\t\t\tMapPoint m = new MapPoint(intXA,intYA);\n\t\t\troadEmpire.POINTS.put(keyA, m);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tif((xA == xB) && (yA == yB))\n\t\t{\n\t\t\tdirection = Direction.NONE;\n\t\t}\n\t\telse if(xA == xB)\n\t\t{\n\t\t\tif(yB > yA)\n\t\t\t{\n\t\t\t\tdirection = Direction.SOUTH;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdirection = Direction.NORTH;\n\t\t\t}\t\t\n\t\t\t\n\t\t\tfor (int i=1; i<(int)length; i++)\n\t\t\t{\n\t\t\t\tint x = (int) xA;\n\t\t\t\tint y;\n\t\t\t\t\n\t\t\t\tif(yB > yA)\n\t\t\t\t{\n\t\t\t\t\ty = ((int)yA) + i;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ty = ((int)yA) - i;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\troad.add(new Point(x,y));\n\t\t\t\t\n\t\t\t\tString key = String.valueOf(x) + \"-\" + String.valueOf(y);\n\t\t\t\tif(!roadEmpire.POINTS.containsKey(key));\n\t\t\t\t{\n\t\t\t\t\tMapPoint m = new MapPoint(x,y);\n\t\t\t\t\troadEmpire.POINTS.put(key, m);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(yA == yB)\n\t\t{\n\t\t\tif(xB > xA)\n\t\t\t{\n\t\t\t\tdirection = Direction.EAST;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdirection = Direction.WEST;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i=1; i<(int)length; i++)\n\t\t\t{\n\t\t\t\tint x;\n\t\t\t\tint y = (int)yA;\n\t\t\t\t\n\t\t\t\tif(xB > xA)\n\t\t\t\t{\n\t\t\t\t\tx = ((int)xA) + i;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tx = ((int)xA) - i;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\troad.add(new Point(x,y));\n\t\t\t\t\n\t\t\t\tString key = String.valueOf(x) + \"-\" + String.valueOf(y);\n\t\t\t\tif(!roadEmpire.POINTS.containsKey(key));\n\t\t\t\t{\n\t\t\t\t\tMapPoint m = new MapPoint(x,y);\n\t\t\t\t\troadEmpire.POINTS.put(key, m);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\tif((xB > xA) && (yB > yA))\n\t\t\t{\n\t\t\t\tdirection = Direction.SOUTH_EAST;\n\t\t\t}\n\t\t\telse if((xB > xA) && (yB < yA))\n\t\t\t{\t\n\t\t\t\tdirection = Direction.NORTH_EAST;\n\t\t\t}\n\t\t\telse if((xB < xA) && (yB > yA))\n\t\t\t{\n\t\t\t\tdirection = Direction.SOUTH_WEST;\n\t\t\t}\n\t\t\telse if((xB < xA) && (yB < yA))\n\t\t\t{\n\t\t\t\tdirection = Direction.NORTH_WEST;\n\t\t\t}\n\t\t\t\t\n\t\t\tfor (int i=1; i<(int)length; i++)\n\t\t\t{\n\t\t\t\tint x;\n\t\t\t\tint y;\n\t\t\t\t\n\t\t\t\tdouble c = (double) i;\n\t\t\t\tdouble a = c/(Math.sqrt((kFactor*kFactor + 1.0))); \n\t\t\t\tdouble b = Math.abs(a*kFactor);\n\t\t\t\t\n\t\t\t\tif((xB > xA) && (yB > yA))\n\t\t\t\t{\n\t\t\t\t\tx = (int)(xA + a);\n\t\t\t\t\ty = (int)(yA + b);\n\t\t\t\t}\n\t\t\t\telse if((xB > xA) && (yB < yA))\n\t\t\t\t{\n\t\t\t\t\tx = (int)(xA + a);\n\t\t\t\t\ty = (int)(yA - b);\n\t\t\t\t}\n\t\t\t\telse if((xB < xA) && (yB > yA))\n\t\t\t\t{\n\t\t\t\t\tx = (int)(xA - a);\n\t\t\t\t\ty = (int)(yA + b);\n\t\t\t\t}\n\t\t\t\telse if((xB < xA) && (yB < yA))\n\t\t\t\t{\n\t\t\t\t\tx = (int)(xA - a);\n\t\t\t\t\ty = (int)(yA - b);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tx = 100;\n\t\t\t\t\ty = 100;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\troad.add(new Point (x,y));\n\t\t\t\t\n\t\t\t\tString key = String.valueOf(x) + \"-\" + String.valueOf(y);\n\t\t\t\tif(!roadEmpire.POINTS.containsKey(key));\n\t\t\t\t{\n\t\t\t\t\tMapPoint m = new MapPoint(x,y);\n\t\t\t\t\troadEmpire.POINTS.put(key, m);\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}\n\t\t}\n\t\t\n\t\troad.add(new Point(intXB, intYB));\n\t\t\n\t\tString keyB = String.valueOf(intXB) + \"-\" + String.valueOf(intYB);\n\t\tif(!roadEmpire.POINTS.containsKey(keyB));\n\t\t{\n\t\t\tMapPoint m = new MapPoint(intXB,intYB);\n\t\t\troadEmpire.POINTS.put(keyB, m);\n\t\t}\n\t}", "public Bounds(double x, double y, double width, double height) {\n\t\tsuper();\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}", "private Road()\n\t{\n\t\t\n\t}", "public Rectangle(int length, int width)\n {\n this.length = length;\n this.width = width;\n\n }", "public Rectangle(String id, double height, double width) {\n\t\tsuper(id);\n\t\t\n\t\t// Initialized here for local use\n\t\tthis.height = height;\n\t\tthis.width = width;\n\t\t\n\t\t// Adds these variables to the array \"sideLengths\" \n\t\tthis.sideLengths.add(height);\n\t\tthis.sideLengths.add(height);\n\t\tthis.sideLengths.add(width);\n\t\tthis.sideLengths.add(width);\n\t}", "Rectangle(int width, int height){\n area = width * height;\n }", "public GameBoard (int height, int width)\n {\n mHeight = height;\n mWidth = width;\n }", "public Rectangle() {\n this(50, 40);\n }", "public Property(int xLength, int yWidth, int xLeft, int yTop) {\n this(xLength, yWidth, xLeft, yTop, DEFAULT_REGNUM);\n }", "Rectangle(int l, int w)\n {\n\tlength = l;\n\twidth = w;\n }", "public HorizontalCoords() {\n }", "public Rectangle(double width, double height) {\r\n this.width = width;\r\n this.height = height;\r\n }", "public Coordinates(int x, int y){\n this.x = x;\n this.y = y;\n }", "public RoadSign(int x, int y, String imageFileName) {\n super(x, y, imageFileName);\n }", "public RailRoad(String tileID, int boardIndex) {\n this.tileID = tileID;\n this.boardIndex = boardIndex;\n this.owner = null;\n this.cost = 200;\n this.group_color = \"rr\";\n this.group_number = 4;\n this.mortgaged = false;\n }", "@Test\n public void constructor(){\n /**Positive tests*/\n Road road = new Road(cityA, cityB, 4);\n assertEquals(road.getFrom(), cityA);\n assertEquals(road.getTo(), cityB);\n assertEquals(road.getLength(), 4);\n }", "public Coordinates(int x, int y)\r\n {\r\n xCoord = x;\r\n yCoord = y;\r\n }", "public RectangleShape(int xCoord, int yCoord, int widthOfRect, int heightOfRect)\n {\n System.out.println(\"setting x to: \"+ xCoord+\" & setting y to: \"+ yCoord);\n x = xCoord;\n y = yCoord;\n width = widthOfRect;\n height = heightOfRect;\n }", "public Stone(int x, int y, int width, int height) {\n\t\tsuper(x, y, width, height);\n\t\t\n\t}", "public Rectangle(Point upperLeft, double width, double height) {\n this.upperLeft = upperLeft;\n this.width = width;\n this.height = height;\n }", "public wall() { //default constructor makes a 10x10 square extending right and down from the pixel located at 5,5\r\n x = 5;\r\n y = 5;\r\n height = 10;\r\n width = 10;\r\n }", "public Rectangle(Point center, int length){\n super(4);\n if(length <= 0)\n throw new IllegalArgumentException(\"Length cannot be negative or zero.\");\n width = length; \n height = length; \n int centerX = center.getX(); //stores the x of the center point\n int centerY = center.getY(); //stores the y of the center point\n int distanceFromCenter = length / 2; //stores the distance from the center point each line will be\n topLine = new Line(centerX - distanceFromCenter, centerY - distanceFromCenter, centerX + distanceFromCenter, centerY - distanceFromCenter);\n rightLine = new Line(centerX + distanceFromCenter, centerY - distanceFromCenter, centerX + distanceFromCenter, centerY + distanceFromCenter);\n bottomLine = new Line(centerX + distanceFromCenter, centerY + distanceFromCenter, centerX - distanceFromCenter, centerY + distanceFromCenter);\n leftLine = new Line(centerX - distanceFromCenter, centerY + distanceFromCenter, centerX - distanceFromCenter, centerY - distanceFromCenter);\n referencePoint = topLine.getFirstPoint();\n }", "public RectangleObject(double width, double height) {\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t}", "TwoDShape5(double x) {\n width = height = x;\n }", "public Railroad(int location, int[] coord) {\n super.setValue(200);\n super.setCoord(coord);\n super.setLocation(location);\n }", "Rectangle()\n {\n this(1.0,1.0);\n }", "public Snake(int width, int height) {\n\t\th = new Segment(null); // head segment, handle on null\n\t\t// Place the head at the center of the world\n\t\th.x=width/2;\n\t\th.y=height/2;\n\t\t\n\t\ttail = new Segment(h); // second body segment, handle on head\n\t\ttail.place(); // place it behind the head\n\t\t\n\t\tparts=2; // two parts to start with\n\t}", "public RoadTest()\n {\n }", "Rectangle(double newWidth, double newHeight){\n height = newHeight;\n width = newWidth;\n }", "public Place(int x, int y){\n this.x=x;\n this.y=y;\n isFull=false;\n }", "public MapPath(int w, int h)\n\t{\n\t\t//Dependant on constants outlined above, divide screen up\n\t\tPIXEL_WIDTH = w/LAND_X_COUNT;\n\t\tPIXEL_HEIGHT = h/LAND_Y_COUNT;\n\t\tpathCo = new int[LAND_X_COUNT][LAND_Y_COUNT];\n\t\t\n\t\tfor (int x = 0; x < LAND_X_COUNT; x++) { //initialise screen to 0 (free to put towers anywhere at this point)\n\t\t\tfor (int y = 0; y < LAND_Y_COUNT; y++) {\n\t\t\t\tpathCo[x][y] = 0;\n\t\t\t}\n\t\t}\n\t}", "Polymorph(int x, int y, int height, int width){\n \t this.x = x;\n \t this.y = y;\n \t this.height = height;\n \t this.width = width;\n }", "public Rectangle() {\n x = 0;\n y = 0;\n width = 0;\n height = 0;\n }", "public Rectangle(double x, double y, double width, double height) {\n super(x, y, width, height);\n }", "public CustomRectangle(int x1, int y1, int x2, int y2) {\n this.x1 = Integer.toString(x1);\n this.y1 = Integer.toString(y1);\n this.x2 = Integer.toString(x2);\n this.y2 = Integer.toString(y2);\n }", "public Road(String name, Junction from, Junction to) {\n this.name = name;\n this.from = from;\n this.to = to;\n }", "public Rectangle(Integer width, Integer height) {\n super(300, 100, \"red\",null);\n this.width = width;\n this.height = height;\n control = new Control(this);\n }", "public Rectangle(float w, float h, float x, float y, float r, float g, float b, String n, int s, int e) {\n super(x, y, r, g, b, n, s, e);\n this.width = w;\n this.height = h;\n }", "public Size(double width, double height)\r\n {\r\n this.width = width;\r\n this.height = height;\r\n }", "Rectangle(int width, int height){\n area = width * height;\n System.out.println(\"Area of a rectangle = \" +area);\n }", "public Grid(int[] intBoard)\n\t{\n\t\tfor (int x =0;x<=8;x++)\n\t\t\tthis.grid[x]= intBoard[x];\n\t}", "public Viewport4i( int leftX, int topY, int rightX, int bottomY) {\r\n\r\n if (Integer.compare(leftX, rightX) < 0) {\r\n _xLeft = leftX;\r\n _xRight = rightX;\r\n } else {\r\n _xRight = leftX;\r\n _xLeft = rightX;\r\n }\r\n\r\n if (Integer.compare(topY, bottomY) < 0) {\r\n _yTop = topY;\r\n _yBottom = bottomY;\r\n } else {\r\n _yBottom = topY;\r\n _yTop = bottomY;\r\n }\r\n\r\n }", "public Shape(int width, int height) {\r\n\r\n\t\t// Shape width and height should not be greater than the sheet width and height\r\n\t\tif (width > Sheet.SHEET_WIDTH || height > Sheet.SHEET_HEIGHT) {\r\n\t\t\tthrow new IllegalArgumentException(\"Shape width or height is not valid\");\r\n\t\t}\r\n\r\n\t\tthis.sWidth = width;\r\n\t\tthis.sHeight = height;\r\n\t}", "MyRectangle2D(double x, double y, double width, double height) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.height = height;\r\n\t\tthis.width = width;\r\n\t}", "public RoadSign() {\n super(0, 0, \"roadsign_speed_50.png\");\n }", "public Board(int boardHeight, int boardWidth) {\n this.boardWidth = boardHeight+1;\n this.boardHeight = boardWidth+1;\n this.board = new char[this.boardHeight][this.boardWidth];\n this.numShips = 0;\n boardInit();\n }", "public Road(Town source, Town destination, int weight, String name) {\r\n\t\tthis.source = source;\r\n\t\tthis.destination = destination;\r\n\t\tthis.vertices = new HashSet<Town>();\r\n\t\tvertices.add(source);\r\n\t\tvertices.add(destination);\r\n\t\t\r\n\t\tthis.weight = weight;\r\n\t\tthis.name = name;\r\n\t\t\r\n\t}", "public Road(Village start, Village end, int cost) {\n\t\tleave = start;\n\t\tarrive = end;\n\t\ttoll = cost;\n\t}", "Rectangle(){\n height = 1;\n width = 1;\n }", "public GameGridBuilder(int gridWidth, int gridHeight) {\n this.gridWidth = gridWidth;\n this.gridHeight = gridHeight;\n }", "public Coordinate(int x,int y)\n {\n this.x = x;\n this.y = y;\n }", "public Rectangle(int x, int y, int w, int h) {\n this.x = x;\n this.y = y;\n this.size = new Dimension(w, h);\n }", "public Neighborhood(int width, int height) {\n if (width <= 0 || height <= 0) {\n throw new IllegalArgumentException(\n String.format(\n \"Neighborhood width and height must each be > 0. Received width=%d, height=%d\",\n width,\n height\n )\n );\n }\n this.width = width;\n this.height = height;\n this.neighborhoodArray = new int[width][height];\n }", "public RailRoad() {}", "ImageProcessor(int width, int height) {\n this.width = width;\n this.height = height;\n centroids = new LinkedList<>();\n centroids.add(0);\n foregroundMovement = new LinkedList<>();\n foregroundMovement.add(0);\n foregroundMovement.add(0);\n tempForegroundMovement = new LinkedList<>();\n tempForegroundMovement.add(0);\n tempForegroundMovement.add(0);\n boxMovement = new LinkedList<>();\n boxMovement.add(0);\n boxMovement.add(0);\n\n // Used to communicate with game engine\n change = new PropertyChangeSupport(this);\n }", "public City(int width, int height) {\r\n\t\tthis.size_w = width;\r\n\t\tthis.size_h = height;\r\n\t\tcity_squares = new Gridpanel[getSize_h()][getSize_w()];\r\n\t}", "Rectangle() {\r\n\t\tlength = 1.0;\r\n\t\twidth = 1.0;\r\n\t}", "public Rectangle(int recLength, int recWidth) {\n super(recLength, recWidth);\n System.out.println(\"\\nA rectangle is being created!\\n\");\n }", "@Override\r\n\tpublic void buildRoad() {\n\t\t\r\n\t}", "public Coordinate() { row = col = -1; }", "public UISnake(int startW, int startH) {\n\t\tsuper(startW, startH);\n\t\thead = new HeadTile(startW, startH, direction, this);\n\t\tlastTile = new BodyTile(800, 800, this);\n\t}", "public Road(Town source, Town destination, String name) {\r\n\t\tthis.source = source;\r\n\t\tthis.destination = destination;\r\n\t\tthis.vertices = new HashSet<Town>();\r\n\t\tvertices.add(source);\r\n\t\tvertices.add(destination);\r\n\t\t\r\n\t\tthis.name = name;\r\n\t}", "public Rectangle() {\n\t\twidth = 1;\n\t\theight = 1;\n\t}", "Road(boolean h, MP m){\n\t\t time = m.getLifeTime();\n\t\t horizontal = h; \n\t\t _MP = m;\n\t\t endPosition = _MP.createRandom(_MP.getRoadLengthMin(), _MP.getRoadLengthMax());\n\t }", "public Rectangle(int w, int h) {\n\t\tthis.width = w;\n\t\tthis.height = h;\n\t}", "public Coordinates(int x, int y) {\n\t\t\n\t\txPosition = x;\t\t\t// Assigns the x integer\n\t\tyPosition = y;\t\t\t// Assigns the y integer\n\t}", "public AStar2D(int width, int height) {\n super( new Grid2D(width, height) );\n }", "public Obstacle(int x, int y, int length, String direction)\n {\n super(x, y, length, direction);\n updateImages();\n }", "public Ground(int x, int y)\n {\n // initialise instance variables\n xleft= x;\n ybottom= y;\n \n }", "public Rectangle() {\n\t\tthis.corner = new Point();\n\t\tthis.size = new Point();\n\t}", "public Rectangle() {\n super();\n properties = new HashMap<String, Double>();\n properties.put(\"Width\", null);\n properties.put(\"Length\", null);\n }", "public RoadAgent(String startNode, String endNode, Point startPosition, Point endPosition, String roadBelongingType)\r\n\t{\r\n\t\tthis.startNode = startNode;\r\n\t\tthis.endNode = endNode;\r\n\t\tthis.startPosition = startPosition;\r\n\t\tthis.endPosition = endPosition;\r\n\t\tthis.roadBelongingType = roadBelongingType;\r\n\t}", "public Grass(int x, int y, int w, int h)\n {\n Xx = x;\n Yy = y;\n Ww = w;\n Hh = h;\n }", "public Rectangle(Point point1, Point point2){\n super(4);\n if(point1.getX() == point2.getX() || point1.getY() == point2.getY())\n throw new IllegalArgumentException(\"Input points are not opposite to each other.\");\n int point1X = point1.getX(); //stores the x of the first point\n int point1Y = point1.getY(); //stores the y of the first point\n int point2X = point2.getX(); //stores the x of the second point\n int point2Y = point2.getY(); //stores the y of the second point\n \n if(point1X < point2X){\n width = point2X - point1X;\n if(point1Y < point2Y){\n height = point2Y - point1Y;\n topLine = new Line(point1X, point1Y, point2X, point1Y);\n rightLine = new Line(point2X, point1Y, point2X, point2Y);\n bottomLine = new Line(point2X, point2Y, point1X, point2Y);\n leftLine = new Line(point1X, point2Y, point1X, point1Y);\n }\n if(point1Y > point2Y){\n height = point1Y - point2Y;\n topLine = new Line(point1X, point2Y, point2X, point2Y);\n rightLine = new Line(point2X, point2Y, point2X, point1Y);\n bottomLine = new Line(point2X, point1Y, point1X, point1Y);\n leftLine = new Line(point1X, point1Y, point1X, point2Y);\n }\n }\n if(point1X > point2X){\n width = point1X - point2X;\n if(point1Y > point2Y){\n height = point1Y - point2Y;\n bottomLine = new Line(point1X, point1Y, point2X, point1Y);\n leftLine = new Line(point2X, point1Y, point2X, point2Y);\n topLine = new Line(point2X, point2Y, point1X, point2Y);\n rightLine = new Line(point1X, point2Y, point1X, point1Y);\n }\n if(point1Y < point2Y){\n height = point2Y - point1Y;\n leftLine = new Line(point2X, point2Y, point2X, point1Y);\n topLine = new Line(point2X, point1Y, point1X, point1Y);\n rightLine = new Line(point1X, point1Y, point1X, point2Y);\n bottomLine = new Line(point1X, point2Y, point2X, point2Y);\n }\n }\n referencePoint = topLine.getFirstPoint();\n }", "public House(int length, int width, int lotLength, int lotWidth) {\r\n super(length, width, lotLength, lotWidth);\r\n }", "public Rectangle() {\n\t\tthis.width = 1;\n\t\tthis.hight = 1;\n\t\tcounter++;\n\t}", "public CellularAutomaton(int width, int height) {\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\tcellMatrix = new int[width][height];\n\t}", "public Paper(double _height, double _width)\n {\n // initialise instance variables\n height = _height;\n width = _width;\n }", "public Origin(int north, int south, int east, int west){\n this.north = north;\n this.south = south;\n this.east = east;\n this.west = west;\n }", "public Worker(int x, int y, int size) {\n super(x, y, size);\n// this.x = x;\n// this.y = y;\n// this.size = size;\n }", "public void makeRoads()\r\n\t{\r\n\t\tfor(int i=0; i<roads.length; i++)\r\n\t\t\troads[i] = new Road(i*SCREEN_HEIGHT/20,SCREEN_WIDTH,SCREEN_HEIGHT/20-10);\r\n\t}", "public Runway(double width, double length) {\n this.width = width;\n this.length = length;\n }", "public BoundingBox(int x0, int y0, int width, int height) {\n\t\tthis(new Coord(x0, y0), width, height);\n\t}", "public Rectangle(double width, double length) {\n\t\tthis.width = width;\n\t\tthis.length = length;\n\t}", "public DrawingArea(int width, int height) {\n\t\tthis.initialize(width, height);\n\t}", "public Property(int xLength, int yWidth, int xLeft, int yTop, int regNum) {\n setXLength(xLength);\n setYWidth(yWidth);\n setXLeft(xLeft);\n setYTop(yTop);\n setRegNum(regNum);\n }", "public SquareGrid(int width, int height) {\n this.width = width;\n this.height = height;\n }", "public Shape(int x, int y, int deltaX, int deltaY, int width, int height) {\n\t\t_x = x;\n\t\t_y = y;\n\t\t_deltaX = deltaX;\n\t\t_deltaY = deltaY;\n\t\t_width = width;\n\t\t_height = height;\n\t}", "Oval(int width, int height, int x, int y){\n setWidth(width);\n setHeight(height);\n setX(x);\n setY(y);\n }", "public Road(String name, MapPoint mapPoint) {\n this.name = name;\n this.points = new ArrayList<>();\n this.mapPoint = mapPoint;\n }", "public CarrierShape(int x,int y)\n {\n super(x,y);\n }", "public void setStreets(int numx, int numy);", "public Rectangle()\n {\n length = 1;\n width = 1;\n count++;\n }", "public Location(int x, int y)\n {\n this.x = x;\n this.y = y;\n }", "public ConstRect(final double x, final double y, final double width, final double height)\r\n {\r\n this.x = (int) Math.round(x);\r\n this.y = (int) Math.round(y);\r\n this.width = (int) Math.round(width);\r\n this.height = (int) Math.round(height);\r\n }", "public BoardCell(int x, int y){\n xCor=x;\n yCor=y;\n }", "public World(int width, int height)\n {\n this(width, height, AIR_EL);\n }" ]
[ "0.61748546", "0.61718714", "0.6159714", "0.61550343", "0.6101408", "0.60995406", "0.6058896", "0.59898376", "0.5973865", "0.59715766", "0.59493476", "0.5931073", "0.5926845", "0.59024537", "0.5882405", "0.5872991", "0.586265", "0.586062", "0.5856291", "0.58058196", "0.58021086", "0.5776258", "0.5771772", "0.57696515", "0.57688105", "0.57661337", "0.57552", "0.5751906", "0.57485", "0.57120013", "0.5694871", "0.56519586", "0.5644359", "0.56412965", "0.56354254", "0.5635005", "0.563146", "0.56105435", "0.5608481", "0.5603326", "0.5601071", "0.55908877", "0.5578624", "0.557422", "0.55628496", "0.55527365", "0.5552149", "0.5549468", "0.55332315", "0.5524975", "0.55223435", "0.5521628", "0.55201757", "0.5517048", "0.5514183", "0.5491329", "0.54900366", "0.5489087", "0.54882383", "0.5488158", "0.5486251", "0.54819286", "0.5481783", "0.5470936", "0.54682505", "0.5468233", "0.5463906", "0.54630244", "0.54625624", "0.5456394", "0.5454361", "0.54539526", "0.5452502", "0.54495484", "0.544136", "0.5440846", "0.5437314", "0.5435888", "0.5425278", "0.5420324", "0.5418963", "0.54186726", "0.5414079", "0.5412554", "0.54123694", "0.54122883", "0.540353", "0.5400683", "0.5399712", "0.53931224", "0.5391258", "0.53842413", "0.5375983", "0.5373479", "0.5368313", "0.53671384", "0.5362807", "0.53590685", "0.5355898", "0.535366" ]
0.82822746
0
This method draws the Road class by establishing the values of the road and other components of it.
public void draw(Graphics2D g2) { Rectangle r1 = new Rectangle( xTopLeft, yTopLeft, screenWidth, screenHeight); Rectangle l1 = new Rectangle( xTopLeft + (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10)); Rectangle l2 = new Rectangle( xTopLeft + 3 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10)); Rectangle l3 = new Rectangle( xTopLeft + 5 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10)); Rectangle l4 = new Rectangle( xTopLeft + 7 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10)); Rectangle l5 = new Rectangle( xTopLeft + 9 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10)); Rectangle l6 = new Rectangle( xTopLeft + 11 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10)); Rectangle l7 = new Rectangle( xTopLeft + 13 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10)); Rectangle l8 = new Rectangle( xTopLeft + 15 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10)); Rectangle l9 = new Rectangle( xTopLeft + 17 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10)); g2.setColor(Color.BLACK); g2.draw(r1); g2.fill(r1); g2.setColor(Color.YELLOW); g2.draw(l1); g2.fill(l1); g2.draw(l2); g2.fill(l2); g2.draw(l3); g2.fill(l3); g2.draw(l3); g2.fill(l3); g2.draw(l4); g2.fill(l4); g2.draw(l5); g2.fill(l5); g2.draw(l6); g2.fill(l6); g2.draw(l7); g2.fill(l7); g2.draw(l8); g2.fill(l8); g2.draw(l9); g2.fill(l9); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void buildRoad() {\n\t\t\r\n\t}", "public Road(int x, int y, int width, int height)\n {\n screenWidth = width;\n screenHeight = height;\n xTopLeft = x;\n yTopLeft = y;\n }", "private void drawRoad(double xM, double yM, double xL, double yL, double xI, double yI,\n\t\t\tdouble xP, double yP, double lat1, double lon1, double lat2, double lon2, int highlight, Graphics2D g2d) {\n\t\t\t\t\t\t\n\t\tlat1 = 1-Math.abs(lat1-mapBounds[0])/yL;\n\t\tlon1 = Math.abs(lon1-mapBounds[1])/xL;\n\t\tlat2 = 1-Math.abs(lat2-mapBounds[0])/yL;\n\t\tlon2 = Math.abs(lon2-mapBounds[1])/xL;\n\t\t\n\t\tint x1 = (int) (lon1*(xM-xI*2) + xI-xP);\n\t\tint y1 = (int) (lat1*(yM-yI*2) + yI-yP);\n\t\tint x2 = (int) (lon2*(xM-xI*2) + xI-xP);\n\t\tint y2 = (int) (lat2*(yM-yI*2) + yI-yP);\n\t\t\n\t\tif(highlight == 1) {\n\t\t\tg2d.setColor(pathColor);\n\t\t\tg2d.setStroke(new BasicStroke(pathWidth));\n\t\t} else {\n\t\t\tg2d.setColor(roadColor);\n\t\t\tg2d.setStroke(new BasicStroke(roadWidth));\n\t\t}\n\t\t\n\t\tg2d.drawLine(x1, y1, x2, y2);\n\t}", "@Override\n\tpublic void roadChanged() {\n\t\tthis.from_x=this.from.getX();\n\t\tthis.from_y=this.from.getY();\n\t\tthis.to_x=this.to.getX();\n\t\tthis.to_y=this.to.getY();\n\t\tthis.getTopLevelAncestor().repaint();\n\t\tthis.repaint();\n//\t\tthis.getParent().repaint();\n\t}", "void addRoadAround(Map<RoadType, Tile> rts, Rectangle rect, Collection<Location> corners) {\r\n\t\tLocation la = Location.of(rect.x, rect.y);\r\n\t\tLocation lb = Location.of(rect.x + rect.width - 1, rect.y);\r\n\t\tLocation lc = Location.of(rect.x, rect.y - rect.height + 1);\r\n\t\tLocation ld = Location.of(rect.x + rect.width - 1, rect.y - rect.height + 1);\r\n\t\t\r\n\t\tcorners.add(la);\r\n\t\tcorners.add(lb);\r\n\t\tcorners.add(lc);\r\n\t\tcorners.add(ld);\r\n\t\t\r\n\t\trenderer.surface.buildingmap.put(la, createRoadEntity(rts.get(RoadType.RIGHT_TO_BOTTOM)));\r\n\t\trenderer.surface.buildingmap.put(lb, createRoadEntity(rts.get(RoadType.LEFT_TO_BOTTOM)));\r\n\t\trenderer.surface.buildingmap.put(lc, createRoadEntity(rts.get(RoadType.TOP_TO_RIGHT)));\r\n\t\trenderer.surface.buildingmap.put(ld, createRoadEntity(rts.get(RoadType.TOP_TO_LEFT)));\r\n\t\t// add linear segments\r\n\t\t\r\n\t\tTile ht = rts.get(RoadType.HORIZONTAL);\r\n\t\tfor (int i = rect.x + 1; i < rect.x + rect.width - 1; i++) {\r\n\t\t\trenderer.surface.buildingmap.put(Location.of(i, rect.y), createRoadEntity(ht));\r\n\t\t\trenderer.surface.buildingmap.put(Location.of(i, rect.y - rect.height + 1), createRoadEntity(ht));\r\n\t\t}\r\n\t\tTile vt = rts.get(RoadType.VERTICAL);\r\n\t\tfor (int i = rect.y - 1; i > rect.y - rect.height + 1; i--) {\r\n\t\t\trenderer.surface.buildingmap.put(Location.of(rect.x, i), createRoadEntity(vt));\r\n\t\t\trenderer.surface.buildingmap.put(Location.of(rect.x + rect.width - 1, i), createRoadEntity(vt));\r\n\t\t}\r\n\t}", "public Road(Place A, Place B)\n\t{\n\t\tEmpire roadEmpire = Empire.getInstance();\n\t\t\n\t\tint intXA, intYA, intXB, intYB;\n\t\tdouble xA, yA, xB, yB;\n\t\t\n\t\tintXA = A.getXPosition();\n\t\tintYA = A.getYPosition();\n\t\tintXB = B.getXPosition();\n\t\tintYB = B.getYPosition();\n\t\t\n\t\txA = (double) intXA;\n\t\tyA = (double) intYA;\n\t\txB = (double) intXB;\n\t\tyB = (double) intYB;\n\t\t\n\t\taPoint = new Point((int) xA, (int) yA);\n\t\tbPoint = new Point((int) xB, (int) yB);\n\t\t\n\t\taName = A.getName();\n\t\tbName = B.getName();\n\t\t\n\t\tlength = Math.sqrt((((xA-xB)*(xA-xB) + (yA - yB)*(yA - yB))));\n\t\tkFactor = (yB - yA)/(xB-xA);\n\t\t\n\t\troad.add(new Point(intXA, intYA));\n\t\t\n\t\tString keyA = String.valueOf(intXA) + \"-\" + String.valueOf(intYA);\n\t\tif(!roadEmpire.POINTS.containsKey(keyA));\n\t\t{\n\t\t\tMapPoint m = new MapPoint(intXA,intYA);\n\t\t\troadEmpire.POINTS.put(keyA, m);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tif((xA == xB) && (yA == yB))\n\t\t{\n\t\t\tdirection = Direction.NONE;\n\t\t}\n\t\telse if(xA == xB)\n\t\t{\n\t\t\tif(yB > yA)\n\t\t\t{\n\t\t\t\tdirection = Direction.SOUTH;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdirection = Direction.NORTH;\n\t\t\t}\t\t\n\t\t\t\n\t\t\tfor (int i=1; i<(int)length; i++)\n\t\t\t{\n\t\t\t\tint x = (int) xA;\n\t\t\t\tint y;\n\t\t\t\t\n\t\t\t\tif(yB > yA)\n\t\t\t\t{\n\t\t\t\t\ty = ((int)yA) + i;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ty = ((int)yA) - i;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\troad.add(new Point(x,y));\n\t\t\t\t\n\t\t\t\tString key = String.valueOf(x) + \"-\" + String.valueOf(y);\n\t\t\t\tif(!roadEmpire.POINTS.containsKey(key));\n\t\t\t\t{\n\t\t\t\t\tMapPoint m = new MapPoint(x,y);\n\t\t\t\t\troadEmpire.POINTS.put(key, m);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(yA == yB)\n\t\t{\n\t\t\tif(xB > xA)\n\t\t\t{\n\t\t\t\tdirection = Direction.EAST;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdirection = Direction.WEST;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i=1; i<(int)length; i++)\n\t\t\t{\n\t\t\t\tint x;\n\t\t\t\tint y = (int)yA;\n\t\t\t\t\n\t\t\t\tif(xB > xA)\n\t\t\t\t{\n\t\t\t\t\tx = ((int)xA) + i;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tx = ((int)xA) - i;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\troad.add(new Point(x,y));\n\t\t\t\t\n\t\t\t\tString key = String.valueOf(x) + \"-\" + String.valueOf(y);\n\t\t\t\tif(!roadEmpire.POINTS.containsKey(key));\n\t\t\t\t{\n\t\t\t\t\tMapPoint m = new MapPoint(x,y);\n\t\t\t\t\troadEmpire.POINTS.put(key, m);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\tif((xB > xA) && (yB > yA))\n\t\t\t{\n\t\t\t\tdirection = Direction.SOUTH_EAST;\n\t\t\t}\n\t\t\telse if((xB > xA) && (yB < yA))\n\t\t\t{\t\n\t\t\t\tdirection = Direction.NORTH_EAST;\n\t\t\t}\n\t\t\telse if((xB < xA) && (yB > yA))\n\t\t\t{\n\t\t\t\tdirection = Direction.SOUTH_WEST;\n\t\t\t}\n\t\t\telse if((xB < xA) && (yB < yA))\n\t\t\t{\n\t\t\t\tdirection = Direction.NORTH_WEST;\n\t\t\t}\n\t\t\t\t\n\t\t\tfor (int i=1; i<(int)length; i++)\n\t\t\t{\n\t\t\t\tint x;\n\t\t\t\tint y;\n\t\t\t\t\n\t\t\t\tdouble c = (double) i;\n\t\t\t\tdouble a = c/(Math.sqrt((kFactor*kFactor + 1.0))); \n\t\t\t\tdouble b = Math.abs(a*kFactor);\n\t\t\t\t\n\t\t\t\tif((xB > xA) && (yB > yA))\n\t\t\t\t{\n\t\t\t\t\tx = (int)(xA + a);\n\t\t\t\t\ty = (int)(yA + b);\n\t\t\t\t}\n\t\t\t\telse if((xB > xA) && (yB < yA))\n\t\t\t\t{\n\t\t\t\t\tx = (int)(xA + a);\n\t\t\t\t\ty = (int)(yA - b);\n\t\t\t\t}\n\t\t\t\telse if((xB < xA) && (yB > yA))\n\t\t\t\t{\n\t\t\t\t\tx = (int)(xA - a);\n\t\t\t\t\ty = (int)(yA + b);\n\t\t\t\t}\n\t\t\t\telse if((xB < xA) && (yB < yA))\n\t\t\t\t{\n\t\t\t\t\tx = (int)(xA - a);\n\t\t\t\t\ty = (int)(yA - b);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tx = 100;\n\t\t\t\t\ty = 100;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\troad.add(new Point (x,y));\n\t\t\t\t\n\t\t\t\tString key = String.valueOf(x) + \"-\" + String.valueOf(y);\n\t\t\t\tif(!roadEmpire.POINTS.containsKey(key));\n\t\t\t\t{\n\t\t\t\t\tMapPoint m = new MapPoint(x,y);\n\t\t\t\t\troadEmpire.POINTS.put(key, m);\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}\n\t\t}\n\t\t\n\t\troad.add(new Point(intXB, intYB));\n\t\t\n\t\tString keyB = String.valueOf(intXB) + \"-\" + String.valueOf(intYB);\n\t\tif(!roadEmpire.POINTS.containsKey(keyB));\n\t\t{\n\t\t\tMapPoint m = new MapPoint(intXB,intYB);\n\t\t\troadEmpire.POINTS.put(keyB, m);\n\t\t}\n\t}", "public void makeRoads()\r\n\t{\r\n\t\tfor(int i=0; i<roads.length; i++)\r\n\t\t\troads[i] = new Road(i*SCREEN_HEIGHT/20,SCREEN_WIDTH,SCREEN_HEIGHT/20-10);\r\n\t}", "public void drawOnMap (char[][] roadMap) {\n int deltaX = 0;\n int deltaY = 0;\n int startX = 0;\n int startY = 0;\n /*\n * If there's no turn, pick an end and calculate the delta. To\n * avoid overwriting the intersections, reduce the delta by 1 and,\n * at the equality end (the initial i value in the loop) shift the\n * start by one for the same reason.\n */\n if (xTurn == -1) {\n startX = xOne;\n startY = yOne;\n deltaX = xTwo - xOne;\n deltaY = yTwo - yOne;\n if (deltaY == 0) {\n if (deltaX < 0) {\n deltaX += 1;\n } else {\n startX++;\n deltaX -= 1;\n }\n } else {\n if (deltaY < 0) {\n deltaY += 1;\n } else {\n startY++;\n deltaY -= 1;\n }\n }\n }\n /*\n * There's a turn. Our starting point will be the turn\n * coordinates. Calculate deltaX and deltaY. Here, we want to\n * overwrite the turn (offset of zero in the loops) and reduce\n * delta to avoid overwriting the intersections at each end.\n */\n else {\n startX = xTurn;\n startY = yTurn;\n if (startX == xOne) {\n deltaX = xTwo - startX;\n deltaY = yOne - startY;\n } else {\n deltaX = xOne - startX;\n deltaY = yTwo - startY;\n }\n if (deltaX < 0) {\n deltaX++;\n }\n if (deltaY < 0) {\n deltaY++;\n }\n }\n /*\n * Now we can run two loops to fill in the necessary chars.\n */\n if (deltaX != 0) {\n for (int i = Math.min(deltaX,0) ; i < Math.max(deltaX,0) ; i++) {\n roadMap[startY][startX + i] = '*';\n }\n }\n if (deltaY != 0) {\n for (int i = Math.min(deltaY,0) ; i < Math.max(deltaY,0) ; i++) {\n roadMap[startY + i][startX] = '*';\n }\n }\n /*\n * Blind spot: in the case where both deltaX and deltaY are\n * counting back toward the turn, an offset of zero, and not quite\n * getting there.\n */\n if (deltaX < 0 && deltaY < 0) roadMap[startY][startX] = '*';\n }", "@Override\n public void buildWorldObject() {\n setPoint(new Point3d());\n\n List<Point2d> pointList = new ArrayList<Point2d>();\n\n for (int i = 0; i < way.getNodesCount(); i++) {\n Node node = way.getNode(i);\n pointList.add(perspective.calcPoint(node));\n }\n\n list = pointList;\n\n roadWidth = (float) DEFAULT_ROAD_WIDTH;\n\n roadWidth = getRoadWidth();\n\n TextureData texture = getTexture();\n\n Material m = MaterialFactory.createTextureMaterial(texture.getFile());\n\n ModelFactory modelBuilder = ModelFactory.modelBuilder();\n\n int mi = modelBuilder.addMaterial(m);\n\n MeshFactory meshWalls = modelBuilder.addMesh(\"road\");\n\n meshWalls.materialID = mi;\n meshWalls.hasTexture = true;\n\n if (list.size() > 1) {\n\n FaceFactory leftBorder = meshWalls.addFace(FaceType.QUAD_STRIP);\n FaceFactory leftPart = meshWalls.addFace(FaceType.QUAD_STRIP);\n FaceFactory rightBorder = meshWalls.addFace(FaceType.QUAD_STRIP);\n FaceFactory rightPart = meshWalls.addFace(FaceType.QUAD_STRIP);\n\n Vector3d flatSurface = new Vector3d(0, 1, 0);\n\n int flatNormalI = meshWalls.addNormal(flatSurface);\n\n Point2d beginPoint = list.get(0);\n for (int i = 1; i < list.size(); i++) {\n Point2d endPoint = list.get(i);\n\n double x = endPoint.x - beginPoint.x;\n double y = endPoint.y - beginPoint.y;\n // calc lenght of road segment\n double mod = Math.sqrt(x * x + y * y);\n\n double distance = beginPoint.distance(endPoint);\n\n // calc orthogonal for road segment\n double orthX = x * cos90 + y * sin90;\n double orthY = -x * sin90 + y * cos90;\n\n // calc vector for road width;\n double normX = roadWidth / 2 * orthX / mod;\n double normY = roadWidth / 2 * orthY / mod;\n // calc vector for border width;\n double borderX = normX + 0.2 * orthX / mod;\n double borderY = normY + 0.2 * orthY / mod;\n\n double uEnd = distance / texture.getLenght();\n\n // left border\n int tcb1 = meshWalls.addTextCoord(new TextCoord(0, 0.99999d));\n // left part of road\n int tcb2 = meshWalls.addTextCoord(new TextCoord(0, 1 - 0.10d));\n // Middle part of road\n int tcb3 = meshWalls.addTextCoord(new TextCoord(0, 0.00001d));\n // right part of road\n int tcb4 = meshWalls.addTextCoord(new TextCoord(0, 1 - 0.10d));\n // right border\n int tcb5 = meshWalls.addTextCoord(new TextCoord(0, 0.99999d));\n\n // left border\n int tce1 = meshWalls.addTextCoord(new TextCoord(uEnd, 0.99999d));\n // left part of road\n int tce2 = meshWalls.addTextCoord(new TextCoord(uEnd, 1 - 0.10d));\n // Middle part of road\n int tce3 = meshWalls.addTextCoord(new TextCoord(uEnd, 0.00001d));\n // right part of road\n int tce4 = meshWalls.addTextCoord(new TextCoord(uEnd, 1 - 0.10d));\n // right border\n int tce5 = meshWalls.addTextCoord(new TextCoord(uEnd, 0.99999d));\n\n // left border\n int wbi1 = meshWalls.addVertex(new Point3d(beginPoint.x + borderX, 0.0d, -(beginPoint.y + borderY)));\n // left part of road\n int wbi2 = meshWalls.addVertex(new Point3d(beginPoint.x + normX, 0.1d, -(beginPoint.y + normY)));\n // middle part of road\n int wbi3 = meshWalls.addVertex(new Point3d(beginPoint.x, 0.15d, -beginPoint.y));\n // right part of road\n int wbi4 = meshWalls.addVertex(new Point3d(beginPoint.x - normX, 0.1d, -(beginPoint.y - normY)));\n // right border\n int wbi5 = meshWalls.addVertex(new Point3d(beginPoint.x - borderX, 0.0d, -(beginPoint.y - borderY)));\n\n // left border\n int wei1 = meshWalls.addVertex(new Point3d(endPoint.x + borderX, 0.0d, -(endPoint.y + borderY)));\n // left part of road\n int wei2 = meshWalls.addVertex(new Point3d(endPoint.x + normX, 0.1d, -(endPoint.y + normY)));\n // middle part of road\n int wei3 = meshWalls.addVertex(new Point3d(endPoint.x, 0.15d, -endPoint.y));\n // right part of road\n int wei4 = meshWalls.addVertex(new Point3d(endPoint.x - normX, 0.1d, -(endPoint.y - normY)));\n // right border\n int wei5 = meshWalls.addVertex(new Point3d(endPoint.x - borderX, 0.0d, -(endPoint.y - borderY)));\n\n leftBorder.addVert(wbi1, tcb1, flatNormalI);\n leftBorder.addVert(wbi2, tcb2, flatNormalI);\n leftBorder.addVert(wei1, tce1, flatNormalI);\n leftBorder.addVert(wei2, tce2, flatNormalI);\n\n leftPart.addVert(wbi2, tcb2, flatNormalI);\n leftPart.addVert(wbi3, tcb3, flatNormalI);\n leftPart.addVert(wei2, tce2, flatNormalI);\n leftPart.addVert(wei3, tce3, flatNormalI);\n\n rightBorder.addVert(wbi3, tcb3, flatNormalI);\n rightBorder.addVert(wbi4, tcb4, flatNormalI);\n rightBorder.addVert(wei3, tce3, flatNormalI);\n rightBorder.addVert(wei4, tce4, flatNormalI);\n\n rightPart.addVert(wbi4, tcb4, flatNormalI);\n rightPart.addVert(wbi5, tcb5, flatNormalI);\n rightPart.addVert(wei4, tce4, flatNormalI);\n rightPart.addVert(wei5, tce5, flatNormalI);\n\n beginPoint = endPoint;\n }\n }\n\n model = modelBuilder.toModel();\n model.setUseLight(true);\n model.setUseTexture(true);\n\n buildModel = true;\n }", "public void drawRoad(int player, int location, Graphics g){\n\t}", "public Road(String name) {\n this.name = name;\n this.points = new ArrayList<>();\n }", "public void drawMap() {\n\t\tRoad[] roads = map.getRoads();\r\n\t\tfor (Road r : roads) {\r\n\t\t\tif (r.turn) {\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road = true;\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_vert = true;\r\n\t\t\t} else if (r.direction == Direction.NORTH)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_north = true;\r\n\t\t\telse if (r.direction == Direction.SOUTH)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_south = true;\r\n\t\t\telse if (r.direction == Direction.WEST)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_west = true;\r\n\t\t\telse if (r.direction == Direction.EAST)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_east = true;\r\n\t\t\ttry {\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].updateImage();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void generateMap(){\n if(currDirections != null){\n\n\t \tPoint edge = new Point(mapPanel.getWidth(), mapPanel.getHeight());\n \tmapPanel.paintImmediately(0, 0, edge.x, edge.y);\n\t \t\n\t \t\n\t \t// setup advanced graphics object\n\t Graphics2D g = (Graphics2D)mapPanel.getGraphics();\n\t g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\t g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);\n\n\t \n\t Route rt = currDirections.getRoute();\n\t\n\t boolean singleStreet = rt.getGeoSegments().size() == 1;\n\t Route contextRoute = (!singleStreet ? rt : \n\t \t\tnew Route( virtualGPS.findFullSegment(rt.getEndingGeoSegment()) ) );\n\t \n\t // calculate the longitude and latitude bounds\n\t int[] bounds = calculateCoverage( contextRoute , edge);\n\t \n\t Collection<StreetSegment> map = virtualGPS.getContext(bounds, contextRoute);\n\t \n\t \n\t // draw every segment of the map\n\t g.setColor(Color.GRAY);\n\t for(GeoSegment gs : map){\n\t \tdrawSegment(g, bounds, edge, gs);\n\t }\n\t \n\t // draw the path over the produced map in BLUE\n\t g.setColor(Color.BLUE);\n\t for(GeoFeature gf : rt.getGeoFeatures()){\n\t for(GeoSegment gs : gf.getGeoSegments()){\n\t\t \tdrawSegment(g, bounds, edge, gs);\n\t }\n\t Point start = derivePoint(bounds, edge, gf.getStart());\n\t Point end = derivePoint(bounds, edge, gf.getEnd());\n\t \n\t int dX = (int)(Math.abs(start.x - end.x) / 2.0);\n\t int dY = (int)(Math.abs(start.y - end.y) / 2.0);\n\n if(!jCheckBoxHideStreetNames.isSelected()){\n \tg.setFont(new Font(g.getFont().getFontName(), Font.BOLD, g.getFont().getSize()));\n \tg.drawString(gf.getName(), start.x + (start.x<end.x ? dX : -dX),\n \t\t\tstart.y + (start.y<end.y ? dY : -dY));\n }\n\t }\n }\n }", "private Road()\n\t{\n\t\t\n\t}", "public RoadRagePanel(final int theWidth, final int theHeight) {\n super();\n\n myVehicles = new ArrayList<Vehicle>();\n myGrid = new Terrain[0][0];\n setLightColor(Light.GREEN);\n setPreferredSize(new Dimension(theWidth * SQUARE_SIZE,\n theHeight * SQUARE_SIZE));\n setBackground(Color.GREEN);\n setFont(FONT);\n }", "public void draw(){\n\t\t int startRX = 100;\r\n\t\t int startRY = 100;\r\n\t\t int widthR = 300;\r\n\t\t int hightR = 300;\r\n\t\t \r\n\t\t \r\n\t\t // start points on Rectangle, from the startRX and startRY\r\n\t\t int x1 = 0;\r\n\t\t int y1 = 100;\r\n\t\t int x2 = 200;\r\n\t\t int y2 = hightR;\r\n\t\t \r\n //direction L - false or R - true\r\n\t\t \r\n\t\t boolean direction = true;\r\n\t\t \t\r\n\t\t\r\n\t\t //size of shape\r\n\t\t int dotD = 15;\r\n\t\t //distance between shapes\r\n\t int distance = 30;\r\n\t\t \r\n\t rect(startRX, startRY, widthR, hightR);\r\n\t \r\n\t drawStripesInRectangle ( startRX, startRY, widthR, hightR,\r\n\t \t\t x1, y1, x2, y2, dotD, distance, direction) ;\r\n\t\t \r\n\t\t super.draw();\r\n\t\t}", "private void paintGraph() {\n if(graph) {\n for (MapFeature street : mapFStreets) {\n if (!(street instanceof Highway)) continue;\n Highway streetedge = (Highway) street;\n Iterable<Edge> edges = streetedge.edges();\n if (edges == null) continue;\n Iterator<Edge> it = edges.iterator();\n g.setStroke(new BasicStroke(0.0001f));\n g.setPaint(Color.CYAN);\n while (it.hasNext()) {\n Edge e = it.next();\n if (e.isOneWay())\n g.setPaint(Color.orange);\n else if (e.isOneWayReverse())\n g.setPaint(Color.PINK);\n g.draw(e);\n }\n\n\n }\n for (MapFeature street : mapFStreets) {\n if (!(street instanceof Highway)) continue;\n Highway streetedge = (Highway) street;\n List<Point2D> points = streetedge.getPoints();\n for(Point2D p : points){\n g.setPaint(Color.yellow);\n g.draw(new Rectangle2D.Double(p.getX(), p.getY(), 0.000005, 0.000005));\n }\n\n }\n }\n }", "private void drawStreet(Graphics2D g2d, int x, int y, Cell c) {\n try {\r\n g2d.setPaint(Color.LIGHT_GRAY);\r\n g2d.fill(cellBorder);\r\n g2d.setPaint(Color.DARK_GRAY);\r\n g2d.draw(cellBorder);\r\n drawStreetAgents(g2d,x,y,c);\r\n } catch(Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n }", "@Override\n protected void buildGraphics() {\n GArc rightWing = new GArc(100, 100, -60, 120);\n rightWing.setColor(Color.magenta);\n rightWing.setFilled(true);\n rightWing.setFillColor(Color.magenta);\n // position in format (cx - r, cy - r) for arc\n getGraphics().add(rightWing, (-15 - 50), (0 - 50));\n\n GArc leftWing = new GArc(100, 100, 120, 120);\n leftWing.setColor(Color.magenta);\n leftWing.setFilled(true);\n leftWing.setFillColor(Color.magenta);\n getGraphics().add(leftWing, (-15 - 50), (0 - 50));\n\n GOval rightWingDot = new GOval(-3, -15, 30, 30);\n rightWingDot.setColor(Color.blue);\n rightWingDot.setFilled(true);\n rightWingDot.setFillColor(Color.blue);\n getGraphics().add(rightWingDot);\n\n GOval rightWingDot2 = new GOval(7, -5, 10, 10);\n rightWingDot2.setColor(Color.cyan);\n rightWingDot2.setFilled(true);\n rightWingDot2.setFillColor(Color.cyan);\n getGraphics().add(rightWingDot2);\n\n GLine rightWingLine = new GLine(-15, 0, 35, 0);\n rightWingLine.setColor(Color.green);\n getGraphics().add(rightWingLine);\n\n GOval leftWingDot = new GOval(-57, -15, 30, 30);\n leftWingDot.setColor(Color.blue);\n leftWingDot.setFilled(true);\n leftWingDot.setFillColor(Color.blue);\n getGraphics().add(leftWingDot);\n\n GOval leftWingDot2 = new GOval(-47, -5, 10, 10);\n leftWingDot2.setColor(Color.cyan);\n leftWingDot2.setFilled(true);\n leftWingDot2.setFillColor(Color.cyan);\n getGraphics().add(leftWingDot2);\n\n GLine leftWingLine = new GLine(-15, 0, -65, 0);\n leftWingLine.setColor(Color.green);\n getGraphics().add(leftWingLine);\n\n GOval body = new GOval(-20, -30, 10, 60);\n body.setColor(Color.black);\n body.setFilled(true);\n body.setFillColor(Color.black);\n getGraphics().add(body);\n\n GOval head = new GOval(-23, -43, 16, 16);\n head.setColor(Color.black);\n head.setFilled(true);\n head.setFillColor(Color.black);\n getGraphics().add(head);\n }", "private void drawStreetLines(final Graphics2D theGraphics,\n final int theX, final int theY) {\n \n final Paint oldPaint = theGraphics.getPaint();\n theGraphics.setPaint(Color.YELLOW);\n\n final int leftx = theX * SQUARE_SIZE;\n final int topy = theY * SQUARE_SIZE;\n final int centerx = leftx + SQUARE_SIZE / 2;\n final int centery = topy + SQUARE_SIZE / 2;\n final int rightx = leftx + SQUARE_SIZE;\n final int bottomy = topy + SQUARE_SIZE;\n\n if (isValidIndex(theY - 1, theX) && myGrid[theY - 1][theX] == Terrain.STREET) {\n theGraphics.drawLine(centerx, centery, centerx, topy); // above\n }\n if (isValidIndex(theY + 1, theX) && myGrid[theY + 1][theX] == Terrain.STREET) {\n theGraphics.drawLine(centerx, centery, centerx, bottomy); // below\n }\n if (isValidIndex(theY, theX - 1) && myGrid[theY][theX - 1] == Terrain.STREET) {\n theGraphics.drawLine(centerx, centery, leftx, centery); // left\n }\n if (isValidIndex(theY, theX + 1) && myGrid[theY][theX + 1] == Terrain.STREET) {\n theGraphics.drawLine(centerx, centery, rightx, centery); // right\n }\n\n theGraphics.setPaint(oldPaint);\n }", "private void DrawRoute(final DirectionsResult result){\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n if(RouteArrayList.size() > 0 ){\n\n //this for loop removes all the other routes\n //so when a new route is created, all previous routes will be removed\n for(Route route : RouteArrayList){\n route.getPolyline().remove();\n }\n RouteArrayList.clear();\n RouteArrayList = new ArrayList<>();\n }\n\n\n\n for(DirectionsRoute route: result.routes){\n //get the encoded path ( get all the points along each rote)in order to build the polyline\n\n List<com.google.maps.model.LatLng> decodedPath = PolylineEncoding.decode(route.overviewPolyline.getEncodedPath());\n\n List<LatLng> newPath = new ArrayList<>();\n\n for(com.google.maps.model.LatLng latLng: decodedPath){\n newPath.add(new LatLng(latLng.lat,latLng.lng));\n }\n\n Polyline polyline = mMap.addPolyline(new PolylineOptions().addAll(newPath).color(Color.GRAY).width(10));\n\n //make it clickable show that the info about distance/duration will show\n polyline.setClickable(true);\n\n RouteArrayList.add(new Route(polyline, route.legs[0]));\n //keep track of routes.legs[0] too.., diction - key being the polyline id?\n }\n }\n });\n }", "public RailRoad(String tileID, int boardIndex) {\n this.tileID = tileID;\n this.boardIndex = boardIndex;\n this.owner = null;\n this.cost = 200;\n this.group_color = \"rr\";\n this.group_number = 4;\n this.mortgaged = false;\n }", "private void drawComponents () {\n // Xoa het nhung gi duoc ve truoc do\n mMap.clear();\n // Ve danh sach vi tri cac thanh vien\n drawMembersLocation();\n // Ve danh sach cac marker\n drawMarkers();\n // Ve danh sach cac tuyen duong\n drawRoutes();\n }", "private void drawRoutes () {\n // Lay ngay cua tour\n Date tourDate = OnlineManager.getInstance().mTourList.get(tourOrder).getmDate();\n // Kiem tra xem ngay dien ra tour la truoc hay sau hom nay. 0: hom nay, 1: sau, -1: truoc\n int dateEqual = Tour.afterToday(tourDate);\n // Kiem tra xem tour da dien ra chua\n if (dateEqual == -1) {\n // Tour da dien ra, khong ve gi ca\n } else if (dateEqual == 1) {\n // Tour chua dien ra, khong ve gi ca\n } else {\n // Tour dang dien ra thi kiem tra gio\n /* Chang sap toi mau do, today nam trong khoang src start va src end\n Chang dang di chuyen mau xanh, today nam trong khoang src end va dst start\n Chang vua di qua mau xam, today nam trong khoang dst start va dst end */\n ArrayList<TourTimesheet> timesheets = OnlineManager.getInstance().mTourList.get(tourOrder).getmTourTimesheet();\n // Danh dau chang dang di qua\n int changDangDiQuaOrder = -1;\n // Danh dau chang sap di qua\n int changSapDiQuaOrder = -1;\n if(Tour.afterCurrentHour(timesheets.get(0).getmStartTime()) == 1){\n // Chang sap di qua mau do\n // Neu chua ve chang sap di, ve duong mau do\n if (timesheets.size() >= 2) {\n drawRoute(Color.RED, timesheets.get(0).getmBuildingLocation(), timesheets.get(1).getmBuildingLocation());\n }\n } else {\n for (int i = 0; i < timesheets.size() - 1; i++) {\n // Kiem tra xem chang hien tai la truoc hay sau gio nay. 0: gio nay, 1: gio sau, -1: gio truoc\n int srcStartEqual = Tour.afterCurrentHour(timesheets.get(i).getmStartTime());\n int srcEndEqual = Tour.afterCurrentHour(timesheets.get(i).getmEndTime());\n int dstStartEqual = Tour.afterCurrentHour(timesheets.get(i + 1).getmStartTime());\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(i).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(i + 1).getmBuildingLocation();\n if (srcStartEqual == -1 && srcEndEqual == 1) {\n // Chang dang di qua mau xanh\n // Neu chua ve chang dang di, ve duong mau xanh\n drawRoute(Color.BLUE, srcLocation, dstLocation);\n // Danh dau chang dang di qua\n changDangDiQuaOrder = i;\n // Thoat khoi vong lap\n break;\n } else if (srcEndEqual == -1 && dstStartEqual == 1) {\n // Chang sap toi mau do\n // Neu chua ve chang sap toi, ve duong mau do\n drawRoute(Color.RED, srcLocation, dstLocation);\n // Danh dau chang sap di qua\n changSapDiQuaOrder = i;\n // Thoat khoi vong lap\n break;\n }\n }\n }\n // Kiem tra xem da ve duoc nhung duong nao roi\n if (changDangDiQuaOrder != - 1) {\n // Neu ve duoc chang dang di qua roi thi ve tiep 2 chang con lai\n if (changDangDiQuaOrder < timesheets.size() - 2) {\n // Neu khong phai chang ket thuc thi ve tiep chang sap di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changDangDiQuaOrder + 1).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changDangDiQuaOrder + 2).getmBuildingLocation();\n drawRoute(Color.RED, srcLocation, dstLocation);\n }\n if (changDangDiQuaOrder > 0) {\n // Neu khong phai chang bat dau thi ve tiep chang da di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changDangDiQuaOrder - 1).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changDangDiQuaOrder).getmBuildingLocation();\n drawRoute(Color.GRAY, srcLocation, dstLocation);\n }\n }\n if (changSapDiQuaOrder != - 1) {\n // Neu ve duoc chang sap di qua roi thi ve tiep 2 chang con lai\n if (changSapDiQuaOrder > 0) {\n // Neu khong phai chang bat dau thi ve tiep chang dang di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changSapDiQuaOrder - 1).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changSapDiQuaOrder).getmBuildingLocation();\n drawRoute(Color.BLUE, srcLocation, dstLocation);\n }\n if (changSapDiQuaOrder > 1) {\n // Neu khong phai chang bat dau thi ve tiep chang da di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changSapDiQuaOrder - 2).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changSapDiQuaOrder - 1).getmBuildingLocation();\n drawRoute(Color.GRAY, srcLocation, dstLocation);\n }\n }\n }\n }", "public void roadList(){\n for(int i = 0; i < roads.size(); i++){\n System.out.println(i + \" \" + roads.get(i).start.getCityName() + \", \" + roads.get(i).end.getCityName());\n }\n }", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\r\n System.out.println(\"How many roads?\");\r\n int roadSpawns = scanner.nextInt();\r\n System.out.println(\"How many cars?\");\r\n int carSpawns = scanner.nextInt();\r\n // Store adjacent paths\r\n List<String> connectedRoad = new ArrayList<>();\r\n List<TrafficLight> lights = new ArrayList<>();\r\n\r\n //Create objects:\r\n System.out.println(\"Object Creation:\\n---------------------\");\r\n System.out.println(\"Roads:\");\r\n ArrayList<Road> roads = new ArrayList<>();\r\n for (int i = 0; i < roadSpawns; i++) {\r\n System.out.println(\"Please input parameters for road_\" + i + \"...\");\r\n System.out.print(\"Length:\");\r\n int lengthInput = scanner.nextInt();\r\n int speedLimitInput = (new Random()).nextInt(11);\r\n roads.add(new Road(Integer.toString(i), speedLimitInput, lengthInput, new int[]{0, 0}));\r\n System.out.println(\"Please input connected roads of road_\" + i + \"...(like:0,1,2...)\");\r\n String infos = scanner.next();\r\n connectedRoad.add(infos);\r\n }\r\n System.out.println(\"\\nRoads;\");\r\n for (Road road : roads) {\r\n road.printRoadInfo();\r\n }\r\n\r\n // Set up TrafficLight at road junctions\r\n for (int i = 0; i < connectedRoad.size(); i++) {\r\n TrafficLight trafficLight = null;\r\n if (roads.get(i).getLightsOnRoad().size() > 0) trafficLight = roads.get(i).getLightsOnRoad().get(0);\r\n else {\r\n long currentTime = new Date().getTime();\r\n trafficLight = new TrafficLight(String.valueOf(currentTime), roads.get(i));\r\n roads.get(i).addTrafficLight(trafficLight);\r\n lights.add(trafficLight);\r\n }\r\n for (String s : connectedRoad.get(i).split(\",\")) {\r\n roads.get(i).addConnectRoad(roads.get(Integer.parseInt(s)));\r\n if (roads.get(Integer.parseInt(s)).getLightsOnRoad().size() > 0) continue;\r\n else roads.get(Integer.parseInt(s)).addTrafficLight(trafficLight);\r\n }\r\n }\r\n\r\n System.out.println(\"\\nCars;\");\r\n ArrayList<Car> cars = new ArrayList<>();\r\n for (int i = 0; i < carSpawns; i++) {\r\n // random add bus or motorbke\r\n if ((new Random()).nextInt(10) <= 5) {\r\n cars.add(new Bus(Integer.toString(i), roads.get(0)));\r\n } else {\r\n cars.add(new Motorbike(Integer.toString(i), roads.get(0)));\r\n }\r\n cars.get(i).printCarStatus();\r\n }\r\n\r\n // Let car run\r\n int time = 0;\r\n System.out.print(\"\\nSet time scale in milliseconds:\");\r\n int maxtime = scanner.nextInt();\r\n while (true) {\r\n // change trafficlight state\r\n for (TrafficLight light : lights) {\r\n light.chageState();\r\n }\r\n for (Car car : cars) {\r\n car.move();\r\n car.printCarStatus();\r\n }\r\n time = time + 1;\r\n System.out.println(time + \" Seconds have passed.\\n\");\r\n if (time >= maxtime) {\r\n System.out.println(\"timeout\");\r\n break;\r\n }\r\n }\r\n }", "void buildRoad(EdgeLocation edge, boolean free);", "private void Create_Path() {\n lines = new Line[getPoints().size()];\n for (int i = 1; i < getLines().length; i++) {\n lines[i] = new Line(getPoints().get(way[i]).getX(), getPoints().get(way[i]).getY(), getPoints().get(way[i - 1]).getX(), getPoints().get(way[i - 1]).getY());\n }\n lines[0] = new Line(getPoints().get(way[getLines().length - 1]).getX(), getPoints().get(way[getLines().length - 1]).getY(), getPoints().get(way[0]).getX(), getPoints().get(way[0]).getY());\n\n }", "private void drawWaypoints() {\r\n\t\tint x1 = (width - SIZE_X) / 2;\r\n\t\tint y1 = (height - SIZE_Y) / 2;\r\n\r\n\t\tfloat scissorFactor = (float) _resolutionResolver.getScaleFactor() / 2.0f;\r\n\r\n\t\tint glLeft = (int) ((x1 + 10) * 2.0f * scissorFactor);\r\n\t\tint glWidth = (int) ((SIZE_X - (10 + 25)) * 2.0f * scissorFactor);\r\n\t\tint gluBottom = (int) ((this.height - y1 - SIZE_Y) * 2.0f * scissorFactor);\r\n\t\tint glHeight = (int) ((SIZE_Y) * 2.0f * scissorFactor);\r\n\r\n\t\tGL11.glEnable(GL11.GL_SCISSOR_TEST);\r\n\t\tGL11.glScissor(glLeft, gluBottom, glWidth, glHeight);\r\n\r\n\t\tGL11.glPushMatrix();\r\n\t\tGL11.glScalef(_textScale, _textScale, _textScale);\r\n\r\n\t\t_startCell = getStartCell();\r\n\t\t_cellStartX = (int) (((float) x1 + (float) 13) / _textScale);\r\n\t\t_cellStartY = (int) (((float) y1 + (float) 22) / _textScale);\r\n\r\n\t\tint x2 = _cellStartX;\r\n\t\tint y2 = _cellStartY + (int) ((float) 0 * (float) CELL_SIZE_Y / _textScale);\r\n\r\n\t\tImmutableList<UltraTeleportWaypoint> list = UltraTeleportWaypoint.getWaypoints();\r\n\t\tfor (int i = 0; i < 2; ++i) {\r\n \t\tfor (int j = 0; j < list.size() && j < MAX_CELL_COUNT; ++j) {\r\n\r\n \t\t\tint x = _cellStartX;\r\n \t\t\tint y = _cellStartY + (int) ((float) j * (float) CELL_SIZE_Y / _textScale);\r\n\r\n \t\t\tdouble posX = list.get(j + _startCell).getPos().getX();\r\n \t\t\tdouble posY = list.get(j + _startCell).getPos().getY();\r\n \t\t\tdouble posZ = list.get(j + _startCell).getPos().getZ();\r\n\r\n \t\t\tString strX = String.format(\"x: %4.1f\", posX);\r\n \t\t\tString strY = String.format(\"y: %4.1f\", posY);\r\n \t\t\tString strZ = String.format(\"z: %4.1f\", posZ);\r\n \t\t\tString text = strX + \" \" + strY + \" \" + strZ;\r\n\r\n \t\t\tif (i == 0) {\r\n \t\t\t this.fontRendererObj.drawStringWithShadow(text, x + 18, y, list.get(j).getColor());\r\n\r\n \t\t\t boolean selected = j + _startCell < _selectedList.size() ? _selectedList.get(j + _startCell) : false;\r\n\r\n \t\t\t GL11.glPushMatrix();\r\n GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);\r\n \t\t\t this.mc.renderEngine.bindTexture(selected ? BUTTON_ON_RESOURCE : BUTTON_OFF_RESOURCE);\r\n \t\t\t HubbyUtils.drawTexturedRectHelper(0, x + CELL_SIZE_X + 18, y - 3, 16, 16, 0, 0, 256, 256);\r\n \t\t\t GL11.glPopMatrix();\r\n \t\t\t}\r\n \t\t\telse if (i == 1) {\r\n \t\t\t\tBlockPos pos = new BlockPos((int)posX, (int)posY - 1, (int)posZ);\r\n \t\t\t Block block = Minecraft.getMinecraft().theWorld.getBlockState(pos).getBlock();\r\n \t\t\tif (block != null) {\r\n \t\t\t Item itemToRender = Item.getItemFromBlock(block);\r\n \t\t\t itemToRender = itemToRender != null ? itemToRender : Item.getItemFromBlock((Block)Block.blockRegistry.getObjectById(3));\r\n \t\t\t ItemStack is = new ItemStack(itemToRender, 1, 0);\r\n \t\t\t _itemRender.renderItemAndEffectIntoGUI(is, x - 1, y - 3);\r\n \t _itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, is, x - 1, y - 3, \"\"); // TODO: is the last param correct?\r\n \t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n\t\t}\r\n\r\n\t\tGL11.glPopMatrix();\r\n\t\tGL11.glDisable(GL11.GL_SCISSOR_TEST);\r\n\t}", "public void makeLine() {\n \t\tList<Pellet> last_two = new LinkedList<Pellet>();\n \t\tlast_two.add(current_cycle.get(current_cycle.size() - 2));\n \t\tlast_two.add(current_cycle.get(current_cycle.size() - 1));\n \n \t\tPrimitive line = new Primitive(GL_LINES, last_two);\n \t\tMain.geometry.add(line);\n \n \t\tActionTracker.newPolygonLine(line);\n \t}", "private void routeDrawing(Location location) {\n\n // validity check in case the first point does not have a previous point\n if (previousLocation == null) {\n // copy the current location to the previous point\n previousLocation = location;\n }\n double lat = location.getLatitude();\n double lon = location.getLongitude();\n\n latitude = lat;\n longitude = lon;\n latList.add(latitude);\n lonList.add(longitude);\n\n // previous coordinates\n //System.out.println(\"previous Location: \" + previousLocation.getLatitude() + \" \" + previousLocation.getLongitude());\n // current coordinates\n //System.out.println(\"Current Location: \" + location.getLatitude() + \" \" + location.getLongitude());\n\n // Polyline Options differ from\n PolylineOptions lineOptions = new PolylineOptions();\n // set the option of each part of polyline\n // 0.03 is the location update interval also the drawing interval\n vdraw = (GetDistance(previousLocation.getLatitude(), previousLocation.getLongitude(), location.getLatitude(), location.getLongitude()))/0.3;\n System.out.println(\"vdraw: \"+vdraw);\n if (vdraw<0.01){\n\n lineOptions.add(new LatLng(previousLocation.getLatitude(), previousLocation.getLongitude()))\n .add(new LatLng(location.getLatitude(), location.getLongitude()))\n // This needs to be beautified\n .color(getResources().getColor(R.color.slow))\n .width(30);\n System.out.print(\"I am running slow\");\n }\n if (vdraw>=0.008 && vdraw<=0.03){\n lineOptions.add(new LatLng(previousLocation.getLatitude(), previousLocation.getLongitude()))\n .add(new LatLng(location.getLatitude(), location.getLongitude()))\n // This needs to be beautified\n .color(getResources().getColor(R.color.commen))\n .width(30);\n System.out.print(\"I am running normally\");\n }\n if (vdraw>0.03){\n lineOptions.add(new LatLng(previousLocation.getLatitude(), previousLocation.getLongitude()))\n .add(new LatLng(location.getLatitude(), location.getLongitude()))\n // This needs to be beautified\n .color(getResources().getColor(R.color.fast))\n .width(30);\n System.out.print(\"I am running fast\");\n }\n\n // add the polyline to the map\n Polyline partOfRunningRoute = mMap.addPolyline(lineOptions);\n // set the zindex so that the poly line stays on top of my tile overlays\n partOfRunningRoute.setZIndex(1000);\n // add the poly line to the array so they can all be removed if necessary\n runningRoute.add(partOfRunningRoute);\n // add the latlng from this point to the array\n points.add(location);\n // store current location as previous location in the end\n previousLocation = location;\n }", "static void drawTopo() {\n\t\tif (currentStage[currentSlice-1]>2)\n\t\t{\n\t\t\tfloat x1,y1,x2,y2;\n\t\t\tint N = pop.N;\n\t\t\tArrayList balloons = pop.BallList;\n\n\t\t\tfor (int i=0;i<N;i++)\n\t\t\t{\n\t\t\t\tPoint P1 = ((Balloon)(balloons.get(i))).getPoint();\n\t\t\t\tx1 = (float)(P1.getX());\n\t\t\t\ty1 = (float)(P1.getY());\n\n\t\t\t\tfor (int j=0;j<i;j++)\n\t\t\t\t{\n\t\t\t\t\tif (pop.topo[i][j]==true)\n\t\t\t\t\t{\n\t\t\t\t\t\t// label connection between cells (potential neighbours)\n\t\t\t\t\t\tjava.awt.geom.GeneralPath Tshape = new GeneralPath();\n\t\t\t\t\t\tPoint P2 = ((Balloon)(balloons.get(j))).getPoint();\n\t\t\t\t\t\tx2 = (float)(P2.getX());\n\t\t\t\t\t\ty2 = (float)(P2.getY());\n\t\t\t\t\t\tTshape.moveTo(x1, y1);\n\t\t\t\t\t\tTshape.lineTo(x2, y2);\n\t\t\t\t\t\tRoi XROI = new ShapeRoi(Tshape);\n\t\t\t\t\t\tXROI.setStrokeWidth(1);\n\t\t\t\t\t\tXROI.setStrokeColor(Color.green);\n\t\t\t\t\t\tOL.add(XROI);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void build() {\n x = vertices.get(0);\n y = vertices.get(1);\n vertices.reverse();\n BodyFactory.createPolyLine(x, y, vertices.toArray(), BodyDef.BodyType.StaticBody, LineType.SOLID);\n }", "Road(boolean h, MP m){\n\t\t time = m.getLifeTime();\n\t\t horizontal = h; \n\t\t _MP = m;\n\t\t endPosition = _MP.createRandom(_MP.getRoadLengthMin(), _MP.getRoadLengthMax());\n\t }", "public void paintRoute(Graphics g, String[] ruteData, int begin, int end, int color) {\n //System.out.println(\"painting rute\");\n end += RUTE_FLOOR + 1;\n begin += RUTE_FLOOR + 1;\n if (begin > end || end > ruteData.length || begin < 0 || g == null || ruteData == null) {\n return;\n }\n g.setColor(color);\n //paint the rute\n int x = 0, y = 0, lastx = 0, lasty = 0, i = begin;\n int floor = Integer.parseInt(ruteData[RUTE_FLOOR]);\n for (; i < end; i++) {\n //System.out.println(ruteData[i]);\n point = getPoint(ruteData[i]);\n x = point[0] + currMatrixX + transformCoordenate(floor, X_COORD);\n y = point[1] + currMatrixY + transformCoordenate(floor, Y_COORD);\n //dot\n g.fillRoundRect(x - 5, y - 5, 10, 10, 5, 5);\n //line\n if (!(lastx == 0 && lasty == 0)) {\n g.drawLine(x - 1, y - 1, lastx - 1, lasty - 1);\n g.drawLine(x, y - 1, lastx, lasty - 1);\n g.drawLine(x - 1, y, lastx - 1, lasty);\n g.drawLine(x, y, lastx, lasty);\n g.drawLine(x, y + 1, lastx, lasty + 1);\n g.drawLine(x + 1, y, lastx + 1, lasty);\n g.drawLine(x + 1, y + 1, lastx + 1, lasty + 1);\n }\n lastx = x;\n lasty = y;\n //System.out.println(\"point \" + (i-begin) + \": \" + x + \",\" + y + \" floor \" + floor);\n }\n }", "@Override\n public void paint(Graphics g1){\n\n try{\n super.paint(g1);\n\n drawSymbols_Rel( g1 );\n drawSymbols_Att( g1 );\n /**\n //==== only for test ====\n this.setComplexRelationsCoordinates(20, 28, 33, 38);\n this.setComplexRelationsCoordinates_extraEnds(400, 404);\n */\n\n drawComplexRelationship(g1);\n drawPath(g1);\n \n \n \n }catch(Exception ex){\n }\n }", "private void drawMap(final Graphics2D theGraphics) {\n for (int y = 0; y < myGrid.length; y++) {\n final int topy = y * SQUARE_SIZE;\n\n for (int x = 0; x < myGrid[y].length; x++) {\n final int leftx = x * SQUARE_SIZE;\n\n switch (myGrid[y][x]) {\n case STREET:\n theGraphics.setPaint(Color.LIGHT_GRAY);\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n drawStreetLines(theGraphics, x, y);\n break;\n\n case WALL:\n theGraphics.setPaint(Color.BLACK);\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n break;\n\n case TRAIL:\n theGraphics.setPaint(Color.YELLOW.darker().darker());\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n break;\n\n case LIGHT:\n // draw a circle of appropriate color\n theGraphics.setPaint(Color.LIGHT_GRAY);\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n theGraphics.setPaint(myLightColor);\n theGraphics.fillOval(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n break;\n \n case CROSSWALK:\n theGraphics.setPaint(Color.LIGHT_GRAY);\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n \n drawCrossWalkLines(theGraphics, x, y);\n \n // draw a small circle of appropriate color centered in the square\n theGraphics.setPaint(myLightColor);\n theGraphics.fillOval(leftx + (int) (SQUARE_SIZE * CROSSWALK_SCALE),\n topy + (int) (SQUARE_SIZE * CROSSWALK_SCALE),\n SQUARE_SIZE / 2, SQUARE_SIZE / 2);\n break;\n\n default:\n }\n\n drawDebugInfo(theGraphics, x, y);\n }\n }\n }", "public void drawDronePath(ArrayList<LatLng> arr){\n dronePath.drawRout(arr,googleMap,Color.GREEN);\n }", "@Override\r\n\tpublic void draw(Graphics g) {\n\t\tg.setColor(this.color);\r\n\t\tg.fillOval((int)x, (int)y, side, side);\r\n\t\tg.setColor(this.color2);\r\n\t\tg.fillOval((int)x+5, (int)y+2, side/2, side/2);\r\n\t}", "public void drawRoute(Set<Waypoint> waypoints, List<GeoPosition> track) {\r\n\t\tRoutePainter routePainter = new RoutePainter(track);\r\n\t\t\r\n WaypointPainter<Waypoint> waypointPainter = new WaypointPainter<Waypoint>();\r\n waypointPainter.setWaypoints(waypoints);\r\n \r\n List<Painter<JXMapViewer>> painters = new ArrayList<Painter<JXMapViewer>>();\r\n painters.add(routePainter);\r\n painters.add(waypointPainter);\r\n\r\n CompoundPainter<JXMapViewer> painter = new CompoundPainter<JXMapViewer>(painters);\r\n mapViewer.setOverlayPainter(painter);\r\n\t}", "@Override\r\n\tpublic void draw(Graphics2D g2) {\r\n\t\tCoord c,c2;\r\n\t\t\r\n\t\tif (simMap == null && gridMap == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tg2.setColor(PATH_COLOR);\r\n\t\tg2.setBackground(BG_COLOR);\r\n\t\t\n\t\tif (simMap != null){\r\n\t\t\t// draws all edges between map nodes (bidirectional edges twice)\r\n\t\t\tfor (MapNode n : simMap.getNodes()) {\r\n\t\t\t\tc = n.getLocation();\r\n\t\t\t\t\r\n\t\t\t\t// draw a line to adjacent nodes\r\n\t\t\t\tfor (MapNode n2 : n.getNeighbors()) {\r\n\t\t\t\t\tc2 = n2.getLocation();\r\n\t\t\t\t\tg2.drawLine(scale(c2.getX()), scale(c2.getY()),\r\n\t\t\t\t\t\t\tscale(c.getX()), scale(c.getY()));\r\n\t\t\t\t}\r\n\t\t\t}\n\t\t}\n\t\t\n\t\tg2.setColor(Color.RED);\n\t\tif (gridMap != null){\n\t\t\t// draws the polygon\n\t\t\tfor (GridCell cell : gridMap.getCells()) {\n\t\t\t\tList<Coord> listPoint = cell.getPoints();\n\t\t\t\tfor (int i = 0; i < listPoint.size(); i++) {\n\t\t\t\t\tCoord p1 = listPoint.get(i);\n\t\t\t\t\tCoord p2 = listPoint.get( (i+1) % (listPoint.size()));\n\t\t\t\t\t\n\t\t\t\t\tg2.drawLine(scale(p2.getX()), scale(p2.getY()),\n\t\t\t\t\t\t\tscale(p1.getX()), scale(p1.getY()));\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\r\n\t}", "public Road(String name, Junction from, Junction to) {\n this.name = name;\n this.from = from;\n this.to = to;\n }", "public BSPLine() {\n super();\n }", "private void drawFlights(){\n if(counter%180 == 0){ //To not execute the SQL request every frame.\n internCounter = 0;\n origins.clear();\n destinations.clear();\n internCounter = 0 ;\n ArrayList<String> answer = GameScreen.database.readDatas(\"SELECT Origin, Destination FROM Flights\");\n for(String s : answer){\n internCounter++;\n String[] parts = s.split(\" \");\n String xyOrigin, xyDestination;\n try{\n xyOrigin = GameScreen.database.readDatas(\"SELECT SystemX, SystemY FROM Systems WHERE SystemName = '\"+parts[0]+\"' ;\").get(0);\n } catch (IndexOutOfBoundsException e){\n String systemId = GameScreen.database.getOneData(\"SELECT SystemId FROM Planet WHERE PlanetName = '\"+parts[0]+\"' ;\");\n xyOrigin = GameScreen.database.readDatas(\"SELECT SystemX, SystemY FROM Systems WHERE id = '\"+systemId+\"' ;\").get(0);\n }\n origins.add(new Vector2(Float.parseFloat(xyOrigin.split(\" \")[0]), Float.parseFloat(xyOrigin.split(\" \")[1])));\n\n try{\n xyDestination = GameScreen.database.readDatas(\"SELECT SystemX, SystemY FROM Systems WHERE SystemName = '\"+parts[1]+\"' ;\").get(0);\n }catch (IndexOutOfBoundsException e){\n String systemId = GameScreen.database.getOneData(\"SELECT SystemId FROM Planet WHERE PlanetName = '\"+parts[1]+\"' ;\");\n xyDestination = GameScreen.database.readDatas(\"SELECT SystemX, SystemY FROM Systems WHERE id = '\"+systemId+\"' ;\").get(0);\n }\n destinations.add(new Vector2(Float.parseFloat(xyDestination.split(\" \")[0]), Float.parseFloat(xyDestination.split(\" \")[1])));\n }\n }\n renderer.begin();\n renderer.set(ShapeRenderer.ShapeType.Filled);\n renderer.setColor(Color.WHITE);\n renderer.circle(600, 380, 4);\n for(int i = 0; i<internCounter; i++){\n renderer.line(origins.get(i), destinations.get(i));\n renderer.setColor(Color.RED);\n renderer.circle(origins.get(i).x, origins.get(i).y, 3);\n renderer.setColor(Color.GREEN);\n renderer.circle(destinations.get(i).x, destinations.get(i).y, 3);\n }\n renderer.end();\n }", "public RoadAgent(String startNode, String endNode, Point startPosition, Point endPosition, String roadBelongingType)\r\n\t{\r\n\t\tthis.startNode = startNode;\r\n\t\tthis.endNode = endNode;\r\n\t\tthis.startPosition = startPosition;\r\n\t\tthis.endPosition = endPosition;\r\n\t\tthis.roadBelongingType = roadBelongingType;\r\n\t}", "public Rectangle(Point point1, Point point2){\n super(4);\n if(point1.getX() == point2.getX() || point1.getY() == point2.getY())\n throw new IllegalArgumentException(\"Input points are not opposite to each other.\");\n int point1X = point1.getX(); //stores the x of the first point\n int point1Y = point1.getY(); //stores the y of the first point\n int point2X = point2.getX(); //stores the x of the second point\n int point2Y = point2.getY(); //stores the y of the second point\n \n if(point1X < point2X){\n width = point2X - point1X;\n if(point1Y < point2Y){\n height = point2Y - point1Y;\n topLine = new Line(point1X, point1Y, point2X, point1Y);\n rightLine = new Line(point2X, point1Y, point2X, point2Y);\n bottomLine = new Line(point2X, point2Y, point1X, point2Y);\n leftLine = new Line(point1X, point2Y, point1X, point1Y);\n }\n if(point1Y > point2Y){\n height = point1Y - point2Y;\n topLine = new Line(point1X, point2Y, point2X, point2Y);\n rightLine = new Line(point2X, point2Y, point2X, point1Y);\n bottomLine = new Line(point2X, point1Y, point1X, point1Y);\n leftLine = new Line(point1X, point1Y, point1X, point2Y);\n }\n }\n if(point1X > point2X){\n width = point1X - point2X;\n if(point1Y > point2Y){\n height = point1Y - point2Y;\n bottomLine = new Line(point1X, point1Y, point2X, point1Y);\n leftLine = new Line(point2X, point1Y, point2X, point2Y);\n topLine = new Line(point2X, point2Y, point1X, point2Y);\n rightLine = new Line(point1X, point2Y, point1X, point1Y);\n }\n if(point1Y < point2Y){\n height = point2Y - point1Y;\n leftLine = new Line(point2X, point2Y, point2X, point1Y);\n topLine = new Line(point2X, point1Y, point1X, point1Y);\n rightLine = new Line(point1X, point1Y, point1X, point2Y);\n bottomLine = new Line(point1X, point2Y, point2X, point2Y);\n }\n }\n referencePoint = topLine.getFirstPoint();\n }", "private void draw(){\n GraphicsContext gc = canvasArea.getGraphicsContext2D();\n canvasDrawer.drawBoard(canvasArea, board, gc, currentCellColor, currentBackgroundColor, gridToggle);\n }", "public String toString() {\n\t\treturn \"LINE:(\"+startPoint.getX()+\"-\"+startPoint.getY() + \")->(\" + endPoint.getX()+\"-\"+endPoint.getY()+\")->\"+getColor().toString();\n\t}", "public void draw(){\r\n\r\n\t\t\t//frame of house\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.down();\r\n\t\t\tpen.move(250,0);\r\n\t\t\tpen.move(250,150);\r\n\t\t\tpen.move(0,300);\r\n\t\t\tpen.move(-250,150);\r\n\t\t\tpen.move(-250,0);\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(250,150);\r\n\t\t\tpen.down();\r\n\t\t\tpen.move(-250,150);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.down();\r\n\r\n\t\t\t//door\r\n\t\t\tpen.setColor(Color.blue);\r\n\t\t\tpen.setWidth(10);\r\n\t\t\tpen.move(50,0);\r\n\t\t\tpen.move(50,100);\r\n\t\t\tpen.move(-50,100);\r\n\t\t\tpen.move(-50,0);\r\n\t\t\tpen.move(0,0);\r\n\r\n\t\t\t//windows\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(150,80);\r\n\t\t\tpen.down();\r\n\t\t\tpen.drawCircle(30);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(-150,80);\r\n\t\t\tpen.down();\r\n\t\t\tpen.drawCircle(30);\r\n\t\t\tpen.up();\r\n\r\n\t\t\t//extra\r\n\t\t\tpen.move(-45,120);\r\n\t\t\tpen.down();\r\n\t\t\tpen.setColor(Color.black);\r\n\t\t\tpen.drawString(\"This is a house\");\r\n\t}", "public Road(Village start, Village end, int cost) {\n\t\tleave = start;\n\t\tarrive = end;\n\t\ttoll = cost;\n\t}", "public Road(String name, MapPoint mapPoint) {\n this.name = name;\n this.points = new ArrayList<>();\n this.mapPoint = mapPoint;\n }", "public String toString() {\n\t\treturn \"Road from \" + getLeave() + \" to \" + getArrive() + \" with toll \" + getToll();\n\t}", "public void paintComponent(Graphics g)\n\t{\n\t\t\n\t\t\n\t\t// Get the current width and height of the window.\n\t\tint width = getWidth(); // panel width\n\t\tint height = getHeight(); // panel height\n\t\t// Calculate the new xOffset position of the moving object.\n\t\t\n\t\t\t\txOffset = (xOffset +stepSize) % width;\n\t\t\t\t\n\t\t// Fill the graphics page with the background color.\n\t\tg.setColor(BACKGROUND_COLOR);\n\t\tg.fillRect(0, 0, width, height);\n\t\t\n\t\t//This draw the road\n\t\tint x = width/5;\n\t\tint y= height/4;\n\t\tg.setColor(new Color(211,211,211));\n\t\tg.fillRect(0, height/2, width, height/5);\n\t\t\n\t\t\n\t\t// \tThis draw the pavement \n\t\tg.setColor(new Color(245,245,220));\n\t\tg.fillRect(0,7*height/10, width, 3*height/10);\n\t\t\n\t\t// This draw paint on the road\n\t\tg.setColor(new Color(255,165,0));\n\t\tg.fillRect(0, 3*height/5, x/2, height/40);\n\t\tg.setColor(new Color(255,165,0));\n\t\tg.fillRect(x, 3*height/5, x/2, height/40);\n\t\tg.setColor(new Color(255,165,0));\n\t\tg.fillRect(2*x, 3*height/5, x/2, height/40);\n\t\tg.setColor(new Color(255,165,0));\n\t\tg.fillRect(3*x, 3*height/5, x/2, height/40);\n\t\tg.setColor(new Color(255,165,0));\n\t\tg.fillRect(4*x, 3*height/5, x/2, height/40);\n\t\tg.setColor(new Color(255,165,0));\n\t\tg.fillRect((int)(4.75*x), 3*height/5, x/2, height/40);\n\t\t\n\t\t\n\t\t// This draws background theme\n\t\tg.setColor(new Color(212,39,41));\n\t\tg.fillRect(0,0, x, height/2);\n\t\tg.setColor(new Color(1,87,174));\n\t\tg.fillRect(x,0, x, height/2);\n\t\tg.setColor(new Color(255,255,255));\n\t\tg.fillRect(2*x,0, x, height/2);\n\t\tg.setColor(Color.RED);\n\t\tg.fillRect(3*x,0, x, height/2);\n\t\tg.setColor(new Color(0,6,84));\n\t\tg.fillRect(4*x,0, x, height/2);\n\n\t\t\t\t\n\n\t\t// Insert a string \n\t\tg.setColor(Color.BLACK);\n\t\tString str = \"Stand up and Salute!!!!!\";\n\t\tg.setFont(new Font(\"Courier New\", Font.BOLD+ Font.ITALIC,y/5));\n g.drawString(str,(int)(1.5*x), height/6);\n\t\t\n // This draw a tank \n \n //This draw rectangle1\n \tg.setColor(new Color(29,33,13));\n \tg.fillRect(xOffset+7*width/50,23*height/72,3*width/25,height/9);\n \n // This draw rectangle2 \n\t\tg.setColor(new Color(29,33,13));\n\t\tg.fillRect(xOffset+width/10,(int)(1.5*y),width/5 ,height/9 );\n\t\t\n\t\t// This draw a logo on rect2\n\t\tg.setColor(Color.WHITE);\n\t\tString ban = \"TEAM USA\";\n\t\tg.setFont(new Font(\"Courier New\", Font.BOLD+ Font.ITALIC,y/5));\n g.drawString(ban,xOffset+(int)(0.12*width), 31*height/72);\n\t\t\n\t\t//This draw 2 triangles \n\t\tg.setColor(new Color(125,138,53));\n\t\t\n\t\tg.drawLine(xOffset, (int)(35*y/18),xOffset+width/10,(int)(1.5*y));\n\t\tg.drawLine(xOffset,(int)(35*y/18), xOffset+width/10,(int)(35*y/18));\n\t\t\n\t\tg.drawLine(xOffset+3*width/10, (int)(1.5*y),xOffset+4*width/10, 35*y/18);\n\t\tg.drawLine(xOffset+3*width/10,35*y/18, xOffset+4*width/10, 35*y/18);\n\t\t\n\t\n\t\t// This draw rectangle3\n\t\tg.fillRect(xOffset+13*width/50, 23*height/72, width/10, height/40);\n\t\t\n\t\t//This draw a rectangle4\n\t\tg.setColor(new Color(25,28,11));\n\t\tg.fillRect(xOffset+9*width/25,557*height/1800 ,7*width/90, (int)(1.5*height/35));\n\t\t//This draw a missile launched from the tank\n\t\tg.setColor(new Color(255,215,0));\n\t\tg.fillArc(xOffset+58*width/225,557*height/1800 ,xOffset+11*width/90, (int)(1.5*height/35),0, 45);\n\t\t\n\t\t//This draw 2 wheels\n\t\tg.setColor(Color.BLACK);\n\t\tg.fillOval(xOffset, (int)(35*y/18),3*width/50 , 9*height/100);\n\t\tg.fillOval(xOffset+(int)(0.35*width),(int)(35*y/18), 3*width/50, 9*height/100);\n\t\t\n\t\t// This draw person1 watching the tank passing by\n\t\tg.setColor(new Color(205,183,158));\n\t\tg.fillOval(x, 3*y, 3*width/50, 9*height/100);\n\t\tg.setColor(new Color(125,138,53));\n\t\tg.fillRoundRect(x, 21*height/25, 3*width/40, 9*height/60,180,90);\n\t\tg.setColor(new Color(125,138,53));\n\t\tg.fillArc((int)(0.95*x), 3*y, 4*width/50, 9*height/100, 0, 180);\n\t\tg.setColor(Color.BLACK);\n\t\tg.fillOval(19*width/80,183*height/200, width/80 , height/80);\n\t\tg.fillOval(19*width/80, 47*height/50, width/80, height/80);\n\t\tg.fillOval(19*width/80, 89*height/100, width/80, height/80);\n\t\t\n\t\t// This draw person2 watching the tank passing by\n\t\tg.setColor(new Color(205,183,158));\n\t\tg.fillOval((int)(1.5*x), 3*y, 3*width/50, 9*height/100);\n\t\tg.setColor(new Color(125,138,53));\n\t\tg.fillRoundRect((int)(1.5*x), 21*height/25, 3*width/40, 9*height/60,180,90);\n\t\tg.setColor(new Color(125,138,53));\n\t\tg.fillArc((int)(1.45*x), 3*y, 4*width/50, 9*height/100, 0, 180);\n\t\tg.setColor(Color.BLACK);\n\t\tg.fillOval(27*width/80,183*height/200, width/80 , height/80);\n\t\tg.fillOval(27*width/80, 47*height/50, width/80, height/80);\n\t\tg.fillOval(27*width/80, 89*height/100, width/80, height/80);\n\t\t\n\t\t// This draw person3 watching the tank passing by\n\t\tg.setColor(new Color(205,183,158));\n\t\tg.fillOval((int)(2*x), 3*y, 3*width/50, 9*height/100);\n\t\tg.setColor(new Color(125,138,53));\n\t\tg.fillRoundRect((int)(2*x), 21*height/25, 3*width/40, 9*height/60,180,90);\n\t\tg.setColor(new Color(125,138,53));\n\t\tg.fillArc((int)(1.95*x), 3*y, 4*width/50, 9*height/100, 0, 180);\n\t\tg.setColor(Color.BLACK);\n\t\tg.fillOval(7*width/16,183*height/200, width/80 , height/80);\n\t\tg.fillOval(7*width/16, 47*height/50, width/80, height/80);\n\t\tg.fillOval(7*width/16, 89*height/100, width/80, height/80);\n\t\t\n\t\t// This drawperson4 watching the tank passing by\n\t\tg.setColor(new Color(205,183,158));\n\t\tg.fillOval((int)(2.5*x), 3*y, 3*width/50, 9*height/100);\n\t\tg.setColor(new Color(125,138,53));\n\t\tg.fillRoundRect((int)(2.5*x), 21*height/25, 3*width/40, 9*height/60,180,90);\n\t\tg.setColor(new Color(125,138,53));\n\t\tg.fillArc((int)(2.45*x), 3*y, 4*width/50, 9*height/100, 0, 180);\n\t\tg.setColor(Color.BLACK);\n\t\tg.fillOval(43*width/80,183*height/200, width/80 , height/80);\n\t\tg.fillOval(43*width/80, 47*height/50, width/80, height/80);\n\t\tg.fillOval(43*width/80, 89*height/100, width/80, height/80);\n\t\t\n\t\t// This draw person5 watching the tank passing by\n\t\tg.setColor(new Color(205,183,158));\n\t\tg.fillOval((int)(3*x), 3*y, 3*width/50, 9*height/100);\n\t\tg.setColor(new Color(125,138,53));\n\t\tg.fillRoundRect((int)(3*x), 21*height/25, 3*width/40, 9*height/60,180,90);\n\t\tg.setColor(new Color(125,138,53));\n\t\tg.fillArc((int)(2.95*x), 3*y, 4*width/50, 9*height/100, 0, 180);\n\t\tg.setColor(Color.BLACK);\n\t\tg.fillOval(51*width/80,183*height/200, width/80 , height/80);\n\t\tg.fillOval(51*width/80, 47*height/50, width/80, height/80);\n\t\tg.fillOval(51*width/80, 89*height/100, width/80, height/80);\n\t\t\n\t\t// This draw a small plane flying across the screen with a banner \n\t\tg.setColor(new Color(255,87,51));\n\t\tg.fillRoundRect(-xOffset+(int)(0.75*width),0, width/8, height/9, 90, 90);\n\t\t\n\t\t\n\t\tg.setColor(new Color(218,247,166));\n\t\tg.fillRect(-xOffset+4*width/5,0,width/5,height/9);\n\t\t\n\t\tg.setColor(new Color(8,24,69));\n\t\tg.fillRoundRect(-xOffset+(int)(0.85*width),height/27,width/20,height/20,180,90);\n\t\t\n\t\t\n\t\n\t\t\n\t\t\n\t\t// Put your code above this line. This makes the drawing smoother.\n\t\tToolkit.getDefaultToolkit().sync();\n\t}", "public void drawArc(int num1, int num2) {\n\t\t//Gdx.app.log(\"renderer\", String.valueOf(((CercleObstacle) myWorld.getObstacles()[num1]).getArcs()[num2].getRayon()));\n \tshapeRenderer.arc(((CercleObstacle) myWorld.getObstacles()[num1]).getArcs()[num2].getPosition().x,\n \t\t((CercleObstacle) myWorld.getObstacles()[num1]).getArcs()[num2].getPosition().y,\n \t\t((CercleObstacle) myWorld.getObstacles()[num1]).getArcs()[num2].getRayon(),\n \t\t((CercleObstacle) myWorld.getObstacles()[num1]).getArcs()[num2].getAngleDepart(),\n \t\t((CercleObstacle) myWorld.getObstacles()[num1]).getArcs()[num2].getAngle());\n }", "public RailRoad() {}", "public Road(Town source, Town destination, String name) {\r\n\t\tthis.source = source;\r\n\t\tthis.destination = destination;\r\n\t\tthis.vertices = new HashSet<Town>();\r\n\t\tvertices.add(source);\r\n\t\tvertices.add(destination);\r\n\t\t\r\n\t\tthis.name = name;\r\n\t}", "@Override\n public void paintComponent(Graphics g) {\n Graphics2D g2 = (Graphics2D) g;\n g2.setStroke(new BasicStroke(WALL));\n int[] xs = {BORDER + WALL, BORDER, BORDER, BORDER + (width-1)*SIZE + WALL};\n int[] ys = {BORDER, BORDER, BORDER + height*SIZE, BORDER + height*SIZE};\n g2.drawPolyline(xs, ys, 4);\n int[] xs2 = {BORDER + SIZE - WALL, BORDER + width*SIZE, BORDER + width*SIZE, BORDER + width*SIZE - WALL};\n g2.drawPolyline(xs2, ys, 4);\n // code that was used to create the intermediate images\n// g2.setColor(Color.LIGHT_GRAY);\n// for(int i = 1; i < height; i++) {\n// int where = BORDER + i*SIZE;\n// g2.drawLine(BORDER + WALL, where, BORDER + width * SIZE - WALL, where);\n// }\n// for(int i = 1; i < width; i++) {\n// int where = BORDER + i*SIZE;\n// g2.drawLine(where, BORDER + WALL, where, BORDER + height * SIZE - WALL);\n// }\n g2.setColor(Color.blue);\n for(Wall wall : walls) {\n drawWall(g2, wall);\n }\n }", "public RoutingResourceGraph() {\n ex = new RunGraph(3,2);\n squares = new JLabel[ex.getGraphSize()][ex.getGraphSize()];\n squares_sinks = new JLabel[ex.getGraphSize()][ex.getGraphSize()];\n squares_wires = new JLabel[2 * ex.getGraphSize() * ex.getGraphSize()][ex.getWireSize()];\n switches = new JToggleButton[ex.getGraphSize()][ex.getGraphSize()];\n ex.initialize();\n initComponents();\n initialize();\n add_edge();\n ex.find_shortest_path();\n showCong();\n showGraph();\n }", "@Override\n\tpublic void paint(Graphics g) {\n\t\tGraphics2D g2d = (Graphics2D) g;\n\t\tg2d.setColor(Color.RED);\n\t\t\n\t\t // Compute Nodes\n\t\t float inc = (float) ((180*2.0)/size);\n\t\t int x[] = new int[size];\n\t\t int y[] = new int[size];\n\t\t float d= 0;\n\t\t d= 180 - inc/2;\n\t\t for (int i=0; i<size; i++){//$d=M_PI-$inc/2.0; $i<$k; $i++, $d+=$inc) {\n\t\t x[i] = (int) ((width/2) - (Math.sin(Math.toRadians(d))*(width/2)*(0.8)));\n\t\t y[i] = (int) (high - ((high/2) - (Math.cos(Math.toRadians(d)))*(high/2)*(0.8)));\n\t\t d+= inc;\n\t\t }\n\t\t for (int i=0; i<size; i++){\n\t\t g2d.fillOval(x[i], y[i], 2*rad, 2*rad);\n\t\t }\n\t\t \n\t\t \n\t\t for (int i=0; i<size; i++)\n\t\t\t for (int j=0; j<size; j++)\n\t\t\t {\n\t\t\t \t if (i != j && adj[i*size + j] == '1') {\n\t\t\t \t\t if(directed)\n\t\t\t \t\t {\n\t\t\t \t\t\t //Line2D lin = new Line2D.Float(x[i]+rad, y[i]+rad,x[j]+rad, y[j]+rad);\n\t\t\t\t \t \t//\tg2d.draw(lin);\n\t\t\t \t\t\t \n\t\t\t \t\t\t DrawArrow(g2d, x[i]+rad, y[i]+rad,x[j]+rad, y[j]+rad);\n\t\t\t \t\t\t \n\t\t\t \t\t }\n\t\t\t \t\t else\n\t\t\t \t\t {\n\t\t\t \t\t\t Line2D lin = new Line2D.Float(x[i]+rad, y[i]+rad,x[j]+rad, y[j]+rad);\n\t\t\t\t \t \t\tg2d.draw(lin);\n\t\t\t \t\t }\n\t\t\t \t\t \n\t\t\t \t }\n\t\t\t }\n\t\t \n\t\t \n\t\t/*\n\t\tg2d.fillOval(0, 0, 30, 30);\n\t\tg2d.drawOval(0, 50, 30, 30);\t\t\n\t\tg2d.fillRect(50, 0, 30, 30);\n\t\tg2d.drawRect(50, 50, 30, 30);\n\n\t\tg2d.draw(new Ellipse2D.Double(0, 100, 30, 30));*/\n\t}", "void draw() {\n\t\tSystem.out.println(\"Drawing the Rectange...\");\n\t\t}", "public void createEdges() {\n \tfor(String key : ways.keySet()) {\n \t Way way = ways.get(key);\n \t if(way.canDrive()) {\n \t\tArrayList<String> refs = way.getRefs();\n \t\t\t\n \t\tif(refs.size() > 0) {\n \t\t GPSNode prev = (GPSNode) this.getNode(refs.get(0));\n \t\t drivableNodes.add(prev);\n \t\t \n \t\t GPSNode curr = null;\n \t\t for(int i = 1; i <refs.size(); i++) {\n \t\t\tcurr = (GPSNode) this.getNode(refs.get(i));\n \t\t\tif(curr == null || prev == null)\n \t\t\t continue;\n \t\t\telse {\n \t\t\t double distance = calcDistance(curr.getLatitude(), curr.getLongitude(),\n \t\t\t\t prev.getLatitude(), prev.getLongitude());\n\n \t\t\t GraphEdge edge = new GraphEdge(prev, curr, distance, way.id);\n \t\t\t prev.addEdge(edge);\n \t\t\t curr.addEdge(edge);\n \t\t\t \n \t\t\t drivableNodes.add(curr);\n \t\t\t prev = curr;\n \t\t\t}\n \t\t }\t\n \t\t}\n \t }\n \t}\n }", "public static void main(String[] args) {\n\t\tint grid[][] = new int[][]\n\t\t\t { \n\t\t\t { 1, 1, 0, 0, 0, 0, 1, 0, 0, 0 }, \n\t\t\t { 0, 1, 0, 1, 0, 0, 0, 1, 0, 0 }, \n\t\t\t { 0, 0, 0, 1, 0, 0, 1, 0, 1, 0 }, \n\t\t\t { 1, 1, 1, 1, 0, 1, 1, 1, 1, 0 }, \n\t\t\t { 0, 0, 0, 1, 0, 0, 0, 1, 0, 1 }, \n\t\t\t { 0, 1, 0, 0, 0, 0, 1, 0, 1, 1 }, \n\t\t\t { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, \n\t\t\t { 0, 1, 0, 0, 0, 0, 1, 0, 0, 0 }, \n\t\t\t { 0, 0, 1, 1, 1, 1, 0, 1, 1, 0 } \n\t\t\t };\n\t\t\n // Step 1: Obtain an instance of GridBasedTrafficControl.\n Configurator cfg = new DefaultConfigurator();\n GridBasedTrafficControl gbtc = cfg.getGridBasedTrafficControl(grid);\n\t\t\n\t // Step 2: Obtain path for Journey-1.\n\t Point source1 = new Point(0, 0);\n\t Point dest1 = new Point(3,4);\t \n\t String vehicleId1 = formVehicleId(source1);\n\t List<Point> path1 = gbtc.allocateRoute(vehicleId1, source1, dest1);\n\t System.out.println(\"Route for Journey-1:\" + path1);\n\t \n\t // Step 3: Obtain path for Journey-2.\n\t // This call will not return a route as the available route conflicts with the route\n\t // allocated for Journey-1.\n\t Point source2 = new Point(3, 0);\n\t Point dest2 = new Point(2,4);\n\t String vehicleId2 = formVehicleId(source2);\n\t List<Point> path2 = gbtc.allocateRoute(vehicleId2, source2, dest2);\n\t System.out.println(\"Route for Journey-2:\" + path2);\n\t \n\t // Step 4: Start Journey-1 and mark Journey-1 as complete.\n\t GridConnectedVehicle vehicle1 = new GridConnectedVehicle(vehicleId1, gbtc);\n\t vehicle1.selfDrive(path1);\n\t gbtc.markJourneyComplete(vehicleId1, source1, dest1);\n\t \n\t // Step 5: Retry call to obtain path for Journey-2.\n\t // This call should return a valid path as Journey-1 was marked as complete.\n\t path2 = gbtc.allocateRoute(formVehicleId(source2), source2, dest2);\n\t System.out.println(\"Route for Journey-2:\" + path2);\n\t \n\t // Step 6: Start Journey-2 and mark Journey-2 as complete.\n\t GridConnectedVehicle vehicle2 = new GridConnectedVehicle(vehicleId2, gbtc);\n\t vehicle2.selfDrive(path2);\n\t gbtc.markJourneyComplete(vehicleId2, source2, dest2);\n\t}", "@Override\r\n public final void draw(final Rectangle r, final BufferedImage paper) {\n String red;\r\n String green;\r\n String blue;\r\n if (Integer.toHexString(r.getBorderColor().getRed()).length() == 1) {\r\n red = \"0\" + Integer.toHexString(r.getBorderColor().getRed());\r\n } else {\r\n red = Integer.toHexString(r.getBorderColor().getRed());\r\n }\r\n if (Integer.toHexString(r.getBorderColor().getGreen()).length() == 1) {\r\n green = \"0\" + Integer.toHexString(r.getBorderColor().getGreen());\r\n } else {\r\n green = Integer.toHexString(r.getBorderColor().getGreen());\r\n }\r\n if (Integer.toHexString(r.getBorderColor().getBlue()).length() == 1) {\r\n blue = \"0\" + Integer.toHexString(r.getBorderColor().getBlue());\r\n } else {\r\n blue = Integer.toHexString(r.getBorderColor().getBlue());\r\n }\r\n String color = \"#\" + red + green + blue;\r\n\r\n draw(new Line((String.valueOf(r.getxSus())), String.valueOf(r.getySus()),\r\n String.valueOf(r.getxSus() + r.getLungime() - 1), String.valueOf(r.getySus()),\r\n color, String.valueOf(r.getBorderColor().getAlpha()), paper), paper);\r\n\r\n draw(new Line((String.valueOf(r.getxSus() + r.getLungime() - 1)),\r\n String.valueOf(r.getySus()), String.valueOf(r.getxSus() + r.getLungime() - 1),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), color,\r\n String.valueOf(r.getBorderColor().getAlpha()), paper), paper);\r\n\r\n draw(new Line((String.valueOf(r.getxSus() + r.getLungime() - 1)),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), String.valueOf(r.getxSus()),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), color,\r\n String.valueOf(r.getBorderColor().getAlpha()), paper), paper);\r\n\r\n draw(new Line((String.valueOf(r.getxSus())),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), String.valueOf(r.getxSus()),\r\n String.valueOf(r.getySus()), color, String.valueOf(r.getBorderColor().getAlpha()),\r\n paper), paper);\r\n\r\n for (int i = r.getxSus() + 1; i < r.getxSus() + r.getLungime() - 1; i++) {\r\n for (int j = r.getySus() + 1; j < r.getySus() + r.getInaltime() - 1; j++) {\r\n if (checkBorder(i, j, paper)) {\r\n paper.setRGB(i, j, r.getFillColor().getRGB());\r\n }\r\n }\r\n }\r\n }", "public void drawBed(double x, double y, double length, double height){\n double bedPostLength = length/15;\n double mattressLength = length - bedPostLength*2;\n double mattressHeight = height/10 * 6;\n //for measurement\n double bedunit = height/10;\n \n //make both bed posts\n Rectangle2D.Double fstpost = new Rectangle2D.Double(x, y, bedPostLength, height);\n Rectangle2D.Double sndpost = new Rectangle2D.Double(x+length-bedPostLength, y, bedPostLength, height);\n \n //make slat\n Rectangle2D.Double slat = new Rectangle2D.Double(x+bedPostLength, y+(bedunit*8), mattressLength, bedunit);\n \n //make mattress\n Rectangle2D.Double mattress = new Rectangle2D.Double(x+bedPostLength, y+(bedunit*2), mattressLength, (bedunit*7));\n \n //put bed together\n \n GeneralPath wholeBed = this.get();\n \n wholeBed.append(fstpost, false);\n wholeBed.append(sndpost, false);\n wholeBed.append(slat, false);\n wholeBed.append(mattress, false);\n }", "public void draw()\n {\n drawLine(x1, y1, x2, y2);\n }", "private void drawRoute(LatLng prevCoords, LatLng curCoords) {\n\n if(!isRequiredMetersComplete()){\n map.addPolyline(new PolylineOptions()\n .add(prevCoords, curCoords)\n .width(10)\n .color(getResources().getColor(R.color.colorPrimary)));\n }\n else{\n if(isOverPace){\n map.addPolyline(new PolylineOptions()\n .add(prevCoords, curCoords)\n .width(10)\n .color(getResources().getColor(R.color.goodGreen)));\n }else{\n map.addPolyline(new PolylineOptions()\n .add(prevCoords, curCoords)\n .width(10)\n .color(getResources().getColor(R.color.badRed)));\n }\n }\n }", "@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n g.drawImage(map.getImage(), mapX, mapY, mapWidth, mapHeight, null);\n //draw hexagon\n for (int j = 0; j < BOARD_HEIGHT; j++) {\n for (int i = 0; i < BOARD_WIDTH; i++) {\n gridCell.setCellIndex(i, j);\n if (mapCells[j][i] != 0) {\n gridCell.computeCorners(mCornersX, mCornersY);\n// g.setColor((mapCells[j][i] == L_ON) ? Color.ORANGE : Color.GRAY);\n// g.fillPolygon(mCornersX, mCornersY, NUM_HEX_CORNERS);\n g.drawPolygon(mCornersX, mCornersY, NUM_HEX_CORNERS);\n }\n }\n }\n }", "protected void building(double xCoord, double yCoord, double len, double width, double height)\n {\n double x1 = (xCoord - (width/2)); // Low x\n double x2 = (xCoord + (width/2)); // High x\n double y1 = (yCoord - (len/2)); // Low y\n double y2 = (yCoord + (len/2)); // High y\n\n Vertex vertex1, vertex2, vertex3;\n\n Triple pos1, pos2, pos3, pos4, pos5, pos6, pos7, pos8, col1, col2, col3, col4;\n Vertex vert1, vert2, vert3;\n\n pos1 = new Triple(x1, y1, 0); \n pos2 = new Triple(x2, y1, 0); \n pos3 = new Triple(x2, y1, height);\n pos4 = new Triple(x1, y1, height);\n pos5 = new Triple(x1, y2, 0); \n pos6 = new Triple(x2, y2, 0); \n pos7 = new Triple(x2, y2, height);\n pos8 = new Triple(x1, y2, height);\n\n col1 = new Triple(1, 0, 0); \n col2 = new Triple(0, 1, 0); \n col3 = new Triple(0, 0, 1); \n col4 = new Triple(1, 0, 1); \n \n // Front Triangles\n frozenSoups.addTri( new Triangle(new Vertex(pos1, 0, 0), \n new Vertex(pos2, 0, 1), \n new Vertex(pos3, 1, 1), \n\t\t\t\t 25 ) );\n\n frozenSoups.addTri( new Triangle(new Vertex(pos3, 1, 1), \n new Vertex(pos4, 1, 0), \n new Vertex(pos1, 0, 0),\n 25 ) );\n \n // Left Triangles\n frozenSoups.addTri( new Triangle(new Vertex(pos1, 0, 0), \n new Vertex(pos5, 0, 1), \n new Vertex(pos8, 1, 1),\n 26 ) );\n\n frozenSoups.addTri( new Triangle(new Vertex(pos8, 1, 1), \n new Vertex(pos4, 1, 0), \n new Vertex(pos1, 0, 0),\n 26 ) );\n\n // Right Triangles\n frozenSoups.addTri( new Triangle(new Vertex(pos2, 0, 0), \n new Vertex(pos6, 0, 1), \n new Vertex(pos7, 1, 1),\n 24 ) );\n\n frozenSoups.addTri( new Triangle(new Vertex(pos7, 1, 1), \n new Vertex(pos3, 1, 0), \n new Vertex(pos2, 0, 0),\n 24 ) );\n\n // Back Triangles\n frozenSoups.addTri( new Triangle(new Vertex(pos5, 0, 0), \n new Vertex(pos6, 0, 1), \n new Vertex(pos7, 1, 1),\n 27 ) );\n\n frozenSoups.addTri( new Triangle(new Vertex(pos7, 1, 1), \n new Vertex(pos8, 1, 0), \n new Vertex(pos5, 0, 0),\n 27 ) );\n\n // Top Triangles\n frozenSoups.addTri( new Triangle(new Vertex(pos4, 0, 0), \n new Vertex(pos3, 0, 1), \n new Vertex(pos7, 1, 1),\n 28 ) );\n\n frozenSoups.addTri( new Triangle(new Vertex(pos7, 1, 1), \n new Vertex(pos8, 1, 0), \n new Vertex(pos4, 0, 0),\n 28 ) );\n }", "public void draw(Graphics2D g2)\n {\n Rectangle2D.Double land= new Rectangle2D.Double(xleft, ybottom, 10000, 100);\n Color mycolor= new Color(255, 222, 156);\n g2.setColor(mycolor);\n g2.draw(land);\n g2.fill(land);\n g2.draw(land);\n \n }", "@Override\r\n\t\tpublic void paintComponent(Graphics g) {\r\n\r\n\t\t\tsuper.paintComponent(g); // Fills the background color.\r\n\r\n\t\t\tg.setColor(Color.DARK_GRAY);\r\n\t\t\tg.fillRect(10, 10, columns * squareSize + 1, rows * squareSize + 1);\r\n\r\n\t\t\tfor (int r = 0; r < rows; r++) {\r\n\t\t\t\tfor (int c = 0; c < columns; c++) {\r\n\t\t\t\t\tif (grid[r][c] == EMPTY) {\r\n\t\t\t\t\t\tg.setColor(Color.WHITE);\r\n\t\t\t\t\t} else if (grid[r][c] == ROBOT) {\r\n\t\t\t\t\t\tg.setColor(Color.RED);\r\n\t\t\t\t\t} else if (grid[r][c] == TARGET) {\r\n\t\t\t\t\t\tg.setColor(Color.GREEN);\r\n\t\t\t\t\t} else if (grid[r][c] == OBST) {\r\n\t\t\t\t\t\tg.setColor(Color.BLACK);\r\n\t\t\t\t\t} else if (grid[r][c] == FRONTIER) {\r\n\t\t\t\t\t\tg.setColor(Color.BLUE);\r\n\t\t\t\t\t} else if (grid[r][c] == CLOSED) {\r\n\t\t\t\t\t\tg.setColor(Color.CYAN);\r\n\t\t\t\t\t} else if (grid[r][c] == ROUTE) {\r\n\t\t\t\t\t\tg.setColor(Color.YELLOW);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tg.fillRect(11 + c * squareSize, 11 + r * squareSize, squareSize - 1, squareSize - 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (drawArrows.isSelected()) {\r\n\t\t\t\t// We draw all arrows from each open or closed state\r\n\t\t\t\t// to its predecessor.\r\n\t\t\t\tfor (int r = 0; r < rows; r++) {\r\n\t\t\t\t\tfor (int c = 0; c < columns; c++) {\r\n\t\t\t\t\t\t// If the current cell is the goal and the solution has\r\n\t\t\t\t\t\t// been found,\r\n\t\t\t\t\t\t// or belongs in the route to the target,\r\n\t\t\t\t\t\t// or is an open state,\r\n\t\t\t\t\t\t// or is a closed state but not the initial position of\r\n\t\t\t\t\t\t// the robot\r\n\t\t\t\t\t\tif ((grid[r][c] == TARGET && found) || grid[r][c] == ROUTE || grid[r][c] == FRONTIER\r\n\t\t\t\t\t\t\t\t|| (grid[r][c] == CLOSED && !(r == robotStart.row && c == robotStart.col))) {\r\n\t\t\t\t\t\t\t// The tail of the arrow is the current cell, while\r\n\t\t\t\t\t\t\t// the arrowhead is the predecessor cell.\r\n\t\t\t\t\t\t\tCell head;\r\n\t\t\t\t\t\t\tif (grid[r][c] == FRONTIER) {\r\n\t\t\t\t\t\t\t\tif (dijkstra.isSelected()) {\r\n\t\t\t\t\t\t\t\t\thead = findPrev(graph, new Cell(r, c));\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\thead = findPrev(openSet, new Cell(r, c));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\thead = findPrev(closedSet, new Cell(r, c));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// The coordinates of the center of the current cell\r\n\t\t\t\t\t\t\tint tailX = 11 + c * squareSize + squareSize / 2;\r\n\t\t\t\t\t\t\tint tailY = 11 + r * squareSize + squareSize / 2;\r\n\t\t\t\t\t\t\t// The coordinates of the center of the predecessor\r\n\t\t\t\t\t\t\t// cell\r\n\t\t\t\t\t\t\tint headX = 11 + head.col * squareSize + squareSize / 2;\r\n\t\t\t\t\t\t\tint headY = 11 + head.row * squareSize + squareSize / 2;\r\n\t\t\t\t\t\t\t// If the current cell is the target\r\n\t\t\t\t\t\t\t// or belongs to the path to the target ...\r\n\t\t\t\t\t\t\tif (grid[r][c] == TARGET || grid[r][c] == ROUTE) {\r\n\t\t\t\t\t\t\t\t// ... draw a red arrow directing to the target.\r\n\t\t\t\t\t\t\t\tg.setColor(Color.RED);\r\n\t\t\t\t\t\t\t\tdrawArrow(g, tailX, tailY, headX, headY);\r\n\t\t\t\t\t\t\t\t// Else ...\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t// ... draw a black arrow to the predecessor\r\n\t\t\t\t\t\t\t\t// cell.\r\n\t\t\t\t\t\t\t\tg.setColor(Color.BLACK);\r\n\t\t\t\t\t\t\t\tdrawArrow(g, headX, headY, tailX, tailY);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public void draw(Frame frame) {\n\t\t// Draw vehicle corner points.\n\t\tif (this.points != null) {\n\t\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t\tif (this.points[i] == null) continue;\n\t\t\t\tImgproc.circle(frame.getSource(), this.points[i], 3, new Scalar(0, 0, 255));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Draw the vehicles back point.\n\t\tif (this.back != null) {\n\t\t\tImgproc.circle(frame.getSource(), this.back, 3, new Scalar(0, 0, 255));\n\t\t}\n\t\t\n\t\t// Draw the vehicles front point.\n\t\tif (this.front != null) {\n\t\t\tImgproc.circle(frame.getSource(), this.front, 6, new Scalar(0, 0, 255));\n\t\t}\n\t\t\n\t\t// Draw the vehicles center point.\n\t\tif (this.center != null) {\n\t\t\tImgproc.circle(frame.getSource(), this.center, 3, new Scalar(255, 0, 0), Imgproc.FILLED);\n\t\t}\n\t}", "public void draw() {\n\t\tp.pushStyle();\n\t\t{\n\t\t\tp.rectMode(PConstants.CORNER);\n\t\t\tp.fill(360, 0, 70, 180);\n\t\t\tp.rect(60f, 50f, p.width - 110f, p.height * 2f * 0.33f - 50f);\n\t\t\tp.rect(60f, p.height * 2f * 0.33f + 50f, p.width - 110f, p.height * 0.33f - 130f);\n\t\t}\n\t\tp.popStyle();\n\n\t\tlineChart.draw(40f, 40f, p.width - 80f, p.height * 2f * 0.33f - 30f);\n\t\tlineChart2.draw(40f, p.height * 2f * 0.33f + 45f, p.width - 80f, p.height * 0.33f - 110f);\n\t\t//p.line(x1, y1, x2, y2);\n\n\t}", "public VisuCoordinateTranslator() {\r\n limitedDirections = new HashMap<String, Integer>();\r\n limitedCoordinates = new HashMap<String, Shape>();\r\n limitedGroundCoordinates = new HashMap<String, Float[]>();\r\n Float c[] = {22f, 2f, 8.5f, -1.7f, 0f};\r\n limitedDirections.put(\"Status_GWP01\", 0);\r\n ArrayList a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n StraightShape ss = new StraightShape(a);\r\n limitedCoordinates.put(\"0.1.0\", ss);\r\n\r\n\r\n c = new Float[]{-0.97f, 0.88f, 0f, -0.1f, 1f};\r\n limitedDirections.put(\"Status_ETKa1\", 1);\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n ss = new StraightShape(a);\r\n limitedCoordinates.put(\"1.1.0\", ss);\r\n\r\n limitedDirections.put(\"Status_ETKa2\", 1);\r\n\r\n c = new Float[]{0.07f, -0.74f, 0f, 0f, 1f};\r\n limitedDirections.put(\"LAM_ETKa1\", 2);\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n ss = new StraightShape(a);\r\n limitedCoordinates.put(\"2.1.0\", ss);\r\n\r\n c = new Float[]{0.07f, -0.74f, 0f, 0f, 1f};\r\n limitedDirections.put(\"LAM_ETKa2\", 2);\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n ss = new StraightShape(a);\r\n\r\n\r\n limitedCoordinates.put(\"2.1.0\", ss);\r\n\r\n ArrayList<ArrayList<Float>> arrayOval = new ArrayList<ArrayList<Float>>();\r\n c = new Float[]{6.3f, -2f, 7.3f, -14.38f, 0f};//straight_1\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n\r\n c = new Float[]{-2f, -4.8f, 7.3f, -14.38f, 0f};//straight_2\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n\r\n c = new Float[]{3.072f, 0.0695f, 2.826f, -5.424f, -17.2f, 7.3f, 1f};//circular_3\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n\r\n c = new Float[]{-4.8f, -2f, 7.3f, -19.715f, 0f};//straight_4\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n\r\n c = new Float[]{-2f, 6.3f, 7.3f, -19.715f, 0f};//straight_5\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n\r\n c = new Float[]{3.038f, 0.1032f, 2.833f, 6.567f, -17.2f, 7.3f, 1f};//circular_6\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n\r\n c = new Float[]{3.1302f, 0.0114f, 2.8202f, -2.0298f, -17.2f, 7.3f, 1f};//circular_7\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n \r\n c = new Float[]{0.41f, 0.48f, 0.6f, 0.67f, 0.78f, 0.92f};//partitions\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n\r\n\r\n OvalShape os = new OvalShape(arrayOval);\r\n\r\n for (int i = 2; i < 11; i++) {\r\n for (int j = 0; j < 3; j++) {\r\n limitedCoordinates.put(\"1.\" + i + \".\" + j, os);\r\n limitedCoordinates.put(\"2.\" + i + \".\" + j, ss);\r\n }\r\n }\r\n\r\n \r\n \r\n c = new Float[]{2.0785f, -1.8972f};\r\n limitedGroundCoordinates.put(\"0.1.0\", c);\r\n c = new Float[]{-6.3859f,-0.4682f};\r\n limitedGroundCoordinates.put(\"1.1.0\", c);\r\n }", "void drawShape() {\n System.out.println(\"Drawing Triangle\");\n this.color.addColor();\n }", "public static void setBoard() {\n\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\tStdDraw.filledRectangle(500, 500, 1000, 1000);\n\t\tStdDraw.setPenColor(StdDraw.BLACK);\n\t\tStdDraw.filledCircle(200, 800, 35);\n\t\tStdDraw.filledCircle(500, 800, 35);\n\t\tStdDraw.filledCircle(800, 800, 35);\n\t\tStdDraw.filledCircle(200, 200, 35);\n\t\tStdDraw.filledCircle(500, 200, 35);\n\t\tStdDraw.filledCircle(800, 200, 35);\n\t\tStdDraw.filledCircle(200, 500, 35);\n\t\tStdDraw.filledCircle(800, 500, 35);\n\t\tStdDraw.filledCircle(350, 650, 35);\n\t\tStdDraw.filledCircle(500, 650, 35);\n\t\tStdDraw.filledCircle(650, 650, 35);\n\t\tStdDraw.filledCircle(350, 350, 35);\n\t\tStdDraw.filledCircle(500, 350, 35);\n\t\tStdDraw.filledCircle(650, 350, 35);\n\t\tStdDraw.filledCircle(350, 500, 35);\n\t\tStdDraw.filledCircle(650, 500, 35);\n\n\t\tStdDraw.setPenRadius(0.01);\n\t\tStdDraw.line(200, 200, 800, 200);\n\t\tStdDraw.line(200, 800, 800, 800);\n\t\tStdDraw.line(350, 350, 650, 350);\n\t\tStdDraw.line(350, 650, 650, 650);\n\t\tStdDraw.line(200, 500, 350, 500);\n\t\tStdDraw.line(650, 500, 800, 500);\n\t\tStdDraw.line(200, 800, 200, 200);\n\t\tStdDraw.line(800, 800, 800, 200);\n\t\tStdDraw.line(350, 650, 350, 350);\n\t\tStdDraw.line(650, 650, 650, 350);\n\t\tStdDraw.line(500, 800, 500, 650);\n\t\tStdDraw.line(500, 200, 500, 350);\n\n\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\tStdDraw.filledCircle(80, 200, 35);\n\t\tStdDraw.filledCircle(80, 300, 35);\n\t\tStdDraw.filledCircle(80, 400, 35);\n\t\tStdDraw.filledCircle(80, 500, 35);\n\t\tStdDraw.filledCircle(80, 600, 35);\n\t\tStdDraw.filledCircle(80, 700, 35);\n\n\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\tStdDraw.filledCircle(920, 200, 35);\n\t\tStdDraw.filledCircle(920, 300, 35);\n\t\tStdDraw.filledCircle(920, 400, 35);\n\t\tStdDraw.filledCircle(920, 500, 35);\n\t\tStdDraw.filledCircle(920, 600, 35);\n\t\tStdDraw.filledCircle(920, 700, 35);\n\n\t\tStdDraw.setPenColor(StdDraw.BLACK);\n\n\t}", "@Override\n public void draw(GraphicsContext gc) {\n gc.setFill(getFillColor());\n gc.setStroke(getStrokeColor());\n gc.setLineWidth(getStrokeWidth());\n gc.fillRect(getX1(), getY1(), getX2() - getX1(), getX2() - getX1());\n gc.strokeRect(getX1(), getY1(), getX2() - getX1(), getX2() - getX1());\n }", "@Override\n public void draw(GraphicsContext gc){\n for(int i = 1; i < path.size(); i++) {\n Point2D from = path.get(i-1);\n Point2D to = path.get(i);\n gc.strokeLine(from.getX(), from.getY(), to.getX(), to.getY());\n }\n }", "public void draw(Canvas canvas, MapView mapv, boolean shadow){\n\t super.draw(canvas, mapv, shadow);\n\n\t // paint object to define the prefrences of the line to be drawn\n\t Paint mPaint = new Paint();\n\t mPaint.setDither(true);\n\t mPaint.setColor(Color.RED);\n\t mPaint.setStyle(Paint.Style.FILL_AND_STROKE);\n\t mPaint.setStrokeJoin(Paint.Join.ROUND);\n\t mPaint.setStrokeCap(Paint.Cap.ROUND);\n\t mPaint.setStrokeWidth(20);\n\n\t GeoPoint gP1 = goeP1;\n\t GeoPoint gP2 = geoP2;\n\n\t \n\t // the points the will represent the start and finish of the line.\n\t Point p1 = new Point();\n\t Point p2 = new Point();\n\n\t // path object the draw a reference path.\n\t Path path = new Path();\n // A projection object which converts between coordinates and pixels on the screen.\n\t Projection projection = mapv.getProjection();\n\t // converting of coordinates to pixel\n\t projection.toPixels(gP1, p1);\n\t projection.toPixels(gP2, p2);\n// draw a reference path\n\t path.moveTo(p2.x, p2.y);\n\t path.lineTo(p1.x,p1.y);\n// draw the actual path.\n\t canvas.drawPath(path, mPaint);\t\n\t }", "public RoadTest()\n {\n }", "public final void draw(Graphics2D g) {\n if (fillColor == null) {\n fillColor = this.myColor();\n }\n\n super.draw(g);\n\n // refresh the width and height attributes\n refreshDimensions(g);\n\n int nameFieldHeight = calculateNameFieldHeight(g);\n int attributeFieldHeight = calculateAttributeFieldHeight(g);\n int methodFieldHeight = calculateMethodFieldHeight(g);\n int startingX = getX();\n int startingY = getY();\n\n // determine the outline of the rectangle representing the class\n g.setPaint(fillColor);\n Shape shape = new Rectangle2D.Double(startingX, startingY, width, height);\n g.fill(shape);\n\n Stroke originalStroke = g.getStroke();\n g.setStroke(new BasicStroke(1.2f));\n originalStroke = g.getStroke();\n if (isSelected()) {\n g.setStroke(new BasicStroke(2));\n g.setPaint(highlightColor);\n } else {\n g.setStroke(originalStroke);\n g.setPaint(outlineColor);\n }\n\n g.draw(shape);\n g.setStroke(originalStroke);\n g.setPaint(outlineColor);\n\n // draw the inner lines\n g.drawLine(startingX, startingY + nameFieldHeight, startingX + width, startingY + nameFieldHeight);\n g.drawLine(startingX, startingY + nameFieldHeight + attributeFieldHeight, startingX + width,\n startingY + nameFieldHeight + attributeFieldHeight);\n\n FontRenderContext frc = g.getFontRenderContext();\n int currentY = 0;\n\n currentY = drawStereotype(g, frc, startingX, startingY, currentY); //hook for design class\n\n // draw class name\n if (!abstractClass.getName().equals(\"\")) {\n String name = abstractClass.getName();\n TextLayout layout = new TextLayout(name, nameFont, frc);\n Rectangle2D bounds = layout.getBounds();\n int nameX = ((width - (int) bounds.getWidth()) / 2) - (int) bounds.getX();\n int nameY = currentY + nameFieldYOffset - (int) bounds.getY();\n\n g.setFont(nameFont);\n g.drawString(name, startingX + nameX, startingY + nameY);\n }\n\n // draw the attributes\n g.setFont(attributeFont);\n\n currentY = nameFieldHeight + 2;\n\n int attributeX;\n int attributeY;\n TextLayout layout;\n Rectangle2D bounds;\n\n String name;\n Iterator iterator = abstractClass.getAttributes().iterator();\n while (iterator.hasNext()) {\n name = ((Attribute) iterator.next()).toString();\n layout = new TextLayout(name, attributeFont, frc);\n bounds = layout.getBounds();\n attributeX = attributeFieldXOffset - (int) bounds.getX();\n attributeY = currentY + attributeFieldYOffset - (int) bounds.getY();\n g.drawString(name, startingX + attributeX, startingY + attributeY);\n currentY = currentY + attributeFieldYOffset + (int) bounds.getHeight();\n }\n\n currentY = nameFieldHeight + attributeFieldHeight + 2;\n currentY = drawMethods(g, frc, startingX, startingY, currentY);\n }", "public void draw(Graphics g){\n\n g.setColor(Color.red);\n g.drawLine(x1,y1,x2,y2);\n g.drawLine(x2,y2,x3,y3);\n g.drawLine(x3,y3,x1,y1);\n g.setFont(new Font(\"Courier\", Font.BOLD, 12));\n DecimalFormat fmt = new DecimalFormat(\"0.##\"); \n g.setColor(Color.blue);\n g.drawString(fmt.format(perimeter()) + \" \" + name,x1+2 , y1 -2);\n \n }", "public void setRoad(int a, int b, int size) {\n if (size != 0 && roads[a][b] == 0) {\n roadCount++;\n inDegree[b]++;\n outDegree[a]++;\n } else if (size == 0 && roads[a][b] != 0) {\n roadCount--;\n inDegree[b]--;\n outDegree[a]--;\n }\n roads[a][b] = size;\n }", "public Street (SimpleMap roadMap) {\n if (roadMap != null) roadMap.addToMap(this);\n }", "public void draw(GraphicsContext gc) {\n // draw the base grid\n gc.setFill(Color.LIGHTGREY);\n for (int i = 0; i < board.side(); i++)\n for (int j = (i % 2 == 0) ? 1 : 0; j < board.side(); j += 2)\n gc.fillRect(startX + j * unitLength, startY + i * unitLength,\n unitLength, unitLength);\n\n // draw boundaries\n gc.setStroke(Color.BLACK);\n gc.strokeRect(startX, startY, sideLength, sideLength);\n\n // highlight legal positions\n for (BoardPos pos : legalPos) {\n gc.setFill(Color.ORANGE);\n gc.fillRect(startX + pos.getX() * unitLength,\n startY + pos.getY() * unitLength, unitLength, unitLength);\n gc.setFill(Color.LIGHTYELLOW);\n if (pos.route != null)\n for (BoardPos step : pos.route)\n gc.fillRect(startX + step.getX() * unitLength,\n startY + step.getY() * unitLength, unitLength, unitLength);\n }\n\n // draw pieces\n for (int i = 0; i < board.side(); i++)\n for (int j = 0; j < board.side(); j++)\n board.get(i, j).draw(gc, startX + i * unitLength,\n startY + j * unitLength, pieceMargin, unitLength);\n }", "public RoadSign() {\n super(0, 0, \"roadsign_speed_50.png\");\n }", "void setRoute(Shape route);", "public void paint(Graphics g) {\n\t\t\n\t\t//find slope - use to calculate position \n\t\tArrayList <Integer> Xpos = new ArrayList<Integer>();\n\t\tArrayList <Integer> Ypos = new ArrayList<Integer>();\n\n\t\t//contain all the x and y coordinates for horizontal lines\n\t\tArrayList <Integer> HorizXOutline = new ArrayList<Integer>();\n\t\tArrayList <Integer> HorizYOutline = new ArrayList<Integer>();\n\t\t//contain all x any y points for veritical lines\n\t\tArrayList <Integer> VertOutlineX = new ArrayList<Integer>();\n\t\tArrayList <Integer> VertOutlineY = new ArrayList<Integer>();\n\t\t//contain all x and y points of postive and pos diag lines\n\t\tArrayList <Integer> PosDiagOutlineX = new ArrayList<Integer>();\n\t\tArrayList <Integer> PosDiagOutlineY = new ArrayList<Integer>();\n\t\t//contain all x and y points of postive and neg diag lines\n\t\tArrayList <Integer> NegDiagOutlineX = new ArrayList<Integer>();\n\t\tArrayList <Integer> NegDiagOutlineY = new ArrayList<Integer>();\n\n\t\tg.setColor(Color.green);\n\t\t//adding outer shape x coord\n\t\tXpos.add(100);Xpos.add(100);Xpos.add(100);Xpos.add(200);\n\t\tXpos.add(200);Xpos.add(300);Xpos.add(100);Xpos.add(200);\n\t\tXpos.add(300);Xpos.add(400);Xpos.add(300);Xpos.add(350);\n\t\tXpos.add(400);Xpos.add(350);Xpos.add(300);Xpos.add(350);\n\t\tXpos.add(400);Xpos.add(350);Xpos.add(200);Xpos.add(300);//Xpos.add(120);Xpos.add(120);\n\t\tSystem.out.println(Xpos.size());\n\t\t//g.drawArc(100, 10, 200, 200, 0, 360);\n\t\t//adding outer shape y coord\n\t\tYpos.add(100);Ypos.add(10);Ypos.add(10);Ypos.add(10);\n\t\tYpos.add(10);Ypos.add(110);Ypos.add(100);Ypos.add(200);\n\t\tYpos.add(300);Ypos.add(300);Ypos.add(300);Ypos.add(180);\n\t\tYpos.add(300);Ypos.add(180);Ypos.add(300);Ypos.add(420);\n\t\tYpos.add(300);Ypos.add(420);Ypos.add(200);Ypos.add(110);//Ypos.add(100);Ypos.add(10);\n\t\tfor(int x =0;x<Xpos.size();x+=2){\n\t\t\tg.drawLine(Xpos.get(x), Ypos.get(x), Xpos.get(x+1), Ypos.get(x+1));\n\t\t\tif(Ypos.get(x)==Ypos.get(x+1)){\n\t\t\t\tHorizXOutline.add(x);HorizXOutline.add(x+1);\n\t\t\t\tHorizYOutline.add(x);HorizYOutline.add(x+1);\n\t\t\t\tg.drawLine(Xpos.get(x),Ypos.get(x)+20,Xpos.get(x+1),Ypos.get(x+1)+20);\n\t\t\t}\n\t\t\telse if(Xpos.get(x)==Xpos.get(x+1)){\n\t\t\t\tVertOutlineX.add(x);VertOutlineX.add(x+1);\n\t\t\t\tVertOutlineY.add(x);VertOutlineY.add(x+1);\n\t\t\t\tg.drawLine(Xpos.get(x)+20,Ypos.get(x),Xpos.get(x+1)+20,Ypos.get(x+1));\n\t\t\t}\n\t\t\tif((Ypos.get(x+1)-Ypos.get(x))!=0)\n\t\t\t{\n\t\t\t\tint slope = (Xpos.get(x)-Xpos.get(x+1))/(Ypos.get(x+1)-Ypos.get(x));\n\t\t\t\tif(slope<0){\n\t\t\t\t\tNegDiagOutlineX.add(x);NegDiagOutlineX.add(x+1);\n\t\t\t\t\tNegDiagOutlineY.add(x);NegDiagOutlineY.add(x+1);\n\t\t\t\t\tif(Xpos.get(x)<=100){\n\t\t\t\t\t\tg.drawLine(Xpos.get(x),Ypos.get(x)-20,Xpos.get(x+1)+10,Ypos.get(x+1)-10);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\tg.drawLine(Xpos.get(x),Ypos.get(x)+20,Xpos.get(x+1)-10,Ypos.get(x+1)+10);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(slope>0){\n\t\t\t\t\tPosDiagOutlineX.add(x);PosDiagOutlineX.add(x+1);\n\t\t\t\t\tPosDiagOutlineY.add(x);PosDiagOutlineY.add(x+1);\n\t\t\t\t\tg.drawLine(Xpos.get(x)-10,Ypos.get(x)-10,Xpos.get(x+1)-10,Ypos.get(x+1)-10);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n//\t for(int x = 0;x<=120;x+=10){\n//\t \t//change in x-3900/-13 = Xpos\n//\t \tint xpos1 = (int)(350 +(x/10)*(-50/11));\n//\t \tint xpos2 = (int)(350+(x/10)*(50/11));\n//\t \tint ypos = 180+x;\n//\t \tg.setColor(Color.red);\n//\t \tg.drawLine(xpos1, ypos, xpos2, ypos);\n//\t \tXpos.add(xpos1);Ypos.add(ypos);Xpos.add(xpos2);Ypos.add(ypos);\n//\t }\n//\t // g.setColor(Color.blue);\n//\t ////.drawRect(200, 100, 100, 100);\n//\t // g.setColor(Color.red);\n//\t double slope = (300-200)/(110-10);\n//\t int y = (int) (100-slope*20);\n//\t // g.drawRect(220, 130-y, 100, 100);\n//\t for(int x = 20;x<=100;x+=10){\n//\t \t//Y=slope*x+0 : (Y)/slope = X where Y = interval of 20\n//\t \tint ypos = (int)(x/slope)+190;\n//\t \tg.drawLine(100, x, ypos, x);\n//\t \tXpos.add(100);Ypos.add(x);Xpos.add(ypos);Ypos.add(x);\n//\t }\n\t // g.drawLine(300, 100, 200, 200);\n//\t for(int x = 100;x<=200;x+=10){\n//\t \tdouble circleypos = 200+ Math.sqrt((200-x)*100);\n//\t \tg.drawLine(x, x, (int)(circleypos), x);\n//\t \t\n//\t }\n\t double totalDist=0;\n\t for(int x=0; x<Xpos.size();x+=2){\n\t int xd = Xpos.get(x+1)-Xpos.get(x); xd = xd*xd;\n\t int yd = Ypos.get(x+1)-Ypos.get(x); yd = yd*yd;\n\t int distance = (int) (Math.sqrt(xd+yd));\n\t totalDist +=distance;\n\t System.out.println(\"The length of this line is\" + distance + \" and the total distance as of now is \" + totalDist);\n\t }\n\t}", "public static void draw(ArrayList<Sighting> data){\n \n \t\tint backgroundColor = Utils.globalProcessing.color(120, 120, 120, 60);\n \n \t\tUtils.globalProcessing.fill(backgroundColor);\n \n \t\tUtils.globalProcessing.rect(200, 0, 1024, 768);\n \t\t//Utils.globalProcessing.rectMode(Utils.globalProcessing.CORNERS);\n \t\tArrayList<Shape> shapes = new ArrayList<Shape>();\n \t\tArrayList<Time> times = new ArrayList<Time>();\n \t\tArrayList<City> locations = new ArrayList<City>();\n \t\t//calculate min/max for each dimension\n \t\tfor(int i = 0; i < data.size(); i++){\n \t\t\tSighting s = data.get(i);\n \t\t\tif(!shapes.contains(s.getShape()))\n \t\t\t\tshapes.add(s.getShape());\n \t\t\tif(!times.contains(s.getTime()))\n \t\t\t\ttimes.add(s.getTime());\n \t\t\tif(!locations.contains(s.getPosition()))\n \t\t\t\tlocations.add((City)s.getPosition());\n \t\t}\n \t\tfloat xPloti, xPlote, yPloti, yPlote;\n \t\txPloti = 200;\n \t\txPlote = 1024;\n \t\tyPloti = 100;\n \t\tyPlote = 700;\n \n \t\tfloat maxDistance = 0;\n\t\tfloat minPopulationDensity = Utils.allCities.get(0).getPopulationDensity();\n\t\tfloat maxpopulationDensity = Utils.allCities.get(0).getPopulationDensity();\n \t\tfor(City c: locations){\n \t\t\tif(c.getDistanceAirport() > maxDistance)\n \t\t\t\tmaxDistance = c.getDistanceAirport();\n \t\t\tif(c.getPopulationDensity()< minPopulationDensity)\n \t\t\t\tminPopulationDensity = c.getPopulationDensity();\n \t\t\telse if(c.getPopulationDensity() > maxpopulationDensity)\n \t\t\t\tmaxpopulationDensity = c.getPopulationDensity();\n \n \t\t}\n \n \n \n \t\t\n \t\tfor(int i = 0; i < data.size(); i++){\n \t\t\tSighting s = data.get(i);\n \t\t\tUtils.globalProcessing.stroke(s.getShape().getColor());\n \t\t\tUtils.globalProcessing.beginShape();\n \t\t\t//Utils.globalProcessing.stroke(120);\n \t\t\tfloat x = Utils.globalProcessing.map((float)1/7, 0, 1, xPloti, xPlote);\n \t\t\tfloat y = Utils.globalProcessing.map(((City)s.getPosition()).getDistanceAirport(), 0, maxDistance, yPloti, yPlote);\n \n \t\t\tUtils.globalProcessing.vertex(x,y); // distance\n \n \t\t\tx = Utils.globalProcessing.map((float)2/7, 0, 1, xPloti, xPlote);\n \t\t\ty = Utils.globalProcessing.map(((City)s.getPosition()).getPopulationDensity(), minPopulationDensity, maxpopulationDensity, yPloti, yPlote);\n \n \t\t\tUtils.globalProcessing.vertex(x,y); //populationDensity\n \t\t\tUtils.globalProcessing.endShape();\n \t\t\t//It works only if I threat all the couple of points as separate, indipendent lines\n \t\t\tUtils.globalProcessing.beginShape();\n \n \t\t\tUtils.globalProcessing.vertex(x,y);\n \n \t\t\tx = Utils.globalProcessing.map((float)3/7, 0, 1, xPloti, xPlote);\n \t\t\tif(s.getTime().getBeginTime().get(Calendar.HOUR_OF_DAY)<19 &&s.getTime().getBeginTime().get(Calendar.HOUR_OF_DAY)>=7)\n \t\t\t\ty = Utils.globalProcessing.map(1, 0, 3, yPloti, yPlote); //day \n \t\t\telse\t\n \t\t\t\ty = Utils.globalProcessing.map(2, 0, 3, yPloti, yPlote); //night \n \t\t\t//System.out.println(x +\" \" +y);\n \t\t\tUtils.globalProcessing.vertex(x,y); // night/day\n \t\t\tUtils.globalProcessing.endShape();\n \t\t\tUtils.globalProcessing.beginShape();\n \t\t\t\n \t\t\tUtils.globalProcessing.vertex(x,y);\n \t\t\tx = Utils.globalProcessing.map((float)4/7, 0, 1, xPloti, xPlote);\n \t\t\ty = Utils.globalProcessing.map(s.getTime().getBeginTime().get(Calendar.MONTH)+1, 0, 13, yPloti, yPlote);\n \t\t\tUtils.globalProcessing.vertex(x, y); //month of the year\n \t\t\t\n \t\t\tUtils.globalProcessing.endShape();\n \t\t\tUtils.globalProcessing.beginShape();\n \t\t\t\n \t\t\tUtils.globalProcessing.vertex(x, y);\n \t\t\tx = Utils.globalProcessing.map((float)5/7, 0, 1, xPloti, xPlote);\n \t\t\tif(s.getTime().getBeginTime().get(Calendar.MONTH)==Calendar.MARCH || s.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.APRIL ||\n \t\t\t\t\ts.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.MAY) //Spring\n \t\t\ty = Utils.globalProcessing.map(1, 0, 5, yPloti, yPlote);\n \t\t\telse if(s.getTime().getBeginTime().get(Calendar.MONTH)==Calendar.JUNE || s.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.JULY ||\n \t\t\t\t\ts.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.AUGUST) //summer\n \t\t\t\ty = Utils.globalProcessing.map(2, 0, 5, yPloti, yPlote);\n \t\t\telse if(s.getTime().getBeginTime().get(Calendar.MONTH)==Calendar.SEPTEMBER || s.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.OCTOBER ||\n \t\t\t\t\ts.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.NOVEMBER) //autumn\n \t\t\t\ty = Utils.globalProcessing.map(3, 0, 5, yPloti, yPlote);\n \t\t\telse\n \t\t\t\ty = Utils.globalProcessing.map(3, 0, 5, yPloti, yPlote);\n \t\t\tUtils.globalProcessing.vertex(x, y); //seasons\n \t\t\t\n \t\t\tUtils.globalProcessing.endShape();\n \t\t\tUtils.globalProcessing.beginShape();\n \t\t\t\n \t\t\tUtils.globalProcessing.vertex(x, y);\n \t\t\t\n \t\t\tx = Utils.globalProcessing.map((float)6/7, 0, 1, xPloti, xPlote);\n \t\t\ty = Utils.globalProcessing.map(s.getTime().getBeginTime().get(Calendar.YEAR), 2000, 2011, yPloti, yPlote);\n \t\t\tUtils.globalProcessing.vertex(x, y); //years\n \t\t\tUtils.globalProcessing.endShape();\n \t\t}\n \t\t//draw vertical lines\n \n \t\tfor(int i = 1; i < 7 ; i++){\n \t\t\tfloat x = Utils.globalProcessing.map((float)i/7, 0, 1, xPloti, xPlote);\n \t\t\t//Utils.globalProcessing.\n \t\t}\n \n \t}", "private void render() {\n\t\ttheMap.draw(g);\n\t\ttheTrainer.draw(g);\n\t}", "@Override\r\n\tpublic void placeRoad(EdgeLocation edgeLoc) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void BuildLegRight() {\n\t\tg.drawLine(70, 100, 85, 150);\r\n\t}", "private void drawMap(HashMap<String, TrailObj> trailCollection,\n\t\t\tGoogleMap mMap2) {\n\n\t\tfor (TrailObj trail : trailCollection.values()) {\n\t\t\tfor (PlacemarkObj p : trail.getPlacemarks()) {\n\t\t\t\tPolylineOptions rectOptions = new PolylineOptions();\n\t\t\t\tfor (LatLng g : p.getCoordinates()) {\n\t\t\t\t\trectOptions.add(g);\n\t\t\t\t}\n\t\t\t\tPolyline polyline = mMap2.addPolyline(rectOptions);\n\t\t\t\tpolyline.setColor(Color.RED);\n\t\t\t\tpolyline.setWidth(5);\n\t\t\t\tpolyline.setVisible(true);\n\t\t\t}\n\t\t}\n\t}", "public Road(Town source, Town destination, int weight, String name) {\r\n\t\tthis.source = source;\r\n\t\tthis.destination = destination;\r\n\t\tthis.vertices = new HashSet<Town>();\r\n\t\tvertices.add(source);\r\n\t\tvertices.add(destination);\r\n\t\t\r\n\t\tthis.weight = weight;\r\n\t\tthis.name = name;\r\n\t\t\r\n\t}", "@Override\n\tvoid draw(Graphics2D g2) {\n\t\t// TODO Auto-generated method stub\n\t\tg2.setColor(color);\n\t\tPoint2D.Double from = new Point2D.Double(this.getXPos(), this.getYPos());\n\t\tPoint2D.Double to = new Point2D.Double(x2, y2);\n\t\tsegment = new Line2D.Double(from, to);\n\t\tg2.drawLine((int) this.getXPos() - 8, (int) this.getYPos() - 96, (int) x2 - 8, (int) y2 - 96);\n\n\t}", "private void buildArcLine(LatLng p1, LatLng p2, double arcCurvature) {\n double d = SphericalUtil.computeDistanceBetween(p1, p2);\n double h = SphericalUtil.computeHeading(p1, p2);\n\n if (h < 0) {\n LatLng tmpP1 = p1;\n p1 = p2;\n p2 = tmpP1;\n\n d = SphericalUtil.computeDistanceBetween(p1, p2);\n h = SphericalUtil.computeHeading(p1, p2);\n }\n\n //Midpoint position\n LatLng midPointLnt = SphericalUtil.computeOffset(p1, d * 0.5, h);\n\n //Apply some mathematics to calculate position of the circle center\n double x = (1 - arcCurvature * arcCurvature) * d * 0.5 / (2 * arcCurvature);\n double r = (1 + arcCurvature * arcCurvature) * d * 0.5 / (2 * arcCurvature);\n\n LatLng centerLnt = SphericalUtil.computeOffset(midPointLnt, x, h + 90.0);\n\n //Polyline options\n PolylineOptions options = new PolylineOptions();\n List<PatternItem> pattern = Arrays.<PatternItem>asList(new Dash(30), new Gap(20));\n\n //Calculate heading between circle center and two points\n double h1 = SphericalUtil.computeHeading(centerLnt, p1);\n double h2 = SphericalUtil.computeHeading(centerLnt, p2);\n\n //Calculate positions of points on circle border and add them to polyline options\n int numPoints = 100;\n double step = (h2 - h1) / numPoints;\n\n for (int i = 0; i < numPoints; i++) {\n LatLng middlePointTemp = SphericalUtil.computeOffset(centerLnt, r, h1 + i * step);\n options.add(middlePointTemp);\n }\n\n\n if (!eDisplayDottedLine.equalsIgnoreCase(\"\") && eDisplayDottedLine.equalsIgnoreCase(\"Yes\")) {\n //Draw polyline\n if (polyline != null) {\n polyline.remove();\n polyline = null;\n\n\n }\n polyline = gMap.addPolyline(options.width(10).color(Color.BLACK).geodesic(false).pattern(pattern));\n } else {\n if (polyline != null) {\n polyline.remove();\n polyline = null;\n\n\n }\n\n }\n }", "public void render() {\n int pixel = getPixelSize();\n for (int xx = x; xx<x+w; xx += pixel) {\n for (int yy = y; yy<y+h; yy += pixel) {\n Location next = getLocation(xx, yy);\n if (next != null) { // This way if a wall is spawned at the edge it's ok\n next.setColor(color(255,255,255));\n next.setType(LocationType.WALL);\n getGridCache().add(next);\n }\n }\n }\n }", "public void addRoad(Road r) {\n\t\tthis.roads.add(r);\n\t}", "void placeRoads(String raceId) {\r\n\t\tMap<RoadType, Tile> rts = buildingModel.roadTiles.get(raceId);\r\n\t\tMap<Tile, RoadType> trs = buildingModel.tileRoads.get(raceId);\r\n\t\t// remove all roads\r\n\t\tIterator<SurfaceEntity> it = renderer.surface.buildingmap.values().iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tSurfaceEntity se = it.next();\r\n\t\t\tif (se.type == SurfaceEntityType.ROAD) {\r\n\t\t\t\tit.remove();\r\n\t\t\t}\r\n\t\t}\r\n\t\tSet<Location> corners = new HashSet<Location>();\r\n\t\tfor (Building bld : renderer.surface.buildings) {\r\n\t\t\tRectangle rect = new Rectangle(bld.location.x - 1, bld.location.y + 1, bld.tileset.normal.width + 2, bld.tileset.normal.height + 2);\r\n\t\t\taddRoadAround(rts, rect, corners);\r\n\t\t}\r\n\t\tSurfaceEntity[] neighbors = new SurfaceEntity[9];\r\n\t\tfor (Location l : corners) {\r\n\t\t\tSurfaceEntity se = renderer.surface.buildingmap.get(l);\r\n\t\t\tif (se == null || se.type != SurfaceEntityType.ROAD) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tsetNeighbors(l.x, l.y, renderer.surface.buildingmap, neighbors);\r\n\t\t\tint pattern = 0;\r\n\t\t\t\r\n\t\t\tRoadType rt1 = null;\r\n\t\t\tif (neighbors[1] != null && neighbors[1].type == SurfaceEntityType.ROAD) {\r\n\t\t\t\tpattern |= Sides.TOP;\r\n\t\t\t\trt1 = trs.get(neighbors[1].tile);\r\n\t\t\t}\r\n\t\t\tRoadType rt3 = null;\r\n\t\t\tif (neighbors[3] != null && neighbors[3].type == SurfaceEntityType.ROAD) {\r\n\t\t\t\tpattern |= Sides.LEFT;\r\n\t\t\t\trt3 = trs.get(neighbors[3].tile);\r\n\t\t\t}\r\n\t\t\tRoadType rt5 = null;\r\n\t\t\tif (neighbors[5] != null && neighbors[5].type == SurfaceEntityType.ROAD) {\r\n\t\t\t\tpattern |= Sides.RIGHT;\r\n\t\t\t\trt5 = trs.get(neighbors[5].tile);\r\n\t\t\t}\r\n\t\t\tRoadType rt7 = null;\r\n\t\t\tif (neighbors[7] != null && neighbors[7].type == SurfaceEntityType.ROAD) {\r\n\t\t\t\tpattern |= Sides.BOTTOM;\r\n\t\t\t\trt7 = trs.get(neighbors[7].tile);\r\n\t\t\t}\r\n\t\t\tRoadType rt = RoadType.get(pattern);\r\n\t\t\t// place the new tile fragment onto the map\r\n\t\t\t// oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo\r\n\t\t\tse = createRoadEntity(rts.get(rt));\r\n\t\t\trenderer.surface.buildingmap.put(l, se);\r\n\t\t\t// alter the four neighboring tiles to contain road back to this\r\n\t\t\tif (rt1 != null) {\r\n\t\t\t\trt1 = RoadType.get(rt1.pattern | Sides.BOTTOM);\r\n\t\t\t\trenderer.surface.buildingmap.put(l.delta(0, 1), createRoadEntity(rts.get(rt1)));\r\n\t\t\t}\r\n\t\t\tif (rt3 != null) {\r\n\t\t\t\trt3 = RoadType.get(rt3.pattern | Sides.RIGHT);\r\n\t\t\t\trenderer.surface.buildingmap.put(l.delta(-1, 0), createRoadEntity(rts.get(rt3)));\r\n\t\t\t}\r\n\t\t\tif (rt5 != null) {\r\n\t\t\t\trt5 = RoadType.get(rt5.pattern | Sides.LEFT);\r\n\t\t\t\trenderer.surface.buildingmap.put(l.delta(1, 0), createRoadEntity(rts.get(rt5)));\r\n\t\t\t}\r\n\t\t\tif (rt7 != null) {\r\n\t\t\t\trt7 = RoadType.get(rt7.pattern | Sides.TOP);\r\n\t\t\t\trenderer.surface.buildingmap.put(l.delta(0, -1), createRoadEntity(rts.get(rt7)));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}", "public void draw(){\n if(isVisible) {\n double diameter = calcularLado(area);\n double side = 2*diameter;\n Canvas circle = Canvas.canvas;\n circle.draw(this, color, \n new Ellipse2D.Double(xPosition, yPosition, \n (int)diameter, side));\n }\n }", "public GameBoardQuadrant(float minRads, float maxRads) {\n setMinRads(minRads);\n setMaxRads(maxRads);\n\n isOn = false;\n\n onColour = new float[4];\n offColour = new float[4];\n setOnColour(0, 0, 0, 1); // default to black\n setOffColour(0, 0, 0, 1); // default to black\n\n generateCircleCoords();\n generateDrawOrder();\n\n vertexCount = circleCoords.length / COORDS_PER_VERTEX;\n\n // initialize vertex byte buffer for shape coordinates\n ByteBuffer bb = ByteBuffer.allocateDirect(\n // (# of coordinate vlues * 4 bytes per short)\n circleCoords.length * 4);\n bb.order(ByteOrder.nativeOrder());\n vertexBuffer = bb.asFloatBuffer();\n vertexBuffer.put(circleCoords);\n vertexBuffer.position(0);\n\n // initialize byte buffer for the draw list\n ByteBuffer dlb = ByteBuffer.allocateDirect(\n // # of coordinate values * 2 bytes per short\n drawOrder.length * 2);\n dlb.order(ByteOrder.nativeOrder());\n drawListBuffer = dlb.asShortBuffer();\n drawListBuffer.put(drawOrder);\n drawListBuffer.position(0);\n\n int vertexShader = SimonGLRenderer.loadShader(GLES20.GL_VERTEX_SHADER, vertexShaderCode);\n int fragmentShader = SimonGLRenderer.loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentShaderCode);\n\n // create empty OpenGL ES program\n mProgram = GLES20.glCreateProgram();\n\n // add the vertex shader to program\n GLES20.glAttachShader(mProgram, vertexShader);\n\n // add the fragment shader\n GLES20.glAttachShader(mProgram, fragmentShader);\n\n // create opengl es program executable\n GLES20.glLinkProgram(mProgram);\n }", "private void drawSegments(List<LatLng> listPoints) {\n\n PolylineOptions rectOptions = new PolylineOptions()\n .width(8)\n .color(context.getResources().getColor(R.color.colorPolylineComplete))\n .addAll(listPoints);\n\n googleMap.addPolyline(rectOptions);\n }" ]
[ "0.65099907", "0.64015967", "0.6249639", "0.62447894", "0.62376064", "0.6182209", "0.6140207", "0.6081876", "0.6048673", "0.5989798", "0.59789664", "0.59307134", "0.5868567", "0.5812752", "0.58120656", "0.57422745", "0.5718475", "0.56902486", "0.5685693", "0.56347084", "0.5607871", "0.56012374", "0.5595284", "0.5583421", "0.55703473", "0.5569661", "0.5557518", "0.5535725", "0.5510576", "0.5509681", "0.54861104", "0.54711014", "0.5466705", "0.5431168", "0.5424457", "0.5391799", "0.5389419", "0.5387653", "0.5373257", "0.5369663", "0.5349014", "0.5341153", "0.53176075", "0.52960557", "0.52876127", "0.52864575", "0.52816814", "0.52671826", "0.5253943", "0.52487016", "0.5238995", "0.5233522", "0.52300066", "0.522097", "0.52179295", "0.52150756", "0.5204795", "0.5204556", "0.51980525", "0.518934", "0.518121", "0.5166474", "0.5166104", "0.5164675", "0.5163338", "0.5160431", "0.51507276", "0.5147968", "0.5137661", "0.5121782", "0.51168287", "0.50987536", "0.50974065", "0.50950265", "0.5086403", "0.50833756", "0.50760204", "0.50708807", "0.50666773", "0.5057086", "0.505585", "0.5053971", "0.505136", "0.50435793", "0.50405985", "0.50387514", "0.50357515", "0.50351495", "0.50349855", "0.5032484", "0.5023291", "0.5022598", "0.501905", "0.5013908", "0.5012152", "0.5009693", "0.5009496", "0.5008662", "0.50027657", "0.5000721", "0.49979427" ]
0.0
-1
TODO Autogenerated method stub
public String getSender() { return senderId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public String getReceiver() { return receiverId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub MessageDialog.openInformation(null, "hey", "good"); IRegion region = toRegion(new PositionRange("", 50, 60)); fOpenAction.run(new TextSelection(region.getOffset(), region.getLength()));
@Override public void open() { Range range = positionRangeTo.getRanges().get(0); UIHelper.selectAndReveal(new File(range.getFile()), range.getFrom(), range.getTo() - range.getFrom()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tMessageDialog.openInformation(parent.getShell(), \"info\", ((ToolItem)e.getSource()).getText());\n\t\t\t}", "@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tMessageDialog.openInformation(parent.getShell(), \"info\", ((ToolItem)e.getSource()).getText());\n\t\t\t}", "public static void infoDialog(String title,String msgBody) throws IOException{\n \n }", "public InfoDialog(String text) {\r\n\t\tthis.setDialog(text);\r\n\t}", "public static void openInformation(Shell parent, String title, String message)\n {\n open(MessageDialog.INFORMATION, parent, title, message, SWT.NONE);\n }", "public void openNSE() {\n\t\t\t this.open.getText();\r\n\t\t}", "@Test\n\tpublic void testInterceptorOpenOn() {\n\t\tnew DefaultStyledText().selectText(\"s:Interceptor\");\n\t\tKeyboardFactory.getKeyboard().invokeKeyCombination(SWT.F3);\n\t\tnew DefaultEditor(\"Interceptor.class\");\n\t\t/* test opened object */\n\t\tassertExpectedOpenedClass(\"javax.interceptor.Interceptor\");\n\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"<html><center><u><strong>Edité par :</strong></u><br>RAHMANI ABD EL KADER<br>SEIF EL ISLEM<br> Groupe 1 Section 1</center></html>\", \"A propros\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t}", "public void displayInfo(String message){\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setContentText(message);\n //alert.initOwner(owner);\n alert.show();\n }", "private void reportOpen(HRegionInfo region) {\n outboundMsgs.add(new HMsg(HMsg.Type.MSG_REPORT_OPEN, region));\n }", "public void Open() {\r\n\t click();\r\n\t }", "public int open() {\n\t\tint value = super.open();\n\t\tif (popupCloser == null) {\n\t\t\tpopupCloser = new PopupCloserListener();\n\t\t}\n\t\tpopupCloser.installListeners();\n\t\tProposal p = getSelectedProposal();\n\t\tif (p != null) {\n\t\t\tshowProposalDescription();\n\t\t}\n\t\treturn value;\n\t}", "static void giveInfo(String message){\n JOptionPane.showMessageDialog(null, message);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJOptionPane.showMessageDialog(null, ApplicationSession.instance().getString(\"info\"), \"info\", JOptionPane.INFORMATION_MESSAGE, null);\t\n\t\t\t}", "public InfoDialog() {\r\n\t\tcreateContents();\r\n\t}", "public void run(IAction action) {\n\t\tMessageDialog.openInformation(window.getShell(), \"AccTrace\",\n\t\t\t\t\"Hello, Eclipse world\");\n\t}", "public EObject displayInfo(EObject context, String title, String message) {\r\n\t\tMessageDialog.openInformation(Display.getCurrent().getActiveShell(), title, message);\r\n\t\treturn context;\r\n\t}", "public Object open() {\n // Create a new shell object and set the text for the dialog.\n Shell parent = getParent();\n shell = new Shell(parent, SWT.DIALOG_TRIM);\n shell.setText(\"Edit Colormaps\");\n\n // Setup all of the layouts and the controls.\n setup();\n\n // Open the shell to display the dialog.\n shell.open();\n\n // Wait until the shell is disposed.\n Display display = parent.getDisplay();\n while (!shell.isDisposed()) {\n if (!display.readAndDispatch())\n display.sleep();\n }\n\n return null;\n }", "public void popupMenuGoto() {\n\t\tint rowIndex = table.getSelectionIndex();\n\t\tint columnIndex = cursor.getColumn();\n\t\t//\n\t\t// Display the dialog\n\t\t//\n\t\tGotoDialog gotoDialog = new GotoDialog(parent.getShell(), rowIndex, columnIndex);\n\t\tif (gotoDialog.open() != Window.OK)\n\t\t\treturn;\n\t\tHexTablePointer p = gotoDialog.getNewPosition();\n\n\t\tif (p == null) {\n\t\t\t//\n\t\t\t// Error calculating new position - do nothing\n\t\t\t//\n\t\t\treturn;\n\t\t} // if\n\n\t\tif (p.getRowIndex() < 0 || p.getColumnIndex() < 0) {\n\t\t\tMessageDialog.openError(parent.getShell(), HexEditorConstants.DIALOG_TITLE_ERROR, Messages.HexEditorControl_49);\n\t\t\tcursor.setSelection(0, 1);\n\t\t\tcursor.redraw();\n\t\t\ttable.setSelection(0);\n\t\t\t//\n\t\t\t// Update the status panel\n\t\t\t//\n\t\t\tupdateStatusPanel();\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tcursor.setSelection(p.getRowIndex(), p.getColumnIndex() + 1);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\tint numRows = table.getItemCount();\n\t\t\tint lastRowIndex = (numRows > 0) ? (numRows - 1) : numRows;\n\t\t\tMessageDialog.openError(parent.getShell(), HexEditorConstants.DIALOG_TITLE_ERROR, \"Address is out of range!\");\n\t\t\tint lastColumnIndex = table.getBufferSize() % HexEditorConstants.TABLE_NUM_DATA_COLUMNS;\n\t\t\tcursor.setSelection(lastRowIndex, lastColumnIndex + 1);\n\t\t\tcursor.redraw();\n\t\t\ttable.setSelection(lastRowIndex);\n\t\t\t//\n\t\t\t// Update the status panel\n\t\t\t//\n\t\t\tupdateStatusPanel();\n\t\t\treturn;\n\t\t}\n\n\t\t//\n\t\t// Place the cursor where was calculated\n\t\t//\n\t\tcursor.setSelection(p.getRowIndex(), p.getColumnIndex() + 1);\n\t\tcursor.redraw();\n\t\ttable.setSelection(p.getRowIndex());\n\n\t\t//\n\t\t// Update the status panel\n\t\t//\n\t\tupdateStatusPanel();\n\t}", "@Test\n\tpublic void testInjectOpenOn() {\n\t\tnew DefaultStyledText().selectText(\"s:Inject\");\n\t\tKeyboardFactory.getKeyboard().invokeKeyCombination(SWT.F3);\n\t\tnew DefaultEditor(\"Inject.class\");\n\n\t\t/* test opened object */\n\t\tassertExpectedOpenedClass(\"javax.inject.Inject\");\n\n\t}", "private void popupMenuAbout() {\n\t\t//\n\t\t// Display the dialog\n\t\t//\n\t\tAboutDialog aboutDialog = new AboutDialog(parent.getShell(), SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);\n\t\taboutDialog.open();\n\t}", "public static int showInformationDialog(Object[] options, String title, String message) {\n\t\treturn 0;\n\t}", "private void showMessage(int position) {\n // Open Bottom sheet and show details\n }", "public static void showInfoDialog(Shell shell, String title,\r\n\t\t\tString message) {\r\n\t\tshowDialog(shell, title, message, SWT.ICON_INFORMATION);\r\n\t}", "@Override\n public void showLorenzoActionPopUp(String string) {\n\n }", "void aboutMenuItem_actionPerformed(ActionEvent e) {\n AboutDialog dlg = new AboutDialog(this, \"About InfoFilter Application\", true);\n Point loc = this.getLocation();\n\n dlg.setLocation(loc.x + 50, loc.y + 50);\n dlg.show();\n }", "public void informationDialog(String paneMessage) {\n showMessageDialog(frame, paneMessage);\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n helpPopUp();\n }", "public abstract void clickHelp(FloodItWorld w, ACell topLeft);", "ActionOpen()\n {\n super(\"Open\");\n this.setShortcut(UtilGUI.createKeyStroke('O', true));\n }", "public InfoDialog(String text, String title, String variant) {\r\n\t\tthis.setDialog(text, title, variant);\r\n\t}", "DialogResult show();", "private void toAbilityInfoDialogue(String message) {\n controller.getUIController().messageAbilityDialogue(message);\n }", "public void showInformationMessage(final String message) {\r\n JOptionPane.showMessageDialog(window, message, getTitle(), JOptionPane.INFORMATION_MESSAGE);\r\n }", "public InfoDialog(String text, String title) {\r\n\t\tthis.setDialog(text, title);\r\n\t}", "public void showWinMessage() {\n\n\t}", "public void onInfoWindowClick(Marker marker2) {\n\n AlertDialog.Builder builder2 = new AlertDialog.Builder(Detalles.this);\n builder2.setTitle(\"Epicent\");\n builder2.setMessage(\"Referencia : \" +\"ddddddd\" +\"\\n\" +\n \"Fecha local : \" + \"ccccccc\" +\"\\n\" +\n \"Hora local : \" + \"ccccccc\"+ \"\\n\" +\n \"Profundidad : \" + \"ccccccc\"+\" km\"+ \"\\n\" +\n \"Intensidad : \" + \"ccccccc\"+ \"\\n\" +\n \"Magnitud : \" + \"ccccccc\"+ \"\\n\" +\n \"Ubicación : \" + \"ccccccc\"+ \", \" + \"ccccccc\");\n builder2.setNegativeButton(\"Cerrar\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog2, int which) {\n dialog2.cancel();\n }\n });\n\n builder2.setCancelable(true);\n builder2.create().show();\n\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdoOpen();\n\t\t\t}", "private void openSearch() {\n\t\tString message = \"This would be search.\";\r\n\t\tIntent intent = new Intent(this, DisplayMessageActivity.class);\r\n\t\tintent.putExtra(EXTRA_MESSAGE, message);\r\n\t\tstartActivity(intent);\r\n\t}", "public void run(IAction action) {\n\t\tInstaSearchUI.getWorkbenchWindow().getActivePage().activate( InstaSearchUI.getActiveEditor() );\n\t\tNewSearchUI.openSearchDialog(InstaSearchUI.getWorkbenchWindow(), InstaSearchPage.ID);\n\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\topenInterestDialog();\n\t\t\t}", "public void showInformationMessage(String msg) {\r\n JOptionPane.showMessageDialog(this,\r\n\t\t\t\t msg, TmplResourceSingleton.getString(\"info.dialog.header\"),\r\n\t\t\t\t JOptionPane.INFORMATION_MESSAGE);\r\n }", "@Override\r\n public final void displayInfo(final String message) {\r\n displayMessage(message, \"Info\", SWT.ICON_INFORMATION);\r\n }", "void show_info() {\n\t\tsetAlwaysOnTop(false);\n\n\t\tString msg = \"<html><ul><li>Shortcuts:<br/>\"\n\t\t\t\t+ \"(\\\") start macro<br/>\"\n\t\t\t\t+ \"(esc) exit<br/><br/>\"\n\t\t\t\t+ \"<li>Author: <b>Can Kurt</b></ul></html>\";\n\n\t\tJLabel label = new JLabel(msg);\n\t\tlabel.setFont(new Font(\"arial\", Font.PLAIN, 15));\n\n\t\tJOptionPane.showMessageDialog(null, label ,\"Info\", JOptionPane.INFORMATION_MESSAGE);\n\n\t\tsetAlwaysOnTop(true);\n\t}", "@Override\n public void messagePrompt(String message) {\n JOptionPane.showMessageDialog(lobbyWindowFrame,message+\" is choosing the gods\");\n }", "void open() {\n \tJFileChooser fileopen = new JFileChooser();\n int ret = fileopen.showDialog(null, \"Open file\");\n\n if (ret == JFileChooser.APPROVE_OPTION) {\n document.setFile(fileopen.getSelectedFile());\n textArea.setText(document.getContent());\n }\n }", "public void helpAbout_actionPerformed(ActionEvent e) {\n AboutDialog dlg = new AboutDialog(this, \"About InfoFilter Application\", true);\n Point loc = this.getLocation();\n\n dlg.setLocation(loc.x + 50, loc.y + 50);\n dlg.show();\n }", "public void showItext() {\n\n\t\tFormUtil.dlg.setText(\"Opening...\");\n\t\tFormUtil.dlg.show();\n\n\n\t\t\n\t\tScheduler.get().scheduleDeferred(new Command() {\n\t\t\tpublic void execute() {\n\n\t\t\t\ttry {\n\n\t\t\t\t\tif (formDef == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tFormUtil.dlg.hide();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\ttabs.selectTab(TAB_INDEX_DESIGN);\n\t\t\t\t\t\n\t\t\t\t\t//update the itext map\n\t\t\t\t\tcontroller.updateLanguage(Context.getLocale(), Context.getLocale(), formDef);\n\t\t\t\t\tFormDef form = controller.getSelectedForm();\n\t\t\t\t\t\n\t\t\t\t\t//clear the itext list\n\t\t\t\t\tContext.getItextList().removeAll();\n\t\t\t\t\t//copy over the map to the list\n\t\t\t\t\tSet<String> keys = form.getITextMap().keySet();\n\t\t\t\t\tfor(String key : keys)\n\t\t\t\t\t{\n\t\t\t\t\t\tItextModel itext = form.getITextMap().get(key);\n\t\t\t\t\t\tContext.getItextList().add(itext);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\titextWidget.loadItext(Context.getItextList());\n\t\t\t\t\titextWidget.showWindow();\n\n\t\t\t\t\tFormUtil.dlg.hide();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tFormUtil.displayException(ex);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public void displayInterimPopup(\n Icon icon,\n String title,\n String message,\n Color color,\n int msecsToDisplayFor);", "private void infoMessage(String message) {\n JOptionPane.showMessageDialog(this, message,\n \"VSEGraf - user management\", JOptionPane.INFORMATION_MESSAGE);\n }", "@Override\n public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {\n\n return true;\n }", "private void info(ActionEvent x) {\n\t\tProject p = this.list.getSelectedValue();\n\t\tif (p != null) {\n\t\t\tcontroller.moreinfo(p.getName());\n\t\t}\n\t}", "public void openCurrentMessage() {\n if (this.currentMessageObject != null) {\n Intent intent = new Intent(ApplicationLoader.applicationContext, LaunchActivity.class);\n long dialogId = this.currentMessageObject.getDialogId();\n if (DialogObject.isEncryptedDialog(dialogId)) {\n intent.putExtra(\"encId\", DialogObject.getEncryptedChatId(dialogId));\n } else if (DialogObject.isUserDialog(dialogId)) {\n intent.putExtra(\"userId\", dialogId);\n } else if (DialogObject.isChatDialog(dialogId)) {\n intent.putExtra(\"chatId\", -dialogId);\n }\n intent.putExtra(\"currentAccount\", this.currentMessageObject.currentAccount);\n intent.setAction(\"com.tmessages.openchat\" + Math.random() + Integer.MAX_VALUE);\n intent.setFlags(32768);\n startActivity(intent);\n onFinish();\n finish();\n }\n }", "@Test\n\tpublic void testProducesOpenOn() {\n\t\tnew DefaultStyledText().selectText(\"s:Produces\");\n\t\tKeyboardFactory.getKeyboard().invokeKeyCombination(SWT.F3);\n\t\tnew DefaultEditor(\"Produces.class\");\n\n\t\t/* test opened object */\n\t\tassertExpectedOpenedClass(\"javax.enterprise.inject.Produces\");\n\n\t}", "private void showInfoMessage(String title, String body)\r\n {\r\n MyLogger.log(Level.INFO, \"Info message initiated. Info Title: {0}\", title);\r\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\r\n Stage currentStage = (Stage) viewCoinAnchorPane.getScene().getWindow();\r\n alert.initOwner(currentStage);\r\n alert.setTitle(title);\r\n alert.setHeaderText(null);\r\n alert.setContentText(body);\r\n alert.showAndWait();\r\n }", "@Override\r\n\t\t\t\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\t\t\t\tWindow.open(result.get(\"description\"), \"description\", result.get(\"description\"));\r\n\r\n\t\t\t\t\t\t}", "public void openText() {\n\t\tString xml = xformsWidget.getXform();\n\t\tif (xml == null || xml.trim().length() == 0) {\n\t\t\tWindow.alert(LocaleText.get(\"emptyFormError\"));\n\t\t\tshowOpen();\n\t\t\treturn;\n\t\t}\n\t\txformsWidget.hideWindow();\n\t\ttry\n\t\t{\n\t\t\tcontroller.loadNewForm(xml);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tWindow.alert(LocaleText.get(\"error\") + \":\\n\\r\" + e.getMessage());\n\t\t}\n\t}", "private void openDialog() {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\tbuilder.setTitle(getString(R.string.allmark));\n\t\tfinal List<ReaderTags> listData = ReaderDataBase\n\t\t\t\t.getReaderDataBase(this);\n\t\tif (listData.size() > 0) {\n\t\t\tListView list = new ListView(this);\n\t\t\tfinal MTagAdapter myAdapter = new MTagAdapter(this, listData);\n\t\t\tlist.setAdapter(myAdapter);\n\t\t\tlist.setOnItemClickListener(new OnItemClickListener() {\n\t\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1,\n\t\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\t\tJump(arg2, listData, myAdapter);\n\t\t\t\t}\n\t\t\t});\n\t\t\tlist.setOnItemLongClickListener(new OnItemLongClickListener() {\n\n\t\t\t\tpublic boolean onItemLongClick(AdapterView<?> arg0, View arg1,\n\t\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\t\tdeleteOneDialog(arg2, listData, myAdapter);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t\tbuilder.setView(list);\n\t\t} else {\n\t\t\tTextView txt = new TextView(this);\n\t\t\ttxt.setText(getString(R.string.nomark));\n\t\t\ttxt.setPadding(10, 5, 0, 5);\n\t\t\ttxt.setTextSize(16f);\n\t\t\tbuilder.setView(txt);\n\t\t}\n\t\tbuilder.setNegativeButton(getString(R.string.yes),\n\t\t\t\tnew OnClickListener() {\n\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tbuilder.show();\n\t}", "public void triggerPopup();", "public static void action(ActionEvent actionEvent){\n\t\tString lineNumberString = (String) JOptionPane.showInputDialog(null,\r\n\t\t\t\tAcideLanguageManager.getInstance().getLabels()\r\n\t\t\t\t\t\t.getString(\"s448\"), AcideLanguageManager.getInstance()\r\n\t\t\t\t\t\t.getLabels().getString(\"s447\"),\r\n\t\t\t\tJOptionPane.YES_NO_CANCEL_OPTION, null, null, null);\r\n\r\n\t\tif ((lineNumberString != null)) {\r\n\t\t\ttry {\r\n\r\n\t\t\t\t// If there are file editors opened\r\n\t\t\t\tif (AcideMainWindow.getInstance().getFileEditorManager()\r\n\t\t\t\t\t\t.getNumberOfFileEditorPanels() > 0){\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Parses the number of line\r\n\t\t\t\t\tint lineNumberInteger = Integer.parseInt(lineNumberString);\r\n\r\n\t\t\t\t\t// If the number of lines is positive\r\n\t\t\t\t\tif (lineNumberInteger > 0) {\r\n\r\n\t\t\t\t\t\t// Go to line in the selected one\r\n\t\t\t\t\t\tAcideMainWindow.getInstance().getFileEditorManager()\r\n\t\t\t\t\t\t\t\t.getSelectedFileEditorPanel()\r\n\t\t\t\t\t\t\t\t.goToLine(lineNumberInteger);\r\n\t\t\t\t\t} else\r\n\r\n\t\t\t\t\t\t// Displays an error message\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, AcideLanguageManager\r\n\t\t\t\t\t\t\t\t.getInstance().getLabels().getString(\"s2010\"),\r\n\t\t\t\t\t\t\t\t\"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception exception) {\r\n\r\n\t\t\t\t// Displays an error message\r\n\t\t\t\tJOptionPane.showMessageDialog(null, AcideLanguageManager\r\n\t\t\t\t\t\t.getInstance().getLabels().getString(\"s2010\"),\r\n\t\t\t\t\t\t\"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t\r\n\t\t\t\t// Updates the log\r\n\t\t\t\tAcideLog.getLog().error(exception.getMessage());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public OverviewSmallStringInputDialogOptions showInputDialog(String referenceID, String title, String textContent, String label, String initialValueText, String okText, String cancelText) {\n/*Generated! Do not modify!*/ InputDialogParameters inputDialogParameters = new InputDialogParameters();\n/*Generated! Do not modify!*/ inputDialogParameters.setReferenceID(referenceID);\n/*Generated! Do not modify!*/ inputDialogParameters.setTitle(title);\n/*Generated! Do not modify!*/ inputDialogParameters.setTextContent(textContent);\n/*Generated! Do not modify!*/ inputDialogParameters.setLabel(label);\n/*Generated! Do not modify!*/ inputDialogParameters.setInitialValueText(initialValueText);\n/*Generated! Do not modify!*/ inputDialogParameters.setOkText(okText);\n/*Generated! Do not modify!*/ inputDialogParameters.setCancelText(cancelText);\n/*Generated! Do not modify!*/ replyDTO.setInputDialogParameters(inputDialogParameters);\n/*Generated! Do not modify!*/ if (recordMode){\n/*Generated! Do not modify!*/ \taddRecordedAction(\"showInputDialog(\" + escapeString(referenceID) + \", \" + escapeString(title) + \", \" + escapeString(textContent) \n/*Generated! Do not modify!*/ \t\t\t+ \", \" + escapeString(label) + \", \" + escapeString(initialValueText) + \", \" + escapeString(okText) \n/*Generated! Do not modify!*/ \t\t\t+ \", \" + escapeString(cancelText)+ \");\");\n/*Generated! Do not modify!*/ }\n/*Generated! Do not modify!*/ return new OverviewSmallStringInputDialogOptions(this, inputDialogParameters);\n/*Generated! Do not modify!*/ }", "@Override\n public void onClick(\n DialogInterface dialog,\n int which) {\n }", "private static void showDialog(Shell shell, String title,\r\n\t\t\tString message, int icon) {\r\n\t\tMessageBox messageBox = new MessageBox(shell, icon | SWT.OK);\r\n\t\tmessageBox.setText(title);\r\n\t\tmessageBox.setMessage(message);\r\n\t\tmessageBox.open();\r\n\t}", "@Override\n\t\t\tpublic void onInfoWindowClick(Marker arg0) {\n\t\t\t\tString id = arg0.getTitle();\n\t\t\t\t\n\t\t\t\tif(id.startsWith(\"Dis\") || id.startsWith(\"my\")){\n\t\t\t\t\tif(id.startsWith(\"Dis\")){\n\t\t\t\t\t\t AlertDialog dialog = new AlertDialog.Builder(MainActivity.this).setTitle(\"Warning\")\n\t\t\t\t\t .setMessage(\"Please select a right victim!!!\")\n\t\t\t\t\t .setNegativeButton(\"OK\", new DialogInterface.OnClickListener() {\n\t\t\t\t public void onClick(DialogInterface dialog, int id) {\n\t\t\t\t \t // finish();\n\t\t\t\t }\n\t\t\t\t }).create();\n\t\t\t\t\t dialog.show();\n\t\t\t\t\t\t}\n\t\t\t\t\tif(id.startsWith(\"my\")){\n\t\t\t\t\t\tmyLocation = arg0.getPosition();\n\t\t\t\t AlertDialog dialog = new AlertDialog.Builder(MainActivity.this)\n\t\t\t\t .setMessage(\"Do you what to update your current location?\")\n\t\t\t\t .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n\t\t\t public void onClick(DialogInterface dialog, int id) {\n\t\t\t \t setFlag = false;\n\t\t\t }\n\t\t\t })\n\t\t\t .setNegativeButton(\"Not now\", new DialogInterface.OnClickListener() {\n\t\t\t public void onClick(DialogInterface dialog, int id) {\n\t\t\t \t \n\t\t\t }\n\t\t\t }).create();\n\t\t\t\t dialog.show();\n\t\t\t\t\t\t}\t\n\t\t\t\t}else{\n\t\t\t\t\tvicLocation = arg0.getPosition();\n\t\t\t\t\tfinal String PoVictim = readOneVictim(id);\n\t\t\t\t\tLog.d(\"victim infomtion:\",PoVictim);\n\t\t\t AlertDialog dialog = new AlertDialog.Builder(MainActivity.this)\n\t\t\t .setMessage(\"What do you want to do with this victim?\")\n\t\t\t .setNegativeButton(\"Edit/Delect Victim\", new DialogInterface.OnClickListener() {\n\t\t public void onClick(DialogInterface dialog, int id) {\n\t\t \t EditVictim(PoVictim);\n\t\t }\n\t\t })\n\t\t .setPositiveButton(\"Find THIS Victim\", new DialogInterface.OnClickListener() {\n\t\t public void onClick(DialogInterface dialog, int id) {\n\t\t \t //String[] PoVIF = PoVictim.split(\",\");\n\t\t \t vicFlag = true;\n\t\t \t //LatLng vic = new LatLng(42.39398619218224,-72.52872716635466);\n\t\t \t if(vicLocation != null && myLocation != null){\n\t\t \t\t if(wayList != null){\n\t\t \t\t\t wayList.clear();\n\t\t \t\t }\n\t\t \t\t \n\t\t \t\t if(indoorFlag){ //when isindoor return true\n\t\t \t\t\t wayList = findOneVictim(myLocation, vicLocation);\n\t\t \t\t\t if(wayList != null){\n\t\t \t\t\t\t getPath();\n\t\t \t\t\t\t}\n\t\t \t\t }else{\n\t\t \t\t\t LatLng door = getNearestDoor(vicLocation);\n\t\t \t\t\t //get the first part outdoor path \n\t\t \t\t\t findDirections(myLocation.latitude,myLocation.longitude,door.latitude,door.longitude,GMapV2Direction.MODE_DRIVING );\n\t\t \t\t\t //wayList.addAll(findOneVictim(door, vicLocation));\n\t\t \t\t } \n\t\t \t }\n\t\t }\n\t\t }).create();\n\t\t\t dialog.show();\n\t\t\t\t}\t\n\t\t\t}", "@Override\r\n\t public void actionPerformed(ActionEvent event) {\n\t \t\t\tJOptionPane.showMessageDialog(gameFrame,\r\n\t \t\t\t regles,\"Règles du jeu\", JOptionPane.INFORMATION_MESSAGE);\r\n\t \t\t\t\r\n\t }", "public void show_dialog_box (){\n //show the message of turning on the location\n Dialog dialog = new Dialog(this);\n dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n dialog.setContentView(R.layout.location_message_r);\n dialog.show();\n }", "public void onClick(View arg0)\n\t\t\t\t{\n\t\t\t\t\tshowDialog(11,\"???? ??? ???? ???????\");\n\t\t\t\t}", "public void open() {\n try {\n if (element != null) {\n DartUI.openInEditor(element, true);\n } else if (element_OLD != null) {\n DartUI.openInEditor(element_OLD);\n } else {\n String title = DartEditorMessages.OverrideIndicatorManager_open_error_title;\n String message = DartEditorMessages.OverrideIndicatorManager_open_error_message;\n MessageDialog.openError(DartToolsPlugin.getActiveWorkbenchShell(), title, message);\n }\n } catch (Exception e) {\n ExceptionHandler.handle(\n e,\n DartEditorMessages.OverrideIndicatorManager_open_error_title,\n DartEditorMessages.OverrideIndicatorManager_open_error_messageHasLogEntry);\n }\n }", "public void show() {\r\n isOkPressed = false;\r\n\r\n dialog = RitDialog.create(context);\r\n dialog.setTitle(\"Inline Method\");\r\n dialog.setContentPane(contentPanel);\r\n\r\n buttonOk.requestFocus();\r\n\r\n HelpViewer.attachHelpToDialog(dialog, buttonHelp, \"refact.inline_method\");\r\n SwingUtil.initCommonDialogKeystrokes(dialog, buttonOk, buttonCancel, buttonHelp);\r\n\r\n dialog.show();\r\n }", "private void openPlacesDialog() {\n // Ask the user to choose the place where they are now.\n DialogInterface.OnClickListener listener =\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n // The \"which\" argument contains the position of the selected item.\n LatLng markerLatLng = mLikelyPlaceLatLngs[which];\n String markerSnippet = mLikelyPlaceAddresses[which];\n if (mLikelyPlaceAttributions[which] != null) {\n markerSnippet = markerSnippet + \"\\n\" + mLikelyPlaceAttributions[which];\n }\n\n // Position the map's camera at the location of the marker.\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(markerLatLng,\n DEFAULT_ZOOM));\n }\n };\n\n // Display the dialog.\n AlertDialog dialog = new AlertDialog.Builder(this)\n .setTitle(R.string.pick_place)\n .setItems(mLikelyPlaceNames, listener)\n .show();\n }", "public void select_details(int icon, String text);", "private void dialogAbout() {\n\t\tGraphicalUserInterfaceAbout.start();\r\n\t}", "public void show() {\n int width = mEditor.getWidth();\n RectF leftHandleRect = mEditor.getLeftHandleRect();\n RectF rightHandleRect = mEditor.getRightHandleRect();\n\n // when right handle goes below visible area, it rect becomes empty. so this feature (or bug) used to calculate popup location\n // if we can not use this,\n // alternative method can be implemented using mMaximumTop\n // @TODO implement a proper way to calculate popup position\n if (rightHandleRect.isEmpty()) {\n rightHandleRect.top = mMaximumTop;\n rightHandleRect.left = width;\n rightHandleRect.bottom = mMaximumTop;\n rightHandleRect.right = width;\n }\n\n float handleHeight = leftHandleRect.height();\n selectionRect.top = Math.min(leftHandleRect.top, rightHandleRect.top);\n selectionRect.bottom = Math.max(leftHandleRect.bottom, rightHandleRect.bottom);\n selectionRect.left = Math.min(leftHandleRect.left, rightHandleRect.left);\n selectionRect.right = Math.max(leftHandleRect.right, rightHandleRect.right);\n\n // prevent drawing popup over the keyboard\n /*if (selectionRect.bottom > mMaximumTop - popHeightPx) {\n selectionRect.bottom -= popHeightPx;\n }*/\n\n if (mLeft > width - getWidth()) {\n mLeft = width - getWidth();\n }\n int height = mEditor.getHeight();\n if (mTop > height - getHeight()) {\n mTop = height - getHeight();\n }\n if (mTop < 0) {\n mTop = 0;\n }\n if (mLeft < 0) {\n mLeft = 0;\n }\n mEditor.getLocationInWindow(mLocation);\n boolean topCovered = mLocation[1] > selectionRect.top - textSizePx - popHeightPx - handleHeight;\n\n if (topCovered) {\n mTop = (int) (selectionRect.bottom + (handleHeight));\n } else {\n mTop = (int) (selectionRect.top - textSizePx - popHeightPx - handleHeight);\n }\n if (isShowing()) {\n update(mLocation[0] + mLeft, mLocation[1] + mTop, getWidth(), getHeight());\n return;\n }\n super.showAtLocation(mEditor,\n Gravity.START | Gravity.TOP,\n mLocation[0] + mLeft, mLocation[1] + mTop);\n }", "private void showInstructions() {\n Alert popUp = new Alert(Alert.AlertType.INFORMATION);\n popUp.setTitle(\"Instructions\");\n popUp.setContentText(\"The size field in the bottom let controls the board demensions.\" \n + \"The coord field in the bottom right controls the starting point of the tour \" \n + \"where 0 <= x, y < size. \"\n + \"Press enter with the text field in focus to submit changes. \"\n + \"Changes submitted to the coordinate field will start a new tour. \"\n + \"Depending on the conditions it could take a while!\");\n\n popUp.showAndWait();\n }", "@Override\r\n\tpublic void launch(IEditorPart arg0, String arg1) {\n\r\n\t}", "public void showmessage ( String tiltle, String message){\n\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setCancelable(true);\n builder.setTitle(tiltle);\n builder.setMessage(message);\n builder.show();\n }", "@Override\r\n\r\n\tpublic void doAction(Object object, Object param, Object extParam,Object... args) {\n\t\tString match = \"\";\r\n\t\tString ks = \"\";\r\n\t\tint time = 3000; // Default wait 3 secs before and after the dialog shows.\r\n\r\n\t\ttry {\r\n\t\t\tThread.sleep(time);\r\n\t\t\tIWindow activeWindow = RationalTestScript.getScreen().getActiveWindow();\r\n\t\t\t// ITopWindow activeWindow = (ITopWindow)AutoObjectFactory.getHtmlDialog(\"ITopWindow\");\r\n\t\t\tif ( activeWindow != null ) {\r\n\t\t\t\tif ( activeWindow.getWindowClassName().equals(\"#32770\") ) {\r\n\t\t\t\t\tactiveWindow.inputKeys(param.toString());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t/*int hwnd = Win32IEHelper.getDialogTop();\r\n\t\t\tTopLevelTestObject too = null;\r\n\t\t\tTestObject[] foundTOs = RationalTestScript.find(RationalTestScript.atChild(\".hwnd\", (long)hwnd, \".domain\", \"Win\"));\r\n\t\t\tif ( foundTOs!=null ) {\r\n\t\t\t\t// Maximize it\r\n\t\t\t\tif ( foundTOs[0]!=null) {\r\n\t\t\t\t\ttoo = new TopLevelTestObject(foundTOs[0]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (too!=null) {\r\n\t\t\t\ttoo.inputKeys(param.toString());\r\n\t\t\t}*/\r\n\t\t\tThread.sleep(time);\r\n\t\t} catch (NullPointerException e ) {\t\t\t\r\n\t\t} catch (ClassCastException e) {\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.err.println(\"Error finding the HTML dialog.\");\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testInterceptorBindingOpenOn() {\n\t\tnew DefaultStyledText().selectText(\"s:InterceptorBinding\");\n\t\tKeyboardFactory.getKeyboard().invokeKeyCombination(SWT.F3);\n\t\tnew DefaultEditor(\"InterceptorBinding.class\");\n\n\t\t/* test opened object */\n\t\tassertExpectedOpenedClass(\"javax.interceptor.InterceptorBinding\");\n\n\t}", "private void showInfo() {\n JOptionPane.showMessageDialog(\n this,\n \"Пока что никакой\\nинформации тут нет.\\nДа и вряд ли будет.\",\n \"^^(,oO,)^^\",\n JOptionPane.INFORMATION_MESSAGE);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t\tint re = jfc.showOpenDialog(f);\n\t\t\t\tfile = jfc.getSelectedFile();\n\t\t\t\tif (re == 0) {\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\tFileReader fr = new FileReader(file);\n\t\t\t\t\t\tint ch;\n\t\t\t\t\t\tString str = \"\";\n\n\t\t\t\t\t\twhile ((ch = fr.read()) != -1) {\n\t\t\t\t\t\t\tstr += (char) ch;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tta.setText(str);\n\t\t\t\t\t\tfr.close();\n\t\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t\tSystem.out.println(ex.getMessage());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\n public void onClick(View arg0) {\n ((CreateDocketActivityPart2) activity).openPopUpForSpareParts(position);\n }", "public void showMessage(int x, int y, String message) {\n }", "private void tutorial(){\n\t\tString msg = \"[Space] = Inicia e pausa o jogo depois de iniciado.\";\n\t\tmsg += \"\\n[Seta esquerda] = Move o paddle para a esquerda.\";\n\t\tmsg += \"\\n[Seta direita] = Move o paddle para a direita.\";\n\t\tmsg += \"\\n[I] = Abre a janela de informaçoes.\";\n\t\tmsg += \"\\n[R] = Reinicia o jogo.\";\n\t\tJOptionPane.showMessageDialog(null, \"\"+msg, \"Informaçoes\", JOptionPane.INFORMATION_MESSAGE);\n\t}", "@Override\n public void onClick(View v) {\n new AlertDialog.Builder(MainActivity.this)\n .setIcon(android.R.drawable.ic_menu_edit)\n .setTitle(\"Textual Description\")\n .setMessage(\"Is this the location where you would like to describe something?\")\n .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener()\n {\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n\n GridPoint gp = myGridPoint();\n MarkerOptions markerOptions = new MarkerOptions().gridPoint(gp);\n markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));\n Marker marker = mMap.addMarker(markerOptions);\n describe();\n\n }\n\n })\n .setNegativeButton(\"No\", null)\n .show();\n\n }", "@Override\n\t\tpublic void openMenu() {\n\t\t}", "public String mo6833a() {\n return \"show_dialog\";\n }", "public void onClick(View arg0)\n\t\t\t\t{\n\t\t\t\t\tshowDialog(2,\"???? ????\");\n\t\t\t\t}", "public void actionPerformed(java.awt.event.ActionEvent e) {\n\t\t\t\t\tJDialog jDialog = getPomocDialog();\n\t\t\t\t\tjDialog.setTitle(\"Pomoc\");\n\t\t\t\t\tjDialog.pack();\n\t\t\t\t\tPoint loc = getHlavneOkno().getLocation();\n\t\t\t\t\tloc.translate(20, 20);\n\t\t\t\t\tjDialog.setLocation(loc);\n\t\t\t\t\tjDialog.setVisible(true);\n\t\t\t\t\n\t\t\t\t}", "@Override\n public void onItemClick(View view, int position, LocationMessage content, UIMessage message) {\n\n Intent intent = new Intent(view.getContext(), ShowTencentMap.class);\n intent.putExtra(\"location\", message.getContent());\n view.getContext().startActivity(intent);\n\n }", "@Override\n\tpublic void info(CharSequence message) {\n\n\t}", "public void onClick(View arg0)\n\t\t\t\t{\n\t\t\t\t\tshowDialog(10,\"???? ?????\");\n\t\t\t\t}", "public static void alert(String message) {\r\n\t Stage window = new Stage();\r\n\r\n\t // Blokira klikanje na druge povrsine sem pop-up\r\n\t window.initModality(Modality.APPLICATION_MODAL);\r\n\t window.setTitle(\"Alert\");\r\n\t window.setMinWidth(250);\r\n\t window.setMinHeight(100);\r\n\t \r\n\t // Label\r\n\t Label label = new Label();\r\n\t label.setText(message);\r\n\t Button closeButton = new Button(\"Close\");\r\n\t closeButton.setOnAction(e -> window.close());\r\n\r\n\t // Layout\r\n\t VBox layout = new VBox(10);\r\n\t layout.getChildren().addAll(label, closeButton);\r\n\t layout.setAlignment(Pos.CENTER);\r\n\r\n\t // Pop-up ostaje aktivan\r\n\t Scene scene = new Scene(layout);\r\n\t window.setScene(scene);\r\n\t window.showAndWait();\r\n\t }", "@FXML public void showInfo(ActionEvent e){\n\t\tAlert alert = new Alert(AlertType.INFORMATION);\n\t\talert.setTitle(\"Picture Information\");\n\t\talert.setHeaderText(\"Current Photo Information\");\n\t\talert.setContentText(listOfPhotos.get(photoNumber).printAttributes());\n\n\t\talert.showAndWait();\n\t}", "public void onClick(View arg0)\n\t\t\t\t{\n\t\t\t\t\tshowDialog(14,\"???? ???????\");\n\t\t\t\t}", "public void open() {\n\t\tthis.createContents();\n\n\t\tWindowBuilder delegate = this.getDelegate();\n\t\tdelegate.setTitle(this.title);\n\t\tdelegate.setContents(this);\n\t\tdelegate.setIcon(this.iconImage);\n\t\tdelegate.setMinHeight(this.minHeight);\n\t\tdelegate.setMinWidth(this.minWidth);\n\t\tdelegate.open();\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tJOptionPane.showMessageDialog(frame, \n//\" Programming language: Java\\n\"+\n\" Developer: Monish Gupta\\n\"+\n\" monishgupta.blogspot.com\", \"About\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJOptionPane.showMessageDialog(mainscreen, \"Created by Saadia Aman and Ammar Israr\");\n\t\t\t}", "public void onClick(View arg0)\n\t\t\t\t{\n\t\t\t\t\tshowDialog(12,\"???? ?????\");\n\t\t\t\t}", "private void showFindDialog() {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(this,R.style.AlertDialogCustom));\n\t\tbuilder.setTitle(\"好友列表\");\n\t\tView FriendListView = LayoutInflater.from(this).inflate(R.layout.friend_list_view, null);\n\t\t\n\t\tfinal ListView listView = (ListView) FriendListView.findViewById(R.id.mapfriendlistView);\n\n\t\tlistView.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View view, int position,\n\t\t\t\t\tlong arg3) {\n\t\t\t\tSystem.out.println(position);\n\t\t\t\tshowFriendLatLng(position);\n\t\t\t\tdialog.dismiss();\n\t\t\t}\n\t\t});\n builder.setView(FriendListView);\n\t\tdialog = builder.create();\n\t\tdialog.show();\n\t\t\n\t}", "public void action() {\n MessageTemplate template = MessageTemplate.MatchPerformative(CommunicationHelper.GUI_MESSAGE);\n ACLMessage msg = myAgent.receive(template);\n\n if (msg != null) {\n\n /*-------- DISPLAYING MESSAGE -------*/\n try {\n\n String message = (String) msg.getContentObject();\n\n // TODO temporary\n if (message.equals(\"DistributorAgent - NEXT_SIMSTEP\")) {\n \tguiAgent.nextAutoSimStep();\n // wykorzystywane do sim GOD\n // startuje timer, zeby ten zrobil nextSimstep i statystyki\n // zaraz potem timer trzeba zatrzymac\n }\n\n guiAgent.displayMessage(message);\n\n } catch (UnreadableException e) {\n logger.error(this.guiAgent.getLocalName() + \" - UnreadableException \" + e.getMessage());\n }\n } else {\n\n block();\n }\n }" ]
[ "0.6092715", "0.6092715", "0.5988093", "0.581076", "0.57379836", "0.5715984", "0.5659326", "0.5619902", "0.5618932", "0.56164354", "0.56132805", "0.55817443", "0.55414224", "0.5537437", "0.55128044", "0.5491037", "0.5475073", "0.5466551", "0.54489124", "0.5439", "0.54096025", "0.5379497", "0.5358538", "0.5340138", "0.53350854", "0.5318631", "0.530297", "0.5297217", "0.5292062", "0.52808815", "0.5279685", "0.5275673", "0.52698463", "0.52693963", "0.52633893", "0.5253444", "0.5242396", "0.5242335", "0.52422994", "0.523393", "0.52326936", "0.5227727", "0.5199529", "0.5196327", "0.51817775", "0.51763046", "0.5176199", "0.5173199", "0.5171692", "0.5171355", "0.5167045", "0.51654065", "0.51641047", "0.51592714", "0.5149133", "0.51420254", "0.5139174", "0.51332504", "0.51330173", "0.5119382", "0.5113826", "0.51107323", "0.50980014", "0.5097495", "0.50948447", "0.50921637", "0.5084135", "0.5081407", "0.5057846", "0.50469625", "0.50404054", "0.50401926", "0.50394046", "0.5033638", "0.50318015", "0.5030328", "0.502705", "0.50241786", "0.5019924", "0.5008914", "0.50055903", "0.5005582", "0.50047153", "0.50043845", "0.5000912", "0.5000206", "0.49992782", "0.49983233", "0.4997278", "0.49944746", "0.49906933", "0.4978396", "0.49778998", "0.49776438", "0.49732366", "0.49711415", "0.49684414", "0.49665067", "0.4966498", "0.49640888" ]
0.58472455
3
Creates a new NameSurferGraph object that displays the data.
public NameSurferGraph() { addComponentListener(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public NameSurferGraph() {\r\n\t\taddComponentListener(this);\r\n\t\tentryGraph = new ArrayList<NameSurferEntry>();\r\n\t}", "public NameSurferGraph() {\n\t\taddComponentListener(this);\n\t\tentries = new ArrayList<NameSurferEntry>();\n\t}", "public void init() {\n\t\t// Read the data text file and load up the local database\n\t\tinitData();\n\n\t\t// Create the labels and the textbox\n\t\taddNameLabel();\n\t\taddNameBox();\n\t\taddGraphButton();\n\t\taddClearButton();\n\n\t\t// Set up the graph object\n\t\tgraph = new NameSurferGraph();\n\t\tadd(graph);\n\n\t}", "@Override\n \t\t\t\tpublic String getGraphName() {\n \t\t\t\t\treturn \"http://opendata.cz/data/namedGraph/3\";\n \t\t\t\t}", "public GraphPanel()\n\t{\n\t\t// instantiates graphArray to hold list of names to graph \n\t\tgraphArray = new ArrayList<NameRecord>();\n\t\t\n\t\t// sets the size of the panel\n\t\tsetPreferredSize(new Dimension(600,600));\n\t}", "private void createGraph() {\r\n graph = new Graph(SHELL, SWT.NONE);\r\n\r\n final GridData gridData = new GridData();\r\n gridData.horizontalAlignment = GridData.FILL;\r\n gridData.verticalAlignment = GridData.FILL;\r\n gridData.grabExcessHorizontalSpace = true;\r\n gridData.grabExcessVerticalSpace = true;\r\n gridData.heightHint = DEFAULT_GRAPH_SIZE;\r\n gridData.widthHint = DEFAULT_GRAPH_SIZE;\r\n graph.setLayoutData(gridData);\r\n }", "public samJGraph()\n {\n super(new GraphPane( new GraphModel(), new samGraphController() ) );\n }", "public GraphInfo(){}", "public void setGraphName(String name) {\n this.graphname = name;\n }", "public Visualization( String name, Facegraph facegraph ) {\r\n\t\tsuper( 100, name );\r\n\t\tlogger.info( \"New visualization object created\" );\r\n\r\n\t\tthis.facegraph = facegraph;\r\n\t\tthis.name = name;\r\n\t}", "public String getGraphName()\n {\n return \"Testabilty Trend Report\";\n }", "public void constructJSONGraph(String name){\n \t IndexHits<Node> foundNodes = findTaxNodeByName(name);\n Node firstNode = null;\n if (foundNodes.size() < 1){\n System.out.println(\"name '\" + name + \"' not found. quitting.\");\n return;\n } else if (foundNodes.size() > 1) {\n System.out.println(\"more than one node found for name '\" + name + \"'not sure how to deal with this. quitting\");\n } else {\n for (Node n : foundNodes)\n firstNode = n;\n }\n \t\tSystem.out.println(firstNode.getProperty(\"name\"));\n \t\tTraversalDescription CHILDOF_TRAVERSAL = Traversal.description()\n \t\t .relationships( RelTypes.TAXCHILDOF,Direction.INCOMING );\n \t\tHashMap<Node,Integer> nodenumbers = new HashMap<Node,Integer>();\n \t\tHashMap<Integer,Node> numbernodes = new HashMap<Integer,Node>();\n \t\tint count = 0;\n \t\tfor(Node friendnode: CHILDOF_TRAVERSAL.traverse(firstNode).nodes()){\n \t\t\tif (friendnode.hasRelationship(Direction.INCOMING)){\n \t\t\t\tnodenumbers.put(friendnode, count);\n \t\t\t\tnumbernodes.put(count,friendnode);\n \t\t\t\tcount += 1;\n \t\t\t}\n \t\t}\n \t\tPrintWriter outFile;\n \t\ttry {\n \t\t\toutFile = new PrintWriter(new FileWriter(\"graph_data.js\"));\n \t\t\toutFile.write(\"{\\\"nodes\\\":[\");\n \t\t\tfor(int i=0; i<count;i++){\n \t\t\t\tNode tnode = numbernodes.get(i);\n \t\t\t\toutFile.write(\"{\\\"name\\\":\\\"\"+tnode.getProperty(\"name\")+\"\");\n \t\t\t\toutFile.write(\"\\\",\\\"group\\\":\"+nodenumbers.get(tnode)+\"\");\n \t\t\t\toutFile.write(\"},\");\n \t\t\t}\n \t\t\toutFile.write(\"],\\\"links\\\":[\");\n \t\t\tfor(Node tnode: nodenumbers.keySet()){\n \t\t\t\tfor(Relationship trel : tnode.getRelationships(Direction.OUTGOING)){\n \t\t\t\t\toutFile.write(\"{\\\"source\\\":\"+nodenumbers.get(trel.getStartNode())+\"\");\n \t\t\t\t\toutFile.write(\",\\\"target\\\":\"+nodenumbers.get(trel.getEndNode())+\"\");\n \t\t\t\t\toutFile.write(\",\\\"value\\\":\"+1+\"\");\n \t\t\t\t\toutFile.write(\"},\");\n \t\t\t\t}\n \t\t\t}\n \t\t\toutFile.write(\"]\");\n \t\t\toutFile.write(\"}\\n\");\n \t\t\toutFile.close();\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}", "public GraphView() {\r\n graphModel = new GraphModel();\r\n graphModel.setNoOfChannels(0);\r\n graphModel.setXLength(1);\r\n initializeGraph();\r\n add(chartPanel);\r\n setVisible(true);\r\n }", "public Builder setGraphName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n graphName_ = value;\n onChanged();\n return this;\n }", "public void displayGraph() {\r\n\t\tgraph.display();\r\n\t}", "@Override\r\n\tpublic Viewer create(String name) {\n\t\tif(this.isAllDataPresent())\r\n\t\t{\r\n\t\t\treturn new ShapeViewer(name);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\t\r\n\t}", "private Node createDetails ()\n {\n\n List<String> prefix = Arrays.asList (charts,sessionlength,labels);\n\n FlowPane b = new FlowPane ();\n b.getStyleClass ().add (StyleClassNames.DETAIL);\n\n return b;\n\n }", "public Graph() {\r\n\t\tinit();\r\n\t}", "void makeSampleGraph() {\n\t\tg.addVertex(\"a\");\n\t\tg.addVertex(\"b\");\n\t\tg.addVertex(\"c\");\n\t\tg.addVertex(\"d\");\n\t\tg.addVertex(\"e\");\n\t\tg.addVertex(\"f\");\n\t\tg.addVertex(\"g\");\n\t\tg.addEdge(\"a\", \"b\");\n\t\tg.addEdge(\"b\", \"c\");\n\t\tg.addEdge(\"b\", \"f\");\n\t\tg.addEdge(\"c\", \"d\");\n\t\tg.addEdge(\"d\", \"e\");\n\t\tg.addEdge(\"e\", \"f\");\n\t\tg.addEdge(\"e\", \"g\");\n\t}", "public static GraphNode createGraphNodeForSubsystem() {\n GraphNode nameNode = new GraphNode();\n\n for (int i = 0; i < 3; i++) {\n GraphNode childNode = new GraphNode();\n\n childNode.setPosition(AccuracyTestHelper.createPoint(0, 12 * i));\n childNode.setSize(AccuracyTestHelper.createDimension(100, 22));\n\n nameNode.addContained(childNode);\n }\n\n nameNode.setPosition(AccuracyTestHelper.createPoint(20, 20));\n nameNode.setSize(AccuracyTestHelper.createDimension(100, 100));\n\n GraphNode graphNode = new GraphNode();\n graphNode.addContained(nameNode);\n graphNode.addContained(new GraphNode());\n\n graphNode.setPosition(AccuracyTestHelper.createPoint(20, 20));\n graphNode.setSize(AccuracyTestHelper.createDimension(1000, 1000));\n\n // create a subsystem\n Subsystem subsystem = new SubsystemImpl();\n\n // set namespace\n Namespace namespace = new MockNamespaceImplAcucracy();\n subsystem.setNamespace(namespace);\n\n // create a semantic model\n Uml1SemanticModelBridge semanticModel = new Uml1SemanticModelBridge();\n semanticModel.setElement(subsystem);\n\n graphNode.setSemanticModel(semanticModel);\n\n return graphNode;\n }", "public static Graph buildGraph1() {\n Graph g = new Graph(\"Undirected graph For Kruskal Algorithm\");\n g.addEdge(\"A\", \"E\", 5);\n g.addEdge(\"A\", \"D\", 3);\n g.addEdge(\"A\", \"H\", 7);\n g.addEdge(\"A\", \"B\", 6);\n g.addEdge(\"D\", \"E\", 9);\n g.addEdge(\"D\", \"C\", 12);\n g.addEdge(\"C\", \"B\", 20);\n g.addEdge(\"B\", \"F\", 15);\n g.addEdge(\"F\", \"G\", 17);\n g.addEdge(\"G\", \"H\", 1);\n\n g.sortEdgesByIncreasingWeights();\n\n System.out.println(g);\n\n return g;\n }", "public String getDisplayName() {\n\t\treturn \"Dependency Graph\";\n\t}", "public Graph(){\r\n this.listEdges = new ArrayList<>();\r\n this.listNodes = new ArrayList<>();\r\n this.shown = true;\r\n }", "@Override\r\n\tpublic Viewer create(String name) {\n\t\tif(this.isAllDataPresent())\r\n\t\t{\r\n\t\t\treturn new StressViewer(name);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public static void DrawIt (Graph<Integer,String> g) {\n\t\tISOMLayout<Integer,String> layout = new ISOMLayout<Integer,String>(g);\r\n\t\t// The Layout<V, E> is parameterized by the vertex and edge types\r\n\t\tlayout.setSize(new Dimension(650,650)); // sets the initial size of the space\r\n\t\t// The BasicVisualizationServer<V,E> is parameterized by the edge types\r\n\t\tBasicVisualizationServer<Integer,String> vv =\r\n\t\tnew BasicVisualizationServer<Integer,String>(layout);\r\n\t\tvv.setPreferredSize(new Dimension(650,650)); //Sets the viewing area size\r\n\t\tJFrame frame = new JFrame(\"Simple Graph View\");\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().add(vv);\r\n\t\tframe.pack();\r\n\t\tframe.setVisible(true);\r\n\r\n\t}", "void createGraphForSingleLoad();", "public DotGraph(String graphname) {\n this.graphname = graphname;\n this.isSubGraph = false;\n this.nodes = new HashMap<String, DotGraphNode>(100);\n this.drawElements = new LinkedList<Renderable>();\n this.attributes = new LinkedList<DotGraphAttribute>();\n }", "public String toString() {\n return \"Flowers [name=\" + name + \", color=\" + color + \"]\";\n }", "public Graph() {\n\t\ttowns = new HashSet<Town>();\n\t\troads = new HashSet<Road>();\n\t\tprevVertex = new HashMap<String, Town>();\n\t}", "public DSAGraph()\n\t{\n\t\tvertices = new DSALinkedList();\n\t\tedgeCount = 0;\n\t}", "private void plotName(NameSurferEntry entry, int entryNumber) {\r\n\t\t\r\n\t\tfor(int i = 0; i<NDECADES; i++) {\r\n\t\t\tString name = entry.getName();\r\n\t\t\tint rank = entry.getRank(i);\r\n\t\t\tString rankString = Integer.toString(rank);\r\n\t\t\tString label = name + \" \" + rankString;\r\n\t\t\t\r\n\t\t\tdouble x = i * (getWidth()/NDECADES) + SPACE;\r\n\t\t\tdouble y = 0;\r\n\t\t\t\r\n\t\t\tif(rank != 0) {\r\n\t\t\t\ty = GRAPH_MARGIN_SIZE + (getHeight() - GRAPH_MARGIN_SIZE*2) * rank/MAX_RANK - SPACE;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tlabel = name + \" *\";\r\n\t\t\t\ty = getHeight() - GRAPH_MARGIN_SIZE - SPACE;\r\n\t\t\t}\r\n\t\t\tGLabel nameLabel = new GLabel(label, x, y);\r\n\t\t\tint numb = entryNumber % NCOLORS;\r\n\t\t\tColor color = NewColor (numb);\r\n\t\t\tnameLabel.setColor(color);\r\n\t\t\tadd(nameLabel);\r\n\t\t}\r\n\t}", "public Graphs() {\n graph = new HashMap<>();\n }", "public FileSourceGraphML() {\n\t\tevents = new Stack<XMLEvent>();\n\t\tkeys = new HashMap<String, Key>();\n\t\tdatas = new LinkedList<Data>();\n\t\tgraphId = new Stack<String>();\n\t\tgraphCounter = 0;\n\t\tsourceId = String.format(\"<GraphML stream %x>\", System.nanoTime());\n\t}", "public String getGraphName() {\r\n\t\treturn graphName;\r\n\t}", "public Graph() {\n\t\tthis(new PApplet());\n\t}", "public void createGraphPanel(List<String> states){\n\t\tgraph = new GraphPanel(states);\n\t\tgraph.update(updatePopulations(), 0);\n\t}", "public GraphicalThingView createGraphicalThingView(String inImageName)\n\t{\n\t\treturn new GraphicalTreeView(inImageName);\n\t}", "public RenderGraph(){\n \n \t\tString[] a = this.tibbr_url.split(\"//\");\n \t\tString[] url = a[1].split(\".t\"); // assumes the URL is *.tibbr.*\n \n \t\t//String date = new SimpleDateFormat(\"dd-MM-yyyy\").format(new Date());\n \t\t//filename = b[0]+ \"_graph_\" +date+ \".csv\";\n \t\tfilename = url[0]+ \"_graph.csv\";\n \n \t}", "public Graph()\r\n\t{\r\n\t\tthis.adjacencyMap = new HashMap<String, HashMap<String,Integer>>();\r\n\t\tthis.dataMap = new HashMap<String,E>();\r\n\t}", "public SurferForm(Surfer surfer) {\n\t\tsuper(\"Surfer\");\n\n\t\tthis.surfer = surfer;\n\n\t\tstartComponents();\n\t}", "public Graph() {\n\t\tdictionary=new HashMap<>();\n\t}", "public void buildGraph(){\n\t}", "public UGraph()\r\n {\r\n uNodes = new HashMap<Integer , UNode>();\r\n uEdges = new HashMap<Integer, UEdge>();\r\n }", "public Figure(String name)\n\t{\n\t\tthis.name = name;\n\t}", "public Builder clearGraphName() {\n \n graphName_ = getDefaultInstance().getGraphName();\n onChanged();\n return this;\n }", "protected IWeightedGraph<GraphNode, WeightedEdge> createGraph() {\r\n\t\treturn createGraph(goapUnit.getGoalState());\r\n\t}", "public static GraphNode createGraphNodeForUseCase() {\n GraphNode graphNode = new GraphNode();\n GraphNode graphNodeName = new GraphNode();\n\n for (int i = 0; i < 3; i++) {\n GraphNode childNode = new GraphNode();\n\n childNode.setPosition(AccuracyTestHelper.createPoint(60, 20 + 20 * i));\n childNode.setSize(AccuracyTestHelper.createDimension(100, 22));\n\n graphNodeName.addContained(childNode);\n }\n\n graphNode.addContained(graphNodeName);\n\n graphNode.setPosition(AccuracyTestHelper.createPoint(20, 20));\n graphNode.setSize(AccuracyTestHelper.createDimension(100, 100));\n\n // create a use case\n UseCase usecase = new UseCaseImpl();\n\n // set stereotype\n Stereotype stereotype = new StereotypeImpl();\n usecase.addStereotype(stereotype);\n\n // set namespace\n Namespace namespace = new MockAccuracyNamespaceImpl();\n usecase.setNamespace(namespace);\n\n // create a semantic model\n Uml1SemanticModelBridge semanticModel = new Uml1SemanticModelBridge();\n semanticModel.setElement(usecase);\n\n graphNode.setSemanticModel(semanticModel);\n\n return graphNode;\n }", "Graph(){\n\t\tadjlist = new HashMap<String, Vertex>();\n\t\tvertices = 0;\n\t\tedges = 0;\n\t\tkeys = new ArrayList<String>();\n\t}", "public void createGraph() {\n System.out.println(\"The overlay graph will be created from scratch\");\n graph = new MatrixOverlayGraph();\n parse(dumpPath);\n saveGraph();\n graph.createSupporters(kdTreeSupporterActived);\n saveSupporters();\n }", "private void createGraphs() {\n initialGraphCreation.accept(caller, listener);\n graphCustomization.accept(caller, listener);\n caller.generateAndAdd(params.getNumCallerEvents(), callerAddToGraphTest);\n listener.generateAndAdd(params.getNumListenerEvents(), listenerAddToGraphTest);\n generationDefinitions.accept(caller, listener);\n }", "@Override\n\tpublic void setName(String name) {\n\t\tfanChart.setName(name);\n\t}", "private void createTree(String Name) {\n DecisionTree tree = new DecisionTree(treeID, Name, mainPanel.getSize(), font);\n mainPanel.addTab(Name + \" *\", tree);\n trees.add(tree);\n }", "private void setUpGraph() {\n \tString title;\n\t\ttry {\n\t\t\ttitle = util.readTextFile(new File(UI.UITEXT_DIRECTORY)).get(GRAPHTITLE_DEX);\n\t\t\taCS = new AreaChartSample(cellStateNames,title);\n\t\t} catch (FileNotFoundException e) {\n\t\t\taCS = new AreaChartSample(cellStateNames, \"ERROR ON TITLE\");\n\t\t}\n\t\troot.getChildren().add(aCS.getAreaChart());\n \tplot();\n }", "public PlainGraph createGraph() {\n PlainGraph graph = new PlainGraph(getUniqueGraphName(), GraphRole.RULE);\n graphNodeMap.put(graph, new HashMap<>());\n return graph;\n }", "private static void startDiagram(String nameOfDiagram, PrintWriter printFile) {\n\t\tprintFile.print(\"digraph \" + nameOfDiagram + \"{\\nrankdir=BT\\n\");\n\t}", "public MTNamed(TypeGraph g, String name) {\n super(g);\n myName = name;\n }", "Graph(){\n\t\taddNode();\n\t\tcurrNode=myNodes.get(0);\n\t}", "public Graph()\n\t{\n\t\tthis.total_verts = null;\n\t\tthis.total_edges = null;\n\t\tnodes = new HashMap<String, Node>();\n\t}", "public GraphInfo(String graphID, String graphName, String graphType){\r\n\t\tthis.graphID = graphID;\r\n\t\tthis.graphName = graphName;\r\n\t\tthis.graphType = graphType;\r\n\t}", "public BubbleDisplay createBubbleDisplay()\n\t{\t\n\t\tbubbleDisplay = new BubbleDisplay();\n\t\treturn bubbleDisplay;\n\t}", "public Villager(String name) {\r\n\t\tthis.name = name;\r\n\t}", "@Override\n public String toString() {\n String str = \"graph [\\n\";\n\n Iterator<Node<E>> it = iterator();\n\n //Node display\n while(it.hasNext()){\n Node n = it.next();\n\n str += \"\\n\\tnode [\";\n str += \"\\n\\t\\tid \" + n;\n str += \"\\n\\t]\";\n }\n\n //Edge display\n it = iterator();\n\n while(it.hasNext()){\n Node n = it.next();\n\n Iterator<Node<E>> succsIt = n.succsOf();\n while(succsIt.hasNext()){\n Node succN = succsIt.next();\n\n str += \"\\n\\tedge [\";\n str += \"\\n\\t\\tsource \" + n;\n str += \"\\n\\t\\ttarget \" + succN;\n str += \"\\n\\t\\tlabel \\\"Edge from node \" + n + \" to node \" + succN + \" \\\"\";\n str += \"\\n\\t]\";\n }\n }\n\n str += \"\\n]\";\n\n return str;\n }", "public Graph() {\n }", "public RoutingResourceGraph() {\n ex = new RunGraph(3,2);\n squares = new JLabel[ex.getGraphSize()][ex.getGraphSize()];\n squares_sinks = new JLabel[ex.getGraphSize()][ex.getGraphSize()];\n squares_wires = new JLabel[2 * ex.getGraphSize() * ex.getGraphSize()][ex.getWireSize()];\n switches = new JToggleButton[ex.getGraphSize()][ex.getGraphSize()];\n ex.initialize();\n initComponents();\n initialize();\n add_edge();\n ex.find_shortest_path();\n showCong();\n showGraph();\n }", "public GraphicalTreeView(String inImageName)\n\t\t{\n\t\t\tsuper(inImageName);\n\t\t}", "public String getName() { return \"GDS\"; }", "public static void main(String[] args) {\n\t\t\r\n\t\tGraph g = new Graph();\r\n\t\tg.printData();\r\n\t\t\r\n\t}", "private static TransformedGraph prepareInputGraph (final String name) {\n\t\treturn new SerializableTransformedGraph() {\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\t@Override\n\t\t\tpublic String getGraphName() {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic String getGraphId() {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic String getMetadataGraphName() {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t@Override\n public String getProvenanceMetadataGraphName() {\n return null;\n }\n\t\t\t@Override\n\t\t\tpublic Collection<String> getAttachedGraphNames() {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void addAttachedGraph(String attachedGraphName)\n\t\t\t\t\tthrows TransformedGraphException {\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void deleteGraph() throws TransformedGraphException {\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic boolean isDeleted() {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t}", "public void display() {\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tString str = vname + \" => \";\r\n\t\t\tVertex vtx = vces.get(vname);\r\n\r\n\t\t\tArrayList<String> nbrnames = new ArrayList<>(vtx.nbrs.keySet());\r\n\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\tstr += nbrname + \"[\" + vtx.nbrs.get(nbrname) + \"], \";\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(str + \".\");\r\n\t\t}\r\n\t}", "public Graph() {\r\n\t\tnodePos = new HashMap<Integer, Vec2D>();\r\n\t\tconnectionLists = new HashMap<Integer, List<Connection>>();\r\n\t\t//screenWidth = Config.SCREEN_WIDTH;\r\n\t}", "public FlowPane simulationGraphs() {\r\n\t\t// Create FlowPane Of Graphs\r\n\t\tFlowPane graphs = new FlowPane(queueLengthGraph, queueTimeGraph, carparkUtilisationGraph);\r\n\t \r\n\t\t// Setup Pane\r\n\t\tgraphs.setMinSize(1000, 200);\r\n\t\t\r\n\t\treturn graphs;\r\n\t}", "IGraphEngine graphEngineFactory();", "public JXGraph() {\r\n this(0.0, 0.0, -1.0, 1.0, -1.0, 1.0, 0.2, 4, 0.2, 4);\r\n }", "private void getEntries() {\r\n\r\n\t\tif(displayEntries.size() > 0){\r\n\t\t\tfor (int i = 0; i<displayEntries.size(); i++){\r\n\t\t\t\tNameSurferEntry entries = displayEntries.get(i);\r\n\t\t\t\tdrawRankGraph(entries,i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public FamilyTree()\n\t{\n\t\tpersonMap = new HashMap<String, Information> (); //the information is basically relationships and people he has relationships with\n\t\tlastNameMap = new HashMap<String, HashSet<String>>();\n\t}", "public ExportGraph()\n {\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"Garage [id=\" + id + \", name=\" + name + \"]\";\n\t}", "public static GraphNode createGraphNodeForActor() {\n GraphNode graphNode = new GraphNode();\n\n for (int i = 0; i < 3; i++) {\n GraphNode childNode = new GraphNode();\n\n childNode.setPosition(AccuracyTestHelper.createPoint(0, 12 * i));\n childNode.setSize(AccuracyTestHelper.createDimension(100, 22));\n\n graphNode.addContained(childNode);\n }\n\n graphNode.setPosition(AccuracyTestHelper.createPoint(20, 20));\n graphNode.setSize(AccuracyTestHelper.createDimension(100, 100));\n\n // create an actor\n Actor actor = new ActorImpl();\n\n\n // set stereotype\n Stereotype stereotype = new StereotypeImpl();\n actor.addStereotype(stereotype);\n\n // set namespace\n Namespace namespace = new MockAccuracyNamespaceImpl();\n actor.setNamespace(namespace);\n\n // create a semantic model\n Uml1SemanticModelBridge semanticModel = new Uml1SemanticModelBridge();\n semanticModel.setElement(actor);\n\n graphNode.setSemanticModel(semanticModel);\n\n return graphNode;\n }", "public String createFamily(String name);", "public void addName(NameRecord record)\n\t{\n\t\t// add code to add record to the graphArray \n\t\t// and call repaint() to update the graph\n\t}", "@Override()\n protected RelationshipData createNewData(final String _name)\n {\n return new RelationshipData(this, _name);\n }", "public void initGraph(GraphData graphData) {\r\n \t\r\n \tGraph g = graphData.getGraph();\r\n \r\n // add visual data groups\r\n \tsetGraph(g, \"social graph\");\r\n \t\r\n \t/*\r\n \tint numEdges = g.getEdges().getTupleCount();\r\n\t\tint numEdgesToRemove = 0;\r\n\t\tif (numEdges < 6)\r\n\t\t\tnumEdgesToRemove = 0;\r\n\t\telse \r\n\t\t\tnumEdgesToRemove = 6;\r\n\t\t*/\r\n \tint numEdgesToRemove = 0;\r\n \t\r\n \t\tthis.clusterSize = clusterGraph(numEdgesToRemove, false);\r\n \t\r\n // set up the renderers \r\n // draw the nodes as basic shapes\r\n //Renderer nodeR = new ShapeRenderer(20); \r\n LabelRenderer nodeR = new LabelRenderer(\"label\", \"image\"); \r\n nodeR.setRoundedCorner(10, 10); \r\n nodeR.setImagePosition(Constants.TOP); \r\n \r\n // draw aggregates as polygons with curved edges\r\n Renderer polyR = new PolygonRenderer(Constants.POLY_TYPE_CURVE);\r\n ((PolygonRenderer)polyR).setCurveSlack(0.15f);\r\n \r\n DefaultRendererFactory drf = new DefaultRendererFactory();\r\n drf.setDefaultRenderer(nodeR);\r\n drf.add(\"ingroup('aggregates')\", polyR);\r\n m_vis.setRendererFactory(drf); \r\n \r\n // fix selected focus nodes\r\n TupleSet focusGroup = m_vis.getGroup(Visualization.FOCUS_ITEMS); \r\n focusGroup.addTupleSetListener(new TupleSetListener() {\r\n public void tupleSetChanged(TupleSet ts, Tuple[] add, Tuple[] rem) {\r\n for ( int i=0; i<rem.length; ++i )\r\n ((VisualItem)rem[i]).setFixed(false);\r\n for ( int i=0; i<add.length; ++i ) {\r\n ((VisualItem)add[i]).setFixed(false);\r\n ((VisualItem)add[i]).setFixed(true);\r\n }\r\n if ( ts.getTupleCount() == 0 ) {\r\n ts.addTuple(rem[0]);\r\n ((VisualItem)rem[0]).setFixed(false);\r\n }\r\n m_vis.run(\"draw\");\r\n }\r\n });\r\n \r\n // set up the visual operators\r\n // first set up all the color actions \r\n ColorAction nNodeStroke = new ColorAction(NODES, VisualItem.STROKECOLOR, 0); \r\n \r\n ColorAction nNodeFill = new ColorAction(NODES, VisualItem.FILLCOLOR, ColorLib.rgb(200,200,255));\r\n nNodeFill.add(VisualItem.FIXED, ColorLib.rgb(255,100,100));\r\n nNodeFill.add(VisualItem.HIGHLIGHT, ColorLib.rgb(255,200,125));\r\n \r\n ColorAction nNodeText = new ColorAction(NODES, VisualItem.TEXTCOLOR, ColorLib.rgb(0,0,0));\r\n \r\n ColorAction nEdgeFill = new ColorAction(EDGES, VisualItem.FILLCOLOR, ColorLib.gray(200)); \r\n \r\n ColorAction nEdgeStroke = new ColorAction(EDGES, VisualItem.STROKECOLOR, ColorLib.gray(200));\r\n \r\n ColorAction aStroke = new ColorAction(AGGR, VisualItem.STROKECOLOR);\r\n aStroke.setDefaultColor(ColorLib.gray(200));\r\n aStroke.add(\"_hover\", ColorLib.rgb(255,100,100));\r\n \r\n int[] palette = new int[] {\r\n ColorLib.rgba(255,200,200,150),\r\n ColorLib.rgba(200,255,200,150),\r\n ColorLib.rgba(200,200,255,150),\r\n ColorLib.rgba(216,134,134,150),\r\n ColorLib.rgba(135,137,211,150),\r\n ColorLib.rgba(134,206,189,150),\r\n ColorLib.rgba(206,176,134,150),\r\n ColorLib.rgba(194,204,134,150),\r\n ColorLib.rgba(145,214,134,150),\r\n ColorLib.rgba(133,178,209,150),\r\n ColorLib.rgba(103,148,255,150),\r\n ColorLib.rgba(60,220,220,150),\r\n ColorLib.rgba(30,250,100,150)\r\n };\r\n \r\n ColorAction aFill = new DataColorAction(AGGR, \"id\",\r\n Constants.NOMINAL, VisualItem.FILLCOLOR, palette);\r\n \r\n // bundle the color actions\r\n ActionList draw = new ActionList();\r\n draw.add(nNodeStroke);\r\n draw.add(nNodeFill);\r\n draw.add(nNodeText);\r\n draw.add(nEdgeFill);\r\n draw.add(nEdgeStroke);\r\n draw.add(aStroke);\r\n draw.add(aFill); \r\n \r\n ForceSimulator forceSimulator = new ForceSimulator();\r\n\t\tforceSimulator.addForce(new NBodyForce(-1.0f, -1.0f, 0.899f));\r\n\t\tforceSimulator.addForce(new DragForce(0.009f));\r\n\t\tforceSimulator.addForce(new SpringForce(9.99E-6f, 200.0f));\r\n \r\n // now create the main layout routine\r\n ActionList animate = new ActionList(Activity.INFINITY);\r\n ForceDirectedLayout layout = new ForceDirectedLayout(GRAPH, forceSimulator, true); \r\n animate.add(layout);\r\n animate.add(draw); \r\n animate.add(new AggregateLayout(AGGR));\r\n animate.add(new RepaintAction());\r\n \r\n // finally, we register our ActionList with the Visualization.\r\n // we can later execute our Actions by invoking a method on our\r\n // Visualization, using the name we've chosen below.\r\n m_vis.putAction(\"draw\", draw); \r\n m_vis.putAction(\"layout\", animate);\r\n m_vis.runAfter(\"draw\", \"layout\"); \r\n \r\n // set up the display\r\n setSize(700, 700);\r\n pan(350, 350);\r\n setHighQuality(true);\r\n setForeground(Color.GRAY);\r\n setBackground(Color.WHITE);\r\n addControlListener(new AggregateDragControl());\r\n addControlListener(new ZoomControl());\r\n addControlListener(new PanControl()); \r\n addControlListener(new FocusControl(1));\r\n addControlListener(new DragControl());\r\n addControlListener(new WheelZoomControl());\r\n addControlListener(new ZoomToFitControl());\r\n addControlListener(new NeighborHighlightControl());\r\n \r\n\t\taddControlListener(new ControlAdapter() {\r\n\r\n\t\t\tpublic void itemEntered(VisualItem item, MouseEvent e) {\r\n\t\t\t\t//System.out.println(\"itemEntered....................\");\r\n\t\t\t\tif (item.isInGroup(NODES)) {\r\n\t\t\t\t\titem.setFillColor(ColorLib.rgb(255,200,125));\r\n\t\t\t\t\titem.setStrokeColor(ColorLib.rgb(255,200,125));\r\n\t\t\t\t\titem.getVisualization().repaint();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tpublic void itemExited(VisualItem item, MouseEvent e) {\r\n\t\t\t\t//System.out.println(\"itemExited....................\");\r\n\t\t\t\tif (item.isInGroup(NODES)) {\r\n\t\t\t\t\tif (item.isInGroup(Visualization.FOCUS_ITEMS)) {\r\n\t\t\t\t\t\titem.setFillColor(ColorLib.rgb(255,200,125));\r\n\t\t\t\t\t\titem.setStrokeColor(ColorLib.rgb(255,200,125));\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\titem.getVisualization().repaint();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tpublic void itemPressed(VisualItem item, MouseEvent e) {\r\n\t\t\t\t//System.out.println(\"itemPressed....................\");\r\n\t\t\t\t\r\n\t\t\t\tif (e.getClickCount() == 2) {\r\n\t\t\t\t\tSystem.out.println(\"itemDoubleClicked....................\");\r\n\t\t\t\t\tString id = item.getString(\"id\");\r\n\t\t\t\t\tif (id != null) {\r\n\t\t\t\t\t\tSystem.out.println(\"ID[\" + id + \"] is selected.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (item.isInGroup(NODES)) {\r\n\t\t\t\t\t//System.out.println(\"Node Selected....\");\r\n\t\t\t\t\titem.setFillColor(ColorLib.rgb(255,200,125));\r\n\t\t\t\t\titem.setStrokeColor(ColorLib.rgb(255,200,125));\r\n\t\t\t\t\titem.getVisualization().repaint();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (e.isPopupTrigger()) {\r\n\t\t\t\t\tSystem.out.println(\"---------isPopupTrigger....................\");\r\n\t\t\t\t\tString id = item.getString(\"id\");\r\n\t\t\t\t\tif (id != null) {\r\n\t\t\t\t\t\tSystem.out.println(\"ID[\" + id + \"] popup menu selected.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n \r\n // set things running\r\n m_vis.run(\"layout\"); \t\r\n }", "GraphLayout createGraphLayout();", "public Graph()\n\t{\n\t\tthis.map = new HashMap<Object, SinglyLinkedList>();\n\t}", "private Pane drawGraph() {\n\n if (activeUser == null) {\n return new Pane();\n }\n\n ArrayList<Person> friends = new ArrayList<>();\n friends.addAll(activeUser.getFriends());\n\n // Positioning and size variables\n double distance = 55;\n double centerX = 350;\n double centerY = 260;\n double radius = 25;\n int ringCapacity = 6;\n\n int ringCount = 0;\n\n Circle centerUser = new Circle(centerX, centerY, radius, Paint.valueOf(\"#74a7f7\")); // blue\n centerUser.setId(activeUser.getName());\n Text centerName = new Text(centerX - (radius / 2), centerY, activeUser.getName());\n graphPane.getChildren().add(centerUser);\n graphPane.getChildren().add(centerName);\n\n // Make Nodes for each friend the active user has\n for (int i = 0; i < friends.size(); ++i) {\n\n if (ringCount > ringCapacity) {\n ringCapacity += 6;\n distance += 55;\n ringCount = 0;\n }\n\n double angle = 2 * ringCount * Math.PI / ringCapacity; // Set radians for positioning\n double xOffset = distance * Math.cos(angle);\n double yOffset = distance * Math.sin(angle);\n double x = centerX + xOffset;\n double y = centerY + yOffset;\n\n ++ringCount;\n\n Circle friend = new Circle(x, y, radius, Paint.valueOf(\"#8fdb48\")); // green\n friend.setId(friends.get(i).getName());\n Text friendName = new Text(x - (radius / 2), y, friends.get(i).getName());\n friendName.setId(friends.get(i).getName());\n graphPane.getChildren().add(friend);\n graphPane.getChildren().add(friendName);\n\n // Define Actions for clicking any user except central user\n // (Make clicked node the active user and redraw the graph)\n friend.setOnMouseClicked((MouseEvent e) -> {\n this.activeUser = socialNetwork.getUserByName(friend.getId());\n updateCounts();\n updateGraph();\n });\n\n friendName.setOnMouseClicked((MouseEvent e) -> {\n this.activeUser = socialNetwork.getUserByName(friendName.getId());\n updateCounts();\n updateGraph();\n });\n // End Defining actions\n }\n\n return graphPane;\n }", "public void displayNode() {\n\t\t\tSystem.out.println(\"{ \" + data + \" } \");\n\t\t}", "public Graph() {\r\n\t\tthis.matrix = new Matrix();\r\n\t\tthis.listVertex = new ArrayList<Vertex>();\r\n\t}", "public FStream newStream(String name, ISource source) {\n\t\tFStream n = new FStream(name, this, source);\n\t\t\n\t\t_graph.addVertex(n);\n\t\t\n\t\treturn n;\n\t}", "@Override\r\n public VizModels create(String name, Model source) throws SlotAlreadyRegisteredException {\n StyleSetModel palette =\r\n StyleSetFactory.prototype.create(\r\n name + \"style palette\",\r\n SimpleExplicitSlotFactory.prototype);\r\n\r\n // Create the attribute model for the ForestModel\r\n PredicateModel predModel = SimplePredicateViewFactory.prototype.create(name + \"fa\", source);\r\n predModel =\r\n StyledPredicateViewFactory.prototype.configure(\r\n predModel,\r\n palette,\r\n SimpleSlotFactory.prototype);\r\n\r\n // Init Visibility Model for nodes in the Forest\r\n VisibilityModel visModel =\r\n PredicateBasedVisibilityViewFactory.prototype.create(\r\n name + \"Viz Model\",\r\n source,\r\n predModel);\r\n \r\n VizModels vm = new VizModels();\r\n vm.init(palette, predModel, visModel);\r\n return vm;\r\n }", "private void setUpCLRSGraph() {\n\t\tvertices = new HashMap<Character, DirectedOrderedDfsVertex>();\n\t\tfor (char i = 'a'; i <= 'h'; i++) {\n\t\t\tvertices.put(i, new DirectedOrderedDfsVertex());\n\t\t}\n\t\tgraph = new DirectedSimpleGraph<DirectedOrderedDfsVertex>(vertices.values());\n\t\tvertices.get('a').addAdjacency(vertices.get('b'));\n\t\tvertices.get('b').addAdjacency(vertices.get('f'));\n\t\tvertices.get('b').addAdjacency(vertices.get('e'));\n\t\tvertices.get('b').addAdjacency(vertices.get('c'));\n\t\tvertices.get('c').addAdjacency(vertices.get('d'));\n\t\tvertices.get('c').addAdjacency(vertices.get('g'));\n\t\tvertices.get('d').addAdjacency(vertices.get('c'));\n\t\tvertices.get('d').addAdjacency(vertices.get('h'));\n\t\tvertices.get('e').addAdjacency(vertices.get('a'));\n\t\tvertices.get('e').addAdjacency(vertices.get('f'));\n\t\tvertices.get('f').addAdjacency(vertices.get('g'));\n\t\tvertices.get('g').addAdjacency(vertices.get('f'));\n\t\tvertices.get('g').addAdjacency(vertices.get('h'));\n\t\tvertices.get('h').addAdjacency(vertices.get('h'));\n\t}", "public NetworkGraph(String flightInfoPath) throws FileNotFoundException {\r\n\t\tString pattern = \",\";\r\n\t\tString line = \"\";\r\n\r\n\t\tallFlightData = new ArrayList<Flight>();\r\n\t\tairportNames = new ArrayList<String>();\r\n\t\tallAirports = new ArrayList<Airport>();\r\n\t\ttry {\r\n\t\t\tFileReader flight = new FileReader(flightInfoPath);\r\n\t\t\tScanner readFlightData = new Scanner(flight);\r\n\t\t\treadFlightData.nextLine();\r\n\t\t\twhile (readFlightData.hasNextLine()) {\r\n\t\t\t\tline = readFlightData.nextLine();\r\n\t\t\t\tString[] values = line.split(pattern);\r\n\t\t\t\t\tif(airportNames.contains(values[0])){\r\n\t\t\t\t\t\tint index = airportNames.indexOf(values[0]);\r\n\t\t\t\t\t\tif(airportNames.contains(values[1])){\r\n\t\t\t\t\t\t\tint destinationIndex = airportNames.indexOf(values[1]);\r\n\t\t\t\t\t\t\tallAirports.get(destinationIndex).setPrevious(allAirports.get(index));\r\n\t\t\t\t\t\t\tflights = new Flight(allAirports.get(destinationIndex), values[2], Integer.parseInt(values[3]), Integer.parseInt(values[4]), Integer.parseInt(values[5]), Integer.parseInt(values[6]), Double.parseDouble(values[7]));\r\n\t\t\t\t\t\t\tallAirports.get(index).addFilght(flights);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\tairportDestination = new Airport(values[1]);\r\n\t\t\t\t\t\tairportDestination.setPrevious(allAirports.get(index));\r\n\t\t\t\t\t\tflights = new Flight(airportDestination, values[2], Integer.parseInt(values[3]), Integer.parseInt(values[4]), Integer.parseInt(values[5]), Integer.parseInt(values[6]), Double.parseDouble(values[7]));\r\n\t\t\t\t\t\tallAirports.get(index).addFilght(flights);\r\n\t\t\t\t\t\tallAirports.add(airportDestination);\r\n\t\t\t\t\t\tairportNames.add(values[1]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tairportOrigin = new Airport(values[0]);\r\n\t\t\t\t\t\tif(airportNames.contains(values[1])){\r\n\t\t\t\t\t\t\tint index = airportNames.indexOf(values[1]);\r\n\t\t\t\t\t\t\tallAirports.get(index).setPrevious(airportOrigin);\r\n\t\t\t\t\t\t\tflights = new Flight(allAirports.get(index), values[2], Integer.parseInt(values[3]), Integer.parseInt(values[4]), Integer.parseInt(values[5]), Integer.parseInt(values[6]), Double.parseDouble(values[7]));\r\n\t\t\t\t\t\t\tairportOrigin.addFilght(flights);\r\n\t\t\t\t\t\t\tallAirports.add(airportOrigin);\r\n\t\t\t\t\t\t\tairportNames.add(values[0]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tairportNames.add(values[0]);\r\n\t\t\t\t\t\t\tairportNames.add(values[1]);\r\n\t\t\t\t\t\t\tairportOrigin = new Airport(values[0]);\r\n\t\t\t\t\t\t\tairportDestination = new Airport(values[1]);\r\n\t\t\t\t\t\t\tflights = new Flight(airportDestination, values[2], Integer.parseInt(values[3]), Integer.parseInt(values[4]), Integer.parseInt(values[5]), Integer.parseInt(values[6]), Double.parseDouble(values[7]));\r\n\t\t\t\t\t\t\tairportOrigin.addFilght(flights);\r\n\t\t\t\t\t\t\tairportDestination.setPrevious(airportOrigin);\r\n\t\t\t\t\t\t\tallAirports.add(airportOrigin);\r\n\t\t\t\t\t\t\tallAirports.add(airportDestination);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treadFlightData.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public SAP(Digraph G) {\n dg = G;\n }", "public void setGraphName(String graphName) {\r\n\t\tthis.graphName = graphName;\r\n\t}", "public BranchGroup createSceneGraph() {\n BranchGroup node = new BranchGroup();\n TransformGroup TG = createSubGraph();\n TG.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);\n TG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);\n // mouse behaviour\n MouseRotate mouse = new MouseRotate(TG);\n mouse.setSchedulingBounds(new BoundingSphere());\n // key nav\n KeyNavigatorBehavior keyNav = new KeyNavigatorBehavior(TG); //Imposto il bound del behavior\n keyNav.setSchedulingBounds(new BoundingSphere(new Point3d(), 100.0)); //Aggiungo il behavior alla scena\n TG.addChild(keyNav);\n TG.addChild(mouse);\n node.addChild(TG);\n // Add directionalLight\n node.addChild(directionalLight());\n // Add ambientLight\n node.addChild(ambientLight());\n return node;\n }", "public DoctorFrame(String drName) {\n Doctor dr = DoctorSetAccess.dictionary().get(drName);\n if (dr != null) {\n setTitle(\"Dr. \" + dr.getName() + \"'s Database\");\n setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);\n DoctorPanel panel = new DoctorPanel(dr);\n add(panel);\n } else\n throw new RuntimeException(\"Name not Found!\");\n }", "Graph() {\r\n\t\tvertices = new LinkedList<Vertex>();\r\n\t\tedges = 0;\r\n\r\n\t\tfor (int i = 0; i < 26; i++) {\r\n\t\t\t// ASCII value of 'A' is 65\r\n\t\t\tVertex vertex = new Vertex((char) (i + 65));\r\n\t\t\tvertices.add(vertex);\r\n\t\t}\r\n\t\tcurrentVertex = vertices.get(0);\r\n\t\tseen = new boolean[26];\r\n\t}", "public WGraph_DS()\n {\n modeCount=0;\n edges=0;\n HashMap<Integer,node_info>nodesHash=new HashMap<>();\n HashMap<Integer,Neighbors>edgesHash=new HashMap<>();\n }", "public String getDisplayName() {\n return graphConfig.getDisplayName();\n }" ]
[ "0.7368507", "0.7227325", "0.5801283", "0.57616913", "0.5678303", "0.55681175", "0.55257815", "0.54828525", "0.5453938", "0.54251194", "0.5402692", "0.5386757", "0.532712", "0.5322424", "0.5286106", "0.5189364", "0.51815605", "0.51814926", "0.51684356", "0.5166683", "0.5157033", "0.51317644", "0.51043844", "0.51034766", "0.5098766", "0.50978583", "0.5058763", "0.50583833", "0.50555694", "0.5048436", "0.50123566", "0.5011146", "0.4991616", "0.4984164", "0.49815008", "0.4965137", "0.496396", "0.49454832", "0.4942624", "0.49307808", "0.4908996", "0.48763543", "0.48745847", "0.48665172", "0.48600078", "0.48540956", "0.4851388", "0.48373622", "0.4834821", "0.48296025", "0.48157007", "0.48118156", "0.4806067", "0.47943577", "0.47752488", "0.47707203", "0.47658458", "0.47614977", "0.47449496", "0.4740163", "0.47374466", "0.47308925", "0.4728199", "0.47281712", "0.47280946", "0.47237355", "0.47229037", "0.4718256", "0.4717688", "0.47131607", "0.47127163", "0.4705774", "0.47048837", "0.47048247", "0.4704485", "0.46920738", "0.46833465", "0.46806872", "0.4678981", "0.4660681", "0.46579123", "0.46554217", "0.4654524", "0.4651596", "0.46481553", "0.46425036", "0.46311197", "0.46306702", "0.4625286", "0.46249115", "0.46179307", "0.46082142", "0.4601252", "0.45983914", "0.45955175", "0.45914522", "0.459095", "0.45898315" ]
0.6572723
4
Clears the list of name surfer entries stored inside this class.
public void clear() { removeAll(); drawBackGround(); clearEntries(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clearNames() {\n eventTitles = null;\n guestTitles = null;\n }", "public static void clearName() {\n\t\tfor (int i = 0; i < count; i++)\n\t\t\t ((IdentifierResolver) bIdents.get(i)).clearNName();\n\t}", "public void clear() {\r\n GiftList.clear();\r\n names = new LinkedList<>();\r\n totalGifts = 0;\r\n totalCost = 0;\r\n }", "public void clear() {\r\n\t\tnameInGraph.clear();\r\n\t\tnameColor.clear();\r\n\t}", "public void clear() {\n\t\tstringList = null;\n\t}", "private void clearName() {\n \n name_ = getDefaultInstance().getName();\n }", "private void clearName() {\n \n name_ = getDefaultInstance().getName();\n }", "private void clearName() {\n \n name_ = getDefaultInstance().getName();\n }", "private void clearName() {\n \n name_ = getDefaultInstance().getName();\n }", "public void clear() {\n\t\tentries.clear();\n\t}", "public void clear()\r\n {\r\n phoneList = new ArrayList<String>();\r\n }", "public void clear() {\n\t\tlist = new ArrayList<String>();\n\t\tword = \"\";\n\t}", "public void clearNName() {\n\t\tn.clearName();\n\t\tif (next != null)\n\t\t\tnext.clearNName();\n\t}", "public void clear() {\n this.entries = new Empty<>();\n }", "protected void clear() {\n\n\t\tthis.myRRList.clear();\n\t}", "public void clear()\n {\n dessertList.clear();\n }", "public synchronized void unRegisterAll()\r\n {\r\n clearNameObjectMaps();\r\n }", "public void clear(){\n strings.clear();\n }", "public void clearPeople() {\n personNames.clear();\n personIds.clear();\n personPhotos.clear();\n personSelections.clear();\n addDefaultPerson();\n }", "public void unsetName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(NAME$0, 0);\r\n }\r\n }", "public void unsetName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(NAME$8, 0);\n }\n }", "public void unsetName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(NAME$0, 0);\n }\n }", "public void unsetName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(NAME$0, 0);\n }\n }", "public void clear() {\n duplicates.clear();\n }", "@Override\n public void clear() {\n wordsArray = new String[0];\n }", "public NameSurferGraph() {\n\t\taddComponentListener(this);\n\t\tentries = new ArrayList<NameSurferEntry>();\n\t}", "public void clearAll()\n\t{\n\t\t// add code to clear all names from the graphArray \n\t\t// and call repaint() to update the graph\n\t}", "public final void clear() {\n ((List<Entry>) Router.callRouter(this.entries, Entries.class, \"getEntry\", null, null)).clear();\n this.fileName = null;\n this.password = null;\n this.modified = false;\n }", "void unsetName();", "public void clear() {\n\t\twordList.removeAll(wordList);\n\t\t// TODO Add your code here\n\t}", "public void clear() {\r\n\t\tif (this.strings != null) {\r\n\t\t\tthis.strings.clear();\r\n\t\t\tthis.strings = null;\r\n\t\t}\r\n\t}", "public void clear() {\n\t\tfor (int i = 0; i < buckets.length; i++) {\n\t\t\tbuckets[i] = null;\n\t\t}\n\t}", "public synchronized void clear() {\n collected.clear();\n }", "@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}", "public void clear() {\n \tthis.listShapes.clear();\n }", "@Override\n public void clear() {\n wordsLinkedList.clear();\n }", "public void clearMembers() {\n\t\tmembers.clear();\n\t}", "public void clearDEALER() {\r\n\t\t_DEALERList.clear();\r\n\t}", "public org.ga4gh.models.CallSet.Builder clearName() {\n name = null;\n fieldSetFlags()[1] = false;\n return this;\n }", "public void unsetUniqueName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(UNIQUENAME$10, 0);\r\n }\r\n }", "public void unsetFriendlyName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(FRIENDLYNAME$2, 0);\r\n }\r\n }", "@Override\r\n\tpublic void clear() {\r\n\t\tbuckets = new Object[numBuckets];\r\n\t\tfor (int i = 0; i < numBuckets; i++) {\r\n\t\t\tbuckets[i] = new Bucket();\r\n\t\t}\r\n\t}", "public void removeAllEntries() {\n }", "public void clear(){\n\t\tcontenido = getName() + ':';\n\t\tindices.clear();\n\t\tindices.add(0);\n\t}", "public String clear() {\n\t\t\tcollectionsOlders.clear();\n\t\t\treturn \"Коллекция была очищена\";\n\t\t}", "public void clear() {\n head = null;\n tail = null;\n size = 0;\n String name = \"aweseome Frok from Father of MC :) :) :) :) :) :): ): ): ):): ):):): :))::):):)\";\n String smileie = ENOUGH SMILES?;\n }", "public static void clear() {\r\n\t\tdata.set(Collections.<String, String> emptyMap());\r\n\t}", "public void clear()\r\n {\r\n super.clear();\r\n }", "public com.luisjrz96.streaming.birthsgenerator.models.BirthInfo.Builder clearName() {\n name = null;\n fieldSetFlags()[0] = false;\n return this;\n }", "private void clearNewName() {\n \n newName_ = getDefaultInstance().getNewName();\n }", "@Override\n\tpublic void clearAll() {\n\t\t\n\t}", "public void clear() {\n\t\tthis.set.clear();\n\t\tthis.size = 0;\n\t}", "public void clear() {\r\n\t\tentryMap.clear();\r\n\t}", "public void reset() {\n this.list.clear();\n }", "public void clear() {\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tbeams[i] = null;\n\t\t}\n\t}", "@Override\r\n\tpublic void clear() {\n\t\tset.clear();\r\n\t}", "public void clear() {\r\n items.clear();\r\n keys.clear();\r\n }", "public void clear() {\n\t if (entries != null) {\n\t\tfor (Entry e : entries) {\n\t\t for(Field f: EntrySerializer.getAllFields(e)) {\n\t\t\tif (f != null) f.clear();\n\t\t }\n\t\t}\n\t }\n\t if (groups != null) {\n\t\tfor (Group g: groups) {\n\t\t for (Field f : GroupSerializer.getAllFields(g)) {\n\t\t\tif (f != null) f.clear();\n\t\t }\n\t\t}\n\t }\n\t}", "@Override\n public void clear() {\n for (LinkedList<Entry<K,V>> list : table) {\n list = null;\n }\n }", "public void clear() {\n buckets = new ArrayList<>();\n for (int i = 0; i < numBuckets; i++) {\n buckets.add(new ArrayList<>());\n }\n keySet = new HashSet<>();\n numEntries = 0;\n }", "public void clear(){\r\n MetersList.clear();\r\n }", "@Override\n\t\tpublic void clear() {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void clear() {\n\t\t\t\n\t\t}", "@Request(id = 3, retryable = false, response = ResponseMessageConst.VOID)\n void clear(String name);", "public void clear()\n {\n }", "public void reset() {\n\t\tvar.clear();\n\t\tname.clear();\n\t}", "public void clearAll() {\n bikeName = \"\";\n bikeDescription = \"\";\n bikePrice = \"\";\n street = \"\";\n zipcode = \"\";\n city = \"\";\n bikeImagePath = null;\n }", "public void unsetFromName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(FROMNAME$4, 0);\n }\n }", "private void clearUserNames()\n\t{\n\t\tfor (final JLabel jLabel : userNamesLabels)\n\t\t{\n\t\t\tuserDisplayPanel.remove(jLabel);\n\t\t}\n\t\tuserNamesLabels.clear();\n\t}", "@Override\n public synchronized void clear() {\n }", "public void removeAll() {\n _hash = new Hashtable();\n _first = null;\n _last = null;\n }", "public void removeAll() {\n\t\tsynchronized (mNpcs) {\n\t\t\tmNpcs = Collections.synchronizedList(new ArrayList<Npc>());\n\t\t\tmDemonCount = 0;\n\t\t\tmHumanCount = 0;\n\t\t}\n\t}", "public void emptyTickets() {\r\n tickets.clear();\r\n }", "@Override\n public void clear()\n {\n }", "public void deleteAllTags(boolean toResetName){\r\n\t\ttags.clear();\r\n\t\tsetChanged();\r\n\t\tnotifyObservers();\r\n\t\tclearChanged();\r\n\t\tdeleteObservers();\t\r\n\t\t\r\n\t\tif (toResetName){\r\n\t\t\tsetName();\r\n\t\t}\r\n\t}", "public void removeAll() \r\n\t{\t\r\n\t\tbookArray = new String[MAXSIZE];\r\n\t\tnumItems = 0;\r\n\t}", "@Override\r\n\tpublic void clear() {\n\t\t\r\n\t}", "@Override\n\tpublic void clear() {\n\t\tmap.clear();\n\t\tkeys.clear();\n\t}", "@Override\n\t\t\tpublic void clear() {\n\t\t\t\t\n\t\t\t}", "public void Clear() {\r\n\t\tfm.Clear();\r\n\t}", "@Override public void clear() {\n }", "public synchronized void clear() {\n Entry tab[] = table;\n for (int index = tab.length; --index >= 0; ) {\n tab[index] = null;\n }\n count = 0;\n }", "public void clear() {\r\n\t\tdisplayEntries.clear();\r\n\t\tupdate();\r\n\t}", "public void clearHash() {\r\n\t\tinternedTexts.clear();\r\n\t\tinternedAttributes.clear();\r\n\t}", "public void clear(){\r\n NotesList.clear();\r\n }", "@Override\n\tpublic void clear() {\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tmap[i] = new LocalEntry<>();\n\t\t}\n\n\t}", "public void removeAll() {\n this.arrayList = null;\n this.arrayList = new ArrayList<>();\n }", "public void clear()\n\t{\n\t\tpairs.clear();\n\t}", "@Override\n\tpublic void clear() {\n\t}", "@Override\n public void clear()\n {\n\n }", "@Override\n public void clear() {\n \n }", "public void clear()\r\n {\r\n first = null;\r\n last = null;\r\n count = 0;\r\n }", "public void removeAll() {\n start = null;\n _size = 0;\n }", "public void clear() {\n doClear();\n }", "public void clear() {\n\t\t\r\n\t}", "private void clearFriendList() {\n friendList_ = emptyProtobufList();\n }", "public void clear(){\n\n \tlist = new ArrayList();\n\n }", "public String clearEntry();", "public void clearAggroList()\n\t{\n\t\tgetAggroList().clear();\n\t}", "public void clear( )\r\n {\r\n frente = null; // ¿alguna duda?\r\n }" ]
[ "0.75812304", "0.70303625", "0.6807627", "0.6763328", "0.67267567", "0.67154944", "0.67154944", "0.67154944", "0.67045647", "0.6578562", "0.6577638", "0.6542369", "0.6508073", "0.6456701", "0.64094", "0.63859934", "0.6350832", "0.6331583", "0.6326261", "0.6320492", "0.631779", "0.63008183", "0.63008183", "0.6296211", "0.6263796", "0.62303364", "0.6207158", "0.6203518", "0.6182659", "0.61706555", "0.61523", "0.6111272", "0.61077195", "0.60990405", "0.60990405", "0.60816747", "0.607487", "0.60738134", "0.6071337", "0.60697305", "0.60614294", "0.6059985", "0.60578036", "0.60515505", "0.603563", "0.6028629", "0.60244966", "0.602146", "0.6016389", "0.6014963", "0.60146683", "0.6006249", "0.6003046", "0.60005546", "0.59846103", "0.59790176", "0.5978685", "0.59776706", "0.59705114", "0.596636", "0.59586596", "0.594999", "0.59477973", "0.59477973", "0.5947305", "0.59339267", "0.5931084", "0.59238845", "0.5914271", "0.59121394", "0.59111094", "0.5907343", "0.590722", "0.59046894", "0.59038585", "0.59023714", "0.59016615", "0.5899755", "0.58992964", "0.5893249", "0.5892341", "0.5887254", "0.587931", "0.587622", "0.5873305", "0.58575594", "0.58563757", "0.5854561", "0.58539355", "0.5851944", "0.5850193", "0.5849888", "0.58436424", "0.58436006", "0.5840192", "0.5838536", "0.5835812", "0.58355415", "0.5835487", "0.583534", "0.5830664" ]
0.0
-1
/ Method: addEntry(entry) Adds a new NameSurferEntry to the list of entries on the display. Note that this method does not actually draw the graph, but simply stores the entry; the graph is drawn by calling update.
public void addEntry(NameSurferEntry entry) { entries.add(entry); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addEntry(NameSurferEntry entry) {\r\n\t\tentryGraph.add(entry);\r\n\t}", "public void addEntry(NameSurferEntry entry) {\r\n\t\tdisplayEntries.add(entry);\r\n\t\tupdate();\r\n\t}", "public void addEntry(NameSurferEntry entry) {\n\t\tentries.add(entry);\n\t}", "public Boolean addEntry(NameSurferEntry entry) {\r\n\t\tint index = indexOfNameSurfer(entry.getName());\r\n\t\t/* Prevent from adding a same name multiple times */\r\n\t\tif(index < 0) {\r\n\t\t\tnameInGraph.add(entry);\r\n\t\t\tnameColor.add(generateColor());\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void addEntry(Entry entry) {\n entries.add(entry);\n }", "public void addEntry(AddressBookEntry entry) {\n addressList.add(entry);\n }", "public void addEntry(Entry entry) {\n getEntryList().addEntry(entry);\n }", "public void addEntry(Entry e) {\n entries.put(e.getName(), e);\n }", "public void addEntry(@NotNull Entry entry) {\n for (String name : entry.names) {\n mappingByName.put(name, entry);\n }\n }", "public void addEntry() {\n\t\tSystem.out.print(\"Name: \");\n\t\tString entryName = getInputForName();\n\t\tSystem.out.print(\"Number: \");\n\t\tint entryNumber = getInputForNumber();\n\t\t\n\t\tp = new PhoneEntry(entryName, entryNumber);\n\t\t\n\t\ttry {\n\t\t\tphoneList.add(p);\n\t\t\twriteFile();\n\t\t\t\n\t\t\tSystem.out.println(\"Entry \" + p.getName() + \" has been added.\");\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystem.err.println(\"Could not write item into array.\");\n\t\t}\n\t}", "public void add(AddressEntry entry) {\n addressEntryList.add(entry);\n }", "public void add(food entry)\n\t{\n\t\titems.add(entry);\n\t\t//updates isChanged to show changes\n\t\tisChanged = true;\n\t}", "public void postEntry(Entry entry) {\n\t\tentries.addFirstElement(entry);\n\t}", "public void add(FileSystemEntry entry);", "@Override\n public void insertEntry(Entry entry) {\n members.add(entry);\n\n }", "private void plotName(NameSurferEntry entry, int entryNumber) {\r\n\t\t\r\n\t\tfor(int i = 0; i<NDECADES; i++) {\r\n\t\t\tString name = entry.getName();\r\n\t\t\tint rank = entry.getRank(i);\r\n\t\t\tString rankString = Integer.toString(rank);\r\n\t\t\tString label = name + \" \" + rankString;\r\n\t\t\t\r\n\t\t\tdouble x = i * (getWidth()/NDECADES) + SPACE;\r\n\t\t\tdouble y = 0;\r\n\t\t\t\r\n\t\t\tif(rank != 0) {\r\n\t\t\t\ty = GRAPH_MARGIN_SIZE + (getHeight() - GRAPH_MARGIN_SIZE*2) * rank/MAX_RANK - SPACE;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tlabel = name + \" *\";\r\n\t\t\t\ty = getHeight() - GRAPH_MARGIN_SIZE - SPACE;\r\n\t\t\t}\r\n\t\t\tGLabel nameLabel = new GLabel(label, x, y);\r\n\t\t\tint numb = entryNumber % NCOLORS;\r\n\t\t\tColor color = NewColor (numb);\r\n\t\t\tnameLabel.setColor(color);\r\n\t\t\tadd(nameLabel);\r\n\t\t}\r\n\t}", "public void addEntryToList(String entry){\n\t\tlogList.add(entry);\n\t}", "public void add(TextEntry entry) {\n\t\t\tif (!entry.getText().isNul()) {\n\t\t\t\tfor (TextEntry t : myTextEntries) {\n\t\t\t\t\tif (t.getText().isNul()) {\n\t\t\t\t\t\tt.getText().unNullify();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tmyTextEntries.add(entry);\n\t\t\tmyLength += entry.getLength();\n\t\t}", "public void addEntry(EventDataEntry entry) {\r\n eventFields.add(entry);\r\n }", "public void setEntryName(String ename);", "private void drawOneNameOnCanvas(NameSurferEntry entry, Color color) {\r\n\t\tdouble width = this.getWidth();\r\n\t\tdouble height = this.getHeight();\r\n\t\t\r\n\t\tString name = entry.getName();\r\n\t\tfor(int i = 0; i< NDECADES-1; i++) {\r\n\t\t\tint leftRank = entry.getRank(i);\r\n\t\t\tdouble[] leftCoordinate = rankToCoordinate(i, leftRank, width, height);\r\n\t\t\t\r\n\t\t\tint rightRank = entry.getRank(i+1);\r\n\t\t\tdouble[] rightCoordinate = rankToCoordinate(i+1, rightRank, width, height);\r\n\t\t\t\r\n\t\t\tdrawNameLabel(leftRank, name, leftCoordinate, color, rightCoordinate);\r\n\t\t\tdrawNameCircle(leftCoordinate, color);\r\n\t\t\tdrawConnectLine(leftCoordinate, rightCoordinate, color);\r\n\t\t}\r\n\t\t\r\n\t\tint lastRank = entry.getRank(NDECADES-1);\r\n\t\tdouble[] lastCoordinate = rankToCoordinate(NDECADES-1, lastRank, width, height);\r\n\t\tdrawNameLabel(lastRank, name, lastCoordinate, color, null);\r\n\t}", "private void addNewEntry(Entry entry) {\n \tboolean showToasts = Settings.getToastsSetting(getApplicationContext());\n \t\n// \tContentResolver cr = getContentResolver();\n// \t\n// \t// Insert the new entry into the provider\n// \tContentValues values = new ContentValues();\n// \t\n// \tvalues.put(WaterProvider.KEY_DATE, _entry.getDate());\n// \tvalues.put(WaterProvider.KEY_AMOUNT, _entry.getMetricAmount());\n// \t\n// \tcr.insert(WaterProvider.CONTENT_URI, values);\n \tmWaterDB.addNewEntry(getContentResolver(), entry);\n \t\n \t// Make a toast displaying add complete\n \tint unitsPref = Settings.getUnitSystem(this);\n \tdouble displayAmount = entry.getNonMetricAmount();\n \tString displayUnits = getString(R.string.unit_fl_oz);\n \tif (unitsPref == Settings.UNITS_METRIC) {\n \t\tdisplayUnits = getString(R.string.unit_mililiters);\n \t\tdisplayAmount = entry.getMetricAmount();\n \t}\n \tString toastMsg = String.format(\"Added %.1f %s\", displayAmount, displayUnits);\n \tToast toast = Toast.makeText(getApplicationContext(), toastMsg, Toast.LENGTH_SHORT);\n \ttoast.setGravity(Gravity.BOTTOM, 0, 0);\n \tif (showToasts)\n \t\ttoast.show();\n \t\n \t// If user wants a reminder when to drink next,\n \t// setup a notification X minutes away from this entry\n \t// where X is also a setting\n \tif (Settings.getReminderEnabled(this) && mIsHistorical == false) {\n \t\t// Get the AlarmManager services\n\t\t\tAlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);\n\t\t\t\n\t\t\t// create the calendar object\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\t// add X minutes to the calendar object\n\t\t\tcal.add(Calendar.MINUTE, Settings.getReminderInterval(this));\n\t\t\t\n\t\t\t// cancel existing alarm if any, this way latest\n\t\t\t// alarm will be the only one to notify user\n\t\t\tIntent cancelIntent = new Intent(this, AlarmReceiver.class);\n\t\t\tPendingIntent cancelSender = PendingIntent.getBroadcast(this, 0, cancelIntent, 0);\n\t\t\tam.cancel(cancelSender);\n\t\t\t\n\t\t\t// set up the new alarm\n\t\t\tIntent intent = new Intent(this, AlarmReceiver.class);\n\t\t\tintent.putExtra(\"entryDate\", entry.getDate());\n\t\t\tPendingIntent sender = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\t\t\tam.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender);\n \t}\n }", "public void addEntry(final HighscoreEntry entry) {\n\t\tscores.add(entry);\n\t\tCollections.sort(scores);\t\t\n\t}", "protected static void addEntryInList(String key, String entry) {\n if (hasEntryInList(key, entry))\n return ;\n\n String entries = getSPreference(key);\n if (TextUtils.isEmpty(entries))\n entries = entry;\n else\n entries = entries + \":\" + entry;\n\n setPreference(key, entries);\n }", "public void addEntry(KantoDex entry)\n {\n if(entries.isEmpty())\n {\n entries.add(entry);\n }\n else\n {\n boolean notFound = true;\n for(KantoDex entryInit : entries)\n {\n if(entry.getDexNumInt() == entryInit.getDexNumInt())\n {\n System.out.println(\"Error: Attempted to add an entry that already exists, or should not exist.\");\n notFound = false;\n }\n }\n if(notFound)\n {\n entries.add(entry);\n }\n }\n }", "public String addEntry(Entry e)\r\n\t{\r\n\t\tfor (Entry ent : tr)\r\n\t\t{\r\n\t\t\tif (e.getEntry().equals(ent.getEntry()))\r\n\t\t\t{\r\n\t\t\t\treturn \"Entry not unique. Try again.\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\ttr.add(e);\r\n\t\treturn \"Record added\\n\";\r\n\t}", "void onEntryAdded(Entry entry);", "public void in(food entry)\n\t{\n\t\titems.add(entry);\n\t}", "protected void addEntry(CacheEntry entry) {\n if (_first == null) {\n _first = entry;\n _last = entry;\n } else {\n _last.setNext(entry);\n entry.setPrevious(_last);\n _last = entry;\n }\n }", "@Override\n synchronized public void addEntry(Entry e) throws RemoteException {\n if (this.map.containsKey(e.getHash())) {\n return;\n }\n //System.out.println(\"Mapper.addEntry() :: entry=\"+e.getHash()+\",\"+e.getLocation());\n this.map.put(e.getHash(), e.getLocation());\n printAct(\">added entry:\" + e.hash);\n }", "public void addEntry(String key, ChoiceEntry entry){\n _entries.put(key, entry);\n }", "@Override\n\tpublic void addEntry(E entry) {\n\n\t\t// Determine if the entry already exists in the list\n\t\tE current = this.getHead();\n\t\twhile (current != null) {\n\t\t\tif (this.isEqual(current, entry)) {\n\t\t\t\t// Already in list\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcurrent = current.getNext();\n\t\t}\n\n\t\t// Not in list, so add the entry\n\t\tsuper.addEntry(entry);\n\t}", "public void addEntry(AddressEntry contact) {\r\n insertAlphabeticalOrder(contact);\r\n }", "public void addName(NameRecord record)\n\t{\n\t\t// add code to add record to the graphArray \n\t\t// and call repaint() to update the graph\n\t}", "public void addToTrace(String traceEntry) {\n\t\tif (traceEntry != null && !traceEntry.isEmpty()) {\n\t\t\ttrace.add(traceEntry);\n\t\t}\n\t}", "public void add(AddressEntry addressEntry)\n {\n try{\n Class.forName(\"oracle.jdbc.OracleDriver\");\n Connection conn = DriverManager.getConnection(\"jdbc:oracle:thin\" +\n \":@adcsdb01.csueastbay.edu:1521:mcspdb.ad.csueastbay.edu\"\n , \"MCS1018\", \"y_WrlhyT\");\n // Statement stmt = conn.createStatement();\n\n PreparedStatement stmt = conn.prepareStatement(\"INSERT INTO \" +\n \"ADDRESSENTRYTABLE values(?,?,?,?,?,?,?,?, \" +\n \"default )\");\n stmt.setString(1, addressEntry.name.firstName);\n stmt.setString(2, addressEntry.name.lastName);\n stmt.setString(3, addressEntry.address.street);\n stmt.setString(4, addressEntry.address.city);\n stmt.setString(5, addressEntry.address.state);\n stmt.setInt(6, addressEntry.address.zip);\n stmt.setString(7, addressEntry.phone);\n stmt.setString(8, addressEntry.email);\n stmt.executeUpdate();\n\n conn.close();\n }\n catch(Exception e){System.out.println(e);}\n\n addressEntryList.addElement(addressEntry);\n }", "public void entryAdded (TudeySceneModel.Entry entry)\n {\n setVisibility(entry);\n }", "public void push(T newEntry) {\n\t\tcheckInitialization();\n\t\tvector.addElement(newEntry);\n\t}", "private void addEntry( List<TicketEntry> entries, JSONObject entry){\n //parsing the entry fields and building it\n String barcode = (String) entry.get(\"barcode\");\n String desc = (String) entry.get(\"description\");\n int amount = Integer.parseInt((String) entry.get(\"amount\"));\n double PPU = Double.parseDouble((String) entry.get(\"PPU\"));\n double discountRate = Double.parseDouble((String) entry.get(\"discountRate\"));\n entries.add(new TicketEntryImpl(barcode,desc,amount,PPU,discountRate));\n }", "public void addRecord(LogRecord entry)\n\t{\n\t\tint newIndex = m_records.size();\n\t\tm_records.add(entry);\n\t\tfireTableRowsInserted(newIndex, newIndex);\n\t}", "public String getEntryName();", "private void drawLine(int entryNum) {\n\t\tNameSurferEntry entry = entries.get(entryNum);\n\t\tdouble deltaX = getWidth() / NDECADES;\n\t\tdouble yMin = getHeight() - GRAPH_MARGIN_SIZE;\n\t\tdouble yMax = GRAPH_MARGIN_SIZE;\n\t\tdouble deltaY = (yMin - yMax) / 1000.0;\n\t\t\n\t\tfor (int decade = 0; decade < NDECADES - 1; decade++) {\n\t\t\t//get rank values and coordinates\n\t\t\tint fromRank = entry.getRank(decade);\n\t\t\tint toRank = entry.getRank(decade + 1);\n\t\t\tGPoint from = new GPoint(decade * deltaX, yMax + fromRank * deltaY);\n\t\t\tGPoint to = new GPoint((decade + 1) * deltaX, yMax + toRank * deltaY);\n\t\t\tif (fromRank == 0) from.setLocation(decade * deltaX, yMin);\n\t\t\tif (toRank == 0) to.setLocation((decade + 1) * deltaX, yMin);\n\t\t\t\n\t\t\tdrawLineSeg(entryNum, from, to);\n\t\t\tdrawLabel(entryNum, from, fromRank);\n\t\t\t\n\t\t\t//labels the last plot point (fence post case)\n\t\t\tif (decade == NDECADES - 2) {\n\t\t\t\tdrawLabel(entryNum, to, toRank);\n\t\t\t}\n\t\t}\n\t}", "public NameSurferEntry(String line) {\n\t\tthis.ranksOfName = new int[NDECADES];\n\t\tArrayList<String> parts = split(line);\n\t\tthis.name = parts.get(0);\n\t\t\n\t\tfor(int i = 1; i < parts.size(); i++) {\n\t\t\tString numberString = parts.get(i);\n\t\t\tint number = Integer.parseInt(numberString); \n\t\t\tranksOfName[i - 1] = number;\n\t\t}\n\t}", "private void insertEntry() {\n String desiredId = idField.getText();\n String desiredName = nameField.getText();\n String desiredMajor = majorField.getText();\n\n if (studentHashMap.containsKey(desiredId)) {\n this.displayStatusPanel(\n \"Error: A student with this information already exists.\",\n \"Error\",\n JOptionPane.WARNING_MESSAGE\n );\n } else {\n studentHashMap.put(desiredId, new Student(desiredName, desiredMajor));\n\n this.displayStatusPanel(\n \"Success: \" + desiredName + \" has been added.\",\n \"Success\",\n JOptionPane.INFORMATION_MESSAGE\n );\n }\n }", "public Entry(String n)\n {\n name = n;\n }", "public void addEntryToGUI(String tags, String entry) {\r\n String[] split = tags.split(\",\");\r\n for (int i = 0; i < split.length; i++) {\r\n if (!m_tags.contains(split[i].trim())) {\r\n m_tags.add(split[i].trim());\r\n }\r\n m_tagsMaster.add(split[i].trim());\r\n }\r\n Collections.sort(m_tags);\r\n this.tags.setListData(m_tags);\r\n }", "public void add(T newEntry) {\r\n add(size(), newEntry);\r\n }", "private void drawRankGraph(NameSurferEntry entry, int entryNumber) {\r\n\r\n\t\tplotRank(entry, entryNumber);\r\n\t\tplotName(entry, entryNumber);\r\n\t}", "public NameSurferGraph() {\n\t\taddComponentListener(this);\n\t\tentries = new ArrayList<NameSurferEntry>();\n\t}", "public void addAtHead(E entry) {\n\t\tLinkedNode<E> temp = new LinkedNode<E>(entry, null);\n\t\tsize++;\n\t\tif(head == null) {\n\t\t\thead = temp;\n\t\t\ttail = head;\n\t\t} else {\n\t\t\ttemp.setNext(head);\n\t\t\thead = temp;\n\t\t}\n\t}", "protected UUID add(E entry) {\n\t\treturn add(entry, true);\n\t}", "public void addEntry(ActionEvent event) {\n\t\tif(checkEntryInputs()) {\n\t\t\tBacteroidesSample newBacteroidesSample = new BacteroidesSample(sampleNumberTF.getText(),materialDescriptionTF.getText(),bacteroidesConcentration.getText());\n\t\t\tnewBacteroidesSample.setConclusionCase();\n\t\t\ttable.getItems().add(newBacteroidesSample);\n\t\t\tnewReport2.addSample(newBacteroidesSample);\n\t\t\taddConclusionNumber(newBacteroidesSample);\n\t\t\tsampleNumberTF.clear();\n\t\t\tmaterialDescriptionTF.clear();\n\t\t\tbacteroidesConcentrationTF.clear();\n\t\t}\n\t}", "public void append(Block.Entry entry) {\r\n\t\tstmts.add(new Entry(entry.code,entry.attributes()));\r\n\t}", "public void addEntry(RouteTableEntry RTE)\n\t{\n\t\ttable.add(RTE);\n\t\t\n\t\tparentActivity.runOnUiThread(new Runnable()\n\t\t{ \n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\tuiManager.resetRoutingListAdapter();\n\t\t\t} // end public method run\n\t\t}); // end runOnUiThread\n\t}", "public NameSurferGraph() {\r\n\t\taddComponentListener(this);\r\n\t\tentryGraph = new ArrayList<NameSurferEntry>();\r\n\t}", "void addEntry(ReadOnlyEntry entry) throws DuplicateEntryException, OverlappingEventException,\n OverlappingAndOverdueEventException, EntryOverdueException;", "public String getDisplayName(){return entryName;}", "public void addEntry(String name, Meem meem) {\n\t\tsend(\"addEntry\", new Serializable[] { name, meem.getMeemPath().toString() });\n\t}", "public boolean addEntry(@NotNull Entry<T> entry) {\n if (entries.contains(entry)) {\n return false;\n }\n\n entries.add(entry);\n entry.addValueChangedListener(entryValueChangedListener);\n return true;\n }", "public void addEntry(FraudDetection predictor, double[][] cv_data, \r\n int[] cv_labels, double stepSize, int iter, double[] newEntry, String original)\r\n {\r\n boolean ret = predictor.addData(newEntry);\r\n if(newEntry[1] > predictor.getMedian() * limit)\r\n System.out.println(\"You are spending more than usual!\");\r\n for (String a : triggers)\r\n {\r\n if(original != null && original.contains(a))\r\n {\r\n System.out.println(\"Trigger Keyword: Warning, transaction made is suspicious!\");\r\n TrainDetection.train(predictor, cv_data, cv_labels, stepSize, iter);\r\n return;\r\n }\r\n }\r\n for (String a : safelist)\r\n {\r\n if(original != null && original.contains(a))\r\n {\r\n System.out.println(\"Whitelist Keyword: Transaction may seem suspcious but should be safe!\");\r\n TrainDetection.train(predictor, cv_data, cv_labels, stepSize, iter);\r\n return;\r\n }\r\n \r\n }\r\n if (ret)\r\n {\r\n System.out.println(\"Transaction may be fraudulent!\");\r\n }\r\n else \r\n System.out.println(\"Transaction appears to be safe!\");\r\n }", "private void addEntry(int hour, int minute, int period, String name) {\n\n //A new instance of GregorianCalendar will initially be set for the time of its creation.\n GregorianCalendar alarmTime = new GregorianCalendar();\n\n alarmTime.set(Calendar.HOUR, hour);\n alarmTime.set(Calendar.MINUTE, minute);\n alarmTime.set(Calendar.SECOND, 0);\n alarmTime.set(Calendar.AM_PM, period);\n\n //If the alarm's time has already happened today reschedule it for tomorrow\n if (alarmTime.before(GregorianCalendar.getInstance())) {\n alarmTime.add(Calendar.DATE, 1);\n }\n\n AlarmTask alarmTask = new AlarmTask(name, entryNumber);\n AlarmTask.schedule(alarmTask, alarmTime.getTime());\n\n AlarmsEntryPanel alarmEntry = new AlarmsEntryPanel(hour, minute, period, name, entryNumber);\n System.out.println(\"Adding new alarm entry: \" + name);\n\n //Validate calls are required to correctly adjust the scroll sliders.\n entryContainerPanel.add(alarmEntry);\n entryContainerPanel.validate();\n entryContainerScrollPane.validate();\n\n entryNumber++;\n }", "public void addRentEntry(RentEntryBean reb) {\n RentDAO rentDAO = new RentDAO();\n rentDAO.addHouse(reb);\n }", "public void newEntry(String file, User user) {\r\n TableEntry entry = new TableEntry();\r\n entry.fileName = file;\r\n entry.userName = user.getName();\r\n entry.date = DateUtils.getISO8601Date(System.currentTimeMillis());\r\n \r\n int sz = m_entries.size();\r\n if ( (MAX_SIZE > 0) && (sz >= MAX_SIZE) ) {\r\n clear();\r\n sz = 0;\r\n }\r\n \r\n synchronized(m_entries) {\r\n m_entries.add(entry);\r\n ++sz;\r\n }\r\n fireTableRowsInserted(sz, sz);\r\n }", "void insert(EntryPair entry);", "@Override\r\n\tpublic void insert(Entry e) throws Exception {\n\r\n\t\tEntry enter = new Entry(e.name, e.initials, e.extension);\r\n\r\n// this gets the first letter of a word\r\n\t\tint index = e.name.toUpperCase().charAt(0) - 'A'; // finds the first letter of name in upper case and subtract\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// from its hashcode of A - 65\r\n\t\tfor (int k = 0; k < array[index].size(); k++) {\r\n\r\n\t\t\tif (array[index].get(k).compareTo(enter) == 0) {\r\n\t\t\t\tarray[index].add(k + 1, enter);\r\n\t\t\t\treturn;\r\n\t\t\t} else if (array[index].get(k).compareTo(enter) > 0) {\r\n\t\t\t\tif (k == 0) {\r\n\t\t\t\t\tarray[index].addFirst(enter);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tarray[index].add(k, enter);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (e.name.length() == array[index].get(k).getName().length()) {\r\n\r\n\t\t\t\t\tString temp = e.name.toUpperCase();\r\n\t\t\t\t\tfor (int j = 1; j < e.name.length(); j++) {\r\n\t\t\t\t\t\tif (temp.charAt(j) > array[index].get(k).getName().toUpperCase().charAt(j)) {\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tarray[index].add(enter);\r\n\t\treturn;\r\n\t}", "public void addMainEntry (ArchiveEntry mainEntry)\n\t{\n\t\tthis.mainEntries.add (mainEntry);\n\t}", "private void getEntries() {\r\n\r\n\t\tif(displayEntries.size() > 0){\r\n\t\t\tfor (int i = 0; i<displayEntries.size(); i++){\r\n\t\t\t\tNameSurferEntry entries = displayEntries.get(i);\r\n\t\t\t\tdrawRankGraph(entries,i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean add(T entry) {\n return false;\n }", "public final void entryRuleEntry() throws RecognitionException {\n try {\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:62:1: ( ruleEntry EOF )\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:63:1: ruleEntry EOF\n {\n before(grammarAccess.getEntryRule()); \n pushFollow(FollowSets000.FOLLOW_ruleEntry_in_entryRuleEntry61);\n ruleEntry();\n _fsp--;\n\n after(grammarAccess.getEntryRule()); \n match(input,EOF,FollowSets000.FOLLOW_EOF_in_entryRuleEntry68); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public Builder addEntry(com.google.devtools.kythe.proto.Analysis.FileInfo value) {\n if (entryBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureEntryIsMutable();\n entry_.add(value);\n onChanged();\n } else {\n entryBuilder_.addMessage(value);\n }\n return this;\n }", "public ZipArchiveEntry(final String name) {\n super(name);\n setName(name);\n }", "public void addEntry(String name, String postalAddress, String Phone, String email, String note) {\r\n AddressEntry contact = new AddressEntry.Builder(name).postalAddress(postalAddress)\r\n .phoneNumber(Phone).email(email).note(note).build();\r\n insertAlphabeticalOrder(contact);\r\n }", "public synchronized void add(String name, long threadId) {\n if(mFinished) {\n throw new IllegalStateException(\"Marker added to finished log\");\n }\n mMarkers.add(new Marker(name, threadId, SystemClock.elapsedRealtime()));\n }", "public static void addWaitlistEntry(WaitlistEntry entry) {\r\n con = DBConnection.getConnection();\r\n try {\r\n PreparedStatement add = con.prepareStatement(\"INSERT INTO Waitlist (FACULTY, DATE, SEATS, TIMESTAMP) \"\r\n + \"VALUES(?, ?, ?, ?)\");\r\n add.setString(1, entry.getName());\r\n add.setDate(2, entry.getDate());\r\n add.setInt(3, entry.getSeats());\r\n add.setTimestamp(4, entry.getTime());\r\n add.executeUpdate();\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void insert(SymbolTableEntry newEntry) {\n if (table.containsKey(newEntry.getName())) {\n table.remove(newEntry.getName());\n }\n table.put(newEntry.getName(), newEntry);\n }", "public MarketHistoricalState entry(final MarketStateEntry entry) {\n\t\tentries.add(entry);\n\t\treturn this;\n\t}", "boolean appendEntry(final LogEntry entry);", "public boolean add(T newEntry);", "ISlot add(ISlot newEntry);", "public boolean addEntry(AddressEntry addressEntry) {\n return this.entrySet.add(addressEntry);\n }", "void addLogEntry(LogEntry entry) throws LogEntryOperationFailedException;", "public Entry create(int compoID,\n\t\t\tint entryID,\n\t\t\tString entryName,\n\t\t\tString entryDesc,\n\t\t\tString entryAuthor) throws CreateException, RemoteException;", "public ArchiveEntry addEntry (File toInsert, String targetName, URI format,\n\t\tboolean mainEntry) throws IOException\n\t{\n\t\ttargetName = prepareLocation (targetName);\n\t\t\n\t\tif (targetName.equals (MANIFEST_LOCATION))\n\t\t\tthrow new IllegalArgumentException (\n\t\t\t\t\"it's not allowed to name a file \" + MANIFEST_LOCATION);\n\t\t\n\t\tif (targetName.equals (METADATA_LOCATION))\n\t\t\tthrow new IllegalArgumentException (\n\t\t\t\t\"it's not allowed to name a file \" + METADATA_LOCATION);\n\t\t\n\t\t// we also do not allow files with names like metadata-[0-9]*.rdf\n\t\tif (targetName.matches (\"^/metadata-[0-9]*\\\\.rdf$\"))\n\t\t\tthrow new IllegalArgumentException (\n\t\t\t\t\"it's not allowed to name a file like metadata-[0-9]*.rdf\");\n\t\t\n\t\t// insert to zip\n\t\tPath insertPath = zipfs.getPath (targetName).normalize ();\n\t\tFiles.createDirectories (insertPath.getParent ());\n\t\tFiles.copy (toInsert.toPath (), insertPath, Utils.COPY_OPTION);\n\t\t\n\t\tArchiveEntry entry = new ArchiveEntry (this, insertPath, format);\n\t\tentries.put (entry.getFilePath (), entry);\n\t\t\n\t\tif (mainEntry)\n\t\t{\n\t\t\tLOGGER.debug (\"setting main entry:\");\n\t\t\taddMainEntry (entry);\n\t\t}\n\t\t\n\t\treturn entry;\n\t}", "public Entry add(Event event, Entry entry) {\n\t\tList<Student> prev = null; // students to be replaced\r\n\t\tEntry res = null; // entry of event to be replaced\r\n\t\t\r\n\t\tif (roster.containsKey(event)) { // entry already present\r\n\t\t\tprev = new ArrayList<>();\r\n\t\t\tres = roster.get(event);\r\n\t\t\t\r\n\t\t\tList<Student> temp = res.getTeam().getMembers();\r\n\t\t\tprev.addAll(temp);\r\n\t\t\t\r\n\t\t\t// tell each student they are not part of event anymore\r\n\t\t\tfor (Student s : temp) {\r\n\t\t\t\ts.removeEvent(event);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// add the students to the roster and notify them\r\n\t\troster.put(event, entry);\r\n\t\tList<Student> members = entry.getTeam().getMembers();\r\n\t\tfor (Student s : members) {\r\n\t\t\tif (containsStudent(s)) {\r\n\t\t\t\ts.addEvent(event); // notify student\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstudents.add(s); // add to crew\r\n\t\t\t\ts.addEvent(event); // notify student\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// if there were original students, check if they need to be discarded\r\n\t\t// (they are not enrolled in any other events for this crew)\r\n\t\tif (prev != null) {\r\n\t\t\tboolean contains = false;\r\n\t\t\tfor (Student s : prev) {\r\n\r\n\t\t\t\tfor (Map.Entry<Event, Entry> rosterEntry : roster\r\n\t\t\t\t\t\t.entrySet()) {\r\n\t\t\t\t\tif (rosterEntry.getValue().getTeam().containsStudent(s)) {\r\n\t\t\t\t\t\tcontains = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (!contains) // student is no longer part of crew\r\n\t\t\t\t\tstudents.remove(s);\r\n\t\t\t}\r\n\t\t} // end of big if\r\n\t\treturn res;\r\n\t}", "public void DisplayEntry()\r\n {\r\n System.out.println(\"Username: \" + this.myUserName);\r\n System.out.println(\"Entry: \\n\" +\r\n this.myEntry);\r\n System.out.println(\"Date: \" + this.myDate);\r\n }", "public void push(T newEntry);", "public void onEntry()\n\t{\n\t}", "public boolean add(AdressEntry e) {\r\n if (addressEntryList.contains(e)) {\r\n System.out.println(\"Record already exists!!\");\r\n System.out.println(addressEntryList.get((addressEntryList.indexOf(e))));\r\n System.out.println();\r\n return false;\r\n } else {\r\n addressEntryList.add(e);\r\n addressEntryList.sort(Comparator.comparing(AdressEntry::getLastName));\r\n System.out.print(\"Thank you the following contact has been added to your address book:\\n \");\r\n System.out.println(e);\r\n }\r\n System.out.println();\r\n return true;\r\n }", "public void addMapEntry(String entry, boolean isLast) {\n checkNotNull(entry);\n if (isLast) {\n addLine(entry);\n } else {\n addLine(entry + ',');\n }\n }", "public final EObject ruleEntryEvent() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2125:28: ( ( () otherlv_1= 'entry' ) )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2126:1: ( () otherlv_1= 'entry' )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2126:1: ( () otherlv_1= 'entry' )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2126:2: () otherlv_1= 'entry'\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2126:2: ()\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2127:5: \r\n {\r\n if ( state.backtracking==0 ) {\r\n\r\n current = forceCreateModelElement(\r\n grammarAccess.getEntryEventAccess().getEntryEventAction_0(),\r\n current);\r\n \r\n }\r\n\r\n }\r\n\r\n otherlv_1=(Token)match(input,39,FOLLOW_39_in_ruleEntryEvent4737); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_1, grammarAccess.getEntryEventAccess().getEntryKeyword_1());\r\n \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }", "public void setEntryId(String entryId) {\n this.entryId = entryId;\n }", "public void entryUpdated (TudeySceneModel.Entry oentry, TudeySceneModel.Entry nentry)\n {\n setVisibility(nentry);\n }", "public void addAtTail(E entry) {\n\t\tLinkedNode<E> temp = new LinkedNode<E>(entry, null);\n\t\tsize++;\n\t\tif(head == null) {\n\t\t\thead = temp;\n\t\t\ttail = head;\n\t\t} else {\n\t\t\ttail.setNext(temp);\n\t\t\ttail = temp;\n\t\t}\n\t}", "protected void touchEntry(CacheEntry entry) {\n if (_last == entry) {\n return;\n }\n removeEntry(entry);\n addEntry(entry);\n }", "public ArchiveEntry addEntry (File toInsert, String targetName, URI format)\n\t\tthrows IOException\n\t{\n\t\treturn addEntry (toInsert, targetName, format, false);\n\t}", "public void addAnnotation(AnnotationEntry ann) {\n if (entries == null)\n entries = new AnnotationEntry[4];\n else if (entries.length <= numEntries) {\n AnnotationEntry[] tmp = new AnnotationEntry[2 * entries.length];\n System.arraycopy(entries, 0, tmp, 0, numEntries);\n entries = tmp;\n }\n entries[numEntries++] = ann;\n }", "public void putNextEntry( TarEntry entry ) throws IOException {\n\t\tStringBuffer name = entry.getHeader().name;\n\t\tif ( ( entry.isUnixTarFormat() && name.length() > TarHeader.NAMELEN ) || ( ! entry.isUnixTarFormat()\n && name.length() > (TarHeader.NAMELEN + TarHeader.PREFIXLEN) )) { // Formata gore isim boyutu kontrolu yapar\n\t\t\tthrow new InvalidHeaderException( \"file name '\" + name + \"' is too long ( \" + name.length() + \" > \"\n + ( entry.isUnixTarFormat() ? TarHeader.NAMELEN : (TarHeader.NAMELEN + TarHeader.PREFIXLEN) ) + \" bytes )\" );\n\t\t\t}\n\t\tentry.writeEntryHeader( this.recordBuf ); // Basligi yazar\n\t\tthis.buffer.writeRecord( this.recordBuf ); // Kayiti yazar\n\t\tthis.currBytes = 0;\n\t\tif ( entry.isDirectory() )\n\t\t\tthis.currSize = 0;\n\t\telse\n\t\t\tthis.currSize = entry.getSize();\n\t\t}", "public Entry updateEntry(Entry entry) {\n\t\tif(!(enteries.containsKey(entry.getUsername()))){\n\t\t\tthrow new EntryNotFoundException(\"Entry \" + entry.getEntryName() + \" not found.\");\n\t\t}else {\n\t\t\t//IS THERE A CLEANER WAY TO DO THIS?????\n\t\t\tList<Entry> userEntries = enteries.get(entry.getUsername());\n\t\t\tfor(Entry entry2 : userEntries) {\n\t\t\t\tif(entry2.getEntryName().equals(entry.getEntryName())) {\n\t\t\t\t\tentry2.setEntry(entry.getEntry());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn entry;\n\t}", "public Entry(String text) {\n this(GtkEntry.createEntry());\n setText(text);\n }", "public void setEntry(Set<AddressEntry> entry) {\n this.entrySet = entry;\n }" ]
[ "0.8915141", "0.8899465", "0.8627878", "0.78194624", "0.69984585", "0.6924655", "0.6901239", "0.6855772", "0.6602589", "0.65901464", "0.6485085", "0.6395498", "0.6332152", "0.6309414", "0.63057095", "0.6223176", "0.6207492", "0.6117605", "0.6050961", "0.6027337", "0.60122573", "0.5995283", "0.59888893", "0.5967455", "0.5946224", "0.5913456", "0.589292", "0.57883644", "0.5702445", "0.5679412", "0.56775236", "0.56504196", "0.56479084", "0.5615227", "0.5577035", "0.55531305", "0.55247337", "0.5484492", "0.5484177", "0.5451714", "0.5429281", "0.54133236", "0.5395307", "0.53856504", "0.53790903", "0.5377177", "0.5365368", "0.535115", "0.5348904", "0.534825", "0.53462523", "0.534537", "0.53346306", "0.531776", "0.52960557", "0.5288405", "0.5287888", "0.5277834", "0.5247924", "0.5246828", "0.52375346", "0.5233519", "0.5224631", "0.5216885", "0.52112967", "0.52057517", "0.51984394", "0.51887107", "0.5185891", "0.5179923", "0.51522684", "0.514677", "0.5127538", "0.50804806", "0.5079296", "0.5079087", "0.5040221", "0.50330436", "0.5025801", "0.50136113", "0.5010928", "0.5000908", "0.4998381", "0.499011", "0.4983613", "0.49825674", "0.49684793", "0.4965219", "0.49553776", "0.4929176", "0.49276286", "0.49174774", "0.49112815", "0.4906836", "0.49033004", "0.4902703", "0.48955187", "0.48872393", "0.48674506", "0.48621988" ]
0.8651335
2
Updates the display image by deleting all the graphical objects from the canvas and then reassembling the display according to the list of entries. Your application must call update after calling either clear or addEntry; update is also called whenever the size of the canvas changes.
public void update() { removeAll(); drawBackGround(); drawGraph(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawGraph();\r\n\t\t\r\n\t\tfor (int i = 0; i < entryGraph.size(); i++) {\r\n\t\t\tdrawEntry(entryGraph.get(i), i);\r\n\t\t}\r\n\t}", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawGrid();\r\n\t\tplotDecades();\r\n\t\tgetEntries();\r\n\t}", "public void clear() {\r\n\t\tdisplayEntries.clear();\r\n\t\tupdate();\r\n\t}", "public void update() {\n\t\tremoveAll();\n\t\tdrawGraph();\n\t\tplotEntries();\n\t}", "public void update() {\r\n\t\tthis.removeAll();\r\n\t\tdrawLinesAndLabels(this.getWidth(), this.getHeight());\r\n\t\tdrawNameSurferEntries();\r\n\t}", "public void clear() {\r\n\t\tremoveAll();\r\n\t\tdrawBackGround();\r\n\t\tclearEntries();\r\n\t\t\r\n\t}", "public void repaint()\n\t{\n\t\tpanel.remove(recipeEntryDisplay); //remove the old display\n\t\trecipeEntryDisplay = renderEntryDisplay(); //create a new one\n\t\t//load new display into main panel\n\t\tpanel.add(recipeEntryDisplay, BorderLayout.CENTER);\n\t\tpanel.revalidate(); //tell BorderLayout changes have been made\n\t\tpanel.repaint(); //repaint just in case\n\t}", "public void updateDisplay() {\n imageCutLevels.updateDisplay();\n }", "public void updateClearedTiles() {\r\n clearedTiles++;\r\n String text = String.format(\"Cleared tiles: %s / %s\",\r\n clearedTiles,\r\n tileList.size() - MINES);\r\n clearedTilesLabel.clear().drawText(text, 10, 10);\r\n\r\n // Check if cleared game\r\n if (clearedTiles == (tileList.size() - MINES)) {\r\n gameEngine.setScreen(new WinScreen(gameEngine));\r\n }\r\n }", "public void updateGraphics() {\n\t\t// Draw the background. DO NOT REMOVE!\n\t\tthis.clear();\n\t\t\n\t\t// Draw the title\n\t\tthis.displayTitle();\n\n\t\t// Draw the board and snake\n\t\t// TODO: Add your code here :)\n\t\tfor(int i = 0; i < this.theData.getNumRows(); i++) {\n\t\t\tfor (int j = 0; j < this.theData.getNumColumns(); j++) {\n\t\t\t\tthis.drawSquare(j * Preferences.CELL_SIZE, i * Preferences.CELL_SIZE,\n\t\t\t\t\t\tthis.theData.getCellColor(i, j));\n\t\t\t}\n\t\t}\n\t\t// The method drawSquare (below) will likely be helpful :)\n\n\t\t\n\t\t// Draw the game-over message, if appropriate.\n\t\tif (this.theData.getGameOver())\n\t\t\tthis.displayGameOver();\n\t}", "private void refreshDisplay(){\n // The ArrayList bricks gets all the bricks currently on the board.\n bricks.addAll(board.getBoardBricks());\n bricks.addAll(board.getCurrentBlock().getBricks());\n g.clearRect(0, 0, BRICK_SIZE*(Board.BOUNDARY_RIGHT+7), BRICK_SIZE*(Board.BOUNDARY_BOTTOM+1));\n\n setupGhostBoard();\n for (Brick brick : ghostBoard.getCurrentBlock().getBricks()){\n g.setFill(Color.rgb(61, 61, 61));\n g.fillRect(brick.getX() * BRICK_SIZE, brick.getY() * BRICK_SIZE, BRICK_SIZE, BRICK_SIZE);\n g.setStroke(Color.WHITE);\n g.setLineWidth(2.0);\n g.strokeRect(brick.getX() * BRICK_SIZE, brick.getY() * BRICK_SIZE, BRICK_SIZE, BRICK_SIZE);\n }\n\n for (Brick brick : bricks) {\n g.setFill(getBrickColour(brick.getColour()));\n g.fillRect(brick.getX() * BRICK_SIZE + 2, brick.getY() * BRICK_SIZE + 2, BRICK_SIZE - 4, BRICK_SIZE - 4);\n }\n\n if(board.getHeldBlock() != null){\n for(Brick brick : board.getHeldBlock().getBricks()){\n g.setFill(getBrickColour(brick.getColour()));\n g.fillRect(brick.getX() * BRICK_SIZE + 259, brick.getY() * BRICK_SIZE + 44, BRICK_SIZE - 4, BRICK_SIZE - 4);\n }\n }\n\n for(Brick brick : board.getBlockQueue().get(0).getBricks()){\n g.setFill(getBrickColour(brick.getColour()));\n g.fillRect(brick.getX() * BRICK_SIZE + 259, brick.getY() * BRICK_SIZE + 184, BRICK_SIZE - 4, BRICK_SIZE - 4);\n }\n\n score.setText(\"\" + board.getScore());\n highScore.setText(\"\" + Math.max(FileHandler.readHighScore(), board.getScore()));\n level.setText(\"\" + board.getLevel());\n lines.setText(\"\" + board.getTotalLinesCleared());\n // All the elements of bricks must be removed, otherwise they stack up.\n bricks.removeAll(bricks);\n\n if(board.isGameOver()){\n g.setFill(Color.rgb(31, 31, 31, 0.5));\n g.fillRect(0, 0, BRICK_SIZE*(Board.BOUNDARY_RIGHT+1), BRICK_SIZE*(Board.BOUNDARY_BOTTOM+1));\n g.setTextAlign(TextAlignment.CENTER);\n g.setTextBaseline(VPos.CENTER);\n g.setFill(Color.WHITE);\n g.setFont(new Font(\"Impact\", 50));\n g.fillText(\n \"GAME OVER\",\n 160, 352\n );\n g.setFill(Color.rgb(190, 190, 190));\n g.setFont(new Font(\"Impact\", 20));\n g.fillText(\n \"Press 'Esc' to exit.\",\n 160, 392\n );\n\n int oldHighScore = FileHandler.readHighScore(), newHighScore = board.getScore();\n if(oldHighScore < newHighScore){\n highScoreSurpassed = true;\n }\n if(highScoreSurpassed){\n g.setFill(Color.WHITESMOKE);\n g.setFont(new Font(\"Impact\", 24));\n g.fillText(\n \"New High Score: \" + newHighScore + \"!\\nOld High Score: \" + oldHighScore + \".\",\n 160, 502\n );\n }\n }\n }", "public void redraw() {\n\t\timgDisplay = null;\n\t\trepaint();\n\t}", "private void clearCanvas() {\n updateImageSize(mScale);\n }", "private void updateDisplay() {\n\t\tif (!Display.isActive()) {\n\t\t\twKeyDown = false;\n\t\t\taKeyDown = false;\n\t\t\tsKeyDown = false;\n\t\t\tdKeyDown = false;\n\t\t\tmouseDown = false;\n\t\t}\n\t\t\n\t\tDisplay.update();\n\t\tDisplay.sync(fps);\n\t\t\n\t\tif (Display.isCloseRequested()) {\n\t\t\tDisplay.destroy();\n\t\t\tAL.destroy();\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public void renewImage() {\r\n\t\t//myHistoryManager.clearHistory();\r\n\t\tindexes.clear();\r\n\t\tcache.clear();\r\n\t\tcolorCache.clear();\r\n\t\tstrokeSizes.clear();\r\n\t\t\r\n//\t\tfor (AbstractHistory tempHistory : newHistorys) {\r\n//\t\t\tmyHistoryManager.addHistory(tempHistory);\r\n//\t\t}\r\n\r\n\t\tsurface.clear();\r\n\t\tint start = 0;\r\n\t\tfor (start = 0; start < myHistoryManager.historys.size(); start++) {\r\n\r\n\t\t\tAbstractHistory history = myHistoryManager.historys.get(start);\r\n\t\t\tif (history.getType() == \"AddHistory\") {\r\n\r\n\t\t\t\tPoint endPos = ((AddHistory) history).endPos;\r\n\t\t\t\tMyColor pathColor = ((AddHistory) history).pathColor;\r\n\t\t\t\tstrokeSize = ((AddHistory) history).strokeSize;\r\n\t\t\t\tdouble x = endPos.getVector2().getX();\r\n\t\t\t\tdouble y = endPos.getVector2().getY();\r\n\r\n\t\t\t\tif (strokePointCount == 2) {\r\n\t\t\t\t\tcanvas_context.setStrokeStyle(pathColor.getColorCode());\r\n\t\t\t\t\tcanvas_context.setFillStyle(pathColor.getColorCode());\r\n\t\t\t\t\tcanvas_context.setLineWidth(((double) strokeSize) * 0.5);\r\n\t\t\t\t\tcanvas_context.setLineCap(LineCap.ROUND);\r\n\t\t\t\t\tcanvas_context.setLineJoin(LineJoin.ROUND);\r\n\t\t\t\t\tcanvas_context.setShadowBlur(((double) strokeSize) * 0.3);\r\n\t\t\t\t\tcanvas_context.setShadowColor(pathColor.getColorCode());\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* get the x, y */\r\n\t\t\t\t\tp3.x = x;\r\n\t\t\t\t\tp3.y = y;\r\n\t\t\t\t\tp0.x = p1.x + (p1.x - p2.x);\r\n\t\t\t\t\tp0.y = p1.y + (p1.y - p2.y);\r\n\t\t\t\t\tstrokePointCount++;\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\tget_buffer(p0, p1, p2, p3, bufferCount);\r\n\t\t\t\t\tbufferCount = buffList.size();\r\n\t\t\t\t\toldx = (int) buffList.get(0).x;\r\n\t\t\t\t\toldy = (int) buffList.get(0).y;\r\n\t\t\t\t\tcanvas_context.beginPath();\r\n\t\t\t\t\tcanvas_context.moveTo(oldx, oldy);\r\n\t\t\t\t\tcache.add(new Vector2(oldx, oldy));\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * draw all interpolated points found through Hermite\r\n\t\t\t\t\t * interpolation\r\n\t\t\t\t\t */\r\n\t\t\t\t\tint i = 1;\r\n\t\t\t\t\tfor (i = 1; i < bufferCount - 2; i++) {\r\n\t\t\t\t\t\tx = buffList.get(i).x;\r\n\t\t\t\t\t\ty = buffList.get(i).y;\r\n\t\t\t\t\t\tcache.add(new Vector2(x, y));\r\n\t\t\t\t\t\tdouble nextx = buffList.get(i + 1).x;\r\n\t\t\t\t\t\tdouble nexty = buffList.get(i + 1).y;\r\n\t\t\t\t\t\tdouble c = (x + nextx) / 2;\r\n\t\t\t\t\t\tdouble d = (y + nexty) / 2;\r\n\t\t\t\t\t\tcanvas_context.quadraticCurveTo(x, y, c, d);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tx = buffList.get(i).x;\r\n\t\t\t\t\ty = buffList.get(i).y;\r\n\t\t\t\t\tcache.add(new Vector2(x, y));\r\n\t\t\t\t\tdouble nextx = buffList.get(i + 1).x;\r\n\t\t\t\t\tdouble nexty = buffList.get(i + 1).y;\r\n\t\t\t\t\tcache.add(new Vector2(nextx, nexty));\r\n\t\t\t\t\t\r\n\t\t\t\t\tcanvas_context.quadraticCurveTo(x, y, nextx, nexty);\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* adaptive buffering using Hermite interpolation */\r\n\t\t\t\t\tint distance = (int) Math.sqrt(Math.pow(x - p2.x, 2)\r\n\t\t\t\t\t\t\t+ Math.pow(y - p2.y, 2));\r\n\t\t\t\t\tbufferCount = ((int) distance / 10) > 6 ? 6 : 3;\r\n\t\t\t\t\tbufferCount = bufferCount < 10 ? bufferCount : 10;\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tcolorCache.remove(colorCache.size()-1);\r\n\t\t\t\t\tcolorCache.add(pathColor);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t/* update the touch point list */\r\n\t\t\t\t\tp0.x = p1.x;\r\n\t\t\t\t\tp0.y = p1.y;\r\n\t\t\t\t\tp1.x = p2.x;\r\n\t\t\t\t\tp1.y = p2.y;\r\n\t\t\t\t\tp2.x = p3.x;\r\n\t\t\t\t\tp2.y = p3.y;\r\n\t\t\t\t\tp3.x = x;\r\n\t\t\t\t\tp3.y = y;\r\n\r\n\t\t\t\t\tget_buffer(p0, p1, p2, p3, bufferCount);\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * draw all interpolated points found through Hermite\r\n\t\t\t\t\t * interpolation\r\n\t\t\t\t\t */\r\n\t\t\t\t\tbufferCount = buffList.size();\r\n\t\t\t\t\tint i = 1;\r\n\t\t\t\t\tfor (i = 1; i < bufferCount - 2; i++) {\r\n\t\t\t\t\t\tx = buffList.get(i).x;\r\n\t\t\t\t\t\ty = buffList.get(i).y;\r\n\t\t\t\t\t\tcache.add(new Vector2(x, y));\r\n\t\t\t\t\t\tdouble nextx = buffList.get(i + 1).x;\r\n\t\t\t\t\t\tdouble nexty = buffList.get(i + 1).y;\r\n\t\t\t\t\t\tdouble c = (x + nextx) / 2;\r\n\t\t\t\t\t\tdouble d = (y + nexty) / 2;\r\n\t\t\t\t\t\tcanvas_context.quadraticCurveTo(x, y, c, d);\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\tx = buffList.get(i).x;\r\n\t\t\t\t\ty = buffList.get(i).y;\r\n\t\t\t\t\tcache.add(new Vector2(x, y));\r\n\t\t\t\t\t\r\n\t\t\t\t\tdouble nextx = buffList.get(i + 1).x;\r\n\t\t\t\t\tdouble nexty = buffList.get(i + 1).y;\r\n\t\t\t\t\tcache.add(new Vector2(nextx, nexty));\r\n\t\t\t\t\t\r\n\t\t\t\t\tcanvas_context.quadraticCurveTo(x, y, nextx, nexty);\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* adaptive buffering using Hermite interpolation */\r\n\t\t\t\t\tint distance = (int) Math.sqrt(Math.pow(x - p2.x, 2)\r\n\t\t\t\t\t\t\t+ Math.pow(y - p2.y, 2));\r\n\t\t\t\t\tbufferCount = ((int) distance / 10) > 6 ? 6 : 3;\r\n\t\t\t\t\tbufferCount = bufferCount < 10 ? bufferCount : 10;\r\n\t\t\t\t\t// logger.log(Level.SEVERE, \"bufferCount \"+\r\n\t\t\t\t\t// bufferCount);\r\n\t\t\t\t}\r\n\r\n\t\t\t} else if (history.getType() == \"PathHeadHistory\") {\r\n\t\t\t\t\r\n\t\t\t\tMyColor pathColor = ((PathHeadHistory) history).pathColor;\r\n\t\t\t\tstrokeSize = ((PathHeadHistory) history).strokeSize;\r\n\t\t\t\t\r\n\t\t\t\tPoint position = ((PathHeadHistory) history).position;\r\n\t\t\t\tdouble x = position.getVector2().getX();\r\n\t\t\t\tdouble y = position.getVector2().getY();\r\n\t\t\t\tstrokePointCount = 0;\r\n\r\n\t\t\t\t/* initialize the points */\r\n\t\t\t\tp1.x = x;\r\n\t\t\t\tp1.y = y;\r\n\t\t\t\tp2.x = x;\r\n\t\t\t\tp2.y = y;\r\n\t\t\t\tstrokePointCount++;\r\n\t\t\t\tstrokePointCount++;\r\n\t\t\t\tcanvas_context.stroke();\r\n\t\t\t\t\r\n\t\t\t\t/* add index to indexes list */\r\n\t\t\t\tindexes.add(cache.size());\r\n\t\t\t\tcache.add(new Vector2(x, y));\r\n\t\t\t\tstrokeSizes.add(strokeSize);\r\n\t\t\t\tcolorCache.add(pathColor);\r\n\t\t\t\t\r\n\t\t\t\t/* set stroke color, size, and shadow */\r\n\t\t\t\tcanvas_context.setStrokeStyle(pathColor.getColorCode());\r\n\t\t\t\tcanvas_context.setFillStyle(pathColor.getColorCode());\r\n\t\t\t\tcanvas_context.setLineWidth(((double) strokeSize) * 0.4);\r\n\t\t\t\tcanvas_context.beginPath();\r\n\t\t\t\tcanvas_context.arc(x, y, ((double) strokeSize) * 0.4, 0,\r\n\t\t\t\t\t\t2 * Math.PI);\r\n\t\t\t\tcanvas_context.fill();\r\n\t\t\t\t\r\n\t\t\t\tbufferCount = 3;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\tcanvas_context.stroke();\r\n\t\tstrokePointCount = 0;\r\n\t}", "void clearCanvasAndDraw()\n {\n \tlauncher.clearRect(0, 0, launcherCanvas.getWidth(), launcherCanvas.getHeight());\n \tdrawLauncher(angle);\n \tcanvas.clearRect(0, 0, mainCanvas.getWidth(), mainCanvas.getHeight());\n \tdrawSky();\n \tdrawGrass();\n }", "public void updateLayer() {\n bufferedImage = null;\n repaint();\n panelResized();\n }", "public void clearScreen()\n {\n showText(\"\", 150, 175);\n List objects = getObjects(null);\n if(objects != null)\n {\n removeObjects(objects);\n }\n }", "public void updateDisplay()\n {\n\t Color metal = new Color(153, 153, 153);\n\t Color background = new Color(0, 0, 0);\n\t Color sand = new Color(251, 251, 208);\n\t Color water = new Color(102, 179, 255);\n\t int rows = grid.length;\n\t int cols = grid[0].length;\n\t for(int i = 0; i < rows; i++) {\n\t\t for(int j = 0; j < cols; j++) {\n\t\t\t if(grid[i][j] == METAL) {\n\t\t\t\t //color should be gray or whatever\n\t\t\t\t display.setColor(i, j, metal);\n\t\t\t }\n\t\t\t else if(grid[i][j] == EMPTY) {\n\t\t\t\t display.setColor(i, j, background);\n\t\t\t }\n\t\t\t else if(grid[i][j] == SAND) {\n\t\t\t\t display.setColor(i, j, sand);\n\t\t\t }\n\t\t\t else {\n\t\t\t\t display.setColor(i, j, water);\n\t\t\t }\n\t\t }\n\t }\n }", "public void clear() {\r\n\t\tentryGraph.clear();\r\n\t\tupdate();\r\n\t}", "private void draw()\n {\n if(surfaceHolder.getSurface().isValid())\n {\n // Locks the surface. Can't be accessed or changed before it is unlocked again\n canvas = surfaceHolder.lockCanvas();\n\n // Background color\n canvas.drawColor(Color.BLACK);\n\n\n // ===================== DRAW SPRITES ======================= //\n // Draw Pacman\n canvas.drawBitmap(pacman.getBitmap(), pacman.getX(), pacman.getY(), paint);\n\n // Draw all Monsters\n for(Monster monster : monsterList)\n {\n canvas.drawBitmap(monster.getBitmap(), monster.getX(), monster.getY(), paint);\n }\n\n // Draw Cherries\n for(Cherry cherry : cherryList)\n {\n canvas.drawBitmap(cherry.getBitmap(), cherry.getX(), cherry.getY(), paint);\n }\n\n // Draw Key\n canvas.drawBitmap(key.getBitmap(), key.getX(), key.getY(), paint);\n\n // Draw Stars\n paint.setColor(Color.WHITE);\n for(Star star : starList)\n {\n paint.setStrokeWidth(star.getStarWidth());\n canvas.drawPoint(star.getX(), star.getY(), paint);\n }\n\n // ======================================================= //\n\n\n if(!gameEnded)\n {\n // Draw user HUD\n paint.setTextAlign(Paint.Align.LEFT);\n paint.setColor(Color.WHITE);\n paint.setTextSize(40);\n paint.setTypeface(Typeface.MONOSPACE);\n canvas.drawText(\"Level: \" + level, 10, 50, paint);\n canvas.drawText(\"Hi Score: \" + hiScore, (screenMax_X /4) * 3, 50 , paint);\n canvas.drawText(\"Score: \" + score, screenMax_X / 3, 50 , paint);\n canvas.drawText(\"New level in: \" + distanceRemaining + \"km\", screenMax_X / 3, screenMax_Y - 20, paint);\n canvas.drawText(\"Lives: \" + pacman.getLifes(), 10, screenMax_Y - 20, paint);\n canvas.drawText(\"Speed \" + pacman.getSpeed() * 100 + \" Km/h\", (screenMax_X /4) * 3, screenMax_Y - 20, paint);\n\n } else {\n\n // Draw 'Game Over' Screen\n paint.setTextAlign(Paint.Align.CENTER);\n paint.setTypeface(Typeface.MONOSPACE);\n paint.setFakeBoldText(true);\n paint.setTextSize(150);\n canvas.drawText(\"Game Over\", screenMax_X / 2, 350, paint);\n paint.setTextSize(50);\n paint.setTypeface(Typeface.DEFAULT);\n paint.setFakeBoldText(false);\n canvas.drawText(\"Hi Score: \" + hiScore, screenMax_X / 2, 480, paint);\n canvas.drawText(\"Your Score: \" + score, screenMax_X / 2, 550, paint);\n paint.setTextSize(80);\n canvas.drawText(\"Tap to replay!\", screenMax_X / 2, 700, paint);\n }\n\n if(levelSwitched)\n {\n // Notify the user whenever level is switched\n paint.setTextSize(100);\n paint.setTypeface(Typeface.MONOSPACE);\n paint.setFakeBoldText(true);\n paint.setTextAlign(Paint.Align.CENTER);\n canvas.drawText(\"Level \" + level + \"!\", screenMax_X / 2, 350, paint);\n }\n\n // Unlcock canvas and draw it the scene\n surfaceHolder.unlockCanvasAndPost(canvas);\n }\n }", "void repaintCanvas() {\n objCanvas.repaint();\n\n objCanvas.setImage(_img);\n ArrayList<ObjLabel> objLabels = objCanvas.getObjLabels();\n\n status(\"Parsed: \" + objLabels.size() + \" objects for \" + getFilename());\n objLabels.forEach((objLabel) -> {\n addObjLabel(objLabel);\n\n });\n }", "public void updateDisplayRoom() {\n roomDisplayArray = new String[roomHeight][roomWidth];\n initalizeRoomDisplayArray();\n addDoorsToRoomDisplayArray();\n addContentsToRoomDisplayArray();\n }", "private void flushElements() {\n if (elements != null) {\n TopItemList smallModel = new TopItemList();\n smallModel.addAll(elements);\n\n SimpleViewBuilder builder = new SimpleViewBuilder();\n\n // scale Compute\n double scale = (double) lineHeight\n / drawingSpecifications.getMaxCadratHeight();\n\n MDCView view = builder.buildView(smallModel,\n drawingSpecifications);\n\n if (view.getWidth() == 0 || view.getHeight() == 0) {\n return;\n }\n ViewDrawer drawer = new ViewDrawer();\n\n BufferedImage image = new BufferedImage((int) Math.ceil(view\n .getWidth()\n * scale + 1), (int) Math.ceil(view.getHeight() * scale\n + 2 * pictureMargin + 1), BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g = image.createGraphics();\n GraphicsUtils.antialias(g);\n\n g.setColor(backgroundColor);\n g.fillRect(0, 0, image.getWidth(), image.getHeight());\n g.setColor(drawingSpecifications.getBlackColor());\n g.translate(1, 1 + pictureMargin);\n\n g.scale(scale, scale);\n drawer.draw(g, view, drawingSpecifications);\n g.dispose();\n\n File fic = getImageFile(imageNumber);\n try {\n ImageIO.write(image, \"png\", fic); //$NON-NLS-1$\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n String center = \"\"; //$NON-NLS-1$\n\n if (centerPictures) {\n center = \" align='center' \"; //$NON-NLS-1$\n }\n if (pictureScale != 100) {\n write(\"<img \" + center + \" src='\" + fic.getName() //$NON-NLS-1$ //$NON-NLS-2$\n + \"' width='\" + pictureScale + \"%' height='\" //$NON-NLS-1$ //$NON-NLS-2$\n + pictureScale + \"%'>\"); //$NON-NLS-1$\n\n } else if (generatePictureSize) {\n write(\"<img \" + center + \" src='\" + fic.getName() //$NON-NLS-1$ //$NON-NLS-2$\n + \"' width='\" + image.getWidth() + \"' height='\" //$NON-NLS-1$ //$NON-NLS-2$\n + image.getHeight() + \"'>\"); //$NON-NLS-1$\n } else {\n write(\"<img \" + center + \"src='\" + fic.getName() + \"'>\"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n }\n imageNumber++;\n image.flush();\n elements = null;\n }\n }", "public void clearDisplay() {\n placeHolder.getChildren().clear();\n }", "public void updateObjectImage() {\r\n\t\tif (this.objectDescriptionTabItem != null) this.objectDescriptionTabItem.redrawImageCanvas();\r\n\t}", "private void draw() {\n Graphics2D g2 = (Graphics2D) image.getGraphics();\n\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);\n\n AffineTransform transform = AffineTransform.getTranslateInstance(0, height);\n transform.concatenate(AffineTransform.getScaleInstance(1, -1));\n g2.setTransform(transform);\n\n int width = this.width;\n int height = this.height;\n if (scale != 1) {\n g2.scale(scale, scale);\n width = (int) Math.round(width / scale);\n height = (int) Math.round(height / scale);\n }\n AbstractGraphics g = new GraphicsSWT(g2);\n\n g.setScale(scale);\n if (background != null) {\n g.drawImage(background, 0, 0, width, height);\n }\n\n synchronized (WFEventsLoader.GLOBAL_LOCK) {\n for (Widget widget : widgets) {\n if (widget != null) widget.paint(g, width, height);\n }\n }\n // draw semi-transparent pixel in top left corner to workaround famous OpenGL feature\n g.drawRect(0, 0, 1, 1, Color.WHITE, .5, PlateStyle.RectangleType.SOLID);\n\n g2.dispose();\n }", "private void refreshDisplay() {\n \t\tCursor cursor;\n \t\tif (node_id >= 0)\n \t\t\tcursor = appInst.getDB().getNodeChildren(node_id);\n \t\telse\n \t\t\tcursor = appInst.getDB().getFileCursor();\n \n \t\tstartManagingCursor(cursor);\n \t\tthis.outlineAdapter = new OutlineCursorAdapter(this, cursor, appInst.getDB());\n \t\tthis.setListAdapter(outlineAdapter);\n \n \t\tgetListView().setSelection(this.lastSelection);\n \t}", "public void cleanCanvas() {\n\t\tclean = true;\n\t\tthis.invalidate();\n\t\t\n\t\t// adiciona ponto fict’cio para informar que o canvas foi limpo num dado momento\n\t\tif (toReplay) {\n\t\t\txs.add(-2.0f);\n\t\t\tys.add(-2.0f);\n\t\t\tcolors.add(mPaint.getColor());\n\t\t}\n\t}", "@Override\n\tpublic void update() {\n\n\t\t// Update camera coordinates based off of the width and height.\n\t\tif (cameraStalk != null) {\n\t\t\tint width = dc.getWidth();\n\t\t\tint height = dc.getHeight();\n\n\t\t\tcamera[0] = cameraStalk.coor_x - (width - m.cellWidth) / 2;\n\t\t\tcamera[1] = cameraStalk.coor_y - (height - m.cellHeight) / 2;\n\t\t\tif (camera[0] < 0) {\n\t\t\t\tcamera[0] = 0;\n\t\t\t} else {\n\t\t\t\tint x;\n\t\t\t\tif (camera[0] > (x = m.mapWmax - width + m.cellWidth)) {\n\t\t\t\t\tcamera[0] = x;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (camera[1] < 0) {\n\t\t\t\tcamera[1] = 0;\n\t\t\t} else {\n\t\t\t\tint y;\n\t\t\t\tif (camera[1] > (y = m.mapHmax - height + m.cellHeight)) {\n\t\t\t\t\tcamera[1] = y;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Draw in the background.\n\t\tif (background != NullImg.getInstance()) {\n\t\t\tint bg_width = background.getWidth();\n\t\t\tint bg_height = background.getHeight();\n\t\t\t// The offset of the image must decrease as the camera's position\n\t\t\t// increases.\n\t\t\tfor (int x = (-camera[0] % -bg_width); x < dc.getWidth(); x += bg_width) {\n\t\t\t\tfor (int y = (-camera[1] % -bg_height); y < dc\n\t\t\t\t\t\t.getHeight(); y += bg_height) {\n\t\t\t\t\tbackground.drawSlide(x, y, dc);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update all objects.\n\t\tif (update) {\n\t\t\tfor (SimpleObject s = m.getDrawBegin(); s != null; s = s.updateNext) {\n\t\t\t\ts.newUpdate();\n\t\t\t}\n\t\t}\n\n\t\t// Paint all objects.\n\t\tfor (SimpleObject s = m.getDrawBegin(); s != null; s = s.drawNext) {\n\t\t\ts.updateNext = s.drawNext;\n\t\t\ts.i.drawSlide(s.coor_x + s.off[0] - camera[0], s.coor_y + s.off[1]\n\t\t\t\t\t- camera[1], dc);\n\t\t}\n\n\t\t// Update the world object last.\n\t\tswo.update();\n\t\tdc.paint();\n\t}", "private void actionClear() {\n layoutPanel.inhNList.clear();\n layoutPanel.activeNList.clear();\n layoutPanel.probedNList.clear();\n\n Graphics g = layoutPanel.getGraphics();\n layoutPanel.writeToGraphics(g);\n }", "private void updateSizeInfo() {\n RelativeLayout drawRegion = (RelativeLayout)findViewById(R.id.drawWindow);\r\n drawW = drawRegion.getWidth();\r\n drawH = drawRegion.getHeight();\r\n getImageFromStorage();\r\n LinearLayout parentWindow = (LinearLayout)findViewById(R.id.parentWindow);\r\n parentWindow.setPadding((drawW - bgImage.getWidth())/2, (drawH - bgImage.getHeight())/2, (drawW - bgImage.getWidth())/2, (drawH - bgImage.getHeight())/2);\r\n parentWindow.invalidate();\r\n }", "public void displayNewImage() {\n\t\tthis.canvas.display();\n\t}", "private void updateCanvas(Canvas c) {\n\t\t\tlong startTime = System.nanoTime();\r\n\t\t\tint size = XList.size();\r\n\r\n\t\t\tif (initialBitmap == null) {\r\n\t\t\t\tinitialBitmap = Bitmap.createBitmap(c.getWidth(), c.getHeight(),\r\n\t\t\t\t\t\tBitmap.Config.ARGB_8888);\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tCanvas tempCanvas = new Canvas(initialBitmap);\r\n\r\n\t\t\tif (size > oldSize) {\r\n\t\t\t\tfor (int i = 0; i < size - 1; i++) {\r\n\r\n\t\t\t\t\ttempCanvas.drawCircle(XList.get(i), YList.get(i), CIRCLE_RADIUS,\r\n\t\t\t\t\t\t\tpaint);\r\n\t\t\t\t}\r\n\t\t\t\tc.drawBitmap(initialBitmap, 0, 0, paint);\r\n\t\t\t\toldSize = size;\r\n\t\t\t}\r\n\r\n\t\t\tlong enTime = System.nanoTime();\r\n\t\t\ttimeList.add(enTime - startTime);\r\n\t\t}", "public void updateDisplay()\n {\n //Step 3\n\t Color color = null;\n //Hint - use a nested for loop\n\t for(int row = 0; row < grid.length; row++)\n\t {\n\t\t for(int col = 0; col < grid[0].length; col++)\n\t\t {\n\t\t\t if(grid[row][col] == EMPTY)\n\t\t\t {\n\t\t\t\t color = Color.BLACK;\n\t\t\t }\n\t\t\t else if(grid[row][col] == METAL)\n\t\t\t {\n\t\t\t\t color = Color.GRAY;\n\t\t\t }\n\t\t\t else if(grid[row][col] == SAND)\n\t\t\t {\n\t\t\t\t color = new Color(204, 186, 25);\n\t\t\t }\n\t\t\t else if(grid[row][col] == WATER)\n\t\t\t {\n\t\t\t\t color = new Color(7, 125, 116);\n\t\t\t }\n\t\t\t else if(grid[row][col] == HELIUM)\n\t\t\t {\n\t\t\t\t color = Color.WHITE;\n\t\t\t }\n\t\t\t else if(grid[row][col] == BOUNCE)\n\t\t\t {\n\t\t\t\t color = new Color(255, 0, 200);\n\t\t\t }\n\t\t\t else if(grid[row][col] == VIRUS)\n\t\t\t {\n\t\t\t\t color = new Color(153, 51, 204);\n\t\t\t }\n\t\t\t else if(grid[row][col] == FIRE)\n\t\t\t {\n\t\t\t\t color = new Color(229, 64, 0);\n\t\t\t }\n\t\t\t else if(grid[row][col] == VINE)\n\t\t\t {\n\t\t\t\t color = new Color(45, 102, 25);\n\t\t\t }\n\t\t\t else if(grid[row][col] == TELEPORT)\n\t\t\t {\n\t\t\t\t color = new Color(255, 255, 0);\n\t\t\t }\n\t\t\t else if(grid[row][col] == LASER)\n\t\t\t {\n\t\t\t\t color = new Color(245, 50, 41);\n\t\t\t }\n\t\t\t display.setColor(row, col, color);\n\t\t }\n\t }\n\t \n }", "public void updateOnCtWindowChange() {\n int[] displayImageData = resolveRaw(imgData[currentLayer]);\n raster.setPixels(0, 0, imgWidth, imgHeight, displayImageData);\n image.setData(raster);\n }", "public void update() {\n\n\t\tdisplay();\n\t}", "private void update() {\r\n\t\t// Creating display image, a bounded rectangle in which the set of bars\r\n\t\t// will fit.\r\n\t\t// The height and width should both be total diameter, which is double\r\n\t\t// the bar and central radii sum.\r\n\t\tdouble displaySize = 2.0 * (sumArray(barRadii) + centralRadius);\r\n\t\t// Rounding dimensions up to ensure the actual set will fit.\r\n\t\tGreenfootImage widget = new GreenfootImage(\r\n\t\t\t\t(int) Math.ceil(displaySize), (int) Math.ceil(displaySize));\r\n\t\t// Setting up canvas for the foundation of the display image, to be\r\n\t\t// drawn on.\r\n\t\tGraphics2D img = widget.getAwtImage().createGraphics();\r\n\t\t// This variable stores the radius at which to begin drawing each bar.\r\n\t\t// Its starting value, for the first bar, is the\r\n\t\t// size of the central circle, which is reserved for avatars, etc. The\r\n\t\t// for loop will use it to keep track of position,\r\n\t\t// to draw outwards.\r\n\t\tdouble drawBarFromRadius = centralRadius;\r\n\t\t// Central coordinates of entire set.\r\n\t\tdouble cenXAndY = displaySize / 2.0;\r\n\t\t// Draw central avatar onto display at center. The parameters still\r\n\t\t// use the upper left corner, so values are corrected as such.\r\n\t\timg.drawImage(avatar.getAwtImage(), (int) (cenXAndY - centralRadius),\r\n\t\t\t\t(int) (cenXAndY - centralRadius), null);\r\n\t\t// This class numerically identifies bars from 0 upwards, from inside to\r\n\t\t// out.\r\n\t\t// Now building bars from inside to out and drawing them onto display\r\n\t\t// image foundation.\r\n\t\tfor (int i = 0; i < barCount; i++) {\r\n\t\t\t// These variables will be frequently used in a moment; inner and\r\n\t\t\t// outer radii of the current bar.\r\n\t\t\tdouble innerRadius = drawBarFromRadius;\r\n\t\t\tdouble outerRadius = drawBarFromRadius + barRadii[i];\r\n\t\t\t// Creating circles for the bar boundaries, to form the rings. These\r\n\t\t\t// are the empty bar backgrounds, not the actual bars.\r\n\t\t\t// Centered on display center.\r\n\t\t\tShape innerBound = getCircle(cenXAndY, cenXAndY, innerRadius);\r\n\t\t\tShape outerBound = getCircle(cenXAndY, cenXAndY, outerRadius);\r\n\t\t\t// Using area subtraction to create an empty ring shape with a\r\n\t\t\t// transparent center.\r\n\t\t\t// This ring is the background.\r\n\t\t\t// After establishing the areas,\r\n\t\t\tArea innerA = new Area(innerBound);\r\n\t\t\tArea ring = new Area(outerBound);\r\n\t\t\t// Subtract the inner, smaller area from the larger to create the\r\n\t\t\t// ring.\r\n\t\t\tring.subtract(innerA);\r\n\t\t\t// Now creating the actual bar, the green partial ring indicator\r\n\t\t\t// that will change in arc length to show statistics.\r\n\t\t\t// First create a new copy of the ring area.\r\n\t\t\tArea bar = new Area(ring);\r\n\t\t\t// Temporary variable used to calculate the proportion of the\r\n\t\t\t// circumference, in degrees, representing the proportion of the\r\n\t\t\t// current status relative to maximum possible status. Percentage\r\n\t\t\t// times the total degree measure of the circle, 360 degrees.\r\n\t\t\tdouble arcAngle = (currentValue[i] / maxValue[i]) * 360.0;\r\n\t\t\t// Now retrieve the area of the pie shape for this arc, for the\r\n\t\t\t// outer boundary circle.\r\n\t\t\tArea pieShapeIndicator = new Area(getPie(cenXAndY, cenXAndY,\r\n\t\t\t\t\touterRadius, 0.0, arcAngle));\r\n\t\t\t// Then turn the bar area, currently still a ring of outer subtract\r\n\t\t\t// inner, into an arc ring by intersecting it with the pie shape.\r\n\t\t\t// The pie shape's center is removed, as only the intersecting\r\n\t\t\t// partial outer ring overlap of both areas is kept.\r\n\t\t\t// Bar is now an arc ring, fitting into the background ring\r\n\t\t\t// appropriately according to status.\r\n\t\t\tbar.intersect(pieShapeIndicator);\r\n\t\t\t// Draw the bar background onto the display.\r\n\t\t\timg.setColor(barBGColors[i]);\r\n\t\t\timg.fill(ring);\r\n\t\t\t// If the visual should be simple.\r\n\t\t\tif (!gradientEffect[i]) {\r\n\t\t\t\t// Draw the simple indicator onto the display.\r\n\t\t\t\timg.setColor(barColors[i]);\r\n\t\t\t\timg.fill(bar);\r\n\t\t\t} else {\r\n\t\t\t\t// Draw a gradient bar. From inner bound to outer bound of arc,\r\n\t\t\t\t// focused at center;\r\n\t\t\t\tRadialGradientPaint grad = new RadialGradientPaint(\r\n\t\t\t\t// Coordinates of center.\r\n\t\t\t\t\t\t(float) cenXAndY, (float) cenXAndY,\r\n\t\t\t\t\t\t// Bounding radius, outer.\r\n\t\t\t\t\t\t(float) outerRadius,\r\n\t\t\t\t\t\t// Key-frame radius positions as a proportion of\r\n\t\t\t\t\t\t// bounding radius. First color is at inner radius,\r\n\t\t\t\t\t\t// second at outer.\r\n\t\t\t\t\t\tnew float[] { (float) (innerRadius / outerRadius), 1.0f },\r\n\t\t\t\t\t\t// Colors to be interpolated between for gradient.\r\n\t\t\t\t\t\t// Uses the set color and a darker version of it.\r\n\t\t\t\t\t\tnew Color[] { barColors[i].darker(), barColors[i] });\r\n\t\t\t\t// Draw arc ring.\r\n\t\t\t\timg.setPaint(grad);\r\n\t\t\t\timg.fill(bar);\r\n\t\t\t}\r\n\t\t\t// Clause for alert feature; if alert is on and should show for\r\n\t\t\t// current status then;\r\n\t\t\tif (lowStatusAlert[i]\r\n\t\t\t\t\t&& currentTarget[i] < alertPercent[i] * maxValue[i]) {\r\n\t\t\t\t// Draw the flicker if it should be there this frame.\r\n\t\t\t\t// Otherwise do nothing.\r\n\t\t\t\tif (alertFlickering[i]) {\r\n\t\t\t\t\timg.setColor(alertColors[i]);\r\n\t\t\t\t\timg.fill(bar);\r\n\t\t\t\t}\r\n\t\t\t\t// Switch the flag for next frame.\r\n\t\t\t\talertFlickering[i] = !alertFlickering[i];\r\n\t\t\t}\r\n\t\t\t// This bar is now updated. Moving onto the next one. The radius at\r\n\t\t\t// which to begin drawing the next is noted down here.\r\n\t\t\tdrawBarFromRadius += barRadii[i];\r\n\t\t}\r\n\t\t// Display.\r\n\t\tsetImage(widget);\r\n\t}", "private void refreshScreen() {\n app.getMainMenu().getTextField().clear();\n for (int key = 0; key < 96; key++) {\n app.getWorkSpace().getGridCell(key).unhighlightGridCell();\n app.getWorkSpace().getGridCell(key).updateState(app);\n }\n Storage.getInstance().writeObject(\"workspace\", app.getWorkSpace().getWorkSpaceMap());\n app.show();\n }", "void updateDrawing() {\n filling = modelRoot.getCDraw().getFilling(this);\n dirtyBufF = true;\n tooltip = modelRoot.getCDraw().getTooltip(this);\n dirtyBufT = true;\n title = modelRoot.getCDraw().getTitle(this);\n dirtyBufTitle = true;\n colorTitle = modelRoot.getCDraw().getTitleColor(this);\n dirtyBufCT = true;\n }", "public void refreshDisplayData() {\n if (useLiveDisplayUpdates && displaySection.isOpen()) {\n displayPanel.setValue(device.getDisplayData(), true);\n }\n\n }", "private void drawStuff() {\n //Toolkit.getDefaultToolkit().sync();\n g = bf.getDrawGraphics();\n bf.show();\n Image background = window.getBackg();\n try {\n g.drawImage(background, 4, 24, this);\n\n for(i=12; i<264; i++) {\n cellKind = matrix[i];\n\n if(cellKind > 0)\n g.drawImage(tile[cellKind], (i%12)*23-3, (i/12)*23+17, this);\n }\n\n drawPiece(piece);\n drawNextPiece(pieceKind2);\n\n g.setColor(Color.WHITE);\n g.drawString(\"\" + (level+1), 303, 259);\n g.drawString(\"\" + score, 303, 339);\n g.drawString(\"\" + lines, 303, 429);\n\n } finally {bf.show(); g.dispose();}\n }", "public void clearData() {\n\t\tdrawnRect.clear();\n\t\tboxList.setListData(drawnRect);\n\t\tcurrRect = null;\n\t\ttextField.setText(\"\");\n\t}", "public void removeAllDisplayItems() {\n\t\tdisp.removeAllDisplayItems();\n\t\trepaint();\n\t}", "public void updateImage() {\n Graphics2D g = img.createGraphics();\n for (Circle gene : genes) {\n gene.paint(g);\n }\n g.dispose();\n }", "public void CleanInfoCanvas(){\n Graphics g = infoCanvas.getGraphics();\n g.setColor(Color.BLACK);\n g.fillRect(infoCanvas.getWidth()/3 + 4, infoCanvas.getHeight()/10 + 10, infoCanvas.getWidth()/3-8, infoCanvas.getHeight()/10-8);\n g.fillRect(infoCanvas.getWidth()/3 + 4, 3 * infoCanvas.getHeight()/10 + 10, infoCanvas.getWidth()/3-8, infoCanvas.getHeight()/10-8);\n g.fillRect(infoCanvas.getWidth()/3 + 4, 11 * infoCanvas.getHeight()/20 + 15, infoCanvas.getWidth()/3-8, infoCanvas.getHeight()/10-8);\n infoCanvas.drawSquares((Graphics2D) infoCanvas.getGraphics(), 14 * infoCanvas.getHeight() / 20, infoCanvas.getWidth(), infoCanvas.getHeight());\n }", "private void updateObjects(Graphics g){\n\t\tclearMhos(g);\n\t\tclearPlayer(g);\n\t\tdrawMhos(g);\n\t\tdrawPlayer(g);\n\t\tdrawFences(g);\n\t\tDraw.drawInstructions(g,smallFont);\n\t}", "public void update() {\n\t\tfor (Entry<String, Integer> entry : countMap.entrySet()) {\n\t\t\tcountMap.put(entry.getKey(), 0);\n\t\t}\n\t\tfor (int i = 0; i < numRows; i++) {\n\t\t\tfor (int j = 0; j < numCols; j++) {\n\t\t\t\tCell c = newGrid[i][j];\n\t\t\t\tc.setRow(i);\n\t\t\t\tc.setCol(j);\n\t\t\t\tblocks[i][j].setFill(c.getColor());\n\t\t\t\tcurrentGrid[i][j] = newGrid[i][j];\n\t\t\t}\n\t\t}\n\t\tempty(newGrid);\n\t}", "public void refresh() {\n this.removeAll();\n init();\n this.revalidate();\n }", "public void updateScreen(){}", "public void update (Graphics g)\n\t{\n\t\t// initialize buffer\n\t\tif (dbImage == null)\n\t\t{\n\t\t\tdbImage = createImage (this.getSize().width, this.getSize().height);\n\t\t\tdbg = dbImage.getGraphics ();\n\t\t}\n\t\t\n\t\t// clear screen in background\n\t\tdbg.setColor (getBackground ());\n\t\tdbg.fillRect (0, 0, this.getSize().width, this.getSize().height);\n\t\t\n\t\t// draw elements in background\n\t\tdbg.setColor (getForeground());\n\t\tpaint (dbg);\n\t\t\n\t\t// draw image on the screen\n\t\tg.drawImage (dbImage, 0, 0, this);\n\t\t\n\t}", "public void clear()\r\n {\r\n throw new RuntimeException(\"Cannot modify the display data.\");\r\n }", "public void update()\r\n {\r\n for (int i = 0; i < _menubar.length; i++)\r\n {\r\n _menubar[i].draw();\r\n }\r\n _ausgewahlt.draw();\r\n }", "private void refresh(int width, int height) {\n Integer numUnexposed = mainField.numUnexposed();\n nonminesLabel.setText(numUnexposed.toString());\n Integer numMarked = mainField.numMarked();\n if (numMarked < 0) {\n cellsUnmarked.setText(\"Too Many Marked!\");\n }\n else {\n cellsUnmarked.setText(numMarked.toString());\n }\n // iterate through all the buttons and update the text if it's an exposed cell\n for (int i = 0;i < width;i++) {\n for (int j = 0;j < height;j++) {\n int cellState = mainField.getCellState(i,j);\n if (cellState == mainField.EXPOSED) {\n Integer numValue = mainField.getValue(i,j);\n if (numValue == -1) {\n btArray[i][j].setText(\"B\");\n btArray[i][j].setStyle(\"-fx-background-color: #FF0000;\");\n }\n else if (numValue == 0) {\n btArray[i][j].setStyle(\"-fx-background-color: #CCCCCC;\");\n }\n else {\n btArray[i][j].setText(numValue.toString());\n btArray[i][j].setStyle(\"-fx-background-color: #CCCCCC;\");\n }\n }\n }\n }\n }", "void updateScreen() {\n\t\tZone possibleNewZone = currentZone.getSpace(playerY, playerX).getNextZone();\n\t\tif (possibleNewZone != null) {\n\t\t\tString oldBGMusic = currentZone.getBackgroundMusic();\n\t\t\tcurrentZone = possibleNewZone;\n\t\t\tcurrentZone.enableZoneWarpSpaces();\n\t\t\tplayerX = currentZone.getPlayerStartX();\n\t\t\tplayerY = currentZone.getPlayerStartY();\n\t\t\t\n\n\t\t\tif (!oldBGMusic.equals(currentZone.getBackgroundMusic())) {\n\t\t\t\tmusicPlayer.stop();\n\t\t\t\tmusicPlayer.play(currentZone.getBackgroundMusic(), 100);\n\t\t\t}\n\t\t}\n\n\t\t// Update Panel Colors\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tfor (int a = 0; a < 10; a++) {\n\t\t\t\tpanels[i][a].setBackground(currentZone.getSpace(i, a).getColor());\n\t\t\t}\n\t\t}\n\n\t\t// Update Labels\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tfor (int a = 0; a < 10; a++) {\n\n\t\t\t\tlabels[i][a].setIcon(currentZone.getSpace(i, a).getPic());\n\t\t\t}\n\t\t}\n\t\t// Shows player in the new space\n\t\tlabels[playerY][playerX].setIcon(playerPic);\n\n\t\t// Shows enemy in the new space\n\t\t// labels[enemyY][enemyX].setIcon(enemyPic);\n\t}", "public void updateDisplayInfo() {\n updateBaseDisplayMetricsIfNeeded();\n this.mDisplay.getDisplayInfo(this.mDisplayInfo);\n this.mDisplay.getMetrics(this.mDisplayMetrics);\n onDisplayChanged(this);\n }", "public void updateInfo()\n\t{\n\t\twidth = Game.frame.getWidth();\n\t\theight = Game.frame.getHeight();\n\t\tGame.frame.revalidate();\n\t\tGame.frame.repaint();\n\t}", "public void draw() {\n GraphicsContext gc = getGraphicsContext2D();\n /*gc.clearRect(0, 0, getWidth(), getHeight());\n\n if (squareMap != null) {\n squareMap.draw(gc);\n }\n if (hexMap != null) {\n hexMap.draw(gc);\n }*/\n\n // Draw animations\n for (SpriteAnimationInstance anim : animationList) {\n anim.draw(gc);\n }\n\n // Lastly draw the dialogue window, no matter which canvas\n // we are on, all the same.\n DfSim.dialogueWindow.draw(gc);\n\n /*if (landMap != null) {\n landMap.draw(gc);\n }*/\n\n // Draw a border around the canvas\n //drawBorder(gc);\n\n // And now just draw everything directly from the simulator\n /*for (Raindrop item : sim.getDrops()) {\n drawMovableCircle(gc, item);\n }\n for (Earthpatch item : sim.getPatches()) {\n drawMovableCircle(gc, item);\n }\n for (SysShape item : sim.getShapes()) {\n drawSysShape(gc, item);\n }\n for (Spike item : sim.getSpikes()) {\n drawMovablePolygon(gc, item);\n }\n for (GravityWell item : sim.getGravityWells()) {\n drawGravityWell(gc, item);\n }*/\n }", "public void paintFinalScreen() {\n\t\tapp.image(end, 0, 0);\n\t}", "protected void reDraw(){\n\t\tcontentPane.revalidate();\n\t\trepaint();\n\t}", "private void updateCanvas()\r\n\t{\r\n\t\tboardCanvas.repaint();\r\n\t\tdiceCanvas.repaint();\r\n\t}", "@Override\n protected void freeUpdate()\n {\n if (raceStarted)\n dragRacePanel.updateGameImage();\n\n /* Repaint panel */\n dragRacePanel.repaint();\n }", "private void updateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateButtonActionPerformed\n try {\n ContactInfo contactInfo = new ContactInfo(nameField.getText(), phoneField.getText(), emailField.getText(), addressField.getText(), imageTitle);\n new DbConnection().edit(oldPhoneNumber, contactInfo);\n ImageSaver.saveImage(selectedFilePath, imageTitle);\n new File(\"images\\\\\" + oldImageTitle).delete();\n mainWindow.refreshList();\n this.setVisible(false);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void updateDisplay()\r\n {\r\n boardpanel.removeAll();\r\n for(int i = 0; i < 3; i++)\r\n {\r\n for(int j = 0; j < 3; j++)\r\n {\r\n if(buttons[i][j].getText().charAt(0) == ' ') {\r\n buttons[i][j].setEnabled(true);\r\n }\r\n else\r\n {\r\n buttons[i][j].setEnabled(false);\r\n }\r\n boardpanel.add(buttons[i][j]);\r\n }\r\n }\r\n }", "protected void updateDisplay() {\n BuildingAdapter adapter = new BuildingAdapter(this, R.layout.item_building, buildingList);\n setListAdapter(adapter);\n }", "private void updateImgCanvas() {\n\t\timgCanvas.updateCanvasImage(source.source);\n\t\tthis.revalidate();\n\t\tthis.repaint();\n\t}", "public void redisplay();", "public void draw() {\n\n // Make sure our drawing surface is valid or we crash\n if (ourHolder.getSurface().isValid()) {\n // Lock the canvas ready to draw\n canvas = ourHolder.lockCanvas();\n // Draw the background color\n paint.setTypeface(tf);\n canvas.drawColor(Color.rgb(178,223,219));\n paint.setColor(Color.rgb(255,255,255));\n canvas.drawRect(offsetX, offsetY, width-offsetX, (height-100)-offsetY, paint);\n // Choose the brush color for drawing\n paint.setColor(Color.argb(50,0,0,0));\n paint.setFlags(Paint.ANTI_ALIAS_FLAG);\n // Make the text a bit bigger\n paint.setTextSize(40);\n paint.setStrokeWidth(5);\n paint.setStrokeCap(Paint.Cap.ROUND);\n // Display the current fps on the screen\n canvas.drawText(\"FPS:\" + fps, 20, 40, paint);\n paint.setTextSize(400);\n if(hasTouched == true) {\n if (count < 0) {\n canvas.drawText(0 + \"\", (width / 2) - 100, height / 2, paint);\n } else if(count<=numLines) {\n canvas.drawText(count + \"\", (width / 2) - 100, height / 2, paint);\n }\n } else {\n paint.setTextSize(100);\n canvas.drawText(\"TAP TO START\", (width / 2) - 300, height / 2, paint);\n }\n paint.setColor(Color.rgb(0,150,136));\n\n paint.setColor(color);\n\n canvas.drawCircle(xPosition, yPosition, radius, paint);\n\n paint.setColor(lineColor);\n\n if(isMoving==true && hasHit == false && count>=0) {\n canvas.drawLine(initialX, initialY, endX, endY, paint);\n }\n paint.setColor(Color.rgb(103,58,183));\n\n for(int i=0; i<verts.length; i++) {\n canvas.drawVertices(Canvas.VertexMode.TRIANGLES, verts[0].length, verts[i], 0, null, 0, verticesColors, 0, null, 0, 0, new Paint());\n }\n for (int i=0; i<innerVerts.length; i++) {\n canvas.drawVertices(Canvas.VertexMode.TRIANGLES, innerVerts[0].length, innerVerts[i], 0, null, 0, verticesColors, 0, null, 0, 0, new Paint());\n }\n // Draw everything to the screen\n ourHolder.unlockCanvasAndPost(canvas);\n\n //Display size and width\n\n }\n\n }", "void reDraw();", "private void draw() {\n\t\tCanvas c = null;\n\t\ttry {\n\t\t\t// NOTE: in the LunarLander they don't have any synchronization here,\n\t\t\t// so I guess this is OK. It will return null if the holder is not ready\n\t\t\tc = mHolder.lockCanvas();\n\t\t\t\n\t\t\t// TODO this needs to synchronize on something\n\t\t\tif (c != null) {\n\t\t\t\tdoDraw(c);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (c != null) {\n\t\t\t\tmHolder.unlockCanvasAndPost(c);\n\t\t\t}\n\t\t}\n\t}", "public void clear() { drawData.clear(); }", "void clear() {\n\t\tthis.theScreen.setColor(Preferences.COLOR_BACKGROUND);\n\t\tthis.theScreen.fillRect(0, 0, this.width, this.height);\n\t\tthis.theScreen.setColor(Preferences.TITLE_COLOR);\n\t\tthis.theScreen.drawRect(0, 0, this.width - 1,\n\t\t\t\tPreferences.GAMEBOARDHEIGHT - 1);\n\t}", "private void drawImages() {\n\t\t\r\n\t}", "public void draw(float delta) {\n\t\tcanvas.clear();\n\t\tcanvas.begin();\n\t\tcw = canvas.getWidth();\n\t\tch = canvas.getHeight();\n\t\tfor (int i = -5; i < 5; i++) {\n\t\t\tfor (int j = -5; j < 5; j++) {\n\t\t\t\tcanvas.draw(getBackground(dayTime), Color.WHITE, cw*i * 2, ch*j * 2, cw * 2, ch * 2);\n\t\t\t\tif(dayTime == 0 || dayTime == 1){\n\t\t\t\t\tcanvas.draw(getBackground(dayTime + 1), levelAlpha, cw*i * 2, ch*j * 2, cw * 2, ch * 2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcanvas.end();\n\t\tif (walls.size() > 0){ \n\t\t\tfor (ArrayList<Float> wall : walls) canvas.drawPath(wall);\n\t\t}\n\t\tcanvas.begin();\n\t\t//\t\tcanvas.draw(background, Color.WHITE, 0, 0, canvas.getWidth(), canvas.getHeight());\n\t\t//canvas.draw(rocks, Color.WHITE, 0, 0, canvas.getWidth(), canvas.getHeight());\n\t\t\n\t\t\n//\t\tfor (ArrayList<Float> wall : walls) canvas.drawPath(wall);\n\t\t\n\t\tfor(Obstacle obj : objects) {\n\t\t\tobj.draw(canvas);\n\t\t}\n\t\t\n\n\t\tfor (int i = -5; i < 5; i++) {\n\t\t\tfor (int j = -5; j < 5; j++) {\n\t\t\t\tcanvas.draw(overlay, referenceC, cw*i, ch*j, cw, ch);\n\t\t\t}\n\t\t}\n\n\t\tcanvas.end();\n\n\t\tif (debug) {\n\t\t\tcanvas.beginDebug();\n\t\t\tfor(Obstacle obj : objects) {\n\t\t\t\tobj.drawDebug(canvas);\n\t\t\t}\n\t\t\tcanvas.endDebug();\n\t\t}\n\n\n\n//\t\t// Final message\n//\t\tif (complete && !failed) {\n//\t\t\tdisplayFont.setColor(Color.BLACK);\n//\t\t\tcanvas.begin(); // DO NOT SCALE\n//\t\t\tcanvas.drawTextCentered(\"VICTORY!\", displayFont, 0.0f);\n//\t\t\tcanvas.end();\n//\t\t\tdisplayFont.setColor(Color.BLACK);\n//\t\t} else if (failed) {\n//\t\t\tdisplayFont.setColor(Color.RED);\n//\t\t\tcanvas.begin(); // DO NOT SCALE\n//\t\t\tcanvas.drawTextCentered(\"FAILURE!\", displayFont, 0.0f);\n//\t\t\tcanvas.end();\n//\t\t}\n\t}", "public void partialRedraw()\r\n\t{\r\n\t\tg.clearRect(0,0,NumerateGame.WINDOW_X,NumerateGame.WINDOW_Y);\r\n\t}", "private void renewPreview() {\r\n\t\tint start = 0;\r\n\t\tsurface.clear();\r\n\t\tfor (start = 0; start < myHistoryManager.historys.size(); start++) {\r\n\t\t\tAbstractHistory history = myHistoryManager.historys.get(start);\r\n\t\t\tif (history.getType() == \"AddHistory\") {\r\n\t\t\t\tPoint endPos = ((AddHistory) history).endPos;\r\n\t\t\t\tMyColor pathColor = ((AddHistory) history).pathColor;\r\n\t\t\t\tstrokeSize = ((AddHistory) history).strokeSize;\r\n\t\t\t\tdouble x = endPos.getVector2().getX();\r\n\t\t\t\tdouble y = endPos.getVector2().getY();\r\n\r\n\t\t\t\tif (strokePointCount == 1) {\r\n\t\t\t\t\t/* set stroke color, size, and shadow */\r\n\t\t\t\t\tcanvas_context.setStrokeStyle(pathColor.getColorCode());\r\n\t\t\t\t\tcanvas_context.setFillStyle(pathColor.getColorCode());\r\n\t\t\t\t\tcanvas_context.setLineWidth(strokeSize);\r\n\t\t\t\t\tcanvas_context.setLineCap(LineCap.ROUND);\r\n\t\t\t\t\tcanvas_context.setLineJoin(LineJoin.ROUND);\r\n\t\t\t\t\tcanvas_context.stroke();\r\n\t\t\t\t\tcanvas_context.beginPath();\r\n\t\t\t\t\tcanvas_context.moveTo(x, y);\r\n\t\t\t\t}\r\n\t\t\t\tcanvas_context.lineTo(x, y);\r\n\t\t\t\tstrokePointCount++;\r\n\t\t\t\t\r\n\t\t\t} else if (history.getType() == \"PathHeadHistory\") {\r\n\t\t\t\tstrokePointCount = 0; \r\n\t\t\t\tstrokePointCount++;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tcanvas_context.stroke();\r\n\t\t\r\n\t}", "private void render() {\n\n // Clear the whole screen\n gc.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\n\n // Draw the background image\n gc.drawImage(curMap.getMap(), 0,0, canvas.getWidth(), canvas.getHeight());\n\n // Draw Paths\n for(DrawPath p : pathMap.values()) {\n p.draw(gc);\n }\n\n // Draw all of the lines and edges\n\n // Lines\n for(Line l : lineMap.values()) {\n l.draw(gc);\n }\n\n // Points\n for(Point p : pointMap.values()) {\n p.draw(gc);\n }\n\n // Images\n for(Img i : imgMap.values()) {\n i.draw(gc);\n }\n\n // Text\n for(Text t : textMap.values()) {\n t.draw(gc);\n }\n }", "public void refresh() {\n\t\tdisp.refresh();\n\t\tdisp.repaint();\n\t}", "public void update(){\r\n\t\tupdateTurnLabel();\r\n\t\tupdateCanvas();\r\n\t}", "public void update()\n {\n for (Container container : containers)\n container.update(false);\n\n Gui.update(BanksGUI.class);\n Gui.update(BankGUI.class);\n Gui.update(ItemsGroupsGUI.class);\n }", "public void refresh() {\n\t\tdrawingPanel.repaint();\n\t}", "private void update()\n {\n\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n //System.out.println(\"UPDATE\");\n updateHumanPlayerMoney();\n updateListViewDoctorItems();\n updateListViewHospitalItems();\n updateListViewLogWindow();\n updateListViewComputerPlayer();\n load_figure();\n updateComputerPlayerMoney();\n }\n });\n }", "public void clearAllGraphics()\r\n {\r\n graphics.clear();\r\n fullExtent = null;\r\n }", "private void update() {\n setPieceType();\n initBackground(pieceIndex);\n }", "private void draw() {\n if (surfaceHolder.getSurface().isValid()) {\n //lock the canvas\n canvas = surfaceHolder.lockCanvas();\n //set background colour\n canvas.drawColor(Color.BLACK);\n //draw stars\n paint.setColor(Color.WHITE);\n starManager.draw(this.canvas, this.paint);\n //draw player\n player.draw(this.canvas, this.paint);\n //draw enemies\n enemyManager.draw(this.canvas, this.paint);\n //draw asteroids\n asteroidManager.draw(this.canvas, this.paint);\n\n //draw the score as well\n paint.setTextSize(100);\n paint.setColor(Color.WHITE);\n canvas.drawText(\"\" + Constants.SCORE, 50, paint.descent() - paint.ascent(), paint);\n\n //if game is over\n if (Constants.GAME_OVER) {\n paint.setTextSize(100);\n paint.setTextAlign(Paint.Align.CENTER);\n paint.setColor(Color.WHITE);\n\n //tell the player\n int yPos = (int) ((canvas.getHeight() / 2) - ((paint.descent() + paint.ascent()) / 2));\n canvas.drawText(\"Game over\", canvas.getWidth() / 2, yPos, paint);\n\n paint.setTextSize(50);\n yPos = (int) ((canvas.getHeight() - 2 * paint.descent()) - ((paint.descent() + paint.ascent()) / 2));\n canvas.drawText(\"Tap anywhere to return to main menu...\", canvas.getWidth() / 2, yPos, paint);\n }\n //unlock canvas\n surfaceHolder.unlockCanvasAndPost(canvas);\n }\n }", "void computeDrawing() {\n if (dirtyD) {\n filling = modelRoot.getCDraw().getFilling(this);\n dirtyBufF = true;\n tooltip = modelRoot.getCDraw().getTooltip(this);\n dirtyBufT = true;\n title = modelRoot.getCDraw().getTitle(this);\n dirtyBufTitle = true;\n colorTitle = modelRoot.getCDraw().getTitleColor(this);\n dirtyBufCT = true;\n modelRoot.decrementNumberOfDirtyDNodes();\n dirtyD = false;\n }\n }", "private void reloadCanvas() {\n reloadCanvas(1f);\n }", "public void updateScreen(int width, int height) {\n\t\tthis.viewport.updateScreen(width, height);\n\t\t// then, let the objects resettle\n\t\tfor(DrawableObject obj:this.objects) {\n\t\t\tobj.updateScreen(width, height);\n\t\t}\n\t}", "public void update() {\n\tfireContentsChanged(this, 0, getSize());\n }", "protected void updateWidgets() {\n if (!isVisible()) {\n return;\n }\n if (myTopPanel != null) {\n // if we have a top panel, then we have a grid display there\n boolean gridOn = viewer.getGridVisible();\n GLGridPlane grid = viewer.getGrid();\n if ((myGridDisplay != null) != gridOn) {\n if (gridOn) {\n myGridDisplay =\n GridDisplay.createAndAdd (\n grid, myTopPanel, myGridDisplayIndex);\n }\n else {\n GridDisplay.removeAndDispose (\n myGridDisplay, myTopPanel, myGridDisplayIndex);\n myGridDisplay = null;\n }\n }\n if (myGridDisplay != null) {\n myGridDisplay.updateWidgets();\n }\n }\n }", "public void clear() {\r\n\t\t// Find the last Style commands\r\n\t\tColorCommand lastColorCommand = null;\r\n\t\tLineWidthCommand lastLineWidthCommand = null;\r\n\t\tfor (int i = 0; i < this.commands.size(); i++) {\r\n\t\t\tif (this.commands.get(i) instanceof ColorCommand) {\r\n\t\t\t\tlastColorCommand = (ColorCommand) this.commands.get(i);\r\n\t\t\t}\r\n\t\t\telse if (this.commands.get(i) instanceof LineWidthCommand) {\r\n\t\t\t\tlastLineWidthCommand = (LineWidthCommand) this.commands.get(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Clear the canvas\r\n\t\tthis.commands.clear();\r\n\t\t\r\n\t\t// Add back last commands\r\n\t\tif (lastColorCommand != null) {\r\n\t\t\tthis.addDrawingCommand(lastColorCommand);\r\n\t\t}\r\n\t\tif (lastLineWidthCommand != null) {\r\n\t\t\tthis.addDrawingCommand(lastLineWidthCommand);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// Notify\r\n\t\tthis.setChanged();\r\n\t\tthis.notifyObservers();\r\n\t}", "private void refreshListContent() {\n\t\t//remove any label not associated with the given card, so the list reflects\n\t\t// only labels associated with all cards \n\t\tArrayList<String> labels = Card.removeStringsFromList(\n\t\t\t\tnew ArrayList<String>(cards[0].labels), \n\t\t\t\tCard.getAutoLabels());\n\t\tArrayList<String> toRemove = new ArrayList<String>();\n\t\tfor( Card c : cards ){\n\t\t\ttoRemove.clear();\n\t\t\tfor( String s : labels ){\n\t\t\t\tif( !c.labels.contains(s) )\n\t\t\t\t\ttoRemove.add(s);\n\t\t\t}\n\t\t\tlabels.removeAll(toRemove);\n\t\t\tif( labels.isEmpty() ) break;\n\t\t}\n\t\t\n\t\t//create prototype cell\n\t\tString longest = \"\";\n\t\tfor( String s : labels ) if( s.length() > longest.length() ) longest = s;\n\t\tlabelsList.setPrototypeCellValue(longest + \"WWW\"); //add some buffer room for readability\n\t\t\n\t\tlabelsList.setListData(labels.toArray(new String[0]));\n\t\tArrayList<String> remainingLabels = Card.removeStringsFromList(\n\t\t\t\tnew ArrayList<String>(Arrays.asList(dataManager.getLabels())), \n\t\t\t\tCard.getAutoLabels());\n\t\tremainingLabels.remove(Card.ALL);\n\t\tremainingLabels.removeAll(labels);\n\t\tnewLabelBox.removeAllItems();\n\t\tCollections.sort(remainingLabels);\n\t\tfor( String label : remainingLabels ){\n\t\t\tnewLabelBox.addItem(label);\n\t\t}\n\t}", "public void update(){\n infoBar = new GreenfootImage (960, 50);\n infoBar.setFont(textFont);\n infoBar.setColor(textColor);\n String output = (\"Trees: \" + numTrees + \" Bushes: \" + numBushes + \" Prey: \" + numPrey + \" Predators: \" + numPredators);\n\n //centres the output on the bar.\n int centre = (960/2) - ((output.length() * 14)/2);\n\n infoBar.drawString(output, centre, 22); //draw the bar.\n this.setImage(infoBar);\n }", "public void refreshAll() {\n\t\tdrawingPanel.repaint();\n\t}", "void drawBuilding() {\r\n\t\tgc.setFill(Color.BEIGE);\r\n\t\tgc.fillRect(0, 0, theBuilding.getXSize(), theBuilding.getYSize()); // clear the canvas\r\n\t\ttheBuilding.showBuilding(this); // draw all items\r\n\r\n\t\tString s = theBuilding.toString();\r\n\t\trtPane.getChildren().clear(); // clear rtpane\r\n\t\tLabel l = new Label(s); // turn string to label\r\n\t\trtPane.getChildren().add(l); // add label\r\n\r\n\t}", "public void draw() {\n //Grey background, which removes the tails of the moving elements\n background(0, 0, 0);\n //Running the update function in the environment class, updating the positions of stuff in environment\n //update function is a collection of the methods needing to be updated\n if(stateOfProgram == 0) { startTheProgram.update(); }\n if(stateOfProgram == 1) {\n theEnvironment.update();\n //update function is a collection of the methods needing to be updated\n //Running the update function in the Population class, updating the positions and states of the rabbits.\n entitiesOfRabbits.update();\n entitiesOfGrass.update();\n entitiesOfFoxes.update();\n\n entitiesOfRabbits.display();\n entitiesOfGrass.display();\n entitiesOfFoxes.display();\n openGraph.update();\n }\n }", "void updateView () {\n updateScore();\n board.clearTemp();\n drawGhostToBoard();\n drawCurrentToTemp();\n view.setBlocks(board.getCombined());\n view.repaint();\n }", "private void finalScreen() {\r\n\t\tdisplay.setLegend(GAME_OVER);\r\n\t\tdisplay.removeKeyListener(this);\r\n\t}", "public void run() {\n\n\t\ttry {\n\t\t\tDisplay.setDisplayMode(new DisplayMode(windowWidth, windowHeight));\n\t\t\tDisplay.setTitle(TITLE);\n\t\t\tDisplay.create();\n\t\t} catch (LWJGLException e) {\n\t\t\tSystem.err.println(\"Error: Failed to create display\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(0);\n\t\t}\n\n\t\t/*\n\t\t * Initialize LWJGL and OpenGL\n\t\t */\n\t\t{\n\t\t\tGL11.glViewport(0, 0, windowWidth, windowHeight);\n\t\t\tGL11.glEnable(GL11.GL_DEPTH_TEST);\n\t\t\tGL11.glDepthFunc(GL11.GL_LEQUAL);\n\t\t\tGL11.glShadeModel(GL11.GL_SMOOTH);\n\t\t\tGL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);\n\t\t\tGL11.glEnable(GL11.GL_BLEND);\n\t\t\tGL11.glAlphaFunc(GL11.GL_GREATER, 0.1f);\n\t\t\t// GL11.glEnable(GL11.GL_ALPHA_TEST);\n\t\t\tGL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST);\n\t\t\tGL11.glClearColor(0.0f, 0.0f, 0.0f, 1f);\n\t\t}\n\n\t\ttry {\n\t\t\twhile (!(Display.isCloseRequested() || Keyboard.isKeyDown(Keyboard.KEY_Q))) {\n\t\t\t\t// Don't eat everything!!!\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(16);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tsetCamera();\n\n\t\t\t\t/*\n\t\t\t\t * Draw Code\n\t\t\t\t */\n\n\t\t\t\tsynchronized (model.drawableObjects) {\n\t\t\t\t\tfor (Drawable drawable : model.drawableObjects)\n\t\t\t\t\t\tdrawable.draw();\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * End draw code\n\t\t\t\t */\n\n\t\t\t\tDisplay.update();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Uncaught exception in View main loop: \" + e.getMessage()\n\t\t\t\t\t+ \"\\nCleaning up and exiting.\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t/*\n\t\t * Clean up\n\t\t */\n\n\t\tmodel.endGame();\n\t\tcontroller.endGame();\n\t\tDisplay.destroy();\n\t}", "private void draw() {\n model.tick();\n\n List<Entity> entities = model.getCurrentLevel().getEntities();\n\n for (EntityView entityView: entityViews) {\n entityView.markForDelete();\n }\n\n double heroXPos = model.getCurrentLevel().getHeroX();\n heroXPos -= xViewportOffset;\n\n if (heroXPos < VIEWPORT_MARGIN) {\n if (xViewportOffset >= 0) {\n xViewportOffset -= VIEWPORT_MARGIN - heroXPos;\n if (xViewportOffset < 0) {\n xViewportOffset = 0;\n }\n }\n } else if (heroXPos > width - VIEWPORT_MARGIN) {\n xViewportOffset += heroXPos - (width - VIEWPORT_MARGIN);\n }\n\n backgroundDrawer.update(xViewportOffset);\n\n for (Entity entity: entities) {\n boolean notFound = true;\n for (EntityView view: entityViews) {\n if (view.matchesEntity(entity)) {\n notFound = false;\n view.update(xViewportOffset);\n break;\n }\n }\n if (notFound) {\n EntityView entityView = new EntityViewImpl(entity);\n entityViews.add(entityView);\n pane.getChildren().add(entityView.getNode());\n }\n }\n\n for (EntityView entityView: entityViews) {\n if (entityView.isMarkedForDelete()) {\n pane.getChildren().remove(entityView.getNode());\n }\n }\n entityViews.removeIf(EntityView::isMarkedForDelete);\n\n if (model.heroDead()) {\n try {\n java.util.concurrent.TimeUnit.SECONDS.sleep(1);\n } catch (Exception e) {\n e.printStackTrace();\n }\n model.restartLevel();\n }\n if (model.finish()) {\n Text finished = new Text(\"F I N I S H E D !\");\n finished.setFont(new Font(50));\n finished.setX(model.getCurrentLevel().getWidth()/2-150);\n finished.setY(model.getCurrentLevel().getHeight()/2);\n pane.getChildren().add(finished);\n } else if (model.gameOver()) {\n Text finished = new Text(\"G A M E O V E R !\");\n finished.setFont(new Font(50));\n finished.setX(model.getCurrentLevel().getWidth()/2-200);\n finished.setY(model.getCurrentLevel().getHeight()/2);\n pane.getChildren().add(finished);\n\n lives.setText(\"Lives: \" + model.getLives());\n lives.setFont(new Font(20));\n lives.setX(width-100);\n lives.setY(30);\n\n } else {\n elapsedTime = (new Date()).getTime() - model.getStartTime();\n elapsedTime = elapsedTime/1000;\n time.setText(\"Time: \" + elapsedTime);\n time.setFont(new Font(20));\n time.setX(30);\n time.setY(30);\n lives.setText(\"Lives: \" + model.getLives());\n lives.setFont(new Font(20));\n lives.setX(width-100);\n lives.setY(30);\n }\n\n\n\n\n\n }" ]
[ "0.70094144", "0.68642604", "0.6760239", "0.670778", "0.665986", "0.6511137", "0.6437702", "0.63854635", "0.613584", "0.6074471", "0.597898", "0.59543735", "0.59381616", "0.58654433", "0.58524835", "0.5844734", "0.5828583", "0.5785964", "0.57823545", "0.575358", "0.5746607", "0.57286626", "0.5706667", "0.56903934", "0.56601226", "0.5641031", "0.5629973", "0.5607801", "0.5607473", "0.5601817", "0.559357", "0.5578833", "0.557439", "0.55715686", "0.55708694", "0.55650544", "0.55557674", "0.5551944", "0.5543646", "0.5538488", "0.55074143", "0.54903257", "0.5488513", "0.54831123", "0.5479426", "0.5474723", "0.5461303", "0.54507875", "0.5450134", "0.54493314", "0.54489785", "0.5446719", "0.5430968", "0.5423172", "0.5416388", "0.5395684", "0.53948855", "0.5378317", "0.53683513", "0.53648376", "0.53491974", "0.53486836", "0.5346515", "0.53453434", "0.5337308", "0.5331515", "0.5327509", "0.5311887", "0.53055274", "0.530388", "0.530321", "0.5301961", "0.5288549", "0.52851635", "0.52784353", "0.527393", "0.5271405", "0.52618957", "0.5261277", "0.52608573", "0.5255361", "0.5253197", "0.5247806", "0.5236007", "0.522713", "0.5225598", "0.5212502", "0.5202622", "0.5202158", "0.52019405", "0.5199488", "0.51994157", "0.519869", "0.519468", "0.5189349", "0.5186065", "0.5183042", "0.5181477", "0.51737064", "0.51728773" ]
0.612605
9
redraws the entire graph each time
private void redrawGraphs(int k, int i) { double y = 0; if (nse.getRank(k) == 0) { y = getHeight() - GRAPH_MARGIN_SIZE; } else { y = (getHeight() - 2 * GRAPH_MARGIN_SIZE) * nse.getRank(k) / (double) MAX_RANK + GRAPH_MARGIN_SIZE; } redrawLines(k, y, i); redrawTitles(i, k, y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void drawGraph(){\n this.post(new Runnable(){\n @Override\n public void run(){\n removeAllSeries();\n addSeries(xySeries);\n addSeries(currentPoint);\n //addSeries(currentPoint);\n }\n });\n }", "public void redraw()\r\n\t{\r\n\t\tif (needsCompleteRedraw)\r\n\t\t{\r\n\t\t\tcompleteRedraw();\r\n\t\t\tneedsCompleteRedraw = false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tpartialRedraw();\r\n\t\t}\r\n\t}", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawBackGround();\r\n\t\tdrawGraph();\r\n\t}", "@Override\n\tpublic void redraw() {\n\t\t\n\t}", "public void update() {\n\t\tremoveAll();\n\t\tdrawGraph();\n\t\tplotEntries();\n\t}", "public void refreshGraph()\n {\n graph.getViewport().setMinX(0);\n graph.removeAllSeries();\n for(CustomPair<String, CustomPair<Integer, Integer>> can:cans)\n {\n series.get(can.getKey()).resetData(new DataPoint[]{});\n }\n initGraph(graph);\n graphViewEditText.setText(\"\");\n }", "public void graphRepaint() {\r\n \t\tgraph.repaint();\r\n \t}", "public void refresh() {\n\t\tdrawingPanel.repaint();\n\t}", "public void repaintGraph() {\r\n this.repaint();\r\n ((GraphBuilder) getFrameParent()).getMiniMap().repaint();\r\n }", "public void draw()\r\n\t\t{\r\n\t\tfor(PanelStationMeteo graph: graphList)\r\n\t\t\t{\r\n\t\t\tgraph.repaint();\r\n\t\t\t}\r\n\t\t}", "protected void reDraw(){\n\t\tcontentPane.revalidate();\n\t\trepaint();\n\t}", "public void refreshGraph() {\n\n // Get all the times\n double[] times = dataSet.getTimes();\n\n int numPointsToDraw = (times.length > GRAPH_MAX_POINTS)? GRAPH_MAX_POINTS: times.length;\n\n // Store new points\n DataPoint[] freshPoints = new DataPoint[numPointsToDraw];\n // String for title of graph\n final int titleString;\n // String for the y-axis of graph\n final int axisLabel;\n\n // Calculate which points to draw\n int firstPointDrawn = (times.length-GRAPH_MAX_POINTS>0)?\n times.length-GRAPH_MAX_POINTS:\n 0;\n\n // if the switch is to the right\n if(velAccelSwitch.isChecked()) {\n // Get all the accelerations\n double[] accels = dataSet.getAccelerations();\n // Add the relevant accelerations to the \"to be drawn\" array\n for (int i = 0; i < numPointsToDraw; i++) {\n freshPoints[i] = new DataPoint(\n // / If the setting tells it to be in hours, divide by 3600\n (setting.isInHours())?\n times[i+firstPointDrawn]/3600:\n times[i+firstPointDrawn], accels[i+firstPointDrawn]);\n }\n // Set the graph title\n titleString = R.string.at_graph_label;\n axisLabel = R.string.acceleration_axis_label;\n } else {\n // Get all the velocities\n double[] velocities = dataSet.getSpeeds();\n // Add the relevant velocities to the \"to be drawn\" array\n for (int i = 0; i < numPointsToDraw; i++) {\n freshPoints[i] = new DataPoint(\n // If the setting tells it to be in hours, divide by 3600\n (setting.isInHours())?\n times[i+firstPointDrawn]/3600:\n times[i+firstPointDrawn],\n // If the setting tells it to be in km/h, multiply by 3.6\n (setting.isInKMPerH())?\n velocities[i+firstPointDrawn]*3.6:\n velocities[i+firstPointDrawn]);\n }\n // Set the graph title\n titleString = R.string.vt_graph_label;\n axisLabel = (setting.isInKMPerH())?\n R.string.velocity_axis_label_kmh:\n R.string.velocity_axis_label_ms;\n }\n\n // swap out the old DataPoints with the new ones\n points.resetData(freshPoints);\n // if there is data, stretch graph to fit it\n if (times.length-1>0) {\n // If the setting is on hours, stretch graph axises accordingly\n graphView.getViewport().setMinX((times[times.length-1] - GRAPH_TIME_RANGE)\n /((setting.isInHours())?3600:1));\n graphView.getViewport().setMaxX(times[times.length-1]\n /((setting.isInHours())?3600:1));\n }\n\n // Update elements of the UI\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n DecimalFormat df = new DecimalFormat(\"#.00\");\n\n // Set graph title\n graphTitle.setText(titleString);\n // Set max velocity\n maxVelocityView.setText(getString(R.string.max_velocity) + \":\\t\\t\\t\\t\\t\\t\\t\\t\" +\n df.format(dataSet.getMaxSpeed()) + \" m/s\");\n // Set max acceleration\n maxAccelerationView.setText(getString(R.string.max_acceleration) + \":\\t\\t\\t\" +\n df.format(dataSet.getMaxAcceleration()) + \" m/s\" + '\\u00B2');\n // Set time elapsed\n timeElapsedView.setText(getString(R.string.time_elapsed) + \":\\t\\t\\t\\t\\t\\t\\t\\t\" +\n df.format(dataSet.getTimeElapsedSeconds()) + \" s\");\n yAxisView.setText(axisLabel);\n xAxisView.setText((setting.isInHours())?\n R.string.time_axis_label_h:\n R.string.time_axis_label_s);\n }\n });\n\n }", "public void refreshAll() {\n\t\tdrawingPanel.repaint();\n\t}", "public void redraw(Data data)\n {\n outputHelper.redraw(data);\n }", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawGraph();\r\n\t\t\r\n\t\tfor (int i = 0; i < entryGraph.size(); i++) {\r\n\t\t\tdrawEntry(entryGraph.get(i), i);\r\n\t\t}\r\n\t}", "private void forceRedraw(){\n postInvalidate();\n }", "void reDraw();", "@Override\r\n\tpublic void update(Graphics g) {\r\n\t\t// S*ystem.out.println(\"Graph.update\");\r\n\t\t// paint(g);\r\n\t\t// super.update(g);\r\n\t}", "public void completeRedraw()\r\n\t{\r\n\t\tg = (Graphics2D) s.getDrawGraphics();\r\n\t}", "public void refresh() {\n\t\tthis.repaint();\n\t}", "private void drawGraph() {\n // you can show warning messages now\n imrGuiBean.showWarningMessages(true);\n addGraphPanel();\n setButtonsEnable(true);\n }", "public void redraw() {\n\t\timgDisplay = null;\n\t\trepaint();\n\t}", "public void reloadContents(boolean doAnim)\n{\n _legend.reloadContents();\n _chartArea.reactivate();\n if(doAnim) _chartArea.animate();\n _yaxis.repaint();\n _xaxis.repaint();\n}", "public void partialRedraw()\r\n\t{\r\n\t\tg.clearRect(0,0,NumerateGame.WINDOW_X,NumerateGame.WINDOW_Y);\r\n\t}", "public void refresh() {\n\t\tdisp.refresh();\n\t\tdisp.repaint();\n\t}", "public void requestRedraw() {\n\n this.getParent().repaint();\n\n }", "private void reloadCanvas() {\n reloadCanvas(1f);\n }", "public void repaint() {\n\n\t}", "public void redraw() {\n if (this.canDraw())\n this.getParent().handleChildRedraw(this, \n 0, 0, this.getWidth(), this.getHeight());\n }", "public void updateGraph(){\n int cont=contador;\n eliminar(0);\n construir(cont);\n }", "void resetPlot();", "private void repaint() {\n\t\tclear();\n\t\tfor (PR1Model.Shape c : m.drawDataProperty()) {\n\t\t\tif(!c.getText().equals(defaultshape))\n\t\t\t\tdrawShape(c, false);\n\t\t}\n\t\tif (getSelection() != null) {\n\t\t\tdrawShape(getSelection(), true);\n\t\t}\n\t}", "private void redrawLines()\n {\n for(int i =0; i<currentRide;i++)\n {\n rides[i].moveTogether(650,60 + 40*i);//move all elemetnts of ride lines\n \n }\n }", "@Override\n protected void refreshVisuals() {\n getFigure().updateLabels();\n }", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawGrid();\r\n\t\tplotDecades();\r\n\t\tgetEntries();\r\n\t}", "private void refresh(final boolean forceRebuild) {\n Runnable refreshRunnable = new Runnable() {\r\n public void run() {\r\n boolean changesExist = refreshSnapshotsForChangedSeries(forceRebuild);\r\n // System.out.println(\"Changes \" + changesExist);\r\n if ( changesExist ) {\r\n //fire the jfreechart change\r\n seriesChanged(new SeriesChangeEvent(this));\r\n }\r\n }\r\n };\r\n \r\n if (! SwingUtilities.isEventDispatchThread() && useSwingThread) {\r\n SwingUtilities.invokeLater(refreshRunnable);\r\n } else {\r\n refreshRunnable.run();\r\n }\r\n \r\n \r\n }", "public void redraw() {\n\t\tif(this.getGraphics() != null){\n\t\t\tthis.getGraphics().drawImage(imageBuffer, 0, 0, this); // Swap\n\t\t}\n\t}", "public void refresh()\n {\n this.invalidate();\n this.validate();\n this.repaint();\n }", "public void repaint() {}", "public void draw() {\n\t\tsuper.repaint();\n\t}", "@Override\r\n public void repaint() {\r\n }", "void flushDraw() {\n dirtyD = true;\n modelRoot.incrementNumberOfDirtyDNodes();\n }", "@Override\n public void update(Graphics g) {\n paint(g);\n }", "public void update(Graphics g){\n paint (g);\r\n \r\n }", "private void updateGraph() {\n if (centerBox.getChildren().size() > 0) {\n graphPane = new Pane();\n graphPane.setPrefSize(500, 500);\n centerBox.getChildren().set(0, this.drawGraph());\n } else {\n graphPane = new Pane();\n graphPane.setPrefSize(500, 500);\n centerBox.getChildren().add(this.drawGraph());\n }\n }", "public void refresh() {\n\t\tgetData();\n\t\trender();\n\t}", "public void setGraph(){\r\n setDisplay(currentGraph);\r\n }", "private void resetPieChart() {\n diagramBox.getChildren().clear();\n }", "public void plot(){\n\t\tplot = true;\n\t}", "@Override \n\tpublic void update(Graphics g) \n\t{\n\t\tpaint(g); \n\t}", "private void redraw() {\r\n for (int row = 0; row < maxRows; row++) {\r\n for (int column = 0; column < maxColumns; column++) {\r\n grid[row][column].setBackground(SQUARE_COLOR);\r\n }\r\n }\r\n grid[snake[HEAD].row][snake[HEAD].column].setBackground(\r\n SNAKE_HEAD_COLOR);\r\n for (int i = 1; i < length; i++) {\r\n grid[snake[i].row][snake[i].column].setBackground(SNAKE_BODY_COLOR);\r\n }\r\n grid[powerUp.row][powerUp.column].setBackground(POWER_UP_COLOR);\r\n }", "@Override\r\n\tpublic void update() {\n\t\tthis.repaint();\r\n\t}", "@Override\r\n\tpublic void repaint() {\n\t\tsuper.repaint();\r\n\t}", "@Override\r\n\tpublic void repaint() {\n\t\tsuper.repaint();\r\n\t}", "public void update() {\r\n\t\tthis.removeAll();\r\n\t\tdrawLinesAndLabels(this.getWidth(), this.getHeight());\r\n\t\tdrawNameSurferEntries();\r\n\t}", "public void resetGraph(){\n removeAllSeries();\n removeSeries(xySeries);\n removeSeries(currentPoint);\n xySeries = new PointsGraphSeries<>();\n currentPoint = new PointsGraphSeries<>();\n initGraph();\n }", "public void updateChart(){\n for(Pair<Number,Number> p : sss.getPopulationQueue()){\n this.population.getData().add(new XYChart.Data<>(p.getKey(),p.getValue()));\n }\n for(Pair<Number,Number> p : sss.getDeathsQueue()){\n this.deaths.getData().add(new XYChart.Data<>(p.getKey(),p.getValue()));\n }\n for(Pair<Number,Number> p : sss.getInfectionsQueue()){\n this.infections.getData().add(new XYChart.Data<>(p.getKey(),p.getValue()));\n }\n for(Pair<Number,Number> p : sss.getHealsQueue()){\n this.heals.getData().add(new XYChart.Data<>(p.getKey(),p.getValue()));\n }\n sss.clearPopulationQueue();\n sss.clearDeathsQueue();\n sss.clearInfectionsQueue();\n sss.clearHealsQueue();\n }", "public void redraw() {\n\t\t// LdvInt leftButtonWidth = new LdvInt(DOM.getElementPropertyInt(_leftScrollButton.getElement(), \"offsetWidth\"));\n\t\t// LdvInt rightButtonWidth = new LdvInt(DOM.getElementPropertyInt(_rightScrollButton.getElement(), \"offsetWidth\"));\n\t\t//_scrollArea.getElement().setPropertyInt(\"left\", leftButtonWidth);\n\t\t//_scrollArea.getElement().setPropertyInt(\"right\", rightButtonWidth);\n\t\t// _mainpanel.setCellWidth(_leftScrollButton, leftButtonWidth.intToString(-1)+\"px\");\n\t\t// _mainpanel.setCellWidth(_rightScrollButton, rightButtonWidth.intToString(-1)+\"px\");\n\t}", "public void paintImmediately() {\n apparatusPanel2.paintDirtyRectanglesImmediately();\n }", "@Override\r\n\tpublic void refreshChart2() {\n\t\tString[] s = new String[categoryStrings.size()];\r\n\t\ts= categoryStrings.toArray(s);\r\n\t\tif(getChartType().equals(\"StepLineChart\")) {\r\n\t\t\tDateAxis xAxis = new DateAxis(\"time\");\r\n\t\t\tValueAxis yAxis = new SymbolAxis(\"status\", s);\r\n\t\t\tXYStepRenderer renderer = new XYStepRenderer();\r\n\t\t\tXYPlot plot = new XYPlot(chartDataset, xAxis, yAxis, renderer);\r\n\t\t\tsetChart(new JFreeChart(null, new Font(\"Tahoma\", 0, 18), plot, true));\r\n\t\t}\r\n\t\t((GridBagLayout)getMonitoringPanel().getLayout()).rowHeights[2] = getMinimumHeight();\r\n\t\tgetMonitoringPanel().setPreferredSize(new Dimension(getMinimumWhidth(), (int) Math.round(getMonitoringPanel().getPreferredSize().getHeight())));\r\n\t\tsetVisible(isVisible());\r\n\t\tgetMonitoringPanel().setVisible(isVisible());\r\n\t\tif (chartPanel != null) \r\n\t\t\tgetMonitoringPanel().remove(chartPanel);\r\n\t\tsetChartPanel(new ChartPanel(chart));\r\n\t\tgetMonitoringPanel().add(chartPanel, new GridBagConstraints(0, 2, 6, 1, 0.0, 0.0,\r\n\t\t\t\tGridBagConstraints.CENTER, GridBagConstraints.BOTH,\r\n\t\t\t\tnew Insets(0, 0, 5, 5), 0, 0));\r\n\t}", "public void redraw(double angle, double speed) {\n }", "public void update(){\n\t\tif (!VisualizerMain.selectedRun.equals(\"\")){\n\t\t\tupdateEpochNum();\n\t\t\tupdateParticles();\n\t\t\tthis.repaint();\n\t\t}\n\t\t\n\t}", "public void repaint();", "public void repaint() {\n\t\n}", "@Override\n\tpublic void repaint() {\n\t\tsuper.repaint();\n\t}", "public void redraw(Graphics g)\n {\n g.drawImage(img, (int)x, (int)y, this);\n }", "public void update(Graphics g){\n paint(g);\n }", "public void drawGraph()\n\t{\n\t\tp.rectMode(PApplet.CORNERS);\n\n\t\t//background(0);\n\t\tp.stroke(255);\n\n\t\t// draw the logarithmic averages\n\t\t//spect.forward(jingle.mix);\n\n\t\tint w = PApplet.parseInt(p.width/spect.avgSize());\n\n\t\tfor(int i = 0; i < fTimer.length; i++)\n\t\t{\n\t\t\tint xPos = i*w;\n\n\t\t\t// Draw numbers\n\t\t\tp.fill(255);\n\t\t\tp.text(i, xPos + (w/2), height2 + 20);\n\n\t\t\t// check fill for beat \n\t\t\tlong clock = System.currentTimeMillis();\n\n\t\t\tif (clock - fTimer[i] < sensitivity)\n\t\t\t{\n\t\t\t\tp.noStroke();\n\n\t\t\t\tfloat h = PApplet.map(clock - fTimer[i], 0, sensitivity, 255, 0);\n\t\t\t\tp.fill(h);\n\t\t\t\tp.ellipse(xPos, height2 + 30, 15, 15); \n\t\t\t}\n\n\t\t\tp.stroke(255);\n\t\t\tp.noFill();\n\t\t\tp.rect(xPos, height2, xPos + w, height2 - spect.getAvg(i));\n\t\t}\n\t}", "public void draw(){\n super.repaint();\n }", "private void firePlotListChanged() {\n firePlotListChanged(this, null);\n }", "@Override\n public void redraw() {\n firePropertyChange(AVKey.LAYER, null, this);\n }", "void clearButton_actionPerformed(ActionEvent e) {\n clearPlot(true);\n }", "@Override\n public void run() {\n signalPanel.clearChart();\n }", "public void drawGraph()\n\t{\n\t\tMatrixStack transformStack = new MatrixStack();\n\t\ttransformStack.getTop().mul(getWorldTransform());\n\t\tdrawSelfAndChildren(transformStack);\n\t}", "public void megarepaintImmediately() {\n paintDirtyRectanglesImmediately();\n }", "protected void refreshVisuals() {\r\n\t\trefreshBendpoints();\r\n\t\tif (getEdge().getValue())\r\n\t\t\tgetEdgeFigure().setForegroundColor(alive);\r\n\t\telse\r\n\t\t\tgetEdgeFigure().setForegroundColor(dead);\r\n\t\t//throw new NullPointerException();\r\n\t}", "@Override\n\tprotected void repaintView(ViewGraphics g) {\n\t}", "public void redraw(Mask mask);", "public void redraw(int [][] board)\n\t{\n\t\tfor(int i = 0; i < 20; ++i)\n\t\t{\n\t\t\tfor( int j = 0; j < 10; ++j)\n\t\t\t{\n\t\t\t\tswitch (board[i][j])\n\t\t\t\t{\n\t\t\t\t\t//empty\n\t\t\t\t\tcase 0:\tcolors[i][j] = Color.GRAY; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//J - shape\n\t\t\t\t\tcase 1:\tcolors[i][j] = Color.BLUE; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//Z shape\n\t\t\t\t\tcase 2:\tcolors[i][j] = Color.RED; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//L shape\n\t\t\t\t\tcase 3:\tcolors[i][j] = Color.ORANGE; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//S shape\n\t\t\t\t\tcase 4:\tcolors[i][j] = new Color(102,255,102); ;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//I shape\n\t\t\t\t\tcase 5:\tcolors[i][j] = Color.CYAN; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//O shape\n\t\t\t\t\tcase 6:\tcolors[i][j] = Color.YELLOW; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//T shape\n\t\t\t\t\tcase 7:\tcolors[i][j] = Color.PINK; \n\t\t\t\t\t\tbreak;\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tview.getInGamePanel().getBoardGamePanel().redraw(colors);\t\n\t}", "void refreshNode(ChartNode node);", "public void update(Graphics g) {\n paint(g);\n }", "public void update(Graphics g) {\n paint(g);\n }", "private void reset(){\n plotValues.clear();\n xLabels.clear();\n }", "@Override\r\n public void repaint(Object canvas) {\r\n {\r\n }\r\n\t}", "public void DrawGraphActive() {\n if (CurrentEQ == null || CurrentEQ.isEmpty()) {\n return;\n }\n StringParser parser = new StringParser();\n Equation eq = parser.ParseString(CurrentEQ);\n\n int size = (int) ((Math.max(MinX, MaxX) - Math.min(MinX, MaxX)) / Step);\n double[] points = new double[size * 2 + 2];\n int index = 0;\n for (double i = Math.min(MinX, MaxX); i <= Math.max(MinX, MaxX); i += Step) {\n points[index] = i;\n index++;\n points[index] = eq.peekAt(\"x\", i);\n index++;\n }\n LineGraph root = new LineGraph(points);\n root.raw = CurrentEQ;\n root.setIncrements(Increments);\n root.setLineColour(LineColor);\n root.SetDrawArea(DrawArea);\n root.setShowNumbers(DrawScale);\n root.setBackColor(BackColor);\n root.setCurveThickness(CurveThickness);\n Canvas.removeAll();\n Canvas.repaint();\n int h = Frame.getHeight();\n int w = Frame.getWidth();\n GraphPanel p;\n if (ForceRange) {\n p = (GraphPanel) root.drawToJPanel((int) (w * Zoom), (int) (h * Zoom),\n Math.min(MinX, MaxX),\n Math.min(MinY, MaxY),\n Math.max(MinX, MaxX),\n Math.max(MinY, MaxY));\n p.addMouseMotionListener(new MouseMovementListener(p, root, eq));\n Canvas.add(p);\n } else {\n p = (GraphPanel) root.drawToJPanel((int) (w * Zoom), (int) (h * Zoom));\n p.addMouseMotionListener(new MouseMovementListener(p, root, eq));\n Canvas.add(p);\n // Canvas.setBackground(Color.red);\n }\n\n Frame.validate();\n CenterScrollPane();\n lineGraphs.set(RootGraph, root);\n p.LineGraphs = lineGraphs;\n }", "public void updateGraphView(GraphModel graphModel) {\r\n this.graphModel = graphModel;\r\n remove(chartPanel);\r\n XYDataset dataSet = createDataSet();\r\n chart = createChart(dataSet);\r\n chartPanel = new ChartPanel(chart);\r\n add(chartPanel);\r\n setVisible(true);\r\n }", "public void updateVisuals ()\n\t{\n\t\tbrainPanel.repaint();\n\t}", "protected void onUpdateGraphPressed(View view) {\n int count = 0;\n gHistoricalPPM.removeAllSeries();\n if (spGraphType.getSelectedItem() == \"Virus\") {\n DataPoint[] dpArray = new DataPoint[selectedReport.getPrList().size()];\n for (PurityReport pr : selectedReport.getPrList()) {\n DataPoint dp = new DataPoint(pr.getMonthSubmitted(), pr.getVirusPPM());\n dpArray[count++] = dp;\n }\n LineGraphSeries<DataPoint> series = new LineGraphSeries<>(dpArray);\n gHistoricalPPM.addSeries(series);\n } else {\n DataPoint[] dpArray = new DataPoint[selectedReport.getPrList().size()];\n for (PurityReport pr : selectedReport.getPrList()) {\n DataPoint dp = new DataPoint(pr.getMonthSubmitted(), pr.getContaminantPPM());\n dpArray[count++] = dp;\n }\n LineGraphSeries<DataPoint> series = new LineGraphSeries<>(dpArray);\n gHistoricalPPM.addSeries(series);\n }\n gHistoricalPPM.getViewport().setMinX(1);\n gHistoricalPPM.getViewport().setMaxX(12);\n gHistoricalPPM.getViewport().setXAxisBoundsManual(true);\n }", "public void update(Graphics g) {\r\n paint(g);\r\n }", "public static void update(){\n\t\t\n\t\tgraphFrame.setColor(color);\n\t}", "public void togglePlot(){\n panel.removeAll();\n graphPanel.togglePlot(buttonControlPanel);\n panel.add(graphPanel, new GridBagConstraints( 0, 0, 1, 1, 1.0, 1.0\n , GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets( 0, 0, 0, 0 ), 0, 0 ));\n panel.validate();\n panel.repaint();\n }", "private void draw() {\n gsm.draw(g);\n }", "public void updateLinesAndGrid() {\n\t\tutilities.redrawAllLines(0, false);\n\t\ttableDisplay.setGrid(utilities.getOrderedWayPoints());\n\t}", "public void draw()\n {\n super.draw();\n k = 0;\n traceOK = true;\n\n // Initialize n, x0, and xn in the control panel.\n nText.setText(\" \");\n x0Text.setText(\" \");\n xnText.setText(\" \");\n\n PlotFunction plotFunction = getSelectedPlotFunction();\n\n // Create the fixed-point iteration root finder.\n finder = new FixedPointRootFinder((Function) plotFunction.getFunction());\n }", "public void draw(){\n\t\t\tint x = getPreferredSize().width/2;\n\t\t\tint y = 10;\n\t\t\tif (root() != null)\n\t\t\t\tpreOrderCell(root(), x, y, root().getColor());\n\t\t\tjgraph.getGraphLayoutCache().insert(cells.values().toArray());\n\t\t\tjgraph.getGraphLayoutCache().insert(nullnodes.toArray());\n\t\t}", "public void updateGraph(){\n\t\tgraph.update(updatePopulations(), iteration);\n\t\titeration++;\n\t}", "public void update( ) {\n\t\tdraw( );\n\t}", "public void refresh() {\n \t\tphysics.physik();\n \t\tcycleTest();\n \t}", "public void reDraw() {\n if(entityManager.getPlayerVaccines() != 0){\n vaccine[entityManager.getPlayerVaccines()-1].draw();\n }\n lifeCount[entityManager.getHealth()].draw();\n\n if(entityManager.getHealth() != prevPlayerLife)\n lifeCount[prevPlayerLife].delete();\n prevPlayerLife = entityManager.getHealth();\n\n if(prevPlayerLife == 0){\n heart.draw();\n }\n\n if(entityManager.playerWithMask()){\n mask.draw();\n } else {\n mask.delete();\n }\n }", "void refresh();" ]
[ "0.76574045", "0.75966185", "0.7585173", "0.75151235", "0.7430516", "0.74171984", "0.7383719", "0.7315702", "0.7290136", "0.71912307", "0.716823", "0.7118961", "0.7065775", "0.7049783", "0.69970477", "0.6964385", "0.6862113", "0.6854024", "0.6826746", "0.6810672", "0.67868227", "0.6771593", "0.67652506", "0.675705", "0.667403", "0.66578317", "0.665613", "0.66520035", "0.66486776", "0.65675044", "0.6567337", "0.65665054", "0.6559889", "0.65574086", "0.6545338", "0.65425694", "0.64417386", "0.642449", "0.64154106", "0.6382145", "0.63318616", "0.6325225", "0.6320277", "0.63136977", "0.63042134", "0.6298135", "0.6297013", "0.6296536", "0.62614125", "0.62347424", "0.6229368", "0.62268275", "0.6226107", "0.6226107", "0.6208406", "0.6206246", "0.6189337", "0.6179591", "0.6170844", "0.6165834", "0.6163493", "0.61562824", "0.6155417", "0.61536694", "0.6148849", "0.614769", "0.6141912", "0.61326224", "0.6124219", "0.61045796", "0.61031747", "0.60948026", "0.60833585", "0.60720414", "0.60672", "0.6063786", "0.6057801", "0.6054148", "0.6033726", "0.60270125", "0.60079837", "0.60079837", "0.6000403", "0.5993935", "0.5991521", "0.5983999", "0.5978545", "0.5974118", "0.5972494", "0.59671605", "0.5965147", "0.59647024", "0.5959781", "0.59423757", "0.5939851", "0.59234047", "0.59231585", "0.592018", "0.59150296", "0.59012747" ]
0.6664305
25
redraws the connecting lines
private void redrawLines(int k, double y, int i) { double y2 = 0; double x = getWidth() / NDECADES * k; double x2 = getWidth() / NDECADES * (k + 1); if (k != NDECADES - 1) { if (nse.getRank(k + 1) == 0) { y2 = getHeight() - GRAPH_MARGIN_SIZE; } else { y2 = (getHeight() - 2 * GRAPH_MARGIN_SIZE) * nse.getRank(k + 1) / (double) MAX_RANK + GRAPH_MARGIN_SIZE; } GLine line = new GLine(x, y, x2, y2); changeTheColor(line, i); add(line); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void redrawLines()\n {\n for(int i =0; i<currentRide;i++)\n {\n rides[i].moveTogether(650,60 + 40*i);//move all elemetnts of ride lines\n \n }\n }", "public void updateLinesAndGrid() {\n\t\tutilities.redrawAllLines(0, false);\n\t\ttableDisplay.setGrid(utilities.getOrderedWayPoints());\n\t}", "void updateGlobalLines() {\n\t\tfor (int i = 0; i < amount; i++) {\n\t\t\tif (i != selectedLine) // do not update Line if it is being dragged\n\t\t\t\t\t\t\t\t\t// (because dragging method already updates\n\t\t\t\t\t\t\t\t\t// it\n\t\t\t{\n\t\t\t\tline[i] = new Line(myParent, point[neighborPointsFromLine(i)[1]].position,\n\t\t\t\t\t\tpoint[neighborPointsFromLine(i)[0]].position, i, this);\n\t\t\t}\n\t\t}\n\t}", "public void draw()\r\n\t{\r\n\t\tsynchronized (lines)\r\n\t\t{\r\n\t\t\tfor(int i = lines.size()-1; i >= 0; i--)\r\n\t\t\t{\r\n\t\t\t\tlines.get(i).draw();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void drawLines() {\n int min = BORDER_SIZE;\n int max = PANEL_SIZE - min;\n int pos = min;\n g2.setColor(LINE_COLOR);\n for (int i = 0; i <= GUI.SIZE[1]; i++) {\n g2.setStroke(new BasicStroke(i % GUI.SIZE[0] == 0 ? 5 : 3));\n g2.drawLine(min, pos, max, pos);\n g2.drawLine(pos, min, pos, max);\n pos += CELL_SIZE;\n }\n }", "public void drawGraph(){\n this.post(new Runnable(){\n @Override\n public void run(){\n removeAllSeries();\n addSeries(xySeries);\n addSeries(currentPoint);\n //addSeries(currentPoint);\n }\n });\n }", "@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n\n if (bdhcHandler != null) {\n int[] slopes = bdhcHandler.getSelectedPlate().getSlope();\n float angle = (float) Math.atan2(slopes[indexSlope1], slopes[indexSlope2]);\n\n Graphics2D g2 = (Graphics2D) g;\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\n RenderingHints.VALUE_ANTIALIAS_ON);\n\n g.setColor(Color.magenta);\n final int angleRadius = (radius * 2) / 3;\n final int angleOffset = size / 2 - angleRadius;\n g2.setStroke(new BasicStroke(2));\n g.drawArc(angleOffset, angleOffset, 2 * angleRadius, 2 * angleRadius, 0, (int) (-(angle * 180) / Math.PI));\n\n g2.setStroke(new BasicStroke(2));\n if (frontView) {\n g.setColor(Color.red);\n g.drawLine(size / 2, size / 2, size, size / 2);\n g.setColor(Color.blue);\n g.drawLine(size / 2, size / 2, size / 2, 0);\n } else {\n g.setColor(Color.green);\n //g.drawLine(size / 2, size / 2, size, size / 2);\n g.drawLine(size / 2, size / 2, size, size / 2);\n g.setColor(Color.blue);\n g.drawLine(size / 2, size / 2, size / 2, 0);\n }\n\n int circleOffset = size / 2 - radius;\n g.setColor(Color.black);\n g2.setStroke(new BasicStroke(1));\n g.drawOval(circleOffset, circleOffset, radius * 2, radius * 2);\n\n int x = (int) (Math.cos(angle) * radius);\n int y = (int) (Math.sin(angle) * radius);\n int lineOffset = size / 2;\n g.setColor(Color.orange);\n g2.setStroke(new BasicStroke(3));\n g.drawLine(lineOffset - x, lineOffset - y, lineOffset + x, lineOffset + y);\n\n }\n\n }", "public void draw()\r\n\t\t{\r\n\t\tfor(PanelStationMeteo graph: graphList)\r\n\t\t\t{\r\n\t\t\tgraph.repaint();\r\n\t\t\t}\r\n\t\t}", "public void addLines(){\n\t\tif (controlPoints.size() == 1) return;\n\t\t\n\t\tif (lineLists.size() < controlPoints.size()-1){\n\t\t lineLists.add(new LinkedList<Line>());\n\t\t}\n\t\t\n\t\t\n\t\tint numControlLines = controlPoints.size() - 1;\n\t\t\n\t\tfor (int i = 0; i < numControlLines; i++){\n\t\t\tLine line = new Line();\n\t\t\tif (i == 0){\n\t\t\t\tline.setStroke(Color.LIGHTGRAY);\n\t\t\t\tline.setStrokeWidth(2);\n\t\t\t\tline.setVisible(showPrimaryLines);\n\t\t\t\tpane.getChildren().add(line);\n\t\t\t\tline.toBack();\n\t\t\t} else {\n\t\t\t\tdouble hue = 360 * (((i-1)%controlPoints.size())/(double)controlPoints.size());\n\t\t\t\tdouble sat = .4;\n\t\t\t\tdouble bri = .8;\n\t\t\t\tline.setStroke(Color.hsb(hue, sat, bri));\n\t\t\t\tline.setStrokeWidth(2);\n\t\t\t\tline.setVisible(showSubLines);\n\t\t\t\tpane.getChildren().add(line);\n\t\t\t}\n\t\t\tLinkedList<Line> list = lineLists.get(i);\n\t\t\tlist.add(line);\n\t\t}\n\t}", "public void eraseLines() {\n for (int i = 0; i < segments.size() - 1; i++) {\n paintLine((Point2D) (segments.elementAt(i)),\n (Point2D) (segments.elementAt(i + 1)));\n }\n }", "private void drawGraph() {\n // you can show warning messages now\n imrGuiBean.showWarningMessages(true);\n addGraphPanel();\n setButtonsEnable(true);\n }", "public void paint(Graphics g )\n {\n super.paint(g); // is no super.paint(), then lines stay on screen \n \n for ( int i=0; i<allTheShapesCount; i++ )\n {\n allTheShapes[ i ] . drawMe(g);\n }\n }", "public void updateCoords() {\n line.setLine(parent.getFullBounds().getCenter2D(), child.getFullBounds().getCenter2D());\n Rectangle2D r = line.getBounds2D();\n // adding 1 to the width and height prevents the bounds from\n // being marked as empty and is much faster than createStrokedShape()\n setBounds(r.getX(), r.getY(), r.getWidth() + 1, r.getHeight() + 1);\n invalidatePaint();\n }", "@Override\n\tpublic void redraw() {\n\t\t\n\t}", "private void drawLines()\n {\n getBackground().setColor( Color.BLACK );\n \n for( int i = 200; i < getWidth(); i += 200 )\n {\n getBackground().drawLine(i, 0, i, getHeight() );\n getBackground().drawLine(0, i, getWidth(), i);\n }\n \n Greenfoot.start();\n }", "public void draw(Graphics g) {\r\n g.drawLine(line.get(0).getX() + 4, line.get(0).getY() + 4, line.get(4).getX() + 4, line.get(4).getY() + 4);\r\n }", "public void paint( java.awt.Graphics g )\n {\n super.paint( g ); // Ord gave us this\n\n canvasWidth = canvas.getWidth(); // Update original\n canvasHeight = canvas.getHeight(); // canvas dimensions\n\n double newHLineY = hLineProportion * canvas.getHeight();\n double newVLineX = vLineProportion * canvas.getWidth();\n\n hLine.setEndPoints(0, newHLineY, canvasWidth, newHLineY);\n vLine.setEndPoints(newVLineX, 0, newVLineX, canvasHeight);\n\n hLineMoved = vLineMoved = true;\n }", "public void draw()\n {\n drawLine(x1, y1, x2, y2);\n }", "@Override\n public void draw(GraphicsContext gc){\n for(int i = 1; i < path.size(); i++) {\n Point2D from = path.get(i-1);\n Point2D to = path.get(i);\n gc.strokeLine(from.getX(), from.getY(), to.getX(), to.getY());\n }\n }", "public void recalculate(){\n\t\t\n\t\tLinkedList<Line> primaryLines = lineLists.get(0);\n\t\t\n\t\tfor (int i = 0; i < controlPoints.size()-1; i++){\n\t\t\tControlPoint current = controlPoints.get(i);\n\t\t\tControlPoint next = controlPoints.get(i+1);\n\t\t\t\n\t\t\tLine line = primaryLines.get(i);\n\t\t\t\n\t\t\tline.setStartX(current.getCenterX());\n\t\t\tline.setStartY(current.getCenterY());\n\t\t\tline.setEndX(next.getCenterX());\n\t\t\tline.setEndY(next.getCenterY());\n\t\t}\n\t}", "private void drawGrid(){\r\n\r\n\t\tdrawHorizontalLines();\r\n\t\tdrawVerticalLines();\r\n\t}", "@Override\n public void paint(Graphics g) {\n g2 = (Graphics2D) g;\n drawBackground();\n drawSquares();\n drawLines();\n gui.hint = new TreeSet<>();\n }", "public void repaint (Graphics g){\r\n g.drawLine(10,10,150,150); // Draw a line from (10,10) to (150,150)\r\n \r\n g.setColor(Color.darkGray);\r\n g.fillRect( 0 , 0 , \r\n 4000 , 4000 ); \r\n \r\n g.setColor(Color.BLACK);\r\n \r\n BufferedImage image;\r\n \r\n for(int h = 0; h < 16; h++){\r\n for(int w =0; w< 16; w++){\r\n //g.drawImage(image.getSubimage(w *16, h*16, 16, 16), 0+(32*w),0 +(32*h), 32,32,this);\r\n g.drawRect(w *32, h*32, 32, 32);\r\n \r\n if(coord.xSelected >=0){\r\n g.setColor(Color.WHITE);\r\n g.drawRect(coord.xSelected *32, coord.ySelected *32, 32, 32);\r\n g.setColor(Color.BLACK);\r\n }\r\n }\r\n }\r\n \r\n \r\n }", "@Override\n protected void onDraw(Canvas canvas) {\n // Draw the components\n Arrange();\n box.draw(canvas);\n for (Node node : nodes) {\n node.draw(canvas);\n }\n line.draw(canvas);\n invalidate(); // Force a re-draw\n }", "public void draw() {\n\t\tsuper.repaint();\n\t}", "public void listenerPaint(java.awt.Graphics g) {\n for (int i = 0; i < segments.size() - 1; i++) {\n paintLine((LatLonPoint) (segments.elementAt(i)),\n (LatLonPoint) (segments.elementAt(i + 1)),\n g);\n }\n paintRubberband(rPoint1, rPoint2, g);\n }", "protected void reDraw(){\n\t\tcontentPane.revalidate();\n\t\trepaint();\n\t}", "public void paint( Graphics g ){\n g.drawOval(-4, -4, 8, 8);\n g.drawLine(-2, 2, 2,-2);\n g.drawLine(-2,-2, 2, 2);\n }", "@Override\n\tpublic void roadChanged() {\n\t\tthis.from_x=this.from.getX();\n\t\tthis.from_y=this.from.getY();\n\t\tthis.to_x=this.to.getX();\n\t\tthis.to_y=this.to.getY();\n\t\tthis.getTopLevelAncestor().repaint();\n\t\tthis.repaint();\n//\t\tthis.getParent().repaint();\n\t}", "@Override\n\t\tpublic void paintComponent(Graphics g) {\n\t\t\tsuper.paintComponent(g);\n\t\t\tsetBackground(Color.gray);\n\n\t\t\tif (points != null) {\n\t\t\t\tPoint lastPoint = null;\n\t\t\t\tint step = 0;\n\t\t\t\tfor (Point p : points) {\n\t\t\t\t\tint shade = 255 * step / points.length;\n\t\t\t\t\tstep++;\n\t\t\t\t\tg.setColor(new Color(shade, 0, 255 - shade));\n\n\t\t\t\t\t// Draw the point, and maybe connect to the previous point\n\t\t\t\t\tif (p != null) {\n\t\t\t\t\t\tint jiggleX = (int) (jiggleFactor * Math.random() - jiggleFactor / 2);\n\t\t\t\t\t\tint jiggleY = (int) (jiggleFactor * Math.random() - jiggleFactor / 2);\n\n\t\t\t\t\t\tg.fillOval(p.x + jiggleX - diameter / 2, p.y + jiggleY\n\t\t\t\t\t\t\t\t- diameter / 2, diameter, diameter);\n\t\t\t\t\t\tif (connectTheDots) {\n\t\t\t\t\t\t\tif (lastPoint != null)\n\t\t\t\t\t\t\t\tg.drawLine(lastPoint.x, lastPoint.y, p.x, p.y);\n\t\t\t\t\t\t\tlastPoint = p;\n\t\t\t\t\t\t}\n\t\t\t\t\t} // end of drawing one point\n\t\t\t\t} // End of loop that draws all points\n\t\t\t} // end of non-null logic\n\t\t}", "public void redraw()\r\n\t{\r\n\t\tif (needsCompleteRedraw)\r\n\t\t{\r\n\t\t\tcompleteRedraw();\r\n\t\t\tneedsCompleteRedraw = false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tpartialRedraw();\r\n\t\t}\r\n\t}", "@Override\n public void paint(Graphics g1){\n\n try{\n super.paint(g1);\n\n drawSymbols_Rel( g1 );\n drawSymbols_Att( g1 );\n /**\n //==== only for test ====\n this.setComplexRelationsCoordinates(20, 28, 33, 38);\n this.setComplexRelationsCoordinates_extraEnds(400, 404);\n */\n\n drawComplexRelationship(g1);\n drawPath(g1);\n \n \n \n }catch(Exception ex){\n }\n }", "private void plotEntries() {\n\t\tfor (int i = 0; i < entries.size(); i++) {\n\t\t\tdrawLine(i);\n\t\t}\n\t}", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawBackGround();\r\n\t\tdrawGraph();\r\n\t}", "@Override\n\tprotected void paintComponent(Graphics g) {\n\t\tpainter.setColorFractions(new float[]{0.0f, 1.0f});\n\t\tpainter.setColors(new Color[]{LIGHT_BLUE, BLUE});\n\t\tfinal Rectangle r = new Rectangle(0, 0, getWidth(), getHeight());\n\t\tpainter.paint((Graphics2D) g, r);\n\n\t\t// Draw a darker line as bottom border\n\t\tg.setColor(DARK_BLUE);\n\t\tg.drawLine(0, getHeight() - 1, getWidth(), getHeight() - 1);\n\n\t\tsuper.paintComponent(g);\n\t}", "private void redraw() {\r\n for (int row = 0; row < maxRows; row++) {\r\n for (int column = 0; column < maxColumns; column++) {\r\n grid[row][column].setBackground(SQUARE_COLOR);\r\n }\r\n }\r\n grid[snake[HEAD].row][snake[HEAD].column].setBackground(\r\n SNAKE_HEAD_COLOR);\r\n for (int i = 1; i < length; i++) {\r\n grid[snake[i].row][snake[i].column].setBackground(SNAKE_BODY_COLOR);\r\n }\r\n grid[powerUp.row][powerUp.column].setBackground(POWER_UP_COLOR);\r\n }", "public void display()\n\t{\n\t\tfor(Character characher : characterAdded)\n\t\t{\t\n\t\t\tif(!characher.getIsDragging())\n\t\t\t{ \n\t\t\t\t//when dragging, the mouse has the exclusive right of control\n\t\t\t\tcharacher.x = (float)(circleX + Math.cos(Math.PI * 2 * characher.net_index/net_num) * radius);\n\t\t\t\tcharacher.y = (float)(circleY + Math.sin(Math.PI * 2 * characher.net_index/net_num) * radius);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tint lineWeight = 0;\n\t\t//draw the line between the characters on the circle\n\t\tif(characterAdded.size() > 0)\n\t\t{\n\t\t\tfor(Character characher : characterAdded)\n\t\t\t{\n\t\t\t\tfor(Character ch : characher.getTargets())\n\t\t\t\t{\n\t\t\t\t\tif(ch.net_index != -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(int i = 0; i < links.size(); i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tJSONObject tem = links.getJSONObject(i);\n\t\t\t\t\t\t\tif((tem.getInt(\"source\") == characher.index) && \n\t\t\t\t\t\t\t\t\t\t\t\t(tem.getInt(\"target\") == ch.index))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlineWeight = tem.getInt(\"value\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tparent.strokeWeight(lineWeight/4 + 1);\t\t\n\t\t\t\t\t\tparent.noFill();\n\t\t\t\t\t\tparent.stroke(0);\n\t\t\t\t\t\tparent.line(characher.x, characher.y, ch.x, ch.y);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void drawGraph() {\n\t\tthis.ig2.setColor(this.backgroundColor);\n\t\tthis.ig2.fillRect(0, 0, this.bi.getWidth(), this.bi.getHeight());\n\n\t\tthis.drawLines();\n\t\tthis.drawFonts(this.scaleStringLine * 10);\n\t\tthis.drawCurves(this.scaleStringLine * 10);\n\t}", "@Override\n\t\tpublic void paint(Graphics g) {\n\t\t\tg.setColor(Color.white);\n\t g.fillRect(0, 0, 700, 700);\n\t g.setColor(Color.black);\n\t g.drawLine(0, 700, 700, 700); // the graph lines\n\t g.drawLine(0, 0, 0, 700);\n\t g.drawLine(300, 700, 300, 690); // the tick marks\n\t g.drawLine(600, 700, 600, 690);\n\t g.drawLine(0, 400, 10, 400);\n\t g.drawLine(0, 100, 10, 100);\n\t \n\t for (int i=0; i<clusters.size(); i++) { // the points in the cluster\n\t \tcluster cl = clusters.get(i);\n\t \tg.setColor(cl.getColor());\n\t \tfor (int j=0; j<cl.getPoints().size(); j++) {\n\t \t\tpoint p = cl.getPoints().get(j);\n\t\t \tg.fillOval(p.x(), p.y(), 7, 7);\n\t \t}\n\t \t\n\t }\n\t\t}", "void updateLinks() {\n\t\tdouble x1, x2, y1, y2;\n\t\tfor(int i=0; i<links.size();i++){\n\t\t\tPNode node1 = links.get(i).getNode1();\n\t\t\tPNode node2 = links.get(i).getNode2();\n\t\t\tx1 = node1.getFullBoundsReference().getCenter2D().getX() + node1.getParent().getFullBounds().getOrigin().getX();\n\t\t\ty1 = node1.getFullBoundsReference().getCenter2D().getY() + node1.getParent().getFullBounds().getOrigin().getY();\n\t\t\tx2 = node2.getFullBoundsReference().getCenter2D().getX() + node2.getParent().getFullBounds().getOrigin().getX();\n\t\t\ty2 = node2.getFullBoundsReference().getCenter2D().getY() + node2.getParent().getFullBounds().getOrigin().getY();\n\t\t\t\n\t\t\t/*\n\t\t\tLine2D line = new Line2D.Double(x1,y1,x2,y2);\n\t\t\tlinks.get(i).getPPath().setPathTo(line);\n */\n\t\t\tsetPolyLine(links.get(i).getPPath(), (float)x1, (float)y1, (float)x2, (float)y2);\n\t\t\t}\n\t\t}", "@Action(selectedProperty = LINE_PAINTING)\r\n public void toggleLines (ActionEvent e)\r\n {\r\n }", "private void repaint() {\n\t\tclear();\n\t\tfor (PR1Model.Shape c : m.drawDataProperty()) {\n\t\t\tif(!c.getText().equals(defaultshape))\n\t\t\t\tdrawShape(c, false);\n\t\t}\n\t\tif (getSelection() != null) {\n\t\t\tdrawShape(getSelection(), true);\n\t\t}\n\t}", "@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n if (task.isFinished()) {\n int y = this.getHeight() / 2;\n g.drawLine(0, y, this.getWidth(), y);\n }\n }", "private void drawConnectorLine(final Graphics g) {\r\n if (startPort != null && startPoint != null && current != null) {\r\n g.drawLine((int) startPoint.getX(), (int) startPoint.getY(), (int) current.getX(), (int) current.getY());\r\n }\r\n }", "void dragLines() {\n\t\t// calculate the offset made by mouseDrag -- subtract beginOffsetP from\n\t\t// P\n\t\toffsetP = PVector.sub(P, beginOffsetP);\n\n\t\tfor (int i = 0; i < amount; i++)\n\t\t\tline[i].drag();\n\t}", "public void draw(Graphics2D g) {\n g.setStroke(stroke);\n g.setColor(EditorCommonSettings.getGridColor());\n g.draw(minorLinesPath);\n g.setColor(EditorCommonSettings.getGridColor().darker());\n g.draw(majorLinesPath);\n }", "protected void drawPlot()\n\t{\n \t\tfill(255);\n \t\tbeginShape();\n \t\tvertex(m_ViewCoords[0] - 1, m_ViewCoords[1] - 1);\n \t\tvertex(m_ViewCoords[2] + 1, m_ViewCoords[1] - 1);\n \t\tvertex(m_ViewCoords[2] + 1, m_ViewCoords[3] + 1);\n \t\tvertex(m_ViewCoords[0] - 1, m_ViewCoords[3] + 1);\n \t\tendShape(CLOSE);\n\t}", "public void graphRepaint() {\r\n \t\tgraph.repaint();\r\n \t}", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawGraph();\r\n\t\t\r\n\t\tfor (int i = 0; i < entryGraph.size(); i++) {\r\n\t\t\tdrawEntry(entryGraph.get(i), i);\r\n\t\t}\r\n\t}", "public void repaintGraph() {\r\n this.repaint();\r\n ((GraphBuilder) getFrameParent()).getMiniMap().repaint();\r\n }", "private void lineColor() {\n\n\t}", "public void refresh() {\n\t\tdrawingPanel.repaint();\n\t}", "public void paint( Graphics2D g2 ) {\n int numberOfRays = _drawLines.size();\n if ( isVisible() && numberOfRays > 0 ) {\n saveGraphicsState( g2 );\n\n g2.setRenderingHints( _hints );\n g2.setStroke( _stroke );\n g2.setPaint( RAY_COLOR );\n g2.transform( getNetTransform() );\n\n // Draw each of the ray lines.\n Line2D line;\n for ( int i = 0; i < numberOfRays; i++ ) {\n line = (Line2D) _drawLines.get( i );\n g2.drawLine( (int) line.getX1(), (int) line.getY1(), (int) line.getX2(), (int) line.getY2() );\n }\n\n restoreGraphicsState();\n }\n }", "private void redrawGraphs(int k, int i) {\n\t\tdouble y = 0;\r\n\t\tif (nse.getRank(k) == 0) {\r\n\t\t\ty = getHeight() - GRAPH_MARGIN_SIZE;\r\n\t\t} else {\r\n\t\t\ty = (getHeight() - 2 * GRAPH_MARGIN_SIZE) * nse.getRank(k) / (double) MAX_RANK + GRAPH_MARGIN_SIZE;\r\n\t\t}\r\n\t\tredrawLines(k, y, i);\r\n\t\tredrawTitles(i, k, y);\r\n\t}", "public void setLinePainting (boolean value)\r\n {\r\n boolean oldValue = constants.linePainting.getValue();\r\n constants.linePainting.setValue(value);\r\n firePropertyChange(LINE_PAINTING, oldValue, value);\r\n }", "@Override\n public void draw(Graphics g) {\n g.setColor(Color.BLACK);\n g.drawLine(startingPoint.x, startingPoint.y, endingPoint.x, endingPoint.y);\n }", "@Override\n protected void onDraw(Canvas canvas) {\n for (Line line : pointersTable.values()) {\n // Set the line's color.\n paint.setColor(line.Color);\n\n // Draw the line on the stored coordinates of the touch events.\n canvas.drawLine(line.LineStart.x, line.LineStart.y, line.LineEnd.x, line.LineEnd.y, paint);\n }\n }", "private void connectAll()\n {\n\t\tint i = 0;\n\t\tint j = 1;\n\t\twhile (i < getNodes().size()) {\n\t\t\twhile (j < getNodes().size()) {\n\t\t\t\tLineEdge l = new LineEdge(false);\n\t\t\t\tl.setStart(getNodes().get(i));\n\t\t\t\tl.setEnd(getNodes().get(j));\n\t\t\t\taddEdge(l);\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ti++; j = i+1;\n\t\t}\n\n }", "@Override\n\tpublic void paint(Graphics g) {\n\t\tGraphics2D g2d = (Graphics2D) g;\n\t\tg2d.setColor(Color.RED);\n\t\t\n\t\t // Compute Nodes\n\t\t float inc = (float) ((180*2.0)/size);\n\t\t int x[] = new int[size];\n\t\t int y[] = new int[size];\n\t\t float d= 0;\n\t\t d= 180 - inc/2;\n\t\t for (int i=0; i<size; i++){//$d=M_PI-$inc/2.0; $i<$k; $i++, $d+=$inc) {\n\t\t x[i] = (int) ((width/2) - (Math.sin(Math.toRadians(d))*(width/2)*(0.8)));\n\t\t y[i] = (int) (high - ((high/2) - (Math.cos(Math.toRadians(d)))*(high/2)*(0.8)));\n\t\t d+= inc;\n\t\t }\n\t\t for (int i=0; i<size; i++){\n\t\t g2d.fillOval(x[i], y[i], 2*rad, 2*rad);\n\t\t }\n\t\t \n\t\t \n\t\t for (int i=0; i<size; i++)\n\t\t\t for (int j=0; j<size; j++)\n\t\t\t {\n\t\t\t \t if (i != j && adj[i*size + j] == '1') {\n\t\t\t \t\t if(directed)\n\t\t\t \t\t {\n\t\t\t \t\t\t //Line2D lin = new Line2D.Float(x[i]+rad, y[i]+rad,x[j]+rad, y[j]+rad);\n\t\t\t\t \t \t//\tg2d.draw(lin);\n\t\t\t \t\t\t \n\t\t\t \t\t\t DrawArrow(g2d, x[i]+rad, y[i]+rad,x[j]+rad, y[j]+rad);\n\t\t\t \t\t\t \n\t\t\t \t\t }\n\t\t\t \t\t else\n\t\t\t \t\t {\n\t\t\t \t\t\t Line2D lin = new Line2D.Float(x[i]+rad, y[i]+rad,x[j]+rad, y[j]+rad);\n\t\t\t\t \t \t\tg2d.draw(lin);\n\t\t\t \t\t }\n\t\t\t \t\t \n\t\t\t \t }\n\t\t\t }\n\t\t \n\t\t \n\t\t/*\n\t\tg2d.fillOval(0, 0, 30, 30);\n\t\tg2d.drawOval(0, 50, 30, 30);\t\t\n\t\tg2d.fillRect(50, 0, 30, 30);\n\t\tg2d.drawRect(50, 50, 30, 30);\n\n\t\tg2d.draw(new Ellipse2D.Double(0, 100, 30, 30));*/\n\t}", "public void draw() {\n\t\tp.pushStyle();\n\t\t{\n\t\t\tp.rectMode(PConstants.CORNER);\n\t\t\tp.fill(360, 0, 70, 180);\n\t\t\tp.rect(60f, 50f, p.width - 110f, p.height * 2f * 0.33f - 50f);\n\t\t\tp.rect(60f, p.height * 2f * 0.33f + 50f, p.width - 110f, p.height * 0.33f - 130f);\n\t\t}\n\t\tp.popStyle();\n\n\t\tlineChart.draw(40f, 40f, p.width - 80f, p.height * 2f * 0.33f - 30f);\n\t\tlineChart2.draw(40f, p.height * 2f * 0.33f + 45f, p.width - 80f, p.height * 0.33f - 110f);\n\t\t//p.line(x1, y1, x2, y2);\n\n\t}", "public void paint(Graphics g) {\n\t\t\n\t\t//find slope - use to calculate position \n\t\tArrayList <Integer> Xpos = new ArrayList<Integer>();\n\t\tArrayList <Integer> Ypos = new ArrayList<Integer>();\n\n\t\t//contain all the x and y coordinates for horizontal lines\n\t\tArrayList <Integer> HorizXOutline = new ArrayList<Integer>();\n\t\tArrayList <Integer> HorizYOutline = new ArrayList<Integer>();\n\t\t//contain all x any y points for veritical lines\n\t\tArrayList <Integer> VertOutlineX = new ArrayList<Integer>();\n\t\tArrayList <Integer> VertOutlineY = new ArrayList<Integer>();\n\t\t//contain all x and y points of postive and pos diag lines\n\t\tArrayList <Integer> PosDiagOutlineX = new ArrayList<Integer>();\n\t\tArrayList <Integer> PosDiagOutlineY = new ArrayList<Integer>();\n\t\t//contain all x and y points of postive and neg diag lines\n\t\tArrayList <Integer> NegDiagOutlineX = new ArrayList<Integer>();\n\t\tArrayList <Integer> NegDiagOutlineY = new ArrayList<Integer>();\n\n\t\tg.setColor(Color.green);\n\t\t//adding outer shape x coord\n\t\tXpos.add(100);Xpos.add(100);Xpos.add(100);Xpos.add(200);\n\t\tXpos.add(200);Xpos.add(300);Xpos.add(100);Xpos.add(200);\n\t\tXpos.add(300);Xpos.add(400);Xpos.add(300);Xpos.add(350);\n\t\tXpos.add(400);Xpos.add(350);Xpos.add(300);Xpos.add(350);\n\t\tXpos.add(400);Xpos.add(350);Xpos.add(200);Xpos.add(300);//Xpos.add(120);Xpos.add(120);\n\t\tSystem.out.println(Xpos.size());\n\t\t//g.drawArc(100, 10, 200, 200, 0, 360);\n\t\t//adding outer shape y coord\n\t\tYpos.add(100);Ypos.add(10);Ypos.add(10);Ypos.add(10);\n\t\tYpos.add(10);Ypos.add(110);Ypos.add(100);Ypos.add(200);\n\t\tYpos.add(300);Ypos.add(300);Ypos.add(300);Ypos.add(180);\n\t\tYpos.add(300);Ypos.add(180);Ypos.add(300);Ypos.add(420);\n\t\tYpos.add(300);Ypos.add(420);Ypos.add(200);Ypos.add(110);//Ypos.add(100);Ypos.add(10);\n\t\tfor(int x =0;x<Xpos.size();x+=2){\n\t\t\tg.drawLine(Xpos.get(x), Ypos.get(x), Xpos.get(x+1), Ypos.get(x+1));\n\t\t\tif(Ypos.get(x)==Ypos.get(x+1)){\n\t\t\t\tHorizXOutline.add(x);HorizXOutline.add(x+1);\n\t\t\t\tHorizYOutline.add(x);HorizYOutline.add(x+1);\n\t\t\t\tg.drawLine(Xpos.get(x),Ypos.get(x)+20,Xpos.get(x+1),Ypos.get(x+1)+20);\n\t\t\t}\n\t\t\telse if(Xpos.get(x)==Xpos.get(x+1)){\n\t\t\t\tVertOutlineX.add(x);VertOutlineX.add(x+1);\n\t\t\t\tVertOutlineY.add(x);VertOutlineY.add(x+1);\n\t\t\t\tg.drawLine(Xpos.get(x)+20,Ypos.get(x),Xpos.get(x+1)+20,Ypos.get(x+1));\n\t\t\t}\n\t\t\tif((Ypos.get(x+1)-Ypos.get(x))!=0)\n\t\t\t{\n\t\t\t\tint slope = (Xpos.get(x)-Xpos.get(x+1))/(Ypos.get(x+1)-Ypos.get(x));\n\t\t\t\tif(slope<0){\n\t\t\t\t\tNegDiagOutlineX.add(x);NegDiagOutlineX.add(x+1);\n\t\t\t\t\tNegDiagOutlineY.add(x);NegDiagOutlineY.add(x+1);\n\t\t\t\t\tif(Xpos.get(x)<=100){\n\t\t\t\t\t\tg.drawLine(Xpos.get(x),Ypos.get(x)-20,Xpos.get(x+1)+10,Ypos.get(x+1)-10);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\tg.drawLine(Xpos.get(x),Ypos.get(x)+20,Xpos.get(x+1)-10,Ypos.get(x+1)+10);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(slope>0){\n\t\t\t\t\tPosDiagOutlineX.add(x);PosDiagOutlineX.add(x+1);\n\t\t\t\t\tPosDiagOutlineY.add(x);PosDiagOutlineY.add(x+1);\n\t\t\t\t\tg.drawLine(Xpos.get(x)-10,Ypos.get(x)-10,Xpos.get(x+1)-10,Ypos.get(x+1)-10);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n//\t for(int x = 0;x<=120;x+=10){\n//\t \t//change in x-3900/-13 = Xpos\n//\t \tint xpos1 = (int)(350 +(x/10)*(-50/11));\n//\t \tint xpos2 = (int)(350+(x/10)*(50/11));\n//\t \tint ypos = 180+x;\n//\t \tg.setColor(Color.red);\n//\t \tg.drawLine(xpos1, ypos, xpos2, ypos);\n//\t \tXpos.add(xpos1);Ypos.add(ypos);Xpos.add(xpos2);Ypos.add(ypos);\n//\t }\n//\t // g.setColor(Color.blue);\n//\t ////.drawRect(200, 100, 100, 100);\n//\t // g.setColor(Color.red);\n//\t double slope = (300-200)/(110-10);\n//\t int y = (int) (100-slope*20);\n//\t // g.drawRect(220, 130-y, 100, 100);\n//\t for(int x = 20;x<=100;x+=10){\n//\t \t//Y=slope*x+0 : (Y)/slope = X where Y = interval of 20\n//\t \tint ypos = (int)(x/slope)+190;\n//\t \tg.drawLine(100, x, ypos, x);\n//\t \tXpos.add(100);Ypos.add(x);Xpos.add(ypos);Ypos.add(x);\n//\t }\n\t // g.drawLine(300, 100, 200, 200);\n//\t for(int x = 100;x<=200;x+=10){\n//\t \tdouble circleypos = 200+ Math.sqrt((200-x)*100);\n//\t \tg.drawLine(x, x, (int)(circleypos), x);\n//\t \t\n//\t }\n\t double totalDist=0;\n\t for(int x=0; x<Xpos.size();x+=2){\n\t int xd = Xpos.get(x+1)-Xpos.get(x); xd = xd*xd;\n\t int yd = Ypos.get(x+1)-Ypos.get(x); yd = yd*yd;\n\t int distance = (int) (Math.sqrt(xd+yd));\n\t totalDist +=distance;\n\t System.out.println(\"The length of this line is\" + distance + \" and the total distance as of now is \" + totalDist);\n\t }\n\t}", "@FXML\n public void drawLPatternButtonPressed()\n {\n GraphicsContext gc = clearCanvasAndGetGraphicsContext();\n\n // loop to draw lines for each number of lines\n for(int i = 0; i <= lines; i++) {\n\n // draw L shape in bottom left\n gc.strokeLine(\n 0,\n (canvas.getHeight()/lines)*i,\n (canvas.getWidth()/lines)*i,\n canvas.getHeight()\n );\n\n }\n }", "public void setConnectDots(boolean b)\r\n/* 29: */ {\r\n/* 30: 24 */ this.connectDots = b;repaint();\r\n/* 31: */ }", "@Override\r\n\tpublic void paint(Graphics g) {\n\t\tGraphics2D g2d= (Graphics2D)g;//Cast the Graphics received in the paint method to Graphics2D\r\n\t\tg2d.setColor(Color.RED);//Set the color to red\r\n\t\tg2d.setStroke(new BasicStroke(5));//Set the width of the line to 5px \r\n\t\t//g2d.drawLine(0, 0, 500, 500);//Draw a line starting at point (0,0) and ending at point (500,500)\r\n\t\t//g2d.drawRect(100, 100, 300, 300);//Draw a rectangle with upper left corner at (100,100) and with width and height of 300px\r\n\t\tg2d.setColor(Color.GREEN);//Set the color to green\r\n\t\t//g2d.fillRect(100, 100, 300, 300);//Fill the rectangle\r\n\t\t\r\n\t\t//If we will draw the line first and then the rectangle, the rectangle will be on top of the line and hide part of it\r\n\t\t//g2d.drawOval(100, 100, 300, 300);//Draw circle\r\n\t\t//g2d.fillOval(100, 100, 300, 300);//Fill the circle\r\n\t\t\r\n\t\t//g2d.drawArc(100,100,200,200,0,180);//Draw half circle\r\n\t\r\n\t\t//g2d.drawArc(100,100,200,200,180,180);//Flip it\r\n\t\t//g2d.drawArc(100,100,200,200,0,270);//Draw 3/4 of a circle\r\n\t\t\r\n\t\t//int[] xPoints= {150,250,350};\r\n\t\t//int[] yPoints= {300,150,300};\r\n\t\t//g2d.drawPolygon(xPoints,yPoints,3);//Draw rectangle using polygon, specify x points and y points of the corners and number of corners,\r\n\t\t\t\t\t\t\t\t\t\t //we can specify more than 3 corners and create different shapes.\r\n\t\t\t\t\r\n\t\t//g2d.fillPolygon(xPoints,yPoints,3);//Fill the rectangle using polygon\r\n\t\tg2d.setColor(Color.BLACK);//Set the color to black\r\n\t\tg2d.setFont(new Font(\"Ink Free\", Font.BOLD,40));\r\n\t\tg2d.drawString(\"Hello world\", 100, 100);\r\n\t}", "public void paintComponent(Graphics g) {\n\t\t\tsuper.paintComponent(g);\n\t\t\t\n\t\t\t// First 2 arguments (X, Y) -> start, Last 2 arguments (X, Y) -> end\n\t\t\tg.drawLine(0, 3, 200, 200);\n\t\t\tg.drawLine(200, 200, 0, 400);\n\t\t\t\n\t\t}", "private void forceRedraw(){\n postInvalidate();\n }", "void setupDragLines() {\n\t\tmouseLockedToLine = true;\n\t\tbeginOffsetP.set(P); // lock the beginning position of the offset vector\n\t\tfor (int i = 0; i < amount; i++)\n\t\t\tline[i].resetLockPoints(P); // check\n\t}", "@Override\n\tprotected void paint2d(Graphics2D g) {\n\t\tdouble x = 0;//getX();\n\t\tdouble y = 0;//getY();\n\t\tfor (int i = 0; i < size() - 1; i++) {\n\t\t\tGPoint p1 = points.get(i);\n\t\t\tGPoint p2 = points.get(i + 1);\n\t\t\tdouble x0 = p1.getX() - x;\n\t\t\tdouble y0 = p1.getY() - y;\n\t\t\tdouble x1 = p2.getX() - x;\n\t\t\tdouble y1 = p2.getY() - y;\n\t\t\tg.drawLine(GMath.round(x0), GMath.round(y0),\n\t\t\t\t\tGMath.round(x1), GMath.round(y1));\n\t\t}\n\t}", "public void draw(){\n super.repaint();\n }", "void reDraw();", "@Override\r\n\tpublic void draw() {\n\t\tdecoratedShape.draw();\r\n\t\tsetRedBorder(decoratedShape);\r\n\t}", "public void paintComponent(Graphics g){\r\n super.paintComponent(g);\r\n\r\n for (int i = 0; i < list.size(); i++) {//draw the shapes of the original list\r\n list.get(i).draw(g);\r\n }\r\n for (int i = 0; i <clonedList.size() ; i++) {//draw the shapes of the cloned list\r\n clonedList.get(i).draw(g);\r\n }\r\n\r\n\r\n }", "public void draw() {\n\t\tfor (Link link : links)\n\t\t\tlink.draw();\n\t}", "public void paint(Graphics g) {\r\n\t\tsuper.paint(g);\r\n\t\t// add code below\r\n\t\tGraphics g1 = drawingPanel.getGraphics();\r\n\t\tif (myLine != null && myLine.getIsAPerpendicular() == false) {\r\n\t\t\tShapes.add(myLine);\r\n\t\t\tfor (int i = 0; i < Shapes.size(); i++) {\r\n\t\t\t\tShapes.get(i).draw(g1);\r\n\t\t\t}\r\n\t\t}// End If to prevent null pointer exception\r\n\t\tif (myOval != null) {\r\n\t\t\tShapes.add(myOval);\r\n\t\t\tfor (int i = 0; i < Shapes.size(); i++) {\r\n\t\t\t\tShapes.get(i).draw(g1); // To make this legal an abstract method named draw which accepted graphics g need to be added to the shapes class\r\n\t\t\t}\r\n\t\t}// End If to prevent null pointer exception\r\n\t}", "@Override\r\n\tpublic void update(Graphics g) {\r\n\t\t// S*ystem.out.println(\"Graph.update\");\r\n\t\t// paint(g);\r\n\t\t// super.update(g);\r\n\t}", "private void setPathLine(Position prevPos, Position newPos) {\n\t\t//Grid coordinates\n\t\tint xStart = prevPos.getX();\n\t\tint yStart = prevPos.getY();\n\t\tint xEnd = newPos.getX();\n\t\tint yEnd = newPos.getY();\n\t\t\n\t\t//Set width/height in pixels of screen dimension\n\t\tfloat xF = (xEnd*PIXEL_WIDTH);\n\t\tfloat yF = (yEnd*PIXEL_HEIGHT);\n\t\t\n\t\t//Check that this grid IS free (ie 0) to draw a path\n\t\tif (checkPathCo(newPos) == 0) {\n\t\t\tsPath.lineTo(xF, yF);\n\t\t\tsetPathCo(newPos,1);\n\t\t\twhile (xStart != xEnd)\n\t\t\t{ //set everything in between as 1 ie undroppable\n\t\t\t\tPosition tmpPos = new Position(xStart, yEnd);\n\t\t\t\tsetPathCo(tmpPos,1);\n\t\t\t\tif (xStart < xEnd)\n\t\t\t\t\txStart++;\n\t\t\t\telse\n\t\t\t\t\txStart--;\n\t\t\t}\n\t\t\t\n\t\t\twhile(yStart < yEnd)\n\t\t\t{ //same as x above\n\t\t\t\tPosition tmpPos = new Position(xEnd,yStart);\n\t\t\t\tsetPathCo(tmpPos,1);\n\t\t\t\tyStart++;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void lineDraw(GraphNodeAL<MapPoint> l1, GraphNodeAL<MapPoint> l2) {\n Line l = new Line((int) l1.data.xCo, (int) l1.data.yCo, (int) l2.data.xCo, (int) l2.data.yCo);\n l.setTranslateX(mapImage.getLayoutX());\n l.setTranslateY(mapImage.getLayoutY());\n ((Pane) mapImage.getParent()).getChildren().add(l);\n }", "private void updateLinePositions() {\n\n\t\tif (alLabelLines.size() == 0) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tfloat fXLinePosition = fXContainerLeft + CONTAINER_BOUNDARY_SPACING;\n\n\t\t\tLabelLine firstLine = alLabelLines.get(0);\n\t\t\tfloat fYLinePosition = fYContainerCenter + (fHeight / 2.0f)\n\t\t\t\t\t- CONTAINER_BOUNDARY_SPACING - firstLine.getHeight();\n\t\t\tfirstLine.setPosition(fXLinePosition, fYLinePosition);\n\n\t\t\tfor (int i = 1; i < alLabelLines.size(); i++) {\n\t\t\t\tLabelLine currentLine = alLabelLines.get(i);\n\t\t\t\tfYLinePosition -= (currentLine.getHeight() + CONTAINER_LINE_SPACING);\n\t\t\t\tcurrentLine.setPosition(fXLinePosition, fYLinePosition);\n\t\t\t}\n\t\t}\n\t}", "private void paintGraph() {\n if(graph) {\n for (MapFeature street : mapFStreets) {\n if (!(street instanceof Highway)) continue;\n Highway streetedge = (Highway) street;\n Iterable<Edge> edges = streetedge.edges();\n if (edges == null) continue;\n Iterator<Edge> it = edges.iterator();\n g.setStroke(new BasicStroke(0.0001f));\n g.setPaint(Color.CYAN);\n while (it.hasNext()) {\n Edge e = it.next();\n if (e.isOneWay())\n g.setPaint(Color.orange);\n else if (e.isOneWayReverse())\n g.setPaint(Color.PINK);\n g.draw(e);\n }\n\n\n }\n for (MapFeature street : mapFStreets) {\n if (!(street instanceof Highway)) continue;\n Highway streetedge = (Highway) street;\n List<Point2D> points = streetedge.getPoints();\n for(Point2D p : points){\n g.setPaint(Color.yellow);\n g.draw(new Rectangle2D.Double(p.getX(), p.getY(), 0.000005, 0.000005));\n }\n\n }\n }\n }", "public void drawGraph() {\n for (int x = 0; x < width; ++x) {\n for (int y = 0; y < height; ++y) {\n\n if (y == height / 2) {\n imageRaster.setPixel(x, y, lineColor);\n } else {\n imageRaster.setPixel(x, y, backgroundColor);\n }\n }\n }\n\n // lateral\n for (int x = 0; x < width; ++x) {\n float xUnit = x / (float) width;\n float slipAngle = map(xUnit, 0, 1, 0, maxSlipAngle);\n\n float lat = tireModel.calcLateralTireForce(slipAngle);\n lat = map(lat, -tireModel.getMaxLoad(), tireModel.getMaxLoad(), 0, height);\n int pixelY = (int) FastMath.clamp(lat, 0, height - 1);\n\n imageRaster.setPixel(x, pixelY, lateralColor);\n }\n\n // longitudinal\n for (int x = 0; x < width; ++x) {\n float xUnit = x / (float) width;\n float slipAngle = map(xUnit, 0, 1, 0, maxSlipAngle);\n\n float lng = tireModel.calcLongitudeTireForce(slipAngle);\n lng = map(lng, -tireModel.getMaxLoad(), tireModel.getMaxLoad(), 0, height);\n int pixelY = (int) FastMath.clamp(lng, 0, height - 1);\n\n imageRaster.setPixel(x, pixelY, longitudinalColor);\n }\n\n // align moment\n for (int x = 0; x < width; ++x) {\n float xUnit = x / (float) width;\n float slipAngle = map(xUnit, 0, 1, 0, maxSlipAngle);\n\n float mnt = tireModel.calcAlignMoment(slipAngle);\n mnt = map(mnt, -tireModel.getMaxLoad(), tireModel.getMaxLoad(), 0, height);\n int pixelY = (int) FastMath.clamp(mnt, 0, height - 1);\n\n imageRaster.setPixel(x, pixelY, momentColor);\n }\n }", "public void update() {\n\t\tremoveAll();\n\t\tdrawGraph();\n\t\tplotEntries();\n\t}", "public void update() {\r\n\t\tthis.removeAll();\r\n\t\tdrawLinesAndLabels(this.getWidth(), this.getHeight());\r\n\t\tdrawNameSurferEntries();\r\n\t}", "protected void paintMoves(Graphics2D g2d) {\r\n\t\tif (!parent.showMoves) return;\r\n\t\tArrayList<Pose> poses = model.getPoses();\r\n\t\tArrayList<Move> moves = model.getMoves();\r\n\t\t//parent.log(poses.size() + \" poses\");\r\n\t //parent.log(moves.size() + \" moves\");\r\n\t\tif (poses == null || poses.size() < 2) return;\r\n\t\tPose previousPose = null;\r\n\t\t\r\n\t\tg2d.setColor(colors[MOVE_COLOR_INDEX]);\r\n\t\tIterator<Move> iter = moves.iterator();\r\n\t\tfor(Pose pose: poses) {\t\r\n\t\t\tif (previousPose == null) previousPose = pose;\r\n\t\t\telse {\r\n\t\t\t\tMove move = iter.next();\r\n\t\t\t\tif (move.getMoveType() == Move.MoveType.ARC) {\r\n\t\t\t\t\t//parent.log(\"Move = \" + move);\r\n\t\t\t\t\tint radius = Math.round(move.getArcRadius());\r\n\t\t\t\t\tint diameter = radius*2;\r\n\t\t\t\t\tint startAngle = Math.round(previousPose.getHeading() - 90);\r\n\t\t\t\t\tint angleTurned = Math.round(move.getAngleTurned());\r\n \r\n\t\t\t\t\tif (radius < 0) {\r\n\t\t\t\t\t\tstartAngle -= 180;\r\n\t\t\t\t\t\tradius = -radius;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tint startX = (int) Math.round(previousPose.getX() - radius - radius*Math.cos(Math.toRadians(startAngle)));\r\n\t\t\t\t\tint startY = (int) Math.round(previousPose.getY() + radius - radius*Math.sin(Math.toRadians(startAngle)));\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (angleTurned < 0) {\r\n\t\t\t\t\t\tstartAngle += angleTurned;\r\n\t\t\t\t\t\tangleTurned =- angleTurned;\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tdiameter = Math.abs(diameter);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//parent.log(\"Drawing arc:\" + startX + \",\" + startY + \",\" + diameter + \",\" + diameter + \",\" + startAngle + \",\" + angleTurned);\r\n\t\t\t\t\tg2d.drawArc((int) getX(startX), (int) getY(startY), (int) getDistance(diameter),(int) getDistance(diameter), startAngle, angleTurned);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//parent.log(\"Drawing line from \" + previousPose.getX() + \",\" + previousPose.getY() + \" to \" + pose.getX() + \",\" + pose.getY());\r\n\t\t\t\t\tg2d.drawLine((int) getX(previousPose.getX()), (int) getY(previousPose.getY()), (int) getX(pose.getX()), (int) getY(pose.getY())); \r\n\t\t\t\t}\r\n\t\t\t\tpreviousPose = pose;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "public static void drawLines(Pane pane) {\n\n for (int i = 0; i < 4; i++) {\n Line lineH = new Line(0, i * 150, 450, i * 150);\n lineH.setStroke(Color.DARKGRAY);\n lineH.setStrokeWidth(3);\n pane.getChildren().add(lineH);\n\n Line lineV = new Line(i * 150, 0, i * 150, 450);\n lineV.setStroke(Color.DARKGRAY);\n lineV.setStrokeWidth(3);\n pane.getChildren().add(lineV);\n }\n }", "@Override\n public void clearLineColors() {\n assemblyView.clearLinesColor();\n }", "@Override\r\n public void actionPerformed(ActionEvent e) {\n progress_stack = progress_stack_bkup;\r\n\r\n rec_points = rec_points_bkup;\r\n rec_colors = rec_colors_bkup;\r\n\r\n squ_points = squ_points_bkup;\r\n squ_colors = squ_colors_bkup;\r\n\r\n ell_points = ell_points_bkup;\r\n ell_colors = ell_colors_bkup;\r\n\r\n cir_points = cir_points_bkup;\r\n cir_colors = cir_colors_bkup;\r\n\r\n str_points = str_points_bkup;\r\n str_colors = str_colors_bkup;\r\n\r\n poly_points = poly_points_bkup;\r\n poly_colors = poly_colors_bkup;\r\n\r\n handdraw_points = handdraw_points_bkup;\r\n handdraw_colors = handdraw_colors_bkup;\r\n\r\n\r\n if(rec_colors.size()>0){\r\n repaint_shapes(\"rec\", rec_colors, rec_points);\r\n }\r\n\r\n //repaint circle\r\n if(cir_colors.size()>0){\r\n repaint_shapes(\"cir\", cir_colors, cir_points);\r\n }\r\n\r\n //repaint square\r\n if(squ_colors.size()>0){\r\n repaint_shapes(\"squ\", squ_colors, squ_points);\r\n }\r\n\r\n //repaint ellipse\r\n if(ell_colors.size()>0){\r\n repaint_shapes(\"ell\", ell_colors, ell_points);\r\n }\r\n\r\n //repaint straight line\r\n if(str_colors.size()>0){\r\n repaint_shapes(\"str\", str_colors, str_points);\r\n }\r\n\r\n //repaint polygons\r\n if(poly_colors.size()>0){\r\n //polygon repaint\r\n ArrayList<Integer> separate_index = get_separate_index(poly_points);\r\n ArrayList<Integer> points = new ArrayList<Integer>();\r\n\r\n //other shapes\r\n for (int j = 0; j < separate_index.size()-1; j++) {\r\n Color polygon_color = poly_colors.get(j);\r\n //each shape repaint\r\n int begin_index = separate_index.get(j);\r\n int end_index = separate_index.get(j+1);\r\n\r\n //get polygon points arraylist\r\n for (int k = (begin_index+1); k < end_index; k++) {\r\n points.add(poly_points.get(k));\r\n\r\n }\r\n System.out.println(points);\r\n\r\n //repaint one polygon\r\n int line_num = points.size()/2 - 1 ;\r\n for (int k = 0; k < line_num; k++) {\r\n int begin_point = k*2;\r\n x1 = points.get(begin_point);\r\n y1 = points.get(begin_point + 1);\r\n x2 = points.get(begin_point + 2);\r\n y2 = points.get(begin_point + 3);\r\n\r\n g.setColor(polygon_color);\r\n g.drawLine(x1, y1, x2, y2);\r\n\r\n canvas.repaint();\r\n }\r\n points.clear();\r\n }\r\n\r\n //the last polygon\r\n //get last shape points arraylist\r\n int index = separate_index.get(separate_index.size()-1);\r\n for (int j = index+1; j < poly_points.size(); j++) {\r\n points.add(poly_points.get(j));\r\n }\r\n System.out.println(points);\r\n //using points to repaint polygon\r\n int line_num = points.size()/2 - 1 ;\r\n for (int j = 0; j < line_num; j++) {\r\n int begin_point = j*2;\r\n x1 = points.get(begin_point);\r\n y1 = points.get(begin_point + 1);\r\n x2 = points.get(begin_point + 2);\r\n y2 = points.get(begin_point + 3);\r\n\r\n g.setColor(poly_colors.get(poly_colors.size()-1));\r\n g.drawLine(x1, y1, x2, y2);\r\n\r\n canvas.repaint();\r\n\r\n }\r\n }\r\n\r\n //repaint freehand lines\r\n if(handdraw_colors.size()>0){\r\n //repaint all handdraw\r\n ArrayList<Integer> separate_index = get_separate_index(handdraw_points);\r\n ArrayList<Integer> points = new ArrayList<Integer>();\r\n for (int i = 0; i < handdraw_colors.size(); i++) {\r\n //each handdraw\r\n //take all points in one draw\r\n if(i == 0){\r\n //first draw\r\n int begin_index = 0;\r\n int end_index = separate_index.get(i);\r\n //get all points in first drawing\r\n for (int j = begin_index; j < end_index; j++) {\r\n points.add(handdraw_points.get(j));\r\n }\r\n //repaint first drawing\r\n System.out.println(points);\r\n\r\n int line_num = points.size()/2 - 1;\r\n for (int j = 0; j < line_num; j++) {\r\n //draw each short line\r\n begin_index = j*2;\r\n\r\n x1 = points.get(begin_index);\r\n y1 = points.get(begin_index + 1);\r\n x2 = points.get(begin_index + 2);\r\n y2 = points.get(begin_index + 3);\r\n\r\n g.setColor(handdraw_colors.get(i));\r\n g.drawLine(x1, y1, x2, y2);\r\n\r\n canvas.repaint();\r\n\r\n }\r\n points.clear();\r\n\r\n }else{\r\n //draw other handdraws\r\n for (int j = 0; j < handdraw_colors.size()-1; j++) {\r\n //draw each drawing\r\n\r\n int begin_index = separate_index.get(j)+1;\r\n int end_index = separate_index.get(j+1);\r\n //get all points in one drawing\r\n for (int k = begin_index; k < end_index; k++) {\r\n points.add(handdraw_points.get(k));\r\n }\r\n System.out.println(points);\r\n\r\n //repaint drawing\r\n int line_num = points.size()/2 - 1;\r\n for (int k = 0; k < line_num; k++) {\r\n //each line\r\n begin_index = k*2;\r\n\r\n x1 = points.get(begin_index);\r\n y1 = points.get(begin_index + 1);\r\n x2 = points.get(begin_index + 2);\r\n y2 = points.get(begin_index + 3);\r\n\r\n g.setColor(handdraw_colors.get(i));\r\n g.drawLine(x1, y1, x2, y2);\r\n\r\n canvas.repaint();\r\n\r\n }\r\n\r\n points.clear();\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }", "public void paint() {\n int L = 150; // Local convenience var\n\n // Declare three lines (left, middle, and right)\n Line left = new Line(L, L, L, getHeight() - L);\n Line middle = new Line(L, getHeight() / 2, getWidth() - L, getHeight() / 2);\n Line right = new Line(getWidth() - L, L, getWidth() - L, getHeight() - L);\n\n getChildren().clear(); // Clear the pane before redisplay\n\n displayHTree(order, left, middle, right); // Call the recursive method\n }", "public void DrawGraphActive() {\n if (CurrentEQ == null || CurrentEQ.isEmpty()) {\n return;\n }\n StringParser parser = new StringParser();\n Equation eq = parser.ParseString(CurrentEQ);\n\n int size = (int) ((Math.max(MinX, MaxX) - Math.min(MinX, MaxX)) / Step);\n double[] points = new double[size * 2 + 2];\n int index = 0;\n for (double i = Math.min(MinX, MaxX); i <= Math.max(MinX, MaxX); i += Step) {\n points[index] = i;\n index++;\n points[index] = eq.peekAt(\"x\", i);\n index++;\n }\n LineGraph root = new LineGraph(points);\n root.raw = CurrentEQ;\n root.setIncrements(Increments);\n root.setLineColour(LineColor);\n root.SetDrawArea(DrawArea);\n root.setShowNumbers(DrawScale);\n root.setBackColor(BackColor);\n root.setCurveThickness(CurveThickness);\n Canvas.removeAll();\n Canvas.repaint();\n int h = Frame.getHeight();\n int w = Frame.getWidth();\n GraphPanel p;\n if (ForceRange) {\n p = (GraphPanel) root.drawToJPanel((int) (w * Zoom), (int) (h * Zoom),\n Math.min(MinX, MaxX),\n Math.min(MinY, MaxY),\n Math.max(MinX, MaxX),\n Math.max(MinY, MaxY));\n p.addMouseMotionListener(new MouseMovementListener(p, root, eq));\n Canvas.add(p);\n } else {\n p = (GraphPanel) root.drawToJPanel((int) (w * Zoom), (int) (h * Zoom));\n p.addMouseMotionListener(new MouseMovementListener(p, root, eq));\n Canvas.add(p);\n // Canvas.setBackground(Color.red);\n }\n\n Frame.validate();\n CenterScrollPane();\n lineGraphs.set(RootGraph, root);\n p.LineGraphs = lineGraphs;\n }", "public void button2Pushed(ActionEvent event)\r\n {\n GraphicsContext gc = canvas.getGraphicsContext2D();\r\n \r\n gc.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\r\n \r\n //draw line from 0,0 to lower right\r\n for (int start = 0; start <= canvas.getWidth(); start += 20)\r\n gc.strokeLine(start, canvas.getHeight()-start, canvas.getWidth(), canvas.getHeight());\r\n \r\n \r\n for (int start = 0; start <= canvas.getWidth(); start += 20)\r\n gc.strokeLine(0, 0, start, canvas.getHeight()-start);\r\n \r\n }", "private void drawLine(Graphics g, int x1, int y1, int x2, int y2) {\n int d = 0;\n\n int dx = Math.abs(x2 - x1);\n int dy = Math.abs(y2 - y1);\n\n int dx2 = 2 * dx; // slope scaling factors to\n int dy2 = 2 * dy; // avoid floating point\n\n int ix = x1 < x2 ? 1 : -1; // increment direction\n int iy = y1 < y2 ? 1 : -1;\n\n int x = x1;\n int y = y1;\n\n if (dx >= dy) {\n while (true) {\n plot(g, x, y);\n if (x == x2)\n break;\n x += ix;\n d += dy2;\n if (d > dx) {\n y += iy;\n d -= dx2;\n }\n }\n } else {\n while (true) {\n plot(g, x, y);\n if (y == y2)\n break;\n y += iy;\n d += dx2;\n if (d > dy) {\n x += ix;\n d -= dy2;\n }\n }\n }\n }", "@Override\n protected void onDraw(Canvas canvas) {\n for (Path p : paths) {\n mPaint.setColor(strokeMap.get(p).getStrokeColor());\n mPaint.setStrokeWidth(strokeMap.get(p).getStrokeWidth());\n canvas.drawPath(p, mPaint);\n }\n //draws current path\n mPaint.setColor(paintColor);\n mPaint.setStrokeWidth(strokeWidth);\n canvas.drawPath(mPath, mPaint);\n }", "@Override\n protected void paintComponent(Graphics g) \n {\n super.paintComponent(g); //calling paintComponent method\n g.clearRect(this.getX(),this.getY(),this.getWidth(),this.getHeight());\n g.fillRect(this.getX(),this.getY(),this.getWidth(),this.getHeight());\n g.setColor(Color.BLACK);\n this.repaint(); \n if(randInt==null) return; //check if array is null\n for(int i = 0;i <this.getWidth();i++) // drawing the lines using graphics\n {\n g.setColor(Color.RED);\n g.drawLine(i,randInt[i],i,this.getHeight() );\n }\n }", "private void drawMirrorCenter(Graphics2D g, boolean erase) {\n Color old = g.getColor();\n g.setXORMode(Color.WHITE);\n Stroke sOld = g.getStroke();\n g.setStroke(strokeDrawing);\n \n // Erase the lines.\n if (erase) {\n g.setColor(CROSS_COLOR_1);\n g.draw(fLine1);\n g.draw(fLine2);\n g.setColor(CROSS_COLOR_2);\n g.draw(fEllipse);\n g.setColor(CROSS_COLOR_1);\n g.draw(fLineDegree);\n }\n \n // Set the lines and ellipses with the new locations.\n fLine1.setLine(fptUserCalculated.x - CROSS_SIZE, fptUserCalculated.y, fptUserCalculated.x + CROSS_SIZE, fptUserCalculated.y);\n fLine2.setLine(fptUserCalculated.x, fptUserCalculated.y - CROSS_SIZE, fptUserCalculated.x, fptUserCalculated.y + CROSS_SIZE);\n float xPrev = fptUserCalculated.x - (float)Math.cos(radian) * CROSS_DEGREE_SIZE;\n float yPrev = fptUserCalculated.y - (float)Math.sin(radian) * CROSS_DEGREE_SIZE;\n float xNext = fptUserCalculated.x + (float)Math.cos(radian) * CROSS_DEGREE_SIZE;\n float yNext = fptUserCalculated.y + (float)Math.sin(radian ) * CROSS_DEGREE_SIZE;\n fLineDegree.setLine(xPrev, yPrev, xNext, yNext);\n fEllipse.setFrame(fptUserCalculated.x - CROSS_SIZE, fptUserCalculated.y - CROSS_SIZE, CROSS_SIZE*2, CROSS_SIZE*2);\n \n // Draw the lines now.\n g.setColor(CROSS_COLOR_1);\n g.draw(fLine1);\n g.draw(fLine2);\n g.setColor(CROSS_COLOR_2);\n g.draw(fEllipse);\n g.setColor(CROSS_COLOR_1);\n g.draw(fLineDegree);\n \n // Restore the color.\n g.setColor(old);\n g.setStroke(sOld);\n }", "public void draw(Graphics g) {\n g.drawLine(start_x, start_y, start_x, end_y);\n g.drawLine(start_x, start_y, end_x, start_y);\n g.drawLine(start_x, end_y, end_x, end_y);\n g.drawLine(end_x, start_y, end_x, end_y);\n }", "public void setCurvedLines(boolean value) {\n _curvedLines = value;\n }", "public void drawLine(Graphics2D g, int width, int height, double minX,\n double minY, double maxX, double maxY) {\n upperX = maxX;\n lowerX = minX;\n\n upperY = maxY;\n lowerY = minY;\n //debug, drawLine bounds\n// g.drawLine(XOffSet, YOffSet, width, YOffSet);\n// g.drawLine(XOffSet, height, width, height); //X\n//\n// g.drawLine(XOffSet, YOffSet, XOffSet, height);\n// g.drawLine(width, YOffSet, width, height); //Y\n\n double Xscale = GetXScale(width);\n double Yscale = GetYScale(height);\n int centerX = getCenterX(width);\n int centerY = getCenterY(height);\n\n //drawGrid(g, width, height, minX, minY, maxX, maxY);\n\n g.setColor(LineColor);\n g.setStroke(new BasicStroke(curveThickness));\n //draws line from last point to current point\n for (int i = 2; i <= PointArray.length - 1; i += 2) {\n double x1 = ((PointArray[i - 2] * Xscale) + centerX);\n double y1 = ((centerY) - (PointArray[i - 1]) * Yscale);\n\n double x2 = ((PointArray[i] * Xscale) + centerX);\n double y2 = ((centerY) - (PointArray[i + 1]) * Yscale);\n\n if (Double.isNaN(y2)) {\n continue;\n }\n if (Double.isNaN(y1)) {\n continue;\n }\n if (y1 == Double.NaN) {\n i += 2;\n continue;\n } else if (y1 == Double.POSITIVE_INFINITY || y1 == Double.NEGATIVE_INFINITY) {\n continue;\n }\n\n if (y2 == Double.NaN) {\n i += 2;\n continue;\n } else if (y2 == Double.POSITIVE_INFINITY || y2 == Double.NEGATIVE_INFINITY) {\n if (i > 3) {\n if ((PointArray[i - 1] - PointArray[i - 3] > 0)) {\n y2 = YOffSet;\n } else {\n y2 = height;\n }\n } else {\n continue;\n }\n }\n if (x1 < XOffSet) {\n x1 = XOffSet;\n } else if (x1 > width) {\n continue;\n }\n if (x2 < XOffSet) {\n continue;\n } else if (x2 > width) {\n x2 = width;\n }\n\n if (y1 < YOffSet) {\n y1 = YOffSet;\n } else if (y1 > height) {\n continue;\n }\n if (y2 < YOffSet) {\n continue;\n } else if (y2 > height) {\n y2 = height;\n }\n g.drawLine((int) x1, (int) y1, (int) x2, (int) y2);\n }\n\n }", "public void completeRedraw()\r\n\t{\r\n\t\tg = (Graphics2D) s.getDrawGraphics();\r\n\t}", "private void drawLinesAndMiddle(Line[] lines, DrawSurface d) {\n for (Line line : lines) {\n d.setColor(Color.black);\n d.drawLine((int) line.start().getX(), (int) line.start().getY(),\n (int) line.end().getX(), (int) line.end().getY());\n int r = 3;\n Point middle = line.middle();\n d.setColor(Color.BLUE);\n d.fillCircle((int) middle.getX(), (int) middle.getY(), r);\n }\n }", "public void requestRedraw() {\n\n this.getParent().repaint();\n\n }", "public void draw()\n {\n super.draw();\n k = 0;\n traceOK = true;\n\n // Initialize n, x0, and xn in the control panel.\n nText.setText(\" \");\n x0Text.setText(\" \");\n xnText.setText(\" \");\n\n PlotFunction plotFunction = getSelectedPlotFunction();\n\n // Create the fixed-point iteration root finder.\n finder = new FixedPointRootFinder((Function) plotFunction.getFunction());\n }" ]
[ "0.77711457", "0.6919565", "0.67848676", "0.67588186", "0.6666307", "0.6600864", "0.64621663", "0.643248", "0.63532645", "0.6272215", "0.6264821", "0.6247935", "0.62421", "0.62309456", "0.62256366", "0.6218008", "0.61807746", "0.6179199", "0.6157491", "0.611305", "0.61118", "0.6103613", "0.61007047", "0.6095816", "0.60695237", "0.60613453", "0.60588217", "0.6057354", "0.60560256", "0.6052364", "0.60333294", "0.60313535", "0.6022622", "0.60219264", "0.6012565", "0.59814686", "0.5968674", "0.5967958", "0.594804", "0.59453905", "0.59396243", "0.5920592", "0.5917113", "0.59017634", "0.58996266", "0.589637", "0.5893649", "0.5891939", "0.5885449", "0.5885183", "0.5883378", "0.5876126", "0.58751404", "0.5874133", "0.58653116", "0.586256", "0.5854202", "0.58540887", "0.5852836", "0.58519524", "0.5831266", "0.5828536", "0.5824261", "0.5814843", "0.5808967", "0.58026797", "0.5781017", "0.5778831", "0.57687646", "0.5766718", "0.5765982", "0.57617986", "0.576072", "0.57500416", "0.5742859", "0.57414454", "0.57408416", "0.57391745", "0.5739009", "0.57357377", "0.573394", "0.57306933", "0.5725263", "0.5723646", "0.5719158", "0.57179797", "0.571723", "0.5705326", "0.57001466", "0.56913215", "0.5689016", "0.56881183", "0.5685587", "0.5685019", "0.5674251", "0.56717956", "0.567042", "0.5667811", "0.56530875", "0.56464714" ]
0.71307844
1
puts names on the graph
private void redrawTitles(int i, int k, double y) { double x = getWidth() / NDECADES * k; GLabel titles; if (entries.get(i).getRank(k) > 0) { titles = new GLabel(entries.get(i).getName() + " " + entries.get(i).getRank(k), x, y); } else { titles = new GLabel(entries.get(i).getName() + " " + "*", x, y); } changeTheColor(titles, i); add(titles); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void display() {\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tString str = vname + \" => \";\r\n\t\t\tVertex vtx = vces.get(vname);\r\n\r\n\t\t\tArrayList<String> nbrnames = new ArrayList<>(vtx.nbrs.keySet());\r\n\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\tstr += nbrname + \"[\" + vtx.nbrs.get(nbrname) + \"], \";\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(str + \".\");\r\n\t\t}\r\n\t}", "@Override\n \t\t\t\tpublic String getGraphName() {\n \t\t\t\t\treturn \"http://opendata.cz/data/namedGraph/3\";\n \t\t\t\t}", "public void printName()\n\t{\n\t\tArrayList<Robot> ar=new ArrayList<Robot>();\n\t\tIterator<Robot> it;\n\t\tint i=1;//started index\n\t\t\n\t\tar.addAll(robotHM.values());//adding all\n\t\tCollections.sort(ar);//sort by names\n\t\tit=ar.iterator();\n\t\twhile (it.hasNext())\n\t\t{\n\t\t\tSystem.out.println(i+\". \"+it.next().getName());\n\t\t\ti++;\n\t\t}\n\t}", "public void print (){\r\n for (int i = 0; i < graph.size(); ++i){\r\n graph.get(i).print();\r\n }\r\n }", "static public void writeNamedGraph(Graph G, String file) {\n\t\ttry {\n\t\t\tPrintWriter out = new PrintWriter(file);\n\t\t\tout.println(G.numNodes());\n\t\t\tfor (int i = 0; i < G.numNodes(); i++)\n\t\t\t\tout.println(G.getName(i));\n\t\t\tfor (int i = 0; i < G.numNodes(); i++) {\n\t\t\t\tArrayList<Pair<Integer, Double>> P = G.adjacentNodes(i);\n\t\t\t\tfor (Pair<Integer, Double> j : P) {\n\t\t\t\t\tif (i < j.first) {\n\t\t\t\t\t\tout.println(G.getName(i) + \" \" + G.getName(j.first) + \" \" + j.second);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tout.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void outputForGraphviz() {\n\t\tString label = \"\";\n\t\tfor (int j = 0; j <= lastindex; j++) {\n\t\t\tif (j > 0) label += \"|\";\n\t\t\tlabel += \"<p\" + ptrs[j].myname + \">\";\n\t\t\tif (j != lastindex) label += \"|\" + String.valueOf(keys[j+1]);\n\t\t\t// Write out any link now\n\t\t\tBTree.writeOut(myname + \":p\" + ptrs[j].myname + \" -> \" + ptrs[j].myname + \"\\n\");\n\t\t\t// Tell your child to output itself\n\t\t\tptrs[j].outputForGraphviz();\n\t\t}\n\t\t// Write out this node\n\t\tBTree.writeOut(myname + \" [shape=record, label=\\\"\" + label + \"\\\"];\\n\");\n\t}", "public void setGraphName(String name) {\n this.graphname = name;\n }", "void printGraph();", "public void constructJSONGraph(String name){\n \t IndexHits<Node> foundNodes = findTaxNodeByName(name);\n Node firstNode = null;\n if (foundNodes.size() < 1){\n System.out.println(\"name '\" + name + \"' not found. quitting.\");\n return;\n } else if (foundNodes.size() > 1) {\n System.out.println(\"more than one node found for name '\" + name + \"'not sure how to deal with this. quitting\");\n } else {\n for (Node n : foundNodes)\n firstNode = n;\n }\n \t\tSystem.out.println(firstNode.getProperty(\"name\"));\n \t\tTraversalDescription CHILDOF_TRAVERSAL = Traversal.description()\n \t\t .relationships( RelTypes.TAXCHILDOF,Direction.INCOMING );\n \t\tHashMap<Node,Integer> nodenumbers = new HashMap<Node,Integer>();\n \t\tHashMap<Integer,Node> numbernodes = new HashMap<Integer,Node>();\n \t\tint count = 0;\n \t\tfor(Node friendnode: CHILDOF_TRAVERSAL.traverse(firstNode).nodes()){\n \t\t\tif (friendnode.hasRelationship(Direction.INCOMING)){\n \t\t\t\tnodenumbers.put(friendnode, count);\n \t\t\t\tnumbernodes.put(count,friendnode);\n \t\t\t\tcount += 1;\n \t\t\t}\n \t\t}\n \t\tPrintWriter outFile;\n \t\ttry {\n \t\t\toutFile = new PrintWriter(new FileWriter(\"graph_data.js\"));\n \t\t\toutFile.write(\"{\\\"nodes\\\":[\");\n \t\t\tfor(int i=0; i<count;i++){\n \t\t\t\tNode tnode = numbernodes.get(i);\n \t\t\t\toutFile.write(\"{\\\"name\\\":\\\"\"+tnode.getProperty(\"name\")+\"\");\n \t\t\t\toutFile.write(\"\\\",\\\"group\\\":\"+nodenumbers.get(tnode)+\"\");\n \t\t\t\toutFile.write(\"},\");\n \t\t\t}\n \t\t\toutFile.write(\"],\\\"links\\\":[\");\n \t\t\tfor(Node tnode: nodenumbers.keySet()){\n \t\t\t\tfor(Relationship trel : tnode.getRelationships(Direction.OUTGOING)){\n \t\t\t\t\toutFile.write(\"{\\\"source\\\":\"+nodenumbers.get(trel.getStartNode())+\"\");\n \t\t\t\t\toutFile.write(\",\\\"target\\\":\"+nodenumbers.get(trel.getEndNode())+\"\");\n \t\t\t\t\toutFile.write(\",\\\"value\\\":\"+1+\"\");\n \t\t\t\t\toutFile.write(\"},\");\n \t\t\t\t}\n \t\t\t}\n \t\t\toutFile.write(\"]\");\n \t\t\toutFile.write(\"}\\n\");\n \t\t\toutFile.close();\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}", "public void printGraph() {\n\t\tSystem.out.println(\"-------------------\");\n\t\tSystem.out.println(\"Printing graph...\");\n\t\tSystem.out.println(\"Vertex=>[Neighbors]\");\n\t\tIterator<Integer> i = vertices.keySet().iterator();\n\t\twhile(i.hasNext()) {\n\t\t\tint name = i.next();\n\t\t\tSystem.out.println(name + \"=>\" + vertices.get(name).printNeighbors());\n\t\t}\n\t\tSystem.out.println(\"-------------------\");\n\t}", "void printGraph() {\n for (Vertex u : this) {\n System.out.print(u + \": \");\n for (Edge e : u.Adj) {\n System.out.print(e);\n }\n System.out.println();\n }\n }", "public void printVertices() {\r\n\t\tfor (int i = 0; i < vertices.size(); i++)\r\n\t\t\tSystem.out.print(vertices.get(i).label);\r\n\t}", "public void display(){\n\t\tSystem.out.println(\"node: \"+name+\", at \"+drawnNode.getXPosition()+\",\"+drawnNode.getYPosition()+\", colour \"+drawnNode.getColour());\n\t\tif(outArcs.length > 0)\n\t\t\tSystem.out.println(\"out arcs:\");\n\t\tfor(int i=0;i<outArcs.length;i++)\n\t\t\tSystem.out.println(\"to \"+outArcs[i].getEndNode().getName());\n\t}", "private void plotName(NameSurferEntry entry, int entryNumber) {\r\n\t\t\r\n\t\tfor(int i = 0; i<NDECADES; i++) {\r\n\t\t\tString name = entry.getName();\r\n\t\t\tint rank = entry.getRank(i);\r\n\t\t\tString rankString = Integer.toString(rank);\r\n\t\t\tString label = name + \" \" + rankString;\r\n\t\t\t\r\n\t\t\tdouble x = i * (getWidth()/NDECADES) + SPACE;\r\n\t\t\tdouble y = 0;\r\n\t\t\t\r\n\t\t\tif(rank != 0) {\r\n\t\t\t\ty = GRAPH_MARGIN_SIZE + (getHeight() - GRAPH_MARGIN_SIZE*2) * rank/MAX_RANK - SPACE;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tlabel = name + \" *\";\r\n\t\t\t\ty = getHeight() - GRAPH_MARGIN_SIZE - SPACE;\r\n\t\t\t}\r\n\t\t\tGLabel nameLabel = new GLabel(label, x, y);\r\n\t\t\tint numb = entryNumber % NCOLORS;\r\n\t\t\tColor color = NewColor (numb);\r\n\t\t\tnameLabel.setColor(color);\r\n\t\t\tadd(nameLabel);\r\n\t\t}\r\n\t}", "public void outputNames(){\n System.out.printf(\"\\n%9s%11s\\n\",\"Last Name\",\"First Name\");\n pw.printf(\"\\n%9s%11s\",\"Last Name\",\"First Name\");\n ObjectListNode p=payroll.getFirstNode();\n while(p!=null){\n ((Employee)p.getInfo()).displayName(pw);\n p=p.getNext();\n }\n System.out.print(\"\\nNumber of Employees: \"+payroll.size()+\"\\n\");\n pw.print(\"\\nNumber of Employees: \"+payroll.size()+\"\\n\");\n }", "public void printGraph() {\n\t\tStringJoiner j = new StringJoiner(\", \");\n\t\tfor(Edge e : edgeList) {\n\t\t\tj.add(e.toString());\n\t\t}\n\t\t\n\t\tSystem.out.println(j.toString());\n\t}", "public void drawPlayerNames(Graphics g) {\n\t}", "public void printGraph()\n {\n Iterator<T> nodeIterator = nodeList.keySet().iterator();\n \n while (nodeIterator.hasNext())\n {\n GraphNode curr = nodeList.get(nodeIterator.next());\n \n while (curr != null)\n {\n System.out.print(curr.nodeId+\"(\"+curr.parentDist+\")\"+\"->\");\n curr = curr.next;\n }\n System.out.print(\"Null\");\n System.out.println();\n }\n }", "private void printGraph() {\r\n\t\tSortedSet<String> keys = new TreeSet<String>(vertexMap.keySet());\r\n\t\tIterator it = keys.iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tVertex v = vertexMap.get(it.next());\r\n\t\t\tif (v.isStatus())\r\n\t\t\t\tSystem.out.println(v.getName());\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(v.getName() + \" DOWN\");\r\n\t\t\tsortEdges(v.adjacent);\r\n\t\t\tfor (Iterator i = v.adjacent.iterator(); i.hasNext();) {\r\n\t\t\t\t// v.adjacent.sort();\r\n\t\t\t\tEdge edge = (Edge) i.next();\r\n\t\t\t\tif (edge.isStatus())\r\n\t\t\t\t\tSystem.out.println(\" \" + edge.getDestination() + \" \" + edge.getCost());\r\n\t\t\t\telse\r\n\t\t\t\t\tSystem.out.println(\" \" + edge.getDestination() + \" \" + edge.getCost() + \" DOWN\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void labelNames(){\n VBox holder = labelContainer.get(containerIndex);\n for(int i = 0; i < group.size(); ++i){\n Label s = (Label)holder.getChildren().get(i);\n s.setText(racers.get(group.get(i))[0] + \":\");\n }\n }", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(name);\n\t}", "public void addNames() {}", "public void addNames() {}", "public static void toDotFile(String methodname, DirectedGraph graph, String graphname) {\n int sequence = 0;\n // this makes the node name unique\n nodecount = 0; // reset node counter first.\n Hashtable nodeindex = new Hashtable(graph.size());\n\n // file name is the method name + .dot\n DotGraph canvas = new DotGraph(methodname);\n // System.out.println(\"onepage is:\"+onepage);\n if (!onepage) {\n canvas.setPageSize(8.5, 11.0);\n }\n\n canvas.setNodeShape(DotGraphConstants.NODE_SHAPE_BOX);\n canvas.setGraphLabel(graphname);\n\n Iterator nodesIt = graph.iterator();\n\n {\n while (nodesIt.hasNext()) {\n Object node = nodesIt.next();\n\n if (node instanceof List) {\n String listName = \"list\" + (new Integer(sequence++)).toString();\n String nodeName = makeNodeName(getNodeOrder(nodeindex, listName));\n listNodeName.put(node, listName);\n // System.out.println(\"put node: \"+node +\"into listNodeName\");\n\n }\n }\n }\n\n nodesIt = graph.iterator();\n while (nodesIt.hasNext()) {\n Object node = nodesIt.next();\n String nodeName = null;\n if (node instanceof List) {\n\n nodeName = makeNodeName(getNodeOrder(nodeindex, listNodeName.get(node)));\n } else {\n\n nodeName = makeNodeName(getNodeOrder(nodeindex, node));\n }\n Iterator succsIt = graph.getSuccsOf(node).iterator();\n\n while (succsIt.hasNext()) {\n Object s = succsIt.next();\n String succName = null;\n if (s instanceof List) {\n succName = makeNodeName(getNodeOrder(nodeindex, listNodeName.get(s)));\n } else {\n Object succ = s;\n // System.out.println(\"$$$$$$succ: \"+succ);\n // nodeName = makeNodeName(getNodeOrder(nodeindex, tag+\" \"+node));\n succName = makeNodeName(getNodeOrder(nodeindex, succ));\n // System.out.println(\"node is :\" +node);\n // System.out.println(\"find start node in pegtodotfile:\"+node);\n }\n\n canvas.drawEdge(nodeName, succName);\n }\n\n }\n\n // set node label\n if (!isBrief) {\n nodesIt = nodeindex.keySet().iterator();\n while (nodesIt.hasNext()) {\n Object node = nodesIt.next();\n // System.out.println(\"node is:\"+node);\n if (node != null) {\n // System.out.println(\"node: \"+node);\n String nodename = makeNodeName(getNodeOrder(nodeindex, node));\n // System.out.println(\"nodename: \"+ nodename);\n DotGraphNode dotnode = canvas.getNode(nodename);\n // System.out.println(\"dotnode: \"+dotnode);\n if (dotnode != null) {\n dotnode.setLabel(node.toString());\n }\n }\n }\n }\n\n canvas.plot(\"pecg.dot\");\n\n // clean up\n listNodeName.clear();\n }", "void setGraphLabel(String label);", "void printGraph() {\n System.out.println(\n \"All vertices in the graph are presented below.\\n\" +\n \"Their individual edges presented after a tab. \\n\" +\n \"-------\");\n\n for (Map.Entry<Vertex, LinkedList<Vertex>> entry : verticesAndTheirEdges.entrySet()) {\n LinkedList<Vertex> adj = entry.getValue();\n System.out.println(\"Vertex: \" + entry.getKey().getName());\n for (Vertex v : adj) {\n System.out.println(\" \" + v.getName());\n }\n }\n }", "void printPath(Coordinate endName) {\n if (!graph.containsKey(endName)) {\n // test use, display point\n // System.err.printf(\"Graph doesn't contain end vertex \\\"%s\\\"\\n\", endName);\n return;\n }\n graph.get(endName).printPath();\n }", "public String getGraphName()\n {\n return \"Testabilty Trend Report\";\n }", "static void giveName() {\n System.out.println(name);\n }", "public String vertexName();", "@Override\n\tpublic String toString() {\n\t\treturn \"[name:]\"+name;\n\t}", "public void printDGraph(){\n System.out.println(this.toString());\n }", "private void addVerticesToGraph()\n\t{\n\t\tString vertexName;\n\n\t\tMap<Long, IOFSwitch> switches = this.floodlightProvider.getSwitches();\n\t\tfor(IOFSwitch s :switches.values())\n\t\t{\n\t\t\tvertexName =Long.toString(s.getId());\n\t\t\tm_graph.addVertex(vertexName);\t\t\t \t\t\t \n\t\t}\n\t\tSystem.out.println(m_graph);\n\t}", "public void printGraph(){\n\t\tSystem.out.println(\"[INFO] Graph: \" + builder.nrNodes + \" nodes, \" + builder.nrEdges + \" edges\");\r\n\t}", "public void printRoutine()\n\t{\n\t\tfor (String name: vertices.keySet())\n\t\t{\n\t\t\tString value = vertices.get(name).toString();\n\t\t\tSystem.out.println(value);\n\t\t}\n\t}", "public void printVertices(PrintWriter os) {\n\n\n // Implement me!\n String s = \"\";\n for (String k : vertices.keySet()) {\n s = s + k + \" \";\n }\n os.println(s);\n\n\n }", "@Override\n\tpublic void writeFile(String hashname) {\n\t\tfor(CircosNode node : nodes){\n\t\t\tString useThisLabel = \"\";\n\t\t\tif(node.getLabel().length() > maxLabelLenght){\n\t\t\t\tuseThisLabel = node.getLabel().substring(0, maxLabelLenght) + \"...\";\n\t\t\t}else{\n\t\t\t\tuseThisLabel = node.getLabel();\n\t\t\t}\n\t\t\toutput += \"chr\" + Settings.CIRCOS_DELIMITER + \"-\" + Settings.CIRCOS_DELIMITER + node.getID() + Settings.CIRCOS_DELIMITER + useThisLabel + \n\t\t\t\t\tSettings.CIRCOS_DELIMITER + \"0\" + Settings.CIRCOS_DELIMITER + Math.round(node.getSzMetricValue()) + \n\t\t\t\t\tSettings.CIRCOS_DELIMITER + node.getID() + \"\\n\";\n\t\t}\n\t\tTools.createFile(Settings.CIRCOS_DATA_PREFIX+\"node\"+hashname+\".txt\", output);\n\t}", "public void PrintMe()\n\t{\n\t\t/**************************************/\n\t\t/* AST NODE TYPE = AST TYPE NAME NODE */\n\t\t/**************************************/\n\t\tSystem.out.format(\"NAME(%s):TYPE(%s)\\n\",name,type);\n\n\t\t/***************************************/\n\t\t/* PRINT Node to AST GRAPHVIZ DOT file */\n\t\t/***************************************/\n\t\tAST_GRAPHVIZ.getInstance().logNode(\n\t\t\tSerialNumber,\n\t\t\tString.format(\"NAME:TYPE\\n%s:%s\",name,type));\n\t}", "public void addName(NameRecord record)\n\t{\n\t\t// add code to add record to the graphArray \n\t\t// and call repaint() to update the graph\n\t}", "@Override\r\n\tpublic void name() {\n\t\tSystem.out.println(\"Hamilton\");\r\n\t}", "public String toString() {return name;}", "public static void main(String[] args) {\n NameGenerator n = new NameGenerator(true);\n // System.out.println(\"Random Names:\");\n // for (int i = 0; i < 10; i++) {\n // System.out.println(n.newName());\n // }\n // System.out.println();\n // System.out.println(\"Planet Names:\");\n // for (int i = 0; i < 10; i++) {\n // System.out.println(n.newPlanetName());\n // }\n for (int i = 0; i < 10; i++) {\n System.out.println();\n String system = n.newName();\n System.out.printf(\"System: %s, Planets:%n\", system);\n for (String p: n.planetNames(5, system)) {\n System.out.println(p);\n }\n }\n // System.out.println();\n // System.out.println(\"Human Names:\");\n // for (int i = 0; i < 10; i++) {\n // System.out.println(n.newHumanName());\n // }\n\n }", "@Override//overring a library function\n public String toString() {\n return shape + \" \" + name;//toString() is called everytime printing is done\n }", "public void printInformation() {\n\n System.out.println(\"Name: \" + name);\n System.out.println(\"Weight: \" + weight);\n System.out.println(\"Shape: \" + shape);\n System.out.println(\"Color: \" + color);\n }", "@Override\n public String toString() {\n String str = \"graph [\\n\";\n\n Iterator<Node<E>> it = iterator();\n\n //Node display\n while(it.hasNext()){\n Node n = it.next();\n\n str += \"\\n\\tnode [\";\n str += \"\\n\\t\\tid \" + n;\n str += \"\\n\\t]\";\n }\n\n //Edge display\n it = iterator();\n\n while(it.hasNext()){\n Node n = it.next();\n\n Iterator<Node<E>> succsIt = n.succsOf();\n while(succsIt.hasNext()){\n Node succN = succsIt.next();\n\n str += \"\\n\\tedge [\";\n str += \"\\n\\t\\tsource \" + n;\n str += \"\\n\\t\\ttarget \" + succN;\n str += \"\\n\\t\\tlabel \\\"Edge from node \" + n + \" to node \" + succN + \" \\\"\";\n str += \"\\n\\t]\";\n }\n }\n\n str += \"\\n]\";\n\n return str;\n }", "private void showTitleConnected( String name ) {\n\t\tshowTitle( getTitleConnected( name ) );\t\n\t}", "public void setVertexName(String newName)\n\t{\n\t\tvertexName = newName ;\n\t}", "@Override\n public String toString(){\n return name;\n }", "@Override\r\n public String toString() {\r\n return name;\r\n }", "public void print(){\n String res = \"\" + this.number;\n for(Edge edge: edges){\n res += \" \" + edge.toString() + \" \";\n }\n System.out.println(res.trim());\n }", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name;\n\t}", "@Override\n public String toString()\n {\n return (name);\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn name;\r\n\t}", "@Override\n public String toString() {\n return name;\n }", "public void getName(String name)\n {\n System.out.println(type + \" : \" + name);\n }", "@Override\n\t\tpublic String toString()\n\t\t{\n\t\t\treturn name;\n\t\t}", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "@Override\n public String toString() {\n return name;\n }", "private static void readAndWriteNodes(String name) throws IOException {\n System.out.println(name);\n Map<Long, Long> nodeMap = new HashMap<>();\n boolean firstLine = true;\n fileReader = new BufferedReader(new FileReader(PATH + name));\n fileWriter = new BufferedWriter(new FileWriter(PATH + \"/uid/\" + name));\n String line;\n while ((line = fileReader.readLine()) != null) {\n if (!firstLine) {\n long globalId = getGlobalId();\n String[] lineTokens = LINE_TOKEN_SEPARATOR.split(line);\n long ID = Long.parseLong(lineTokens[0]);\n nodeMap.put(ID, globalId);\n String writeLine = \"\";\n for (int i = 0; i < lineTokens.length; i++) {\n if (i == 0) {\n writeLine += globalId;\n } else {\n writeLine += lineTokens[i];\n }\n writeLine += \"|\";\n }\n fileWriter.write(writeLine);\n fileWriter.newLine();\n vertexCount++;\n globalVertexCount++;\n } else {\n fileWriter.write(line);\n fileWriter.newLine();\n firstLine = false;\n }\n }\n fileWriter.close();\n fileReader.close();\n counterMapNodes.put(name, vertexCount);\n vertexCount = 0;\n vertexList.add(nodeMap);\n }", "private String vertexNamesAndCoordsToString() {\n \n //make empty string\n String s = \"\";\n \n //add # of vertices & line break\n s += N + \"\\n\";\n \n //for loop to add names/coords to it\n for (int i = 0; i < arrayOfVertices.length; i++) {\n \n //add vertex name, xcoord, & ycoord separated by spaces \n s += arrayOfVertices[i].getName() + \" \" \n + arrayOfVertices[i].getX() + \" \" \n + arrayOfVertices[i].getY() + \"\\n\"; \n \n }\n \n //return the string\n return s;\n \n }", "public void printGraphStructure() {\n\t\tSystem.out.println(\"Vector size \" + nodes.size());\n\t\tSystem.out.println(\"Nodes: \"+ this.getSize());\n\t\tfor (int i=0; i<nodes.size(); i++) {\n\t\t\tSystem.out.print(\"pos \"+i+\": \");\n\t\t\tNode<T> node = nodes.get(i);\n\t\t\tSystem.out.print(node.data+\" -- \");\n\t\t\tIterator<EDEdge<W>> it = node.lEdges.listIterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tEDEdge<W> e = it.next();\n\t\t\t\tSystem.out.print(\"(\"+e.getSource()+\",\"+e.getTarget()+\", \"+e.getWeight()+\")->\" );\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "@Override public String toString()\n {\n return name;\n }", "public void print() {\n System.out.println(\"Person of name \" + name);\n }", "public static void printGraph( Graph graph ){\n\t\tint size = graph.getGraph().size();\n\t\tStringBuilder sb = new StringBuilder(); \n\t\tint weight = 0;\n\t\tfor( String start: graph.getGraph().keySet() ) {\n\t\t\tfor( String end : graph.getGraph().get(start).keySet() ) {\n\t\t\t\tweight = graph.getGraph().get(start).get(end);\n\t\t\t\tsb.append( start + end + String.valueOf(weight) + \", \" );\n\t\t\t}\n\t\t}\n\t\tsb.delete(sb.length()-2, sb.length());\n\t\tSystem.out.println(sb.toString());\n\t}", "public void print() {\n\t\tint i = 1;\n\t\tfor (String s: g.keySet()) {\n\t\t\tSystem.out.print(\"Element: \" + i++ + \" \" + s + \" --> \");\n\t\t\tfor (String k: g.get(s)) {\n\t\t\t\tSystem.out.print(k + \" ### \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public NameSurferGraph() {\r\n\t\taddComponentListener(this);\r\n\t\tentryGraph = new ArrayList<NameSurferEntry>();\r\n\t}", "public String toString()\n\t{\n\t \n\t\tString str = vertexName + \": \" ;\n\t\tfor(int i = 0 ; i < adjacencyList.size(); i++)\n\t\t\tstr = str + adjacencyList.get(i).vertexName + \" \";\n\t\treturn str ;\n\t\t\n\t}", "void printNodesWithEdges()\n {\n for ( int i = 0; i < this.numNodes; i++ )\n {\n Node currNode = this.nodeList.get(i);\n System.out.println(\"Node id: \" + currNode.id );\n \n int numEdges = currNode.connectedNodes.size();\n for ( int j = 0; j < numEdges; j++ )\n {\n Node currEdge = currNode.connectedNodes.get(j);\n System.out.print(currEdge.id + \",\");\n }\n\n System.out.println();\n } \n\n \n }", "static void showGraph(ArrayList<ArrayList<Integer>> graph) {\n for(int i=0;i< graph.size(); i++ ){\n System.out.print(\"Vertex : \" + i + \" : \");\n for(int j = 0; j < graph.get(i).size(); j++) {\n System.out.print(\" -> \"+ graph.get(i).get(j));\n }\n }\n }", "public String apGraph() {\n if(root != null){\n root.nameAvl();\n return doBigGraph();\n }else{\n return \"\";\n }\n }", "private static void printGraph(ArrayList<Vertex> graph) {\n\t\tSystem.out.print(\"---GRAPH PRINT START---\");\n\t\tfor (Vertex vertex: graph) {\n\t\t\tSystem.out.println(\"\\n\\n\" + vertex.getValue());\n\t\t\tSystem.out.print(\"Adjacent nodes: \");\n\t\t\tfor (Vertex v: vertex.getAdjacencyList()) {\n\t\t\t\tSystem.out.print(v.getValue() + \" \");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"\\n\\n---GRAPH PRINT END---\\n\\n\");\n\t}", "void printNode() {\n\t\tint j;\n\t\tSystem.out.print(\"[\");\n\t\tfor (j = 0; j <= lastindex; j++) {\n\n\t\t\tif (j == 0)\n\t\t\t\tSystem.out.print (\" * \");\n\t\t\telse\n\t\t\t\tSystem.out.print(keys[j] + \" * \");\n\n\t\t\tif (j == lastindex)\n\t\t\t\tSystem.out.print (\"]\");\n\t\t}\n\t}", "public void plot() {\n // TODO: Implement this method\n System.out.printf(\"%10s : [\",this.label);\n for (int i=1;i<=this.value;i++) {\n System.out.print(\"#\");\n }\n System.out.printf(\"] (%d)\\n\",this.value);\n }", "@Override\n public void infixDisplay() {\n System.out.print(name);\n }", "public abstract String beginGraphString();", "public void displayNames()\r\n {\r\n // ensure there is at least one Cat in the collection\r\n if (catCollection.size() > 0) {\r\n System.out.println(\"The current guests in \"+businessName);\r\n for (Cat eachCat : catCollection) {\r\n System.out.println(eachCat.getName());\r\n }\r\n }\r\n else {\r\n System.out.println(businessName + \" is empty!\");\r\n }\r\n }", "@Override public String toString() {\n return name;\n }", "@Override\n\tpublic void setNodeName(String name) {\n\n\t}", "public static void userDisplay() {\n\n String nameList = \" | \";\n for (String username : students.keySet()) {\n nameList += \" \" + username + \" | \";\n\n\n }\n System.out.println(nameList);\n// System.out.println(students.get(nameList).getGrades());\n\n }", "@Override\n public final String toString() {\n return name;\n }", "@Override\n public final String toString() {\n return name;\n }", "public void printAnnuaireName() {\n\t\t\n\t}", "@Override\n public String toString() {\n return \"[\" + this.name + \"]\";\n }" ]
[ "0.7200291", "0.69348705", "0.67021656", "0.66284215", "0.6583168", "0.65821326", "0.6564045", "0.6528306", "0.63781476", "0.6298156", "0.62299776", "0.61479557", "0.61046976", "0.61021936", "0.60911536", "0.6068993", "0.606867", "0.60634416", "0.60412496", "0.60332334", "0.6024895", "0.6021588", "0.6021588", "0.6017674", "0.600785", "0.5992156", "0.5944799", "0.59365577", "0.5936392", "0.5888541", "0.58882976", "0.5884252", "0.5870443", "0.5867566", "0.5846239", "0.5841202", "0.58355373", "0.58256257", "0.5819466", "0.58089256", "0.5801957", "0.57948357", "0.5783266", "0.5771152", "0.57688665", "0.5766479", "0.57519406", "0.5749738", "0.5737574", "0.5723634", "0.5723526", "0.5721344", "0.5721344", "0.5721344", "0.5721344", "0.5721344", "0.5721344", "0.5721344", "0.5721344", "0.5721344", "0.5720784", "0.57203645", "0.5715478", "0.5714834", "0.5708882", "0.569898", "0.569898", "0.569898", "0.569898", "0.569898", "0.569898", "0.569898", "0.569898", "0.569898", "0.569898", "0.569898", "0.568699", "0.5686391", "0.56687933", "0.5667952", "0.56678206", "0.56668955", "0.56619394", "0.5655944", "0.5655419", "0.56509864", "0.56502277", "0.5639681", "0.56344074", "0.5624103", "0.5617215", "0.5616489", "0.5612755", "0.5604925", "0.5601354", "0.5599209", "0.5594182", "0.5593785", "0.5593785", "0.5591604", "0.55898386" ]
0.0
-1
changes the color of a GObject accordingly
private void changeTheColor(GObject object, int i) { if (i % 4 == 0) { object.setColor(Color.BLACK); } else if (i % 4 == 1) { object.setColor(Color.RED); } else if (i % 4 == 2) { object.setColor(Color.BLUE); } else if (i % 4 == 3) { object.setColor(Color.YELLOW); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setColor(){\n this.objectColour = new Color(rValue,gValue,bValue,timeToLive).brighter();\n }", "@Override\n\tpublic void setColour(float r, float g, float b) {\n\n\t}", "public abstract boolean atomicChangeObjectColor(Object dst, int oldColor, int newColor);", "public void setColor(int r, int g, int b);", "void setColor(int r, int g, int b);", "public void setObjectColor(GObject object, Color color) {\n\t\tobject.setColor(color);\n\t}", "public void setColor(Color newColor) ;", "public void setColour(Colour colour);", "public void setColor(float r, float g, float b, float a);", "private void changeShapeColor(int r, int g, int b)\n\t{\n\t\tthis.red = r;\n\t\tthis.green = g;\n\t\tthis.blue = b;\n\t}", "public void setColor(Color c);", "public void setColor(int color);", "public void setColor(int color);", "public void setColor(Color color);", "public void changeColor(){\r\n if(color == 1)\r\n color = 2;\r\n else\r\n color = 1;\r\n }", "public void setColor(int color) {\n/* 77 */ this.color = color;\n/* 78 */ this.paint.setColor(this.color);\n/* */ }", "public void setColor()\n {\n if (wall != null) // only if it's painted already...\n {\n wall.changeColor(\"red\");\n window.changeColor(\"black\");\n roof.changeColor(\"green\");\n sun.changeColor(\"yellow\");\n }\n }", "public void setColor()\n {\n if(wall != null) // only if it's painted already...\n {\n wall.changeColor(\"yellow\");\n window.changeColor(\"black\");\n roof.changeColor(\"red\");\n sun.changeColor(\"yellow\");\n }\n }", "public void setColor()\n {\n if(wall != null) // only if it's painted already...\n {\n wall.changeColor(\"red\");\n window.changeColor(\"black\");\n roof.changeColor(\"green\");\n sun.changeColor(\"yellow\");\n }\n }", "public void setColor(int value);", "@Override // Override GameObject setColor\n @Deprecated // Deprecated so developer does not accidentally use\n public void setColor(int color) {\n }", "public void setColor(Color c) { color.set(c); }", "private void colorObject(String node, Color color) {\r\n pMap.get(node).changeColor(\"\", color, null, null);\r\n }", "public void red() {\n g2.setPaint(Color.red);\r\n }", "private final void shade(Object value) throws UninterruptiblePragma {\n if (value != null) {\n while (true) {\n final int gcColor = VmMagic.getObjectColor(value);\n if (gcColor > ObjectFlags.GC_WHITE) {\n // Not white or yellow, we're done\n return;\n }\n if (helper.atomicChangeObjectColor(value, gcColor,\n ObjectFlags.GC_GREY)) {\n // Change to grey, we're done\n changed = true;\n return;\n }\n }\n }\n }", "public void onUpdateColor() {\n getVertexBufferObject().onUpdateColor(this);\n }", "void setStatusColour(Color colour);", "public void setColor()\n {\n if(eyeL != null) // only if it's painted already...\n {\n eyeL.changeColor(\"yellow\");\n eyeR.changeColor(\"yellow\");\n nose.changeColor(\"green\");\n mouthM.changeColor(\"red\");\n mouthL.changeColor(\"red\");\n mouthR.changeColor(\"red\");\n }\n }", "private native void setModelColor(float r,float g,float b);", "public void setColor(String c);", "public void setColor(Graphics2D g){\r\n if(color.equals(\"yellow\") || color.equals(\"Yellow\"))\r\n g.setColor(Color.yellow);\r\n if(color.equals(\"red\") || color.equals(\"Red\"))\r\n g.setColor(Color.red);\r\n if(color.equals(\"blue\") || color.equals(\"Blue\"))\r\n g.setColor(Color.blue);\r\n \r\n }", "boolean changeColor(Color newColor){\n boolean change=false;\r\n\r\n if (fShapes.size() > 0) {\r\n Iterator iter = fShapes.iterator();\r\n\r\n while (iter.hasNext()) {\r\n TShape theShape = (TShape) iter.next();\r\n\r\n if (theShape.getSelected()) {\r\n theShape.setColor(newColor);\r\n change = true;\r\n }\r\n }\r\n }\r\n\r\n if (!change){\r\n TShape prototype=fPalette.getPrototype();\r\n\r\n if (prototype!=null)\r\n prototype.setColor(newColor);\r\n fPalette.repaint(); // no listeners for change in the palette\r\n }\r\n\r\n return\r\n change; // to drawing itself\r\n }", "public void setColor( GraphColor newVal ) {\n color = newVal;\n }", "public void useStarObjectColor ( ) {\r\n\t\tcolor = null;\r\n\t}", "public void green() {\n g2.setPaint(Color.green);\r\n }", "public void Color() {\n\t\t\r\n\t}", "void setRed(int x, int y, int value);", "void setGreen(int x, int y, int value);", "protected abstract void updateShapeColor(Color color);", "public void setColor(Color color) {\n this.color = color;\n }", "@Override\n public void excute() {\n drawable.setColor(color);\n }", "public static void update(){\n\t\t\n\t\tgraphFrame.setColor(color);\n\t}", "public void setFillColor(Color color);", "private static void changeColor(Orange apple) {\n\t\tapple.color = \"green\";\n\t\t\n\t}", "public void setColor(int gnum, Color col);", "void setCor(Color cor);", "public void setColor(RMColor aColor)\n{\n // Set color\n if(aColor==null) setFill(null);\n else if(getFill()==null) setFill(new RMFill(aColor));\n else getFill().setColor(aColor);\n}", "public void blue() {\n g2.setPaint(Color.blue);\r\n }", "@Override\r\n\tpublic void howToColor() {\n\t\t\r\n\t}", "public abstract void setColor(Color color);", "public abstract void setColor(Color color);", "void setColor(Vector color);", "private void setColor() {\n cell.setStroke(Color.GRAY);\n\n if (alive) {\n cell.setFill(aliveColor);\n } else {\n cell.setFill(deadColor);\n }\n }", "private void updateColor() {\n int redShift = red << 16; // red: 0xRR0000 <- 0xRR\n int greenShift = green << 8; // red: 0xGG00 <- 0xGG\n int blueShift = blue; // blue: 0xBB <- 0xBB\n int alphaShift = 0xff << 24; // alpha 0xff000000 <- 0xff // we don't want our color to be transparent.\n int color = alphaShift | redShift | greenShift | blueShift;\n viewColor.setBackgroundColor(color);\n }", "public void setRrColor(Color value) {\n rrColor = value;\n }", "void setBlue(int x, int y, int value);", "public void modeColor(Graphics2D g2d) { g2d.setColor(RTColorManager.getColor(\"label\", \"default\")); }", "private void\tsetColor(GL2 gl, int r, int g, int b, int a)\n\t{\n\t\tgl.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);\n\t}", "public void setColor(Color that){\r\n \t//set this to that\r\n this.theColor = that;\r\n if(this.theColor.getRed() == 255 && this.theColor.getGreen() == 0 && this.theColor.getBlue() == 0){\r\n this.theColor = Color.red;\r\n }\r\n if(this.theColor.getRed() == 0 && this.theColor.getGreen() == 0 && this.theColor.getBlue() == 255){\r\n this.theColor = Color.black;\r\n }\r\n if(this.theColor.getRed() == 0 && this.theColor.getGreen() == 255 && this.theColor.getBlue() == 0){\r\n this.theColor = Color.green;\r\n }\r\n }", "public void setColor(Color newColor) {\n\tcolor = newColor;\n }", "public void setDataColor(Color c)\r\n/* 48: */ {\r\n/* 49: 36 */ this.ballColor = c;repaint();\r\n/* 50: */ }", "public void saveColor()\r\n\t{\r\n\t\tsavedColor = g.getColor();\r\n\t}", "public void setColor(Color newColor)\n {\n this.color = newColor;\n conditionallyRepaint();\n }", "public void color(Color the_color) {\n \n }", "void setColor(float r, float g, float b) {\n color c = color(r, g, b);\n for(int x = 0; x < _img.width; x++) {\n for(int y = 0; y < _img.height; y++) {\n _img.set(x, y, c);\n }\n }\n }", "public void setRectColor(Graphics g, int colorInt) {\n if (colorInt == 0) {\n g.setColor(Color.white);\n }else if (colorInt == 1) {\n g.setColor(Color.orange);\n }else if (colorInt == 2) {\n Color lblue = new Color(200, 220, 255);\n g.setColor(lblue); //LIGHTER\n }else if (colorInt == 3) {\n g.setColor(Color.yellow);\n }else if (colorInt == 4) {\n g.setColor(Color.green);\n }else if (colorInt == 5) {\n g.setColor(Color.red); //LIGHTER\n }else if (colorInt == 6) {\n g.setColor(Color.gray);\n }else if (colorInt == 7) {\n Color purple = new Color(206, 103, 218);\n g.setColor(purple);\n }\n }", "public void changeColor(Color c){\n switch(identifier){\n case \"FillRec\":\n fillrec.setBackground(c);\n break;\n case \"FillOval\":\n filloval.setBackground(c);\n break;\n case \"EmptyRec\":\n emptyrec.setBackground(c);\n break;\n case \"EmptyOval\":\n emptyoval.setBackground(c);\n break;\n case \"LineDraw\":\n linedraw.setBackground(c);\n break;\n case \"ColorChooser\":\n opencolor.setBackground(c);\n break;\n }\n }", "public void PRCRender() {\n if(rollOver) {\n object.getStyle().setFillColorFloat(20);\n } else if(dragging) {\n object.getStyle().setFillColorFloat(5);\n } else {\n object.style.setFillColorFloat(100);\n }\n object.render();\n }", "public void setColor(String c)\n { \n color = c;\n draw();\n }", "public void setColor(RGBColor color){\r\n this._color = new RGBColor(color);\r\n }", "public void makeRectangleColorChange() {\n final Timeline timeline = new Timeline();\n // The rectangle should continue blinking forever.\n timeline.setCycleCount(Timeline.INDEFINITE);\n RectangleBlinkEventHandler cursorChange = new RectangleBlinkEventHandler();\n KeyFrame keyFrame = new KeyFrame(Duration.seconds(0.5), cursorChange);\n timeline.getKeyFrames().add(keyFrame);\n timeline.play();\n }", "void setColor(@ColorInt int color);", "public void setColor(int red, int green, int blue){\r\n this.red = red;\r\n this.green = green;\r\n this.blue = blue;\r\n }", "public void setColor(Color another)\r\n {\r\n currentColor = another;\r\n }", "public void setColor(Color c) {\n color = c;\n }", "public void setColor(Color color) {\n this.color = color;\r\n }", "public void setColor(int color){\n this.color = color;\n }", "@Override\n public ShapeColor setColor(int r, int g, int b) {\n return new ShapeColor(r, g, b);\n }", "@Override public void setColor(Color c) \n\t{\n\t\tc2 = c1; c1 = c.dup();\n\t}", "synchronized private void changeColor()\n {\n if ( ++colorIndex == someColors.length )\n colorIndex = 0;\n setForeground( currentColor() );\n repaint();\n }", "@Override\n public String getType() {\n return \"Color change\";\n }", "public void resetColor(){\n myRectangle.setFill(PADDLE_COLOR);\n }", "public void changeColor(View v) {\n\n if (i_act_id > 0) {\n ImageView img = (ImageView) findViewById(ID_PlacementMode_BrickPreview_ImageView);\n\n // release old brick\n if (objBrickPreview != null) {\n objBlockFactory.ReleaseBlock(objBrickPreview);\n objBrickPreview = null;\n b_brick_is_placeable = false;\n }\n\n // get actual selected shape\n BlockShape block_shape = map_id_to_bricks.get(i_act_id);\n\n // get color from id\n BlockColor block_color = map_id_to_color.get(v.getId());\n\n // if block is available pick up\n if (objBlockFactory.IsBlocktypeAvailable(block_shape, block_color)) {\n img.setColorFilter(map_blockcolor_to_int.get(block_color));\n objBrickPreview = objBlockFactory.Allocate(block_shape, block_color);\n objBrickPreview.setRotation(BlockRotation.DEGREES_0);\n\n // Allowing a view to be dragged\n findViewById(ID_PlacementMode_BrickPreview_ImageView).setOnTouchListener(new BrickTouchListener());\n\n // set flag that brick is placeable\n b_brick_is_placeable = true;\n }\n }\n updateView();\n\n }", "@Override\n\tpublic void changeColor2(Color color) {\n\n\t}", "private void changeColors(){\n \n Color vaccanceColor = vaccance.getValue();\n String vaccRGB = getRGB(vaccanceColor);\n databaseHandler.setTermColor(\"vaccance\", vaccRGB);\n \n Color travailColor = travail.getValue();\n String travailRGB = getRGB(travailColor);\n databaseHandler.setTermColor(\"travail\", travailRGB);\n \n Color AnnivColor = anniverssaire.getValue();\n String summerSemRGB = getRGB(AnnivColor);\n databaseHandler.setTermColor(\"annivessaire\", summerSemRGB);\n \n Color formationColor = formation.getValue();\n String formationRGB = getRGB(formationColor);\n databaseHandler.setTermColor(\"formation\", formationRGB);\n \n Color workshopColor = workshop.getValue();\n String workshopRGB = getRGB(workshopColor);\n databaseHandler.setTermColor(\"workshop\", workshopRGB);\n \n Color certifColor = certif.getValue();\n String certifRGB = getRGB(certifColor);\n databaseHandler.setTermColor(\"certif\", certifRGB);\n \n Color importantColor = important.getValue();\n String importantRGB = getRGB(importantColor);\n databaseHandler.setTermColor(\"important\", importantRGB);\n \n Color urgentColor = urgent.getValue();\n String allHolidayRGB = getRGB(urgentColor);\n databaseHandler.setTermColor(\"urgent\", allHolidayRGB);\n \n \n \n }", "void setColorWithRedraw(@ColorInt int color) {\n/* 167 */ this.mPaint.setColor(color);\n/* 168 */ onRedrawIfInitialized();\n/* */ }", "private void switchColor(Node node) {\n Circle temp = (Circle) node;\n\n if (isRed) {\n temp.setFill(Paint.valueOf(\"Red\"));\n turnCircle.setFill(Paint.valueOf(\"Blue\"));\n turnDisplay.setText(aiTurn);\n isRed = false;\n } else {\n temp.setFill(Paint.valueOf(\"Blue\"));\n turnCircle.setFill(Paint.valueOf(\"Red\"));\n turnDisplay.setText(humanTurn);\n isRed = true;\n }\n }", "public void setColor(Color c) {\n this.color = c;\n }", "public void chooseColor() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t}", "private void green(){\n\t\tthis.arretes_fG();\n\t\tthis.coins_fG();\n\t\tthis.coins_a1G();\n\t\tthis.coins_a2G();\n\t\tthis.aretes_aG();\n\t\tthis.cube[31] = \"G\";\n\t}", "public void highlight(){\n myRectangle.setFill(HIGHLIGHT);\n }", "public void setColour(String colour) {\n this.colour = colour;\n }", "public void setSurfaceColor(int color){\r\n\r\n this.surface.setColor(color);\r\n }", "public final native void setFill(Colour colour) /*-{\n\t\tthis.setFill([email protected]::toString()());\n\t}-*/;", "@Override\n public void update(Observable o, Object arg) {\n if (arg instanceof Color && this.shapeSelected()) {\n Color color = (Color) arg;\n this.selectedShape.setColor(color);\n }\n }", "public void set_color(String color){ color_ = GralColor.getColor(color.trim()); }", "public void setCarColor(){\n\t\tthis.carColor = \"white\";\n\t}", "Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }", "public void\nsetSpecularElt( SbColor color )\n//\n{\n this.coinstate.specular.copyFrom(color);\n}", "public void setColor(Color clr){\n color = clr;\n }" ]
[ "0.76087236", "0.7040881", "0.70195544", "0.6995607", "0.6966906", "0.6942278", "0.691024", "0.6880329", "0.68529695", "0.6809004", "0.6721261", "0.66485476", "0.66485476", "0.66484016", "0.6630421", "0.662469", "0.6614949", "0.65924346", "0.6590575", "0.6575893", "0.6552079", "0.65505433", "0.6544143", "0.6510954", "0.648574", "0.64836985", "0.64524055", "0.64267915", "0.63731474", "0.6372908", "0.63659024", "0.6360439", "0.63455844", "0.6334143", "0.6317298", "0.63158", "0.62930346", "0.6283716", "0.62758416", "0.6274465", "0.6272309", "0.62579834", "0.6255192", "0.62500095", "0.6243137", "0.620197", "0.61994535", "0.61746687", "0.6174393", "0.6172398", "0.6172398", "0.6171946", "0.6148368", "0.6126619", "0.6108974", "0.6104072", "0.6098051", "0.6091163", "0.60884774", "0.6085724", "0.6085176", "0.6078759", "0.60720843", "0.60615146", "0.6058974", "0.6057727", "0.60453826", "0.604458", "0.60247076", "0.60162807", "0.5984152", "0.5983497", "0.5979154", "0.5960498", "0.5959565", "0.5956736", "0.59499824", "0.5940329", "0.5932853", "0.59324694", "0.5928533", "0.59225386", "0.59216297", "0.59156066", "0.59060055", "0.5902738", "0.58985496", "0.58960277", "0.58895683", "0.5869781", "0.5868691", "0.5864868", "0.58538336", "0.584969", "0.584243", "0.5837904", "0.5822088", "0.5821229", "0.5809629", "0.5801778" ]
0.7052066
1
draws the vertical and horizontal lines, adds decade labels
private void drawBackGround() { double diff = getWidth() / NDECADES; double xcrd = 0; int year = START_DECADE; for (int i = 0; i < NDECADES; i++) { String yearStr = year + ""; add(new GLine(xcrd, 0, xcrd, getHeight())); add(new GLabel(yearStr, xcrd, getHeight())); xcrd = xcrd + diff; year = year + 10; } double ycrd = GRAPH_MARGIN_SIZE; add(new GLine(0, ycrd, getWidth(), ycrd)); add(new GLine(0, getHeight() - ycrd, getWidth(), getHeight() - ycrd)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void drawGraph() {\n\t\t//draw vertical (decade) lines\n\t\tdouble deltaX = getWidth() / NDECADES;\n\t\tfor (int i = 0; i < NDECADES; i++) {\n\t\t\tGLine decadeLine = new GLine(i * deltaX, getHeight(),\n\t\t\t\t\t\t\t\t\t\t i * deltaX, 0);\n\t\t\tadd(decadeLine);\n\t\t}\n\t\t\n\t\t//draw horizontal (margin) lines\n\t\tGLine topMargin = new GLine(0, GRAPH_MARGIN_SIZE,\n\t\t\t\t\t\t\t\t\tgetWidth(), GRAPH_MARGIN_SIZE);\n\t\tadd(topMargin);\n\t\tGLine botMargin = new GLine(0, getHeight() - GRAPH_MARGIN_SIZE,\n\t\t\t\t\t\t\t\t\tgetWidth(), getHeight() - GRAPH_MARGIN_SIZE);\n\t\tadd(botMargin);\n\t\t\n\t\t//draw decade labels\n\t\tint year = START_DECADE;\n\t\tfor (int j = 0; j < NDECADES; j++) {\n\t\t\tGLabel label = new GLabel(Integer.toString(year));\n\t\t\tadd(label, j * deltaX, getHeight());\n\t\t\tyear += 10;\n\t\t}\n\t}", "private void drawVerticalLines() {\r\n\t\tfor(int i=0;i<NDECADES;i++){\r\n\r\n\t\t\tdouble x1 = i* (getWidth()/NDECADES);\r\n\t\t\tdouble x2 = x1;\r\n\t\t\tdouble y1 = START_Y;\r\n\t\t\tdouble y2 = getHeight();\r\n\r\n\t\t\tdrawLine(x1,y1,x2,y2);\r\n\t\t}\r\n\t}", "private void plotDecades() {\r\n\r\n\t\tfor(int i=0;i<NDECADES;i++){\r\n\t\t\tint year = START_DECADE;\r\n\t\t\tyear += 10*i;\r\n\t\t\tString decade = Integer.toString(year);\r\n\t\t\tdouble x = i * (getWidth()/NDECADES) + SPACE;\r\n\t\t\tdouble y = getHeight() - GRAPH_MARGIN_SIZE/4;\r\n\t\t\tGLabel decadeLabel = new GLabel (decade, x, y);\r\n\t\t\tadd(decadeLabel);\t\r\n\t\t}\r\n\t}", "private void drawVerticalLines(GenericTabItem tab)\n\t{\n\t\tfor(Long cpuId : vLines.keySet())\n\t\t{\n\t\t\tVector<Line> cpuLines = vLines.get(cpuId);\n\n\t\t\t//Calculate line coordinates\n\t\t\tPoint cpuCoordinate = cpuCoordinates.get(cpuId);\n\t\t\tint lineXStartPos = cpuCoordinate.x;\n\t\t\tint lineXPos = lineXStartPos;\n\t\t\tint lineXOffset = (int)(CPU_WIDTH.intValue() / (cpuLines.size()+1));;\t\t\n\n\t\t\tfor(Line line : cpuLines)\n\t\t\t{\n\t\t\t\tlineXPos += lineXOffset;\n\t\t\t\t\n\t\t\t\t//Update x coordinates to match cpu coordinates\n\t\t\t\tPoint cpuStart = line.getStart();\n\t\t\t\tcpuStart.setX(lineXPos);\t\t\t\n\t\t\t\tPoint cpuEnd = line.getEnd();\n\t\t\t\tcpuEnd.setX(lineXPos);\n\t\t\t\t\n\t\t\t\tline.setStart(cpuStart);\n\t\t\t\tline.setEnd(cpuEnd);\t\t\n\t\t\t\ttab.addFigure(line);\n\t\t\t\t\n\t\t\t\t//Save x coordinate if this is the first or last connection on the horizontal lines\n\t\t\t\tLine busLine = hLines.get(new Long(cpuEnd.y));\n\t\t\t\tPoint busStart = busLine.getStart();\n\t\t\t\tPoint busEnd = busLine.getEnd();\n\t\t\t\t\n\t\t\t\tif(busStart.x > lineXPos || busStart.x == 0)\n\t\t\t\t\tbusStart.setX(lineXPos);\n\t\t\t\t\n\t\t\t\tif(busEnd.x < lineXPos)\n\t\t\t\t\tbusEnd.setX(lineXPos);\t\n\t\t\t\t\n\t\t\t\tbusLine.setStart(busStart);\n\t\t\t\tbusLine.setEnd(busEnd);\n\t\t\t}\t\t\n\t\t}\n\t}", "@Override\r\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\r\n\r\n // draw the notes, black and green\r\n for (INote n : no.getNotes()) {\r\n int x = (n.getStartBeat() + 2) * beatWidth;\r\n int y = ((no.highestNote().getNoteNumber() - n.getNoteNumber()) * lineHeight)\r\n + (lineHeight * 2);\r\n\r\n g.setColor(Color.BLACK);\r\n g.fillRect(x, y, beatWidth, lineHeight);\r\n\r\n for (int ii = 1; ii < n.getDuration(); ii++) {\r\n g.setColor(Color.GREEN);\r\n g.fillRect(x + (ii * beatWidth), y, beatWidth, lineHeight);\r\n }\r\n }\r\n\r\n g.setColor(Color.BLACK);\r\n\r\n //draw the row labels and lines\r\n int y1 = (lineHeight * 3) / 2;\r\n int y2 = lineHeight;\r\n\r\n g.drawLine((beatWidth * 2) - 1, (lineHeight * 2) - 1,\r\n (totalBeats + 2) * beatWidth, (lineHeight * 2) - 1);\r\n\r\n for (String row : this.rows()) {\r\n g.drawString(row, 0, y1 + g.getFontMetrics().getHeight());\r\n y1 += lineHeight;\r\n g.drawLine(beatWidth * 2, y2 + lineHeight, (totalBeats + 2) * beatWidth, y2 + lineHeight);\r\n y2 += lineHeight;\r\n g.drawLine(beatWidth * 2, y2 + lineHeight - 1,\r\n (totalBeats + 2) * beatWidth, y2 + lineHeight - 1);\r\n }\r\n g.drawLine((beatWidth * 2) - 1, y2 + lineHeight,\r\n (totalBeats + 2) * beatWidth, y2 + lineHeight);\r\n\r\n //draw the column labels and lines\r\n int x1 = -(beatWidth * 2);\r\n int x2 = -(beatWidth * 2);\r\n\r\n g.drawLine((beatWidth * 2) - 1, lineHeight * 2, (beatWidth * 2) - 1, y2 + lineHeight - 1);\r\n\r\n for (int value : this.columns()) {\r\n g.drawString(Integer.toString(value), x1 + (beatWidth * 4), g.getFontMetrics().getHeight());\r\n x1 += (beatWidth * 4);\r\n g.drawLine(x2 + (beatWidth * 4), lineHeight * 2, x2 + (beatWidth * 4), y2 + lineHeight - 1);\r\n x2 += (beatWidth * 4);\r\n g.drawLine(x2 + (beatWidth * 4) - 1, lineHeight * 2,\r\n x2 + (beatWidth * 4) - 1, y2 + lineHeight - 1);\r\n }\r\n g.drawLine(x2 + (beatWidth * 4), lineHeight, x2 + (beatWidth * 4), y2 + lineHeight - 1);\r\n\r\n // useful numbers or drawing the piano\r\n int leftMargin = (beatWidth * 4) / 5;\r\n int keyWidth = leftMargin / 2;\r\n int pianoY = y2 + lineHeight;\r\n\r\n //draw the gray piano background\r\n g.setColor(Color.LIGHT_GRAY);\r\n g.fillRect(0, pianoY,\r\n (totalBeats + 2) * beatWidth, pianoY + (lineHeight * 15) + leftMargin);\r\n\r\n //draw white piano base\r\n g.setColor(Color.WHITE);\r\n g.fillRect(leftMargin, pianoY, keyWidth * 80, lineHeight * 15);\r\n\r\n //draw white piano keys\r\n g.setColor(Color.BLACK);\r\n for (int ii = leftMargin; ii < leftMargin + (keyWidth * 80); ii += keyWidth) {\r\n g.drawRect(ii, pianoY, keyWidth, lineHeight * 15);\r\n }\r\n\r\n // draw black piano keys\r\n for (int ii = leftMargin; ii < leftMargin + (keyWidth * 80); ii += keyWidth * 8) {\r\n g.fillRect(ii + (keyWidth / 2) + 1, pianoY, keyWidth / 2, lineHeight * 7);\r\n g.fillRect(ii + keyWidth + (keyWidth / 2) + 1, pianoY, keyWidth / 2, lineHeight * 7);\r\n g.fillRect(ii + (keyWidth * 3) + (keyWidth / 2) + 1, pianoY, keyWidth / 2, lineHeight * 7);\r\n g.fillRect(ii + (keyWidth * 4) + (keyWidth / 2) + 1, pianoY, keyWidth / 2, lineHeight * 7);\r\n g.fillRect(ii + (keyWidth * 5) + (keyWidth / 2) + 1, pianoY, keyWidth / 2, lineHeight * 7);\r\n }\r\n\r\n // draw line at beat\r\n g.setColor(Color.RED);\r\n g.drawLine((beatWidth * 2) - 1 + (beatWidth * currentBeat), lineHeight * 2,\r\n (beatWidth * 2) - 1 + (beatWidth * currentBeat), y2 + lineHeight - 1);\r\n\r\n }", "protected void paintComponent(Graphics g) {\r\n super.paintComponent(g);\r\n Graphics2D g2 = (Graphics2D)g;\r\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r\n RenderingHints.VALUE_ANTIALIAS_ON);\r\n int w = getWidth();\r\n int h = getHeight();\r\n // Draw ordinate.\r\n g2.draw(new Line2D.Double(Points, Points, Points, h-Points));\r\n // Draw abcissa.\r\n g2.draw(new Line2D.Double(Points, h-Points, w-Points, h-Points));\r\n // Draw labels.\r\n Font font = g2.getFont();\r\n FontRenderContext frc = g2.getFontRenderContext();\r\n LineMetrics lm = font.getLineMetrics(\"0\", frc);\r\n float sh = lm.getAscent() + lm.getDescent();\r\n // Ordinate label.\r\n String s = \"Strecke\";\r\n float sy = Points + ((h - 2*Points) - s.length()*sh)/2 + lm.getAscent();\r\n for(int i = 0; i < s.length(); i++) {\r\n String letter = String.valueOf(s.charAt(i));\r\n float sw = (float)font.getStringBounds(letter, frc).getWidth();\r\n float sx = (Points - sw)/2;\r\n g2.drawString(letter, sx, sy);\r\n sy += sh;\r\n }\r\n // Abcissa label.\r\n s = \"Datum\";\r\n sy = h - Points + (Points - sh)/2 + lm.getAscent();\r\n float sw = (float)font.getStringBounds(s, frc).getWidth();\r\n float sx = (w - sw)/2;\r\n g2.drawString(s, sx, sy);\r\n // Draw lines.\r\n double xInc = (double)(w - 2*Points)/(data.length-1);\r\n double scale = (double)(h - 2*Points)/getMax();\r\n g2.setPaint(Color.green.darker());\r\n for(int i = 0; i < data.length-1; i++) {\r\n double x1 = Points + i*xInc;\r\n double y1 = h - Points - scale*data[i];\r\n double x2 = Points + (i+1)*xInc;\r\n double y2 = h - Points - scale*data[i+1];\r\n g2.draw(new Line2D.Double(x1, y1, x2, y2));\r\n }\r\n // Mark data points.\r\n g2.setPaint(Color.red);\r\n for(int i = 0; i < data.length; i++) {\r\n double x = Points + i*xInc;\r\n double y = h - Points - scale*data[i];\r\n g2.fill(new Ellipse2D.Double(x-2, y-2, 4, 4));\r\n }\r\n }", "public void draw() {\n final int columns = (int) (2 * Math.ceil(Math.max(-minx, maxx)));\n final int rows = (int) (2 * Math.ceil(Math.max(-miny, maxy)));\n\n final int drawColumns;\n final int drawRows;\n drawColumns = drawRows = Math.max(columns, rows);\n\n double leftOffsetPx = BORDER;\n double rightOffsetPx = BORDER;\n double topOffsetPx = BORDER;\n double bottomOffsetPx = BORDER;\n\n final double availableWidth = view.getWidth() - leftOffsetPx - rightOffsetPx;\n final double availableHeight = view.getHeight() - topOffsetPx - bottomOffsetPx;\n\n final double drawWidth;\n final double drawHeight;\n drawWidth = drawHeight = Math.min(availableWidth, availableHeight);\n\n leftOffsetPx = rightOffsetPx = (view.getWidth() - drawWidth) / 2;\n topOffsetPx = bottomOffsetPx = (view.getHeight() - drawHeight) / 2;\n\n // Adjust for aspect ratio\n columnWidth = rowHeight = drawHeight / columns;\n\n centerX = (drawColumns / 2.0) * columnWidth + leftOffsetPx;\n centerY = (drawRows / 2.0) * rowHeight + topOffsetPx;\n\n drawVerticalLine((float) centerX, topOffsetPx, bottomOffsetPx);\n drawHorizontalLine((float) centerY, leftOffsetPx, rightOffsetPx);\n\n int yTick = (int) (-drawRows / 2.0 / TICK_INTERVAL) * TICK_INTERVAL;\n while (yTick <= drawRows / 2.0) {\n if (yTick != 0) {\n final String label = yTick % (TICK_INTERVAL * 2) == 0 ? String.format(\"%d\", yTick) : null;\n drawYTick(-yTick * rowHeight + centerY, centerX, label);\n }\n yTick += TICK_INTERVAL;\n }\n\n int xTick = (int) (-drawColumns / 2.0 / TICK_INTERVAL) * TICK_INTERVAL;\n while (xTick <= drawColumns / 2.0) {\n if (xTick != 0) {\n final String label = xTick % (TICK_INTERVAL * 2) == 0 ? String.format(\"%d\", xTick) : null;\n drawXTick(xTick * columnWidth + centerX, centerY, label);\n }\n xTick += TICK_INTERVAL;\n }\n\n double adaptiveTextSize = getAdaptiveTextSize();\n\n final Paint paint = new Paint();\n final float textSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, (float)adaptiveTextSize, view.getResources().getDisplayMetrics());\n paint.setTextSize(textSize);\n paint.setTypeface(Typeface.create(Typeface.MONOSPACE, Typeface.NORMAL));\n for (Entry entry : data.getEntries()) {\n final double x = entry.getX();\n final double y = entry.getY();\n\n final double xDraw = x * columnWidth + centerX;\n final double yDraw = -y * rowHeight + centerY;\n\n CharSequence dispStr = entry.getStringLabel();\n if (dispStr == null) {\n dispStr = String.format(\"%.0f\", entry.getValue());\n }\n\n\n\n\n Rect bounds = getTextRectBounds(dispStr, paint);\n int textHeight = bounds.height();\n int textWidth = bounds.width();\n canvas.drawText(dispStr, 0, dispStr.length(),\n (float) xDraw - textWidth * 0.5f, (float) yDraw + textHeight * 0.5f,\n paint);\n }\n\n }", "private void drawLines()\n {\n getBackground().setColor( Color.BLACK );\n \n for( int i = 200; i < getWidth(); i += 200 )\n {\n getBackground().drawLine(i, 0, i, getHeight() );\n getBackground().drawLine(0, i, getWidth(), i);\n }\n \n Greenfoot.start();\n }", "private void drawVertical(GC gc, Rectangle drawingArea, TimeBarViewerDelegate delegate, boolean top,\n boolean printing) {\n int oy = drawingArea.y;\n\n int basex;\n int minorOff;\n int majorOff;\n int majorLabelOff;\n int dayOff;\n\n if (!top) {\n basex = drawingArea.x;\n minorOff = scaleX(MINORLENGTH);\n majorOff = scaleX(MAJORLENGTH);\n majorLabelOff = scaleX(22);\n dayOff = scaleX(34);\n } else {\n basex = drawingArea.x + drawingArea.width - 1;\n minorOff = scaleX(-MINORLENGTH);\n majorOff = scaleX(-MAJORLENGTH);\n majorLabelOff = scaleX(-10);\n dayOff = scaleX(-22);\n }\n int ox = basex;\n\n int height = drawingArea.height;\n JaretDate date = delegate.getStartDate().copy();\n\n int idx = TickScaler.getTickIdx(delegate.getPixelPerSecond() / getScaleY());\n\n int majTick = TickScaler.getMajorTickMinutes(idx);\n int minTick = TickScaler.getMinorTickMinutes(idx);\n TickScaler.Range range = TickScaler.getRange(idx);\n _lastRange = range;\n\n // clean starting date on a major tick minute position (starting with a\n // day)\n date.setMinutes(0);\n date.setHours(0);\n date.setSeconds(0);\n\n // if range is week take a week starting point\n if (range == Range.WEEK) {\n while (date.getDayOfWeek() != DateUtils.getFirstDayOfWeek()) {\n date.backDays(1.0);\n }\n } else if (range == Range.MONTH) {\n // month -> month starting point\n date.setDay(1);\n }\n JaretDate save = date.copy();\n\n if (printing) {\n gc.setLineWidth(1);\n }\n // draw top/bottom line\n gc.drawLine(ox, oy, ox, oy + height);\n\n // draw the minor ticks\n while (delegate.xForDate(date) < oy + height) {\n int y = delegate.xForDate(date);\n gc.drawLine(ox, y, ox + minorOff, y);\n if (range == Range.MONTH) {\n int adv = Math.round(minTick / APPROXSECONDSINMONTH);\n if (adv == 0) {\n adv = 1;\n }\n date.advanceMonths(adv);\n } else {\n date.advanceMinutes(minTick);\n }\n }\n\n date = save.copy();\n // draw the major ticks\n while (delegate.xForDate(date) < oy + height) {\n int y = delegate.xForDate(date);\n gc.drawLine(ox, y, ox + majorOff, y);\n if (range == Range.MONTH) {\n int adv = Math.round(majTick / APPROXSECONDSINMONTH);\n if (adv == 0) {\n adv = 1;\n }\n date.advanceMonths(adv);\n } else {\n date.advanceMinutes(majTick);\n }\n }\n\n gc.setLineWidth(1);\n\n // labels: draw every two major ticks\n date = save.copy();\n // Labels are drawn beyond the width. Otherwise when the beginning of\n // the labels\n // would not be drawn when the tick itself is out of sight\n while (delegate.xForDate(date) < drawingArea.y + drawingArea.height + 50) {\n int y = delegate.xForDate(date);\n if (date.getMinutes() % (majTick * 2) == 0) {\n // Second line\n String str = null;\n if (range == Range.HOUR) {\n // time\n str = date.toDisplayStringTime();\n } else if (range == Range.DAY) {\n // day\n str = date.getShortDayOfWeekString();\n } else if (range == Range.WEEK) {\n // week\n str = \"KW\" + date.getWeekOfYear();\n } else if (range == Range.MONTH) {\n // month\n str = Integer.toString(date.getYear());\n }\n // draw\n if (top) {\n SwtGraphicsHelper.drawStringRightAlignedVCenter(gc, str, drawingArea.x + drawingArea.width\n + majorOff, y);\n } else {\n SwtGraphicsHelper.drawStringLeftAlignedVCenter(gc, str, drawingArea.x + majorOff, y);\n }\n // // first line\n // if (range == Range.HOUR) {\n // if (date.getDay() != lastDay) {\n // str = date.getDay() + \". (\" + date.getDayOfWeekString() + \")\";\n // } else {\n // str = \"\";\n // }\n // lastDay = date.getDay();\n // } else if (range == Range.DAY || range == Range.WEEK) {\n // str = date.getDay() + \".\" + (third ? date.getShortMonthString() : \"\");\n // } else if (range == Range.MONTH) {\n // str = date.getMonthString();\n // }\n // second = !second;\n // third = count++ % 3 == 0;\n // SwtGraphicsHelper.drawStringCentered(gc, str, x, oy + dayOff);\n }\n if (range == Range.MONTH) {\n int adv = Math.round(majTick / APPROXSECONDSINMONTH);\n if (adv == 0) {\n adv = 1;\n }\n date.advanceMonths(adv);\n } else {\n date.advanceMinutes(majTick);\n }\n }\n }", "public void paint(Graphics graphics) {\n setBackground(Color. gray);\n super. paint(graphics);\n graphics. setColor(Color.red);\n graphics. drawLine(highthresh, 1, highthresh, 256);\n graphics. setColor(Color. green);\n graphics. drawLine(lowthresh, 1, lowthresh , 256);\n graphics.setColor(Color.white);\n\n // Vertical line\n graphics.setColor(Color.red);\n graphics.drawLine(0,0,0,255);\n graphics.drawLine(0,0,10,0);\n graphics.drawLine(0,64,5,64);\n graphics.drawLine(0,128,10,128);\n graphics.drawLine(0,192,5,192);\n graphics.drawLine(0,256,10,256);\n int a = 0;\n int b = hvalue/4;\n int c = b+b;\n int d = b+c;\n int e = hvalue;\n graphics.drawString(Integer.toString(e),0,15);\n //graphics.drawString(Integer.toString(d),0,74);\n graphics.drawString(Integer.toString(c),10,140);\n //graphics.drawString(Integer.toString(b),0,202);\n graphics.drawString(Integer.toString(a),5,250);\n\n // Horizontal line \n graphics.setColor(Color.red);\n graphics.drawLine(0,255,255,255);\n graphics.drawLine(0,255,0,245);\n graphics.drawLine(64,255,64,250);\n graphics.drawLine(128,255,128,245);\n graphics.drawLine(192,255,192,250);\n graphics.drawLine(256,255,256,245);\n int aa = 0;\n int bb = wvalue/4;\n int cc = bb+bb;\n int dd = bb+cc;\n int ee = wvalue;\n graphics.drawString(Integer.toString(aa),5,240);\n //graphics.drawString(Integer.toString(bb),58,240);\n graphics.drawString(Integer.toString(cc),123,240);\n //graphics.drawString(Integer.toString(dd),180,240);\n graphics.drawString(Integer.toString(ee),230,240);\n }", "private void drawAxes() {\n float margin = 90;\n\n //TODO tony va a hacer que el eje aparezca abajo\n //X rojo\n text(\"+X\",margin,-2,0);\n text(\"-X\",-margin,-2,0);\n stroke(210, 0, 0);\n line(-size,0,0,size,0,0);\n\n //Y verde\n text(\"-Z\",2,margin,0);\n text(\"+Z\",2,-margin,0);\n stroke(0, 210, 0);\n line(0,-size,0,0,size,0);\n\n //Z azul\n text(\"+Y\",5,0,margin);\n text(\"-Y\",5,0,-margin);\n stroke(0, 0, 210);\n line(0, 0, -size,0,0, size);\n }", "private void drawScalesAndLabels(Canvas canvas) {\n Paint.FontMetrics fontMetrics = mTextPaint.getFontMetrics();\n float mTextWidth;\n float mTextHeight = fontMetrics.bottom;\n\n canvas.drawLine(paddingLeft, scaleLinePosition,\n paddingLeft + contentWidth, scaleLinePosition, scaleLinePaint);\n\n float scaleMarginWidth = contentWidth * 1.0f / 24;\n float x = 0;\n for (int i = 0; i <= 24; i++) {\n x = paddingLeft + scaleMarginWidth * i;\n\n if ((i % 2) == 1) {\n //draw scale line\n canvas.drawLine(x, scaleLinePosition, x, scaleLinePosition + mTimeScaleHeight, scaleLinePaint);\n //draw time label\n mTextWidth = mTextPaint.measureText(hourLabels[i]);\n canvas.drawText(hourLabels[i], x - mTextWidth / 2, paddingTop + contentHeight - mTextHeight, mTextPaint);\n } else {\n //draw scale line\n canvas.drawLine(x, scaleLinePosition, x, scaleLinePosition + mTimeScaleHeight * 2, scaleLinePaint);\n }\n }\n }", "public void draw() {\n\t\tp.pushStyle();\n\t\t{\n\t\t\tp.rectMode(PConstants.CORNER);\n\t\t\tp.fill(360, 0, 70, 180);\n\t\t\tp.rect(60f, 50f, p.width - 110f, p.height * 2f * 0.33f - 50f);\n\t\t\tp.rect(60f, p.height * 2f * 0.33f + 50f, p.width - 110f, p.height * 0.33f - 130f);\n\t\t}\n\t\tp.popStyle();\n\n\t\tlineChart.draw(40f, 40f, p.width - 80f, p.height * 2f * 0.33f - 30f);\n\t\tlineChart2.draw(40f, p.height * 2f * 0.33f + 45f, p.width - 80f, p.height * 0.33f - 110f);\n\t\t//p.line(x1, y1, x2, y2);\n\n\t}", "@Override\n protected void createLines() {\n\n Line[] lines = new GraphicalLine[(2 * columns * rows) + columns + rows];\n int lineIndex = 0;\n\n int boxCounter = 0;\n int x = settings.dotStartX() + settings.dotWidth();\n int y = settings.dotStartY() + settings.lineOffset();\n boolean isTop = true;\n boolean isFirstRow = true;\n\n /* horizontal lines */\n /* for every row + 1 */\n for (int i = 0; i < rows + 1; i++) {\n\n /* for every column */\n for (int j = 0; j < columns; j++) {\n\n Line line = new GraphicalLine(x, y, settings.lineWidth(), settings.lineHeight());\n line.addBox(boxes[boxCounter]);\n if (isTop) {\n boxes[boxCounter].setTopLine(line);\n } else {\n boxes[boxCounter].setBottomLine(line);\n /* if there is a next row */\n if (i + 1 < rows + 1) {\n line.addBox(boxes[boxCounter + columns]);\n boxes[boxCounter + columns].setTopLine(line);\n }\n }\n boxCounter++;\n lines[lineIndex++] = line;\n x += settings.dotSeparatorLength();\n }\n boxCounter = isTop ? boxCounter - columns : boxCounter;\n if (isFirstRow) {\n isTop = false;\n isFirstRow = false;\n }\n y += settings.dotSeparatorLength();\n x = settings.dotStartX() + settings.dotWidth();\n }\n\n boxCounter = 0;\n x = settings.dotStartX() + settings.lineOffset();\n y = settings.dotStartY() + settings.dotWidth();\n\n /* vertical lines */\n /* for every row */\n for (int i = 0; i < rows; i++) {\n\n /* for every column + 1 */\n for (int j = 0; j < columns + 1; j++) {\n\n Line line = new GraphicalLine(x, y, settings.lineHeight(), settings.lineWidth());\n /* if there is a previous vertical line */\n if (j > 0) {\n boxes[boxCounter - 1].setRightLine(line);\n line.addBox(boxes[boxCounter - 1]);\n }\n /* if there is a next column */\n if (j + 1 < columns + 1) {\n boxes[boxCounter].setLeftLine(line);\n line.addBox(boxes[boxCounter]);\n boxCounter++;\n }\n lines[lineIndex++] = line;\n x += settings.dotSeparatorLength();\n }\n y += settings.dotSeparatorLength();\n x = settings.dotStartX() + settings.lineOffset();\n }\n\n this.lines = lines;\n }", "private void drawLoglines(Canvas canvas) {\n\n for(int i = 0; i < log.logLines.size(); i ++) {\n float txtYpos = (float) (\n firstLineYpos + // The height of the top bar\n (lineGap * (i + 0.5d)) + // Move down the log to the right spot\n (paint.getTextSize() / 3d) // Centering the text vertically\n );\n\n String dadTime = MyTime.getDadTime(\n log.logLines.get(i).startTime.hour,\n log.logLines.get(i).startTime.minute\n );\n canvas.drawText(\n String.valueOf(dadTime.charAt(0)), \n sideLimit,// Correct x-position according to the chart above\n txtYpos,\n paint\n );\n canvas.drawText(\n String.valueOf(dadTime.charAt(1)),\n sideLimit + paint.measureText(\"8\"), // Correct x-position according to the chart above\n txtYpos,\n paint\n );\n canvas.drawText(\n String.valueOf(dadTime.charAt(2)),\n sideLimit + paint.measureText(\"88\"), // Correct x-position according to the chart above\n txtYpos,\n paint\n );\n canvas.drawText(\n \"-\",\n sideLimit + paint.measureText(\"888N\"), // Correct x-position according to the chart above\n txtYpos,\n paint\n );\n canvas.drawText(\n log.logLines.get(i).subject.name,\n sideLimit + paint.measureText(\"888N-N\"), // Correct x-position according to the chart above\n txtYpos,\n paint\n );\n }\n }", "public void drawChart() {\n ArrayList<Entry> confuse = new ArrayList<>();\n ArrayList<Entry> attention = new ArrayList<>();\n ArrayList<Entry> engagement = new ArrayList<>();\n ArrayList<Entry> joy = new ArrayList<>();\n ArrayList<Entry> valence = new ArrayList<>();\n // point = \"Brow Furrow: \\n\";\n String dum = null, dum2 = null;\n for (int i = 0; i < size; i++) {\n //point += (\"\" + Emotion.getBrowFurrow(i).getL() + \" seconds reading of \" + Emotion.getBrowFurrow(i).getR() + \"\\n\");\n dum2 = Emotion.getBrowFurrow(i).getL().toString();\n dum = Emotion.getBrowFurrow(i).getR().toString();\n confuse.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n dum2 = Emotion.getAttention(i).getL().toString();\n dum = Emotion.getAttention(i).getR().toString();\n attention.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n dum2 = Emotion.getEngagement(i).getL().toString();\n dum = Emotion.getEngagement(i).getR().toString();\n engagement.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n dum2 = Emotion.getJoy(i).getL().toString();\n dum = Emotion.getJoy(i).getR().toString();\n joy.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n dum2 = Emotion.getValence(i).getL().toString();\n dum = Emotion.getValence(i).getR().toString();\n valence.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n }\n\n LineDataSet data1 = new LineDataSet(confuse,\"Confuse\");\n LineDataSet data2 = new LineDataSet(attention,\"Attention\");\n LineDataSet data3 = new LineDataSet(engagement,\"Engagement\");\n LineDataSet data4 = new LineDataSet(joy,\"Engagement\");\n LineDataSet data5 = new LineDataSet(valence,\"Valence\");\n data1.setColor(Color.BLUE);\n data1.setDrawCircles(false);\n data2.setColor(Color.YELLOW);\n data2.setDrawCircles(false);\n data3.setColor(Color.GRAY);\n data3.setDrawCircles(false);\n data4.setColor(Color.MAGENTA);\n data4.setDrawCircles(false);\n data5.setColor(Color.GREEN);\n data5.setDrawCircles(false);\n\n\n dataSets.add(data1);\n dataSets.add(data2);\n dataSets.add(data3);\n dataSets.add(data4);\n dataSets.add(data5);\n }", "private void drawGrid(){\r\n\r\n\t\tdrawHorizontalLines();\r\n\t\tdrawVerticalLines();\r\n\t}", "private void drawHorizontalLines(){\r\n\r\n\t\tdouble x1 = START_X;\r\n\t\tdouble x2 = getWidth();\r\n\t\tdouble y1 = GRAPH_MARGIN_SIZE;\r\n\t\tdouble y2 = y1;\r\n\r\n\t\tdrawLine(x1,y1,x2,y2);\r\n\r\n\t\tdouble newY1 = getHeight() - y1;\r\n\t\tdouble newY2 = newY1;\r\n\r\n\t\tdrawLine(x1,newY1,x2,newY2);\r\n\t}", "public void draw()\r\n\t{\r\n\t\tsynchronized (lines)\r\n\t\t{\r\n\t\t\tfor(int i = lines.size()-1; i >= 0; i--)\r\n\t\t\t{\r\n\t\t\t\tlines.get(i).draw();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void drawOnCanvas(Graphics2D g2d, int x, int y){ \n FontMetrics fm = g2d.getFontMetrics(this.axisFont);\n g2d.setColor(Color.BLACK);\n g2d.setFont(axisFont);\n if(this.isAxisVertical==false){\n g2d.drawLine(x, y, x + this.axisLength, y);\n for(int loop = 0; loop < this.axisMarks.size(); loop++){\n double pos = this.getPosition( this.axisMarks.get(loop));\n g2d.drawLine((int) (x+pos), y-this.axisTickMarkLength, (int) (x+pos), y);\n int fw = fm.stringWidth(this.axisMarksString.get(loop));\n int fh = fm.getHeight();\n g2d.drawString(this.axisMarksString.get(loop), (int) (x+pos-fw*0.5), y + (int) (fh )); \n //System.out.println(\"drawing tick mark on \" + (int) pos);\n }\n int titleOffset = fm.getHeight();\n Rectangle2D rect = this.axisTitle.getBounds(g2d);\n //this.axisTitle.setFontSize(24);\n g2d.drawString(this.axisTitle.getText().getIterator(), \n (int) (x + this.axisLength*0.5 - rect.getWidth()*0.5),\n y + titleOffset + fm.getHeight());\n } else{\n \n int maxStringLength = 0; \n g2d.drawLine(x, y, x, y-this.axisLength);\n for(int loop = 0; loop < this.axisMarks.size();loop++){\n double pos = this.getPosition(this.axisMarks.get(loop));\n g2d.drawLine(x, (int) (y-pos), x+this.axisTickMarkLength, (int) (y-pos));\n int fw = fm.stringWidth(this.axisMarksString.get(loop));\n int fh = fm.getHeight();\n int fww = (int) (fw - fh*0.2);\n if(fww> maxStringLength){\n maxStringLength = fww;\n }\n g2d.drawString(this.axisMarksString.get(loop), (int) (x - fw - fh*0.2), (int) (y-pos+fh*0.35));\n }\n AffineTransform orig = g2d.getTransform();\n// g2d.rotate(-Math.PI/2);\n g2d.rotate(-Math.PI/2);\n //int yoffset = \n Rectangle2D rect = this.axisTitle.getBounds( g2d);\n int xt = (int) -(y-this.axisLength*0.5+rect.getWidth()*0.5);\n \n //System.out.println(\"Drawing Y - title \"); \n g2d.drawString(this.axisTitle.getText().getIterator(), xt, (int) (x - maxStringLength - fm.getHeight()));\n g2d.setTransform(orig);\n }\n }", "public void drawGraph() {\n\t\tthis.ig2.setColor(this.backgroundColor);\n\t\tthis.ig2.fillRect(0, 0, this.bi.getWidth(), this.bi.getHeight());\n\n\t\tthis.drawLines();\n\t\tthis.drawFonts(this.scaleStringLine * 10);\n\t\tthis.drawCurves(this.scaleStringLine * 10);\n\t}", "private void drawTimeLine (Graphics g) {\n g.setColor (parent.parent.parent.rulerColor);\n g.fillRect (0, _yPix - 3 * parent.lineSize, _xPix, 3 * parent.lineSize);\n \n g.setColor (Color.black);\n g.drawLine (0, _yPix - 3 * parent.lineSize, _xPix, _yPix - 3 * parent.lineSize);\n double inchT = parent.getTime (parent.dpi); if (inchT <= 0) return;\n int i = (int)Math.rint (begT / inchT);\n double t = i * inchT;\n while (t < endT) {\n int xcord = i * parent.dpi - parent.getEvtXCord (begT) - \n (int)Math.rint (parent.fm.charWidth ('|') / 2.0);\n \n g.drawString (\"|\", xcord, _yPix - 2 * parent.lineSize - parent.fDescent);\n \n String t1 = (new Float (t)).toString (), t2;\n \n if (t1.indexOf ('E') == -1) {\n\tint index = max;\n\tif (index > t1.length ()) index = t1.length ();\n\tt2 = t1.substring (0, index);\n }\n else {\n\tint exp = t1.indexOf ('E');\n\tString e = t1.substring (exp, t1.length ());\n\t\n\tint si = 5; if (exp < si) si = exp;\n\tString a = t1.substring (0, si);\n\t\n\tt2 = a + e;\n }\n \n g.drawString (t2,\n xcord - (int)Math.rint (parent.fm.stringWidth (t2) / 2.0),\n _yPix - (parent.lineSize + parent.fDescent));\n t = (++i * inchT);\n }\n }", "public void draw(Graphics2D g2d) {\r\n for (int i = 0; i < lines.size(); ++i) {\r\n int deltaX = (width - getGlobalFontMetrics().stringWidth(lines.elementAt(i))) / 2;\r\n int deltaY = getGlobalFontMetrics().getHeight() * (i + 1) - getGlobalFontMetrics().getDescent();\r\n g2d.drawString(lines.elementAt(i), x + deltaX + 1, y + deltaY);\r\n }\r\n }", "private void drawLineInfoPanel(Canvas canvas,float centerY,float rightX) {\n if(!mDisplayLnPanel) {\n return;\n }\n float expand = mDpUnit * 3;\n String text = mLnTip + ((2 + getFirstVisibleLine() + getLastVisibleLine() / 2));\n float textWidth = mPaint.measureText(text);\n mRect.top = centerY - getLineHeight() / 2f - expand;\n mRect.bottom = centerY + getLineHeight() / 2f + expand;\n mRect.right = rightX;\n mRect.left = rightX - expand * 2 - textWidth;\n drawColor(canvas,mColors.getColor(ColorScheme.LINE_NUMBER_PANEL),mRect);\n float baseline = centerY - getLineHeight()/2 + getLineBaseLine(0);\n float centerX = (mRect.left + mRect.right) / 2;\n mPaint.setColor(mColors.getColor(ColorScheme.LINE_NUMBER_PANEL_TEXT));\n Paint.Align align = mPaint.getTextAlign();\n mPaint.setTextAlign(Paint.Align.CENTER);\n canvas.drawText(text,centerX,baseline,mPaint);\n mPaint.setTextAlign(align);\n }", "public void drawLine() {\n for(int i=0; i < nCols; i++) {\n System.out.print(\"----\");\n }\n System.out.println(\"\");\n }", "private void drawLines() {\n int min = BORDER_SIZE;\n int max = PANEL_SIZE - min;\n int pos = min;\n g2.setColor(LINE_COLOR);\n for (int i = 0; i <= GUI.SIZE[1]; i++) {\n g2.setStroke(new BasicStroke(i % GUI.SIZE[0] == 0 ? 5 : 3));\n g2.drawLine(min, pos, max, pos);\n g2.drawLine(pos, min, pos, max);\n pos += CELL_SIZE;\n }\n }", "private void drawVerticalAxisLabels(Graphics2D g2) {\r\n double axisV = xPositionToPixel(originX);\r\n\r\n// double startY = Math.floor((minY - originY) / majorY) * majorY;\r\n double startY = Math.floor(minY / majorY) * majorY;\r\n for (double y = startY; y < maxY + majorY; y += majorY) {\r\n if (((y - majorY / 2.0) < originY) &&\r\n ((y + majorY / 2.0) > originY)) {\r\n continue;\r\n }\r\n \r\n int position = (int) yPositionToPixel(y);\r\n g2.drawString(format(y), (int) axisV + 5, position);\r\n }\r\n }", "public void paint(Graphics g) {\n\t\t\n\t\t//find slope - use to calculate position \n\t\tArrayList <Integer> Xpos = new ArrayList<Integer>();\n\t\tArrayList <Integer> Ypos = new ArrayList<Integer>();\n\n\t\t//contain all the x and y coordinates for horizontal lines\n\t\tArrayList <Integer> HorizXOutline = new ArrayList<Integer>();\n\t\tArrayList <Integer> HorizYOutline = new ArrayList<Integer>();\n\t\t//contain all x any y points for veritical lines\n\t\tArrayList <Integer> VertOutlineX = new ArrayList<Integer>();\n\t\tArrayList <Integer> VertOutlineY = new ArrayList<Integer>();\n\t\t//contain all x and y points of postive and pos diag lines\n\t\tArrayList <Integer> PosDiagOutlineX = new ArrayList<Integer>();\n\t\tArrayList <Integer> PosDiagOutlineY = new ArrayList<Integer>();\n\t\t//contain all x and y points of postive and neg diag lines\n\t\tArrayList <Integer> NegDiagOutlineX = new ArrayList<Integer>();\n\t\tArrayList <Integer> NegDiagOutlineY = new ArrayList<Integer>();\n\n\t\tg.setColor(Color.green);\n\t\t//adding outer shape x coord\n\t\tXpos.add(100);Xpos.add(100);Xpos.add(100);Xpos.add(200);\n\t\tXpos.add(200);Xpos.add(300);Xpos.add(100);Xpos.add(200);\n\t\tXpos.add(300);Xpos.add(400);Xpos.add(300);Xpos.add(350);\n\t\tXpos.add(400);Xpos.add(350);Xpos.add(300);Xpos.add(350);\n\t\tXpos.add(400);Xpos.add(350);Xpos.add(200);Xpos.add(300);//Xpos.add(120);Xpos.add(120);\n\t\tSystem.out.println(Xpos.size());\n\t\t//g.drawArc(100, 10, 200, 200, 0, 360);\n\t\t//adding outer shape y coord\n\t\tYpos.add(100);Ypos.add(10);Ypos.add(10);Ypos.add(10);\n\t\tYpos.add(10);Ypos.add(110);Ypos.add(100);Ypos.add(200);\n\t\tYpos.add(300);Ypos.add(300);Ypos.add(300);Ypos.add(180);\n\t\tYpos.add(300);Ypos.add(180);Ypos.add(300);Ypos.add(420);\n\t\tYpos.add(300);Ypos.add(420);Ypos.add(200);Ypos.add(110);//Ypos.add(100);Ypos.add(10);\n\t\tfor(int x =0;x<Xpos.size();x+=2){\n\t\t\tg.drawLine(Xpos.get(x), Ypos.get(x), Xpos.get(x+1), Ypos.get(x+1));\n\t\t\tif(Ypos.get(x)==Ypos.get(x+1)){\n\t\t\t\tHorizXOutline.add(x);HorizXOutline.add(x+1);\n\t\t\t\tHorizYOutline.add(x);HorizYOutline.add(x+1);\n\t\t\t\tg.drawLine(Xpos.get(x),Ypos.get(x)+20,Xpos.get(x+1),Ypos.get(x+1)+20);\n\t\t\t}\n\t\t\telse if(Xpos.get(x)==Xpos.get(x+1)){\n\t\t\t\tVertOutlineX.add(x);VertOutlineX.add(x+1);\n\t\t\t\tVertOutlineY.add(x);VertOutlineY.add(x+1);\n\t\t\t\tg.drawLine(Xpos.get(x)+20,Ypos.get(x),Xpos.get(x+1)+20,Ypos.get(x+1));\n\t\t\t}\n\t\t\tif((Ypos.get(x+1)-Ypos.get(x))!=0)\n\t\t\t{\n\t\t\t\tint slope = (Xpos.get(x)-Xpos.get(x+1))/(Ypos.get(x+1)-Ypos.get(x));\n\t\t\t\tif(slope<0){\n\t\t\t\t\tNegDiagOutlineX.add(x);NegDiagOutlineX.add(x+1);\n\t\t\t\t\tNegDiagOutlineY.add(x);NegDiagOutlineY.add(x+1);\n\t\t\t\t\tif(Xpos.get(x)<=100){\n\t\t\t\t\t\tg.drawLine(Xpos.get(x),Ypos.get(x)-20,Xpos.get(x+1)+10,Ypos.get(x+1)-10);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\tg.drawLine(Xpos.get(x),Ypos.get(x)+20,Xpos.get(x+1)-10,Ypos.get(x+1)+10);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(slope>0){\n\t\t\t\t\tPosDiagOutlineX.add(x);PosDiagOutlineX.add(x+1);\n\t\t\t\t\tPosDiagOutlineY.add(x);PosDiagOutlineY.add(x+1);\n\t\t\t\t\tg.drawLine(Xpos.get(x)-10,Ypos.get(x)-10,Xpos.get(x+1)-10,Ypos.get(x+1)-10);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n//\t for(int x = 0;x<=120;x+=10){\n//\t \t//change in x-3900/-13 = Xpos\n//\t \tint xpos1 = (int)(350 +(x/10)*(-50/11));\n//\t \tint xpos2 = (int)(350+(x/10)*(50/11));\n//\t \tint ypos = 180+x;\n//\t \tg.setColor(Color.red);\n//\t \tg.drawLine(xpos1, ypos, xpos2, ypos);\n//\t \tXpos.add(xpos1);Ypos.add(ypos);Xpos.add(xpos2);Ypos.add(ypos);\n//\t }\n//\t // g.setColor(Color.blue);\n//\t ////.drawRect(200, 100, 100, 100);\n//\t // g.setColor(Color.red);\n//\t double slope = (300-200)/(110-10);\n//\t int y = (int) (100-slope*20);\n//\t // g.drawRect(220, 130-y, 100, 100);\n//\t for(int x = 20;x<=100;x+=10){\n//\t \t//Y=slope*x+0 : (Y)/slope = X where Y = interval of 20\n//\t \tint ypos = (int)(x/slope)+190;\n//\t \tg.drawLine(100, x, ypos, x);\n//\t \tXpos.add(100);Ypos.add(x);Xpos.add(ypos);Ypos.add(x);\n//\t }\n\t // g.drawLine(300, 100, 200, 200);\n//\t for(int x = 100;x<=200;x+=10){\n//\t \tdouble circleypos = 200+ Math.sqrt((200-x)*100);\n//\t \tg.drawLine(x, x, (int)(circleypos), x);\n//\t \t\n//\t }\n\t double totalDist=0;\n\t for(int x=0; x<Xpos.size();x+=2){\n\t int xd = Xpos.get(x+1)-Xpos.get(x); xd = xd*xd;\n\t int yd = Ypos.get(x+1)-Ypos.get(x); yd = yd*yd;\n\t int distance = (int) (Math.sqrt(xd+yd));\n\t totalDist +=distance;\n\t System.out.println(\"The length of this line is\" + distance + \" and the total distance as of now is \" + totalDist);\n\t }\n\t}", "private void updateLinePositions() {\n\n\t\tif (alLabelLines.size() == 0) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tfloat fXLinePosition = fXContainerLeft + CONTAINER_BOUNDARY_SPACING;\n\n\t\t\tLabelLine firstLine = alLabelLines.get(0);\n\t\t\tfloat fYLinePosition = fYContainerCenter + (fHeight / 2.0f)\n\t\t\t\t\t- CONTAINER_BOUNDARY_SPACING - firstLine.getHeight();\n\t\t\tfirstLine.setPosition(fXLinePosition, fYLinePosition);\n\n\t\t\tfor (int i = 1; i < alLabelLines.size(); i++) {\n\t\t\t\tLabelLine currentLine = alLabelLines.get(i);\n\t\t\t\tfYLinePosition -= (currentLine.getHeight() + CONTAINER_LINE_SPACING);\n\t\t\t\tcurrentLine.setPosition(fXLinePosition, fYLinePosition);\n\t\t\t}\n\t\t}\n\t}", "private void draw(){\n\t\t\t Point level = new Point(txtBoard_top_left.x, txtBoard_top_left.y);\n\t\t\t level_info = new TextInfo(g, level, txt_width, size*4, LEVEL, this.level);\n\t\t\t level_info.drawTextInfo();\n\t\t\t \n\t\t\t // draw 2nd text info\n\t\t\t Point lines = new Point(level.x, level.y+size*2);\n\t\t\t lines_info = new TextInfo(g, lines, txt_width, size*4, LINES, this.lines);\n\t\t\t lines_info.drawTextInfo();\n\t\t\t \n\t\t\t // draw 3rd text info\n\t\t\t Point score = new Point(lines.x, lines.y+size*2);\n\t\t\t score_info = new TextInfo(g, score, txt_width, size*4, SCORE, this.score);\n\t\t\t score_info.drawTextInfo();\t\t\n\t\t}", "public void drawLine(float x, float y, float x2, float y2, float width, float u, float v, float texW, float texH) {\n throw new NotImplementedException(); // TODO Implement\n }", "public void paint(Graphics g) {\n g.drawLine(120, 10, 120, 140);\n g.drawLine(120,140, 240, 140);\n g.drawString(\"120\",90,35 );\n g.drawString(\"100\",90,55 );\n g.drawString(\"80\",90,75 );\n g.drawString(\"60\",90,92 );\n g.drawString(\"40\",90,105 );\n g.drawString(\"20\",90,120 );\n g.drawString(\"0\",90,140 );\n g.drawString(\"Valerie\", 120,160);\n g.drawString(\"Hans\", 170,160);\n g.drawString(\"Jeroen\", 210,160);\n g.setColor(Color.red);\n g.fillRect(120, yvalerie, 40, hvalerie);\n g.drawRect(120, 100, 40, 40);\n g.setColor(Color.magenta);\n g.fillRect(160, yhans, 40, hhans);\n g.drawRect(160, 65, 40, 75);\n g.setColor(Color.orange);\n g.fillRect(200, yjeroen, 40, hjeroen);\n g.drawRect(200, 45, 40, 95);\n\n\n }", "@Override\n\tpublic void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\n\t\tg.setColor(Color.BLACK);\n\n\t\tg.setFont(numFont);\n\n\t\tif (param.showaxis) {\n\t\t\t// pixels\n\t\t\tint actualcenterx = (int) math.Math.scale(0, param.minx, param.maxx, 0, getWidth());\n\t\t\tint actualcentery = (int) math.Math.scale(0, param.miny, param.maxy, getHeight(), 0);\n\n\t\t\tg.drawLine(actualcenterx, 0, actualcenterx, getHeight());\n\t\t\tg.drawLine(0, actualcentery, getWidth(), actualcentery);\n\t\t\tg.drawString(0 + \"\", actualcenterx - xoffset, actualcentery + yoffset);\n\n\t\t\tg.drawString(param.maxx + \"\", getWidth() - xoffset * (param.maxx + \"\").length(), actualcentery + yoffset);\n\t\t\tg.drawString(param.minx + \"\", 0, actualcentery + yoffset);\n\t\t\tg.drawString(param.maxy + \"\", actualcenterx - xoffset * (param.maxy + \"\").length(), yoffset);\n\t\t\tg.drawString(param.miny + \"\", actualcenterx - xoffset * (param.miny + \"\").length(), getHeight() - yoffset);\n\t\t}\n\n\t\tfor (UIPointSet pointSet : pointSets) {\n\n\t\t\tint prevpx = 0, prevpy = 0;\n\t\t\tfor (int i = 0; i < pointSet.getPoints().length; i++) {\n\n\t\t\t\tdouble[] point = pointSet.getPoints()[i];\n\t\t\t\t// pixels\n\t\t\t\tint px = (int) math.Math.scale(point[0], param.minx, param.maxx, 0, getWidth());\n\t\t\t\tint py = (int) math.Math.scale(point[1], param.miny, param.maxy, getHeight(), 0);\n\n\t\t\t\tif (pointSet.getPointColor() != null) {\n\t\t\t\t\tint pointWidth = 10;\n\t\t\t\t\tg.setColor(pointSet.getPointColor());\n\t\t\t\t\tg.fillOval(px - pointWidth / 2, py - pointWidth / 2, pointWidth, pointWidth);\n\t\t\t\t}\n\n\t\t\t\tif (pointSet.getLineColor() != null && i > 0) {// if (Math.abs(y2 - y) < (getHeight())) {\n\t\t\t\t\tg.setColor(pointSet.getLineColor());\n\t\t\t\t\tg.drawLine(prevpx, prevpy, px, py);\n\t\t\t\t\tfor (int ii = 1; ii < 2; ii++) {\n\t\t\t\t\t\tg.drawLine(prevpx, prevpy - ii, px, py - ii);\n\t\t\t\t\t\tg.drawLine(prevpx, prevpy + ii, px, py + ii);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprevpx = px;\n\t\t\t\tprevpy = py;\n\n\t\t\t}\n\t\t}\n\n\t\tfor (PointBox bx : savedBoxes) {\n\t\t\tbx.updatePixCoordinate();\n\t\t\tg.setColor(bx.pointSet.getPointColor());\n\t\t\tbx.paint(g, clickingmBox && mBox.equals(bx), false);\n\t\t}\n\t\tif (showmBox) {\n\t\t\tint index = savedBoxes.indexOf(mBox);\n\t\t\tg.setColor(mBox.pointSet.getPointColor());\n\t\t\tif (index < 0) {\n\t\t\t\tmBox.paint(g, clickingmBox, false);\n\t\t\t} else {\n\t\t\t\tsavedBoxes.get(index).paint(g, clickingmBox, true);\n\t\t\t}\n\t\t\t// now draw the box (top left)\n\t\t\tint corneroffset = 10;\n\t\t\tString eqS = \"y = \" + mBox.pointSet.getTitle();\n\t\t\tString fnumS = pointSets.indexOf(mBox.pointSet) + \"\";\n\n\t\t\tint boxx = corneroffset + 10;\n\t\t\tint boxy = corneroffset;\n\t\t\tint boxw = eqS.length() * (xoffset - 4) + 8 + corneroffset;\n\t\t\tint boxh = yoffset + corneroffset;\n\n\t\t\tg.clearRect(boxx, boxy, boxw, boxh);\n\n\t\t\tg.drawString(eqS, xoffset + corneroffset, yoffset + corneroffset);\n\n\t\t\tg.setFont(subFont);\n\t\t\tg.drawString(fnumS, xoffset * 2 + corneroffset, (yoffset * 4 / 3) + corneroffset);\n\n\t\t\tg.drawRect(boxx, boxy, boxw, boxh);\n\n\t\t}\n\t}", "public void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\t\t\n\t\t//int width = getWidth();\n\t\t\n\t\tint steps = getWidth() / 15;\n\t\tint x1 = 0;\n\t\tint y1 = 0;\n\t\tint x2 = steps;\n\t\tint y2 = getHeight();\n\t\t\n\t\t// draw a line from the upper-left to the lower-right (right side)\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tg.drawLine(x1, y1, x2, y2);\n\t\t\ty1 = y1 + steps;\n\t\t\tx2 = x2 + steps;\n\n\t\t}\n\t\t\n\t\tx1 = 0;\n\t\ty1 = getHeight();\n\t\tx2 = steps;\n\t\ty2 = 0;\n\t\t\n\t\t// draw a line from the lower-left to the top-right (left side)\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tg.drawLine(x1, y1, x2, y2);\n\t\t\ty1 = y1 - steps;\n\t\t\tx2 = x2 + steps;\n\n\t\t}\n\t\t\n\t\tx1 = 0;\n\t\ty1 = getHeight();\n\t\tx2 = getWidth();\n\t\ty2 = getHeight() - steps;\n\t\t\n\t\t// draw a line from the lower-left to the top-right (right side)\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tg.drawLine(x1, y1, x2, y2);\n\t\t\tx1 = x1 + steps;\n\t\t\ty2 = y2 - steps;\n\n\n\t\t}\n\t\t\n\t\tx1 = 0;\n\t\ty1 = 0;\n\t\tx2 = getWidth();\n\t\ty2 = steps;\n\t\t\n\t\t// draw a line from the upper-left to the lower-right (left side)\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tg.drawLine(x1, y1, x2, y2);\n\t\t\tx1 = x1 + steps;\n\t\t\ty2 = y2 + steps;\n\n\n\t\t}\n\t\t\n\t}", "public static void show(int[] kd){\n final int NUM_OF_LINES = 5;\n\n Line[] lines = new Line[NUM_OF_LINES];\n\n //gives each array element the necessary memory\n for(int i = 0; i < NUM_OF_LINES; i++){\n lines[i] = new Line();\n }\n\n //in order to print\n lines[0].setLine(4,0,0);\n lines[1].setLine(3,1,2);\n lines[2].setLine(2,3,5);\n lines[3].setLine(1,6,9);\n lines[4].setLine(0,10,14);\n\n for(int i = 0; i < NUM_OF_LINES; i++){\n String tab = \"\";\n\n //creates the 'tab' effect based on position\n for(int j = 0; j < lines[i].getT(); j++){\n tab += \" \";\n }\n System.out.print(tab);\n\n for(int j = lines[i].getA(); j < lines[i].getB() + 1; j++){\n if(kd[j] == 0){\n System.out.print(\". \");\n }\n else{\n System.out.print(\"x \");\n }\n }\n System.out.println();\n }\n\n }", "private void drawTextArea(Graphics g) {\n // declare local variables:\n int buffer;\n int horizontalBars;\n int greatestMinimum;\n int greatestMaximum;\n int dataMinimums[];\n int dataMaximums[];\n int heightDifference;\n double verticalDifference;\n DisplayData displayData[];\n BigDecimal horizontalLevels[];\n // end of local variables declaration\n\n\n // set the drawing colour\n g.setColor(Color.WHITE);\n\n // determine what data is displayed\n displayData = format.getDisplayData();\n\n // check for null pointer\n if(displayData == null || data == null) {\n // exit\n return;\n } // end of if statement\n \n // initialize the minimums and maximums\n dataMinimums = new int[displayData.length];\n dataMaximums = new int[displayData.length];\n\n // get the minimums and maximums\n for(int c = 0; c < displayData.length; c++) {\n //\n switch(displayData[c]) {\n case CLOSE_PRICES:\n dataMinimums[c] = data.getMinimum(data.getClosePrices(bars) );\n dataMaximums[c] = data.getMaximum(data.getClosePrices(bars) );\n break;\n\n case HIGH_PRICES:\n dataMinimums[c] = data.getMinimum(data.getHighPrices(bars) );\n dataMaximums[c] = data.getMaximum(data.getHighPrices(bars) );\n break;\n\n case LOW_PRICES:\n dataMinimums[c] = data.getMinimum(data.getLowPrices(bars) );\n dataMaximums[c] = data.getMinimum(data.getLowPrices(bars) );\n break;\n\n case VOLUMES:\n dataMinimums[c] = data.getMinimum(data.getVolumes(bars) );\n dataMaximums[c] = data.getMinimum(data.getVolumes(bars) );\n break;\n } // end of switch statement\n\n } // end of for loop\n\n // find the greatest minimums and greatest maximum\n greatestMinimum = data.getMinimum(dataMinimums);\n greatestMaximum = data.getMaximum(dataMaximums);\n\n // find the heightDifference\n heightDifference = greatestMaximum - greatestMinimum;\n\n // check for logical error\n if(heightDifference == 0 || heightDifference < 0 ) {\n // exit from method\n return;\n } // end of if statement\n\n // find the horizontal bars\n horizontalBars = (getHeight() - 50 ) / 35 ;\n\n // find the verticalDifference\n verticalDifference = heightDifference / horizontalBars ;\n\n // initialize the horizontal levels array\n horizontalLevels = new BigDecimal[horizontalBars+1];\n\n // resolve the horizontal levels array\n for(int c = 0; c < horizontalLevels.length ; c++) {\n buffer = (int ) greatestMinimum + c* ( (int ) Math.round(verticalDifference) );\n horizontalLevels[c] = new BigDecimal(Integer.toString( buffer ) );\n horizontalLevels[c] = horizontalLevels[c].movePointLeft(digitsAfterDot);\n } // end of for loop\n\n // add the maximum\n horizontalLevels[horizontalLevels.length-1] = new BigDecimal(Integer.toString(greatestMaximum) );\n horizontalLevels[horizontalLevels.length-1] = horizontalLevels[horizontalLevels.length-1].movePointLeft(digitsAfterDot);\n\n // draw the horizontal bars\n for(int c = 0; c < horizontalLevels.length; c++) {\n g.drawLine(getWidth()-textAreaLenght,\n getHeight() - 30 - c* ( 35 + ( Math.round ( (( getHeight() - 50 ) % 35) / horizontalBars ) ) ),\n getWidth()-textAreaLenght+5,\n getHeight() - 30 - c* ( 35 + ( Math.round ( (( getHeight() - 50 ) % 35) / horizontalBars ) ) ) );\n } // end of for loop\n\n // draw the horizontalLevel prices\n for(int c = 0 ; c < horizontalLevels.length; c++) {\n // draw the current horizontal level \n g.drawString(horizontalLevels[c].toString() , getWidth()-textAreaLenght+10,\n getHeight() + 5 - 30 - c* ( 35 + ( Math.round ( (( getHeight() - 50 ) % 35) / horizontalBars ) ) ) );\n } // end of if statement\n\n }", "public void drawLine(double x0, double y0, double x1, double y1, int red, int green, int blue){\n\t\tif( x0 > x1 ) {\n\t\t\tdouble xt = x0 ; x0 = x1 ; x1 = xt ;\n\t\t\tdouble yt = y0 ; y0 = y1 ; y1 = yt ;\n\t\t}\n\t\t\n\t\tdouble a = y1-y0;\n\t\tdouble b = -(x1-x0);\n\t\tdouble c = x1*y0 - x0*y1;\n\n\t\t\tif(y0<y1){ // Octant 1 or 2\n\t\t\t\tif( (y1-y0) <= (x1-x0) ) { //Octant 1\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Calculate initial x and initial y\n\t\t\t\t\tint x = (int)Math.round(x0);\n\t\t\t\t\tint y = (int)Math.round((-a*x-c)/b);\n\t\t\t\t\t\n\t\t\t\t\tdouble d = a*(x+1) + b*(y+0.5) + c;\n\t\t\t\t\t\n\t\t\t\t\t// Do we need to go E or SE\n\t\t\t\t\twhile(x<=Math.round(x1)){\n\t\t\t\t\t\tRenderer.setPixel(x, y, red, green, blue);\n\t\t\t\t\t\tif(d<0){\n\t\t\t\t\t\t\td = d+a;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\td = d+a+b;\n\t\t\t\t\t\t\ty = y+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx = x+1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else { // Octant 2\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Calculate initial x and initial y\n\t\t\t\t\tint y = (int)Math.round(y0);\n\t\t\t\t\tint x = (int)Math.round((-b*y-c)/a);\n\t\t\t\n\t\t\t\t\tdouble d = a*(x+0.5) + b*(y+1) + c;\n\t\t\t\t\t\n\t\t\t\t\t// Do we need to go SE or S\t\t\t\t\t\n\t\t\t\t\twhile(y<=Math.round(y1)){\n\t\t\t\t\t\tRenderer.setPixel(x, y, red, green, blue);\n\t\t\t\t\t\tif(d>0){\n\t\t\t\t\t\t\td = d+b; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\td = d+a+b;\n\t\t\t\t\t\t\tx = x+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ty = y+1;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else { // Octant 7 or 8\n\t\t\t\tif( (y0-y1) <= (x1-x0) ) { // Octant 8\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tint x = (int)Math.round(x0);\n\t\t\t\t\tint y = (int)Math.round((-a*x-c)/b);\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tdouble d = a*(x+1) + b*(y-0.5) + c;\n\t\t\t\t\t\n\t\t\t\t\t// Do we need to go E or NE\t\t\t\t\t\n\t\t\t\t\twhile(x<=Math.round(x1)){\n\t\t\t\t\t\tRenderer.setPixel(x, y, red, green, blue);\n\t\t\t\t\t\tif(d>0){ \n\t\t\t\t\t\t\td = d+a;\n\t\t\t\t\t\t} else { \n\t\t\t\t\t\t\td = d+a-b;\n\t\t\t\t\t\t\ty = y-1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx = x+1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else { //Octant 7\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tint y = (int)Math.round(y0);\n\t\t\t\t\tint x = (int)Math.round((-b*y-c)/a);\n\t\t\t\t\t\n\t\t\t\t\tdouble d = a*(x+0.5) + b*(y-1) + c;\n\t\t\t\t\t\n\t\t\t\t\t// Do we need to go NE or N\n\t\t\t\t\twhile(y>=Math.round(y1)){\n\t\t\t\t\t\tRenderer.setPixel(x, y, red, green, blue);\n\t\t\t\t\t\tif(d<0){\n\t\t\t\t\t\t\td = d-b; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\td = d+a-b;\n\t\t\t\t\t\t\tx = x+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ty = y-1;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}", "public void draw(Graphics g){\n\n g.setColor(Color.red);\n g.drawLine(x1,y1,x2,y2);\n g.drawLine(x2,y2,x3,y3);\n g.drawLine(x3,y3,x1,y1);\n g.setFont(new Font(\"Courier\", Font.BOLD, 12));\n DecimalFormat fmt = new DecimalFormat(\"0.##\"); \n g.setColor(Color.blue);\n g.drawString(fmt.format(perimeter()) + \" \" + name,x1+2 , y1 -2);\n \n }", "public void drawHorizontal(GC gc, Rectangle drawingArea, TimeBarViewerDelegate delegate, boolean top,\n boolean printing) {\n int ox = drawingArea.x;\n\n int basey;\n int minorOff;\n int majorOff;\n int majorLabelOff;\n int dayOff;\n\n if (!top) {\n basey = drawingArea.y;\n minorOff = scaleY(MINORLENGTH);\n majorOff = scaleY(MAJORLENGTH);\n majorLabelOff = scaleY(22);\n dayOff = scaleY(34);\n } else {\n basey = drawingArea.y + drawingArea.height - 1;\n minorOff = scaleY(-MINORLENGTH);\n majorOff = scaleY(-MAJORLENGTH);\n majorLabelOff = scaleY(-10);\n dayOff = scaleY(-22);\n }\n int oy = basey;\n\n int width = drawingArea.width;\n JaretDate date = delegate.getStartDate().copy();\n\n int idx;\n if (!printing) {\n idx = TickScaler.getTickIdx(delegate.getPixelPerSecond() / getScaleX());\n } else {\n idx = TickScaler.getTickIdx(delegate.getPixelPerSecond() / getScaleX());\n }\n int majTick = TickScaler.getMajorTickMinutes(idx);\n int minTick = TickScaler.getMinorTickMinutes(idx);\n TickScaler.Range range = TickScaler.getRange(idx);\n _lastRange = range;\n\n // clean starting date on a major tick minute position (starting with a\n // day)\n date.setMinutes(0);\n date.setHours(0);\n date.setSeconds(0);\n\n // if range is week take a week starting point\n if (range == Range.WEEK) {\n while (date.getDayOfWeek() != DateUtils.getFirstDayOfWeek()) {\n date.backDays(1.0);\n }\n } else if (range == Range.MONTH) {\n // month -> month starting point\n date.setDay(1);\n }\n JaretDate save = date.copy();\n\n if (printing) {\n gc.setLineWidth(1);\n }\n // draw top/bottom line\n gc.drawLine(ox, oy, ox + width, oy);\n\n // draw the minor ticks\n while (delegate.xForDate(date) < ox + width) {\n int x = delegate.xForDate(date);\n gc.drawLine(x, oy, x, oy + minorOff);\n if (range == Range.MONTH) {\n int adv = Math.round(minTick / APPROXSECONDSINMONTH);\n if (adv == 0) {\n adv = 1;\n }\n date.advanceMonths(adv);\n } else {\n date.advanceMinutes(minTick);\n }\n }\n\n date = save.copy();\n // draw the major ticks\n while (delegate.xForDate(date) < ox + width) {\n int x = delegate.xForDate(date);\n gc.drawLine(x, oy, x, oy + majorOff);\n if (range == Range.MONTH) {\n int adv = Math.round(majTick / APPROXSECONDSINMONTH);\n if (adv == 0) {\n adv = 1;\n }\n date.advanceMonths(adv);\n } else {\n date.advanceMinutes(majTick);\n }\n }\n\n gc.setLineWidth(1);\n\n // labels: draw every two major ticks\n date = save.copy();\n int lastDay = date.getDay();\n boolean second = true;\n int count = 0;\n boolean third = true;\n // Labels are drawn beyond the width. Otherwise when the beginning of\n // the labels\n // would not be drawn when the tick itself is out of sight\n while (delegate.xForDate(date) < drawingArea.x + drawingArea.width) {\n int x = delegate.xForDate(date);\n if (date.getMinutes() % (majTick * 2) == 0) {\n // Second line\n String str = null;\n if (range == Range.HOUR) {\n // time\n str = date.toDisplayStringTime();\n } else if (range == Range.DAY) {\n // day\n str = date.getShortDayOfWeekString();\n } else if (range == Range.WEEK) {\n // week\n str = \"KW\" + date.getWeekOfYear();\n } else if (range == Range.MONTH) {\n // month\n str = Integer.toString(date.getYear());\n }\n // draw\n if (x > SwtGraphicsHelper.getStringDrawingWidth(gc, str) / 2) {\n SwtGraphicsHelper.drawStringCentered(gc, str, x, oy + majorLabelOff);\n }\n // first line\n if (range == Range.HOUR) {\n if (date.getDay() != lastDay) {\n str = date.getDay() + \". (\" + date.getDayOfWeekString() + \")\";\n } else {\n str = \"\";\n }\n lastDay = date.getDay();\n } else if (range == Range.DAY || range == Range.WEEK) {\n str = date.getDay() + \".\" + (third ? date.getShortMonthString() : \"\");\n } else if (range == Range.MONTH) {\n str = date.getMonthString();\n }\n second = !second;\n third = count++ % 3 == 0;\n SwtGraphicsHelper.drawStringCentered(gc, str, x, oy + dayOff);\n }\n if (range == Range.MONTH) {\n int adv = Math.round(majTick / APPROXSECONDSINMONTH);\n if (adv == 0) {\n adv = 1;\n }\n date.advanceMonths(adv);\n } else {\n date.advanceMinutes(majTick);\n }\n }\n }", "public static void drawLines(Pane pane) {\n\n for (int i = 0; i < 4; i++) {\n Line lineH = new Line(0, i * 150, 450, i * 150);\n lineH.setStroke(Color.DARKGRAY);\n lineH.setStrokeWidth(3);\n pane.getChildren().add(lineH);\n\n Line lineV = new Line(i * 150, 0, i * 150, 450);\n lineV.setStroke(Color.DARKGRAY);\n lineV.setStrokeWidth(3);\n pane.getChildren().add(lineV);\n }\n }", "public void draw() {\r\n\t\tbackground(255); // Clear the screen with a white background\r\n\r\n\t\ttextSize(12);\r\n\t\tfill(0);\r\n\r\n\t\tstroke(0);\r\n\t\tcurve.draw(this);\r\n\t}", "private void redrawLines(int k, double y, int i) {\n\t\tdouble y2 = 0;\r\n\t\tdouble x = getWidth() / NDECADES * k;\r\n\t\tdouble x2 = getWidth() / NDECADES * (k + 1);\r\n\t\tif (k != NDECADES - 1) {\r\n\t\t\tif (nse.getRank(k + 1) == 0) {\r\n\t\t\t\ty2 = getHeight() - GRAPH_MARGIN_SIZE;\r\n\t\t\t} else {\r\n\t\t\t\ty2 = (getHeight() - 2 * GRAPH_MARGIN_SIZE) * nse.getRank(k + 1) / (double) MAX_RANK + GRAPH_MARGIN_SIZE;\r\n\t\t\t}\r\n\t\tGLine line = new GLine(x, y, x2, y2);\r\n\t\tchangeTheColor(line, i);\r\n\t\tadd(line);\r\n\t\t}\r\n\t}", "public void draw()\n\t{\t\t\n\t\tArrayList<Segment> seg = new ArrayList<Segment>();\n\t\tfor(int i = 0; i < hullVertices.length - 1; i++)\n\t\t{\n\t\t\tSegment s = new Segment(hullVertices[i], hullVertices[i+1]);\n\t\t\tseg.add(s);\n\t\t}\n\t\tSegment s1 = new Segment(hullVertices[hullVertices.length-1], hullVertices[0]);\n\t\tseg.add(s1);\n\t\t// Based on Section 4.1, generate the line segments to draw for display of the convex hull.\n\t\t// Assign their number to numSegs, and store them in segments[] in the order.\n\t\tSegment[] segments = new Segment[seg.size()];\n\t\tfor(int i = 0; i < seg.size(); i++)\n\t\t{\n\t\t\tsegments[i] = seg.get(i);\n\t\t}\n\t\t// The following statement creates a window to display the convex hull.\n\t\tPlot.myFrame(pointsNoDuplicate, segments, getClass().getName());\n\t}", "private void drawLine(int entryNum) {\n\t\tNameSurferEntry entry = entries.get(entryNum);\n\t\tdouble deltaX = getWidth() / NDECADES;\n\t\tdouble yMin = getHeight() - GRAPH_MARGIN_SIZE;\n\t\tdouble yMax = GRAPH_MARGIN_SIZE;\n\t\tdouble deltaY = (yMin - yMax) / 1000.0;\n\t\t\n\t\tfor (int decade = 0; decade < NDECADES - 1; decade++) {\n\t\t\t//get rank values and coordinates\n\t\t\tint fromRank = entry.getRank(decade);\n\t\t\tint toRank = entry.getRank(decade + 1);\n\t\t\tGPoint from = new GPoint(decade * deltaX, yMax + fromRank * deltaY);\n\t\t\tGPoint to = new GPoint((decade + 1) * deltaX, yMax + toRank * deltaY);\n\t\t\tif (fromRank == 0) from.setLocation(decade * deltaX, yMin);\n\t\t\tif (toRank == 0) to.setLocation((decade + 1) * deltaX, yMin);\n\t\t\t\n\t\t\tdrawLineSeg(entryNum, from, to);\n\t\t\tdrawLabel(entryNum, from, fromRank);\n\t\t\t\n\t\t\t//labels the last plot point (fence post case)\n\t\t\tif (decade == NDECADES - 2) {\n\t\t\t\tdrawLabel(entryNum, to, toRank);\n\t\t\t}\n\t\t}\n\t}", "private void drawAxes()\r\n {\r\n Rectangle rectangle = this.getBounds();\r\n rectangle.setBounds(0,0,300,300);\r\n \r\n xOrigin_ = (int)(rectangle.x);\r\n yOrigin_ = (int)(rectangle.y);\r\n \r\n // Draw x axis\r\n graphics_.drawLine(xOrigin_ + OFFSET,\r\n yOrigin_ + OFFSET,\r\n MAX_AXIS_LENGTH + OFFSET,\r\n yOrigin_ + OFFSET);\r\n \r\n // Draw y axis\r\n graphics_.drawLine(xOrigin_ + OFFSET,\r\n yOrigin_ + OFFSET,\r\n xOrigin_ + OFFSET,\r\n MAX_AXIS_LENGTH + OFFSET);\r\n \r\n // Put labels on Axes\r\n graphics_.drawString(xLabel_, \r\n MAX_AXIS_LENGTH, \r\n (yOrigin_+ X_LABEL_OFFSET));\r\n \r\n graphics_.drawString(yLabel_, \r\n (xOrigin_ + X_LABEL_OFFSET), \r\n (MAX_AXIS_LENGTH + Y_LABEL_OFFSET));\r\n \r\n // Write description of plot below graph\r\n graphics_.drawString(\"PLOT OF \" + xLabel_ + \" VS \" + yLabel_, \r\n PLOT_DESCRIP_X,\r\n PLOT_DESCRIP_Y);\r\n \r\n // Draw tick marks on x axis\r\n final int axisMarkerDist = MAX_AXIS_LENGTH/NUM_MARKERS;\r\n \r\n // Temporary variable representing location where tick marks \r\n // should be drawn\r\n int axisTemp;\r\n \r\n for (int i=1; i<=NUM_MARKERS; i++)\r\n {\r\n axisTemp = i*axisMarkerDist;\r\n \r\n // Draw tick mark\r\n graphics_.drawLine(OFFSET + (axisTemp),\r\n OFFSET,\r\n OFFSET + (axisTemp),\r\n OFFSET - 5 );\r\n \r\n // Draw value above tick mark\r\n graphics_.drawString(String.valueOf( (maxX_/NUM_MARKERS)*i ),\r\n (OFFSET + (axisTemp)),\r\n OFFSET - 20);\r\n }\r\n \r\n // Draw tick marks on y axis\r\n for (int i=1; i<=NUM_MARKERS; i++)\r\n {\r\n axisTemp = i*axisMarkerDist;\r\n // Draw tick mark\r\n graphics_.drawLine( OFFSET - 5,\r\n (OFFSET + (axisTemp)),\r\n OFFSET,\r\n (OFFSET + (axisTemp)));\r\n \r\n // Draw value above tick mark\r\n graphics_.drawString(String.valueOf((maxY_/NUM_MARKERS)*i),\r\n xOrigin_ + X_LABEL_OFFSET,\r\n (OFFSET + (axisTemp)));\r\n }\r\n\r\n\r\n }", "private void redrawLines()\n {\n for(int i =0; i<currentRide;i++)\n {\n rides[i].moveTogether(650,60 + 40*i);//move all elemetnts of ride lines\n \n }\n }", "private void drawView(Canvas canvas){\n //long start = System.currentTimeMillis();\n\n getCursor().updateCache(getFirstVisibleLine());\n\n ColorScheme color = mColors;\n drawColor(canvas, color.getColor(ColorScheme.WHOLE_BACKGROUND), mViewRect);\n\n float lineNumberWidth = measureLineNumber();\n float offsetX = - getOffsetX();\n\n drawLineNumberBackground(canvas, offsetX, lineNumberWidth + mDividerMargin, color.getColor(ColorScheme.LINE_NUMBER_BACKGROUND));\n\n drawCurrentLineBackground(canvas, color.getColor(ColorScheme.CURRENT_LINE));\n drawCurrentCodeBlockLabelBg(canvas);\n\n drawDivider(canvas, offsetX + lineNumberWidth + mDividerMargin, color.getColor(ColorScheme.LINE_DIVIDER));\n\n drawLineNumbers(canvas, offsetX, lineNumberWidth, color.getColor(ColorScheme.LINE_NUMBER));\n offsetX += lineNumberWidth + mDividerMargin * 2 + mDividerWidth;\n\n if(mCursor.isSelected()){\n drawSelectedTextBackground(canvas,offsetX, color.getColor(ColorScheme.SELECTED_TEXT_BACKGROUND));\n }\n\n drawText(canvas, offsetX, color.getColor(ColorScheme.TEXT_NORMAL));\n drawComposingTextUnderline(canvas,offsetX, color.getColor(ColorScheme.UNDERLINE));\n\n if(!mCursor.isSelected()){\n drawSelectionInsert(canvas, offsetX, color.getColor(ColorScheme.SELECTION_INSERT));\n if(mEventHandler.shouldDrawInsertHandle()) {\n drawHandle(canvas,mCursor.getLeftLine(),mCursor.getLeftColumn(),mInsertHandle);\n }\n }else if(!mTextActionPanel.isShowing()){\n drawHandle(canvas,mCursor.getLeftLine(),mCursor.getLeftColumn(),mLeftHandle);\n drawHandle(canvas,mCursor.getRightLine(),mCursor.getRightColumn(),mRightHandle);\n }else{\n mLeftHandle.setEmpty();\n mRightHandle.setEmpty();\n }\n\n drawBlockLines(canvas,offsetX);\n drawScrollBars(canvas);\n\n //These are for debug\n //long end = System.currentTimeMillis();\n //canvas.drawText(\"Draw:\" + (end - start) + \"ms\" + \"Last highlight:\" + m + \"ms\", 0, getLineBaseLine(11), mPaint);\n }", "@Override\n protected void onDraw(Canvas canvas) {\n int count = (getHeight()-getPaddingTop()-getPaddingBottom()) / getLineHeight();\n Rect r = mRect;\n Paint paint = mPaint;\n getLineBounds(0, r);\n\n for (int i = 0; i < count; i++) {\n int baseline2 = getLineHeight() * (i+1) + getPaddingTop();\n Log.d(\"\",\"onDraw: Baseline \"+baseline2+\" \"+r.left+\" \"+r.right+\" \"+count);\n canvas.drawLine(r.left, baseline2 + 1, r.right, baseline2 + 1, paint);\n }\n super.onDraw(canvas);\n\n }", "public void draw() {\n StdDraw.clear();\n StdDraw.setPenColor(StdDraw.BLACK);\n StdDraw.setXscale(-drawLength * 0.1, drawLength * 1.2);\n StdDraw.setYscale(-drawLength * 0.65, drawLength * 0.65);\n StdDraw.line(0, 0, drawLength, 0);\n StdDraw.text(-drawLength * 0.05, 0, \"0\");\n StdDraw.text(drawLength * 1.1, 0, Integer.toString(size()));\n }", "private void drawnPoints(Canvas canvas) {\n int height;\n String itemText;\n Paint temporaryPaint;\n Rect textBound;\n\n // TODO refactor left and right to avoid duplicated code\n if (left.size() > 0) {\n height = HEIGHT / left.size();\n for (int i = 0; i < left.size(); i++) {\n Object item = left.get(i);\n\n Bitmap itemBitmap = adapter.getNotNullBitmap(item);\n itemText = adapter.getLabel(item);\n temporaryPaint = adapter.getLabelPaint(item);\n textBound = new Rect();\n float textMaxWidth = getMaximumWidth(itemText, temporaryPaint);\n temporaryPaint.getTextBounds(itemText, 0, itemText.length() - 1, textBound);\n\n if (item != null) {\n PointF location = getLocation(item);\n\n int positionY = (height / 2) + (height * i);\n\n\n float itemHeight = itemBitmap.getHeight() / (scaleToBackground ? ratio : 1);\n float itemWidth = itemBitmap.getWidth() / (scaleToBackground ? ratio : 1);\n\n labelClickable.put(drawText(canvas, temporaryPaint, 0, positionY, itemText, true), item);\n\n PointF anchor = adapter.getAnchor(item);\n canvas.drawLine(\n textMaxWidth + TEXT_MARGIN,\n positionY - (textBound.height() / 2),\n location.x + (itemWidth * anchor.x) - (itemWidth / 2),\n location.y + (itemHeight * anchor.y) - (itemHeight / 2),\n adapter.getLinePaint(item));\n }\n }\n }\n if (right.size() > 0) {\n height = HEIGHT / right.size();\n for (int i = 0; i < right.size(); i++) {\n Object item = right.get(i);\n\n itemText = adapter.getLabel(item);\n textBound = new Rect();\n\n temporaryPaint = adapter.getLabelPaint(item);\n\n temporaryPaint.getTextBounds(itemText, 0, itemText.length() - 1, textBound);\n\n\n if (item != null) {\n PointF location = getLocation(item);\n\n int positionY = (height / 2) + (height * i);\n\n\n Rect rect = drawText(canvas, temporaryPaint, WIDTH, positionY, itemText, false);\n labelClickable.put(rect, item);\n drawLine(canvas, textBound, item, location, positionY, rect.width());\n }\n }\n }\n }", "private void drawLinesAndMiddle(Line[] lines, DrawSurface d) {\n for (Line line : lines) {\n d.setColor(Color.black);\n d.drawLine((int) line.start().getX(), (int) line.start().getY(),\n (int) line.end().getX(), (int) line.end().getY());\n int r = 3;\n Point middle = line.middle();\n d.setColor(Color.BLUE);\n d.fillCircle((int) middle.getX(), (int) middle.getY(), r);\n }\n }", "public void draw(int[] moduleMarks) {\n\t\t\r\n\t\tboolean[] coreModule = new boolean[] { true, false, true, true, true, true }; // creating a boolean array to work out if a module is core or not\r\n\t\t\r\n\t\tBar x = new Bar(); // creating an object called 'x' which will be the x axis on my graph\r\n\t\tx.makeVisible(); // making the object visible\r\n\t\tx.changeSize(200, 5); // making the object into the shape of a thin line\r\n\t\tx.changeColour(Colour.BLACK); // making the line black\r\n\t\tx.moveVertical(200); //aligning the line so it is in the correct place\r\n\t\t\r\n\t\tBar y = new Bar(); // creating an object called 'y' which will be the y axis on my graph\r\n\t\ty.makeVisible(); // making the object visible\r\n\t\ty.changeSize(5, 200); // making the object into the shape of a thin line\r\n\t\ty.changeColour(Colour.BLACK); // making the line black\r\n\t\t\r\n\t\tint xPosition = 5; // Stating x position for the bars\r\n\t\tint xDistance = 23; // the distance the bars are moved to the right\r\n\t\r\n\t\tfor (int i = 0; i < moduleMarks.length; i++){ // creating a for loop for creating the bars\r\n\t\t\t\r\n\t\t\tBar j = new Bar(); // making an object j which will by the bars for each module\r\n\t\t\tj.makeVisible(); // making the bars visible\r\n\t\t\tj.moveHorizontal(xPosition); // sets the horizontal position of the bars to 'xPosition'\r\n\t\t\txPosition += xDistance; // each time a new bar is created it adds the xDistance to the previous position.\r\n\t\t\tj.changeSize(20, moduleMarks[i]); //changing the size of the bars depending on the results\r\n\t\t\tj.moveVertical(200 - moduleMarks[i]); // changes the height of the bars depending on the marks\r\n\t\t\t\r\n\t\t\tif (moduleMarks[i] > 70){ //changes the colour of the bars depending on the result which the student got\r\n\t\t\t\tj.changeColour(Colour.MAGENTA);\r\n\t\t\t}\r\n\t\t\telse if(moduleMarks[i] >= 40){\r\n\t\t\t\tj.changeColour(Colour.GREEN);\r\n\t\t\t}\r\n\t\t\telse if(moduleMarks[i] < 40 && moduleMarks[i] > 35 && coreModule[i] == true){\r\n\t\t\t\tj.changeColour(Colour.YELLOW);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tj.changeColour(Colour.RED);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "private void drawLabels(Graphics2D g2) {\r\n if (isTextPainted()) {\r\n double axisH = yPositionToPixel(originY);\r\n double axisV = xPositionToPixel(originX);\r\n\r\n if (isAxisPainted()) {\r\n Stroke stroke = g2.getStroke();\r\n g2.setStroke(new BasicStroke(STROKE_AXIS));\r\n g2.setColor(getAxisColor());\r\n g2.drawLine((int) axisV - 3, (int) axisH,\r\n (int) axisV + 3, (int) axisH);\r\n g2.drawLine((int) axisV, (int) axisH - 3,\r\n (int) axisV, (int) axisH + 3);\r\n g2.setStroke(stroke);\r\n }\r\n\r\n g2.setColor(getForeground());\r\n FontMetrics metrics = g2.getFontMetrics();\r\n g2.drawString(format(originX) + \"; \" +\r\n format(originY), (int) axisV + 5,\r\n (int) axisH + metrics.getHeight());\r\n \r\n drawHorizontalAxisLabels(g2);\r\n drawVerticalAxisLabels(g2);\r\n }\r\n }", "@Override\n\tpublic void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\n\t\tint length = cont.getLength();\n\t\tint start = cont.getStart();\n\t\tint stop = cont.getStop();\n\n\t\tg.drawString(String.valueOf(length)+\"bp\",(int)(this.getSize().getWidth()/2),15); // tekend de lengte in baseparen in het midden van de panel\n\t\tg.fillRect(5,40,(int)(this.getSize().getWidth()-10),5);\n\n\t\tint stepSize = calculateStepSize(length);\n\t\tint first = (start - (start % stepSize)) + stepSize - 1;\t// de waarde van first is gelijk aan de positie in de sequentie van de\n\t\t// eerste nucleotide waarboven de eerste ruler lijn getekend word\n\n\t\tfor (int j = first; j < stop; j+= stepSize){\n\n\n\t\t\tint pos = (int) DrawingTools.calculateLetterPosition(this.getWidth(), length,Double.valueOf(j-start)); //schaald de posities in sequentie naar de breedte van de panel\n\t\t\tg.drawLine(pos,40,pos,30);\t\t\t\t\t\t\t\t// draws line on the ruler\n\t\t\tg.drawString(String.valueOf(j + 1) , pos, 30);\t\t// draws the nucleotide position(in sequence) above the line\n\n\t\t}\n\n\t\tint alpha = 127; // 50% transparent/\n\t\tColor myColour = new Color(255, 0, 0, alpha);\n\t\tg.setColor(myColour);\n\n\t\tif (x < x2){\n\t\t\tg.fillRect(x,0,x2-x,getHeight()); //selectie rechthoek\n\t\t}\n\t\telse{\n\t\t\tg.fillRect(x2,0,x-x2,getHeight()); //inverse rechthoek.\n\t\t}\n\t}", "@Override\n protected void onDraw(Canvas canvas) {\n // Draw the components\n Arrange();\n box.draw(canvas);\n for (Node node : nodes) {\n node.draw(canvas);\n }\n line.draw(canvas);\n invalidate(); // Force a re-draw\n }", "public void drawGrid(){\r\n gc.setLineWidth(0.5f);//this is how thick the 'pen' will be, 1 pixel for now\r\n gc.setStroke(divisionsColour);\r\n //this for loop will start at (canvas.widthProperty().intValue()/2)%pixelsPerDivision\r\n //this means that one line will pass through the center of the screen, for 0 which we need\r\n //canvas width and height properties are the width and height of the display of the waves only\r\n //then we draw a line every pixelsPerDivision pixels, this is so one division is pixelsPerDivision pixels.\r\n //the one directly below is for the time domain\r\n for (int x = (canvas.widthProperty().intValue() / 2) % pixelsPerDivision; x < canvas.widthProperty().intValue(); x += pixelsPerDivision) {\r\n //we begin to draw a line\r\n gc.beginPath();\r\n //starting at the top of the page\r\n gc.moveTo(x, 0);\r\n //going to the bottom\r\n gc.lineTo(x, canvas.heightProperty().intValue());\r\n //then finish this line\r\n gc.stroke();\r\n }\r\n\r\n\r\n //the one directly below is for the voltage domain\r\n //this one it is much more important that a line goes through the center as this is where the 0 mark for the waves is\r\n for (int y = (canvas.heightProperty().intValue() / 2) % pixelsPerDivision; y < canvas.heightProperty().intValue(); y += pixelsPerDivision) {\r\n gc.beginPath();\r\n gc.moveTo(0, y);\r\n gc.lineTo(canvas.widthProperty().intValue(), y);\r\n gc.stroke();\r\n }\r\n gc.setStroke(voltageTextColour);\r\n int numberOfPositiveDivisions = (canvas.heightProperty().intValue() / 2) / pixelsPerDivision;\r\n\r\n\r\n\r\n\r\n for (int i = 0; i < numberOfPositiveDivisions; i+=2) {\r\n gc.strokeText(\"+\" + getScienceNumber(i * VoltagePerDivision) + \"V\", 5, canvas.heightProperty().intValue() / 2 - (pixelsPerDivision * i)+5);\r\n // gc.strokeText(\"+\" + i / voltageMultiplier + \"V\", canvas.widthProperty().intValue() - 25, canvas.heightProperty().intValue() / 2 - (pixelsPerDivision * i));\r\n if (i != 0) {\r\n gc.strokeText(\"-\" + getScienceNumber(i * VoltagePerDivision) + \"V\", 5, canvas.heightProperty().intValue() / 2 + (pixelsPerDivision * i)+5);\r\n // gc.strokeText(\"-\" + i / voltageMultiplier + \"V\", canvas.widthProperty().intValue() - 25, canvas.heightProperty().intValue() / 2 + (pixelsPerDivision * i));\r\n }\r\n }\r\n gc.rotate(-90);\r\n\r\n for (int i=4; i<canvasSizeXY/pixelsPerDivision;i+=4){\r\n gc.strokeText(getScienceNumber(i*secondsPerDivision)+\"ms\", -(canvasSizeXY-10),(pixelsPerDivision * i)+5);\r\n }\r\n gc.rotate(90);\r\n //the following will draw a center line over the 0V axis part, but with a thicker pen so we can see 0 clearer\r\n gc.beginPath();\r\n gc.setLineWidth(3);//makes the line thicker\r\n gc.moveTo(0, canvas.heightProperty().intValue() / 2);\r\n gc.lineTo(canvas.widthProperty().intValue(), canvas.heightProperty().intValue() / 2);\r\n gc.stroke();\r\n\r\n }", "public void printTest(){\n\r\n p.resetAll();\r\n p.initialize();\r\n p.feedBack((byte)2);\r\n// p.color(1);\r\n p.alignCenter();\r\n p.setText(\"The Dum Dum Name\");\r\n p.newLine();\r\n p.setText(\"Restaurant Dining\");\r\n p.newLine();\r\n p.addLineSeperator();\r\n p.newLine();\r\n p.setText(\"Bling Bling\");\r\n p.newLine();\r\n p.addLineSeperator();\r\n p.newLine();\r\n\r\n p.alignLeft();\r\n p.setText(\"POD No \\t\\t: 2001 \\t\\t Table \\t: E511\");\r\n p.newLine(); \r\n\r\n p.setText(\"Res Date \\t: \" + \"01/01/1801 22:59\");\r\n\r\n p.newLine();\r\n p.setText(\"Session \\t: Evening Session\");\r\n p.newLine();\r\n p.setText(\"Staff \\t\\t: Bum Dale\");\r\n p.newLine();\r\n p.addLineSeperator();\r\n p.newLine();\r\n p.alignCenter();\r\n p.setText(\" - Some Items - \");\r\n p.newLine();\r\n p.alignLeft();\r\n p.addLineSeperator();\r\n\r\n p.newLine();\r\n\r\n p.setText(\"No \\tItem\\t\\tUnit\\tQty\");\r\n p.newLine();\r\n p.addLineSeperator();\r\n \r\n p.newLine();\r\n p.setText(\"1\" + \"\\t\" + \"Aliens Everywhere\" + \"\\t\" + \"Rats\" + \"\\t\" + \"500\");\r\n p.newLine();\r\n p.setText(\"1\" + \"\\t\" + \"Aliens Everywhere\" + \"\\t\" + \"Rats\" + \"\\t\" + \"500\");\r\n p.newLine();\r\n p.setText(\"1\" + \"\\t\" + \"Aliens Everywhere\" + \"\\t\" + \"Rats\" + \"\\t\" + \"500\");\r\n p.newLine();\r\n p.setText(\"1\" + \"\\t\" + \"Aliens Everywhere\" + \"\\t\" + \"Rats\" + \"\\t\" + \"500\");\r\n p.newLine();\r\n p.setText(\"1\" + \"\\t\" + \"Aliens Everywhere\" + \"\\t\" + \"Rats\" + \"\\t\" + \"500\");\r\n p.newLine();\r\n p.setText(\"1\" + \"\\t\" + \"Aliens Everywhere\" + \"\\t\" + \"Rats\" + \"\\t\" + \"500\");\r\n p.newLine();\r\n \r\n p.addLineSeperator();\r\n p.feed((byte)3);\r\n p.finit();\r\n\r\n p.feedPrinter(p.finalCommandSet().getBytes());\r\n \r\n }", "public void drawAngleIndicator(){\n\t\tfloat bottomLineHyp = 60;\n\t\tfloat topLineHyp = 100;\n\t\t\n\t\tfloat bottomXCoord = (float) ((Math.cos(Math.toRadians(angle) ) ) * bottomLineHyp);\n\t\tfloat bottomYCoord = (float) ((Math.sin(Math.toRadians(angle) ) ) * bottomLineHyp);\n\t\t\n\t\tfloat bottomX = Player.getxPlayerLoc() + ((Player.getPlayerImage().getWidth() * Player.getPlayerScale()) / 2 ) + bottomXCoord;\n\t\tfloat bottomY = Player.getyPlayerLoc() + ((Player.getPlayerImage().getHeight() * Player.getPlayerScale()) / 2 ) + bottomYCoord ;\n\t\t\n\t\tfloat topXCoord = (float) ((Math.cos(Math.toRadians(angle) ) ) * topLineHyp);\n\t\tfloat topYCoord = (float) ((Math.sin(Math.toRadians(angle) ) ) * topLineHyp);\n\t\t\n\t\tfloat topX = Player.getxPlayerLoc() + ((Player.getPlayerImage().getWidth() * Player.getPlayerScale() ) / 2 ) + topXCoord;\n\t\tfloat topY = Player.getyPlayerLoc() + ((Player.getPlayerImage().getHeight() * Player.getPlayerScale() ) / 2 ) + topYCoord;\n\t\t\n\t\tShapeRenderer shape = new ShapeRenderer();\n\t\tshape.setColor(Color.BLACK);\n\t\tshape.begin(ShapeType.Line);\n\t\tshape.line(bottomX, bottomY, topX, topY);\n\t\tshape.end();\n\t}", "public void chart() {\r\n setLayout(new FlowLayout());\r\n String[] testNumbers = {\"LINEAR SEARCH\", \"TEST 1\", \"TEST 2\", \"TEST 3\", \"TEST 4\", \"TEST 5\", \"TEST 6\", \"TEST 7\", \"TEST 8\", \"TEST 9\", \"TEST 10\", \"AVERAGE\", \"STANDARD DEV.\"};\r\n Object[][] testResult = {{\"500\", lin[0][0], lin[0][1], lin[0][2], lin[0][3], lin[0][4], lin[0][5], lin[0][6], lin[0][7], lin[0][8], lin[0][0], linAvAndDev[0][0], linAvAndDev[0][1]},\r\n {\"10,000\", lin[1][0], lin[1][1], lin[1][2], lin[1][3], lin[1][4], lin[1][5], lin[1][6], lin[1][7], lin[1][8], lin[1][9], linAvAndDev[1][0], linAvAndDev[1][1]},\r\n {\"100,000\", lin[2][0], lin[2][1], lin[2][2], lin[2][3], lin[2][4], lin[2][5], lin[2][6], lin[2][7], lin[2][8], lin[2][9], linAvAndDev[2][0], linAvAndDev[2][1]},\r\n {\"1,000,000\", lin[3][0], lin[3][1], lin[3][2], lin[3][3], lin[3][4], lin[3][5], lin[3][6], lin[3][7], lin[3][8], lin[3][9], linAvAndDev[3][0], linAvAndDev[3][1]},\r\n {\"5,000,000\", lin[4][0], lin[4][1], lin[4][2], lin[4][3], lin[4][4], lin[4][5], lin[4][6], lin[4][7], lin[4][8], lin[4][9], linAvAndDev[4][0], linAvAndDev[4][1]},\r\n {\"7,000,000\", lin[5][0], lin[5][1], lin[5][2], lin[5][3], lin[5][4], lin[5][5], lin[5][6], lin[5][7], lin[5][8], lin[5][9], linAvAndDev[5][0], linAvAndDev[5][1]},\r\n {\"10,000,000\", lin[6][0], lin[6][1], lin[6][2], lin[6][3], lin[6][4], lin[6][5], lin[6][6], lin[6][7], lin[6][8], lin[6][9], linAvAndDev[6][0], linAvAndDev[6][1]},\r\n {\"BINARY SEARCH\", \"TEST 1\", \"TEST 2\", \"TEST 3\", \"TEST 4\", \"TEST 5\", \"TEST 6\", \"TEST 7\", \"TEST 8\", \"TEST 9\", \"TEST 10\", \"AVERAGE\", \"STANDARD DEV.\"},\r\n {\"500\", bin[0][0], bin[0][1], bin[0][2], bin[0][3], bin[0][4], bin[0][5], bin[0][6], bin[0][7], bin[0][8], bin[0][9], linAvAndDev[7][0], linAvAndDev[7][1]},\r\n {\"10,000\", bin[1][0], bin[1][1], bin[1][2], bin[1][3], bin[1][4], bin[1][5], bin[1][6], bin[1][7], bin[1][8], bin[1][9], linAvAndDev[8][0], linAvAndDev[8][1]},\r\n {\"100,000\", bin[2][0], bin[2][1], bin[2][2], bin[2][3], bin[2][4], bin[2][5], bin[2][6], bin[2][7], bin[2][8], bin[2][9], linAvAndDev[9][0], linAvAndDev[9][1]},\r\n {\"1,000,000\", bin[3][0], bin[3][1], bin[3][2], bin[3][3], bin[3][4], bin[3][5], bin[3][6], bin[3][7], bin[3][8], bin[3][9], linAvAndDev[10][0], linAvAndDev[10][1]},\r\n {\"5,000,000\", bin[4][0], bin[4][1], bin[4][2], bin[4][3], bin[4][4], bin[4][5], bin[4][6], bin[4][7], bin[4][8], bin[4][9], linAvAndDev[11][0], linAvAndDev[11][1]},\r\n {\"7,000,000\", bin[5][0], bin[5][1], bin[5][2], bin[5][3], bin[5][4], bin[5][5], bin[5][6], bin[5][7], bin[5][8], bin[5][9], linAvAndDev[12][0], linAvAndDev[12][1]},\r\n {\"10,000,000\", bin[6][0], bin[6][1], bin[6][2], bin[6][3], bin[6][4], bin[6][5], bin[6][6], bin[6][7], bin[6][8], bin[6][9], linAvAndDev[13][0], linAvAndDev[13][1]}};\r\n chart = new JTable(testResult, testNumbers);\r\n chart.setPreferredScrollableViewportSize(new Dimension(1500, 500)); // SETS SIZE OF CHART.\r\n chart.setFillsViewportHeight(true);\r\n JScrollPane scrollPane = new JScrollPane(chart);\r\n add(scrollPane);\r\n }", "private void drawLine(Graphics g, int x1, int y1, int x2, int y2) {\n int d = 0;\n\n int dx = Math.abs(x2 - x1);\n int dy = Math.abs(y2 - y1);\n\n int dx2 = 2 * dx; // slope scaling factors to\n int dy2 = 2 * dy; // avoid floating point\n\n int ix = x1 < x2 ? 1 : -1; // increment direction\n int iy = y1 < y2 ? 1 : -1;\n\n int x = x1;\n int y = y1;\n\n if (dx >= dy) {\n while (true) {\n plot(g, x, y);\n if (x == x2)\n break;\n x += ix;\n d += dy2;\n if (d > dx) {\n y += iy;\n d -= dx2;\n }\n }\n } else {\n while (true) {\n plot(g, x, y);\n if (y == y2)\n break;\n y += iy;\n d += dx2;\n if (d > dy) {\n x += ix;\n d -= dy2;\n }\n }\n }\n }", "@Override\r\n public final void draw(final Rectangle r, final BufferedImage paper) {\n String red;\r\n String green;\r\n String blue;\r\n if (Integer.toHexString(r.getBorderColor().getRed()).length() == 1) {\r\n red = \"0\" + Integer.toHexString(r.getBorderColor().getRed());\r\n } else {\r\n red = Integer.toHexString(r.getBorderColor().getRed());\r\n }\r\n if (Integer.toHexString(r.getBorderColor().getGreen()).length() == 1) {\r\n green = \"0\" + Integer.toHexString(r.getBorderColor().getGreen());\r\n } else {\r\n green = Integer.toHexString(r.getBorderColor().getGreen());\r\n }\r\n if (Integer.toHexString(r.getBorderColor().getBlue()).length() == 1) {\r\n blue = \"0\" + Integer.toHexString(r.getBorderColor().getBlue());\r\n } else {\r\n blue = Integer.toHexString(r.getBorderColor().getBlue());\r\n }\r\n String color = \"#\" + red + green + blue;\r\n\r\n draw(new Line((String.valueOf(r.getxSus())), String.valueOf(r.getySus()),\r\n String.valueOf(r.getxSus() + r.getLungime() - 1), String.valueOf(r.getySus()),\r\n color, String.valueOf(r.getBorderColor().getAlpha()), paper), paper);\r\n\r\n draw(new Line((String.valueOf(r.getxSus() + r.getLungime() - 1)),\r\n String.valueOf(r.getySus()), String.valueOf(r.getxSus() + r.getLungime() - 1),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), color,\r\n String.valueOf(r.getBorderColor().getAlpha()), paper), paper);\r\n\r\n draw(new Line((String.valueOf(r.getxSus() + r.getLungime() - 1)),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), String.valueOf(r.getxSus()),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), color,\r\n String.valueOf(r.getBorderColor().getAlpha()), paper), paper);\r\n\r\n draw(new Line((String.valueOf(r.getxSus())),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), String.valueOf(r.getxSus()),\r\n String.valueOf(r.getySus()), color, String.valueOf(r.getBorderColor().getAlpha()),\r\n paper), paper);\r\n\r\n for (int i = r.getxSus() + 1; i < r.getxSus() + r.getLungime() - 1; i++) {\r\n for (int j = r.getySus() + 1; j < r.getySus() + r.getInaltime() - 1; j++) {\r\n if (checkBorder(i, j, paper)) {\r\n paper.setRGB(i, j, r.getFillColor().getRGB());\r\n }\r\n }\r\n }\r\n }", "public void drawGraph()\n\t{\n\t\tp.rectMode(PApplet.CORNERS);\n\n\t\t//background(0);\n\t\tp.stroke(255);\n\n\t\t// draw the logarithmic averages\n\t\t//spect.forward(jingle.mix);\n\n\t\tint w = PApplet.parseInt(p.width/spect.avgSize());\n\n\t\tfor(int i = 0; i < fTimer.length; i++)\n\t\t{\n\t\t\tint xPos = i*w;\n\n\t\t\t// Draw numbers\n\t\t\tp.fill(255);\n\t\t\tp.text(i, xPos + (w/2), height2 + 20);\n\n\t\t\t// check fill for beat \n\t\t\tlong clock = System.currentTimeMillis();\n\n\t\t\tif (clock - fTimer[i] < sensitivity)\n\t\t\t{\n\t\t\t\tp.noStroke();\n\n\t\t\t\tfloat h = PApplet.map(clock - fTimer[i], 0, sensitivity, 255, 0);\n\t\t\t\tp.fill(h);\n\t\t\t\tp.ellipse(xPos, height2 + 30, 15, 15); \n\t\t\t}\n\n\t\t\tp.stroke(255);\n\t\t\tp.noFill();\n\t\t\tp.rect(xPos, height2, xPos + w, height2 - spect.getAvg(i));\n\t\t}\n\t}", "public void draw()\r\n {\r\n\tfinal GraphicsLibrary g = GraphicsLibrary.getInstance();\r\n\t_level.draw(g);\r\n\t_printText.draw(\"x\" + Mario.getTotalCoins(), 30, _height - 36, false);\r\n\t_printText.draw(\"C 000\", _width - 120, _height - 36, false);\r\n\t_printText.draw(Mario.getLives() + \"UP\", 240, _height - 36, false);\r\n\t_printText.draw(Mario.getPoints() + \"\", 400, _height - 36, false);\r\n\t_coin.draw();\r\n\t_1UP.draw();\r\n }", "@Override\n public void draw(Graphics g) {\n g.setColor(this.getColor());\n g.drawLine(left, axisY, right, axisY);\n\n // Draw string to the left of the plot labeling the height of this axis\n g.setColor(LABEL_COLOR);\n g.setFont(LABEL_FONT);\n FontMetrics metric = g.getFontMetrics(LABEL_FONT);\n int width = metric.stringWidth(label);\n int height = metric.getAscent();\n int x = left - 8 - width;\n int y = axisY + (height / 2) - 1;\n g.drawString(label, x, y);\n }", "public static void mainDraw(Graphics graphics) {\n int x1 = 50;\r\n int x2 = 180;\r\n int y1 = 180;\r\n int y2 = 50;\r\n Color[] colors = {Color.blue, Color.cyan, Color.green, Color.magenta};\r\n graphics.setColor(colors[1]);\r\n graphics.drawLine(x1, y2, x2, y2);\r\n graphics.setColor(colors[2]);\r\n graphics.drawLine(x2, y2, x2, y1);\r\n graphics.setColor(colors[3]);\r\n graphics.drawLine(x2, y1, x1, y1);\r\n graphics.setColor(colors[0]);\r\n graphics.drawLine(x1, y1, x1, y2);\r\n }", "public void drawMark (Graphics g) {\r\n\r\n\t\tGraphics2D graph = (Graphics2D) g;\r\n\r\n\t\tgraph.setColor(color);\r\n\t\t\r\n\t\t//For each sector draw the same mark\r\n\t\tfor (int i = 0; i < dolly.getNumberOfSectors(); i++) {\r\n\t\t\t\r\n\t\t\tgraph.setStroke(new BasicStroke(penSize));\r\n\t\t\tIterator<Point> iter = listOfPoints.iterator();\r\n\t\t\tPoint firstPoint = null; \r\n\t\t\tPoint secondPoint = null;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (listOfPoints.size() == 1) {\r\n\t\t\t\t\r\n\t\t\t\tfirstPoint = listOfPoints.get(0);\r\n\t\t\t\tgraph.drawRect((int) firstPoint.getX(), (int) firstPoint.getY(), dolly.getPenSize(), dolly.getPenSize());\r\n\t\t\t\t\r\n\t\t\t\tif (reflected) { \r\n\t\t\t\t\t\r\n\t\t\t\t\tgraph.drawRect(-(int) firstPoint.getX(), (int) firstPoint.getY(), dolly.getPenSize(), dolly.getPenSize());\r\n\t\t\t\t}\r\n\t\t\t\tgraph.rotate(Math.toRadians(dolly.getAngle()));\r\n\t\t\t\t\r\n\t\t\t} else if (listOfPoints.size() > 1) { \r\n\t\t\t\t\r\n\t\t\t\tfirstPoint = iter.next();\r\n\r\n\t\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\t\tsecondPoint = iter.next();\r\n\r\n\t\t\t\t\tgraph.drawLine((int) firstPoint.getX(), (int) firstPoint.getY(), (int) secondPoint.getX(), (int) secondPoint.getY());\r\n\r\n\t\t\t\t\tif (reflected) { \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tgraph.drawLine(-(int) firstPoint.getX(), (int) firstPoint.getY(), -(int) secondPoint.getX(),\r\n\t\t\t\t\t\t\t\t(int) secondPoint.getY());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfirstPoint = secondPoint;\r\n\t\t\t\t}\r\n\t\t\t\tgraph.rotate(Math.toRadians(dolly.getAngle()));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "@Override\n\tprotected void drawSub(Canvas canvas) {\n\t\tpaint.setTextSize(30);\n\t\tcanvas.drawText(\"Logic View\", rx, 30, paint);\n\t\t\n\t\tcanvas.drawArc(oval, 0, sweepAngle, true, paint);\n\n\t}", "public void paint(Graphics g) {\n\n\t\t// Horizontale Linie zwischen Spielfeld 1 & 2\n\t\tg.setColor(Color.black);\n\t\tg.drawLine(396, 20, 396, 415);\n\t\tg.drawLine(398, 20, 398, 415);\n\t\tg.drawLine(400, 20, 400, 415);\n\t\tg.drawLine(402, 20, 402, 415);\n\t\tg.drawLine(404, 20, 404, 415);\n\n\t\t// Horizontale Linie zwischen Spielfeld 2 & Chat\n\t\tg.setColor(Color.black);\n\t\tg.drawLine(780, 20, 780, 415);\n\t\tg.drawLine(782, 20, 782, 415);\n\t\tg.drawLine(784, 20, 784, 415);\n\t\tg.drawLine(786, 20, 786, 415);\n\t\tg.drawLine(788, 20, 788, 415);\n\n\t\t// Text fuer den Status\n\t\tg.setFont(new Font(\"Serif\", Font.BOLD, 18));\n\t\tg.drawString(\"Dein Spielfeld\", 115, 30);\n\t\tg.setColor(Color.red);\n\t\tg.drawString(this.status, 100, 55);\n\t\n\n\t\t// Chat Font\n\t\tg.setFont(new Font(\"Serif\", Font.BOLD, 18));\n\t\tg.setColor(Color.red);\n\t\tg.drawString(\"Chat!\", 900, 55);\n\t\tg.setFont(new Font(\"Serif\", Font.BOLD, 12));\n\t\tg.setColor(Color.red);\n\t\tg.drawString(\"Du bist Spieler \" + spielerNummer, 900, 80);\n\n\t\tg.setColor(Color.black);\n\t\tg.drawString(\"Dein Herausforderer\", 500, 30);\n\n\t\t// Spielfeld 1 Beschriftung zeichnen\n\t\tfor (int i = 30; i < 330; i = i + 30) {\n\t\t\t\n\t\t\tg.setFont(new Font(\"Serif\", Font.BOLD, 14));\n\t\t\tif (i == 300) {\n\t\t\t\tg.drawString(Integer.toString(i / 30), startX + i - 25,\n\t\t\t\t\t\tstartY - 5);\n\t\t\t} else {\n\t\t\t\tg.drawString(Integer.toString(i / 30), startX + i - 20,\n\t\t\t\t\t\tstartY - 5);\n\t\t\t}\n\t\t\tg.drawString(String.valueOf((char) (i / 30 + 64)), startX - 15,\n\t\t\t\t\tstartY + i - 10);\n\t\t}\n\t\t// Linien zeichnen\n\t\tfor (int i = 0; i < 330; i = i + 30) {\n\t\t\tg.drawLine(startX + i, startY, startX + i, endY);\n\t\t\tg.drawLine(startX, startY + i, endX, startY + i);\n\t\t}\n\t\t// Hover effekte und treffer fuer Spiefeld 1\n\t\tfor (int i = 0; i < 300; i = i + 30) {\n\t\t\tfor (int j = 0; j < 300; j = j + 30) {\n\t\t\t\t// Koordinaten\n\t\t\t\tint x = i / 30;\n\t\t\t\tint y = j / 30;\n\t\t\t\t// Wenn keine Schiffe gesetzen werden\n\t\t\t\tif (!setzeSchiffe) {\n\t\t\t\t\t//Noch kein schuss auf dem Feld dann blauen Hover\n\t\t\t\t\tif (spielfeld1[x][y] == 0) {\n\t\t\t\t\t\tif (startX + i + 1 == 30 * lastX + 1\n\t\t\t\t\t\t\t\t&& startY + j + 1 == 30 * lastY + 1) {\n\t\t\t\t\t\t\tg.setColor(Color.blue);\n\t\t\t\t\t\t\tg.fillRect(30 * lastX + 1, 30 * lastY + 1, 29, 29);\n\t\t\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\t\t\tg.drawLine(30 * lastX + 1 + 10,\n\t\t\t\t\t\t\t\t\t30 * lastY + 1 + 10, 30 * lastX + 1 + 20,\n\t\t\t\t\t\t\t\t\tlastY * 30 + 1 + 20);\n\t\t\t\t\t\t\tg.drawLine(30 * lastX + 1 + 20,\n\t\t\t\t\t\t\t\t\t30 * lastY + 1 + 10, 30 * lastX + 1 + 10,\n\t\t\t\t\t\t\t\t\tlastY * 30 + 1 + 20);\n\t\t\t\t\t\t}\n\t\t\t\t\t// geschossen aber kein Treffer\n\t\t\t\t\t} else if (spielfeld1[x][y] == 1) {\n\t\t\t\t\t\t// Wenn hover dann gray\n\t\t\t\t\t\tif (startX + i + 1 == 30 * lastX + 1\n\t\t\t\t\t\t\t\t&& startY + j + 1 == 30 * lastY + 1) {\n\t\t\t\t\t\t\tg.setColor(Color.gray);\n\t\t\t\t\t\t\tg.fillRect(30 * lastX + 1, 30 * lastY + 1, 29, 29);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//Kein Hover dann DarkGrey\n\t\t\t\t\t\t\tg.setColor(Color.darkGray);\n\t\t\t\t\t\t\tg.fillRect(startX + i + 1, startY + j + 1, 29, 29);\n\t\t\t\t\t\t}\n\t\t\t\t\t//Wenn treffer\n\t\t\t\t\t} else if (spielfeld1[x][y] == 2) {\n\t\t\t\t\t\t// wenn maus ueber feld dann Orange-Hover \n\t\t\t\t\t\tif (startX + i + 1 == 30 * lastX + 1\n\t\t\t\t\t\t\t\t&& startY + j + 1 == 30 * lastY + 1) {\n\t\t\t\t\t\t\tg.setColor(Color.orange);\n\t\t\t\t\t\t\tg.fillRect(30 * lastX + 1, 30 * lastY + 1, 29, 29);\n\t\t\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\t\t\tg.drawLine(30 * lastX + 1 + 10,\n\t\t\t\t\t\t\t\t\t30 * lastY + 1 + 10, 30 * lastX + 1 + 20,\n\t\t\t\t\t\t\t\t\tlastY * 30 + 1 + 20);\n\t\t\t\t\t\t\tg.drawLine(30 * lastX + 1 + 20,\n\t\t\t\t\t\t\t\t\t30 * lastY + 1 + 10, 30 * lastX + 1 + 10,\n\t\t\t\t\t\t\t\t\tlastY * 30 + 1 + 20);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// wenn maus ueber feld dann Roten-Hover \n\t\t\t\t\t\t\tg.setColor(Color.red);\n\t\t\t\t\t\t\tg.fillRect(startX + i + 1, startY + j + 1, 29, 29);\n\t\t\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\t\t\tg.drawLine(startX + i + 1 + 10,\n\t\t\t\t\t\t\t\t\tstartY + j + 1 + 10, startX + i + 1 + 20,\n\t\t\t\t\t\t\t\t\tstartY + j + 1 + 20);\n\t\t\t\t\t\t\tg.drawLine(startX + i + 1 + 20,\n\t\t\t\t\t\t\t\t\tstartY + j + 1 + 10, startX + i + 1 + 10,\n\t\t\t\t\t\t\t\t\tstartY + j + 1 + 20);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Spielfeld2\n\t\tint lstartX = 450;\n\t\tint lendX = 750;\n\t\tg.setColor(Color.black);\n\t\t// Beschriftung des Feld 2\n\t\tfor (int i = 30; i < 330; i = i + 30) {\n\t\t\tg.setFont(new Font(\"Serif\", Font.BOLD, 14));\n\t\t\tif (i == 300) {\n\t\t\t\tg.drawString(Integer.toString(i / 30), lstartX + i - 25,\n\t\t\t\t\t\tstartY - 5);\n\t\t\t} else {\n\t\t\t\tg.drawString(Integer.toString(i / 30), lstartX + i - 20,\n\t\t\t\t\t\tstartY - 5);\n\t\t\t}\n\t\t\tg.drawString(String.valueOf((char) (i / 30 + 64)), lstartX - 15,\n\t\t\t\t\tstartY + i - 10);\n\t\t}\n\t\t//Linen des 2. Spiefeldes\n\t\tfor (int i = 0; i < 330; i = i + 30) {\n\t\t\tg.drawLine(lstartX + i, startY, lstartX + i, endY);\n\t\t\tg.drawLine(lstartX, startY + i, lendX, startY + i);\n\t\t}\n\n\t\t// Hover effekte\n\t\tfor (int i = 0; i < 300; i = i + 30) {\n\t\t\tfor (int j = 0; j < 300; j = j + 30) {\n\t\t\t\tint x = i / 30;\n\t\t\t\tint y = j / 30;\n\t\t\t\t//Fuers schiffe setzen\n\t\t\t\tif (gesetzeSchiffe.contains(new Point(x, y)) && setzeSchiffe) {\n\t\t\t\t\t//gesetzte schiffe schwart malen\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(lstartX + i + 1, startY + j + 1, 29, 29);\n\t\t\t\t//schiffe duerfen gesetzen werden\n\t\t\t\t} else if (setzeSchiffe) {\n\t\t\t\t\t// Hover effekt\n\t\t\t\t\tif (lstartX + i + 1 == 30 * lastX + 1\n\t\t\t\t\t\t\t&& startY + j + 1 == 30 * lastY + 1) {\n\t\t\t\t\t\tif (gesetzeSchiffe.contains(new Point(x, y))) {\n\t\t\t\t\t\t\tg.setColor(Color.red);\n\t\t\t\t\t\t\tg.fillRect(30 * lastX + 1, 30 * lastY + 1, 29, 29);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tg.setColor(Color.blue);\n\t\t\t\t\t\t\tg.fillRect(30 * lastX + 1, 30 * lastY + 1, 29, 29);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tint anzahl = ships[anzahlschiffe - 1];\n\t\t\t\t\t\t// Drehung in X-Richtug\n\t\t\t\t\t\tif (drehen) {\n\t\t\t\t\t\t\t// Wie lang ist das Schiff?\n\t\t\t\t\t\t\tfor (int k = 0; k < anzahl; k++) {\n\t\t\t\t\t\t\t\t//Innerhalb des Spielfeldes Malen\n\t\t\t\t\t\t\t\tif (lstartX + i + 1 + k * 30 < lendX) {\n\t\t\t\t\t\t\t\t\tif (!gesetzeSchiffe.contains(new Point(x\n\t\t\t\t\t\t\t\t\t\t\t+ k, y)))\n\t\t\t\t\t\t\t\t\t\tg.setColor(Color.blue);\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tg.setColor(Color.red);\n\t\t\t\t\t\t\t\t\tg.fillRect(lstartX + i + 1 + k * 30, startY\n\t\t\t\t\t\t\t\t\t\t\t+ j + 1, 29, 29);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t// Drehung in Y-Richtug\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Wie lang ist das Schiff?\n\t\t\t\t\t\t\tfor (int k = 0; k < anzahl; k++) {\n\t\t\t\t\t\t\t\t//Innerhalb des Spielfeldes Malen\n\t\t\t\t\t\t\t\tif (startY + k * 30 + j + 1 < endY) {\n\t\t\t\t\t\t\t\t\tif (!gesetzeSchiffe.contains(new Point(x, y\n\t\t\t\t\t\t\t\t\t\t\t+ k)))\n\t\t\t\t\t\t\t\t\t\tg.setColor(Color.blue);\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tg.setColor(Color.red);\n\t\t\t\t\t\t\t\t\tg.fillRect(lstartX + i + 1, startY + k * 30\n\t\t\t\t\t\t\t\t\t\t\t+ j + 1, 29, 29);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Wenn keine schiffe gesetzt werden\n\t\t\t\t} else {\n\t\t\t\t\t// Kein schuss auf das Feld = DarkGrey\n\t\t\t\t\tif (spielfeld2[x][y] == 0\n\t\t\t\t\t\t\t&& gesetzeSchiffe.contains(new Point(x, y))) {\n\t\t\t\t\t\tg.setColor(Color.darkGray);\n\t\t\t\t\t\tg.fillRect(lstartX + i + 1, startY + j + 1, 29, 29);\n\t\t\t\t\t// Schuss = Gray\n\t\t\t\t\t} else if (spielfeld2[x][y] == 1) {\n\t\t\t\t\t\tg.setColor(Color.gray);\n\t\t\t\t\t\tg.fillRect(lstartX + i + 1, startY + j + 1, 29, 29);\n\t\t\t\t\t//Treffer mit Roten-Kreuz\n\t\t\t\t\t} else if (spielfeld2[x][y] == 2) {\n\t\t\t\t\t\tg.setColor(Color.red);\n\t\t\t\t\t\tg.fillRect(lstartX + i + 1, startY + j + 1, 29, 29);\n\t\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\t\tg.drawLine(lstartX + i + 1 + 10, startY + j + 1 + 10,\n\t\t\t\t\t\t\t\tlstartX + i + 1 + 20, startY + j + 1 + 20);\n\t\t\t\t\t\tg.drawLine(lstartX + i + 1 + 20, startY + j + 1 + 10,\n\t\t\t\t\t\t\t\tlstartX + i + 1 + 10, startY + j + 1 + 20);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Chat-GUI am \"Ende\" zeichnen\n\t\tsuper.paint(g);\n\t}", "private void paintNumbers() {\n\n g2d.setColor(_BOARDCOLOR);\n g2d.drawString(\"0\", 100, 150);\n g2d.drawString(\"1\", 200, 150);\n g2d.drawString(\"2\", 300, 150);\n g2d.drawString(\"3\", 400, 150);\n g2d.drawString(\"4\", 100, 250);\n g2d.drawString(\"5\", 200, 250);\n g2d.drawString(\"6\", 300, 250);\n g2d.drawString(\"7\", 400, 250);\n g2d.drawString(\"8\", 100, 350);\n g2d.drawString(\"9\", 200, 350);\n g2d.drawString(\"10\", 300, 350);\n g2d.drawString(\"11\", 400, 350);\n g2d.drawString(\"12\", 100, 450);\n g2d.drawString(\"13\", 200, 450);\n g2d.drawString(\"14\", 300, 450);\n g2d.drawString(\"15\", 400, 450);\n }", "void drawStuff (Graphics g) {\n if (g instanceof PrintGraphics) \n g.setColor (parent.parent.parent.printImgBColor);\n else \n g.setColor (parent.parent.parent.normImgBColor);\n \n g.fillRect (0, 0, _xPix, _yPix - 3 * parent.lineSize);\n \n //draw the stuff\n drawBins (g);\n \n //Draw the Time Line\n drawTimeLine (g);\n }", "public void addLines(){\n\t\tif (controlPoints.size() == 1) return;\n\t\t\n\t\tif (lineLists.size() < controlPoints.size()-1){\n\t\t lineLists.add(new LinkedList<Line>());\n\t\t}\n\t\t\n\t\t\n\t\tint numControlLines = controlPoints.size() - 1;\n\t\t\n\t\tfor (int i = 0; i < numControlLines; i++){\n\t\t\tLine line = new Line();\n\t\t\tif (i == 0){\n\t\t\t\tline.setStroke(Color.LIGHTGRAY);\n\t\t\t\tline.setStrokeWidth(2);\n\t\t\t\tline.setVisible(showPrimaryLines);\n\t\t\t\tpane.getChildren().add(line);\n\t\t\t\tline.toBack();\n\t\t\t} else {\n\t\t\t\tdouble hue = 360 * (((i-1)%controlPoints.size())/(double)controlPoints.size());\n\t\t\t\tdouble sat = .4;\n\t\t\t\tdouble bri = .8;\n\t\t\t\tline.setStroke(Color.hsb(hue, sat, bri));\n\t\t\t\tline.setStrokeWidth(2);\n\t\t\t\tline.setVisible(showSubLines);\n\t\t\t\tpane.getChildren().add(line);\n\t\t\t}\n\t\t\tLinkedList<Line> list = lineLists.get(i);\n\t\t\tlist.add(line);\n\t\t}\n\t}", "private void drawVector(Vector2 v, float x, float y, float scayl, ShapeRenderer sr) {\n float arrowsize = 4;\n sr.begin(ShapeRenderer.ShapeType.Line);\n // Translate to location to render vector\n sr.setColor(0,0,0,.5f);\n sr.identity();\n sr.translate(x,y,0);\n // Call vector heading function to get direction (note that pointing to the right is a heading of 0) and rotate\n sr.rotate(0,0,1,v.angle());\n // Calculate length of vector & scale it to be bigger or smaller if necessary\n float len = scayl;\n // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction)\n sr.line(0,0,len,0);\n //line(len,0,len-arrowsize,+arrowsize/2);\n //line(len,0,len-arrowsize,-arrowsize/2);\n sr.end();\n }", "public void tetraederzeichnen(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy){\n double[][] arr_koordinaten_2d ={{ax,ay},{bx,by},{cx,cy},{dx,dy}};\n /**\n * Aufruf der Methode gestricheltodernicht\n *\n * Überprüft, welche Strecken von Punkt D sichtbar sind oder nicht.\n */\n\n boolean[] strichelnodernicht = cls_berechnen.gestricheltodernicht(arr_koordinaten_2d);\n\n /**Skaliert die Koordinaten zum Pixelformat mit Koordinatenursprung\n * ca in der Mitte der Zeichenfläche*/\n int sw=9; //skalierungswert\n ax= (sw+ax)*50;\n ay=(sw-ay)*50;\n bx= (sw+bx)*50;\n by=(sw-by)*50;\n cx= (sw+cx)*50;\n cy=(sw-cy)*50;\n dx= (sw+dx)*50;\n dy=(sw-dy)*50;\n\n /**\n * Erstellt Linienobjekte für die Kanten des Tetraeder Objekts...\n */\n Line line1 = new Line();\n Line line2 = new Line();\n Line line3 = new Line();\n Line line4 = new Line();\n Line line5 = new Line();\n Line line6 = new Line();\n\n /**\n * ... weißt ihnen die Koordinaten zu...\n */\n line1.setStartX(ax);\n line1.setStartY(ay);\n line1.setEndX(bx);\n line1.setEndY(by);\n\n line2.setStartX(ax);\n line2.setStartY(ay);\n line2.setEndX(cx);\n line2.setEndY(cy);\n\n line3.setStartX(bx);\n line3.setStartY(by);\n line3.setEndX(cx);\n line3.setEndY(cy);\n \n line4.setStartX(dx);\n line4.setStartY(dy);\n line4.setEndX(ax);\n line4.setEndY(ay);\n\n line5.setStartX(dx);\n line5.setStartY(dy);\n line5.setEndX(bx);\n line5.setEndY(by);\n\n line6.setStartX(dx);\n line6.setStartY(dy);\n line6.setEndX(cx);\n line6.setEndY(cy);\n \n if(!strichelnodernicht[0]){\n line4.getStrokeDashArray().addAll(5d,5d);}\n\n if(!strichelnodernicht[1]){\n line5.getStrokeDashArray().addAll(5d,5d);}\n\n if(!strichelnodernicht[2]){\n line6.getStrokeDashArray().addAll(5d,5d);}\n\n /**\n * ... und fügt die Linien Objekte der Zeichenfläche hinzu\n */\n canvaspane.getChildren().add(line1);\n canvaspane.getChildren().add(line2);\n canvaspane.getChildren().add(line3);\n canvaspane.getChildren().add(line4);\n canvaspane.getChildren().add(line5);\n canvaspane.getChildren().add(line6);\n\n //zeichnet den Koordinatenursprung neu\n canvaspane.getChildren().add(l1);\n canvaspane.getChildren().add(l2);\n }", "public static void main(String[] args){\n\t\tDrawingPanel panel = new DrawingPanel(100, 138);\n\t\tGraphics g = panel.getGraphics();\n g.fillOval(0,1,2,3);\n g.fillRect(4,5,6,7);\n g.fillArc(8,7,10,11,12,13);\n int count = 0;\n\t\tString StringLine1, StringLine2, StringLine3, StringLine4, StringLine5, StringLine6, StringLine7, StringLine8, StringLine9, StringLine10, StringLine11, StringLine12, StringLine13, StringLine14, StringLine15, StringLine16, StringLine17, StringLine18, StringLine19, StringLine20, StringLine21, StringLine22, StringLine23, StringLine24, StringLine25, StringLine26, StringLine27, StringLine28, StringLine29, StringLine30, StringLine31, StringLine32, StringLine33, StringLine34, StringLine35, StringLine36, StringLine37, StringLine38, StringLine39, StringLine40, StringLine41, StringLine42, StringLine43, StringLine44, StringLine45, StringLine46, StringLine47, StringLine48, StringLine49, StringLine50, StringLine51, StringLine52, StringLine53, StringLine54, StringLine55, StringLine56, StringLine57, StringLine58, StringLine59, StringLine60, StringLine61, StringLine62, StringLine63, StringLine64, StringLine65, StringLine66, StringLine67, StringLine68, StringLine69, StringLine70, StringLine71, StringLine72, StringLine73, StringLine74, StringLine75, StringLine76, StringLine77, StringLine78, StringLine79, StringLine80, StringLine81, StringLine82, StringLine83, StringLine84, StringLine85, StringLine86, StringLine87, StringLine88, StringLine89, StringLine90, StringLine91, StringLine92, StringLine93, StringLine94, StringLine95, StringLine96, StringLine97, StringLine98, StringLine99, StringLine100;\n\t\tStringLine1\t\t = \"999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\";\n\t\tStringLine2\t\t = \"999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\";\n\t\tStringLine3\t\t = \"999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\";\n\t\tStringLine4\t\t = \"999999999999999999999999999999999999999955555555559999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\";\n\t\tStringLine5\t\t = \"999999999999999999999999999999999955555555555555555555555555999999999999999936666888888899999999999999999999999999999999999999999999999999\";\n\t\tStringLine6\t\t = \"999999999999999999999999999999955555555555555555555555555555555555549996336747663368666668999999999999999999999999999999999999999999999999\";\n\t\tStringLine7\t\t = \"999999999999999999999999999995555555555555555555555555555555555555151736641446333367886366889999999999999999999999999999999999999999999999\";\n\t\tStringLine8\t\t = \"999999999999999999999999999555555555555555555555555555555555555555555178411517686368444788887899999999999999999999999999999999999999999999\";\n\t\tStringLine9\t\t = \"999999999999999999999999995555555555555555555555555555555555555555555551555511448336477887663689999999999999999999999999999999999999999999\";\n\t\tStringLine10\t = \"999999999999999999999999955555555555555555555555555555555555555555555555555555511144783636868887999999999999999999999999999999999999999999\";\n\t\tStringLine11\t = \"999999999999999999999995555555555555555555555555555555555555555555555555555555555551144686366667899999999999999999999999999999999999999999\";\n\t\tStringLine12\t = \"999999999999999999999955555555555555555555555555555555555555555555551111111111111111111114444686699999999999999999999999999999999999999999\";\n\t\tStringLine13\t = \"999999999999999999999555555555555555555555555555555555551555555111414444411111111111111111111111499999999999999999999999999999999999999999\";\n\t\tStringLine14\t = \"999999999999999999995555555555555555555551555111111111151111111414444444444411111111111111111111111199999999999999999999999999999999999999\";\n\t\tStringLine15\t = \"999999999999999999955555555555555555555515511511111111111111114144444444444444411111111111111111111111119999999999999999999999999999999999\";\n\t\tStringLine16\t = \"999999999999999995555555555555555555551111111111111111141111411111444477777777477444111111111111111111111111999999999999999999999999999999\";\n\t\tStringLine17\t = \"999999999999999955555555555555555555115111111414441441411114111144447777787777777777774414444444111111111111119999999999999999999999999999\";\n\t\tStringLine18\t = \"999999999999999555555555555555555511111111111144444444114411111114747777888878888888777444444444444111111111111199999999999999999999999999\";\n\t\tStringLine19\t = \"999999999999995555555555555555551111114141414414144141441111441147477878888888868888888774444444444444441414111119999999999999999999999999\";\n\t\tStringLine20\t = \"999999999999955555555555555511111114441447474444441441111144411477744777778886688688888777444444444474444444444411199999999999999999999999\";\n\t\tStringLine21\t = \"999999999999555555555555555515111414444774747477444444444474411444444174777888866686888877777747747774774744447441119999999999999999999999\";\n\t\tStringLine22\t = \"999999999999555555555555551111114177474477477774777444417774111441444414778888666666688888887777777777777774444744411199999999999999999999\";\n\t\tStringLine23\t = \"999999999995555555555555551511144441447777777777777777477774111744111147787888666666888888888888877778778777774444441119999999999999999999\";\n\t\tStringLine24\t = \"999999999955555555555555515114171144774777777777777777777841114444111177888868686666668688868888888888888888877444414411499999999999999999\";\n\t\tStringLine25\t = \"999999999955555555555555151111117474477777777777777777788841114841111177886666686363666688888686868886888888777747441111149999999999999999\";\n\t\tStringLine26\t = \"999999999555555555555555151114174447747777777777777777886811116641114117866666666336663666686666666666868888888877744441111999999999999999\";\n\t\tStringLine27\t = \"999999999555555555555551511111774777777777777777777888886411446711436477866663663333336366666666666666668888888888877444411199999999999999\";\n\t\tStringLine28\t = \"999999995555555555555511111144417477777777777777787878868411148711333447866633336333333336363636666366668686666666688777441119999999999999\";\n\t\tStringLine29\t = \"999999995555555555555511111471447777777877777777788888668411118641113648666363333333333333336666333366666333633366636888848411999999999999\";\n\t\tStringLine30\t = \"999999955555555555555115111147477777778778777778878888668411117611441447636333333333333333333333333363633666666636666687887441199999999999\";\n\t\tStringLine31\t = \"999999955555555555551111111474777777788887887778787888667411118711111437333663333333333333333333333666668688866666666866888774119999999999\";\n\t\tStringLine32\t = \"999999555555555555551151141747477777888888887878888888687711118411153448333363333333333333333333666866888666668886668868688777441999999999\";\n\t\tStringLine33\t = \"999999555555555555511111417747777777888888888888888886888411118611114346663633333333333333333363688888666636684786888886868884844499999999\";\n\t\tStringLine34\t = \"999995555555555555555111444477777777886888888888888686687411118711444446663333333333336333333668888868666666644877888778868887774449999999\";\n\t\tStringLine35\t = \"999995555555555555551114447777777788888888888888888666667411118711333486886333333333386333666888688686666666847777788878888888776744999999\";\n\t\tStringLine36\t = \"999995555555555555551144474777777878886688888886866886668741117471633488863333333336886366868666668866686636417777488878888886687744999999\";\n\t\tStringLine37\t = \"999955555555555555551744777777778888866666686888666666688874117474167877886333333688866687747786668666866668444777447888888888888884499999\";\n\t\tStringLine38\t = \"999955555555555555554444777777787888666666666666668666666674117747417888863336666877887744444447886886666668444777747888788668688887449999\";\n\t\tStringLine39\t = \"999955555555555555551447777777878886666666666668866666633374417677844788663668888777744477787744868888666667744777744478888688888877749999\";\n\t\tStringLine40\t = \"999955555555555555551777777777788866666663666366666633333384114687837783368888777777778788887474766668663667744777777478888668886888844999\";\n\t\tStringLine41\t = \"999955555555555555551477778777788888666366663366866633333641114867866636688887777777778788867187788786633667711777777447888688886868784999\";\n\t\tStringLine42\t = \"999955555555555555554777787787888886666666666366666333333644411768787887777777477747777787784186788886666687711777777744888688886686884499\";\n\t\tStringLine43\t = \"999555555555555555554777878888788866663666363666663333333374414777777774444447774474444477444173888686668667744777788774788888866668674499\";\n\t\tStringLine44\t = \"999555555555555555555787788878888866666663633663666633333381144777777444444447444447444447777116686888663667744478866744786886666666884499\";\n\t\tStringLine45\t = \"999555555555555555551778878888888666633366333663666633333387788777774447474747774777777777887411887866333337446478766847786666663666688499\";\n\t\tStringLine46\t = \"999555555555555555554778888888886666633633633663666633333366666887888877777777877788878888638871166663666336744778863874776666333363687499\";\n\t\tStringLine47\t = \"999555555555555555551478788888866666636666333633666663333333666666668888888866888888888686336674176666636633744477866844776666366336687499\";\n\t\tStringLine48\t = \"999955555555555555555177778888666666663663333663666663333333333333366688888866666666666633336884443646664333871478866874788666663366684499\";\n\t\tStringLine49\t = \"999955555555555555555177888868686666663663633663366833333333333333336888888888668666666668636874463666666633774178863744788666633366684449\";\n\t\tStringLine50\t = \"999955555555555555555147888888666666666666333633638633333336666636666888877868866888888888888771466633636338771478866747886666366336687439\";\n\t\tStringLine51\t = \"999995555555555555555577887786686866636363636633366863333666666663668877777787777778887888887711888866633368741778888747766666633366684499\";\n\t\tStringLine52\t = \"999995555555555555555177777886866666663663336633366633336666636668744474444444447477778877874118888766866668741487868447886666663333687499\";\n\t\tStringLine53\t = \"999995555555555555555177878888666666633636366633636633333367863847777744744477447444777777774186747866666668711787787448886666663636684499\";\n\t\tStringLine54\t = \"999995555555555555551147888888886666663636638666336633333384467448888774777777774774444777764168777888868668744777884478886686666368684499\";\n\t\tStringLine55\t = \"999995555555555555515147788788868666666666666863666333336874474488887668777777777777444478867188487778888668714777777486866666666666674499\";\n\t\tStringLine56\t = \"999955555555555555555577778878888686666636666666663633333874444688866333668888777777777777887474487788666668414777774868686666866668744999\";\n\t\tStringLine57\t = \"999955555555555555555517788888888888866663666666666633333811117688867766336666688777744447777744788888866666411777747668666668688688744999\";\n\t\tStringLine58\t = \"999955555555555555555117777888878888666636666866666633633711118687774788863333366877777774744147688886886688411777476688866666886684749999\";\n\t\tStringLine59\t = \"999955555555555555555117777878888888666636668668666663333441118844747788786333333368886666887633688886688886417777886888886686886888449999\";\n\t\tStringLine60\t = \"999955555555555555555517777788888888866666666886666666663711118747187787788363333333666633333333667886668666418777866686666666686887499999\";\n\t\tStringLine61\t = \"999955555555555555555514777777878888688866888888866666683411118771433447876636333333336666333333336886666666747778868868868868868874999999\";\n\t\tStringLine62\t = \"999955555555555555555514477777778888886866888788888866683711118471433846886636666333333333333333333688886636344888688886866888664469999999\";\n\t\tStringLine63\t = \"999955555555555555555514747778788888888888888878888866636411118741444667666363363333333333333333333368886636384766688888688668444499999999\";\n\t\tStringLine64\t = \"999995555555555555555554447777778788888888887788788866368411118741114444633333633333333333333333333336888886668666668868686884644999999999\";\n\t\tStringLine65\t = \"999995555555555555555554447777777778887888878778788888668711116411111344663333633333333333333333366666366888686666668866888646449999999999\";\n\t\tStringLine66\t = \"999995555555555555555511144477777788788878887777788886666411118841151464666333333333333333333663333666866688686336686888876444499999999999\";\n\t\tStringLine67\t = \"999999555555555555555511114477777777877787877777778888666411116771111444766636333333333333336636666888888886666366868786444441999999999999\";\n\t\tStringLine68\t = \"999999555555555555555511114444747777777777777777777888668411116771111344766636336333333333366366666668688888888888887744441419999999999999\";\n\t\tStringLine69\t = \"999999555555555555555551511444477777777777777777777888688411118441133674786666663333333333666666666686888777888777874444411119999999999999\";\n\t\tStringLine70\t = \"999999955555555555555551151144447777777777777777778778888111116744163444768666666633333336366666866688888878777777444444441499999999999999\";\n\t\tStringLine71\t = \"999999955555555555555555115114444447777777777777777878868114446844114814768866663636636366668666888888887887787747444444444999999999999999\";\n\t\tStringLine72\t = \"999999995555555555555555511111444477777777777777777778788114447841411114888886866666666666668688888887888777777444444444449999999999999999\";\n\t\tStringLine73\t = \"999999995555555555555555555111444444447777777777777777776411417874111114887888686666366668888888888887877877444474746444499999999999999999\";\n\t\tStringLine74\t = \"999999999555555555555555555511414444774777777777777777778811117844411144778788866666668688888888788787778774778874484449999999999999999999\";\n\t\tStringLine75\t = \"999999999555555555555555555551144444477747777777777777777811111444444444477788866666888888877777777777777777787747744499999999999999999999\";\n\t\tStringLine76\t = \"999999999955555555555555555555111414477774777777777777777771111174444444777888868666688888877777777777874477444444449999999999999999999999\";\n\t\tStringLine77\t = \"999999999955555555555555555555511144444777777777777777474774111148787777788878888888888877777777777744444444444444999999999999999999999999\";\n\t\tStringLine78\t = \"999999999995555555555555555555555111444747777477744444444447411117447778788888888888887777747444444444444444444499999999999999999999999999\";\n\t\tStringLine79\t = \"999999999999555555555555555555555551144144744444444444444444444144777778888878888887877744444444444444444444149999999999999999999999999999\";\n\t\tStringLine80\t = \"999999999999955555555555555555555555511144144414444444444414444444447788787877777777444444414444411414114149999999999999999999999999999999\";\n\t\tStringLine81\t = \"999999999999995555555555555555555555555511414444474474444444144444474777777777747444444444441111144441444999999999999999999999999999999999\";\n\t\tStringLine82\t = \"999999999999999555555555555555555555555551511141744444444444444444777777777744444444414114114444441144999999999999999999999999999999999999\";\n\t\tStringLine83\t = \"999999999999999955555555555555555555555555551111414144444444444477474774744444444441441141441111114999999999999999999999999999999999999999\";\n\t\tStringLine84\t = \"999999999999999995555555555555555555555555555551111411411444444444444444444444444114144414111414643999999999999999999999999999999999999999\";\n\t\tStringLine85\t = \"999999999999999999555555555555555555555555555555555511511111111414444444444444444444111111114786336999999999999999999999999999999999999999\";\n\t\tStringLine86\t = \"999999999999999999955555555555555555555555555555555555555555555155555111111515555555111146488777888899999999999999999999999999999999999999\";\n\t\tStringLine87\t = \"999999999999999999999555555555555555555555555555555555555555555555555555555555555551114444887777778999999999999999999999999999999999999999\";\n\t\tStringLine88\t = \"999999999999999999999955555555555555555555555555555555555555555555555555555555551833688778888888889999999999999999999999999999999999999999\";\n\t\tStringLine89\t = \"999999999999999999999995555555555555555555555555555555555555555555555555555555144763336447448688699999999999999999999999999999999999999999\";\n\t\tStringLine90\t = \"999999999999999999999999555555555555555555555555555555555555555555555555517777866666368747778876999999999999999999999999999999999999999999\";\n\t\tStringLine91\t = \"999999999999999999999999995555555555555555555555555555555555555555555555547778863333338868868799999999999999999999999999999999999999999999\";\n\t\tStringLine92\t = \"999999999999999999999999999555555555555555555555555555555555555555555555173868888633338888766999999999999999999999999999999999999999999999\";\n\t\tStringLine93\t = \"999999999999999999999999999995555555555555555555555555555555555555555544414663688886878886999999999999999999999999999999999999999999999999\";\n\t\tStringLine95\t = \"999999999999999999999999999999999555555555555555555555555555555555555555559999999999999999999999999999999999999999999999999999999999999999\";\n\t\tStringLine94\t = \"999999999999999999999999999999955555555555555555555555555555555555555555555549999999999999999999999999999999999999999999999999999999999999\";\n\t\tStringLine96\t = \"999999999999999999999999999999999999555555555555555555555555555555555555999999999999999999999999999999999999999999999999999999999999999999\";\n\t\tStringLine97\t = \"999999999999999999999999999999999999999555555555555555555555555555555999999999999999999999999999999999999999999999999999999999999999999999\";\n\t\tStringLine98\t = \"999999999999999999999999999999999999999999999555555555555555555559999999999999999999999999999999999999999999999999999999999999999999999999\";\n\t\tStringLine99\t = \"999999999999999999999999999999999999999999999999990555555555559999999999999999999999999999999999999999999999999999999999999999999999999999\";\n\t\tStringLine100\t = \"999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\";\n\t\tstringIntaker(g, StringLine1, count); count++; stringIntaker(g, StringLine2, count); count++; stringIntaker(g, StringLine3, count); count++; stringIntaker(g, StringLine4, count); count++; stringIntaker(g, StringLine5, count); count++; stringIntaker(g, StringLine6, count); count++; stringIntaker(g, StringLine7, count); count++; stringIntaker(g, StringLine8, count); count++; stringIntaker(g, StringLine9, count); count++; stringIntaker(g, StringLine10, count); count++; stringIntaker(g, StringLine11, count); count++; stringIntaker(g, StringLine12, count); count++; stringIntaker(g, StringLine13, count); count++; stringIntaker(g, StringLine14, count); count++; stringIntaker(g, StringLine15, count); count++; stringIntaker(g, StringLine16, count); count++; stringIntaker(g, StringLine17, count); count++; stringIntaker(g, StringLine18, count); count++; stringIntaker(g, StringLine19, count); count++; stringIntaker(g, StringLine20, count); count++; stringIntaker(g, StringLine21, count); count++; stringIntaker(g, StringLine22, count); count++; stringIntaker(g, StringLine23, count); count++; stringIntaker(g, StringLine24, count); count++; stringIntaker(g, StringLine25, count); count++; stringIntaker(g, StringLine26, count); count++; stringIntaker(g, StringLine27, count); count++; stringIntaker(g, StringLine28, count); count++; stringIntaker(g, StringLine29, count); count++; stringIntaker(g, StringLine30, count); count++; stringIntaker(g, StringLine31, count); count++; stringIntaker(g, StringLine32, count); count++; stringIntaker(g, StringLine33, count); count++; stringIntaker(g, StringLine34, count); count++; stringIntaker(g, StringLine35, count); count++; stringIntaker(g, StringLine36, count); count++; stringIntaker(g, StringLine37, count); count++; stringIntaker(g, StringLine38, count); count++; stringIntaker(g, StringLine39, count); count++; stringIntaker(g, StringLine40, count); count++; stringIntaker(g, StringLine41, count); count++; stringIntaker(g, StringLine42, count); count++; stringIntaker(g, StringLine43, count); count++; stringIntaker(g, StringLine44, count); count++; stringIntaker(g, StringLine45, count); count++; stringIntaker(g, StringLine46, count); count++; stringIntaker(g, StringLine47, count); count++; stringIntaker(g, StringLine48, count); count++; stringIntaker(g, StringLine49, count); count++; stringIntaker(g, StringLine50, count); count++; stringIntaker(g, StringLine51, count); count++; stringIntaker(g, StringLine52, count); count++; stringIntaker(g, StringLine53, count); count++; stringIntaker(g, StringLine54, count); count++; stringIntaker(g, StringLine55, count); count++; stringIntaker(g, StringLine56, count); count++; stringIntaker(g, StringLine57, count); count++; stringIntaker(g, StringLine58, count); count++; stringIntaker(g, StringLine59, count); count++; stringIntaker(g, StringLine60, count); count++; stringIntaker(g, StringLine61, count); count++; stringIntaker(g, StringLine62, count); count++; stringIntaker(g, StringLine63, count); count++; stringIntaker(g, StringLine64, count); count++; stringIntaker(g, StringLine65, count); count++; stringIntaker(g, StringLine66, count); count++; stringIntaker(g, StringLine67, count); count++; stringIntaker(g, StringLine68, count); count++; stringIntaker(g, StringLine69, count); count++; stringIntaker(g, StringLine70, count); count++; stringIntaker(g, StringLine71, count); count++; stringIntaker(g, StringLine72, count); count++; stringIntaker(g, StringLine73, count); count++; stringIntaker(g, StringLine74, count); count++; stringIntaker(g, StringLine75, count); count++; stringIntaker(g, StringLine76, count); count++; stringIntaker(g, StringLine77, count); count++; stringIntaker(g, StringLine78, count); count++; stringIntaker(g, StringLine79, count); count++; stringIntaker(g, StringLine80, count); count++; stringIntaker(g, StringLine81, count); count++; stringIntaker(g, StringLine82, count); count++; stringIntaker(g, StringLine83, count); count++; stringIntaker(g, StringLine84, count); count++; stringIntaker(g, StringLine85, count); count++; stringIntaker(g, StringLine86, count); count++; stringIntaker(g, StringLine87, count); count++; stringIntaker(g, StringLine88, count); count++; stringIntaker(g, StringLine89, count); count++; stringIntaker(g, StringLine90, count); count++; stringIntaker(g, StringLine91, count); count++; stringIntaker(g, StringLine92, count); count++; stringIntaker(g, StringLine93, count); count++; stringIntaker(g, StringLine94, count); count++; stringIntaker(g, StringLine95, count); count++; stringIntaker(g, StringLine96, count); count++; stringIntaker(g, StringLine97, count); count++; stringIntaker(g, StringLine98, count); count++; stringIntaker(g, StringLine99, count); count++; stringIntaker(g, StringLine100, count); \n\t}", "@Override\r\n\tprotected void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\r\n\t\tg.drawString(str, 10, 10);\r\n\t\tg.drawLine(10, 20, 110, 20);\r\n\t\tg.drawRect(pX, 30, 100, 100);\r\n\t\t\r\n\t}", "public void updateChart() {\n\t\tdouble val_min = Double.MAX_VALUE;\n\t\tdouble val_max = -Double.MAX_VALUE;\n\t\tVector<CurveData> cdV = new Vector<CurveData>();\n\n\t\tint maxMarkLength = 1;\n\t\tint nClmns = barColumns.size();\n\t\tint nMaxLines = 0;\n\t\tfor ( final BarColumn bc : barColumns ) {\n\t\t\tif (bc.show()) {\n\t\t\t\tfor (int j = 0; j < bc.size(); j++) {\n\t\t\t\t\tif (val_min > bc.value(j)) {\n\t\t\t\t\t\tval_min = bc.value(j);\n\t\t\t\t\t}\n\t\t\t\t\tif (val_max < bc.value(j)) {\n\t\t\t\t\t\tval_max = bc.value(j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (nMaxLines < bc.size()) {\n\t\t\t\tnMaxLines = bc.size();\n\t\t\t}\n\t\t\tif (maxMarkLength < bc.marker().length()) {\n\t\t\t\tmaxMarkLength = bc.marker().length();\n\t\t\t}\n\t\t}\n\n\t\tString tmp_str = \"\";\n\t\tfor (int i = 0; i < maxMarkLength; i++) {\n\t\t\ttmp_str = tmp_str + \" \";\n\t\t}\n\t\temptyStr = tmp_str;\n\n\t\t//System.out.println(\"debug =========== val_min=\" + val_min + \" val_max=\" + val_max);\n\n\t\tif (val_min * val_max > 0.) {\n\t\t\tif (val_min > 0.) {\n\t\t\t\tval_min = 0.;\n\t\t\t} else {\n\t\t\t\tval_max = 0.;\n\t\t\t}\n\t\t}\n\n\t\tint iMin = GP.getScreenX(GP.getCurrentMinX());\n\t\tint iMax = GP.getScreenX(GP.getCurrentMaxX());\n\t\t//System.out.println(\"debug iMin=\" + iMin + \" iMax=\" + iMax);\n\t\twidth = (int) ((iMax - iMin) / (1.9 * nMaxLines * nClmns));\n\t\t//System.out.println(\"debug width=\" + width);\n\t\tif (width < 1) {\n\t\t\twidth = 1;\n\t\t}\n\n\t\t//make line from\n\t\tCurveData cd = cvV.get(0);\n\t\tif (nClmns > 0) {\n\t\t\tcd.clear();\n\t\t\tcd.addPoint(0., 0.);\n\t\t\tcd.addPoint(1.0 * (nClmns + 1), 0.);\n\t\t\tcd.setColor(Color.black);\n\t\t\tcd.setLineWidth(1);\n\t\t\tcd.findMinMax();\n\t\t\tcdV.add(cd);\n\t\t}\n\n\t\tint cvCount = 1;\n\t\tfor (int i = 1; i <= nClmns; i++) {\n\t\t\tBarColumn bc = barColumns.get(i - 1);\n\t\t\tif (bc.show()) {\n\t\t\t\tdouble d_min = i - 0.35;\n\t\t\t\tdouble d_max = i + 0.35;\n\t\t\t\tint nL = bc.size();\n\t\t\t\tdouble st = (d_max - d_min) / nL;\n\t\t\t\tfor (int j = 0; j < nL; j++) {\n\t\t\t\t\tif (bc.show(j)) {\n\t\t\t\t\t\tif(cvCount < cvV.size()){\n\t\t\t\t\t\t\tcd = cvV.get(cvCount);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tcd = new CurveData();\n\t\t\t\t\t\t\tcvV.add(cd);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcd.clear();\n\t\t\t\t\t\tcd.addPoint(d_min + (j + 0.5) * st, 0.);\n\t\t\t\t\t\tcd.addPoint(d_min + (j + 0.5) * st, bc.value(j));\n\t\t\t\t\t\tcd.setLineWidth(width);\n\t\t\t\t\t\tif (bc.getColor(j) == null) {\n\t\t\t\t\t\t\tcd.setColor(bcColor.getColor(j));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcd.setColor(bc.getColor(j));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcd.findMinMax();\n\t\t\t\t\t\tcdV.add(cd);\n\t\t\t\t\t\tcvCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//System.out.println(\"debug ===========start plotting=============== nClmns= \" + nClmns);\n\t\tif (val_min < val_max) {\n\t\t\tformatter.makeAnalysis(val_min, val_max);\n\t\t\tGP.setNumberFormatY(formatter.getFormat());\n\t\t\tGP.setLimitsAndTicksY(formatter.getMin(), formatter.getMax(), formatter.getStep());\n\t\t}\n\n\t\tif (barColumns.size() >= 10) {\n\t\t\tGP.getCurrentGL().setXminOn(false);\n\t\t\tGP.getCurrentGL().setXmaxOn(false);\n\t\t}\n\n\t\tif (cdV.size() > 0) {\n\t\t\tGP.setCurveData(cdV);\n\t\t} else {\n\t\t\tGP.removeAllCurveData();\n\t\t}\n\t}", "@Override\n\tprotected void onDraw(Canvas canvas) \n\t{\n\t\tsuper.onDraw(canvas);\n\t\t\n\t\t//每项统计间隔的宽度\n\t\tint inspace = 30;\n\t\t\n\t\tint initX = 20;\n\t\tint initY = 20;\n\t\tcanvas.drawColor(Color.WHITE);\n\t\t\n\t\tint size = mItems.length;\n\t\t\n\t\tfor (int i = 0; i < size; i++) \n\t\t{\n\t\t\ttextPaint.setColor(mColors[i]);\n\t\t\tcanvas.drawText(\"text:\", initX, initY, textPaint);\n//\t\t\tcanvas.drawRect(rect, paint);\n\t\t\tcanvas.drawRect(initX +80, initY, initX + 200, initY +40, textPaint);\n\t\t\t\n\t\t\t\n\t\t\tinitY+=40;\n\t\t\t\n\t\t}\n\t\t\n\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t}", "public void draw(Graphics g) {\r\n g.drawLine(line.get(0).getX() + 4, line.get(0).getY() + 4, line.get(4).getX() + 4, line.get(4).getY() + 4);\r\n }", "@Override\n public void paint(Graphics g) {\n \t Graphics2D g2 = (Graphics2D) g;\n Dimension size = getSize();\n Font font = new Font(\"Arial\", Font.PLAIN, 14);\n \n g.setFont(font);\n \n String tempString = histTitle;\n FontRenderContext frc = ((Graphics2D)g).getFontRenderContext();\n Rectangle2D boundsTemp = font.getStringBounds(tempString, frc);\n Rectangle2D boundsCond = font.getStringBounds(\"\", frc);\n int wText = Math.max((int)boundsTemp.getWidth(), (int)boundsCond.getWidth());\n int hText = (int)boundsTemp.getHeight() + (int)boundsCond.getHeight();\n int rX = (size.width-wText)/2;\n int rY = (size.height-hText)/2;\n \n g.setColor(Color.WHITE);\n g2.fillRect(0, 0, size.width, size.height);\n \n g.setColor(Color.BLACK);\n int xTextTemp = rX-(int)boundsTemp.getX(); // centres the text\n int yTextTemp = rY-(int)boundsTemp.getY();\n g.drawString(tempString, xTextTemp, 20);\n \n int maxX = size.width;\n int maxY = size.height;\n int yAxis_startX = 20; int yAxis_startY=maxY-20; int yAxis_endX=20; int yAxis_endY=20;\n int xAxis_startX = 20; int xAxis_startY=maxY-20; int xAxis_endX=maxX-20; int xAxis_endY=maxY-20;\n \n drawArrow(g, yAxis_startX, yAxis_startY, yAxis_endX, yAxis_endY, ArrowDirection.UPWARD);\n drawArrow(g, xAxis_startX, xAxis_startY, xAxis_startX+513, xAxis_endY, ArrowDirection.LEFTWARD); // what the hell. Let's fix hist width to 512 + 1 pixels (two pixels for each grayscale value)\n \n if (pierwszy==null) { // Clear the histogram view\n \t g.setColor(Color.WHITE);\n \t g.fillRect(yAxis_endX+1, yAxis_endY-1, 512, yAxis_startY-yAxis_endY-1);\n \t System.out.println(\"Cleared hist\");\n }\n else\n {\n \t BufferedImage grayScaled = new BufferedImage(pierwszy.getWidth(), pierwszy.getHeight(), BufferedImage.TYPE_BYTE_GRAY);\n \t Graphics gg = grayScaled.getGraphics();\n \t System.out.println(\"W=\"+grayScaled.getWidth()+\", H=\"+grayScaled.getHeight());\n \t gg.drawImage(pierwszy, 0, 0, null);\n \t lut = getGrayscaleHist(grayScaled);\n \t int maxBarHeight = yAxis_endY-yAxis_startY-1;\n \t paintBars(g, lut, xAxis_startX+1, xAxis_startY-1, maxBarHeight);\n }\n }", "@Override\r\n\tpublic void paint(Graphics g) {\n\t\tGraphics2D g2d= (Graphics2D)g;//Cast the Graphics received in the paint method to Graphics2D\r\n\t\tg2d.setColor(Color.RED);//Set the color to red\r\n\t\tg2d.setStroke(new BasicStroke(5));//Set the width of the line to 5px \r\n\t\t//g2d.drawLine(0, 0, 500, 500);//Draw a line starting at point (0,0) and ending at point (500,500)\r\n\t\t//g2d.drawRect(100, 100, 300, 300);//Draw a rectangle with upper left corner at (100,100) and with width and height of 300px\r\n\t\tg2d.setColor(Color.GREEN);//Set the color to green\r\n\t\t//g2d.fillRect(100, 100, 300, 300);//Fill the rectangle\r\n\t\t\r\n\t\t//If we will draw the line first and then the rectangle, the rectangle will be on top of the line and hide part of it\r\n\t\t//g2d.drawOval(100, 100, 300, 300);//Draw circle\r\n\t\t//g2d.fillOval(100, 100, 300, 300);//Fill the circle\r\n\t\t\r\n\t\t//g2d.drawArc(100,100,200,200,0,180);//Draw half circle\r\n\t\r\n\t\t//g2d.drawArc(100,100,200,200,180,180);//Flip it\r\n\t\t//g2d.drawArc(100,100,200,200,0,270);//Draw 3/4 of a circle\r\n\t\t\r\n\t\t//int[] xPoints= {150,250,350};\r\n\t\t//int[] yPoints= {300,150,300};\r\n\t\t//g2d.drawPolygon(xPoints,yPoints,3);//Draw rectangle using polygon, specify x points and y points of the corners and number of corners,\r\n\t\t\t\t\t\t\t\t\t\t //we can specify more than 3 corners and create different shapes.\r\n\t\t\t\t\r\n\t\t//g2d.fillPolygon(xPoints,yPoints,3);//Fill the rectangle using polygon\r\n\t\tg2d.setColor(Color.BLACK);//Set the color to black\r\n\t\tg2d.setFont(new Font(\"Ink Free\", Font.BOLD,40));\r\n\t\tg2d.drawString(\"Hello world\", 100, 100);\r\n\t}", "private void drawAxisLines() {\n\t\t//Draw axis lines\n\t\tgl.glLineWidth(2.0f);\n\t\tgl.glBegin(GL2.GL_LINES);\n\t\t\n\t\t//Line Positive X - Red\n\t\tgl.glColor3d(1, 0, 0);\n\t\tgl.glVertex3d(0, 0, 0);\n\t\tgl.glVertex3d(1, 0, 0);\n\t\t//Line Negative X - Red\n\t\tgl.glColor3d(1, 0, 0);\n\t\tgl.glVertex3d(0, 0, 0);\n\t\tgl.glVertex3d(-1, 0, 0);\n\t\t//Line Positive Y - Green\n\t\tgl.glColor3d(0, 1, 0);\n\t\tgl.glVertex3d(0, 0, 0);\n\t\tgl.glVertex3d(0, 1, 0);\n\t\t//Line Negative Y - Green\n\t\tgl.glColor3d(0, 1, 0);\n\t\tgl.glVertex3d(0, 0, 0);\n\t\tgl.glVertex3d(0, -1, 0);\n\t\t//Line Positive Z - Blue\n\t\tgl.glColor3d(0, 0, 1);\n\t\tgl.glVertex3d(0, 0, 0);\n\t\tgl.glVertex3d(0, 0, 1);\n\t\t//Line Negative Z - Blue\n\t\tgl.glColor3d(0, 0, 1);\n\t\tgl.glVertex3d(0, 0, 0);\n\t\tgl.glVertex3d(0, 0, -1);\n\n\t\tgl.glEnd();\n\t}", "@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n\n if (bdhcHandler != null) {\n int[] slopes = bdhcHandler.getSelectedPlate().getSlope();\n float angle = (float) Math.atan2(slopes[indexSlope1], slopes[indexSlope2]);\n\n Graphics2D g2 = (Graphics2D) g;\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\n RenderingHints.VALUE_ANTIALIAS_ON);\n\n g.setColor(Color.magenta);\n final int angleRadius = (radius * 2) / 3;\n final int angleOffset = size / 2 - angleRadius;\n g2.setStroke(new BasicStroke(2));\n g.drawArc(angleOffset, angleOffset, 2 * angleRadius, 2 * angleRadius, 0, (int) (-(angle * 180) / Math.PI));\n\n g2.setStroke(new BasicStroke(2));\n if (frontView) {\n g.setColor(Color.red);\n g.drawLine(size / 2, size / 2, size, size / 2);\n g.setColor(Color.blue);\n g.drawLine(size / 2, size / 2, size / 2, 0);\n } else {\n g.setColor(Color.green);\n //g.drawLine(size / 2, size / 2, size, size / 2);\n g.drawLine(size / 2, size / 2, size, size / 2);\n g.setColor(Color.blue);\n g.drawLine(size / 2, size / 2, size / 2, 0);\n }\n\n int circleOffset = size / 2 - radius;\n g.setColor(Color.black);\n g2.setStroke(new BasicStroke(1));\n g.drawOval(circleOffset, circleOffset, radius * 2, radius * 2);\n\n int x = (int) (Math.cos(angle) * radius);\n int y = (int) (Math.sin(angle) * radius);\n int lineOffset = size / 2;\n g.setColor(Color.orange);\n g2.setStroke(new BasicStroke(3));\n g.drawLine(lineOffset - x, lineOffset - y, lineOffset + x, lineOffset + y);\n\n }\n\n }", "private void plotEntries() {\n\t\tfor (int i = 0; i < entries.size(); i++) {\n\t\t\tdrawLine(i);\n\t\t}\n\t}", "private void drawClockHand(GraphicsContext gc) {\n\t\t\n\t\tdouble x1 = getX();\n\t\t//double y1 = getY() + getHeight() / 2 - getTimeLabelHeight();\n\t\tdouble y1 = getY() + (getHeight() - getTimeLabelHeight()) / 2;\n\t\tdouble x2 = getX() + Math.cos(Math.toRadians(getClockHandAngle())) \n\t\t\t\t* getClockRadius();\n\t\t\n\t\tdouble y2 = (y1) + \n\t\t\t\tMath.sin(Math.toRadians(getClockHandAngle())) \n\t\t\t\t* getClockRadius();\n\t\t\n\t\tgc.setStroke(Color.BLACK);\n\t\tgc.strokeLine(x1, y1, x2, y2);\n\t\t\n\t}", "@Override\r\n public final void draw(final Line l, final BufferedImage paper) {\n int x1 = l.getxStart();\r\n int x2 = l.getxFinish();\r\n int y1 = l.getyStart();\r\n int y2 = l.getyFinis();\r\n\r\n if (x1 == x2) {\r\n if (y1 < y2) {\r\n for (int i = y1; i <= y2; i++) {\r\n if (checkBorder(x1, i, paper)) {\r\n paper.setRGB(x1, i, l.getColor().getRGB());\r\n }\r\n }\r\n } else {\r\n for (int i = y2; i <= y1; i++) {\r\n if (checkBorder(x1, i, paper)) {\r\n paper.setRGB(x1, i, l.getColor().getRGB());\r\n }\r\n }\r\n }\r\n return;\r\n }\r\n \r\n int deltaX = Math.abs(x2 - x1);\r\n int deltaY = Math.abs(y2 - y1);\r\n int s1 = (int) (Math.signum(x2 - x1) * 1);\r\n int s2 = (int) (Math.signum(y2 - y1) * 1);\r\n\r\n boolean interchanged = false;\r\n if (deltaY > deltaX) {\r\n int aux = deltaX;\r\n deltaX = deltaY;\r\n deltaY = aux;\r\n interchanged = true;\r\n }\r\n\r\n int error = 2 * deltaY - deltaX;\r\n\r\n for (int i = 0; i <= deltaX; i++) {\r\n if (x1 >= 0 && y1 >= 0 && x1 < paper.getWidth() && y1 < paper.getHeight()) {\r\n\r\n paper.setRGB(x1, y1, l.getColor().getRGB());\r\n }\r\n while (error > 0) {\r\n if (interchanged) {\r\n x1 = x1 + s1;\r\n } else {\r\n y1 = y1 + s2;\r\n }\r\n error = error - 2 * deltaX;\r\n }\r\n\r\n if (interchanged) {\r\n y1 = y1 + s2;\r\n } else {\r\n x1 = x1 + s1;\r\n }\r\n\r\n error = error + 2 * deltaY;\r\n }\r\n }", "@Override\n public void draw(Canvas canvas) {\n mPaint.setColor(mContext.getResources().getColor(android.R.color.holo_orange_light));\n mPaint.setStyle(Style.STROKE);\n mPaint.setStrokeWidth(RateChartConst.sLineWidth);\n mPaint.setAntiAlias(true);\n\n RateChartManager manager = mManager;\n int columns = manager.getColumnNum();\n\n double[] YValues = manager.getYValues();\n if (YValues == null || YValues.length < columns) return;\n\n double[] yValues = new double[YValues.length];\n System.arraycopy(YValues, 0, yValues, 0, yValues.length);\n\n double[] yCoordinates = manager.getYCoordinates();\n double deltaYCoordinateMM = RateDataHelper.getAbsDeltaMaxMin(yCoordinates);\n double maxYCoordinate = RateDataHelper.getMax(yCoordinates);\n\n //draw y coordinate value.\n float[] drawYValue = new float[YValues.length];\n\n for (int m = 0; m < yValues.length; m++) {\n drawYValue[m] =\n (float) (mRegionHeight * (maxYCoordinate - yValues[m]) / deltaYCoordinateMM);\n }\n\n // line path\n mLinePath.reset();\n mLinePath.moveTo(mMarginLeft, mMarginTop + drawYValue[0]);\n mShaderPath.reset();\n mShaderPath.moveTo(mMarginLeft, mMarginTop + drawYValue[0]);\n\n float deltaX = mRegionWidth / (columns - 1);\n\n if (columns < RateChartConst.sColumnNum) {\n deltaX = mRegionWidth / (RateChartConst.sColumnNum - 1);\n }\n for (int i = 1; i < columns; i++) {\n mLinePath.lineTo(mMarginLeft + deltaX * i, drawYValue[i] + mMarginTop);\n mShaderPath.lineTo(mMarginLeft + deltaX * i, drawYValue[i] + mMarginTop);\n }\n\n //draw shader\n mShaderPath.lineTo(mMarginLeft + deltaX * (columns - 1), mRegionHeight + mMarginTop);\n mShaderPath.lineTo(mMarginLeft, mRegionHeight + mMarginTop);\n mShaderPath.lineTo(mMarginLeft, mMarginTop + drawYValue[0]);\n mShaderPath.setFillType(FillType.EVEN_ODD);\n canvas.drawPath(mShaderPath, mShaderPaint);\n\n //draw line\n canvas.drawPath(mLinePath, mPaint);\n\n //draw orange circle\n mPaint.setStrokeWidth(RateChartConst.sCircleWidth);\n canvas.drawCircle(mMarginLeft + deltaX * (columns - 1),\n drawYValue[columns - 1] + mMarginTop, RateChartConst.sCircleOuterRadius, mPaint);\n\n //draw inner circle.\n mPaint.setColor(mContext.getResources().getColor(android.R.color.white));\n mPaint.setStyle(Style.FILL);\n canvas.drawCircle(mMarginLeft + deltaX * (columns - 1),\n drawYValue[columns - 1] + mMarginTop, RateChartConst.sCircleInnerRadius, mPaint);\n\n //draw black pop window.\n float mLatestX = mMarginLeft + deltaX * (columns - 1);\n float mLatestY = mMarginTop + drawYValue[columns - 1];\n showPopText(canvas,\n mDecimalFormat.format(manager.getYValues()[manager.getYValues().length - 1]),\n mLatestX, mLatestY);\n }", "private void drawHorizontalAxisLabels(Graphics2D g2) {\r\n double axisH = yPositionToPixel(originY);\r\n FontMetrics metrics = g2.getFontMetrics();\r\n \r\n// double startX = Math.floor((minX - originX) / majorX) * majorX;\r\n double startX = Math.floor(minX / majorX) * majorX;\r\n for (double x = startX; x < maxX + majorX; x += majorX) {\r\n if (((x - majorX / 2.0) < originX) &&\r\n ((x + majorX / 2.0) > originX)) {\r\n continue;\r\n }\r\n \r\n int position = (int) xPositionToPixel(x);\r\n g2.drawString(format(x), position,\r\n (int) axisH + metrics.getHeight());\r\n }\r\n }", "static void drawCrosses() { // draws a cross at each cell centre\n\t\tif (currentStage[currentSlice-1]>1)\n\t\t{\n\t\t\tfloat xc,yc;\n\t\t\t//GeneralPath path = new GeneralPath();\n\n\t\t\tfor (int i=0;i<pop.N;i++)\n\t\t\t{\n\t\t\t\txc = (float) ( (Balloon)(pop.BallList.get(i)) ).x0;\n\t\t\t\tyc = (float) ( (Balloon)(pop.BallList.get(i)) ).y0;\n\t\t\t\tfloat arm = 5;\n\n\t\t\t\t// label cell position\n\t\t\t\tjava.awt.geom.GeneralPath Nshape = new GeneralPath();\n\t\t\t\tNshape.moveTo(xc-arm, yc);\n\t\t\t\tNshape.lineTo(xc+arm, yc);\n\t\t\t\tNshape.moveTo(xc, yc-arm);\n\t\t\t\tNshape.lineTo(xc, yc+arm);\n\n\t\t\t\tRoi XROI = new ShapeRoi(Nshape);\n\t\t\t\tOL.add(XROI);\n\t\t\t}\n\t\t}\n\t}", "public void paintGraph(Graphics g) {\n\t\tint y = PREF_H-20;\n\t\tint x;\n\t\tg.drawLine(20, y, PREF_W-5, y);\n\t\tfor(int i = 0;i<X_TICK_MARK_POS.length;i++) {\n\t\t\tx = X_TICK_MARK_POS[i];\n\t\t\t\n\t\t\tString label = X_AXIS_LABELS[i];\n\t\t\tg.drawLine(x,y-5,x,y+5);\n\t\t\tg.drawChars(label.toCharArray(), 0, label.length(), x-10, y+20);\n\t\t}\n\t\t\n\t\t//Vertical Axis\n\t\tx=20;\n\t\tg.drawLine(x, 20, x, PREF_H-20);\n\t\tfor(int i = 0;i<Y_TICK_MARK_POS.length;i++) {\n\t\t\ty = Y_TICK_MARK_POS[i];\n\t\t\t\n\t\t\tString label = Y_AXIS_LABELS[i];\n\t\t\tg.drawLine(x-5,y,x+5,y);\n\t\t\tg.drawChars(label.toCharArray(), 0, label.length(), x-15, y+5);\n\t\t}\n\t\t\n\t\t//draw points (if necessary)\n\t\tfor(int i=0;i<this.ratios.length;i++) {\n\t\t\tif(ratios[i]>0) {\n\t\t\t\tx = this.X_TICK_MARK_POS[i];\n\t\t\t\ty = (int) (Y_TICK_MARK_POS[1] - ((Y_TICK_MARK_POS[1]-Y_TICK_MARK_POS[0])*(this.ratios[i]/.1)));\n\t\t\t\tg.drawLine(x-5,y-5,x+5,y+5);\n\t\t\t\tg.drawLine(x-5, y+5, x+5, y-5);\n\t\t\t\t\n\t\t\t\tString label = \"(\"+String.valueOf(ratios[i]).substring(0, 6)+\")\";\n\t\t\t\tg.drawChars(label.toCharArray(), 0, label.length(), x+5, y-15);\n\t\t\t}\n\t\t}\n\t}", "private void drawLine(int x1, int y1, int x2, int y2)\n {\n System.out.println(\"Draw a line from x of \" + x1 + \" and y of \" + y1);\n System.out.println(\"to x of \" + x2 + \" and y of \" + y2);\n System.out.println(\"The line color is \" + lineColor);\n System.out.println(\"The width of the line is \" + lineWidth);\n System.out.println(\"Then length of the line is \" + df.format(getLength()) + \"\\n\" );\n }", "@RequiresApi(api = Build.VERSION_CODES.O)\n public void createNewLineChart() {\n\n ArrayList<Entry> yValues = new ArrayList<>();\n yValues.clear();\n\n //Todays Date\n Date date = new Date();\n LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();\n// String currentMonth = getMonthForInt(localDate.getMonthValue());\n if (monthSelectedAsInt > localDate.getMonthValue()){\n yValues.add(new Entry(0, 0));\n } else if (monthSelectedAsInt == localDate.getMonthValue()){\n for (int i = 1; i <= localDate.getDayOfMonth() ; i++) {\n yValues.add(new Entry(i, occupancyRate[i]));\n }\n } else {\n for (int i = 1; i <= numberOfDays ; i++) {\n yValues.add(new Entry(i, occupancyRate[i]));\n }\n }\n\n //chart.setOnChartValueSelectedListener(this);\n\n // enable scaling and dragging\n chart.setDragEnabled(true);\n chart.setScaleEnabled(true);\n\n // if disabled, scaling can be done on x- and y-axis separately\n chart.setPinchZoom(false);\n\n LineDataSet set1;\n\n set1 = new LineDataSet(yValues, \"Occupany Rate \");\n set1.setDrawCircles(false);\n set1.setDrawValues(false);\n set1.setColor(Color.RED);\n\n ArrayList <ILineDataSet> dataSets = new ArrayList<>();\n dataSets.add(set1);\n LineData dataLine = new LineData(set1);\n chart.getDescription().setEnabled(false);\n chart.getXAxis().setTextSize(10f);\n chart.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM);\n\n chart.getAxisLeft().setAxisMinimum(0);\n chart.getAxisLeft().setAxisMaximum(100);\n chart.getAxisRight().setAxisMinimum(0);\n chart.getAxisRight().setAxisMaximum(100);\n chart.getXAxis().setAxisMinimum(1);\n chart.getXAxis().setAxisMaximum(numberOfDays);\n\n chart.setData(dataLine);\n chart.invalidate();\n }", "public void paintComponent(Graphics g)\n\t{\n\t\tsuper.paintComponent(g);\n\n\t\t\n\t\tint width = getWidth();\n\t\tint height = getHeight();\n\t\t\n\t\t\n\t\t// use the Graphics parameter g to draw grid lines and\n\t\t// to write the decades across the bottom of the graph (Part 3)\n\n\t\n\t\t\n\t\t// loop to graph each name in the graphArray (Part 4)\n\t\t// HINT: write the code to graph one name, then add a loop to graph\n\t\t// all the names in graphArray\n\t\t\n\t\t\n\t}", "public void display()\n\t{\n\t\tfor(Character characher : characterAdded)\n\t\t{\t\n\t\t\tif(!characher.getIsDragging())\n\t\t\t{ \n\t\t\t\t//when dragging, the mouse has the exclusive right of control\n\t\t\t\tcharacher.x = (float)(circleX + Math.cos(Math.PI * 2 * characher.net_index/net_num) * radius);\n\t\t\t\tcharacher.y = (float)(circleY + Math.sin(Math.PI * 2 * characher.net_index/net_num) * radius);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tint lineWeight = 0;\n\t\t//draw the line between the characters on the circle\n\t\tif(characterAdded.size() > 0)\n\t\t{\n\t\t\tfor(Character characher : characterAdded)\n\t\t\t{\n\t\t\t\tfor(Character ch : characher.getTargets())\n\t\t\t\t{\n\t\t\t\t\tif(ch.net_index != -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(int i = 0; i < links.size(); i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tJSONObject tem = links.getJSONObject(i);\n\t\t\t\t\t\t\tif((tem.getInt(\"source\") == characher.index) && \n\t\t\t\t\t\t\t\t\t\t\t\t(tem.getInt(\"target\") == ch.index))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlineWeight = tem.getInt(\"value\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tparent.strokeWeight(lineWeight/4 + 1);\t\t\n\t\t\t\t\t\tparent.noFill();\n\t\t\t\t\t\tparent.stroke(0);\n\t\t\t\t\t\tparent.line(characher.x, characher.y, ch.x, ch.y);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "ZHDraweeView mo91981h();", "private void drawTimeLine(Graphics2D g2d, RenderContext myrc) {\n if (mouseIn()) {\n double mxc = mx, myc = my; // Save the mouse coords so they are static\n\n // Find the closest line segment\n Line2D closest_line = null; double closest_line_d = Double.MAX_VALUE;\n Iterator<Line2D> it = myrc.line_to_bundles.keySet().iterator();\n while (it.hasNext()) {\n Line2D line = it.next();\n\tdouble d = line.ptSegDist(mxc,myc);\n\tif (d < closest_line_d) { closest_line = line; closest_line_d = d; }\n }\n\n // If we found an edge, create the timeline\n if (closest_line != null && closest_line_d < 20.0) {\n\t// Darken background\n Composite orig_comp = g2d.getComposite(); \n\tg2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f));\n\tg2d.setColor(RTColorManager.getColor(\"brush\", \"dim\"));\n\tg2d.fillRect(0,0,myrc.getRCWidth(),myrc.getRCHeight());\n\tg2d.setComposite(orig_comp);\n\n // Create the composites\n\tComposite trans = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f), full = g2d.getComposite();\n\n\t// Determine the timeline geometry\n\tint txt_h = Utils.txtH(g2d, \"0\");\n int tl_x0 = 10, tl_x1 = myrc.w - 10, tl_w = tl_x1 - tl_x0;\n\tint tl_y0 = myrc.h - txt_h - 4, tl_h = 6;\n\n // Get the time bounds\n\tlong ts0 = getRenderBundles().ts0(), ts1 = getRenderBundles().ts1dur();\n\n\t// Give it labels\n\tString str = Utils.humanReadableDate(ts0); Color fg = RTColorManager.getColor(\"label\", \"defaultfg\"), bg = RTColorManager.getColor(\"label\", \"defaultbg\");\n\tg2d.setColor(RTColorManager.getColor(\"axis\",\"default\")); g2d.drawLine(tl_x0, tl_y0+1, tl_x1, tl_y0+1);\n clearStr(g2d, str, tl_x0, tl_y0 + txt_h+2, fg, bg);\n\tstr = Utils.humanReadableDate(ts1);\n clearStr(g2d, str, tl_x1 - Utils.txtW(g2d,str), tl_y0 + txt_h+2, fg, bg);\n\n // Highlight the line itself\n g2d.setColor(RTColorManager.getColor(\"annotate\",\"cursor\"));\n\tdrawTimeLineForLine(g2d, myrc, closest_line, full, trans, tl_x0, tl_x1, tl_w, tl_y0, tl_h, ts0, ts1);\n\n\t// Create a bitvector representing locations in the timeline... use minute resolution... unless unreasonable (like decades...)\n\tlong resolution = 60L*1000L;\n\tint minutes = (int) ((ts1 - ts0)/resolution);\n\tif (minutes > 0 && minutes < 5*365*24*60) {\n\t boolean mask[] = new boolean[minutes+1]; // Give it a little extra...\n\t fillTimeLineMask(myrc,closest_line,mask,ts0,resolution);\n\n // Count matches across the rest of the lines...\n\t List<LineCountSorter> sorter = new ArrayList<LineCountSorter>();\n it = myrc.line_to_bundles.keySet().iterator();\n while (it.hasNext()) {\n Line2D line = it.next();\n\t if (line != closest_line) {\n\t int matches = countTimeLineMatches(myrc, line, mask, ts0, resolution);\n\t if (matches > 0) { sorter.add(new LineCountSorter(line, matches)); }\n\t }\n\t }\n\n\t // If we have matches, sort them\n Collections.sort(sorter);\n\n\t // Display the top twenty or so...\n\t for (int i=0;i<(sorter.size() > 20 ? 20 : sorter.size());i++) {\n\t tl_y0 -= tl_h; g2d.setColor(RTColorManager.getColor(sorter.get(i).getLine().toString()));\n\t drawTimeLineForLine(g2d, myrc, sorter.get(i).getLine(), full, trans, tl_x0, tl_x1, tl_w, tl_y0, tl_h, ts0, ts1);\n\t }\n\n\t if (sorter.size() > 20) { // Let the user know that the display is abridged...\n\t tl_y0 -= tl_h;\n\t fg = RTColorManager.getColor(\"label\", \"errorfg\"); bg = RTColorManager.getColor(\"label\", \"errorbg\");\n\t clearStr(g2d, \"Edges Truncated\", tl_x0, tl_y0, fg, bg);\n\t }\n }\n }\n }\n }", "public void paint ( Graphics g )\r\n\t{\r\n if(listOfOtherContins.size() <= 0) return;\r\n if(to == from || to-from <=0) return;\r\n\t\tGraphics2D g2;\r\n\r\n\t\tif ( g instanceof Graphics2D )\r\n\t\t{\r\n\t\t\tg2 = ( Graphics2D ) g;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif ( !horizontal )\r\n\t\t{\r\n\t\t\t//g2.transform(AffineTransform.getRotateInstance(Math.toRadians(-90)));\r\n\t\t\tg2.translate ( this.getWidth ( ) / 2.0f, this.getHeight ( ) / 2.0f );\r\n\t\t\tg2.rotate ( Math.toRadians ( 90 ) );\r\n\t\t\tg2.translate ( -this.getHeight ( ) / 2.0f, -this.getWidth ( ) / 2.0f );\r\n\r\n\t\t\t//g2.rotate(Math.toRadians(90), this.getWidth()/2.0f, this.getHeight()/2.0f);\r\n\t\t}\r\n\r\n\t\tdrawLabelledHorizontalLine ( g2 );\r\n\t\tg2.setStroke ( new BasicStroke( 1 ) );\r\n\r\n\t\tIterator itor = listOfOtherContins.iterator ( );\r\n\r\n\t\t/*int currentSectionNumber =-1;\r\n\t\t String textOfContinNames=\"\";\r\n\t\t while(itor.hasNext())\r\n\t\t {\r\n\t\t TwoDDisplayContin discon = (TwoDDisplayContin) itor.next();\r\n\t\t if(discon.getSectionNumber() == currentSectionNumber)\r\n\t\t {\r\n\t\t textOfContinNames += \", \" + discon.getDisplayableContinName();\r\n\t\t }\r\n\t\t else if(currentSectionNumber == -1)\r\n\t\t {\r\n\t\t //drawText(textOfContinNames, g2);\r\n\t\t currentSectionNumber = discon.getSectionNumber();\r\n\t\t textOfContinNames = discon.getDisplayableContinName();\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t drawText(textOfContinNames, g2);\r\n\t\t currentSectionNumber = discon.getSectionNumber();\r\n\t\t textOfContinNames = discon.getDisplayableContinName();\r\n\t\t }\r\n\t\t drawRelation(discon, g2);\r\n\t\t }\r\n\t\t if(! textOfContinNames.equals(\"\"))\r\n\t\t {\r\n\t\t drawText(textOfContinNames, g2);\r\n\t\t }*/\r\n\t\tint currentSectionNumber = -1;\r\n\r\n\t\twhile ( itor.hasNext ( ) )\r\n\t\t{\r\n\t\t\tTwoDDisplayContin discon = ( TwoDDisplayContin ) itor.next ( );\r\n\r\n\t\t\tif ( discon.getSectionNumber ( ) == currentSectionNumber )\r\n\t\t\t{\r\n\t\t\t\tdrawRelationUsingCurrentVertLoc ( discon, g2 );\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tdrawRelation ( discon, g2 );\r\n\t\t\t\tcurrentSectionNumber = discon.getSectionNumber ( );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void draw(){\n\t\t int startRX = 100;\r\n\t\t int startRY = 100;\r\n\t\t int widthR = 300;\r\n\t\t int hightR = 300;\r\n\t\t \r\n\t\t \r\n\t\t // start points on Rectangle, from the startRX and startRY\r\n\t\t int x1 = 0;\r\n\t\t int y1 = 100;\r\n\t\t int x2 = 200;\r\n\t\t int y2 = hightR;\r\n\t\t \r\n //direction L - false or R - true\r\n\t\t \r\n\t\t boolean direction = true;\r\n\t\t \t\r\n\t\t\r\n\t\t //size of shape\r\n\t\t int dotD = 15;\r\n\t\t //distance between shapes\r\n\t int distance = 30;\r\n\t\t \r\n\t rect(startRX, startRY, widthR, hightR);\r\n\t \r\n\t drawStripesInRectangle ( startRX, startRY, widthR, hightR,\r\n\t \t\t x1, y1, x2, y2, dotD, distance, direction) ;\r\n\t\t \r\n\t\t super.draw();\r\n\t\t}", "public void Draw(Graphics g)\n/* */ {\n/* 55 */ g.setColor(this.m_color);\n/* */ \n/* 57 */ Point prevPt = new Point(0, 0);Point currPt = new Point(0, 0);\n/* */ \n/* 59 */ for (double t = 0.0D; t < 1.01D; t += this.m_tValue) {\n/* 60 */ ptFromTVal(t, currPt);\n/* */ \n/* 62 */ if (t == 0.0D) {\n/* 63 */ prevPt.x = currPt.x;\n/* 64 */ prevPt.y = currPt.y;\n/* */ }\n/* */ \n/* 67 */ g.drawLine(prevPt.x, prevPt.y, currPt.x, currPt.y);\n/* */ \n/* 69 */ if (this.m_showTPoints) {\n/* 70 */ g.fillOval(currPt.x - this.PT_RADIUS, currPt.y - this.PT_RADIUS, this.PT_DIAMETER, this.PT_DIAMETER);\n/* */ }\n/* */ \n/* 73 */ prevPt.x = currPt.x;\n/* 74 */ prevPt.y = currPt.y;\n/* */ }\n/* */ }", "public void paint( java.awt.Graphics g )\n {\n super.paint( g ); // Ord gave us this\n\n canvasWidth = canvas.getWidth(); // Update original\n canvasHeight = canvas.getHeight(); // canvas dimensions\n\n double newHLineY = hLineProportion * canvas.getHeight();\n double newVLineX = vLineProportion * canvas.getWidth();\n\n hLine.setEndPoints(0, newHLineY, canvasWidth, newHLineY);\n vLine.setEndPoints(newVLineX, 0, newVLineX, canvasHeight);\n\n hLineMoved = vLineMoved = true;\n }", "private void setUpLedger() {\n _ledgerLine = new Line();\n _ledgerLine.setStrokeWidth(Constants.STROKE_WIDTH);\n _staffLine = new Line();\n _staffLine.setStrokeWidth(1);\n }" ]
[ "0.7275118", "0.7258654", "0.700312", "0.673354", "0.64749664", "0.64704955", "0.6451586", "0.64327675", "0.6367279", "0.6354411", "0.6348251", "0.6336758", "0.63224024", "0.6292473", "0.6260902", "0.625458", "0.6247296", "0.6240356", "0.6153126", "0.61239517", "0.6110623", "0.60816854", "0.6059198", "0.6018976", "0.5970507", "0.5960604", "0.59555066", "0.5946983", "0.59274644", "0.5926072", "0.5920373", "0.590817", "0.58874434", "0.5838136", "0.5836794", "0.5832137", "0.58269036", "0.58160484", "0.58005196", "0.5799021", "0.57982886", "0.57976955", "0.5796505", "0.5791657", "0.57785827", "0.5766378", "0.57530916", "0.5748002", "0.5744373", "0.5715483", "0.5705029", "0.56983775", "0.56925017", "0.5688139", "0.5685992", "0.5679416", "0.5656082", "0.56522053", "0.5635912", "0.562997", "0.5622732", "0.56158984", "0.5613071", "0.5607046", "0.5606998", "0.56012386", "0.5589041", "0.558649", "0.55811614", "0.5575377", "0.55715513", "0.5568198", "0.5566825", "0.5543065", "0.55371934", "0.55302733", "0.5527759", "0.5527038", "0.5524179", "0.5522392", "0.5521685", "0.5516893", "0.5512277", "0.5510272", "0.55093795", "0.55083454", "0.550588", "0.549895", "0.5498878", "0.5487007", "0.54853773", "0.5481088", "0.5470977", "0.5462293", "0.5460512", "0.5457878", "0.5455033", "0.54459614", "0.54396075", "0.5436632" ]
0.6326944
12
/ Implementation of the ComponentListener interface
public void componentHidden(ComponentEvent e) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\t\tpublic void componentAdded(ContainerEvent arg0){}", "@Override\r\npublic void componentMoved(ComponentEvent arg0) {\n\t\r\n}", "@Override\n\t\t\t\t\t\tpublic void componentMoved(ComponentEvent arg0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void componentMoved(ComponentEvent arg0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "@Override\n public void componentMoved(ComponentEvent e)\n {\n \n }", "@Override\r\n\tpublic void componentMoved(ComponentEvent arg0) {\n\r\n\t}", "@Override\n public void componentShown(ComponentEvent e)\n {\n \n }", "@Override\n public void componentShown(ComponentEvent e) {\n\n }", "public void onComponentSelection(){\r\n\r\n }", "@Override\r\n\t\t\tpublic void componentMoved(ComponentEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\npublic void componentShown(ComponentEvent arg0) {\n\t\r\n}", "@Override\n public void componentShown(ComponentEvent e) {\n }", "@Override\r\n\tpublic void componentMoved(ComponentEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n public void componentShown(ComponentEvent e) {\n }", "@Override\r\n\t\t\tpublic void componentMoved(ComponentEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void componentMoved(ComponentEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\tpublic void componentMoved(ComponentEvent arg0) {\n\t\t\t\r\n\t\t}", "@Override\r\n\tpublic void componentMoved(ComponentEvent e) {\n\t\t\r\n\t}", "@Override\n\tpublic void componentMoved(ComponentEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void componentMoved(ComponentEvent e) {\n\t\t\n\t}", "@Override\r\n public void componentMoved(ComponentEvent e) {\n }", "@Override\n\tpublic void componentMoved(ComponentEvent e) {\n\n\t}", "@Override\r\n\t\t\tpublic void componentShown(ComponentEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void componentMoved(ComponentEvent arg0) {\n\t\t\n\t}", "@Override\n public void componentMoved(ComponentEvent e) {\n }", "@Override\n\tpublic void componentShown(ComponentEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void componentShown(ComponentEvent e) {\n\t\t\n\t}", "@Override\n public void componentMoved(ComponentEvent arg0) {\n }", "@Override\n public void componentShown(ComponentEvent arg0) {\n\n }", "@Override\r\n\tpublic void componentActivated(AbstractComponent arg0) {\n\r\n\t}", "@Override\n\t\t\t\t\t\tpublic void componentShown(ComponentEvent arg0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void componentShown(ComponentEvent arg0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "@Override\n\tpublic void componentShown(ComponentEvent e) {\n\n\t}", "@Override\r\n\t\tpublic void componentShown(ComponentEvent arg0) {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void componentShown(ComponentEvent e) {\n\t}", "@Override\r\n\tpublic void componentShown(ComponentEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void componentShown(ComponentEvent arg0) {\n\r\n\t}", "@Override\r\n\tpublic void componentActivated(AbstractComponent arg0) {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void componentShown(ComponentEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\t\tpublic void componentMoved(ComponentEvent arg0) {\n\t\t\t\n\n\t\t}", "@Override\n\tpublic void componentShown(ComponentEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void componentShown(ComponentEvent arg0) {\n\t\t\n\t}", "public abstract void addListener(EventListener eventListener, String componentName);", "public void componentShown(ComponentEvent e) {\n\t\t\t\n\t\t}", "@Override\n public void stateChanged(javax.swing.event.ChangeEvent e) {\n }", "public void componentShown(ComponentEvent arg0) {\n }", "public interface ComponentSystem {\n /**\n * AddListener's common function, according event type to add certain listener\n * \n * @param listener listener to be add\n */\n public void addListener(EventListener listener);\n\n /**\n * @return listener type\n */\n public ListenerType getListenerType();\n\n /**\n * Set the component name\n * \n * @param name name of component\n */\n public void setComponentName(ComponentName name);\n\n /**\n * @return component name\n */\n public ComponentName getComponentName();\n}", "public void componentMoved(ComponentEvent e) {\n\t\t\t\n\t\t}", "@Override\n public void componentResized(ComponentEvent e) {\n }", "@Override\n public void componentOpened() {\n }", "@Override\r\n\t\t\tpublic void componentResized(ComponentEvent e) {\n\t\t\t\t\r\n\t\t\t}", "public interface ComponentResizeListener extends ComponentListener {\n @Override\n void componentResized(ComponentEvent e);\n\n @Override\n default void componentMoved(final ComponentEvent e) {\n }\n\n @Override\n default void componentShown(final ComponentEvent e) {\n }\n\n @Override\n default void componentHidden(final ComponentEvent e) {\n }\n}", "@Override\n public void componentOpened() {\n }", "@Override\n public void componentOpened() {\n }", "@Override\n public void componentOpened() {\n }", "@Override\n public void componentOpened() {\n }", "@Override\n\t\t\t\t\t\tpublic void componentResized(ComponentEvent arg0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void componentResized(ComponentEvent arg0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "@Override\r\n\t\t\tpublic void componentResized(ComponentEvent e) {\n\t\t\t\tsuper.componentResized(e);\r\n\t\t\t\t\r\n\t\t\t}", "public void componentShown(ComponentEvent arg0) {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void connectedComponentStarted(ConnectedComponentTraversalEvent e) {\n\t\t\t\t\r\n\t\t\t}", "void jBroadcastListenerList_mouseClicked(MouseEvent e) {\n ComponentInterface anInterface = (ComponentInterface) jBroadcastListenerList.getSelectedValue();\n \n if (anInterface != null) {\n anInterface.flipActiveFlag();\n jBroadcastListenerList.repaint();\n }\n }", "public void componentMoved(ComponentEvent arg0) {\n\t\t\n\t}", "@Override\n\t\tpublic void componentResized(ComponentEvent arg0) {\n\t\t\t\n\n\t\t}", "@Override\r\n\t\t\tpublic void componentResized(ComponentEvent arg0) {\r\n\t\t\t}", "@Override\n public void componentMoved(final ComponentEvent e) {\n // Do nothing\n }", "@Override\n public void componentClosed() {\n }", "protected void fireComponentSelected() {\n if(_listeners != null) {\n for(int i = _listeners.size() - 1; i >= 0; i--) {\n IComponentSelectionListener listener = (IComponentSelectionListener)_listeners.elementAt(i);\n listener.componentSelected(this);\n }\n }\n }", "protected void onComponentRendered()\n\t{\n\t}", "@Override\r\n\t\t\tpublic void connectedComponentFinished(ConnectedComponentTraversalEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\npublic void componentHidden(ComponentEvent arg0) {\n\t\r\n}", "@Override\n public void componentClosed() {\n }", "@Override\n public void componentClosed() {\n }", "@Override\n public void componentClosed() {\n }", "@Override\n public void componentClosed() {\n }", "@Override\n public void componentClosed() {\n }", "@Override\n public void componentClosed() {\n }", "public void componentResized(ComponentEvent e) \r\n\t{\r\n\t\t//System.out.println(\"Resized: \" + e);\r\n\t\tsuper.componentResized(e);\r\n\t}", "public void componentMoved(ComponentEvent e) {\n\t\tsuper.componentMoved(e);\r\n\t}", "public void componentShown(ComponentEvent e) {\n\t\tsuper.componentShown(e);\r\n\t}", "@Override\n\tpublic void update(Event e) {\n\t}", "@Override\n public void componentHidden(ComponentEvent arg0) {\n }", "public void componentMoved(ComponentEvent event) {\n // empty body\n }", "public void componentMoved(ComponentEvent event) {\n // empty body\n }", "public void createEventListeners() {\n this.addComponentListener(new ComponentAdapter() {\n @Override\n public void componentResized(ComponentEvent e) {\n super.componentResized(e);\n //canvas.setSize(J2DNiftyView.this.getSize());\n }\n });\n }", "private void addListeners() {\n\n\t\tfinal ComponentsController serviceController = (ComponentsController) componentsService;\n\t\t/*\n\t\t * service controller listener:\n\t\t */\n\t\tfinal ChangeListener changeListener = new ChangeListener() {\n\t\t\tpublic void modelChanged(ChangeEvent ce) {\n\t\t\t\tPmsChangeEvent event = (PmsChangeEvent) ce;\n\t\t\t\tswitch (event.getType()) {\n\t\t\t\t\tcase PmsChangeEvent.UPDATE:\n\t\t\t\t\t\tonComponentUpdate((InheritedComponentInstanceSelDTO) event.getEventInfo());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PmsChangeEvent.IMPORT:\n\t\t\t\t\t\ttryGetComponents();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: // event not expected: nothing to do here.\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tserviceController.addChangeListener(changeListener);\n\t\t\n\t\t// remove listener from components controller when this panel is detached\n\t\taddListener(Events.Detach, new Listener<BaseEvent>() {\n\t\t\tpublic void handleEvent(BaseEvent be) {\n\t\t\t\tserviceController.removeChangeListener(changeListener);\n\t\t\t}\n\t\t});\n\n\t\t/*\n\t\t * Grid RowClick listener\n\t\t */\n\t\tgrid.addListener(Events.RowClick, new Listener<GridEvent<InheritedComponentInstanceSelModelData>>() {\n\t\t\tpublic void handleEvent(GridEvent<InheritedComponentInstanceSelModelData> ge) {\n\t\t\t\tInheritedComponentInstanceSelModelData model = grid.getSelectionModel().getSelectedItem();\n\t\t\t\tif (model != null) {\n\t\t\t\t\tenableDisableButtons(model);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "private void HalKelasComponentShown(java.awt.event.ComponentEvent evt) {\n\t\n }", "protected ChangeListener createChangeListener(JComponent paramJComponent) {\n/* 66 */ return new MotifChangeHandler((JMenu)paramJComponent, this);\n/* */ }", "@Override\r\n\tpublic void componentHidden(ComponentEvent arg0) {\n\r\n\t}", "@Override\r\n\tpublic void componentHidden(ComponentEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void componentHidden(ComponentEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n public void componentHidden(ComponentEvent e)\n {\n \n }", "@Override\n public void componentOpened() {\n super.componentOpened();\n\n }", "@Override\r\n\t\tpublic void componentHidden(ComponentEvent arg0) {\n\t\t\t\r\n\t\t}", "public abstract JComponent getComponent();", "@Override\n public void componentShown(final ComponentEvent e) {\n // Do nothing\n }", "@Override\n protected void componentOpened() {\n WindowManager.getDefault().getRegistry().addPropertyChangeListener(this);\n }", "public void componentMoved(ComponentEvent e) {\n // !!! TODO: Do we want to save absolute positions???\n if (DEBUG)\n System.out.println(\"componentMoved: \" + e);\n }", "public void componentHidden(ComponentEvent e) { }", "public void componentHidden(ComponentEvent e) { }", "public void componentHidden(ComponentEvent e) { }" ]
[ "0.7355353", "0.7306408", "0.72292095", "0.72292095", "0.7207072", "0.7199147", "0.71981734", "0.71626663", "0.71503764", "0.7137413", "0.71323603", "0.71285903", "0.71269125", "0.71247256", "0.712024", "0.712024", "0.7116396", "0.71163493", "0.71091175", "0.71091175", "0.71072936", "0.70964605", "0.7093747", "0.7089462", "0.708135", "0.707965", "0.707965", "0.7074697", "0.7071324", "0.70694566", "0.705958", "0.705958", "0.7058135", "0.70474917", "0.7045208", "0.7040886", "0.7040118", "0.70369834", "0.701267", "0.6999179", "0.69937366", "0.69937366", "0.69743794", "0.6934117", "0.6879838", "0.68443394", "0.68363214", "0.6785113", "0.67719805", "0.67348397", "0.6718206", "0.670409", "0.6692659", "0.6692659", "0.6692659", "0.6692659", "0.66530967", "0.66530967", "0.6619119", "0.6615202", "0.661274", "0.6604394", "0.66019285", "0.6586691", "0.65657574", "0.6551187", "0.6546296", "0.6528087", "0.65275997", "0.6510408", "0.6497356", "0.6483555", "0.6483555", "0.6483555", "0.6483555", "0.6483555", "0.6483555", "0.6463764", "0.64362705", "0.6423303", "0.64134926", "0.64027137", "0.6401109", "0.6401109", "0.63972336", "0.63922304", "0.63861686", "0.6364917", "0.6358519", "0.63562423", "0.6340631", "0.63338643", "0.63303536", "0.63231194", "0.6321235", "0.63087946", "0.63050544", "0.6303507", "0.62938696", "0.62938696", "0.62938696" ]
0.0
-1
Value of "help" parameter.
public boolean getHelp() { return help; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getHelp();", "String getHelpString();", "public String getSpecificHelp() {\n return specificHelp;\n }", "String getHelpText();", "public void setHelp (String Help);", "public VRL getHelp()\n {\n return Global.getHelpUrl(this.getType()); \n }", "public abstract String getHelpInfo();", "@Override\n public String getHelp() {\n return name;\n }", "protected String getHelp() {\r\n return UIManager.getInstance().localize(\"renderingHelp\", \"Help description\");\r\n }", "@DISPID(-2147412099)\n @PropGet\n java.lang.Object onhelp();", "Argument help(String help);", "@Override\n public HelpCtx getHelp() {\n return HelpCtx.DEFAULT_HELP;\n }", "protected String getHelpText() {\n return \"\";\n }", "public String showHelp() {\r\n return ctrlDomain.getHidatoDescription();\r\n }", "@Override\r\n\tprotected String getHelpInfor() {\n\t\treturn \"\";\r\n\t}", "public String getHelp() {\n\t\tfinal StringBuilder helpBuilder = new StringBuilder(\"HELP MANUAL\\n\\n\");\n\t\tfor (final Argument arg : registeredArguments) {\n\t\t\thelpBuilder.append(\n\t\t\t\t\tString.format(\"- %1s : %2s | %3s\\n\", arg.getArgName(), arg.getShortCall(), arg.getLongCall()));\n\t\t\thelpBuilder.append(arg.getHelpLine());\n\t\t\thelpBuilder.append(\"\\n\");\n\t\t\tif (arg.isMandatory()) {\n\t\t\t\thelpBuilder.append(\"This argument is mandatory on the command line.\\n\");\n\t\t\t} else {\n\t\t\t\thelpBuilder.append(\"This argument is not mandatory on the command line.\\n\");\n\t\t\t}\n\t\t\tif (arg.isValueNotRequired()) {\n\t\t\t\thelpBuilder.append(\"This argument has no value. If a value is present, it will be ignored.\\n\");\n\t\t\t}\n\t\t\thelpBuilder.append(\"\\n\");\n\t\t}\n\t\treturn helpBuilder.toString();\n\t}", "public void showHelp();", "public String getSpecificHelpTitle() {\n return specificHelpTitle;\n }", "@Override\n public String getHelp() {\n return getController().getNameOfConnection(numberOfConnection);\n }", "public String getGenericHelp() {\n return genericHelp;\n }", "@Override\r\n\tprotected String getHelpId() {\n\t\treturn null;\r\n\t}", "@Override\n \t\t\t\tpublic void doHelp() {\n \n \t\t\t\t}", "public abstract String getHelpId();", "@Override\r\n\tpublic String getHelp() {\n\t\treturn \"QUIT|SALIR\";\r\n\t}", "@Override\n\tpublic String getHelp()\n\t{\n\t\treturn \"<html>Enter two before values and one after value<br>\"\n\t\t\t\t+ \"from the solution. Click the calculate button<br>\"\n\t\t\t\t+ \"to find the remaining after value.</html>\";\n\t}", "public void help();", "public String getHelp(){\r\n\t\tString out=\"\";\r\n\r\n\t\tout+=this.beforeTextHelp;\r\n\r\n\t\t//uso\r\n\t\tout += \"\\nUsage: \"+this.programName+\" \";\r\n\t\t//short arg\r\n\t\tout += \"[\";\r\n\t\tint i = 0;\r\n\t\twhile(i<opts.size()){\r\n\t\t\tout += \"-\"+opts.get(i).getArgument();\r\n\t\t\tif(i<opts.size()-1){out+=\"|\";}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tout += \"] \";\r\n\r\n\t\t//long arg\r\n\t\tout += \"[\";\r\n\t\ti = 0;\r\n\t\twhile(i<opts.size()){\r\n\t\t\tout += \"--\"+opts.get(i).getLongArgument();\r\n\t\t\tif(i<opts.size()-1){out+=\"|\";}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tout += \"]\\n\\n\";\r\n\r\n\t\tout += \"*\\tArgument required\\n\";\r\n\t\tout += \"**\\tValue required\\n\\n\";\r\n\r\n\t\t//lista degli argomenti\r\n\t\ti = 0;\r\n\t\twhile(i<opts.size()){\r\n\t\t\tout += \"-\"+opts.get(i).getArgument()+\"\\t\"; //short arg\r\n\t\t\tif(opts.get(i).getLongArgument().equals(null)){out += \"\\t\\t\";}else{out += \"--\"+opts.get(i).getLongArgument()+\"\\t\";} //long arg\r\n\t\t\tout += opts.get(i).getDescription()+\"\\n\";//description\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tout +=\"\\n\";\t\r\n\r\n\t\tout+=this.afterTextHelp;\r\n\r\n\t\tout +=\"\\n\";\r\n\t\treturn out;\r\n\t}", "@Override\n public void help() {\n\n }", "@Override\n\tpublic String getHelp() {\n\n\t\treturn \"EXAMINE|EXAMINAR\";\n\t}", "@Override\n public HelpCtx getHelp() {\n return HelpCtx.DEFAULT_HELP;\n // If you have context help:\n // return new HelpCtx(\"help.key.here\");\n }", "@Override\n public HelpCtx getHelp() {\n return HelpCtx.DEFAULT_HELP;\n // If you have context help:\n // return new HelpCtx(\"help.key.here\");\n }", "@DISPID(-2147412099)\n @PropPut\n void onhelp(\n java.lang.Object rhs);", "public boolean isHelpMode();", "private void setHelp() {\n\t\tHelpOpt.add(\"-h\");\n\t\tHelpOpt.add(\"/h\");\n\t\tHelpOpt.add(\"help\");\n\t}", "public String getGenericHelpTitle() {\n return genericHelpTitle;\n }", "@Override\n public void printHelp() {\n\n }", "void printHelp();", "private int help(Integer parameterIndex) throws ExceptionMalformedInput\n {\n System.out.println(\"usage: \");\n\n Field[] fieldList = this.getClass().getFields();\n\n for (Field field : fieldList)\n {\n if (!field.getName().startsWith(USER_OPTION_FIELD_NAME))\n continue;\n\n try\n {\n String attributeName = (String) field.get(this);\n String fieldName = USER_HELP_FIELD_NAME + field.getName().substring(USER_OPTION_FIELD_NAME.length()); //USER_HELP_FIELD_NAME+attributeName;\n String help = (String) this.getClass().getDeclaredField(fieldName).get(this);\n System.out.println(\"\\t\" + USER_OPTION + attributeName + \": \\t\" + help);\n }\n catch(Exception e)\n {\n throw new RuntimeException(\"Internal error.\" +\n \" We forgot to declare a help for the user option \" + field);\n }\n\n }\n System.exit(0);\n\n return parameterIndex + 1;\n }", "void help();", "@Override\n public String showHelp()\n {\n return new String(ChatColour.RED + \"Usage: \" + ChatColour.AQUA + this.getName());\n }", "public static String getHelpPath() {\n\n return m_sSextantePath + File.separator + \"help\";\n\n }", "private void help() {\n usage(0);\n }", "@Override\n public Optional<Text> getHelp(CommandSource source) {\n return help;\n }", "public String help() {\r\n\t\t\tif(this.inBattle()) {\r\n\t\t\t\treturn \"You can use the commands [attack] and [escape] while in battle.\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn \"You can use the commands: \\n\" + this.getPlayer().getPlayerCommands().keySet().toString() + \".\";\r\n\t\t\t}\r\n\t\t}", "public String getHelpMessage() {\n\t\tString message = MessageManager.getDefaultMessages().getString(\"help.\" + getCommand());\n\t\tif (message == null || message.equals(\"\")) {\n\t\t\tmessage = getHelp();\n\t\t\tMessageManager.getDefaultMessages().set(\"help.\" + getCommand(), getHelp());\n\n\t\t\tFile f = MessageManager.getFile();\n\t\t\ttry {\n\t\t\t\tMessageManager.getDefaultMessages().save(f);\n\t\t\t} catch (IOException ex) {\n\t\t\t\tBukkit.getLogger().log(Level.SEVERE, \"Could not save config to \" + f, ex);\n\t\t\t}\n\t\t}\n\t\treturn message;\n\t}", "private Configuration help() {\n final HelpFormatter formatter = new HelpFormatter();\n\n formatter.printHelp(\"-f filepath OR -u http://fake.url\", options);\n return null;\n }", "public static void displayHelp() {\n\t\thelp = getInstance();\n\t\tUIMain.popUpHelp(commandList, inputCommand);\t\n\t\tLoggingLogic.logging(HELP_MESSAGE);\n\t}", "public String toString(){\n\t\treturn \"HELP\";\n\t}", "@Override\n\tpublic String help(Player p) {\n\t\treturn null;\n\t}", "@Override\n\tprotected void handleHelp(ClickEvent event) {\n\t\t\n\t}", "private static String getHelp() {\n StringBuffer sb = new StringBuffer();\n\n // License\n //sb.append(License.get());\n\n // Usage\n sb.append(\"Usage: java -cp dist/jcore.jar -mx2G eu.fbk.fm.profiling.extractors.LSA.LSM input threshold size dim idf\\n\\n\");\n\n // Arguments\n sb.append(\"Arguments:\\n\");\n sb.append(\"\\tinput\\t\\t-> root of files from which to read the model\\n\");\n sb.append(\"\\tthreshold\\t-> similarity threshold\\n\");\n sb.append(\"\\tsize\\t\\t-> number of similar terms to return\\n\");\n sb.append(\"\\tdim\\t\\t-> number of dimensions\\n\");\n sb.append(\"\\tidf\\t\\t-> if true rescale using the idf\\n\");\n //sb.append(\"\\tterm\\t\\t-> input term\\n\");\n\n // Arguments\n //sb.append(\"Arguments:\\n\");\n\n return sb.toString();\n }", "public String getHelp() {\n\t\tStringBuffer help = new StringBuffer(256);\n\t\thelp.append(ConsoleMsg.CONSOLE_HELP_CONTROLLING_CONSOLE_HEADING);\n\t\thelp.append(newline);\n\t\thelp.append(tab);\n\t\thelp.append(\"more - \"); //$NON-NLS-1$\n\t\thelp.append(ConsoleMsg.CONSOLE_HELP_MORE);\n\t\thelp.append(newline);\n\t\treturn help.toString();\n\t}", "private void helpService() {\n output.println(\"Help command\");\n output.println(\"-calc <number> \\t Calculates the value of pi based on <number> points; quit \\t Exit from program \");\n }", "public Object getModuleHelp() throws DynamicCallException, ExecutionException {\n return (Object)call(\"getModuleHelp\").get();\n }", "public String getHelp() {\r\n String res = \"You can use the following commands:\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"north\\\" to go towards the north\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"south\\\" to go towards the south\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"east\\\" to go towards the south\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"west\\\" to go towards the south\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"attack\\\" to attack a monster\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"look\\\" to look around in the room\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"search\\\" to search the room for treasure\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"use\\\" to use somthing in your inventory\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"gear\\\" to see what gear you got equipped\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"inventory\\\" to see what gear you have in your inventory\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"savegame\\\" to save your progress\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"stop\\\" to quit the game.\" + System.lineSeparator();\r\n return res;\r\n }", "public abstract void printHelp(List<String> args);", "Menu getMenuHelp();", "default String toHelpString() {\n // Builder\n StringBuilder builder = new StringBuilder();\n // Name\n builder.append(ChatColor.RED).append(getName()).append(\" \");\n // Parameter\n Iterator<PowreedCommandParameter> iterator = this.getParameters().iterator();\n while (iterator.hasNext()) {\n PowreedCommandParameter next = iterator.next();\n\n if (next.isRequired()) {\n builder.append(ChatColor.GOLD).append(\"<\").append(next.getName()).append(\">\");\n } else {\n builder.append(ChatColor.DARK_GRAY).append(\"[\").append(next.getName()).append(\"]\");\n }\n\n if (iterator.hasNext()) {\n builder.append(\" \");\n }\n }\n // Description\n builder.append(ChatColor.RED).append(\": \").append(ChatColor.GRAY).append(getDescription());\n // Return to string\n return builder.toString();\n }", "String getHelp(long guildID);", "public void showHelp(CommandSender sender) {\n\t\t\n\t}", "public static void help() {\n\n\t\tSystem.out.println(\"--help--Input format should be as below\" + \n\t\t \"\\njava -jar passgen.jar -l\" + \n\t\t\t\t \"\\n\" +\n\t\t\t\t \"\\njava -jar passgen.jar -l\" + \"\\n(where l= length of password)\" + \n\t\t\t\t \"\\n\");\n\n\t}", "public boolean isHelpRequested() {\n return m_commandLine.hasOption(m_helpOption);\n }", "public boolean isFullHelpMode();", "public String[] getHelpMessages()\r\n {\r\n return helpMessage;\r\n }", "public void helpGenericAction() {\n new Help(getGenericHelpTitle(), getGenericHelp());\n }", "public void helpSpecificAction() {\n new Help(getSpecificHelpTitle(), getSpecificHelp());\n }", "@ZAttr(id=676)\n public String getHelpAdvancedURL() {\n return getAttr(Provisioning.A_zimbraHelpAdvancedURL, null);\n }", "private void doHelp()\r\n {\r\n Help.showHelp(page, ref, null);\r\n }", "String getOnlineHelpLocation();", "public void helpRequested(HelpEvent event) {\r\n }", "@Override\n\tpublic void sendHelp(ICommandSender sender) {\n\t}", "protected void handleHelp(ActionEvent event) {\n\t}", "public String textHelp() {\t\t\n\t\tString s = \"RUN: Ejecuta todas las instrucciones\";\n\t\treturn s;\n\t}", "@Test\n\tpublic void testHelpOption()\n\t{\n\t\tPrintStream outBkp = System.out;\n\t\tByteArrayOutputStream outBuf = new ByteArrayOutputStream ();\n\t\tSystem.setOut ( new PrintStream ( outBuf ) );\n\n\t\tApp.main ( \"--help\" );\n\t\t\n\t\tSystem.setOut ( outBkp ); // restore the original output\n\n\t\tlog.debug ( \"CLI output:\\n{}\", outBuf.toString () );\n\t\tassertTrue ( \"Can't find CLI output!\", outBuf.toString ().contains ( \"*** Command Line Example ***\" ) );\n\t\tassertEquals ( \"Bad exit code!\", 1, App.getExitCode () );\n\t}", "Help createHelp();", "@ZAttr(id=677)\n public String getHelpStandardURL() {\n return getAttr(Provisioning.A_zimbraHelpStandardURL, null);\n }", "private static void displayHelp(){\n System.out.println(\"-host hostaddress: \\n\" +\n \" connect the host and run the game \\n\" +\n \"-help: \\n\" +\n \" display the help information \\n\" +\n \"-images: \\n\" +\n \" display the images directory \\n\" +\n \"-sound: \\n\" +\n \" display the sounds file directory \\n\"\n\n );\n }", "@Override\n public String getHelpFile() {\n final String filePath = \"/descriptor/au.com.centrumsystems.hudson.plugin.buildpipeline.trigger.BuildPipelineTrigger/help\";\n final String fileName = \"buildPipeline.html\";\n return String.format(\"%s/%s\", filePath, fileName);\n }", "public void help(String helpType) {\n try {\n if (helpType.equals(\"\")) {\n write(\"help\");\n } else {\n write(\"help \" + helpType);\n }\n } catch (IOException e) {\n System.out.println(\"No connecting with server:help\");\n }\n }", "public JMenu getHelpMenu() {\n return helpMenu;\n }", "@Override\n public void help()\n {\n System.out.println(\"\\tcd [DEST]\");\n }", "private static void help() {\n HelpFormatter formater = new HelpFormatter();\n formater.printHelp(\"SGD-SVM\", options);\n System.exit(0);\n }", "public void help() {\n\t\tString format = \"%-20s%s%n\";\n\t\tString[] commands = new String[5];\n\t\tcommands[0] = \"help\";\n\t\tcommands[1] = \"learn\";\n\t\tcommands[2] = \"alphabet:create\";\n\t\tcommands[3] = \"alphabet:destroy\";\n\t\tcommands[4] = \"alphabet:compose\";\n\n\t\tString[] explanation = new String[5];\n\t\texplanation[0] = \"display this message\";\n\t\texplanation[1] = \"starts a learning process. Note: with a large alphabet, this\\ncan take a \"\n\t\t\t\t+ \"very long time!\";\n\t\texplanation[2] = \"creates an alphabet. Currently only working for Android, the\\n\"\n\t\t\t\t+ \"creation of an iOS alphabet has to be done more or less manually\";\n\t\texplanation[3] = \"deletes an existing alphabet\";\n\t\texplanation[4] = \"composes an alphabet from existing window dumps.\";\n\n\t\tfor (int i = 0; i < commands.length; i++) {\n\t\t\tSystem.out.printf(format, commands[i], explanation[i]);\n\t\t}\n\t}", "public void showHelp() {\n\tString shortFormat = \"%16s -- %-20s %n\";\n\tString longFormat = \"%16s -- %-40s %n\";\n System.out.printf(shortFormat, \"ls\", \"list matched tariffs\");\n System.out.printf(shortFormat, \"ls all\", \"list all tariffs\");\n System.out.printf(shortFormat, \"clear\", \"reset filters\");\n System.out.printf(shortFormat, \"exit\", \"exit the program\");\n System.out.printf(longFormat, \"field min max\",\n \"filter tariffs with field having\"\n + \"value between min and max\");\n System.out.println(\"\\nList of available fields:\\n\");\n filterCommands.stream().forEach(System.out::println);\n }", "@XRMethod(value = \"system.help\", help = \"Returns usage information for a method\")\r\n\tString help(String methodName);", "private void printHelp() {\r\n\t\tSystem.out.println(\"Flag Param Details\");\r\n\t\tSystem.out.println(\" -f **x** Add a filter. 'x' is the board letter.\");\r\n\t\tSystem.out.println(\" Can have 0 or more stars before and after the board letter.\");\r\n\t\tSystem.out.println(\" -h Print this message.\");\r\n\t\tSystem.out.println(\" -q Quit interactive session.\");\r\n\t\tSystem.out.println(\" -n xx Display xx number of words.\");\r\n\t\tSystem.out.println(\" -n all Display all words.\");\r\n\t\tSystem.out.println(\" -r Repeat last search.\");\r\n\t\tSystem.out.println(\" -s len Words are sorted by length.\");\r\n\t\tSystem.out.println(\" -s alpha Words are sorted alphapetically.\");\r\n\t\t// System.out.println(\"\");\r\n\t}", "public String getHelp() {\n\t\treturn \"DCAU type\";\n\t}", "@Override\r\n\tpublic String getHelp() {\r\n\t\treturn \"DROP | SOLTAR <id>\";\r\n\t}", "@Override\r\n\tpublic String getHelp() {\r\n\t\treturn \"DROP | SOLTAR <id>\";\r\n\t}", "private static void printHelp(){\r\n System.out.println(\"\\n\\n\\t\\t\\t ----HELP---\\n\\n\" +\r\n \"\\nYou can set the length of password like this \\n\" +\r\n \"\\t java -jar nipunpassgen.jar -l (where l is length of password) \\n\\n\" +\r\n \"\\nYou can also specifiy the which type of word your want to use like this-->\\n\" +\r\n \"\\t Type java -jar nipunpassgen.jar -l -tttt \\n \" +\r\n \"Here 1st t will set uselowercase true \\t 2nd t set useUppercase true\\n\" +\r\n \"\\t 3rd t set useDigit True \\t and 4th t set useSpecial Char true\\n\" +\r\n \"You can use 't' or 'T' for setting the true and 'f' or 'F' for setting the false\\n\" +\r\n \"You can pass -c flag at the end of command for directly copy the password in your\\n\" +\r\n \"clipboard without showing in console like this \\t java -jar nipunpassgen.jar -c \\t this will copy a\\n\" +\r\n \"random 8 digit password in your clipboard .\");\r\n }", "public String getHelp(String keyword) {\n\t\tString value = \"\";\n\n\t\tif (this.helpMap.containsKey(keyword)) {\n\t\t\tvalue = this.helpMap.get(keyword);\n\t\t}\n\t\treturn value;\n\t}", "public Integer getHelp_keyword_id() {\n return help_keyword_id;\n }", "public String help() {\n\t\t\treturn \"\\nc-m-n backtracking test game.\\n\"\n\t\t\t\t\t\t\t+ \"Moves are integers in the range 0..\"\n\t\t\t\t\t\t\t+ getMM()\n\t\t\t\t\t\t\t+ \"\\nFind \"\n\t\t\t\t\t\t\t+ getCC()\n\t\t\t\t\t\t\t+ \" numbers that sum to \"\n\t\t\t\t\t\t\t+ getNN()\n\t\t\t\t\t\t\t+ \"\\nIf both or neither succeed, game is a draw. 0 quits.\\n\";\n\t\t}", "@Override\n public void help(CommandSender sender) {\n \n }", "@Test\n\t//If only \"-help\", print help message\n\tpublic void pasteGetHelpAsOnlyArgumentTest() {\n\t\t//String[] arguments = new String[]{\"-help\"};\n\t\t//Changes: command stdin is shifted to execute method to cater to our project\n\t\tpasteTool = new PASTETool();\n\t\tactualOutput = pasteTool.execute(workingDirectory, \"paste -help\");\n\t\texpectedOutput = helpOutput;\n\t\tassertTrue(expectedOutput.equalsIgnoreCase(actualOutput));\n\t\tassertEquals(pasteTool.getStatusCode(), 0);\t\t\n\t}", "public org.sirius.client.win32.core.types.Dword getDwContextHelpID() {\n return dwContextHelpID;\n }", "public void testHelp() {\n // increasing time because opening of help window can last longer on slower machines\n JemmyProperties.setCurrentTimeout(\"JMenuOperator.PushMenuTimeout\", 60000);\n // open \"Help|Contents\"\n HelpOperator helpOper = HelpOperator.invoke();\n // check help window opened\n // title is \"Help - All\"\n helpOper.close();\n }", "private static void help() {\n System.out.println(USAGE); \n System.exit(0);\n }", "public static void help() {\n\tSystem.out.println(\"-- Avaible options --\");\n\tSystem.out.println(\"-- [arg]: Required argument\");\n\tSystem.out.println(\"-- {arg}: Optional argument\");\n\tSystem.out.println(\"* -s {file} Save the game into a file\");\n\tSystem.out.println(\"* -r {file} Play or Replay a game from a file\");\n\tSystem.out.println(\"* -a [file] Play a binary file or a game file\");\n\tSystem.out.println(\"* -n [file] Create a random game file\");\n\tSystem.out.println(\"* -t [size] Specify the size of the board\");\n\tSystem.out.println(\"* -k Solve the game with the IA solver\");\n\tSystem.out.println(\"* -m Solve the game with the MinMax/AlphaBeta algorithm\");\n\tSystem.out.println(\"----------------------------------------------\");\n\tSystem.out.println(\". Press Enter to Start or Restart\");\n\tSystem.out.println(\". Press Z to Undo the last move\");\n\tSystem.out.println(\"\");\n }", "private SlackerOutput handleHelp() {\n logger.debug(\"Handling help request\");\n List<WorkflowMetadata> metadata = registry.getWorkflowMetadata();\n Collections.sort(metadata, new Comparator<WorkflowMetadata>() {\n @Override\n public int compare(WorkflowMetadata m1, WorkflowMetadata m2) {\n String p1 = StringUtils.join(m1.getPath(), \"::\");\n String p2 = StringUtils.join(m2.getPath(), \"::\");\n return p1.compareTo(p2);\n }\n });\n StringBuilder sb = new StringBuilder(\"I can understand:\\n\");\n for (WorkflowMetadata wm : metadata) {\n sb.append(StringUtils.join(wm.getPath(), \" \"))\n .append(\" \")\n .append(trimToEmpty(wm.getArgsSpecification()))\n .append(\"\\n\").append(\" \")\n .append(trimToEmpty(wm.getName()))\n .append(\" - \").append(trimToEmpty(wm.getDescription()))\n .append(\"\\n\");\n }\n return new TextOutput(sb.toString());\n }" ]
[ "0.80213046", "0.78279513", "0.77412677", "0.7688273", "0.760001", "0.74843156", "0.7395004", "0.73650014", "0.7354578", "0.72721076", "0.7254371", "0.7158874", "0.7147404", "0.71291775", "0.7125293", "0.70411766", "0.7038619", "0.70371854", "0.7004014", "0.6993647", "0.69888484", "0.6976895", "0.69728094", "0.6958839", "0.693445", "0.693038", "0.69239324", "0.68963027", "0.6896282", "0.685175", "0.6846639", "0.67781633", "0.67693275", "0.67598826", "0.67595524", "0.6724757", "0.6718468", "0.6707159", "0.67030954", "0.6694878", "0.6693142", "0.6649042", "0.6647291", "0.66442597", "0.66334426", "0.6605574", "0.6600795", "0.6582014", "0.6550873", "0.652145", "0.64865404", "0.6478243", "0.64615977", "0.6449998", "0.6442657", "0.64338297", "0.6425031", "0.6399586", "0.6379968", "0.6349879", "0.6341092", "0.6277149", "0.6242337", "0.62329483", "0.6215084", "0.62105817", "0.62087375", "0.62031597", "0.6199432", "0.6197064", "0.6183739", "0.6174979", "0.61717004", "0.61715645", "0.617125", "0.6166823", "0.6161552", "0.61595863", "0.6152856", "0.6126495", "0.6120758", "0.6111203", "0.6109567", "0.6101593", "0.60839784", "0.60791403", "0.6069767", "0.6063113", "0.6063113", "0.6051677", "0.60492986", "0.6045027", "0.60364765", "0.603364", "0.6026551", "0.60174143", "0.60168684", "0.60159594", "0.60068846", "0.5997805" ]
0.7434114
6
Value of "url" parameter. Defaults to
@Nonnull public String getURL() { return url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setURL(String _url) { url = _url; }", "@Override\r\n public String getURL() {\n return url;\r\n }", "@Override\n\tpublic String getUrl()\n\t{\n\t\treturn url;\n\t}", "public String getUrl() { return url; }", "public String getURL() { return url; }", "public String getURL(){\r\n\t\t \r\n\t\t\r\n\t\treturn rb.getProperty(\"url\");\r\n\t}", "public String getUrl(){\n \treturn url;\n }", "public void setURL(String url);", "public void setUrl(String url);", "public void setUrl(String url);", "public String getURL() {\r\n return url;\r\n }", "public String getUrl() {\r\n\t\treturn url;\r\n\t}", "public String getUrl() {\r\n\t\treturn url;\r\n\t}", "public String getURL() {\r\n\t\treturn url;\r\n\t}", "@java.lang.Override\n public java.lang.String getUrl() {\n return url_;\n }", "@java.lang.Override\n public java.lang.String getUrl() {\n return url_;\n }", "public String getUrl() {\n\t\tif (prop.getProperty(\"url\") == null)\n\t\t\treturn \"\";\n\t\treturn prop.getProperty(\"url\");\n\t}", "public String getUrl() {\r\n\t\t\treturn url;\r\n\t\t}", "public String getUrl() {\r\n return url;\r\n }", "public String getUrl() {\r\n return url;\r\n }", "public String getUrl() {\r\n return url;\r\n }", "public String getUrl() {\r\n return url;\r\n }", "public String getUrl() {\r\n return url;\r\n }", "public String getUrl() {\r\n return url;\r\n }", "public String getUrl() {\r\n return url;\r\n }", "public String url() {\n return this.url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n\t\treturn url;\n\t}", "public String getUrl() {\n\t\treturn url;\n\t}", "public String getUrl() {\n\t\treturn url;\n\t}", "public String getUrl() {\n\t\treturn url;\n\t}", "public String getUrl() {\n\t\treturn url;\n\t}", "public String getUrl() {\n\t\treturn url;\n\t}", "public String getUrl() {\n\t\treturn url;\n\t}", "public String getUrl() {\n\t\treturn url;\n\t}", "public String getUrl() {\n\t\treturn url;\n\t}", "public void setUrl( String url )\n {\n this.url = url;\n }", "public void setUrl( String url )\n {\n this.url = url;\n }", "public String getURL() {\n return url;\n }", "public String getURL() {\n\t\treturn url;\n\t}", "public String getUrl()\n {\n return url;\n }", "public void setUrl(String url) {\n this.url = url;\n }", "public void setUrl(String url) {\r\n this.url = url;\r\n }", "public void setUrl(String url) {\r\n this.url = url;\r\n }", "public void setUrl(String url) {\r\n this.url = url;\r\n }", "public void setUrl(String url){\n\t\t_url=url;\n\t}", "public void setUrl(URL url)\n {\n this.url = url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public String getUrl() {\n return url;\n }", "public java.lang.String getUrl() {\n return url;\n }", "private void setUrl(\n java.lang.String value) {\n value.getClass();\n bitField0_ |= 0x00000002;\n url_ = value;\n }", "public java.lang.String getUrl () {\r\n\t\treturn url;\r\n\t}", "public final String getUrl() {\n return properties.get(URL_PROPERTY);\n }", "public void setUrl(String url) {\r\n\t\tthis.url = url;\r\n\t}", "public void setUrl(String url) {\r\n\t\tthis.url = url;\r\n\t}", "public String getUrl() {\n\t\t\treturn url;\n\t\t}", "public String getUrl() {\n return url;\n }", "@Override\r\n\tpublic String getUrl() {\n\t\treturn null;\r\n\t}", "public String getURL() {\n\t\treturn prop.getProperty(\"URL\");\n\t}", "private void setUrl(\n java.lang.String value) {\n value.getClass();\n bitField0_ |= 0x00000001;\n url_ = value;\n }", "public String getURL() {\n\t\treturn URL;\n\t}", "public java.lang.String getUrl(){\r\n return this.url;\r\n }", "public void setUrl(String url) {\n this.url = url;\n }", "public void setUrl(String url) {\n this.url = url;\n }", "public void setUrl(String url) {\n this.url = url;\n }", "public void setUrl(String url) {\n this.url = url;\n }", "public void setUrl(String url) {\n this.url = url;\n }", "public void setUrl(String url) {\n this.url = url;\n }", "public void setUrl(String url) {\n this.url = url;\n }", "public void setUrl(String url) {\n this.url = url;\n }", "@Nullable\n public abstract String url();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "private String getURL() {\n\t\t// TODO : Generate URL\n\t\treturn null;\n\t}", "public String getURL()\n {\n return getURL(\"http\");\n }", "public String getUrl() {\n return this.url;\n }" ]
[ "0.75857985", "0.7493368", "0.7485623", "0.7477863", "0.7431631", "0.7429441", "0.7354102", "0.73256683", "0.73132586", "0.73132586", "0.72555256", "0.72197634", "0.72197634", "0.72119606", "0.7201035", "0.7201035", "0.7194905", "0.7193453", "0.71932226", "0.71932226", "0.71932226", "0.71932226", "0.71932226", "0.71932226", "0.71932226", "0.7173478", "0.71683514", "0.71683514", "0.71339965", "0.71339965", "0.71339965", "0.71339965", "0.71339965", "0.71339965", "0.71339965", "0.71339965", "0.71339965", "0.71287864", "0.71287864", "0.71283025", "0.7125253", "0.7105733", "0.7087077", "0.70840186", "0.70840186", "0.70840186", "0.7080338", "0.7072987", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7061906", "0.7020247", "0.701959", "0.7014775", "0.7007828", "0.7006795", "0.7006795", "0.69960475", "0.6995204", "0.69934434", "0.6990374", "0.6984402", "0.6981917", "0.69782627", "0.69777274", "0.69777274", "0.69777274", "0.69777274", "0.69777274", "0.69777274", "0.69777274", "0.69777274", "0.69521624", "0.69510776", "0.69510776", "0.69510776", "0.69510776", "0.69510776", "0.69510776", "0.69497675", "0.6949591", "0.69451994" ]
0.0
-1
Value of "path" parameter.
@Nullable public String getPath() { return path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String path() {\n\treturn path;\n }", "public String path() {\n return this.path;\n }", "public String path() {\n return this.path;\n }", "public String getpathInput() {\r\n\t\treturn pathInput;\r\n\t}", "public String getPath(){\r\n\t\treturn path;\r\n\t}", "String getPath() {\r\n\t\treturn path;\r\n\t}", "public String getPath() {\r\n return path;\r\n }", "public String getPath() {\r\n return path;\r\n }", "public String getPath() {\n\t\treturn getString(\"path\");\n\t}", "public int path(){\n\t\treturn this.path;\n\t}", "public String getPath() {\r\n\t\treturn path;\r\n\t}", "public String getPath() {\r\n\t\treturn path;\r\n\t}", "public String getPath() {\r\n\t\treturn path;\r\n\t}", "public String getPath()\n {\n return path;\n }", "public String getPath()\n {\n return path;\n }", "public String getPath() {\n\t\treturn path;\n\t}", "public String getPath() {\r\n\t\t\treturn path;\r\n\t\t}", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public java.lang.String getPath() {\n\t\t return path;\n\t }", "String getPath() {\n return path;\n }", "public String getPath() {\n return this.path;\n }", "protected String getPath ()\n\t{\n\t\treturn path;\n\t}", "public String getPath() {\n return path;\n }", "public String getPath() {\n return path;\n }", "public String getPath() {\n return path;\n }", "public String getPath() {\n return path;\n }", "public String getPath() {\n return path;\n }", "public String getPath() {\n return path;\n }", "public String getPath() {\n return path;\n }", "public String getPath() {\n return path;\n }", "public String getPath() {\n return path;\n }", "public String getPath() {\n return path;\n }", "public String getPath() {\n return path;\n }", "public String getPath() {\n return path;\n }", "public String getPath() {\n return path;\n }", "public String getPath() {\n return path;\n }", "public String getPath() {\n return path;\n }", "public String getPath(){\n\t\t\treturn this.path;\n\t\t}", "public String getPath() {\n\t\treturn this.path;\n\t}", "String getPath() {\n return this.path;\n }", "public void setPath(String path) {\n this.path = path;\n }", "public void setPath(String path) {\r\n this.path = path;\r\n }", "public String getPath()\n {\n\n return _path;\n }", "public void setPath(String path)\n {\n this.path = path;\n }", "public final String getPath()\n {\n return path;\n }", "public final String getPath() {\n\t return m_path;\n\t}", "public void setPath(String path) {\r\n\t\tthis.path = path;\r\n\t}", "public void setPath(String path) {\r\n\t\tthis.path = path;\r\n\t}", "public void setPath(String path) {\r\n\t\tthis.path = path;\r\n\t}", "public String getPath() {\n return m_path;\n }", "@Override\n\t\tpublic String getRealPath(String path) {\n\t\t\treturn null;\n\t\t}", "public void setPath(String path)\r\n/* 21: */ {\r\n/* 22:53 */ this.path = path;\r\n/* 23: */ }", "public void setPath(String path) {\n this.path = path;\n }", "public void setPath(String path) {\n this.path = path;\n }", "public void setPath(String path) {\n this.path = path;\n }", "public void setPath(String path) {\n this.path = path;\n }", "public void setPath(String path) {\n this.path = path;\n }", "public void setPath(String path) {\n this.path = path;\n }", "public void setPath(String path) {\n this.path = path;\n }", "public void setPath(String path) {\n this.path = path;\n }", "public void setPath(String path) {\n this.path = path;\n }", "public String getPath()\r\n/* 26: */ {\r\n/* 27:57 */ return this.path;\r\n/* 28: */ }", "public SoPath getPath() {\n\t\t return path; \n\t}", "public void setPath(String path);", "void path(String path);", "void path(String path);", "public String getPath() {\n\n\t\treturn this.path;\n\n\t}", "@JsonProperty(\"path\")\r\n public String getPath() {\r\n return path;\r\n }", "@JsonProperty(\"path\")\r\n public String getPath() {\r\n return path;\r\n }", "public void setPath(String path) {\n\n this.path = path;\n }", "String getPath();", "String getPath();", "String getPath();", "String getPath();", "String getPath();", "public Path getPath(){\n return this.path;\n }", "Path getPath();", "public final String getPath() {\n\t\treturn this.path.toString();\n\t}", "public void setPath(String path){\n mPath = path;\n }", "public String getPath();", "public String getPath();", "public String getPath();", "@JsonProperty(\"path\")\n public String getPath() {\n return path;\n }", "public Path getPath() {\n return path;\n }", "@JsonProperty(\"path\")\r\n public void setPath(String path) {\r\n this.path = path;\r\n }", "@JsonProperty(\"path\")\r\n public void setPath(String path) {\r\n this.path = path;\r\n }", "@Override\n\tpublic String getRealPath(String path) {\n\t\treturn null;\n\t}", "public Path getPath() {\n return this.path;\n }" ]
[ "0.72145194", "0.7157242", "0.7157242", "0.715655", "0.7090781", "0.7088791", "0.70230645", "0.70230645", "0.7019166", "0.7018351", "0.7015947", "0.7015947", "0.7015947", "0.699317", "0.699317", "0.6968474", "0.6951629", "0.6938024", "0.6938024", "0.6938024", "0.6938024", "0.6938024", "0.6938024", "0.6938024", "0.6938024", "0.6938024", "0.6938024", "0.6938024", "0.6938024", "0.6938024", "0.6911201", "0.6902638", "0.6891274", "0.6874853", "0.6871503", "0.6871503", "0.6871503", "0.6871503", "0.6871503", "0.6871503", "0.6871503", "0.6871503", "0.6871503", "0.6871503", "0.6871503", "0.6871503", "0.6871503", "0.6871503", "0.6871503", "0.68461484", "0.68341154", "0.68322307", "0.6792551", "0.67719656", "0.6769923", "0.6767368", "0.6745329", "0.6731781", "0.67277217", "0.67277217", "0.67277217", "0.6705973", "0.6691977", "0.6683525", "0.6682027", "0.6682027", "0.6682027", "0.6682027", "0.6682027", "0.6682027", "0.6682027", "0.6682027", "0.6682027", "0.66761166", "0.6650156", "0.66452086", "0.66434795", "0.66434795", "0.66433877", "0.6628124", "0.6628124", "0.66176796", "0.6612297", "0.6612297", "0.6612297", "0.6612297", "0.6612297", "0.65689147", "0.65683144", "0.6568145", "0.6554775", "0.65352505", "0.65352505", "0.65352505", "0.6505853", "0.6500575", "0.64890933", "0.64890933", "0.6487435", "0.64872324" ]
0.6509428
94
Value of "trustStore" parameter.
@Nullable public String getTrustStore() { return trustStore; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getTrustStore() {\n return trustStore;\n }", "public void setTrustStore(String trustStore) {\n this.trustStore = trustStore;\n }", "@Nullable public String getTrustStoreType() {\n return trustStoreType;\n }", "public URL getTrustStore() {\n URL trustStore = null;\n if (trustStoreLocation != null) {\n try {\n trustStore = new URL(\"file:\" + trustStoreLocation);\n }\n catch (Exception e) {\n log.error(\"Truststore has a malformed name: \" + trustStoreLocation, e);\n }\n }\n return trustStore;\n }", "public String getTrustStorePassword() {\n return trustStorePassword;\n }", "public String getTrustStorePassword() {\n return trustStorePassword;\n }", "@Nullable public String getTrustStorePassword() {\n return trustStorePassword;\n }", "public void setTrustStorePassword(String trustStorePassword) {\n this.trustStorePassword = trustStorePassword;\n }", "protected String getStore() {\n return store;\n }", "@Override\r\n\tpublic String getBind_trust_ind() {\n\t\treturn super.getBind_trust_ind();\r\n\t}", "public File getMySQLSSLTrustStore() throws GuacamoleException {\n return getProperty(MySQLGuacamoleProperties.MYSQL_SSL_TRUST_STORE);\n }", "public Long getStoreId() {\r\n return storeId;\r\n }", "public void setTrustStore(String trustStoreLocation) {\n if (!complete) {\n this.trustStoreLocation = trustStoreLocation;\n } else {\n log.warn(\"Connection Descriptor setter used outside of factory.\");\n }\n }", "private void installTrustStore() {\n if (trustStoreType != null) {\n System.setProperty(\"javax.net.ssl.trustStore\", trustStore);\n if (trustStoreType != null) {\n System.setProperty(\"javax.net.ssl.trustStoreType\", trustStoreType);\n }\n if (trustStorePassword != null) {\n System.setProperty(\"javax.net.ssl.trustStorePassword\", trustStorePassword);\n }\n }\n }", "public Integer getStoreId() {\n return storeId;\n }", "public Integer getStoreId() {\n return storeId;\n }", "public Long getStoreId() {\n return storeId;\n }", "public String getStoreName() {\r\n return storeName;\r\n }", "public String getStoreName() {\n return (String) get(\"store_name\");\n }", "public String getStoreName() {\n return storeName;\n }", "public T getStore() {\r\n\t\treturn store;\r\n\t}", "public void setTrustStorePassword(String trustStorePassword) {\n if (!complete) {\n this.trustStorePassword = trustStorePassword;\n } else {\n log.warn(\"Connection Descriptor setter used outside of factory.\");\n }\n }", "private static void checkTrustStore(KeyStore store, Path path) throws GeneralSecurityException {\n Enumeration<String> aliases = store.aliases();\n while (aliases.hasMoreElements()) {\n String alias = aliases.nextElement();\n if (store.isCertificateEntry(alias)) {\n return;\n }\n }\n throw new SslConfigException(\"the truststore [\" + path + \"] does not contain any trusted certificate entries\");\n }", "public String getStore_location()\n {\n \treturn store_location;\n }", "public String getStoreName() {\r\n\t\treturn storeName;\r\n\t}", "public int getStoreID() { return storeID; }", "public String getSslTrustProperty() {\n\n return unmaskProperty(EmailConnectionConstants.PROPERTY_SSL_TRUST);\n }", "public String getStoreName() {\n\t\treturn storeName;\n\t}", "public String getLocalStore() {\n return localStore;\n }", "public String getStore_name()\n {\n \treturn store_name;\n }", "public boolean isTrusted() {\n\t\treturn trusted;\n\t}", "private String getStoreName() {\n if (storeName == null) {\n storeName = System.getProperty(\"user.dir\")\n + File.separator\n + QVCSConstants.QVCS_META_DATA_DIRECTORY\n + File.separator\n + QVCSConstants.QVCS_FILEID_DICT_STORE_NAME\n + \"dat\";\n }\n return storeName;\n }", "protected void setStore(String store) {\n this.store = store;\n }", "public URL getKeystoreLocation() {\n return keystoreLocation;\n }", "public String getFromStoreId();", "public Integer getStorekeeperid() {\n return storekeeperid;\n }", "public DtxStore getStore() {\n return dtxStore;\n }", "public String getToStoreId();", "public boolean isStore() { return _store; }", "public java.lang.Integer getStoredem() throws java.rmi.RemoteException;", "public String getKeystorePass() {\n return keystorePass;\n }", "public String getStoreNoList() {\n return storeNoList;\n }", "public KeyStore getKeyStore();", "protected static String getKeyStoreAlias() {\n return keyStoreAlias;\n }", "DataStoreInfo getUserDataStoreInfo();", "public KeyStore getKeyStore() {\n return keyStore;\n }", "com.google.ads.googleads.v4.common.StoreAttribute getStoreAttribute();", "@SuppressWarnings(\"unchecked\")\r\n\tprotected VirtualIdentityStore<T> getVirtualIdentityStore() {\r\n\t\treturn (VirtualIdentityStore<T>) getStore().getIdentityStore();\r\n\t}", "public PublicKeyStoreBuilderBase getKeystore() {\n return keystore;\n }", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-08-13 13:14:15.604 -0400\", hash_original_method = \"D53C3DAE7394798EE5A7C498CACBD5AF\", hash_generated_method = \"13DD0364106557B654A3555DA9860FB0\")\n \npublic TrustAnchor getTrustAnchor() {\n return trustAnchor;\n }", "String getValue() throws AccessDeniedException {\n\t performSecurityManagerCheck();\n\t return town;\n\t }", "protected abstract boolean evaluateTrust(Credential untrustedCredential, TrustBasisType trustBasis)\n throws SecurityException;", "public String saveStore() {\n\t\tsuper.setPageTitle(\"label.menu.group.store\");\n\n\t\tMerchantStore store = null;\n\t\ttry {\n\n\t\t\tContext ctx = (Context) super.getServletRequest().getSession()\n\t\t\t\t\t.getAttribute(ProfileConstants.context);\n\t\t\tInteger merchantid = ctx.getMerchantid();\n\n\t\t\tMerchantService mservice = (MerchantService) ServiceFactory\n\t\t\t\t\t.getService(ServiceFactory.MerchantService);\n\t\t\tstore = mservice.getMerchantStore(merchantid.intValue());\n\t\t\t\n\t\t\t//validation\n/*\t\t\tif (StringUtils.isBlank(merchantProfile.getTemplateModule())) {\n\t\t\t\tsuper.setErrorMessage(\"errors.store.emptytemplate\");\n\t\t\t\treturn INPUT;\n\t\t\t} */\n\n\t\t\tif (store == null) {\n\t\t\t\tstore = new MerchantStore();\n\t\t\t\tstore.setTemplateModule(CatalogConstants.DEFAULT_TEMPLATE);\n\t\t\t}else {\n\t\t\t\tstore.setTemplateModule(merchantProfile.getTemplateModule());\n\t\t\t}\n\t\t\t\n\n\n\t\t\tjava.util.Date dt = new java.util.Date();\n\n\t\t\tStringBuffer languages = new StringBuffer();\n\t\t\tList langs = this.getSupportedLanguages();\n\t\t\tif (langs != null && langs.size() > 0) {\n\t\t\t\tint sz = 0;\n\t\t\t\tIterator i = langs.iterator();\n\n\t\t\t\twhile (i.hasNext()) {\n\t\t\t\t\tString lang = (String) i.next();\n\t\t\t\t\tlanguages.append(lang);\n\n\t\t\t\t\tif (sz < langs.size() - 1) {\n\t\t\t\t\t\tlanguages.append(\";\");\n\t\t\t\t\t}\n\t\t\t\t\tsz++;\n\n\t\t\t\t}\n\t\t\t\tstore.setSupportedlanguages(languages.toString());\n\t\t\t} else {\n\t\t\t\tMessageUtil.addErrorMessage(super.getServletRequest(),\n\t\t\t\t\t\tLabelUtil.getInstance().getText(\n\t\t\t\t\t\t\t\t\"message.confirmation.languagerequired\"));\n\t\t\t\tstore.setSupportedlanguages(Constants.ENGLISH_CODE);\n\t\t\t\treturn SUCCESS;\n\t\t\t}\n\n\t\t\tstore.setStorename(merchantProfile.getStorename());\n\t\t\tstore.setStoreemailaddress(merchantProfile.getStoreemailaddress());\n\t\t\tstore.setStoreaddress(merchantProfile.getStoreaddress());\n\t\t\tstore.setStorecity(merchantProfile.getStorecity());\n\t\t\tstore.setStorepostalcode(merchantProfile.getStorepostalcode());\n\t\t\tstore.setCountry(merchantProfile.getCountry());\n\t\t\tstore.setZone(merchantProfile.getZone());\n\t\t\tstore.setCurrency(merchantProfile.getCurrency());\n\t\t\t\n\n\t\t\tif (!StringUtils.isBlank(merchantProfile.getWeightunitcode())) {\n\t\t\t\tstore.setWeightunitcode(merchantProfile.getWeightunitcode()\n\t\t\t\t\t\t.trim());\n\t\t\t}\n\t\t\tif (!StringUtils.isBlank(merchantProfile.getSeizeunitcode())) {\n\t\t\t\tstore.setSeizeunitcode(merchantProfile.getSeizeunitcode()\n\t\t\t\t\t\t.trim());\n\t\t\t}\n\t\t\tstore.setStorelogo(merchantProfile.getStorelogo());\n\t\t\tstore.setStorephone(merchantProfile.getStorephone());\n\t\t\tstore.setBgcolorcode(merchantProfile.getBgcolorcode());\n\t\t\tstore.setContinueshoppingurl(merchantProfile\n\t\t\t\t\t.getContinueshoppingurl());\n\t\t\tstore.setUseCache(merchantProfile.isUseCache());\n\t\t\tstore.setDomainName(merchantProfile.getDomainName());\n\n\t\t\tstore.setMerchantId(merchantid.intValue());\n\t\t\tstore.setLastModified(new java.util.Date(dt.getTime()));\n\n\t\t\tif (!StringUtils.isNumeric(merchantProfile.getZone())) {\n\t\t\t\tstore.setStorestateprovince(merchantProfile\n\t\t\t\t\t\t.getStorestateprovince());\n\t\t\t\tctx.setZoneid(0);\n\t\t\t} else {// get the value from zone\n\t\t\t\tctx.setZoneid(Integer.parseInt(merchantProfile.getZone()));\n\t\t\t\tMap zones = RefCache.getInstance().getAllZonesmap(\n\t\t\t\t\t\tLanguageUtil.getLanguageNumberCode(ctx.getLang()));\n\t\t\t\tZone z = (Zone) zones.get(Integer.parseInt(merchantProfile\n\t\t\t\t\t\t.getZone()));\n\t\t\t\tif (z != null) {\n\t\t\t\t\tstore.setStorestateprovince(z.getZoneName());// @todo,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// localization\n\t\t\t\t} else {\n\t\t\t\t\tstore.setStorestateprovince(\"N/A\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!StringUtils.isBlank(this.getInBusinessSince())) {\n\t\t\t\tDate businessDate = DateUtil.getDate(this.getInBusinessSince());\n\t\t\t\tstore.setInBusinessSince(businessDate);\n\t\t\t}\n\n\t\t\tsuper.prepareSelections(store.getCountry());\n\t\t\tmservice.saveOrUpdateMerchantStore(store);\n\n\t\t\tsuper.getContext().setExistingStore(true);\n\n\t\t\t// refresh context\n\n\t\t\tctx.setCountryid(merchantProfile.getCountry());\n\t\t\tctx.setSizeunit(merchantProfile.getSeizeunitcode());\n\t\t\tctx.setWeightunit(merchantProfile.getWeightunitcode());\n\t\t\tLanguageHelper.setLanguages(languages.toString(), ctx);\n\t\t\tctx.setCurrency(merchantProfile.getCurrency());\n\n\t\t\t// refresh the locale\n\t\t\tMap countries = RefCache.getAllcountriesmap(LanguageUtil\n\t\t\t\t\t.getLanguageNumberCode(ctx.getLang()));\n\t\t\tCountry c = (Country) countries.get(merchantProfile.getCountry());\n\t\t\tLocale locale = new Locale(\"en\", c.getCountryIsoCode2());\n\t\t\tActionContext.getContext().setLocale(locale);\n\t\t\tMap sessions = ActionContext.getContext().getSession();\n\t\t\tsessions.put(\"WW_TRANS_I18N_LOCALE\", locale);\n\n\n\t\t\tMessageUtil.addMessage(super.getServletRequest(), LabelUtil\n\t\t\t\t\t.getInstance().getText(\"message.confirmation.success\"));\n\n\t\t} catch (Exception e) {\n\t\t\tlog.error(e);\n\t\t\tsuper.setTechnicalMessage();\n\t\t}\n\n\t\treturn SUCCESS;\n\n\t}", "public URL getKeyStore() {\n URL keyStore = null;\n if (keyStoreLocation != null) {\n try {\n keyStore = new URL(\"file:\" + keyStoreLocation);\n }\n catch (Exception e) {\n log.error(\"Keystore has a malformed name: \" + keyStoreLocation, e);\n }\n }\n return keyStore;\n }", "public Boolean isTrusted()\n {\n return this.isTrusted;\n }", "public String getCustomKeyStoreId() {\n return this.customKeyStoreId;\n }", "public String getKeyStorePassword() {\n return this.keyStorePassword;\n }", "protected static String getKeyStorePath() {\n return keyStorePath;\n }", "public BigDecimal getEntrustorId() {\r\n\t\treturn getEntrustor().getEntrustorId();\r\n\t}", "public void setStoreName(String storeName) {\r\n this.storeName = storeName;\r\n }", "public StoreWithEnterpriseTO getStore(long storeID) throws NotInDatabaseException;", "public String getTrustedBy()\n {\n return this.by;\n }", "public String getKeyStorePassword() {\n return keyStorePassword;\n }", "boolean hasStoreAttribute();", "@Override\n public void setKeyStore(KeyStore keyStore) {\n this.keyStore = keyStore;\n }", "@Override\n Store apply(@Required Store store);", "public BigDecimal getEntrustId() {\r\n\t\treturn entrustId;\r\n\t}", "@JsonProperty(\"store_id\")\n public String getStoreId() {\n return storeId;\n }", "public final String getSignerOverride() {\n return properties.get(SIGNER_OVERRIDE_PROPERTY);\n }", "public void setTrusted (boolean trusted) {\n impl.setTrusted(trusted);\n }", "@Override\r\n\tpublic Double getPropensity_trust_score() {\n\t\treturn super.getPropensity_trust_score();\r\n\t}", "public void setStoreName(String storeName) {\n this.storeName = storeName;\n }", "public Integer getSecurity() {\n return security;\n }", "private void loadTM() throws ERMgmtException{\n try{\n KeyStore ts = KeyStore.getInstance(KeyStore.getDefaultType());\n //random number generate to generated aliases for the new keystore\n Random generator = new Random();\n \n ts.load(null, null);\n \n if(mCertList.size() > 0){\n for(int i=0; i<mCertList.size(); i++){\n int randomInt = generator.nextInt();\n while(ts.containsAlias(\"certificate\"+randomInt)){\n randomInt = generator.nextInt();\n }\n ts.setCertificateEntry(\"certificate\"+randomInt, (X509Certificate) mCertList.get(i));\n } \n mTrustManagerFactory.init(ts); \n } else { \n mTrustManagerFactory.init((KeyStore) null);\n }\n \n TrustManager[] tm = mTrustManagerFactory.getTrustManagers();\n for(int i=0; i<tm.length; i++){\n if (tm[i] instanceof X509TrustManager) {\n mTrustManager = (X509TrustManager)tm[i]; \n break;\n }\n }\n \n } catch (Exception e){ \n throw new ERMgmtException(\"Trust Manager Error\", e);\n }\n \n }", "@GetMapping(path = \"/secure/trust/hello\")\n\t@PreAuthorize(\"hasRole('USER') and #oauth2.hasScope('trust')\")\n\tpublic String getTrustHello() {\n\t\treturn \"Hello Trust\";\n\t}", "public String getSignLocation() {\n\t\treturn signLocation;\n\t}", "@ApiModelProperty(value = \"Name of the store\")\n public String getStoreName() {\n return storeName;\n }", "public KeyProvider getKeyProvider() {\n return keystore; \n }", "@Override\n\tpublic boolean isTrusted(X509Certificate[] chain, String authType)\n\t\t\tthrows CertificateException {\n\t\treturn false;\n\t}", "public void setLocalStore(String localStore) {\n this.localStore = localStore;\n }", "@DOMSupport(DomLevel.ONE)\r\n @Property String getSecurity();", "public TemplateStore getTemplateStore() {\n \t\treturn fTemplateStore;\n \t}", "UserStoreManager getUserStoreManager() throws UserStoreException;", "public DataStoreType getDataStoreType() {\n return dataStoreType;\n }", "public static String getSrwContext() {\r\n if (srwContext == null) {\r\n srwContext = PropertiesProvider.getInstance().getProperty(\"srw.context\", \"/srw\");\r\n }\r\n return srwContext;\r\n }", "public List<VaultStore> getStores() {\n\t\treturn stores;\n\t}", "public IStore getIStore() {\n\n\t\treturn store;\n\t}", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv xgetCryptProviderType();", "void setUserStore(UserStore userStore) {\n this.userStore = userStore;\n }", "void setUserStore(UserStore userStore) {\n this.userStore = userStore;\n }", "public void setKeyStore(KeyStore keyStore) {\n this.keyStore = keyStore;\n }", "@Test \n\tpublic void GetTrustTest(){\n\t\tlogger.info(\"--------------------start---GetTrustTest--------------------------------------------------------------------------------------------------\");\n\t\tList<Trust> list=trustManagementService.GetTrust();\n\t\tfor (Trust trust : list) {\n\t\t\tlogger.info(\"查找结果\" + trust.getTrustName()); \n\t\t}\n\t\t\n\n\t\tlogger.info(\"--------------------end---GetTrustTest--------------------------------------------------------------------------------------------------\");\n\t}", "public String getPassphrase() \r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}", "public File getStoreDir();", "public void setStoreId(Long storeId) {\r\n this.storeId = storeId;\r\n }", "public String getSecurityPolicyFile()\n\t{\n\t\treturn securityPolicyFile;\n\t}", "@Override\n\tpublic EnumEStoreId getEStoreId() {\n\t\treturn sale.geteStoreId();\n\t}", "public boolean isStoreLeaseEligibilityInd() {\n return storeLeaseEligibilityInd;\n }", "public Short getStoreCount() {\n return storeCount;\n }", "java.lang.String getSaltData();" ]
[ "0.74079007", "0.70585954", "0.697624", "0.6853338", "0.6762575", "0.6762575", "0.658109", "0.6523227", "0.5949165", "0.5812522", "0.57321525", "0.57206786", "0.5688388", "0.5682303", "0.5665517", "0.5665517", "0.56560713", "0.5540786", "0.5539089", "0.5496924", "0.54757494", "0.54582417", "0.5406181", "0.5367671", "0.53676474", "0.5359117", "0.53209394", "0.53183967", "0.5283375", "0.5273251", "0.52343565", "0.5223253", "0.52224416", "0.52133626", "0.5160986", "0.5142879", "0.51125884", "0.51060677", "0.5102653", "0.5088822", "0.50866544", "0.507047", "0.5043595", "0.50295836", "0.50265294", "0.50062394", "0.4970434", "0.49440876", "0.49318817", "0.491894", "0.49179456", "0.48911792", "0.48650113", "0.48414344", "0.48281145", "0.48137778", "0.48130316", "0.4792145", "0.4787344", "0.47867638", "0.4786532", "0.47813693", "0.47723702", "0.47418046", "0.47344044", "0.47304124", "0.472697", "0.4717442", "0.4711227", "0.47097543", "0.47043967", "0.46998635", "0.46854907", "0.46843663", "0.4682162", "0.4679746", "0.4667502", "0.46565384", "0.4618939", "0.46182123", "0.46180528", "0.46156338", "0.4609311", "0.4608259", "0.46068516", "0.46049792", "0.4602276", "0.4602269", "0.4597903", "0.4597903", "0.45816594", "0.45779046", "0.45530114", "0.45415452", "0.45400715", "0.45367357", "0.45351577", "0.4532347", "0.45253015", "0.45223618" ]
0.72771126
1
Value of "trustStoreType" parameter.
@Nullable public String getTrustStoreType() { return trustStoreType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getTrustStore() {\n return trustStore;\n }", "@Nullable public String getTrustStore() {\n return trustStore;\n }", "public DataStoreType getDataStoreType() {\n return dataStoreType;\n }", "public java.lang.String getStore_price_type() {\n return store_price_type;\n }", "public void setTrustStore(String trustStore) {\n this.trustStore = trustStore;\n }", "public java.lang.String getSecurityType() {\r\n return securityType;\r\n }", "public void setDataStoreType(DataStoreType dataStoreType) {\n this.dataStoreType = dataStoreType;\n }", "public URL getTrustStore() {\n URL trustStore = null;\n if (trustStoreLocation != null) {\n try {\n trustStore = new URL(\"file:\" + trustStoreLocation);\n }\n catch (Exception e) {\n log.error(\"Truststore has a malformed name: \" + trustStoreLocation, e);\n }\n }\n return trustStore;\n }", "protected abstract STORE_TYPE decideType();", "public String getSignType() {\n return signType;\n }", "com.google.privacy.dlp.v2.StoredType getStoredType();", "public SecurityType getSecurityType() {\n return securityType;\n }", "protected String getStore() {\n return store;\n }", "public void setTrustStorePassword(String trustStorePassword) {\n this.trustStorePassword = trustStorePassword;\n }", "public String getTrustStorePassword() {\n return trustStorePassword;\n }", "public String getTrustStorePassword() {\n return trustStorePassword;\n }", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv xgetCryptProviderType();", "public Integer getStoreId() {\n return storeId;\n }", "public Integer getStoreId() {\n return storeId;\n }", "public Long getStoreId() {\r\n return storeId;\r\n }", "public Byte getSellerType() {\n return sellerType;\n }", "@Nullable public String getTrustStorePassword() {\n return trustStorePassword;\n }", "public Long getStoreId() {\n return storeId;\n }", "public String getPaytype() {\n return paytype;\n }", "public String getPayType() {\n return payType;\n }", "public String getPayType() {\n return payType;\n }", "public String getSysType() {\n return sysType;\n }", "public String getStoreName() {\r\n return storeName;\r\n }", "public String getStoreName() {\n return storeName;\n }", "public String getStoreName() {\n return (String) get(\"store_name\");\n }", "public Integer getPayType() {\n\t\treturn payType;\n\t}", "public void setStore_price_type(java.lang.String store_price_type) {\n this.store_price_type = store_price_type;\n }", "private static Class<? extends DataStore> getSpecificDataStore(\n Type datastoreType) {\n switch (datastoreType) {\n case DYNAMODB:\n return DynamoDBStore.class;\n case CASSANDRA:\n case HBASE:\n case ACCUMULO:\n case MONGO:\n //return MongoStore.class;\n default:\n throw new IllegalStateException(\"DataStore not supported yet.\");\n }\n }", "public SignType getSignType();", "public java.lang.String getCertiType() {\n return certiType;\n }", "public String getLoyaltyType() {\n if (compositePOSTransaction.getLoyaltyCard() != null\n && compositePOSTransaction.getLoyaltyCard().getStoreType() != null)\n return res.getString(compositePOSTransaction.getLoyaltyCard().getStoreType());\n else\n return null;\n }", "public Integer getVerifyType() {\r\n return verifyType;\r\n }", "public String getStoreName() {\r\n\t\treturn storeName;\r\n\t}", "org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum getCryptProviderType();", "public int getDatabaseType()\n {\n return Constants.LOCAL | Constants.SHARED_DATA | Constants.LOCALIZABLE;\n }", "public String getStoreName() {\n\t\treturn storeName;\n\t}", "public int getStoreID() { return storeID; }", "public String getUsertype() {\n return usertype;\n }", "public int getWareHouseType()\n\t{\n\t\treturn getBigDecimal(WareHouse.WAREHOUSETYPE).intValue();\n\t}", "java.lang.String getCryptProviderTypeExtSource();", "public long getPaymentType() {\n return paymentType;\n }", "public T getStore() {\r\n\t\treturn store;\r\n\t}", "public short getStorageType() {\n\treturn storageType;\n }", "long getCryptProviderTypeExt();", "public boolean isStore() { return _store; }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"One of the following values will be provided: Payment Settlement Entity (PSE), Electronic Payment Facilitator (EPF), Other Third Party\")\n\n public String getType() {\n return type;\n }", "public String getStore_name()\n {\n \treturn store_name;\n }", "public String getDatabaseType() {\r\n return m_databaseType;\r\n }", "public String saveStore() {\n\t\tsuper.setPageTitle(\"label.menu.group.store\");\n\n\t\tMerchantStore store = null;\n\t\ttry {\n\n\t\t\tContext ctx = (Context) super.getServletRequest().getSession()\n\t\t\t\t\t.getAttribute(ProfileConstants.context);\n\t\t\tInteger merchantid = ctx.getMerchantid();\n\n\t\t\tMerchantService mservice = (MerchantService) ServiceFactory\n\t\t\t\t\t.getService(ServiceFactory.MerchantService);\n\t\t\tstore = mservice.getMerchantStore(merchantid.intValue());\n\t\t\t\n\t\t\t//validation\n/*\t\t\tif (StringUtils.isBlank(merchantProfile.getTemplateModule())) {\n\t\t\t\tsuper.setErrorMessage(\"errors.store.emptytemplate\");\n\t\t\t\treturn INPUT;\n\t\t\t} */\n\n\t\t\tif (store == null) {\n\t\t\t\tstore = new MerchantStore();\n\t\t\t\tstore.setTemplateModule(CatalogConstants.DEFAULT_TEMPLATE);\n\t\t\t}else {\n\t\t\t\tstore.setTemplateModule(merchantProfile.getTemplateModule());\n\t\t\t}\n\t\t\t\n\n\n\t\t\tjava.util.Date dt = new java.util.Date();\n\n\t\t\tStringBuffer languages = new StringBuffer();\n\t\t\tList langs = this.getSupportedLanguages();\n\t\t\tif (langs != null && langs.size() > 0) {\n\t\t\t\tint sz = 0;\n\t\t\t\tIterator i = langs.iterator();\n\n\t\t\t\twhile (i.hasNext()) {\n\t\t\t\t\tString lang = (String) i.next();\n\t\t\t\t\tlanguages.append(lang);\n\n\t\t\t\t\tif (sz < langs.size() - 1) {\n\t\t\t\t\t\tlanguages.append(\";\");\n\t\t\t\t\t}\n\t\t\t\t\tsz++;\n\n\t\t\t\t}\n\t\t\t\tstore.setSupportedlanguages(languages.toString());\n\t\t\t} else {\n\t\t\t\tMessageUtil.addErrorMessage(super.getServletRequest(),\n\t\t\t\t\t\tLabelUtil.getInstance().getText(\n\t\t\t\t\t\t\t\t\"message.confirmation.languagerequired\"));\n\t\t\t\tstore.setSupportedlanguages(Constants.ENGLISH_CODE);\n\t\t\t\treturn SUCCESS;\n\t\t\t}\n\n\t\t\tstore.setStorename(merchantProfile.getStorename());\n\t\t\tstore.setStoreemailaddress(merchantProfile.getStoreemailaddress());\n\t\t\tstore.setStoreaddress(merchantProfile.getStoreaddress());\n\t\t\tstore.setStorecity(merchantProfile.getStorecity());\n\t\t\tstore.setStorepostalcode(merchantProfile.getStorepostalcode());\n\t\t\tstore.setCountry(merchantProfile.getCountry());\n\t\t\tstore.setZone(merchantProfile.getZone());\n\t\t\tstore.setCurrency(merchantProfile.getCurrency());\n\t\t\t\n\n\t\t\tif (!StringUtils.isBlank(merchantProfile.getWeightunitcode())) {\n\t\t\t\tstore.setWeightunitcode(merchantProfile.getWeightunitcode()\n\t\t\t\t\t\t.trim());\n\t\t\t}\n\t\t\tif (!StringUtils.isBlank(merchantProfile.getSeizeunitcode())) {\n\t\t\t\tstore.setSeizeunitcode(merchantProfile.getSeizeunitcode()\n\t\t\t\t\t\t.trim());\n\t\t\t}\n\t\t\tstore.setStorelogo(merchantProfile.getStorelogo());\n\t\t\tstore.setStorephone(merchantProfile.getStorephone());\n\t\t\tstore.setBgcolorcode(merchantProfile.getBgcolorcode());\n\t\t\tstore.setContinueshoppingurl(merchantProfile\n\t\t\t\t\t.getContinueshoppingurl());\n\t\t\tstore.setUseCache(merchantProfile.isUseCache());\n\t\t\tstore.setDomainName(merchantProfile.getDomainName());\n\n\t\t\tstore.setMerchantId(merchantid.intValue());\n\t\t\tstore.setLastModified(new java.util.Date(dt.getTime()));\n\n\t\t\tif (!StringUtils.isNumeric(merchantProfile.getZone())) {\n\t\t\t\tstore.setStorestateprovince(merchantProfile\n\t\t\t\t\t\t.getStorestateprovince());\n\t\t\t\tctx.setZoneid(0);\n\t\t\t} else {// get the value from zone\n\t\t\t\tctx.setZoneid(Integer.parseInt(merchantProfile.getZone()));\n\t\t\t\tMap zones = RefCache.getInstance().getAllZonesmap(\n\t\t\t\t\t\tLanguageUtil.getLanguageNumberCode(ctx.getLang()));\n\t\t\t\tZone z = (Zone) zones.get(Integer.parseInt(merchantProfile\n\t\t\t\t\t\t.getZone()));\n\t\t\t\tif (z != null) {\n\t\t\t\t\tstore.setStorestateprovince(z.getZoneName());// @todo,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// localization\n\t\t\t\t} else {\n\t\t\t\t\tstore.setStorestateprovince(\"N/A\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!StringUtils.isBlank(this.getInBusinessSince())) {\n\t\t\t\tDate businessDate = DateUtil.getDate(this.getInBusinessSince());\n\t\t\t\tstore.setInBusinessSince(businessDate);\n\t\t\t}\n\n\t\t\tsuper.prepareSelections(store.getCountry());\n\t\t\tmservice.saveOrUpdateMerchantStore(store);\n\n\t\t\tsuper.getContext().setExistingStore(true);\n\n\t\t\t// refresh context\n\n\t\t\tctx.setCountryid(merchantProfile.getCountry());\n\t\t\tctx.setSizeunit(merchantProfile.getSeizeunitcode());\n\t\t\tctx.setWeightunit(merchantProfile.getWeightunitcode());\n\t\t\tLanguageHelper.setLanguages(languages.toString(), ctx);\n\t\t\tctx.setCurrency(merchantProfile.getCurrency());\n\n\t\t\t// refresh the locale\n\t\t\tMap countries = RefCache.getAllcountriesmap(LanguageUtil\n\t\t\t\t\t.getLanguageNumberCode(ctx.getLang()));\n\t\t\tCountry c = (Country) countries.get(merchantProfile.getCountry());\n\t\t\tLocale locale = new Locale(\"en\", c.getCountryIsoCode2());\n\t\t\tActionContext.getContext().setLocale(locale);\n\t\t\tMap sessions = ActionContext.getContext().getSession();\n\t\t\tsessions.put(\"WW_TRANS_I18N_LOCALE\", locale);\n\n\n\t\t\tMessageUtil.addMessage(super.getServletRequest(), LabelUtil\n\t\t\t\t\t.getInstance().getText(\"message.confirmation.success\"));\n\n\t\t} catch (Exception e) {\n\t\t\tlog.error(e);\n\t\t\tsuper.setTechnicalMessage();\n\t\t}\n\n\t\treturn SUCCESS;\n\n\t}", "@Override\n public <T> T convert(Class<T> type, Object value) {\n if (StoreConfiguration.StoreType.DATABASE.toString().equals(value)) {\n return (T) new DatabaseStorageConfiguration();\n }\n throw ActiveMQMessageBundle.BUNDLE.unsupportedStorePropertyType();\n }", "public void setSecurityType(java.lang.String securityType) {\r\n this.securityType = securityType;\r\n }", "public Short getPayType() {\n return payType;\n }", "public String getDBType() {\r\n return dbType;\r\n }", "public Integer getUsertype() {\n return usertype;\n }", "private void installTrustStore() {\n if (trustStoreType != null) {\n System.setProperty(\"javax.net.ssl.trustStore\", trustStore);\n if (trustStoreType != null) {\n System.setProperty(\"javax.net.ssl.trustStoreType\", trustStoreType);\n }\n if (trustStorePassword != null) {\n System.setProperty(\"javax.net.ssl.trustStorePassword\", trustStorePassword);\n }\n }\n }", "public String getIdentityType() {\n return identityType;\n }", "public void setSysType(String sysType) {\n this.sysType = sysType;\n }", "void xsetCryptProviderType(org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv cryptProviderType);", "public String getPassholderType() {\n\t\treturn passholderType;\n\t}", "public java.lang.String maturityType()\n\t{\n\t\treturn _strMaturityType;\n\t}", "public int getMinecartType() {\n return type;\n }", "void setCryptProviderTypeExt(long cryptProviderTypeExt);", "public String getDataSourceType () {\n return dataSourceType;\n }", "public String getUserType() {\n\t\treturn _userType;\n\t}", "public String getStoreNoList() {\n return storeNoList;\n }", "public String getStore_location()\n {\n \treturn store_location;\n }", "public java.lang.String getProviderType() {\n return this._providerType;\n }", "public String getFromStoreId();", "public int getLocationtypeValue() {\n return locationtype_;\n }", "public Boolean getPayType() {\n return payType;\n }", "void setCryptProviderType(org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum cryptProviderType);", "public int getLocationtypeValue() {\n return locationtype_;\n }", "public String getType() {\r\n\t\treturn productType;\r\n\t}", "public int getType() {\n\t\treturn (config >> 2) & 0x3F;\n\t}", "public void setDBType(String dbType) {\r\n this.dbType = dbType;\r\n }", "public String getUserType() {\n return userType;\n }", "public String getUserType() {\n return userType;\n }", "public String getUserType() {\n return userType;\n }", "public String getUserType() {\n return userType;\n }", "String getSType();", "public String getPaymentType() {\r\n return paymentType;\r\n }", "public String getSystemType() {\n \t\treturn fSystemType;\n \t}", "public java.lang.Long getTradeType () {\r\n\t\treturn tradeType;\r\n\t}", "public String getTRS_TYPE() {\r\n return TRS_TYPE;\r\n }", "public String getPrincipalType(){\n return principalType;\n }", "org.apache.xmlbeans.XmlString xgetCryptProviderTypeExtSource();", "public String getSRcpType() {\n return sRcpType;\n }", "@Override\n\tpublic EnumEStoreId getEStoreId() {\n\t\treturn sale.geteStoreId();\n\t}", "public String getrType() {\n return rType;\n }", "public String getConfigType() {\n\t\treturn configType;\n\t}", "public String getWashType() {\n return (String) getAttributeInternal(WASHTYPE);\n }", "public void setDatabaseType(String databaseType) {\r\n m_databaseType = databaseType;\r\n }", "public String getToStoreId();", "void setCryptProviderTypeExtSource(java.lang.String cryptProviderTypeExtSource);", "public String getType(){\n\t\tif(source==null){\n\t\t\t//it's a domain predicate\n\t\t\treturn \"domain_predicate\";\n\t\t}\n\t\treturn source.getType();\n\t}" ]
[ "0.63951576", "0.6367311", "0.62560767", "0.6049382", "0.60409755", "0.6010959", "0.59380853", "0.5819603", "0.57707304", "0.5724642", "0.57243925", "0.56864136", "0.5680227", "0.56111777", "0.56109786", "0.56109786", "0.56108207", "0.55671966", "0.55671966", "0.55478185", "0.5518227", "0.5513758", "0.5507587", "0.54992443", "0.5496241", "0.5496241", "0.54903966", "0.54434603", "0.5433225", "0.5427808", "0.540345", "0.53409225", "0.53403836", "0.53401303", "0.5338711", "0.5314905", "0.53135353", "0.5296398", "0.5285709", "0.5270954", "0.52499545", "0.52243775", "0.5222411", "0.5221958", "0.52095187", "0.51903", "0.51798683", "0.51795846", "0.5175922", "0.51727635", "0.51474124", "0.51424104", "0.5123247", "0.5120806", "0.5117919", "0.5117456", "0.50875986", "0.5087405", "0.50790924", "0.5077302", "0.5065807", "0.5065757", "0.50647056", "0.50644565", "0.50551635", "0.50549835", "0.50547373", "0.5053471", "0.5053254", "0.5047795", "0.5043733", "0.504153", "0.504051", "0.5018003", "0.50150216", "0.5013964", "0.5000023", "0.4999897", "0.49998572", "0.49994284", "0.49956527", "0.49956527", "0.49956527", "0.49956527", "0.49930707", "0.4977077", "0.496583", "0.49525547", "0.4951928", "0.49452758", "0.4941137", "0.49395552", "0.4938596", "0.49369115", "0.49368036", "0.49340874", "0.49328518", "0.49189666", "0.49153063", "0.4911618" ]
0.7946191
0
Value of "trustStorePassword" parameter.
@Nullable public String getTrustStorePassword() { return trustStorePassword; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getTrustStorePassword() {\n return trustStorePassword;\n }", "public String getTrustStorePassword() {\n return trustStorePassword;\n }", "public void setTrustStorePassword(String trustStorePassword) {\n this.trustStorePassword = trustStorePassword;\n }", "public String getPassword() {\n return getProperty(PASSWORD);\n }", "public String getPassword() {\r\n \t\treturn properties.getProperty(KEY_PASSWORD);\r\n \t}", "public final String getPassword() {\n return properties.get(PASSWORD_PROPERTY);\n }", "public String getKeystorePass() {\n return keystorePass;\n }", "public String getKeyStorePassword() {\n return keyStorePassword;\n }", "public String getKeyStorePassword() {\n return this.keyStorePassword;\n }", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "public java.lang.String getPassword();", "public String getPassword() {\n return (String) getObject(\"password\");\n }", "@Override\n\tpublic String getPass() {\n\t\treturn password;\n\t}", "public String getPassword(){\r\n\t\treturn password;\r\n\t}", "@XmlTransient\n\tpublic String getPassword() {\n\t\treturn password;\n\t}", "public String getRepositoryDatabasePassword(){\n \t\treturn getDecryptedProperty(\"org.sagebionetworks.repository.database.password\");\n \t}", "public String getPassword(){\n\t\treturn this.password;\n\t}", "public String getPassword() {\r\n return this.password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public void setTrustStorePassword(String trustStorePassword) {\n if (!complete) {\n this.trustStorePassword = trustStorePassword;\n } else {\n log.warn(\"Connection Descriptor setter used outside of factory.\");\n }\n }", "public String get_password()\r\n\t{\r\n\t\treturn this.password;\r\n\t}", "public static String specifyApplicationPassword() {\n return holder.format(\"specifyApplicationPassword\");\n }", "public String getPassword() {\n \t\treturn password;\n \t}", "public String getPassword() {\n return password;\r\n }", "public String getPassword() {\n return this.password;\n }", "public String getPassword() {\n return this.password;\n }", "public String getPassword() {\n return this.password;\n }", "public String getPassword() {\n return this.password;\n }", "public String getPassword() {\n return this.password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n\t\treturn password;\r\n\t}", "public String getPassword() {\r\n\t\treturn password;\r\n\t}", "public String getPassword() {\r\n\t\treturn password;\r\n\t}", "public String getPassword() {\r\n\t\treturn password;\r\n\t}", "public String getPassword() {\r\n\t\treturn password;\r\n\t}", "public String getPassword() {\r\n\t\treturn password;\r\n\t}", "public String getPassword()\n \t{\n \t\treturn password;\n \t}", "public String getPassword(){\n \treturn password;\n }", "public String getPassword()\r\n {\r\n return password;\r\n }", "public String getPassword() throws RemoteException;", "public String getPassword()\n {\n return this.password;\n }", "public String getPassword() {\n\t\treturn this.password;\n\t}", "protected static String getKeyStorePassword() {\n Path userHomeDirectory = null;\n if (\"?\".equals(keyStorePassword)) {\n promptForKeystorePassword();\n } else if (keyStorePassword == null || keyStorePassword.isEmpty()) {\n // first try the password file\n try {\n userHomeDirectory = Paths.get(System.getProperty(\"user.home\")).toAbsolutePath();\n } catch (InvalidPathException e) {\n throw new BadSystemPropertyError(e);\n }\n File pwFile = new File(userHomeDirectory.toString(), Constants.PW_FILE_PATH_SEGMENT);\n if (pwFile.isFile()) {\n try {\n String rawPassword = readFileContents(pwFile);\n return EncodingUtils.decodeAndXor(rawPassword);\n } catch (FileNotFoundException | UnsupportedEncodingException e) {\n throw new IllegalArgumentException(\"Password file could not be read\");\n }\n } else {\n promptForKeystorePassword();\n }\n }\n return keyStorePassword;\n }", "public java.lang.String getPassword () {\r\n\t\treturn password;\r\n\t}", "public String getPassword() {\n\treturn password;\n}", "public String getPassword()\n\t{\n\t\treturn this.password;\n\t}", "public String getPassword()\n {\n return password;\n }", "public String getPassword()\n {\n return password;\n }", "public String getPassword() {return password;}", "public final SimpleStringProperty passwordProperty() {\n return password;\n }", "public String getPasspwd() {\n return passpwd;\n }", "public String getPassword() {\n\t\treturn password;\n\t}", "public String getPassword() {\n\t\treturn password;\n\t}", "public String getPassword() {\n\t\treturn password;\n\t}", "public String getPassword() {\n\t\treturn password;\n\t}", "public String getPassword() {\n\t\treturn password;\n\t}", "public String getPassword() {\n\t\treturn password;\n\t}", "public String getPassword() {\n\t\treturn password;\n\t}", "public String getPassword() {\n\t\treturn password;\n\t}", "public String getPassword() {\n\t\treturn password;\n\t}", "public String getPassword() {\n\t\treturn password;\n\t}", "public String getPassword() {\n\t\treturn password;\n\t}", "public String getPassword() {\n\t\treturn password;\n\t}", "public String getPassword() {\n\t\treturn password;\n\t}", "public String getPassword() {\n return password;\n }", "public String getPassword()\r\n {\r\n return password;\r\n }", "public String getPassword(){\n return password;\n\t}", "public java.lang.String getPassword() {\r\n return password;\r\n }", "public java.lang.String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }" ]
[ "0.77743566", "0.77743566", "0.72652555", "0.7089529", "0.7048467", "0.6995747", "0.6955806", "0.6894632", "0.6886993", "0.68667746", "0.68667746", "0.68667746", "0.68667746", "0.68667746", "0.68667746", "0.68667746", "0.6849753", "0.68133444", "0.677294", "0.674564", "0.67433524", "0.6701923", "0.6692661", "0.6686872", "0.6686802", "0.6670985", "0.6659142", "0.6657129", "0.66569024", "0.66492504", "0.66403544", "0.66403544", "0.66403544", "0.66403544", "0.66403544", "0.66398764", "0.66398764", "0.66384065", "0.66384065", "0.66384065", "0.66384065", "0.66384065", "0.66384065", "0.66384065", "0.66384065", "0.66384065", "0.66384065", "0.66384065", "0.66348916", "0.66348916", "0.66348916", "0.66348916", "0.66348916", "0.66348916", "0.66347903", "0.6631551", "0.66244847", "0.6615284", "0.661527", "0.66126287", "0.6608456", "0.6606352", "0.66033256", "0.6603221", "0.6602515", "0.6602515", "0.6600073", "0.65994334", "0.6595444", "0.658875", "0.658875", "0.658875", "0.658875", "0.658875", "0.658875", "0.658875", "0.658875", "0.658875", "0.658875", "0.658875", "0.658875", "0.658875", "0.6582886", "0.65827733", "0.65808123", "0.6578567", "0.6578567", "0.6578302", "0.6578302", "0.6578302", "0.6578302", "0.6578302", "0.6578302", "0.6578302", "0.6578302", "0.6578302", "0.6578302", "0.6578302", "0.6578302", "0.6578302" ]
0.7643762
2
Value of "disableNameChecking" parameter.
public boolean isDisableNameChecking() { return disableNameChecking; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setDisableNameValidation(boolean tmp) {\n this.disableNameValidation = tmp;\n }", "public void setDisableNameValidation(String tmp) {\n this.disableNameValidation = DatabaseUtils.parseBoolean(tmp);\n }", "public boolean getDisableNameValidation() {\n return disableNameValidation;\n }", "public boolean isNameChangeable() {\n\t\treturn false;\n\t}", "public void disableComponent(String name);", "public boolean checkName(String name)\n {\n return true;\n }", "@Override\r\n public boolean isNameProperty() throws Exception\r\n {\n return false;\r\n }", "@Override\n public boolean hasCustomName() {\n return false;\n }", "public String getForceName();", "@LogMessage(level = WARN)\n @Message(value = \"Could not find configuration [%s]; using defaults.\", id = 20002)\n void unableToFindConfiguration(String name);", "default String getCheckName() {\n return getClass().getSimpleName();\n }", "private Checking(String name) {\r\n\t\tsuper(name);\r\n\t}", "static public boolean isSanitaryName(String name) {\n return sanitizeName(name).equals(name);\n }", "@Override\n public boolean getAllowPrivateNameConflicts()\n {\n \treturn allowPrivateNameConflicts;\n }", "public String getInvalidName() {\n return invalidName;\n }", "void unsetName();", "@Override\n\tpublic boolean hasCustomName() {\n\t\treturn false;\n\t}", "public void disable ( ) {\r\n\t\tenabled = false;\r\n\t}", "private boolean isNameValid(String name) {\n\n }", "public abstract String filterLibraryName(final String name);", "protected boolean isExcluded(String name) {\r\n return (this.excludeRE == null) ? false : this.excludeRE.match(name);\r\n }", "protected void check(String name, Object value) {\n\t\tcheck(name,value,false);\n\t}", "public void setIgnoreNamePattern(Pattern pattern) {\n ignoreNamePattern = pattern;\n }", "public final void testNoName() {\n testTransaction1.setName(\"\");\n assertFalse(testTransaction1.isValidTransaction());\n }", "public void setInternalName(String name);", "public void disable()\r\n\t{\r\n\t\tenabled = false;\r\n\t}", "void disable() {\n }", "public void setInvalidName(String invalidName) {\n this.invalidName = invalidName;\n }", "public boolean shouldUseRawName() {\n return chkUseRawName.isChecked();\n }", "public void disableFilter(String filterName)\n {\n session.disableFilter(filterName);\n }", "public void onDisable() {\r\n }", "@DSComment(\"Package priviledge\")\n @DSBan(DSCat.DEFAULT_MODIFIER)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:56:28.372 -0500\", hash_original_method = \"E4C63287FA81E5CD749A3DF00B7871AE\", hash_generated_method = \"A395ADC766F313790DA998F5853068A3\")\n \n void nameChanged(String newName){\n \t//Formerly a native method\n \taddTaint(newName.getTaint());\n }", "public void onDisable() {\n }", "public void onDisable() {\n }", "public static boolean isExplicitUnusedVarName(String name) {\n return name.startsWith(\"ignored\")\n || name.startsWith(\"unused\")\n || \"_\".equals(name); // before java 9 it's ok\n }", "String removeEdible(String name);", "@Test\r\n\tpublic void testNameInvalid() {\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"*\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"-\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"0-\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"324tggs\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"-feioj\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"/\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\"@\"));\r\n\t\tassertFalse(Activity5Query.isNameCorrect(\" \"));\r\n\t}", "public void onDisable() {\n }", "public void onDisable()\n {\n }", "private boolean checkName(String name) {\n if (!name.equals(\"\")) {\n //Check si le nom est déjà utilisé\n return myDbA.checkName(name);\n }\n return false;\n }", "public boolean isVerifyingNames() {\n return verifyNames;\n }", "public void setRealName(Boolean realName) {\n this.realName = realName;\n }", "public void set_name(String name) throws Exception{\n\t\tthis.name = name;\n\t}", "public void set_name(String name) throws Exception{\n\t\tthis.name = name;\n\t}", "private void setExcludeUnlistedClasses(String value) {\n if (!_excludeUnlistedSet) {\n BigDecimal version = getPersistenceVersion();\n boolean excludeUnlisted;\n if (version.compareTo(VERSION_1_0) > 0) {\n excludeUnlisted = !(\"false\".equalsIgnoreCase(value));\n } else {\n excludeUnlisted = \"true\".equalsIgnoreCase(value);\n }\n _info.setExcludeUnlistedClasses(excludeUnlisted);\n _excludeUnlistedSet = true;\n }\n }", "public void setDisabled() {\n\t\tdisabled = true;\n\t}", "@Override\n public boolean isRename() {\n return false;\n }", "public String getUnlessName()\n {\n return (String) getAttributes().get(ATTR_UNLESS_NAME);\n }", "@Override\n public void onProviderDisabled(String s) {\n }", "@Override\n public void onProviderDisabled(String s) {\n }", "public void disable();", "@Override\n\tpublic void onDisable() {\n\t\t\n\t}", "public static void checkWithoutSpecialChars(String name) throws SpecialCharsNotAllowedException{ \n \n if(!name.matches(\"^[0-9 \\\\p{L}]*$\")) throw new SpecialCharsNotAllowedException(\"The special chars in the name of entity are not allowed!\");\n }", "@Test\n\tpublic void VerifyRoomNameUpdateIsDisable() {\n\t\t\t\t\n\t\tLoginPage loginPage = new LoginPage(driver);\n\t\t\n\t\tHomePage homePage = loginPage\n\t\t\t\t.setCredentials()\n\t\t\t\t.clickSignInButton();\n\t\t\n\t\tConferenceRoomPage conferenceRoomPage = homePage\n\t\t\t\t.selectConferenceRoomsLink();\n\t\t\n\t\tRoomInfoPage updateRoomName = conferenceRoomPage\n\t\t\t\t.doubleClickOnRoom(roomSelected);\n\t\t\n\t\tupdateRoomName.setDisplayNameRoom(roomSelected);\n\t\t\n\t\tboolean IsDisabled = updateRoomName.RoomNameIsDisable();\n\t\t\n\t\tAssert.assertEquals( IsDisabled, true,msgError);\n\t\t\n\t\tupdateRoomName.clickButtonCancelInfoRoom();\n\t}", "default void onDisable() {}", "public Boolean checkDisabled() {\r\n\t\treturn searchRepository.checkDisabled();\r\n\t}", "@Override\r\n\tpublic void onDisable() {\n\t}", "public boolean isBname() {\n return Bname;\n }", "public void setShEnabledDisabled(String val) {\n\n\t\tshEnabledDisabled = val;\n\n\t}", "@Override\n public void onDisable() {\n }", "@Override\n\tpublic boolean checkRoleName(String role_name) {\n\t\treturn false;\n\t}", "@Override\n\tpublic void onDisable() {\n\n\t}", "public abstract void Disabled();", "public Component playerHasNotSlept(String name) {\n return MiniMessage.get().parse(MessageFormat.format(playerHasNotSlept, name));\n }", "public void setName(final String pName){this.aName = pName;}", "boolean isNameRequired();", "@Override\n\tpublic String disable() throws Throwable {\n\t\treturn null;\n\t}", "String noExt(String name) {\r\n int last=name.lastIndexOf(\".\");\r\n if(last>0)\r\n return name.substring(0, last);\r\n\r\n return name;\r\n }", "private void enableDisable() {\n fixDisplayName.setEnabled(automaticFix.isSelected());\n }", "public void unsetName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(NAME$2);\r\n }\r\n }", "public boolean whiteCheck() {\n\t\treturn false;\n\t}", "public void setBname(boolean bname) {\n this.Bname = bname;\n }", "default void checkInOk(String name) {\n }", "public void set_Name(String name) {\n\t\tthis.name = name;\n\t}", "public static String getNameFilter() {\r\n return nameFilter;\r\n }", "public String cleanEnchantmentName(String name){\n\t\treturn getConfig().getString(name);\n\t}", "public void disable() {\n \t\t\tsetEnabled(false);\n \t\t}", "public ContainsNamedTypeChecker(String name) {\n myNames.add(name);\n }", "private void assertFalse(String name, boolean result) {\n assertTrue(name, ! result);\n }", "@Override\n public String getName() {\n return null;\n }", "public void setDetectionName(String detectionName) {\r\n this.detectionName = detectionName;\r\n }", "public void setCheckedName(String name) {\n \n boolean checked = true;\n setCheckedName(name, checked);\n }", "public static boolean checkName(String name) {\r\n\t\tboolean result = false;\r\n\t\tif (check(name) && name.matches(CommandParameter.REG_EXP_NAME)) {\r\n\t\t\tresult = true;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "void disable();", "void disable();", "private boolean validNames(String whiteName, String blackName){\n return whiteName.length() > 0 && blackName.length() > 0 &&\n !whiteName.equalsIgnoreCase(blackName);\n }", "public boolean exsitName(String name) {\n\t\tKynamic kynamic = this.kynamicDao.getKynamicByName(name);\r\n\t\treturn kynamic!=null?true:false;\r\n\t}", "public void setName(String name) {\n if (!name.equals(\"\")) {\r\n this.name = name;\r\n }\r\n\r\n\r\n\r\n\r\n }", "@Override\n public void onDisabled() {\n }", "@Override\n public String getName() {\n return null;\n }", "@Override\n public String getName() {\n return null;\n }", "@Override\n public String getName() {\n return null;\n }", "public void setDPAutorName(String value){\n\t\tthis.m_bIsDirty = (this.m_bIsDirty || (!value.equals(this.m_sDPAutorName)));\n\t\tthis.m_sDPAutorName=value;\n\t}", "public static String no() {\n\t\treturn \"allowusersetup no\" + delimiter + \"allowusersetup no \";\n\t}", "private boolean isInternal(String name) {\n return name.startsWith(\"java.\")\n || name.startsWith(\"javax.\")\n || name.startsWith(\"com.sun.\")\n || name.startsWith(\"javax.\")\n || name.startsWith(\"oracle.\");\n }", "@Override\n public void onProviderDisabled(String arg0) {\n\n }", "public Boolean getRealName() {\n return realName;\n }", "private void assertFalse(String name, boolean result) {\n assertTrue(name, !result);\n }", "public static void setDisabled(boolean _disabled) {\r\n disabled = _disabled;\r\n }", "@Test\n public void testIsEmptyValidName() {\n FieldVerifier service = new FieldVerifier();\n String name = \"\";\n boolean result = service.isValidName(name);\n assertEquals(false, result);\n }" ]
[ "0.77737534", "0.748435", "0.74309653", "0.6129056", "0.6081032", "0.5970513", "0.57709634", "0.56159693", "0.5517515", "0.55059665", "0.55007976", "0.5492668", "0.5461931", "0.54598075", "0.54327613", "0.5425303", "0.54223186", "0.538742", "0.5384745", "0.53826267", "0.5340292", "0.53384167", "0.53317744", "0.52980334", "0.5292186", "0.5288109", "0.52837956", "0.52766293", "0.52540326", "0.5201016", "0.52008355", "0.5199184", "0.51905686", "0.51905686", "0.51844037", "0.5180315", "0.5178762", "0.5164468", "0.5163723", "0.51498854", "0.5149875", "0.5146981", "0.5145322", "0.5145322", "0.5142734", "0.5130297", "0.51296574", "0.5128134", "0.51200664", "0.51200664", "0.5114824", "0.51147133", "0.5114656", "0.5114561", "0.5108265", "0.5106966", "0.5096856", "0.50960314", "0.5095234", "0.5094388", "0.50774854", "0.50755674", "0.5058246", "0.50524634", "0.5052205", "0.5051503", "0.5047231", "0.50461924", "0.50445735", "0.5043476", "0.50091815", "0.5008563", "0.50033736", "0.5000538", "0.4993506", "0.49919993", "0.49862114", "0.49851307", "0.49834424", "0.4982111", "0.4979101", "0.49767706", "0.4974865", "0.49736133", "0.49736133", "0.49728552", "0.49701434", "0.49664238", "0.4965556", "0.49642852", "0.49642852", "0.49642852", "0.49620968", "0.4959871", "0.49568644", "0.49564052", "0.49553174", "0.49552992", "0.49545556", "0.49541742" ]
0.81808305
0
Value of "username" parameter.
@Nullable public String getUsername() { return username; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "java.lang.String getUsername();", "String getUsername();", "String getUsername();", "String getUsername();", "String getUsername();", "String getUsername();", "String getUsername();", "public String getUsername() { return this.username; }", "public String getUsername(){\r\n\t\treturn username;\r\n\t}", "public String getUsername()\r\n {\r\n return this.username; \r\n }", "public String getUsername() {\r\n return this.username;\r\n }", "public String getUsername() {return username;}", "String getUserUsername();", "public String getUsername() {\r\n return username;\r\n }", "public String getUsername() {\r\n return username;\r\n }", "public String get_username()\r\n\t{\r\n\t\treturn this.username;\r\n\t}", "public String getUsername()\r\n\t{\r\n\t\treturn username;\r\n\t}", "public String getUsername()\r\n {\r\n return username;\r\n }", "public String getUsername() {\n return username;\r\n }", "public String getUsername() {\r\n return username;\r\n }", "public String getUsername() {\r\n return username;\r\n }", "public String getUsername() {\r\n return username;\r\n }", "public String getUsername() {\r\n return username;\r\n }", "public String getUsername() {\r\n return username;\r\n }", "public String getUsername() {\r\n return username;\r\n }", "public String getUsername() {\r\n return username;\r\n }", "public String getUsername() {\r\n return username;\r\n }", "public String getUsername() {\r\n return username;\r\n }", "public String getUsername() {\r\n return username;\r\n }", "public String getUsername() {\r\n return username;\r\n }", "public String getUsername(){\r\n return this.username;\r\n }", "public String getUsername()\n {\n return this.username;\n }", "public String getUsername()\n {\n return this.username;\n }", "public String getUsername() {\n return this.username;\n }", "public String getUsername() {\n return this.username;\n }", "public String getUsername() {\n return this.username;\n }", "public String getUsername()\n\t{\n\t\treturn username;\n\t}", "public String getUsername(){\n return this.username;\n }", "public String getUsername() {\n \t\treturn username;\n \t}", "public String getUsername() {\n return username;\n }", "public final void setUsername(final String value) {\n username = value;\n }", "public String getUsername() {\n\treturn username;\n}", "public String getUsername()\n {\n return username;\n }", "public String getUsername()\n {\n return username;\n }", "public void setUsername(String username) {this.username = username;}", "public String getUsername() {\r\n\t\treturn username;\r\n\t}", "public String getUsername() {\r\n\t\treturn username;\r\n\t}", "public String getUsername() {\r\n\t\treturn username;\r\n\t}", "public String getUsername() {\r\n\t\treturn username;\r\n\t}", "public String getUsername() {\r\n\t\treturn username;\r\n\t}", "@Override\r\n\tpublic String getUsername() {\n\t\treturn username;\r\n\t}", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "public String getUsername() {\n return username;\n }", "@Override\n\tpublic String getUsername() {\n\t\treturn username;\n\t}", "@Override\n\tpublic String getUsername() {\n\t\treturn username;\n\t}", "public String getUsername() {\n\t\treturn this.username;\n\t}", "@Override public String getUsername()\r\n {\r\n return username;\r\n }", "public void setUsername(java.lang.CharSequence value) {\n this.username = value;\n }", "public String getUsername() {\n return username;\n }" ]
[ "0.8023128", "0.8023128", "0.8023128", "0.8023128", "0.8023128", "0.8023128", "0.8023128", "0.8023128", "0.8023128", "0.7791684", "0.7791684", "0.7791684", "0.7791684", "0.7791684", "0.7791684", "0.7704567", "0.7695465", "0.76543665", "0.76504296", "0.7626962", "0.7612742", "0.7611904", "0.7611904", "0.76068604", "0.7606078", "0.76022786", "0.7586155", "0.7568095", "0.7568095", "0.7568095", "0.7568095", "0.7568095", "0.7568095", "0.7568095", "0.7568095", "0.7568095", "0.7568095", "0.7568095", "0.7559283", "0.7555346", "0.7555346", "0.75437415", "0.75437415", "0.75437415", "0.75401384", "0.7535899", "0.75289273", "0.75094634", "0.7495674", "0.7490274", "0.74822545", "0.74822545", "0.7469082", "0.745576", "0.745576", "0.745576", "0.745576", "0.745576", "0.7454536", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7451679", "0.7442493", "0.7442493", "0.7437264", "0.74303347", "0.74148124", "0.7414184" ]
0.0
-1
Value of "password" parameter.
@Nullable public String getPassword() { return password; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "public java.lang.String getPassword();", "public String getPassword() {return password;}", "public String getPassword();", "public String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "public String getPassword() { \n return this.password; \n }", "public String getPassword(){\n return password;\n\t}", "public String getPassword()\r\n {\r\n return password;\r\n }", "public String getPassword(){\r\n\t\treturn password;\r\n\t}", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword()\r\n {\r\n return password;\r\n }", "String getUserPassword();", "public String getPassword()\r\n {\r\n return password;\r\n }", "public String getPassword(){\n \treturn password;\n }", "public String getPassword(){\n return this.password;\n }", "@Override\n\tpublic String getPass() {\n\t\treturn password;\n\t}", "@Override public String getPassword()\r\n {\r\n return password;\r\n }", "public String getPassword() {\n return password;\r\n }", "public String getPassword() {\r\n return this.password;\r\n }", "public String getPassword()\n {\n return password;\n }", "public String getPassword()\n {\n return password;\n }", "public String getPassword() {\n\treturn password;\n}", "@Override\n public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword()\n {\n return this.password;\n }", "public void setPassword(String pass);", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword()\n {\n return password;\n }", "public String getPassword()\n {\n return password;\n }", "public String getPassword(){\n\t\treturn this.password;\n\t}", "@Override\n public String getPassword() {\n return password;\n }", "public String getPassword() {\n return this.password;\n }", "public String getPassword() {\n return this.password;\n }", "public String getPassword() {\n return this.password;\n }", "public String getPassword() {\n return this.password;\n }", "public String getPassword() {\n return this.password;\n }", "public String getPassword()\n \t{\n \t\treturn password;\n \t}", "public String get_password()\r\n\t{\r\n\t\treturn this.password;\r\n\t}", "@Override\n\tpublic String getPassword() {\n\t\treturn password;\n\t}", "@Override\n\tpublic String getPassword() {\n\t\treturn password;\n\t}", "@Override\n\tpublic String getPassword() {\n\t\treturn password;\n\t}", "public String getPassword()\n {\n return _password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }" ]
[ "0.84907496", "0.84907496", "0.84907496", "0.84907496", "0.84907496", "0.84907496", "0.84907496", "0.8451084", "0.838263", "0.83732826", "0.83732826", "0.8348186", "0.8348186", "0.8348186", "0.8348186", "0.8348186", "0.8348186", "0.8348186", "0.8348186", "0.8348186", "0.8189117", "0.818425", "0.8182304", "0.8179486", "0.81746256", "0.8163978", "0.81545806", "0.81428856", "0.81265974", "0.8126035", "0.8119612", "0.811462", "0.81097746", "0.8107997", "0.81026524", "0.81026524", "0.810152", "0.810126", "0.8100612", "0.8100612", "0.80955565", "0.80913675", "0.80761933", "0.80761933", "0.80761933", "0.80761933", "0.80761933", "0.80761933", "0.80761933", "0.80761933", "0.80761933", "0.80761933", "0.80761933", "0.806682", "0.806682", "0.80357945", "0.8026968", "0.8011805", "0.8011805", "0.8011805", "0.8011805", "0.8011805", "0.8006263", "0.80029935", "0.7994095", "0.7994095", "0.7994095", "0.7982334", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856", "0.7974856" ]
0.0
-1
Value of "method" parameter.
@Nullable @NotEmpty public String getMethod() { return StringSupport.trimOrNull(method); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getMethodValue() {\n return method_;\n }", "public int getMethodValue() {\n return method_;\n }", "int getMethodValue();", "public int getMethod(){\n return method;\n }", "public String getMethod() {\n\t\treturn getParameter(\"method\");\n\t}", "public String getMethod ()\n {\n return method;\n }", "String getMethod();", "String getMethod();", "public Method getMethod () {\n\t\treturn method;\n\t}", "protected Method getMethod() {\n return method;\n }", "public String getMethod() {\n return method;\n }", "public String getMethod() {\n return method;\n }", "public String getMethod() {\n return method;\n }", "public Method getMethod() {\n return method;\n }", "public Method getMethod() {\n return method;\n }", "public Method getMethod() {\n\t\treturn method;\n\t}", "public String getMethod() {\n\t\treturn method;\n\t}", "MethodName getMethod();", "public Method getMethod();", "Method getMethod();", "Method getMethod();", "public String getMethod() {\n\n return this.method;\n }", "Methodsig getMethod();", "public Method getMethod() {\n return mMethod;\n }", "public Method method() {\n return method;\n }", "public String getMethod() {\n\t\t\treturn method;\n\t\t}", "@Override\n public String getMethod() {\n return METHOD_NAME;\n }", "public InputMethod getMethod() {\n return method;\n }", "ClassMember getMethod () { return method; }", "public HttpMethod method() {\n return method;\n }", "public void setMethod(String method) {\r\n this.method = method;\r\n }", "public Param getProcessingMethod();", "public HttpMethod method() {\n\t\treturn method;\n\t}", "public HttpMethod getMethod()\r\n/* 29: */ {\r\n/* 30:56 */ return this.method;\r\n/* 31: */ }", "private String getName() {\n return method.getName();\n }", "@Nullable\n abstract Method getMethod();", "public HttpMethod getMethod() {\n return method;\n }", "public void setMethod(Method method) {\n this.method = method;\n }", "public java.lang.reflect.Method getMethod()\n {\n return __m_Method;\n }", "@Override\n\t\tpublic String getMethod() {\n\t\t\treturn null;\n\t\t}", "protected String getParameter() {\r\n return this.parameter;\r\n }", "public String getMethod()\n {\n if (averageRating == null) {\n return \"\";\n } else {\n return averageRating.getMethod();\n }\n }", "ValuationMethod getValuationMethod();", "@JsonIgnore\n public java.lang.reflect.Method getMethod() {\n return this.method;\n }", "public String getValue() {\n return getMethodValue(\"value\");\n }", "public Value getValue()\r\n\t{\r\n\t\treturn paramValue;\r\n\t}", "public Method getMethod() {\n\t\treturn this.currentAction.getMethod();\n\t}", "Parameter getParameter();", "public String getMethodName() {\r\n return _methodName;\r\n }", "String getMethodName();", "String getMethodName();", "String getCalled();", "@Override\n public String getMethodName() {\n return null;\n }", "public String getMethodName() {\n return methodName;\n }", "public String getMethodName() {\n return methodName;\n }", "public static Method getMethod(String method) throws IllegalArgumentException {\n/* 119 */ return getMethod(method, false);\n/* */ }", "public StrColumn getMethod() {\n return delegate.getColumn(\"method\", DelegatingStrColumn::new);\n }", "public String getMethodName() {\n\t\treturn this.methodName;\n\t}", "public String getMethodName() {\n\t\treturn this.methodName;\n\t}", "public HttpMethod getMethod()\r\n/* 44: */ {\r\n/* 45: 78 */ return HttpMethod.valueOf(this.servletRequest.getMethod());\r\n/* 46: */ }", "@SuppressWarnings(\"hiding\")\n @Override\n public void setMethod(String method) {\n this.method = method;\n }", "public String getParam() {\n return param;\n }", "public String getParam() {\n return param;\n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "public void method(){}", "void updateMethod(Method method);", "@Override\n\tpublic void VisitMethodCallNode(MethodCallNode Node) {\n\n\t}", "public String getMethodName() {\n\t\treturn methodName;\n\t}", "public HttpMethod getMethod()\r\n/* 31: */ {\r\n/* 32:60 */ return HttpMethod.valueOf(this.httpRequest.getMethod());\r\n/* 33: */ }", "public Builder setMethodValue(int value) {\n method_ = value;\n onChanged();\n return this;\n }", "public String getRequestMethod(){\n return this.requestMethod;\n }", "java.lang.String getParameterValue();", "public void setMethod(String method)\r\n {\r\n routing_method=method;\r\n }", "public HTTPRequestMethod getMethod();", "java.lang.String getMethodName();", "java.lang.String getMethodName();", "java.lang.String getMethodName();", "java.lang.String getMethodName();", "public String getMethod(String request) {\n return request.split(\" \")[0];\n }", "public void setMethod(String newValue);", "public synchronized void setMethod(int whatMethod) {\n method = whatMethod;\n }", "public Method getActionMethod() {\n return this.method;\n }", "public String toString() {\n\t\treturn methodName;\n\t}", "public AnalysisMethod getAnalysisMethod() {\n return method;\n }", "public String getRequestMethod()\n {\n return requestMethod;\n }", "public void setMethod(String method) {\n this.method = method == null ? null : method.trim();\n }", "public void setMethod(String method) {\n this.method = method == null ? null : method.trim();\n }", "private String parseMethod() {\n\t\tString[] splitted = command.split(\":\", 2);\n\t\tif (splitted.length == 1) {\n\t\t\treturn splitted[0];\n\t\t} else {\n\t\t\treturn splitted[1] + splitted[0].substring(0, 1).toUpperCase() + splitted[0].substring(1);\n\t\t}\n\t}", "void setMethod (ClassMember m) { method = m; }", "public Object getParam() {\n return param;\n }", "public void simulateMethod(SootMethod method, ReferenceVariable thisVar, ReferenceVariable returnVar,\n ReferenceVariable params[]) {\n\n String subSignature = method.getSubSignature();\n\n if (subSignature.equals(\"java.lang.Object getObjectFieldValue(java.lang.Object,long)\")) {\n java_io_ObjectOutputStream_getObjectFieldValue(method, thisVar, returnVar, params);\n return;\n\n } else {\n defaultMethod(method, thisVar, returnVar, params);\n return;\n\n }\n }", "@Override\n\tpublic int method() {\n\t\treturn 0;\n\t}", "public String getMethodName() {\n\t\t\treturn methodName;\n\t\t}", "public abstract RlcpMethod getMethod();", "public abstract PredictionMethod getMethod();", "protected ResourceMethod getMethod( int theMethodIndex ) {\r\n\t\tConditions.checkParameter( theMethodIndex >= 0 && theMethodIndex < methods.length, \"theMethodIndex\", \"The specific method index is not within range.\" );\r\n\t\t\r\n\t\treturn methods[ theMethodIndex ];\r\n\t}", "public Method getTestMethod()\r\n {\r\n return method.getMethod();\r\n }", "private void isMethod(Context isParameter) {\n try {\n MediaPlayer isVariable = isNameExpr.isMethod(isNameExpr, isNameExpr.isFieldAccessExpr.isFieldAccessExpr);\n isNameExpr.isMethod();\n isNameExpr.isMethod(isIntegerConstant);\n isNameExpr.isMethod();\n isNameExpr.isMethod();\n } catch (Exception isParameter) {\n isNameExpr.isMethod(isNameExpr, isNameExpr.isMethod());\n }\n }", "public MethodProxy getMethod() {\n\t\treturn null;\n\t}", "@Override\n public int getMethod() {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"b89def63-26ff-4cb0-98cc-9b6cee3e0e29\");\n return method;\n }" ]
[ "0.78953946", "0.776894", "0.774711", "0.7566115", "0.73524916", "0.71987516", "0.6933109", "0.6933109", "0.6912361", "0.69104815", "0.6830101", "0.6830101", "0.6830101", "0.68279654", "0.68279654", "0.680791", "0.6806998", "0.678231", "0.6775532", "0.67336583", "0.67336583", "0.6671023", "0.66530675", "0.66484076", "0.66346556", "0.65911174", "0.6586788", "0.6579428", "0.65692824", "0.6499388", "0.64597696", "0.64229256", "0.6404312", "0.63108927", "0.62767917", "0.6227864", "0.622407", "0.62231076", "0.617449", "0.6157549", "0.6152401", "0.6149196", "0.61458886", "0.6132203", "0.6082463", "0.60603094", "0.60419005", "0.6025202", "0.6020547", "0.6007813", "0.6007813", "0.59950393", "0.59924334", "0.5985636", "0.5985636", "0.5980091", "0.5942725", "0.591265", "0.591265", "0.5911539", "0.59030294", "0.5901578", "0.5901578", "0.5898511", "0.5864781", "0.5862989", "0.5845756", "0.58370954", "0.58300334", "0.58274215", "0.5817179", "0.5784715", "0.5778782", "0.57729715", "0.5768924", "0.5768924", "0.5768924", "0.5768924", "0.5740356", "0.57371265", "0.57277524", "0.5726975", "0.57144386", "0.5710321", "0.57012534", "0.56758875", "0.56758875", "0.56618625", "0.56616116", "0.5653817", "0.5639719", "0.5638535", "0.563561", "0.5633815", "0.5629803", "0.56281406", "0.5614432", "0.5608203", "0.5594907", "0.5593003" ]
0.6285606
34
Compute the full URL to connect to.
@Nonnull public URL buildURL() throws MalformedURLException { installTrustStore(); if (disableNameChecking) { final HostnameVerifier allHostsValid = new HostnameVerifier() { public boolean verify(final String hostname, final SSLSession session) { return true; } }; HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid); } final StringBuilder builder = new StringBuilder(getURL()); if (getPath() != null) { builder.append(getPath()); } return new URL(doBuildURL(builder).toString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getURL() {\n\t return getURL(BackOfficeGlobals.ENV.NIS_USE_HTTPS, BackOfficeGlobals.ENV.NIS_HOST, BackOfficeGlobals.ENV.NIS_PORT);\n\t}", "public String url() {\n return server.baseUri().toString();\n }", "public String getBaseUrl() {\n StringBuffer buf = new StringBuffer();\n buf.append(getScheme());\n buf.append(\"://\");\n buf.append(getServerName());\n if ((isSecure() && getServerPort() != 443) ||\n getServerPort() != 80) {\n buf.append(\":\");\n buf.append(getServerPort());\n }\n return buf.toString();\n }", "public String getEasyCoopURI() {\r\n String uri = \"\";\r\n\r\n try {\r\n javax.naming.Context ctx = new javax.naming.InitialContext();\r\n uri = (String) ctx.lookup(\"java:comp/env/easycoopbaseurl\");\r\n //BASE_URI = uri; \r\n } catch (NamingException nx) {\r\n System.out.println(\"Error number exception\" + nx.getMessage().toString());\r\n }\r\n\r\n return uri;\r\n }", "private String makeServerUrl(){\n\t\tURL url = null;\n\t\t\n\t\t//Make sure we have a valid url\n\t\tString complete = this.preferences.getString(\"server\", \"\");\n\t\ttry {\n\t\t\turl = new URL( complete );\n\t\t} catch( Exception e ) {\n\t\t\tonCreateDialog(DIALOG_INVALID_URL).show();\n\t\t\treturn null;\n\t\t}\n\t\treturn url.toExternalForm();\n\t}", "public String getURL()\n {\n return getURL(\"http\");\n }", "String getServerUrl();", "private String getURL() {\n\t\t// TODO : Generate URL\n\t\treturn null;\n\t}", "private static String getBaseUrl() {\n StringBuilder url = new StringBuilder();\n url.append(getProtocol());\n url.append(getHost());\n url.append(getPort());\n url.append(getVersion());\n url.append(getService());\n Log.d(TAG, \"url_base: \" + url.toString());\n return url.toString();\n }", "public String getFullHost() {\n return \"http://\" + get(HOSTNAME_KEY) + \":\" + get(PORT_KEY) + \"/\" + get(CONTEXT_ROOT_KEY) + \"/\";\n }", "public String getServerUrl() {\r\n return this.fedoraBaseUrl;\r\n }", "private String get_url() {\n File file = new File(url);\n return file.getAbsolutePath();\n }", "public String getServerURI() {\n return settings.getString(\"server_url\", DEFAULT_SERVER_URL);\n }", "public String getServerUrl() {\n return props.getProperty(\"url\");\n }", "public String getURL(){\r\n\t\tString url = \"rmi://\";\r\n\t\turl += this.getAddress()+\":\"+this.getPort()+\"/\";\r\n\t\treturn url;\r\n\t}", "public final String getUrl() {\n return properties.get(URL_PROPERTY);\n }", "public static String getBaseURL()\r\n {\r\n String savedUrl = P.getChoreoServicesUrl();\r\n return savedUrl.length() > 0 ? savedUrl : Config.DEFAULT_SERVER_URL;\r\n }", "public static String getURLRedirect(){\n\t\treturn \"https://54.247.74.173:8443\";\r\n\t}", "private String baseUrl() {\n return \"http://\" + xosServerAddress + \":\" +\n Integer.toString(xosServerPort) + XOSLIB + baseUri;\n }", "public String getConnectionURL (CConnection connection);", "public String getConnectionURL (CConnection connection);", "String url();", "public URL getUrl() {\n try {\n StringBuilder completeUrlBuilder = new StringBuilder();\n completeUrlBuilder.append(getBaseEndpointPath());\n completeUrlBuilder.append(path);\n if (requestType == HttpRequest.NetworkOperationType.GET && parameters != null) {\n boolean first = true;\n for (String key : parameters.keySet()) {\n if (first) {\n first = false;\n completeUrlBuilder.append(\"?\");\n } else {\n completeUrlBuilder.append(\"&\");\n }\n completeUrlBuilder.append(key).append(\"=\").append(parameters.get(key));\n }\n }\n return new URL(completeUrlBuilder.toString());\n } catch (MalformedURLException exception) {\n LocalizableLog.error(exception);\n return null;\n }\n }", "String webSocketUri();", "private String getURL() {\n String url = profileLocation.getText().toString();\n if (url == null || url.length() == 0) {\n return url;\n }\n // if it's not the last (which should be \"Raw\") choice, we'll use the prefix\n if (!url.contains(\"://\")) { // if there is no (http|jr):// prefix, we'll assume it's a http://bit.ly/ URL\n url = \"http://bit.ly/\" + url;\n }\n return url;\n }", "public String getURL() {\n\t\treturn prop.getProperty(\"URL\");\n\t}", "@Override\n public String getUrl() {\n StringBuilder sb = new StringBuilder(baseUrl);\n if (mUrlParams.size() > 0) {\n sb.append(\"?\");\n for (String key : mUrlParams.keySet()) {\n sb.append(key);\n sb.append(\"=\");\n sb.append(mUrlParams.get(key));\n sb.append(\"&\");\n }\n }\n String result = sb.substring(0, sb.length() - 1);\n return result;\n }", "java.net.URL getUrl();", "String getRequestURL();", "public static String getBaseUrl() {\r\n if (baseUrl == null) {\r\n baseUrl = Constants.HTTP_PROTOCOL + \"://\" + getBaseHost() + \":\" + getBasePort();\r\n }\r\n return baseUrl;\r\n }", "String getServerBaseURL();", "public String getURL() {\n\t\treturn RequestConstants.BASE_IMAGE_URL+_url;\n\t}", "public String getLogonURL()\n {\n return getUnsecuredRootLocation() + configfile.logon_url;\n }", "public String getURL(){\r\n\t\t \r\n\t\t\r\n\t\treturn rb.getProperty(\"url\");\r\n\t}", "public static String getBaseUrl(HttpServletRequest request) {\n\t\tif ((request.getServerPort() == 80) || (request.getServerPort() == 443))\n\t\t{\n\t\t\treturn request.getScheme() + \"://\" + request.getServerName();\t\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\treturn request.getScheme() + \"://\" + request.getServerName() + \":\" + request.getServerPort();\n\t\t}\n\t}", "private String getUrlBaseForLocalServer() {\n\t HttpServletRequest request = ((ServletRequestAttributes) \n\t\t\t RequestContextHolder.getRequestAttributes()).getRequest();\n\t String base = \"http://\" + request.getServerName() + ( \n\t (request.getServerPort() != 80) \n\t \t\t ? \":\" + request.getServerPort() \n\t\t\t\t : \"\");\n\t return base;\n\t}", "public String getServiceUrl() {\n return \"http://\" + this.serviceHost + \":\" + this.servicePort;\n }", "public String getUrl() {\n\t\tif (prop.getProperty(\"url\") == null)\n\t\t\treturn \"\";\n\t\treturn prop.getProperty(\"url\");\n\t}", "public static String getAppURL(HttpServletRequest request) {\n\t\tStringBuffer url = new StringBuffer();\n\t\tint port = request.getServerPort();\n\t\tif (port < 0) {\n\t\t\tport = 80; // Work around java.net.URL bug\n\t\t}\n\t\tString scheme = request.getScheme();\n\t\turl.append(scheme);\n\t\turl.append(\"://\");\n\t\turl.append(request.getServerName());\n\t\tif ((scheme.equals(\"http\") && (port != 80))\n\t\t\t\t|| (scheme.equals(\"https\") && (port != 443))) {\n\t\t\turl.append(':');\n\t\t\turl.append(port);\n\t\t}\n\t\turl.append(request.getContextPath());\n\t\treturn url.toString();\n\t}", "public String getHostURL() {\n return getHostURL(PAActiveObject.getActiveObjectNodeUrl(PAActiveObject.getStubOnThis()));\n }", "public String getURL();", "public String getZookeeperUrl() {\n return zookeeper.getHost() + \":\" + zookeeper.getPort();\n }", "Uri getUrl();", "URL getUrl();", "public String getURL() {\r\n\t\treturn dURL.toString();\r\n\t}", "private String getRootUrl() {\n\t\treturn \"http://localhost:\" + port;\n\t}", "private String getRootUrl() {\n\t\treturn \"http://localhost:\" + port;\n\t}", "public URL getEndPoint();", "public String getUrl() {\n Deque<String> urlDeque = (Deque<String>) httpSession.getAttribute( SessionVariable.SESSION_URL_SCOPE );\n return urlDeque.pollFirst();\n }", "String getJoinUrl();", "String getUri( );", "public static String setURL(String endpoint) {\n String url = hostName + endpoint;\n\n log.info(\"Enpoint: \" + endpoint);\n\n return url;\n\n }", "String getBaseUri();", "public String getServerUrl() {\n\t return Config.SERVER_URL;\n }", "String getServiceUrl();", "default HttpUrl getNodeUrl() {\n return HttpUrl.parse(getHost()).newBuilder().port(getPort()).build();\n }", "public String getUrl()\n\t\t{\n\t\t\treturn \"https://www.zohoapis.eu\";\n\t\t}", "private String createUrlWithPort(String gadgetUrl) {\n try {\n URL origUrl = new URL(gadgetUrl);\n URL urlWithPort = null;\n String origHost = origUrl.getHost();\n if (origUrl.getPort() <= 0 && origHost != null && origHost.length() != 0\n && !STAR.equals(origHost)) {\n if (origUrl.getProtocol().equalsIgnoreCase(HTTP)) {\n urlWithPort = new URL(origUrl.getProtocol(), origUrl.getHost(), HTTP_PORT, origUrl.getFile());\n }\n else if (origUrl.getProtocol().equalsIgnoreCase(HTTPS)) {\n urlWithPort = new URL(origUrl.getProtocol(), origUrl.getHost(), HTTPS_PORT, origUrl.getFile());\n }\n return urlWithPort == null ? origUrl.toString() : urlWithPort.toString();\n } else {\n return origUrl.toString();\n }\n } catch (MalformedURLException e) {\n return gadgetUrl;\n }\n }", "public String getCurrentUrlConfig() {\n String primary = AbstractConfigHandler.getPrimaryDataServer();\n if (primary == null) {\n logger.debug(\"No primary dataserver found\");\n urlUnset();\n return null;\n } else {\n String url = addressHandler.getHttpAddress(primary);\n if (url == null) {\n logger.debug(\"No url set for dataserver: \" + primary);\n urlUnset();\n return null;\n } else {\n return verifyHttpProcess(url);\n }\n }\n }", "public static String UrlToHit(){\n\t\treturn BaseURL;\n\t}", "public String getUnproxiedFieldDataServerUrl() {\n\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);\n\t\tString hostName = prefs.getString(\"serverHostName\", \"\");\n\t\tString context = \"bdrs-core\";//prefs.getString(\"contextName\", \"\");\n\t\tString path = prefs.getString(\"path\", \"\");\n\t\t\n\t\tStringBuilder url = new StringBuilder();\n\t\turl.append(\"http://\").append(hostName).append(\"/\").append(context);\n\t\t\n\t\tif (path.length() > 0) {\n\t\t\turl.append(\"/\").append(path);\n\t\t}\n\t\t\n\t\treturn url.toString();\n\t}", "public String determineURL(HttpServletRequest request)\n {\n String url = \"http://\"+request.getHeader(\"host\")+request.getContextPath()+\"/omserver\";\n return url;\n }", "public abstract String getURL();", "public abstract String getBaseURL();", "String constructUrl() {\n StringBuilder builder = new StringBuilder(256);\n builder.append(parts[DB_PREFIX]);\n \n if(notEmpty(parts[DB_ALT_DBNAME])) {\n builder.append(parts[DB_ALT_DBNAME]);\n builder.append('@');\n } else if(\"jdbc:oracle:thin:\".equals(parts[DB_PREFIX])) {\n builder.append('@');\n } else {\n // most formats\n builder.append(\"//\"); // NOI18N\n }\n \n builder.append(parts[DB_HOST]);\n\n if(notEmpty(parts[DB_INSTANCE_NAME])) {\n builder.append('\\\\');\n builder.append(parts[DB_INSTANCE_NAME]);\n }\n \n if(notEmpty(parts[DB_PORT])) {\n builder.append(':'); // NOI18N\n builder.append(parts[DB_PORT]);\n }\n\n if(notEmpty(parts[DB_PRIMARY_DBNAME])) {\n if(\"jdbc:oracle:thin:\".equals(parts[DB_PREFIX])) {\n builder.append(':'); // NOI18N\n } else {\n builder.append('/'); // NOI18N\n }\n builder.append(parts[DB_PRIMARY_DBNAME]);\n }\n\n char propertyInitialSeparator = ';';\n char propertySeparator = ';';\n if(\"jdbc:mysql:\".equals(parts[DB_PREFIX])) {\n propertyInitialSeparator = '?';\n propertySeparator = '&';\n } else if(\"jdbc:informix-sqli:\".equals(parts[DB_PREFIX])) {\n propertyInitialSeparator = ':';\n }\n \n Set<Map.Entry<String, String>> entries = props.entrySet();\n Iterator<Map.Entry<String, String>> entryIterator = entries.iterator();\n if(entryIterator.hasNext()) {\n builder.append(propertyInitialSeparator);\n Map.Entry<String, String> entry = entryIterator.next();\n builder.append(entry.getKey());\n String value = entry.getValue();\n if(notEmpty(value)) {\n builder.append('=');\n builder.append(value);\n }\n }\n \n while(entryIterator.hasNext()) {\n builder.append(propertySeparator);\n Map.Entry<String, String> entry = entryIterator.next();\n builder.append(entry.getKey());\n String value = entry.getValue();\n if(notEmpty(value)) {\n builder.append('=');\n builder.append(value);\n }\n }\n \n return builder.toString();\n }", "public String getProviderUrl() {\n return \"jnp://\".concat(host).concat(\":\").concat(jndiPort.toString());\n }", "public String getServerUrl() {\n return ipAddress;\n }", "public String getThisApplicationUrl() {\n\t\tString tempFileDest = getProperties().getProperty(\"temp.file.dest\").trim();\n\t\tString thisApplicationUrl = null;\n\t\tif(tempFileDest != null && tempFileDest.contains(\"mysunflower\")){\n\t\t\tthisApplicationUrl = getPortalApplicationUrl();\n\t\t}else{\n\t\t\tthisApplicationUrl = getApplicationUrl();\n\t\t}\n\t\treturn thisApplicationUrl;\n\t}", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "public String getApplicationURL()\n\t{\n\t\tString url=pro.getProperty(\"baseURL\");\n\t\treturn url;\n\t}", "public static URL getHostUrl() {\n try {\n String protocol = getRequestsProtocol();\n return new URL(protocol + \"://\" + Controller.request().host());\n } catch (MalformedURLException e) {\n LOGGER.error(\".getHostUrl: couldn't get request's host URL\", e);\n }\n // Should never happen\n return null;\n }", "public final String getURL(final String id) {\n\t\tString url = \"\";\n\t\turl += \"http://\";\n\t\turl += CONFIGURATION.PENTAHO_IP;\n\t\turl += \":\";\n\t\turl += CONFIGURATION.PENTAHO_PORTNUMBER;\n\t\turl += CONFIGURATION.CDASOLUTION_ADDRESS;\n\t\turl += CONFIGURATION.CDA_METHOD;\n\t\turl += \"?\";\n\t\turl += \"solution=\";\n\t\turl += CONFIGURATION.CDA_SOLUTION;\n\t\turl += \"&\";\n\t\turl += \"path=\";\n\t\turl += CONFIGURATION.CDA_PATH.replace(\"/\", \"%2F\");\n\t\turl += \"&\";\n\t\turl += \"file=\";\n\t\turl += CONFIGURATION.CDA_FILEFULLNAME;\n\t\turl += \"&\";\n\t\turl += \"dataAccessId=\";\n\t\turl += id;\n\t\treturn url;\n\t}", "public String getUrl()\n\t\t{\n\t\t\treturn \"https://sandbox.zohoapis.eu\";\n\t\t}", "public String getUriString() {\n return \"mina:\" + getProtocol() + \":\" + getHost() + \":\" + getPort();\n }", "public String getSecureBaseLinkUrl() {\n return (String) get(\"secure_base_link_url\");\n }", "public static String getCurrentURL() {\n\t\treturn driver.getCurrentUrl();\n\t}", "protected String getServerUrl() {\r\n\t\treturn server;\r\n\t}", "private String getOriginUrl() {\n Uri.Builder builder = url.buildUpon();\n for (Param p : queryParams) {\n builder.appendQueryParameter(p.key, p.value);\n }\n return builder.build().toString();\n }", "@Nullable\n public abstract String url();", "public String getCurrentURL()\n\t{\n\t\treturn driver.getCurrentUrl();\n\t}", "public static URL getUrlForLogin()\r\n {\r\n String strUrl = getBaseURL() + \"account_services/api/1.0/account/login\";\r\n return str2url( strUrl );\r\n }", "private static String getHostURL(String url) {\n URI uri = URI.create(url);\n int port = uri.getPort();\n if (port == -1) {\n return uri.getScheme() + \"://\" + uri.getHost() + \"/\";\n } else {\n return uri.getScheme() + \"://\" + uri.getHost() + \":\" + uri.getPort() + \"/\";\n }\n }", "String getRootServerBaseUrl();", "public static String getBaseURI() {\n\t\treturn getIP() + \":\" + getPort();\r\n//\t\tURIBuilder builder = new URIBuilder();\r\n//\t\tbuilder.setScheme(\"http\");\r\n//\t\tbuilder.setHost(getIP());\r\n//\t\tbuilder.setPort(Integer.valueOf(getPort()));\r\n//\t\tbuilder.setPath(\"/\"+getVersion());\r\n//\t\treturn builder.toString();\r\n//\t\treturn \"http://\" + getIP() + \":\" + getPort()\r\n//\t\t\t\t+ \"/\"+getVersion();\r\n\t}", "@Api(1.2)\n @NonNull\n public String url() {\n return mRequest.buildOkRequest().url().toString();\n }", "public String getServerURL() {\n return serverURL;\n }", "public String getRepoUrl() {\n return \"ssh://git@\" + host() + \":\" + port() + REPO_DIR;\n }", "String getUrl();", "String getUrl();", "String getUrl();", "String getUrl();", "String getUrl();", "public static String getRelativeUrl() {\n return url;\n }", "String makePlanCommunityUrl();", "public java.lang.String getURL() {\n return uRL;\n }" ]
[ "0.7102608", "0.69805545", "0.6858084", "0.68034303", "0.6789641", "0.6773022", "0.67600745", "0.6742249", "0.67277944", "0.66881675", "0.66477776", "0.66297877", "0.6595502", "0.65935415", "0.6584078", "0.6554074", "0.6546127", "0.6538649", "0.6498093", "0.6486104", "0.6486104", "0.6484293", "0.6470555", "0.64467484", "0.64153737", "0.6402115", "0.6394493", "0.6376606", "0.6364169", "0.6343887", "0.63402605", "0.62979174", "0.6277759", "0.6275398", "0.62709534", "0.626997", "0.6260821", "0.62575096", "0.6253337", "0.6252655", "0.62488025", "0.624221", "0.62300974", "0.6213682", "0.6208909", "0.62021613", "0.62021613", "0.6197141", "0.6190492", "0.6181455", "0.61740273", "0.61732864", "0.6167066", "0.6135579", "0.61353034", "0.61256146", "0.61188614", "0.6104582", "0.61035055", "0.6103086", "0.61013496", "0.609105", "0.609019", "0.6086481", "0.60709447", "0.6068117", "0.60636175", "0.60625243", "0.6053666", "0.6053666", "0.6053666", "0.6053666", "0.6053666", "0.6053666", "0.60512704", "0.6045184", "0.6029507", "0.6028534", "0.60213965", "0.60201526", "0.6017837", "0.6016071", "0.6007762", "0.60008574", "0.60007244", "0.5986437", "0.59771115", "0.5972832", "0.5969575", "0.5969344", "0.5961739", "0.5952621", "0.5952349", "0.5952349", "0.5952349", "0.5952349", "0.5952349", "0.5951015", "0.5946955", "0.59460235" ]
0.65971625
12
Override this method to modify the eventual URL and attach any parameters.
@Nonnull protected StringBuilder doBuildURL(@Nonnull final StringBuilder builder) { return builder; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract String toURLParam();", "private String initUrlParameter() {\n StringBuffer url = new StringBuffer();\n url.append(URL).append(initPathParameter());\n return url.toString();\n }", "void setQueryRequestUrl(String queryRequestUrl);", "@Override\r\n\tpublic void getUrl() {\n\r\n\t}", "@Override\n protected String getTestURL(String... parameters) {\n return super.getTestURL(parameters).replace(\"?\", \"\");\n }", "public void changeUrl() {\n url();\n }", "protected void setURL(URL paramURL, String paramString1, String paramString2, int paramInt, String paramString3, String paramString4, String paramString5, String paramString6, String paramString7) {\n/* 538 */ if (this != paramURL.handler) {\n/* 539 */ throw new SecurityException(\"handler for url different from this handler\");\n/* */ }\n/* 541 */ if (paramString2 != null && paramURL.isBuiltinStreamHandler(this)) {\n/* 542 */ String str = IPAddressUtil.checkHostString(paramString2);\n/* 543 */ if (str != null) throw new IllegalArgumentException(str);\n/* */ \n/* */ } \n/* 546 */ paramURL.set(paramURL.getProtocol(), paramString2, paramInt, paramString3, paramString4, paramString5, paramString6, paramString7);\n/* */ }", "@Override\n public String getUrl() {\n StringBuilder sb = new StringBuilder(baseUrl);\n if (mUrlParams.size() > 0) {\n sb.append(\"?\");\n for (String key : mUrlParams.keySet()) {\n sb.append(key);\n sb.append(\"=\");\n sb.append(mUrlParams.get(key));\n sb.append(\"&\");\n }\n }\n String result = sb.substring(0, sb.length() - 1);\n return result;\n }", "public void addParameter(String key, Object value) {\n if (!super.requestURL.contains(\"?\")) {\n super.requestURL = super.requestURL + \"?\";\n }\n String strValue = \"\";\n try{\n strValue = Uri.encode(value.toString(), \"utf-8\");\n super.requestURL = super.requestURL + key + \"=\" + strValue + \"&\";\n } catch (Exception e){\n Log.e(TAG, e.getMessage());\n }\n }", "@Override\n\t\tpublic StringBuffer getRequestURL() {\n\t\t\treturn null;\n\t\t}", "@Override\n public StringBuffer getRequestURL() {\n //StringBuffer requestURL = super.getRequestURL();\n //System.out.println(\"URL: \" + requestURL.toString());\n return this.requestURL;\n }", "@Override\r\n\tpublic java.lang.String toString()\r\n\t{\r\n\t\treturn \"appendParamToUrl\";\r\n\t}", "@Deprecated\n/* */ protected void setURL(URL paramURL, String paramString1, String paramString2, int paramInt, String paramString3, String paramString4) {\n/* 572 */ String str1 = null;\n/* 573 */ String str2 = null;\n/* 574 */ if (paramString2 != null && paramString2.length() != 0) {\n/* 575 */ str1 = (paramInt == -1) ? paramString2 : (paramString2 + \":\" + paramInt);\n/* 576 */ int i = paramString2.lastIndexOf('@');\n/* 577 */ if (i != -1) {\n/* 578 */ str2 = paramString2.substring(0, i);\n/* 579 */ paramString2 = paramString2.substring(i + 1);\n/* */ } \n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 586 */ String str3 = null;\n/* 587 */ String str4 = null;\n/* 588 */ if (paramString3 != null) {\n/* 589 */ int i = paramString3.lastIndexOf('?');\n/* 590 */ if (i != -1) {\n/* 591 */ str4 = paramString3.substring(i + 1);\n/* 592 */ str3 = paramString3.substring(0, i);\n/* */ } else {\n/* 594 */ str3 = paramString3;\n/* */ } \n/* 596 */ } setURL(paramURL, paramString1, paramString2, paramInt, str1, str2, str3, str4, paramString4);\n/* */ }", "@Override\r\n public String getURL() {\n return url;\r\n }", "@OverrideOnDemand\n protected void modifyResultURL (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,\n @Nonnull final String sKey,\n @Nonnull final SimpleURL aTargetURL)\n {}", "@Override\n public String encodeUrl(String arg0) {\n return null;\n }", "String getQueryRequestUrl();", "@Override\n public void setUrl(String url) {\n if (LOGGER.isDebugEnabled()) {\n LOGGER.debug(\"Directory manager \" + directoryManager);\n }\n try {\n super.setUrl(directoryManager.replacePath(url));\n } catch (Exception e) {\n LOGGER.error(\"Exception thrown when setting URL \", e);\n throw new IllegalStateException(e);\n }\n }", "@Override\r\n\tpublic void getCurrentUrl() {\n\t\t\r\n\t}", "@Override\n\tpublic String buildURL(String string) {\n\t\treturn null;\n\t}", "public void addUrlArg(String key, String value);", "protected abstract String getUrl();", "@Override\npublic void get(String url) {\n\t\n}", "@Override \n public String getRequestURI() {\n if (requestURI != null) {\n return requestURI;\n }\n\n StringBuilder buffer = new StringBuilder();\n buffer.append(getRequestURIWithoutQuery());\n if (super.getQueryString() != null) {\n buffer.append(\"?\").append(super.getQueryString());\n }\n return requestURI = buffer.toString();\n }", "public void setURL(String url);", "public abstract String getURL();", "@Override\n\tpublic String getUrl()\n\t{\n\t\treturn url;\n\t}", "public void processUrl() {\n try {\n\n JsonNode rootNode = getJsonRootNode(getJsonFromURL()); // todo: pass url in this method (to support multi-urls)\n getValuesFromJsonNodes(rootNode);\n setAndFormatValues();\n\n } catch (Exception e) {\n System.out.println(\"ERROR: caught error in processUrl()\");\n e.printStackTrace();\n }\n }", "void setQueryStateUrl(String queryStateUrl);", "public StringBuffer getRequestURL() {\n return new StringBuffer(url);\n }", "@Override\n protected void parseURL(URL url, String spec, int start, int end) {\n if (end < start) {\n return;\n }\n String parseString = \"\";\n if (start < end) {\n parseString = spec.substring(start, end).replace('\\\\', '/');\n }\n super.parseURL(url, parseString, 0, parseString.length());\n }", "@Override\n @SuppressWarnings(\"all\")\n public String encodeUrl(String arg0) {\n\n return null;\n }", "public void setURL(String _url) { url = _url; }", "@Override\n public String encodeURL(String arg0) {\n return null;\n }", "public void setUrl(String url);", "public void setUrl(String url);", "private String addGetParams(String url, String params) {\n if (url.indexOf('?') == -1) {\n url += \"?\" + params;\n } else {\n url += \"&\" + params;\n }\n return url;\n }", "String getRequestURL();", "@Override\n\tpublic String encodeUrl(String url) {\n\t\treturn null;\n\t}", "@Override\n\tpublic CharSequence encodeURL(CharSequence url)\n\t{\n\t\tif (httpServletResponse != null && url != null)\n\t\t{\n\t\t\treturn httpServletResponse.encodeURL(url.toString());\n\t\t}\n\t\treturn url;\n\t}", "void setUrl(String url) {\n this.url = Uri.parse(url);\n }", "public void setUrl(Uri url) {\n this.urlString = url.toString();\n }", "private String expandURLParameters()\n throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {\n StringBuilder result = new StringBuilder(mRequestURL.length()+16);\n\n StringTokenizer stringTokenizer = new StringTokenizer(mRequestURL, \"/\");\n StringBuilder getterName = new StringBuilder(128);\n while(stringTokenizer.hasMoreTokens()) {\n String urlSection = stringTokenizer.nextToken();\n if(!urlSection.startsWith(\"{\") || !urlSection.endsWith(\"}\")) {\n result.append(urlSection);\n result.append('/');\n continue;\n }\n\n if(getterName.length() != 0) {\n getterName.delete(0, getterName.length());\n }\n\n getterName.append(\"get\");\n getterName.append(Character.toUpperCase(urlSection.charAt(1)));\n getterName.append(urlSection.substring(2, urlSection.length()-1));\n Method getter = getClass().getMethod(getterName.toString(), GETTER_PARAMETERS);\n Object value = getter.invoke(this, (Object[])null);\n result.append(value.toString());\n result.append('/');\n }\n\n if(!mRequestURL.endsWith(\"/\")) {\n result.deleteCharAt(result.length()-1);\n }\n\n return result.toString();\n }", "public void setUrl(URL url)\n {\n this.url = url;\n }", "public void setHTTP_URL(String url) {\r\n\t\ttry {\r\n\t\t\tURL u = new URL(url);\r\n\t\t\tu.toURI();\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t} catch (URISyntaxException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t\tthis.settings.setProperty(\"HTTP_URL\", url);\r\n\t\tthis.saveChanges();\r\n\t}", "private String getURL() {\n\t\t// TODO : Generate URL\n\t\treturn null;\n\t}", "public void setRequestURI(URI requestURI);", "public abstract RestURL getURL();", "void addHadithUrl(Object newHadithUrl);", "public UrlEncapsulation() {\r\n\t\t\r\n\t\tthis(null\r\n\t\t\t\t, null, null, null, null\r\n\t\t\t\t, false, null, null, null, null, null, null, null);\r\n\t\t\r\n\t}", "public void setURL(java.lang.CharSequence value) {\n this.URL = value;\n }", "protected void appendQueryProperties(StringBuilder targetUrl, Map<String, Object> model, String encodingScheme)\n throws UnsupportedEncodingException {\n String fragment = null;\n int anchorIndex = targetUrl.indexOf(\"#\");\n if (anchorIndex > -1) {\n fragment = targetUrl.substring(anchorIndex);\n targetUrl.delete(anchorIndex, targetUrl.length());\n }\n\n // If there aren't already some parameters, we need a \"?\".\n boolean first = (targetUrl.toString().indexOf('?') < 0);\n for (Map.Entry<String, Object> entry : queryProperties(model).entrySet()) {\n Object rawValue = entry.getValue();\n Iterator<Object> valueIter;\n if (rawValue != null && rawValue.getClass().isArray()) {\n valueIter = Arrays.asList(ObjectUtils.toObjectArray(rawValue)).iterator();\n }\n else if (rawValue instanceof Collection) {\n valueIter = ((Collection<Object>) rawValue).iterator();\n }\n else {\n valueIter = Collections.singleton(rawValue).iterator();\n }\n while (valueIter.hasNext()) {\n Object value = valueIter.next();\n if (first) {\n targetUrl.append('?');\n first = false;\n }\n else {\n targetUrl.append('&');\n }\n String encodedKey = urlEncode(entry.getKey(), encodingScheme);\n String encodedValue = (value != null ? urlEncode(value.toString(), encodingScheme) : \"\");\n targetUrl.append(encodedKey).append('=').append(encodedValue);\n }\n }\n\n // Append anchor fragment, if any, to end of URL.\n if (fragment != null) {\n targetUrl.append(fragment);\n }\n }", "public abstract String getUrl();", "private String getOriginUrl() {\n Uri.Builder builder = url.buildUpon();\n for (Param p : queryParams) {\n builder.appendQueryParameter(p.key, p.value);\n }\n return builder.build().toString();\n }", "String rewriteUrl(String originalUrl);", "@Override\n\tpublic String encodeURL(String url) {\n\t\treturn null;\n\t}", "void setQueryString (String string);", "private String fill(String url, String requestPath, String... parameters) {\n String filledUrl = url.replaceFirst(\"\\\\{url\\\\}\", requestPath.substring(1,requestPath.length()));\n for (String parameter : parameters) {\n filledUrl = filledUrl.replaceFirst(\"\\\\{[^}]*\\\\}\", parameter);\n }\n\n return filledUrl;\n }", "private void appendSearchParam(String query, HttpUrl.Builder urlBuilder) {\n urlBuilder.addQueryParameter(\"generator\", \"search\")\n .addQueryParameter(\"gsrwhat\", \"text\")\n .addQueryParameter(\"gsrnamespace\", \"6\")\n .addQueryParameter(\"gsrlimit\", \"25\")\n .addQueryParameter(\"gsrsearch\", query);\n }", "@Override\r\n public String getUrl()\r\n {\n return null;\r\n }", "public void setUrlCustomParameters(String urlCustomParameters) {\r\n this.urlCustomParameters = urlCustomParameters;\r\n }", "public abstract BridgeURL encodeBookmarkableURL(String baseURL, Map<String, List<String>> parameters);", "@Override\n public String encodeURL(String url) {\n return this._getHttpServletResponse().encodeURL(url);\n }", "public void setEatUri(java.lang.String param) {\n localEatUriTracker = true;\n\n this.localEatUri = param;\n }", "String getRequestedUrl();", "public DefaultHref(String baseUrl)\r\n {\r\n this.parameters = new HashMap();\r\n setFullUrl(baseUrl);\r\n }", "public String formURL(){\n String target = feedURL + \"?s=\" + marketInformation.getTickers().stream().reduce( (a, b) -> a + \",\" + b).get();\n // p0 is just the prices ordered the same as the request\n target += \"&f=p0\";\n return target;\n }", "IParser setServerBaseUrl(String theUrl);", "abstract String getUri();", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"latitude\", latitude_file);\n params.put(\"longitude\", longitude_file);\n params.put(\"link\", link);\n\n return params;\n }", "public void setUrl(String url, OgemaHttpRequest req) {\n\t\tgetData(req).setUrl(url);\n\t}", "public void setUrl(String url) {\n\t\tthis.url = utf8URLencode(url);\n\t}", "@Override\n public String encodeRedirectUrl(String arg0) {\n return null;\n }", "public void setUrl(String url) {\n if(url != null && !url.endsWith(\"/\")){\n url += \"/\";\n }\n this.url = url;\n }", "@DisplayName(\"The URL for the Marketcetera Exchange Server\")\n public void setURL(@DisplayName(\"The URL for the Marketcetera Exchange Server\")\n String inURL);", "@Override\n\t\tpublic String getRequestURI() {\n\t\t\treturn null;\n\t\t}", "public void setServerUrl(String newUrl) {\n if(newUrl == null){\n return;\n }\n props.setProperty(\"url\", newUrl);\n saveProps();\n }", "public sparqles.avro.discovery.DGETInfo.Builder setURL(java.lang.CharSequence value) {\n validate(fields()[2], value);\n this.URL = value;\n fieldSetFlags()[2] = true;\n return this; \n }", "public String setUrl() throws JSONException {\n url = baseUrl + searchName;\n for(int i = 0; i < typesCheckList.size(); i++) {\n if(typesObj.has(typesCheckList.get(i))){\n url += typesObj.getString(typesCheckList.get(i));\n }\n }\n if(V)System.out.println(url);\n return url;\n }", "@Override\n public String getUrl() {\n return getOriginUrl();\n }", "public native final void setUrl(String url)/*-{\n this.url = url;\n }-*/;", "interface UrlModifier {\n\n String createUrl(String url);\n\n }", "public void setURL() {\n\t\tURL = Constant.HOST_KALTURA+\"/api_v3/?service=\"+Constant.SERVICE_KALTURA_LOGIN+\"&action=\"\n\t\t\t\t\t\t+Constant.ACTION_KALTURA_LOGIN+\"&loginId=\"+Constant.USER_KALTURA+\"&password=\"+Constant.PASSWORD_KALTURA+\"&format=\"+Constant.FORMAT_KALTURA;\n\t}", "@Override\n protected boolean shouldEncodeUrls() {\n return isShouldEncodeUrls();\n }", "protected abstract HttpUriRequest getHttpUriRequest();", "private URL mergeUrl(URL providerUrl) {\n\n providerUrl = ClusterUtils.mergeUrl(providerUrl, queryMap);\n\n List<Configurator> localConfigurators = this.configurators;\n if (!Objects.isNull(localConfigurators) && localConfigurators.size() > 0){\n for (Configurator configurator : localConfigurators) {\n configurator.configure(providerUrl);\n }\n }\n\n providerUrl = providerUrl.addParameter(Constants.CHECK_KEY, String.valueOf(false));\n\n this.overrideDirectoryUrl = this.overrideDirectoryUrl.addParametersIfAbsent(providerUrl.getParameters());\n if ((Objects.isNull(providerUrl.getPath()) || providerUrl.getPath().length() == 0) && \"mandal\".equals(providerUrl.getProtocol())){\n String path = directoryUrl.getParameter(Constants.INTERFACE_KEY);\n if (!Objects.isNull(path)){\n int i = path.indexOf(\"/\");\n if (i >= 0){\n path = path.substring(i + 1);\n }\n i = path.lastIndexOf(':');\n if (i >= 0){\n path = path.substring(0, i);\n }\n providerUrl = providerUrl.setPath(path);\n }\n }\n return providerUrl;\n }", "@Override\n @SuppressWarnings({ \"all\", \"deprecation\" })\n public String encodeRedirectUrl(String arg0) {\n\n return null;\n }", "public interface BaseURL {\n\n //INFOQ网址[目前全为移动端]\n String INFOQ_PATH = \"http://www.infoq.com/cn/\";\n\n //CSDN网址\n String CSDN_PATH = \"http://geek.csdn.net/\";\n\n //CSDN ajax请求算法\n String GEEK_CSDN_PATH = \"http://geek.csdn.net/service/news/\";\n\n String ITEYE_PATH_SHORT = \"http://www.iteye.com\";\n\n //ITEYE网址\n String ITEYE_PATH = ITEYE_PATH_SHORT + \"/\";\n\n //泡在网上的日子[移动版块]\n String JCC_PATH = \"http://www.jcodecraeer.com/\";\n\n //开源中国 [使用ajax请求]\n String OS_CHINA_PATH = \"https://www.oschina.net/\";\n\n //开源中国 [使用ajax请求]\n String OS_CHINA_PATH_AJAX = \"https://www.oschina.net/action/ajax/\";\n\n //CSDN搜索区\n String SEARCH_CSDN = \"http://so.csdn.net/so/search/\";\n\n //OSCHINA搜索区\n String SEARCH_OSCHINA = \"https://www.oschina.net/\";\n\n //INFOQ搜索区\n String SEARCH_INFOQ = \"http://www.infoq.com/\";\n\n\n /**\n * 获取CSDN文章链接\n *\n * @return\n * @\n */\n @GET(\"get_category_news_list\")\n Observable<String> getCSDNArticle(@Query(\"category_id\") String category_id,\n @Query(\"jsonpcallback\") String jsonpcallback,\n @Query(\"username\") String username,\n @Query(\"from\") String from,\n @Query(\"size\") String size,\n @Query(\"type\") String type,\n @Query(\"_\") String other);\n\n /**\n * ITeye文章链接\n *\n * @param page\n * @return\n */\n @GET(\"{type}\")\n Observable<String> getITEyeArticle(@Path(\"type\") String path, @Query(\"page\") int page);\n\n /**\n * ITEye 专栏笔记 位于blog之下\n *\n * @param path\n * @return\n */\n @GET(\"{path}\")\n Observable<String> getITEyeSubject(@Path(\"path\") String path);\n\n\n /**\n * Info文章链接\n *\n * @param id\n * @return\n */\n @GET(\"{type}/articles/{id}\")\n Observable<String> getInfoQArticle(@Path(\"type\") String type, @Path(\"id\") int id);\n\n /**\n * 泡在网上的日子 链接\n *\n * @param tid\n * @param pageNo\n * @return\n */\n @GET(\"plus/list.php\")\n Observable<String> getJccArticle(@Query(\"tid\") int tid, @Query(\"PageNo\") int pageNo);\n\n /**\n * OSChina 链接 ?type=0&p=5#catalogs\n *\n * @return\n */\n @GET(\"get_more_recommend_blog\")\n Observable<String> getOSChinaArticle(@Query(\"classification\") String classification, @Query(\"p\") int p);\n\n /**\n * 获取网页详细内容\n *\n * @return\n */\n @GET(\"{path}\")\n Observable<String> getWebContent(@Path(\"path\") String path);\n\n //http://so.csdn.net/so/search/s.do?q=Android&t=blog&o=&s=&l=null\n @GET(\"s.do\")\n Observable<String> searchCSDNContent(@Query(\"q\") String keyWords,\n @Query(\"t\") String type,\n @Query(\"o\") String o,\n @Query(\"s\") String s,\n @Query(\"l\") String l);\n\n //https://www.oschina.net/search?scope=blog&q=Android&fromerr=Nigvshhe\n @GET(\"search\")\n Observable<String> searchOSChinaContent(@Query(\"q\") String keyWords,\n @Query(\"scope\") String type,\n @Query(\"fromerr\") String formerr);\n\n\n //http://www.iteye.com/search?query=Android&type=blog\n @GET(\"search\")\n Observable<String> searchItEyeContent(@Query(\"query\") String keyWords,\n @Query(\"type\") String type);\n\n\n //http://www.jcodecraeer.com/plus/search.php?kwtype=0&q=Java\n @GET(\"plus/search.php\")\n Observable<String> searchJCCContent(@Query(\"keyword\") String keyWord,\n @Query(\"searchtype\") String searchType,\n @Query(\"orderby\") String orderby,\n @Query(\"kwtype\") String type,\n @Query(\"pagesize\") String pagesize,\n @Query(\"typeid\") String typeid,\n @Query(\"pageNo\") String pageNo);\n\n //http://www.infoq.com/cn/search.action?queryString=java&page=1&searchOrder=&sst=o9OURhPD52ER0BUp\n //sst 在infoQ中为搜索验证时使用 不对的话 将会有HTTP 404 异常\n //o9OURhPD52ER0BUp\n @GET(\"search.action\")\n Observable<String> searchInfoQContent(@Query(\"queryString\") String keyWords,\n @Query(\"page\") int page,\n @Query(\"searchOrder\") String order,\n @Query(\"sst\") String sst);\n\n //获取INFOQ的sst用于搜索\n @GET(\"mobile\")\n Observable<String> searchInfoQSST();\n\n //文件下载\n @GET(\"{photoPath}\")\n Observable<ResponseBody> downloadFile(@Path(value = \"photoPath\") String photoPath);\n\n\n}", "@java.lang.Override\n public java.lang.String getUrl() {\n return url_;\n }", "@java.lang.Override\n public java.lang.String getUrl() {\n return url_;\n }", "@Override\n\tpublic String getURL() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String encodeRedirectUrl(String url) {\n\t\treturn null;\n\t}", "@Override\n public String encodeRedirectURL(String arg0) {\n return null;\n }", "protected static void setURL(PURL u, String protocol, String host, int port,\n\t\t String authority, String userInfo, String path,\n String query, String ref) {\n\n\t// ensure that no one can reset the protocol on a given URL.\n u.set(u.getProtocol(), host, port, authority, userInfo, path, query, ref);\n }", "public URL standardizeURL(URL startingURL);", "public void setUrl(String url){\n\t\t_url=url;\n\t}", "@Override\r\n\tpublic String getUrl() {\n\t\treturn null;\r\n\t}", "public String getUrl() { return url; }", "void addHadithBookUrl(Object newHadithBookUrl);", "public String getUrlCustomParameters() {\r\n return urlCustomParameters;\r\n }", "private String getSearchUrl(String url ){\n String params = searchEditText.getText().toString();\n params = params.replace(\" \",\"+\");\n url += params + \"&filter=ebooks&prettyPrint=false\";\n return url;\n }" ]
[ "0.6711156", "0.6536423", "0.64491665", "0.63931584", "0.6365502", "0.6334257", "0.6282132", "0.6222815", "0.62015826", "0.6193221", "0.6178822", "0.6174224", "0.61455023", "0.6108777", "0.6081805", "0.6033812", "0.6022066", "0.6013505", "0.6009828", "0.5980802", "0.59684944", "0.5952884", "0.59494126", "0.5947127", "0.5921589", "0.5917168", "0.5876071", "0.5872045", "0.5865448", "0.5842026", "0.58369106", "0.582963", "0.58164567", "0.58061725", "0.5806018", "0.5806018", "0.5791148", "0.57822007", "0.5780639", "0.5762524", "0.5760341", "0.57554007", "0.5753206", "0.57447034", "0.5744218", "0.5744192", "0.57408476", "0.57360905", "0.5721026", "0.57118267", "0.5708216", "0.57067776", "0.56988645", "0.569485", "0.5683989", "0.56716084", "0.5669851", "0.56680655", "0.5667358", "0.56510043", "0.56498605", "0.5642987", "0.5627912", "0.5624824", "0.5610762", "0.56075805", "0.55981934", "0.5591374", "0.55871665", "0.5578394", "0.55702704", "0.5566091", "0.55653775", "0.5558225", "0.5557043", "0.5551239", "0.5547832", "0.5520396", "0.5516113", "0.55105746", "0.5510553", "0.55082625", "0.55042064", "0.54976606", "0.54721403", "0.5456973", "0.5456539", "0.54553646", "0.5455264", "0.5455264", "0.54418534", "0.54404265", "0.54379827", "0.54343235", "0.54270405", "0.54252136", "0.5421908", "0.5411948", "0.5410696", "0.5408751", "0.5405981" ]
0.0
-1
Use the configured parameters to set global JVM trust store parameters for SSL connectivity.
private void installTrustStore() { if (trustStoreType != null) { System.setProperty("javax.net.ssl.trustStore", trustStore); if (trustStoreType != null) { System.setProperty("javax.net.ssl.trustStoreType", trustStoreType); } if (trustStorePassword != null) { System.setProperty("javax.net.ssl.trustStorePassword", trustStorePassword); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@PostConstruct\n\t\tprivate void configureSSL() {\n\t\t\tSystem.setProperty(\"https.protocols\", \"TLSv1.2\");\n\n\t\t\t//load the 'javax.net.ssl.trustStore' and\n\t\t\t//'javax.net.ssl.trustStorePassword' from application.properties\n\t\t\tSystem.setProperty(\"javax.net.ssl.trustStore\", env.getProperty(\"server.ssl.trust-store\"));\n\t\t\tSystem.setProperty(\"javax.net.ssl.trustStorePassword\",env.getProperty(\"server.ssl.trust-store-password\"));\n\t\t}", "@Override\n public void setSSLParameters(SSLParameters sslP) {\n\n }", "@Override\n protected void createConnectionOptions(ClientOptions clientOptions) {\n if (clientOptions.getOption(ClientOptions.CON_SSL_TRUST_ALL).hasParsedValue()) {\n try {\n SSLContext ctx = SSLContext.getInstance(\"TLS\");\n ctx.init(new KeyManager[0], new TrustManager[]{new TrustingTrustManager()}, null);\n SSLContext.setDefault(ctx);\n } catch (NoSuchAlgorithmException | KeyManagementException e) {\n throw new RuntimeException(\"Could not set up the all-trusting TrustManager\", e);\n }\n }\n\n // Configure SSL options, which in case of activemq-client are set as Java properties\n // http://activemq.apache.org/how-do-i-use-ssl.html\n // https://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide.html#CustomizingStores\n\n if (clientOptions.getOption(ClientOptions.CON_SSL_KEYSTORE_LOC).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.keyStore\", relativize(clientOptions.getOption(ClientOptions.CON_SSL_KEYSTORE_LOC).getValue()));\n }\n if (clientOptions.getOption(ClientOptions.CON_SSL_KEYSTORE_PASS).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.keyStorePassword\", clientOptions.getOption(ClientOptions.CON_SSL_KEYSTORE_PASS).getValue());\n }\n// System.setProperty(\"javax.net.ssl.keyStorePassword\", \"secureexample\");\n if (clientOptions.getOption(ClientOptions.CON_SSL_TRUSTSTORE_LOC).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.trustStore\", relativize(clientOptions.getOption(ClientOptions.CON_SSL_TRUSTSTORE_LOC).getValue()));\n }\n if (clientOptions.getOption(ClientOptions.CON_SSL_TRUSTSTORE_PASS).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.trustStorePassword\", clientOptions.getOption(ClientOptions.CON_SSL_TRUSTSTORE_PASS).getValue());\n }\n if (clientOptions.getOption(ClientOptions.CON_SSL_STORE_TYPE).hasParsedValue()) {\n System.setProperty(\"javax.net.ssl.keyStoreType\", clientOptions.getOption(ClientOptions.CON_SSL_STORE_TYPE).getValue());\n System.setProperty(\"javax.net.ssl.trustStoreType\", clientOptions.getOption(ClientOptions.CON_SSL_STORE_TYPE).getValue());\n }\n\n super.createConnectionOptions(clientOptions);\n }", "private void setTrustedCertificates() {\n TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {\n public java.security.cert.X509Certificate[] getAcceptedIssuers() {\n return null;\n }\n\n public void checkClientTrusted(X509Certificate[] certs, String authType) {\n }\n\n public void checkServerTrusted(X509Certificate[] certs, String authType) {\n }\n }};\n // Install the all-trusting trust manager\n final SSLContext sc;\n try {\n sc = SSLContext.getInstance(\"TLS\");\n sc.init(null, trustAllCerts, new java.security.SecureRandom());\n } catch (NoSuchAlgorithmException | KeyManagementException e) {\n e.printStackTrace();\n return;\n }\n\n HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());\n // Create all-trusting host name verifier\n HostnameVerifier allHostsValid = new HostnameVerifier() {\n public boolean verify(String hostname, SSLSession session) {\n return true;\n }\n };\n\n // Install the all-trusting host verifier\n HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);\n }", "public void setTrustStore(String trustStore) {\n this.trustStore = trustStore;\n }", "private static void setupSSL() {\n\t\ttry {\n\t\t\tTrustManager[] trustAllCerts = createTrustAllCertsManager();\n\t\t\tSSLContext sslContext = SSLContext.getInstance(SSL_CONTEXT_PROTOCOL);\n\t\t\tSecureRandom random = new java.security.SecureRandom();\n\t\t\tsslContext.init(null, trustAllCerts, random);\n\t\t\tHttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tLOGGER.error(INVALID_PROTOCOL_ERROR_MESSAGE, e);\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t} catch (GeneralSecurityException e) {\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t}\n\n\t}", "private SSLContext initSSLContext() {\n KeyStore ks = KeyStoreUtil.loadSystemKeyStore();\n if (ks == null) {\n _log.error(\"Key Store init error\");\n return null;\n }\n if (_log.shouldLog(Log.INFO)) {\n int count = KeyStoreUtil.countCerts(ks);\n _log.info(\"Loaded \" + count + \" default trusted certificates\");\n }\n\n File dir = new File(_context.getBaseDir(), CERT_DIR);\n int adds = KeyStoreUtil.addCerts(dir, ks);\n int totalAdds = adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n if (!_context.getBaseDir().getAbsolutePath().equals(_context.getConfigDir().getAbsolutePath())) {\n dir = new File(_context.getConfigDir(), CERT_DIR);\n adds = KeyStoreUtil.addCerts(dir, ks);\n totalAdds += adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n }\n dir = new File(System.getProperty(\"user.dir\"));\n if (!_context.getBaseDir().getAbsolutePath().equals(dir.getAbsolutePath())) {\n dir = new File(_context.getConfigDir(), CERT_DIR);\n adds = KeyStoreUtil.addCerts(dir, ks);\n totalAdds += adds;\n if (adds > 0 && _log.shouldLog(Log.INFO))\n _log.info(\"Loaded \" + adds + \" trusted certificates from \" + dir.getAbsolutePath());\n }\n if (_log.shouldLog(Log.INFO))\n _log.info(\"Loaded total of \" + totalAdds + \" new trusted certificates\");\n\n try {\n SSLContext sslc = SSLContext.getInstance(\"TLS\");\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());\n tmf.init(ks);\n X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0];\n _stm = new SavingTrustManager(defaultTrustManager);\n sslc.init(null, new TrustManager[] {_stm}, null);\n /****\n if (_log.shouldLog(Log.DEBUG)) {\n SSLEngine eng = sslc.createSSLEngine();\n SSLParameters params = sslc.getDefaultSSLParameters();\n String[] s = eng.getSupportedProtocols();\n Arrays.sort(s);\n _log.debug(\"Supported protocols: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getEnabledProtocols();\n Arrays.sort(s);\n _log.debug(\"Enabled protocols: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = params.getProtocols();\n if (s == null)\n s = new String[0];\n _log.debug(\"Default protocols: \" + s.length);\n Arrays.sort(s);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getSupportedCipherSuites();\n Arrays.sort(s);\n _log.debug(\"Supported ciphers: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = eng.getEnabledCipherSuites();\n Arrays.sort(s);\n _log.debug(\"Enabled ciphers: \" + s.length);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n s = params.getCipherSuites();\n if (s == null)\n s = new String[0];\n _log.debug(\"Default ciphers: \" + s.length);\n Arrays.sort(s);\n for (int i = 0; i < s.length; i++) {\n _log.debug(s[i]);\n }\n }\n ****/\n return sslc;\n } catch (GeneralSecurityException gse) {\n _log.error(\"Key Store update error\", gse);\n } catch (ExceptionInInitializerError eiie) {\n // java 9 b134 see ../crypto/CryptoCheck for example\n // Catching this may be pointless, fetch still fails\n _log.error(\"SSL context error - Java 9 bug?\", eiie);\n }\n return null;\n }", "private static void setAllowAllSSL(HttpsURLConnection httpsConn,\n KeyManager km) throws KeyManagementException, NoSuchAlgorithmException {\n TrustManager[] trustAllCerts = new TrustManager[] {\n new X509TrustManager() {\n @Override\n public java.security.cert.X509Certificate[] getAcceptedIssuers() {\n return new X509Certificate[]{};\n }\n\n @Override\n public void checkClientTrusted(\n java.security.cert.X509Certificate[] certs, String authType)\n throws CertificateException {\n }\n\n @Override\n public void checkServerTrusted(\n java.security.cert.X509Certificate[] certs, String authType)\n throws CertificateException {\n }\n }\n };\n KeyManager[] kms = (km == null) ? null : new KeyManager[]{km};\n SSLContext sc = SSLContext.getInstance(\"SSL\");\n sc.init(kms, trustAllCerts, new SecureRandom());\n httpsConn.setSSLSocketFactory(sc.getSocketFactory());\n // Don't check the hostname\n httpsConn.setHostnameVerifier(new NoopHostnameVerifier());\n }", "private static void trustAllHosts() {\n TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {\n public java.security.cert.X509Certificate[] getAcceptedIssuers() {\n return new java.security.cert.X509Certificate[]{};\n }\n\n public void checkClientTrusted(X509Certificate[] chain, String authType) {\n }\n\n public void checkServerTrusted(X509Certificate[] chain, String authType) {\n }\n }};\n // Install the all-trusting trust manager\n try {\n SSLContext sc = SSLContext.getInstance(\"TLS\");\n sc.init(null, trustAllCerts, new java.security.SecureRandom());\n HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void beforeHookedMethod(MethodHookParam param) throws Throwable {\n param.args[0] = new TrustAllSSLSocketFactory();\n }", "private static void trustAllHosts() {\n\t\tTrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\n\t\t\tpublic java.security.cert.X509Certificate[] getAcceptedIssuers() {\n\t\t\t\treturn new java.security.cert.X509Certificate[] {};\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void checkClientTrusted(\n\t\t\t\t\tjava.security.cert.X509Certificate[] chain,\n\t\t\t\t\tString authType)\n\t\t\t\t\t\t\tthrows java.security.cert.CertificateException {\n\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void checkServerTrusted(\n\t\t\t\t\tjava.security.cert.X509Certificate[] chain,\n\t\t\t\t\tString authType)\n\t\t\t\t\t\t\tthrows java.security.cert.CertificateException {\n\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t}\n\t\t} };\n\n\t\t// Install the all-trusting trust manager\n\t\ttry {\n\t\t\tSSLContext sc = SSLContext.getInstance(\"TLS\");\n\t\t\tsc.init(null, trustAllCerts, new java.security.SecureRandom());\n\t\t\tHttpsURLConnection\n\t\t\t.setDefaultSSLSocketFactory(sc.getSocketFactory());\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void trustAllHosts() {\n final String TAG = \"trustAllHosts\";\n // Create a trust manager that does not validate certificate chains\n TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\n public java.security.cert.X509Certificate[] getAcceptedIssuers() {\n return new java.security.cert.X509Certificate[] {};\n }\n public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {\n// Log.i(TAG, \"checkClientTrusted\");\n }\n public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {\n// Log.i(TAG, \"checkServerTrusted\");\n }\n } };\n // Install the all-trusting trust manager\n try {\n SSLContext sc = SSLContext.getInstance(\"TLS\");\n sc.init(null, trustAllCerts, new java.security.SecureRandom());\n HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void setSSLConfiguration(String clientTruststore, String truststorePassword, boolean forConsumer) {\n\t\tProperties properties = forConsumer ? consumerProperties : producerProperties;\n\n\t\tproperties.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, \"SSL\");\n\t\tproperties.put(SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG, \"https\");\n\t\tproperties.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, clientTruststore);\n\t\tproperties.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, truststorePassword);\n\t}", "public static void trustAllHosts() {\n\t\tTrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {\n\t\t\tpublic java.security.cert.X509Certificate[] getAcceptedIssuers() {\n\t\t\t\treturn new java.security.cert.X509Certificate[]{};\n\t\t\t}\n\n\t\t\tpublic void checkClientTrusted(X509Certificate[] chain,\n\t\t\t\t\tString authType) throws CertificateException {\n\t\t\t}\n\n\t\t\tpublic void checkServerTrusted(X509Certificate[] chain,\n\t\t\t\t\tString authType) throws CertificateException {\n\t\t\t}\n\t\t}};\n\n\t\t// Install the all-trusting trust manager\n\t\ttry {\n\t\t\tSSLContext sc = SSLContext.getInstance(\"TLS\");\n\t\t\tsc.init(null, trustAllCerts, new java.security.SecureRandom());\n\t\t\tHttpsURLConnection\n\t\t\t.setDefaultSSLSocketFactory(sc.getSocketFactory());\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void setTrustStore(String trustStoreLocation) {\n if (!complete) {\n this.trustStoreLocation = trustStoreLocation;\n } else {\n log.warn(\"Connection Descriptor setter used outside of factory.\");\n }\n }", "public void setTrustStorePassword(String trustStorePassword) {\n this.trustStorePassword = trustStorePassword;\n }", "public static final void registerTrustingSSLManager() {\n registerTrustingSSLManager(\"SSL\");\n }", "public void init() throws Exception {\n\t\tString trustKeyStore = null;\n\t\tString trustKsPsword = null;\n\t\tString trustKsType = null;\n\t\t\n\t\t// Read ssl keystore properties from file\n\t\tProperties properties = new Properties();\n\t\tInputStream sslCertInput = Resources.getResourceAsStream(\"sslCertification.properties\");\n\t\ttry {\n\t\t\tproperties.load(sslCertInput);\n\t\t\ttrustKeyStore = properties.getProperty(\"trustKeyStore\");\n\t\t\ttrustKsPsword = properties.getProperty(\"trustKeyStorePass\");\n\t\t\ttrustKsType = properties.getProperty(\"trustKeyStoreType\");\n\t\t} catch (Exception e) {\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tsslCertInput.close();\n\t\t}\n \n // Set trust key store factory\n KeyStore trustKs = KeyStore.getInstance(trustKsType); \n FileInputStream trustKSStream = new FileInputStream(trustKeyStore);\n try {\n \ttrustKs.load(trustKSStream, trustKsPsword.toCharArray()); \n } catch (Exception e) {\n \tthrow e;\n } finally {\n \ttrustKSStream.close();\n }\n TrustManagerFactory trustKf = TrustManagerFactory.getInstance(\"SunX509\");\n trustKf.init(trustKs); \n \n // Init SSLContext\n SSLContext context = SSLContext.getInstance(\"TLSv1.2\"); \n context.init(null, trustKf.getTrustManagers(), null); \n sslFactory = context.getSocketFactory();\n \n\t\treturn;\n\t}", "public static void \n setDefaultTrustedCertificates(TrustedCertificates trusted) {\n\n trustedCertificates = trusted;\n }", "private void setRahasParameters(AxisService axisService, String privateKeyStore)\n throws PersistenceException, AxisFault {\n Properties cryptoProps = new Properties();\n\n String serviceGroupId = axisService.getAxisServiceGroup().getServiceGroupName();\n String serviceName = axisService.getName();\n String serviceXPath = PersistenceUtils.getResourcePath(axisService);\n\n List pvtStores = serviceGroupFilePM.getAssociations(serviceGroupId, serviceXPath,\n SecurityConstants.ASSOCIATION_PRIVATE_KEYSTORE);\n List tstedStores = serviceGroupFilePM.getAssociations(serviceGroupId, serviceXPath,\n SecurityConstants.ASSOCIATION_TRUSTED_KEYSTORE);\n\n if (pvtStores != null && !CollectionUtils.isEmpty(pvtStores)) {\n String keyAlias = null;\n ServerConfiguration serverConfig = ServerConfiguration.getInstance();\n keyAlias = serverConfig.getFirstProperty(\"Security.KeyStore.KeyAlias\");\n cryptoProps.setProperty(ServerCrypto.PROP_ID_PRIVATE_STORE, privateKeyStore);\n cryptoProps.setProperty(ServerCrypto.PROP_ID_DEFAULT_ALIAS, keyAlias);\n }\n StringBuilder trustStores = new StringBuilder();\n\n for (Object node : tstedStores) {\n OMElement assoc = (OMElement) node;\n String tstedStore = assoc.getAttributeValue(new QName(Resources.Associations.DESTINATION_PATH));\n String name = tstedStore.substring(tstedStore.lastIndexOf(\"/\"));\n trustStores.append(name).append(\",\");\n }\n\n cryptoProps.setProperty(ServerCrypto.PROP_ID_TRUST_STORES, trustStores.toString());\n\n try {\n setServiceParameterElement(serviceName, RahasUtil.getSCTIssuerConfigParameter(\n ServerCrypto.class.getName(), cryptoProps, -1, null, true, true));\n setServiceParameterElement(serviceName, RahasUtil.getTokenCancelerConfigParameter());\n OMElement serviceElement = (OMElement) serviceGroupFilePM.get(serviceGroupId, serviceXPath);\n\n serviceElement.addAttribute(SecurityConstants.PROP_RAHAS_SCT_ISSUER, Boolean.TRUE.toString(), null);\n serviceGroupFilePM.setMetaFileModification(serviceGroupId);\n } catch (Exception e) {\n throw new AxisFault(\"Could not configure Rahas parameters\", e);\n }\n\n }", "private void loadDefaults() throws ERMgmtException{\n// \n\n try {\n //first try PKIX, works on 1.5 and 1.6\n mTrustManagerFactory = TrustManagerFactory.getInstance(mTrustManagerFactoryAlgorithm); \n } catch (NoSuchAlgorithmException nae1) {\n try{\n //trustManagerFactory should be using IBMJSSE2 in java1.4.2, or an exception will happen upon init\n Security.insertProviderAt(new IBMJSSEProvider2(), 1);\n //PKIX is called IbmPKIX on 1.4.2. running IBMJSSE2\n mTrustManagerFactory = TrustManagerFactory.getInstance(mTrustManagerFactoryBackupAlgorithm);\n }\n catch (NoSuchAlgorithmException nae2){\n //then try Ibm509 for 1.4.2 running JSSE\n try {\n mTrustManagerFactory = TrustManagerFactory.getInstance(mTrustManagerFactoryBackupAlgorithm2); \n }\n catch (NoSuchAlgorithmException nae3){\n throw new ERMgmtException(\"Trust Manager Error: \" , nae3);\n } \n }\n }\n loadTM(); \n X509Certificate[] defaultChain = mTrustManager.getAcceptedIssuers();\n for(int i=0; i<defaultChain.length; i++){\n mCertList.add(defaultChain[i]);\n }\n }", "public void setTrustAllSSLCertificates(boolean trustAllSSLCertificates) {\n this.trustAllSSLCertificates = trustAllSSLCertificates;\n }", "public void beforeHookedMethod(MethodHookParam param) throws Throwable {\n param.setResult(new TrustAllSSLSocketFactory());\n }", "public void setTlsCertPath(String tlsCertPath);", "@Override\n public SSLParameters getSSLParameters() {\n return null;\n }", "@SuppressWarnings(\"checkstyle:parameternumber\")\n public static void setupSSLConfig(String keystoresDir, String sslConfDir,\n Configuration conf, boolean useClientCert, boolean trustStore,\n String excludeCiphers, String serverPassword, String clientPassword,\n String trustPassword) throws Exception {\n\n String clientKS = keystoresDir + \"/clientKS.jks\";\n String serverKS = keystoresDir + \"/serverKS.jks\";\n String trustKS = null;\n\n File sslClientConfFile = new File(sslConfDir, getClientSSLConfigFileName());\n File sslServerConfFile = new File(sslConfDir, getServerSSLConfigFileName());\n\n Map<String, X509Certificate> certs = new HashMap<String, X509Certificate>();\n\n if (useClientCert) {\n KeyPair cKP = KeyStoreTestUtil.generateKeyPair(\"RSA\");\n X509Certificate cCert =\n KeyStoreTestUtil.generateCertificate(\"CN=localhost, O=client\", cKP, 30,\n \"SHA1withRSA\");\n KeyStoreTestUtil.createKeyStore(clientKS, clientPassword, \"client\",\n cKP.getPrivate(), cCert);\n certs.put(\"client\", cCert);\n }\n\n KeyPair sKP = KeyStoreTestUtil.generateKeyPair(\"RSA\");\n X509Certificate sCert =\n KeyStoreTestUtil.generateCertificate(\"CN=localhost, O=server\", sKP, 30,\n \"SHA1withRSA\");\n KeyStoreTestUtil.createKeyStore(serverKS, serverPassword, \"server\",\n sKP.getPrivate(), sCert);\n certs.put(\"server\", sCert);\n\n if (trustStore) {\n trustKS = keystoresDir + \"/trustKS.jks\";\n KeyStoreTestUtil.createTrustStore(trustKS, trustPassword, certs);\n }\n\n Configuration clientSSLConf = createClientSSLConfig(clientKS,\n clientPassword, clientPassword, trustKS, trustPassword, excludeCiphers);\n Configuration serverSSLConf = createServerSSLConfig(serverKS,\n serverPassword, serverPassword, trustKS, trustPassword, excludeCiphers);\n\n saveConfig(sslClientConfFile, clientSSLConf);\n saveConfig(sslServerConfFile, serverSSLConf);\n\n conf.set(SSLFactory.SSL_HOSTNAME_VERIFIER_KEY, \"ALLOW_ALL\");\n conf.set(SSLFactory.SSL_CLIENT_CONF_KEY, sslClientConfFile.getName());\n conf.set(SSLFactory.SSL_SERVER_CONF_KEY, sslServerConfFile.getName());\n conf.setBoolean(SSLFactory.SSL_REQUIRE_CLIENT_CERT_KEY, useClientCert);\n }", "public ERTrustManager(boolean allowUntrustedCert) throws ERMgmtException{\n //loads the default certificates into the trustManager; \n loadDefaults();\n mAllowUntrusted = allowUntrustedCert;\n //add the DataPower Certificates\n addCert(DATAPOWER_CA_CERT_PEM_9005);\n addCert(DATAPOWER_CA_CERT_PEM_9004);\n \n }", "public SSLContextParameters createClientSSLContextParameters() {\n SSLContextParameters sslContextParameters = new SSLContextParameters();\n\n TrustManagersParameters trustManagersParameters = new TrustManagersParameters();\n KeyStoreParameters trustStore = new KeyStoreParameters();\n trustStore.setPassword(\"changeit\");\n trustStore.setResource(\"ssl/keystore.jks\");\n trustManagersParameters.setKeyStore(trustStore);\n sslContextParameters.setTrustManagers(trustManagersParameters);\n\n return sslContextParameters;\n }", "@DSSink({DSSinkKind.SENSITIVE_UNCATEGORIZED})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:02:01.395 -0500\", hash_original_method = \"886AE080148D5E5D7C66238C628CC678\", hash_generated_method = \"B59D430B54A9E84755CD1B8DE11AFB42\")\n \npublic void setSSLParameters(SSLParameters p) {\n String[] cipherSuites = p.getCipherSuites();\n if (cipherSuites != null) {\n setEnabledCipherSuites(cipherSuites);\n }\n String[] protocols = p.getProtocols();\n if (protocols != null) {\n setEnabledProtocols(protocols);\n }\n if (p.getNeedClientAuth()) {\n setNeedClientAuth(true);\n } else if (p.getWantClientAuth()) {\n setWantClientAuth(true);\n } else {\n setWantClientAuth(false);\n }\n }", "public static void allowAllCertificates() {\n try {\n TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\n public X509Certificate[] getAcceptedIssuers() {\n X509Certificate[] myTrustedAnchors = new X509Certificate[0];\n return myTrustedAnchors;\n }\n\n @Override\n public void checkClientTrusted(X509Certificate[] certs,\n String authType) {}\n\n @Override\n public void checkServerTrusted(X509Certificate[] certs,\n String authType) {}\n } };\n\n SSLContext sc = SSLContext.getInstance(\"SSL\");\n sc.init(null, trustAllCerts, new SecureRandom());\n HttpsURLConnection\n .setDefaultSSLSocketFactory(sc.getSocketFactory());\n HttpsURLConnection\n .setDefaultHostnameVerifier(new HostnameVerifier() {\n\n @Override\n public boolean verify(String arg0, SSLSession arg1) {\n return true;\n }\n });\n } catch (Exception e) {}\n }", "public void setSslContextParameters(SSLContextParameters sslContextParameters) {\n this.sslContextParameters = sslContextParameters;\n }", "private static synchronized void satisfyTrustAllCerts() {\n\t\tif (trustAllCerts == null) {\n\t\t\ttrustAllCerts = new TrustManager[] { new X509TrustManager() {\n\t\t\t\tpublic X509Certificate[] getAcceptedIssuers() {\n\t\t\t\t\treturn new X509Certificate[0];\n\t\t\t\t}\n\n\t\t\t\tpublic void checkClientTrusted(X509Certificate[] certs, String authType) {\n\t\t\t\t}\n\n\t\t\t\tpublic void checkServerTrusted(X509Certificate[] certs, String authType) {\n\t\t\t\t}\n\t\t\t} };\n\t\t}\n\t}", "public void setTrustStorePassword(String trustStorePassword) {\n if (!complete) {\n this.trustStorePassword = trustStorePassword;\n } else {\n log.warn(\"Connection Descriptor setter used outside of factory.\");\n }\n }", "public SSLContextParameters createServerSSLContextParameters() {\n SSLContextParameters sslContextParameters = new SSLContextParameters();\n\n KeyManagersParameters keyManagersParameters = new KeyManagersParameters();\n KeyStoreParameters keyStore = new KeyStoreParameters();\n keyStore.setPassword(\"changeit\");\n keyStore.setResource(\"ssl/keystore.jks\");\n keyManagersParameters.setKeyPassword(\"changeit\");\n keyManagersParameters.setKeyStore(keyStore);\n sslContextParameters.setKeyManagers(keyManagersParameters);\n\n return sslContextParameters;\n }", "public final SSLParameters getDefaultSSLParameters() {\n return spiImpl.engineGetDefaultSSLParameters();\n }", "protected void setupHttps(){\n try {\n if (!testKeystoreFile.exists()) {\n // Prepare a temporary directory for the tests\n BioUtils.delete(this.testDir, true);\n this.testDir.mkdir();\n // Copy the keystore into the test directory\n Response response = new Client(Protocol.CLAP)\n .handle(new Request(Method.GET,\n \"clap://class/org/restlet/test/engine/dummy.jks\"));\n\n if (response.getEntity() != null) {\n OutputStream outputStream = new FileOutputStream(\n testKeystoreFile);\n response.getEntity().write(outputStream);\n outputStream.flush();\n outputStream.close();\n } else {\n throw new Exception(\n \"Unable to find the dummy.jks file in the classpath.\");\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n }", "public static void setupSSLConfig(String keystoresDir, String sslConfDir,\n Configuration conf, boolean useClientCert,\n boolean trustStore)\n throws Exception {\n setupSSLConfig(keystoresDir, sslConfDir, conf, useClientCert, true,\"\");\n }", "public TrustingSSLSocketFactory() throws SSLException {\n\t\tSecurity.addProvider(new com.sun.net.ssl.internal.ssl.Provider());\n\t\tSystem.setProperty(\"java.protocol.handler.pkgs\", \"com.sun.net.ssl.internal.www.protocol\");\n\t\ttry {\n\t\t\tSSLContext sslContext;\n\t\t\tsslContext = SSLContext.getInstance(\"SSLv3\");\n\t\t\tsslContext.init(null, new TrustManager[]{new UtilSSLSocketFactory.TrustingX509TrustManager()}, null);\n\t\t\tfactory = sslContext.getSocketFactory();\n\t\t} catch (NoSuchAlgorithmException nsae) {\n\t\t\tthrow new SSLException(\"Unable to initialize the SSL context: \", nsae);\n\t\t} catch (KeyManagementException kme) {\n\t\t\tthrow new SSLException(\"Unable to register a trust manager: \", kme);\n\t\t}\n\t\tciphers = factory.getDefaultCipherSuites();\n\t}", "protected void init() throws Exception {\n if (this.sslConfiguration != null && this.sslConfiguration.enabled()) {\n if (this.sslConfiguration.certificatePath() != null && this.sslConfiguration.privateKeyPath() != null) {\n try (var cert = Files.newInputStream(this.sslConfiguration.certificatePath());\n var privateKey = Files.newInputStream(this.sslConfiguration.privateKeyPath())) {\n // begin building the new ssl context building based on the certificate and private key\n var builder = SslContextBuilder.forServer(cert, privateKey);\n\n // check if a trust certificate was given, if not just trusts all certificates\n if (this.sslConfiguration.trustCertificatePath() != null) {\n try (var stream = Files.newInputStream(this.sslConfiguration.trustCertificatePath())) {\n builder.trustManager(stream);\n }\n } else {\n builder.trustManager(InsecureTrustManagerFactory.INSTANCE);\n }\n\n // build the context\n this.sslContext = builder\n .clientAuth(this.sslConfiguration.clientAuth() ? ClientAuth.REQUIRE : ClientAuth.OPTIONAL)\n .build();\n }\n } else {\n // self-sign a certificate as no certificate was provided\n var selfSignedCertificate = new SelfSignedCertificate();\n this.sslContext = SslContextBuilder\n .forServer(selfSignedCertificate.certificate(), selfSignedCertificate.privateKey())\n .trustManager(InsecureTrustManagerFactory.INSTANCE)\n .build();\n }\n }\n }", "public static void installTrustManagerNotValidatingCertificateChains() throws NoSuchAlgorithmException,\n KeyManagementException\n {\n // see http://code.google.com/p/misc-utils/wiki/JavaHttpsUrl\n SSLContext sslContext = SSLContext.getInstance(\"SSL\");\n sslContext.init(null, new TrustManager[] {createTrustManagerNotValidatingCertificateChains()}, new java.security.SecureRandom());\n HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());\n }", "public static void initEncryption(EncryptionOptions options)\n { \n logger.info(\"Registering custom HTTPClient SSL configuration with Solr\");\n SSLSocketFactory socketFactory = \n (options.verifier == null) ?\n new SSLSocketFactory(options.ctx) :\n new SSLSocketFactory(options.ctx, options.verifier);\n HttpClientUtil.setConfigurer(new SSLHttpClientConfigurer(socketFactory)); \n }", "public void setTlsCert(String tlsCert);", "public void setSslKeystore(String keystore) {\n\t\tsslKeystore = keystore;\n\t}", "public static void main(String args[]) throws Exception{\n\t KeyStore keyStore = KeyStore.getInstance(\"JCEKS\");\r\n\r\n //Cargar el objeto KeyStore \r\n char[] password = \"changeit\".toCharArray();\r\n java.io.FileInputStream fis = new FileInputStream(\r\n \t\t \"/usr/lib/jvm/java-11-openjdk-amd64/lib/security/cacerts\");\r\n \r\n keyStore.load(fis, password);\r\n \r\n //Crear el objeto KeyStore.ProtectionParameter \r\n ProtectionParameter protectionParam = new KeyStore.PasswordProtection(password);\r\n\r\n //Crear el objeto SecretKey \r\n SecretKey mySecretKey = new SecretKeySpec(\"myPassword\".getBytes(), \"DSA\");\r\n \r\n //Crear el objeto SecretKeyEntry \r\n SecretKeyEntry secretKeyEntry = new SecretKeyEntry(mySecretKey);\r\n keyStore.setEntry(\"AliasClaveSecreta\", secretKeyEntry, protectionParam);\r\n\r\n //Almacenar el objeto KeyStore \r\n java.io.FileOutputStream fos = null;\r\n fos = new java.io.FileOutputStream(\"newKeyStoreName\");\r\n keyStore.store(fos, password);\r\n \r\n //Crear el objeto KeyStore.SecretKeyEntry \r\n SecretKeyEntry secretKeyEnt = (SecretKeyEntry)keyStore.getEntry(\"AliasClaveSecreta\", protectionParam);\r\n\r\n //Crear el objeto SecretKey \r\n SecretKey mysecretKey = secretKeyEnt.getSecretKey(); \r\n System.out.println(\"Algoritmo usado para generar la clave: \"+mysecretKey.getAlgorithm()); \r\n System.out.println(\"Formato usado para la clave: \"+mysecretKey.getFormat());\r\n }", "public static void setupSSLConfig(String keystoresDir, String sslConfDir,\n Configuration conf, boolean useClientCert, boolean trustStore,\n String excludeCiphers) throws Exception {\n setupSSLConfig(keystoresDir, sslConfDir, conf, useClientCert, trustStore,\n excludeCiphers, SERVER_KEY_STORE_PASSWORD_DEFAULT,\n CLIENT_KEY_STORE_PASSWORD_DEFAULT, TRUST_STORE_PASSWORD_DEFAULT);\n }", "private static void handleSSLCertificate() throws Exception {\n\t\tTrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\n\t\t\tpublic X509Certificate[] getAcceptedIssuers() {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic void checkClientTrusted(X509Certificate[] certs,\n\t\t\t\t\tString authType) {\n\t\t\t\t// Trust always\n\t\t\t}\n\n\t\t\tpublic void checkServerTrusted(X509Certificate[] certs,\n\t\t\t\t\tString authType) {\n\t\t\t\t// Trust always\n\t\t\t}\n\t\t} };\n\n\t\t// Install the all-trusting trust manager\n\t\tSSLContext sc = SSLContext.getInstance(\"SSL\");\n\t\t// Create empty HostnameVerifier\n\t\tHostnameVerifier hv = new HostnameVerifier() {\n\t\t\tpublic boolean verify(String arg0, SSLSession arg1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\n\t\tsc.init(null, trustAllCerts, new java.security.SecureRandom());\n\t\tHttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());\n\t\tHttpsURLConnection.setDefaultHostnameVerifier(hv);\n\t}", "public void setSsl(SSLConfiguration ssl) {\n this.ssl = ssl;\n }", "public void beforeHookedMethod(MethodHookParam param) throws Throwable {\n param.setResult(TrustAllApacheSSLSocketFactory.getSocketFactory());\n }", "public String getTrustStore() {\n return trustStore;\n }", "public interface SecurityConfigurator {\n\n /**\n * The provider to use for {@link SSLEngine}.\n */\n enum SslProvider {\n /**\n * Use the stock JDK implementation.\n */\n JDK,\n /**\n * Use the openssl implementation.\n */\n OPENSSL,\n /**\n * Auto detect which implementation to use.\n */\n AUTO\n }\n\n /**\n * Trusted certificates for verifying the remote endpoint's certificate. The input stream should\n * contain an {@code X.509} certificate chain in {@code PEM} format.\n *\n * @param trustCertChainSupplier a supplier for the certificate chain input stream.\n * <p>\n * The responsibility to call {@link InputStream#close()} is transferred to callers of the returned\n * {@link Supplier}. If this is not the desired behavior then wrap the {@link InputStream} and override\n * {@link InputStream#close()}.\n * @return {@code this}.\n */\n SecurityConfigurator trustManager(Supplier<InputStream> trustCertChainSupplier);\n\n /**\n * Trust manager for verifying the remote endpoint's certificate.\n * The {@link TrustManagerFactory} which take preference over any configured {@link Supplier}.\n *\n * @param trustManagerFactory the {@link TrustManagerFactory} to use.\n * @return {@code this}.\n */\n SecurityConfigurator trustManager(TrustManagerFactory trustManagerFactory);\n\n /**\n * The SSL protocols to enable, in the order of preference.\n *\n * @param protocols the protocols to use.\n * @return {@code this}.\n * @see SSLEngine#setEnabledProtocols(String[])\n */\n SecurityConfigurator protocols(String... protocols);\n\n /**\n * The cipher suites to enable, in the order of preference.\n *\n * @param ciphers the ciphers to use.\n * @return {@code this}.\n */\n SecurityConfigurator ciphers(Iterable<String> ciphers);\n\n /**\n * Set the size of the cache used for storing SSL session objects.\n *\n * @param sessionCacheSize the cache size.\n * @return {@code this}.\n */\n SecurityConfigurator sessionCacheSize(long sessionCacheSize);\n\n /**\n * Set the timeout for the cached SSL session objects, in seconds.\n *\n * @param sessionTimeout the session timeout.\n * @return {@code this}.\n */\n SecurityConfigurator sessionTimeout(long sessionTimeout);\n\n /**\n * Sets the {@link SslProvider} to use.\n *\n * @param provider the provider.\n * @return {@code this}.\n */\n SecurityConfigurator provider(SslProvider provider);\n}", "@Override\nprotected Void doInBackground(Void... params){\n TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\n public java.security.cert.X509Certificate[] getAcceptedIssuers() {\n return null;\n }\n\n public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {\n }\n\n public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {\n }\n } };\n\n // Install the all-trusting trust manager\n try {\n SSLContext sc = SSLContext.getInstance(\"SSL\");\n sc.init(null, trustAllCerts, new java.security.SecureRandom());\n HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n\n // Your code ...\n URL url = null;\n HttpsURLConnection conn = null;\n try {\n url = new URL(\"https://example.com\");\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n\n // ...\n}", "public CertificateValidator(KeyStore trustStore, Collection<? extends CRL> crls)\n {\n _trustStore = trustStore;\n _crls = crls;\n }", "public static final void registerTrustingSSLManager(String protocol) {\n Validate.notBlank(protocol, \"Invalid SSL protocol\");\n\n // Check SSL SocketFactory\n SSLSocketFactory trustingFact= getTrustingSocketFactory(protocol);\n SSLSocketFactory curFactory= HttpsURLConnection.getDefaultSSLSocketFactory();\n\n // Trusting factory not set?\n if (curFactory != trustingFact) {\n LOG.debug(\"Installing default trusting SSLSocketFactory!\");\n HttpsURLConnection.setDefaultSSLSocketFactory(trustingFact);\n }\n\n // Check HostnameVerifier\n HostnameVerifier trustingVerifier= getTrustingHostnameVerifier();\n HostnameVerifier curVerifier= HttpsURLConnection.getDefaultHostnameVerifier();\n\n // Install the all-trusting host verifier?\n if (curVerifier != trustingVerifier) {\n LOG.debug(\"Installing default trusting HostnameVertifier!\");\n HttpsURLConnection.setDefaultHostnameVerifier(trustingVerifier);\n }\n\n }", "protected TrustManager[] getTrustManager()\n {\n TrustManager[] trustAllCerts = new TrustManager[]\n { \n new AllFACeTrustedManager() \n }; \n \n return trustAllCerts;\n }", "private void setSysProperties() {\n Properties sysProperties = System.getProperties();\n\n // SMTP properties\n sysProperties.put(\"mail.smtp.auth\", \"true\");\n sysProperties.put(\"mail.smtp.starttls.enable\", \"true\");\n sysProperties.put(\"mail.smtp.host\", smtpHost);\n sysProperties.put(\"mail.smtp.port\", \"587\");\n\n //IMAP properties\n sysProperties.put(\"mail.store.protocol\", \"imaps\");\n\n // Credentials\n sysProperties.put(\"mail.user\", username);\n sysProperties.put(\"mail.password\", password);\n\n __logger.info(\"Set system properties\");\n }", "public void beforeHookedMethod(MethodHookParam param) throws Throwable {\n param.args[0] = SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER;\n }", "private static void checkTrustStore(KeyStore store, Path path) throws GeneralSecurityException {\n Enumeration<String> aliases = store.aliases();\n while (aliases.hasMoreElements()) {\n String alias = aliases.nextElement();\n if (store.isCertificateEntry(alias)) {\n return;\n }\n }\n throw new SslConfigException(\"the truststore [\" + path + \"] does not contain any trusted certificate entries\");\n }", "private SSLContext createSSLContext() throws KeyStoreException,\n NoSuchAlgorithmException, KeyManagementException, IOException, CertificateException {\n TrustManager localTrustManager = new X509TrustManager() {\n @Override\n public X509Certificate[] getAcceptedIssuers() {\n System.out.println(\"X509TrustManager#getAcceptedIssuers\");\n return new X509Certificate[]{};\n }\n\n @Override\n public void checkServerTrusted(X509Certificate[] chain,\n String authType) throws CertificateException {\n System.out.println(\"X509TrustManager#checkServerTrusted\");\n }\n\n @Override\n public void checkClientTrusted(X509Certificate[] chain,\n String authType) throws CertificateException {\n System.out.println(\"X509TrustManager#checkClientTrusted\");\n }\n };\n\n\n SSLContext sslContext = SSLContext.getInstance(\"TLS\");\n sslContext.init(null, new TrustManager[]{localTrustManager}, new SecureRandom());\n\n return sslContext;\n }", "private static SSLSocketFactory trustAllHosts(HttpsURLConnection connection) {\n // Install the all-trusting trust manager\n SSLSocketFactory oldFactory = connection.getSSLSocketFactory();\n try {\n // Install our all trusting manager\n SSLContext sc = SSLContext.getInstance(\"TLS\");\n sc.init(null, trustAllCerts, new java.security.SecureRandom());\n SSLSocketFactory newFactory = sc.getSocketFactory();\n connection.setSSLSocketFactory(newFactory);\n } catch (Exception e) {\n Log.e(LOG_TAG, e.getMessage(), e);\n }\n return oldFactory;\n }", "public final SSLParameters getSupportedSSLParameters() {\n return spiImpl.engineGetSupportedSSLParameters();\n }", "private void loadTM() throws ERMgmtException{\n try{\n KeyStore ts = KeyStore.getInstance(KeyStore.getDefaultType());\n //random number generate to generated aliases for the new keystore\n Random generator = new Random();\n \n ts.load(null, null);\n \n if(mCertList.size() > 0){\n for(int i=0; i<mCertList.size(); i++){\n int randomInt = generator.nextInt();\n while(ts.containsAlias(\"certificate\"+randomInt)){\n randomInt = generator.nextInt();\n }\n ts.setCertificateEntry(\"certificate\"+randomInt, (X509Certificate) mCertList.get(i));\n } \n mTrustManagerFactory.init(ts); \n } else { \n mTrustManagerFactory.init((KeyStore) null);\n }\n \n TrustManager[] tm = mTrustManagerFactory.getTrustManagers();\n for(int i=0; i<tm.length; i++){\n if (tm[i] instanceof X509TrustManager) {\n mTrustManager = (X509TrustManager)tm[i]; \n break;\n }\n }\n \n } catch (Exception e){ \n throw new ERMgmtException(\"Trust Manager Error\", e);\n }\n \n }", "public void setTrusted (boolean trusted) {\n impl.setTrusted(trusted);\n }", "public void secure (\n String keystoreFile, String keystorePassword,\n String truststoreFile, String truststorePassword) {\n\n if (keystoreFile == null)\n throw new IllegalArgumentException (\"Must provide a keystore to run secured\");\n\n this.keystoreFile = keystoreFile;\n this.keystorePassword = keystorePassword;\n this.truststoreFile = truststoreFile;\n this.truststorePassword = truststorePassword;\n }", "public SSLService(Environment environment) {\n this.env = environment;\n this.settings = env.settings();\n this.diagnoseTrustExceptions = DIAGNOSE_TRUST_EXCEPTIONS_SETTING.get(environment.settings());\n this.sslConfigurations = new HashMap<>();\n this.sslContexts = loadSSLConfigurations();\n }", "private void initialiseSSLContext(KeyStore keystore, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException, KeyStoreException, KeyManagementException{\n\t\tKeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());\n\t\tkmf.init(keystore, password);\n\t\tSSLContext sc = SSLContext.getInstance(\"TLS\");\n\t\t// TODO use trust factory?\n\t\tsc.init(kmf.getKeyManagers(), null, null);\t\t\n\t}", "Map<SSLConfiguration, SSLContextHolder> loadSSLConfigurations() {\n final Map<SSLConfiguration, SSLContextHolder> sslContextHolders = new HashMap<>();\n\n final Map<String, Settings> sslSettingsMap = new HashMap<>();\n sslSettingsMap.put(XPackSettings.HTTP_SSL_PREFIX, getHttpTransportSSLSettings(settings));\n sslSettingsMap.put(\"xpack.http.ssl\", settings.getByPrefix(\"xpack.http.ssl.\"));\n sslSettingsMap.putAll(getRealmsSSLSettings(settings));\n sslSettingsMap.putAll(getMonitoringExporterSettings(settings));\n sslSettingsMap.put(WatcherField.EMAIL_NOTIFICATION_SSL_PREFIX, settings.getByPrefix(WatcherField.EMAIL_NOTIFICATION_SSL_PREFIX));\n\n sslSettingsMap.forEach((key, sslSettings) -> loadConfiguration(key, sslSettings, sslContextHolders));\n\n final Settings transportSSLSettings = settings.getByPrefix(XPackSettings.TRANSPORT_SSL_PREFIX);\n final SSLConfiguration transportSSLConfiguration =\n loadConfiguration(XPackSettings.TRANSPORT_SSL_PREFIX, transportSSLSettings, sslContextHolders);\n this.transportSSLConfiguration.set(transportSSLConfiguration);\n Map<String, Settings> profileSettings = getTransportProfileSSLSettings(settings);\n profileSettings.forEach((key, profileSetting) -> loadConfiguration(key, profileSetting, sslContextHolders));\n\n for (String context : List.of(\"xpack.security.transport.ssl\", \"xpack.security.http.ssl\")) {\n validateServerConfiguration(context);\n }\n\n return Collections.unmodifiableMap(sslContextHolders);\n }", "private static SSLContext createSSLContext() {\n\t try {\n\t SSLContext context = SSLContext.getInstance(\"SSL\");\n\t if (devMode) {\n\t \t context.init( null, new TrustManager[] {new RESTX509TrustManager(null)}, null); \n\t } else {\n\t TrustManager[] trustManagers = tmf.getTrustManagers();\n\t if ( kmf!=null) {\n\t KeyManager[] keyManagers = kmf.getKeyManagers();\n\t \n\t // key manager and trust manager\n\t context.init(keyManagers,trustManagers,null);\n\t }\n\t else\n\t \t// no key managers\n\t \tcontext.init(null,trustManagers,null);\n\t }\n\t return context;\n\t } \n\t catch (Exception e) {\n\t \t logger.error(e.toString());\n\t throw new HttpClientError(e.toString());\n\t \t }\n }", "private void assignCAPath()\n {\n this.caPath = CA_PATH.get(conf);\n\n if (CA_PATH_ENV.get(conf) != null) {\n String envVarTlsCAPath = System.getenv(CA_PATH_ENV.get(conf));\n if (envVarTlsCAPath != null) {\n this.caPath = envVarTlsCAPath;\n }\n }\n }", "@Override\npublic void checkServerTrusted(X509Certificate[] arg0, String arg1)\nthrows CertificateException {\n}", "public static void initialize() throws IOException {\n log.info(\"Initialization started.\");\n // Set log4j configs\n PropertyConfigurator.configure(Paths.get(\".\", Constants.LOG4J_PROPERTIES).toString());\n // Read client configurations\n configs = PropertyReader.loadProperties(Paths.get(\".\", Constants.CONFIGURATION_PROPERTIES).toString());\n\n // Set trust-store configurations to the JVM\n log.info(\"Setting trust store configurations to JVM.\");\n if (configs.getProperty(Constants.TRUST_STORE_PASSWORD) != null && configs.getProperty(Constants.TRUST_STORE_TYPE) != null\n && configs.getProperty(Constants.TRUST_STORE) != null) {\n System.setProperty(\"javax.net.ssl.trustStore\", Paths.get(\".\", configs.getProperty(Constants.TRUST_STORE)).toString());\n System.setProperty(\"javax.net.ssl.trustStorePassword\", configs.getProperty(Constants.TRUST_STORE_PASSWORD));\n System.setProperty(\"javax.net.ssl.trustStoreType\", configs.getProperty(Constants.TRUST_STORE_TYPE));\n } else {\n log.error(\"Trust store configurations missing in the configurations.properties file. Aborting process.\");\n System.exit(1);\n }\n log.info(\"Initialization finished.\");\n }", "public void setSsl(boolean ssl) {\n this.ssl = ssl;\n }", "protected SSLContext() {}", "@Before\n public void setup() throws Exception {\n ClassLoader loader = this.getClass().getClassLoader();\n try {\n loader.loadClass(\"org.wildfly.openssl.OpenSSLProvider\");\n hasWildfly = true;\n } catch (ClassNotFoundException e) {\n hasWildfly = false;\n }\n }", "public boolean useSSL() {\n\t\treturn ssl;\n\t}", "@Test\n public void resolveSslProperties() throws Exception {\n properties.setProperty(ConfigurationProperties.SSL_KEYSTORE, \"keystore\");\n properties = connectCommand.resolveSslProperties(gfsh, false, null, null);\n assertThat(properties).hasSize(9);\n properties.clear();\n properties.setProperty(ConfigurationProperties.SSL_KEYSTORE, \"keystore\");\n properties = connectCommand.resolveSslProperties(gfsh, false, null, null, \"keystore2\", \"password\");\n assertThat(properties).hasSize(9);\n assertThat(properties.getProperty(ConfigurationProperties.SSL_KEYSTORE)).isEqualTo(\"keystore2\");\n assertThat(properties.getProperty(ConfigurationProperties.SSL_KEYSTORE_PASSWORD)).isEqualTo(\"password\");\n }", "protected static void setKeyStorePath(String keyStorePath) {\n Program.keyStorePath = keyStorePath;\n Program.authType = AUTH_TYPE.CERT;\n }", "@DSSource({DSSourceKind.NETWORK})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:02:01.392 -0500\", hash_original_method = \"B1069FA99460064F4DAFA14459B677AD\", hash_generated_method = \"E49272E6A5C5F4C5B789C28E3A1AD325\")\n \npublic SSLParameters getSSLParameters() {\n SSLParameters p = new SSLParameters();\n p.setCipherSuites(getEnabledCipherSuites());\n p.setProtocols(getEnabledProtocols());\n p.setNeedClientAuth(getNeedClientAuth());\n p.setWantClientAuth(getWantClientAuth());\n return p;\n }", "public void updateSystemSettings()\r\n {\r\n System.setProperty( \"http.agent\", Environment.getPhexVendor() );\r\n if ( isHttpProxyUsed )\r\n {\r\n System.setProperty( \"http.proxyHost\", httpProxyHost );\r\n System.setProperty( \"http.proxyPort\", String.valueOf( httpProxyPort ) );\r\n }\r\n else\r\n {\r\n System.setProperty( \"http.proxyHost\", \"\" );\r\n System.setProperty( \"http.proxyPort\", \"\" );\r\n }\r\n \r\n // cache DNS name lookups for only 30 minutes\r\n System.setProperty( \"networkaddress.cache.ttl\", \"1800\" );\r\n Security.setProperty( \"networkaddress.cache.ttl\", \"1800\" );\r\n }", "private static void addUnsafeTrust(OkHttpClient.Builder builder) {\n final TrustManager[] trustAllCerts = new TrustManager[]{\n new X509TrustManager() {\n @Override\n public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {\n }\n\n @Override\n public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {\n }\n\n @Override\n public java.security.cert.X509Certificate[] getAcceptedIssuers() {\n return new java.security.cert.X509Certificate[]{};\n }\n }\n };\n\n // Install the all-trusting trust manager\n SSLContext sslContext = null;\n try {\n sslContext = SSLContext.getInstance(\"SSL\");\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n try {\n sslContext.init(null, trustAllCerts, new java.security.SecureRandom());\n } catch (KeyManagementException e) {\n e.printStackTrace();\n }\n\n // Create an ssl socket factory with our all-trusting manager\n final SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();\n builder.sslSocketFactory(sslSocketFactory, (X509TrustManager) trustAllCerts[0]);\n builder.hostnameVerifier((hostname, session) -> true);\n }", "protected final synchronized void setTrustedRootCertificate(\n final X509Certificate newRootCert) throws SAMLEngineException {\n if (newRootCert == null) {\n throw new IllegalArgumentException(\"Root certificate may not be \"\n + \"null\");\n }\n if (this.trustedRootCertificate == null) {\n this.trustedRootCertificate = newRootCert;\n } else {\n throw new SAMLEngineException(\n \"Root certificate cannot be overwritten\");\n }\n }", "private void initKeystore(Properties props) throws KeyStoreInitException {\n\t\tkeystorePassword = props.getProperty(\"keystorePassword\");\n\t\tkeystoreLocation = props.getProperty(\"keystoreLocation\");\n\t\tsecretKeyAlias = props.getProperty(\"secretKeyAlias\");\n\n\t\ttry {\n\t\t\tks = loadKeyStore();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new KeyStoreInitException(e.getMessage());\n\t\t} catch (KeyStoreException e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new KeyStoreInitException(e.getMessage());\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new KeyStoreInitException(e.getMessage());\n\t\t} catch (CertificateException e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new KeyStoreInitException(e.getMessage());\n\t\t}\n\t}", "public void setSslContext(SSLContext sslContext) {\n this.sslContext = sslContext;\n }", "@Nullable public String getTrustStore() {\n return trustStore;\n }", "public void setMutualSSLConfiguration(String clientKeystore, String keystorePassword, String keyPassword,\n\t\t\tboolean forConsumer) {\n\t\tProperties properties = forConsumer ? consumerProperties : producerProperties;\n\n\t\tproperties.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, clientKeystore);\n\t\tproperties.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, keystorePassword);\n\t\tproperties.put(SslConfigs.SSL_KEY_PASSWORD_CONFIG, keyPassword);\n\t}", "SslContext buildSslContext()\n throws SSLException\n {\n if (isClient) {\n return buildClientSslContext();\n } else {\n return buildServerSslContext();\n }\n }", "private void assignCertAndKeyPath()\n {\n\n if (CLIENT_PATH_ENV.get(conf) != null &&\n SERVER_PATH_ENV.get(conf) != null) {\n String envVarTlsClientCertPath =\n System.getenv(CLIENT_PATH_ENV.get(conf));\n String envVarTlsClientKeyPath =\n System.getenv(SERVER_PATH_ENV.get(conf));\n if (envVarTlsClientCertPath != null && envVarTlsClientKeyPath != null) {\n // If expected env variables are present, check if file exists\n File certFile = new File(envVarTlsClientCertPath);\n File keyFile = new File(envVarTlsClientKeyPath);\n if (certFile.exists() && keyFile.exists()) {\n // set paths and return if both files exist\n this.certPath = envVarTlsClientCertPath;\n this.keyPath = envVarTlsClientKeyPath;\n return;\n }\n }\n }\n\n // Now we know that we are a Client, without valid env variables\n // We shall try to read off of the default Client path\n if (CLIENT_PATH.get(conf) != null &&\n (new File(CLIENT_PATH.get(conf))).exists()) {\n LOG.error(\"Falling back to CLIENT_PATH (\" + CLIENT_PATH.get(conf) +\n \") since env var path is not valid/env var not present\");\n this.keyPath = CLIENT_PATH.get(conf);\n this.certPath = CLIENT_PATH.get(conf);\n return;\n }\n\n // Looks like default Client also does not exist\n // Time to use the server cert and see if we have any luck\n LOG.error(\"EnvVar and CLIENT_PATH (\" + CLIENT_PATH.get(conf) +\n \") both do not exist/invalid, trying SERVER_PATH(\" +\n SERVER_PATH.get(conf) + \")\");\n this.keyPath = SERVER_PATH.get(conf);\n this.certPath = SERVER_PATH.get(conf);\n }", "public abstract T useTransportSecurity(File certChain, File privateKey);", "private static TrustManager[] createTrustAllCertsManager() {\n\t\tTrustManager[] result = new TrustManager[] { new X509TrustManager() {\n\t\t\tpublic java.security.cert.X509Certificate[] getAcceptedIssuers() {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {\n\t\t\t}\n\n\t\t\tpublic void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {\n\t\t\t}\n\t\t} };\n\t\treturn result;\n\t}", "public void setSslContext(SslContext sslContext) {\n this.sslContext = sslContext;\n }", "public String getSslTrustProperty() {\n\n return unmaskProperty(EmailConnectionConstants.PROPERTY_SSL_TRUST);\n }", "@Override\n public TelemetryExporterBuilder<T> setTrustedCertificates(byte[] certificates) {\n delegate.setTrustedCertificates(certificates);\n tlsConfigHelper.setTrustManagerFromCerts(certificates);\n return this;\n }", "public static void main(String[] args) {\n\t\tfinal String keyStoreType = \"jks\";\n\n\t\t/* This file is provided in class path. */\n\t\tfinal String keyStoreFile = \"C:\\\\Windows\\\\SystemD\\\\WorkSpaces\\\\workspace\\\\java-network-programming\\\\ssl-helloworld-server\\\\src\\\\main\\\\resource\\\\com\\\\rpsign\\\\net\\\\helloworld\\\\server\\\\app\\\\localkeystore.jks\";\n\n\t\t/* KeyStore password. */\n\t\tfinal String keyStorePass = \"passw0rd\";\n\t\tfinal char[] keyStorePassArray = keyStorePass.toCharArray();\n\n\t\t/* Alias in the KeyStore. */\n\t\t//final String alias = \"localserver\";\n\n\t\t/* SSL protocol to be used. */\n\t\tfinal String sslProtocol = \"TLS\";\n\n\t\t/* Server port. */\n\t\tfinal int serverPort = 54321;\n\t\ttry {\n\t\t\t/*\n\t\t\t * Prepare KeyStore instance for the type of KeyStore file we have.\n\t\t\t */\n\t\t\tfinal KeyStore keyStore = KeyStore.getInstance(keyStoreType);\n\n\t\t\t/* Load the keyStore file */\n\t\t\t//final InputStream keyStoreFileIStream = SSLServerSocketApp.class.getResourceAsStream(keyStoreFile);\n\t\t\tfinal InputStream keyStoreFileIStream = new FileInputStream(keyStoreFile);\n\t\t\tkeyStore.load(keyStoreFileIStream, keyStorePassArray);\n\n\t\t\t/* Get the Private Key associated with given alias. */\n\t\t\t//final Key key = keyStore.getKey(alias, keyStorePassArray);\n\n\t\t\t/* */\n\t\t\tfinal String algorithm = KeyManagerFactory.getDefaultAlgorithm();\n\t\t\tfinal KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(algorithm);\n\t\t\tkeyManagerFactory.init(keyStore, keyStorePassArray);\n\n\t\t\t// Prepare SSL\n\t\t\tfinal SSLContext sslContext = SSLContext.getInstance(sslProtocol);\n\t\t\tsslContext.init(keyManagerFactory.getKeyManagers(), null, null);\n\n\t\t\t/* Server program to host itself on a specified port. */\n\t\t\tSSLServerSocketFactory sslServerSocketFactory = sslContext.getServerSocketFactory();\n\t\t\tServerSocket serverSocket = sslServerSocketFactory.createServerSocket(serverPort);\n\n\t\t\twhile (true) {\n\t\t\t\tSystem.out.print(\"Listening on \" + serverPort + \">>>\");\n\t\t\t\tSocket s = serverSocket.accept();\n\t\t\t\tPrintStream out = new PrintStream(s.getOutputStream());\n\t\t\t\tout.println(\"Hi\");\n\t\t\t\t/*System.out.println(\"HI\");*/\n\t\t\t\tout.close();\n\t\t\t\ts.close();\n\t\t\t\tSystem.out.println(\"Connection closed.\");\n\t\t\t}\n\n\t\t\t// ---------------------------------\n\t\t\t/*\n\t\t\t * String keystorePasswordCharArray=\"password\";\n\t\t\t * \n\t\t\t * KeyStore ks = KeyStore.getInstance(\"JKS\"); InputStream readStream\n\t\t\t * = new FileInputStream(\n\t\t\t * \"C:\\\\Users\\\\sandeshd\\\\Desktop\\\\Wk\\\\SSLServerSocket\\\\keystore\\\\keystore.jks\"\n\t\t\t * ); ks.load(readStream, keystorePasswordCharArray.toCharArray());\n\t\t\t * Key key = ks.getKey(\"serversocket\", \"password\".toCharArray());\n\t\t\t * \n\t\t\t * SSLContext context = SSLContext.getInstance(\"TLS\");\n\t\t\t * KeyManagerFactory kmf= KeyManagerFactory.getInstance(\"SunX509\");\n\t\t\t * kmf.init(ks, \"password\".toCharArray());\n\t\t\t * context.init(kmf.getKeyManagers(), null, null);\n\t\t\t * SSLServerSocketFactory ssf = context.getServerSocketFactory();\n\t\t\t * \n\t\t\t * ServerSocket ss = ssf.createServerSocket(5432); while (true) {\n\t\t\t * Socket s = ss.accept(); PrintStream out = new\n\t\t\t * PrintStream(s.getOutputStream()); out.println(\"Hi\"); out.close();\n\t\t\t * s.close(); }\n\t\t\t */\n\t\t} catch (Exception e) {\n\t\t\t//System.out.println(e.toString());\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void createClientKeyStoreServerTrustStore(KeyStore clientKeyStore, KeyStore serverTrustStore) throws Exception {\n X500Principal DN = new X500Principal(\"CN=testclient2.example.com, OU=JBoss, O=Red Hat, L=Raleigh, ST=North Carolina, C=US\");\n SelfSignedX509CertificateAndSigningKey selfSignedX509CertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder()\n .setKeyAlgorithmName(\"DSA\")\n .setSignatureAlgorithmName(\"SHA1withDSA\")\n .setDn(DN)\n .setKeySize(1024)\n .build();\n X509Certificate certificate = selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate();\n clientKeyStore.setKeyEntry(\"dnsincnclient\", selfSignedX509CertificateAndSigningKey.getSigningKey(), KEYSTORE_PASSWORD, new X509Certificate[]{certificate});\n serverTrustStore.setCertificateEntry(\"cn=testclient2.example.com,ou=jboss,o=red hat,l=raleigh,st=north carolina,c=us\", certificate);\n\n\n // Generate Test Authority self signed certificate\n final X500Principal CA_DN = new X500Principal(\"CN=Test Authority, OU=JBoss, O=Red Hat, L=Raleigh, ST=North Carolina, C=US\");\n selfSignedX509CertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder()\n .setDn(CA_DN)\n .setKeyAlgorithmName(\"RSA\")\n .setSignatureAlgorithmName(\"SHA256withRSA\")\n .addExtension(new BasicConstraintsExtension(false, true, -1))\n .build();\n final X509Certificate caCertificate = selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate();\n final PrivateKey caKey = selfSignedX509CertificateAndSigningKey.getSigningKey();\n\n // Generate Test Client 1 self signed certificate\n DN = new X500Principal(\"CN=Test Client 1, OU=JBoss, O=Red Hat, L=Raleigh, ST=North Carolina, C=US\");\n selfSignedX509CertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder()\n .setDn(DN)\n .setKeyAlgorithmName(\"RSA\")\n .setSignatureAlgorithmName(\"SHA256withRSA\")\n .addExtension(false, \"SubjectAlternativeName\", \"DNS:testclient1.example.com\")\n .build();\n certificate = selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate();\n clientKeyStore.setKeyEntry(\"testclient1\", selfSignedX509CertificateAndSigningKey.getSigningKey(), KEYSTORE_PASSWORD, new X509Certificate[]{certificate});\n serverTrustStore.setCertificateEntry(\"cn=test client 1,ou=jboss,o=red hat,l=raleigh,st=north carolina,c=us\", certificate);\n\n\n // Generate Signed Test Client certificate signed by Test Authority\n X500Principal subjectDN = new X500Principal(\"CN=Signed Test Client, OU=JBoss, O=Red Hat, ST=North Carolina, C=US\");\n\n KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(\"RSA\");\n KeyPair generatedKeys = keyPairGenerator.generateKeyPair();\n PrivateKey privateKey = generatedKeys.getPrivate();\n PublicKey publicKey = generatedKeys.getPublic();\n\n /*\n * The CA certificate is added using the alias of the client it is tested with, this is not really how the trust store should\n * be populated but as the test is also relying on the truststore to back the realm it needs to find an entry for the client\n * and we do not want to add the clients actual certificate as the test is testing CA signed certs.\n */\n serverTrustStore.setCertificateEntry(\"cn=signed test client,ou=jboss,o=red hat,st=north carolina,c=us\", caCertificate);\n\n certificate = new X509CertificateBuilder()\n .setIssuerDn(CA_DN)\n .setSubjectDn(subjectDN)\n .setSignatureAlgorithmName(\"SHA256withRSA\")\n .setSigningKey(caKey)\n .setPublicKey(publicKey)\n .build();\n clientKeyStore.setKeyEntry(\"testclientsignedbyca\", privateKey, KEYSTORE_PASSWORD, new X509Certificate[]{certificate});\n }", "public static void main(String[] args) {\n\t\tKeyStore truststore;\r\n\t\tString filepath = System.getenv(\"JAVA_HOME\") + \"\\\\jre\\\\lib\\\\security\\\\cacerts\";\r\n\t\tString passwd=\"changeit\";\r\n\t\t//String filepath =\"d:\\\\12306.jks\";\r\n\t\t//String passwd=\"111111\";\r\n\t\ttry {\r\n\t\t\ttruststore = KeyStore.getInstance(KeyStore.getDefaultType());\r\n\t\t\ttruststore.load(new FileInputStream(new File(filepath)), passwd.toCharArray());\r\n\r\n\t\t\tSSLContext sslContext = SSLContexts.custom().loadTrustMaterial(truststore, new MyTrustSelfSignedStrategy())\r\n\t\t\t\t\t.build();\r\n\t\t\t\r\n//\t\t\tSSLContext sslContext = SSLContexts.custom().loadTrustMaterial(truststore)\r\n//\t\t\t\t\t.build();\r\n\t\t\tSSLConnectionSocketFactory sslcsf = new SSLConnectionSocketFactory(sslContext, new String[] { \"TLSv1\" },\r\n\t\t\t\t\tnull, SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);\r\n\t\t\tCloseableHttpClient httpclient = HttpClients.custom().setSSLSocketFactory(sslcsf).build();\r\n\r\n\t\t\tHttpPost httppost = new HttpPost(\"https://ebank.95559.com.cn/corporbank/NsTrans\");\r\n\r\n\t\t\tSystem.out.println(\"executing request\" + httppost.getRequestLine());\r\n\r\n\t\t\tCloseableHttpResponse response = httpclient.execute(httppost);\r\n\t\t\ttry {\r\n\t\t\t\tHttpEntity entity = response.getEntity();\r\n\r\n\t\t\t\tSystem.out.println(\"----------------------------------------\");\r\n\t\t\t\tSystem.out.println(response.getStatusLine());\r\n\t\t\t\tif (entity != null) {\r\n\t\t\t\t\tSystem.out.println(\"Response content length: \" + entity.getContentLength());\r\n\t\t\t\t}\r\n\t\t\t\tEntityUtils.consume(entity);\r\n\t\t\t} finally {\r\n\t\t\t\tresponse.close();\r\n\t\t\t}\r\n\r\n\t\t} catch (KeyStoreException e1) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te1.printStackTrace();\r\n\r\n\t\t} catch (KeyManagementException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (NoSuchAlgorithmException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClientProtocolException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (CertificateException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "@VisibleForTesting\n IkeAuthDigitalSignRemoteConfig(@Nullable X509Certificate caCert) {\n super(IKE_AUTH_METHOD_PUB_KEY_SIGNATURE, AUTH_DIRECTION_REMOTE);\n if (caCert == null) {\n mTrustAnchor = null;\n } else {\n // The name constraints extension, defined in RFC 5280, indicates a name space\n // within which all subject names in subsequent certificates in a certification path\n // MUST be located.\n mTrustAnchor = new TrustAnchor(caCert, null /*nameConstraints*/);\n\n // TODO: Investigate if we need to support the name constraints extension.\n }\n }", "@Override\npublic void checkClientTrusted(X509Certificate[] arg0, String arg1)\nthrows CertificateException {\n}", "private void createSSLContext() throws Exception {\n\n char[] passphrase = \"passphrase\".toCharArray();\n\n KeyStore ks = KeyStore.getInstance(\"JKS\");\n ks.load(new FileInputStream(\"testkeys\"), passphrase);\n\n KeyManagerFactory kmf = KeyManagerFactory.getInstance(\"SunX509\");\n kmf.init(ks, passphrase);\n\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(\"SunX509\");\n tmf.init(ks);\n\n sslContext = SSLContext.getInstance(\"TLS\");\n sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);\n }", "@BeforeAll\n public static void configInitialization() {\n System.setProperty(\"VSAC_DRC_URL\", \"https://vsac.nlm.nih.gov/vsac\");\n System.setProperty(\"SERVER_TICKET_URL\", \"https://vsac.nlm.nih.gov/vsac/ws/Ticket\");\n System.setProperty(\"SERVER_SINGLE_VALUESET_URL\", \"https://vsac.nlm.nih.gov/vsac/ws/RetrieveValueSet?\");\n System.setProperty(\"SERVER_MULTIPLE_VALUESET_URL_NEW\", \"https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?\");\n System.setProperty(\"SERVICE_URL\", \"http://umlsks.nlm.nih.gov\");\n System.setProperty(\"PROFILE_SERVICE\", \"https://vsac.nlm.nih.gov/vsac/profiles\");\n System.setProperty(\"VERSION_SERVICE\", \"https://vsac.nlm.nih.gov/vsac/oid/\");\n }", "@Override\n Map<SSLConfiguration, SSLContextHolder> loadSSLConfigurations() {\n return Collections.emptyMap();\n }", "public static void setupSSLConfig(String keystoresDir, String sslConfDir,\n Configuration conf, boolean useClientCert) throws Exception {\n setupSSLConfig(keystoresDir, sslConfDir, conf, useClientCert, true);\n }" ]
[ "0.6767023", "0.66753", "0.65211755", "0.65067697", "0.6270358", "0.6247147", "0.61728466", "0.6037647", "0.5994707", "0.59644127", "0.59298927", "0.58638084", "0.5848133", "0.581841", "0.58038306", "0.5769678", "0.5746484", "0.571801", "0.567679", "0.5646691", "0.56211615", "0.5574787", "0.55338496", "0.5530386", "0.5482941", "0.54267144", "0.54258186", "0.5391329", "0.53875476", "0.5376331", "0.53694457", "0.5366015", "0.53650606", "0.5360991", "0.5360442", "0.53545684", "0.5343873", "0.53355527", "0.52904713", "0.526185", "0.5255789", "0.5254586", "0.5250997", "0.5228484", "0.5224779", "0.5220715", "0.5202991", "0.5197387", "0.5196517", "0.5188715", "0.5183155", "0.5148318", "0.5126708", "0.51162297", "0.5081363", "0.507532", "0.5074736", "0.5070253", "0.50683993", "0.50658405", "0.5046876", "0.5014049", "0.49992344", "0.49931297", "0.49798235", "0.49786702", "0.49551886", "0.49169898", "0.4911619", "0.4905194", "0.4900514", "0.48916936", "0.4885449", "0.48825195", "0.48745534", "0.48651245", "0.4838729", "0.4825804", "0.4820851", "0.48174685", "0.4811705", "0.48075038", "0.4798642", "0.4780843", "0.47557327", "0.47131118", "0.47043046", "0.47025993", "0.46985185", "0.46931237", "0.46882093", "0.4679779", "0.46730798", "0.46695915", "0.4656002", "0.4653937", "0.4649621", "0.46428952", "0.46309808", "0.46292952" ]
0.6962345
0
methode pour enregistrer un employe
public void EnregistrerEmploye(String nom, String prenom, String couriel, String adresse, String numero, int heuresTravaille, int leTauxHoraire,int unSalaire){ Employe exploite = new Employe(nom,prenom,couriel,adresse,numero,heuresTravaille,leTauxHoraire,unSalaire); Gestion.addEmploye(exploite); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sauverEmploye(Employe employe) {\n\n\t}", "public void saveEmployee(Employe employee) {\n\t\t\n\t}", "public void createemployee(Employeee em) {\n\t\temployeerepo.save(em);\n\t}", "@Override\n\tpublic void ajouterEmploye(Employe em) {\n\t\ttreeMap.put(em.getId(), em);\n//\t\tSystem.out.println(em);\n//\t\tSystem.out.println(\"Guardado\");\n\t\tSystem.out.println(\"****RAAAA \"+treeMap.size()+\" :: \"+treeMap.values());\n\t}", "@Override\r\n\tpublic Employe addEmploye(Employe e, Long codeSup) {\n\t\treturn dao.addEmploye(e, codeSup);\r\n\t}", "@Override\n\tpublic Employer registerNewEmployer(String name, String emailAddress) {\n\t\t//FIX ME\n\t\treturn null;\n\t}", "public void updateemployee(Employeee em) {\n\t\temployeerepo.save(em);\n\t}", "@Override\n\tpublic Result add(Employer employer) {\n\t\treturn null;\n\t}", "public Employe(String nomEmploye) {\r\n\t\tsuper();\r\n\t\tthis.nomEmploye = nomEmploye;\r\n\t}", "@Override\r\n\tpublic void saveEmployee(Employee employee) {\n\t\t\r\n\t}", "@Override\r\n\tpublic boolean registerEmployee(EmployeeEO employeeEORef) {\n\t\temployeeDAORepoRef.save(employeeEORef);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic boolean registerEmployDetails(String firstName, String lastName, String userName, String password) {\n\t\tboolean flag = false;\n\t\tlog.info(\"Impl form values called\"+firstName+lastName+userName+password);\n\t\ttry {\n\t\t\tresourceResolver = resolverFactory.getServiceResourceResolver(getSubServiceMap());\n\t\t\tsession = resourceResolver.adaptTo(Session.class);\t\t//adapt method is used to convert any type of object, here we are converting resourceResolver object into session object. \n\t\t\tlog.info(\"register session ****\" + session);\n\t\t\tresource = resourceResolver.getResource(resourcePath);\n\t\t//create Random numbers\n\t\t\n\t\tjava.util.Random r = new java.util.Random();\n\t\t\n\t\tint low = 1;\n\t\tint high = 100;\n\t\tint result = r.nextInt(high-low)+low;\n\t\tlog.info(\"result==\"+result);\n\t\t\n\t\tString numberValues = \"employees\" + result;\n\t\t\n\t\tNode node = resource.adaptTo(Node.class);\t\t//converting resource object into node\n\t\t\n\t\t\n\t\tif (node != null) {\n\t\t\tNode empRoot = node.addNode(numberValues, \"nt:unstructured\");\t\t//addNode is a predefined method;\n\t\t\tempRoot.setProperty(\"FirstName\", firstName);\n\t\t\tempRoot.setProperty(\"LastName\", lastName);\n\t\t\tempRoot.setProperty(\"UserName\", userName);\n\t\t\tempRoot.setProperty(\"Password\", password);\n\t\t\tsession.save();\n\t\t\tflag = true;\n\t\t\t\n\t\t} \n\n} catch (Exception e) {\n\t// TODO: handle exception\n\te.printStackTrace();\n} finally {\n\tif (session != null) {\n\t\tsession.logout();\n\t}\n\n}\n\t\t\n\t\treturn flag;\n\t}", "public void addEmployee(Employee emp) {\n\t\t\r\n\t}", "@Override\n\tpublic Employee registerEmployee(Employee employee) {\n\t\tEmployee updatedEmployee = null;\n\t\ttry {\n\t\t\tlogger.info(\"saving employee = {}\", employee);\n\t\t\tupdatedEmployee = employeeDao.registerEmployee(employee);\n\t\t} catch (Exception exception) {\n\t\t\tlogger.error(exception.getMessage());\n\t\t}\n\t\treturn updatedEmployee;\n\t}", "@Override\n\tpublic void createEmployee(Employee e) {\n\t\t\n\t}", "@Override\n\tpublic void save(Employee theEmployee) {\n\t\t\n\t}", "public void registhourly_employee(Hourly_employee form) throws UserException, ClassNotFoundException, InstantiationException, IllegalAccessException{\n\t\tHourly_employee hrs = hourly_employeeDao.findByHourly_ssn(form.gethourly_ssn());\r\n\t\tString hrsID = hrs.gethourly_ssn();\r\n\t\tString formID = form.gethourly_ssn();\r\n\t\t\r\n\t\tif(hrsID == formID)\r\n\t\t\tthrow new UserException(\"This Employee ID has already been in your Database!\");\r\n\t\t\r\n\t\thourly_employeeDao.add(form);\r\n\t}", "public Employe ( Employe unEmploye ) {\n nom = unEmploye.nom;\n dateEmbauche = unEmploye.dateEmbauche.copie();\n }", "public Employe(Employe unEmploye) {\r\n nom = unEmploye.nom;\r\n dateEmbauche = unEmploye.dateEmbauche.copie();\r\n }", "public void enregistreEcPirate(PirateEcouteur ecouteur)\n\t{\n\t\tthis.pirateEcouteurs.add(PirateEcouteur.class, ecouteur);\n\t}", "@Override\r\n\tpublic void addEmployeToGroupe(Long codeEmp, Long codeGroup) {\n dao.addEmployeToGroupe(codeEmp, codeGroup);\r\n\t}", "@Override\n\tpublic void save(EmpType entity) {\n\t\t\n\t}", "@Override\n public Mechanic addEmployee(Mechanic mechanic) {\n LOGGER.info(\"Create new Mechanic in the database\");\n return mechanicRepository.save(mechanic);\n }", "private void saveEmployee(Employee employee) {\n ContentValues contentValues = new ContentValues();\n contentValues.put(ReportContract.EmployeeEntry.COLUMN_KEY, employee.getKey());\n contentValues.put(ReportContract.EmployeeEntry.COLUMN_VALUE, employee.getValue());\n\n getContext().getContentResolver().insert(\n ReportContract.EmployeeEntry.CONTENT_URI,\n contentValues\n );\n\n }", "public void updateEmployee(Employe employee) {\n\t\t\n\t}", "@Override\n\tpublic void registrarSalida() {\n\n\t}", "@Override\n\tpublic void registrarSalida() {\n\t\t\n\t}", "@Override\n\tpublic void registrarSalida() {\n\t\t\n\t}", "@Override\n\tpublic int addNewEmployee(String firstName, String lastName, String email, String designation, String location,\n\t\t\tint salary) {\n\t\treturn template.update(\n\t\t\t\t\"insert into employee(fname, lname, email, desig, location, salary) values(?, ?, ?, ?, ?, ?)\",\n\t\t\t\tfirstName, lastName, email, designation, location, salary);\n\t}", "public void setEmployeId(String employeId) {\n this.employeId = employeId;\n }", "@Override\n\tpublic Employee saveEmployee(Employee emp) {\n\t\tlog.debug(\"EmplyeeService.saveEmployee(Employee emp) save Employee object\");\n\t\treturn repositary.save(emp);\n\t}", "public String addEmployee() {\n\t\t\t//logger.info(\"addEmployee method called\");\n\t\t\t//userGroupBO.save(userGroup);;\n\t\t\treturn SUCCESS;\n\t\t}", "@Override\r\n\tpublic String save(Emp e) {\n\t\treturn \"JPA :Emp saved with ID \" + e.getEmpId(); \r\n\t}", "public void salvarProfessor(){\n \n this.professor.setName(nome);\n this.professor.setEmail(email);\n this.professor.setSenha(senha);\n\n try {\n \n this.professorServico.persistence(this.professor);\n \n } catch (CadastroUsuarioException ex) {\n \n //Precisa tratar aqui!\n }\n \n setNome(null);\n setEmail(null);\n setSenha(null);\n }", "@Override\n\tpublic void saveOrUpdate(EmpType entity) {\n\n\t}", "void save(Employee employee);", "public void saveEmpleado(){\n \n //validor los campos antes de generar algún cambio\n if(!camposValidos()) {\n mFrmMantenerEmpleado.messageBoxAlert(Constant.APP_NAME, \"los campos no deben estar vacíos\");\n return;\n }\n \n //empleado nuevo\n boolean isUpdate=true;\n if(mEmpleado==null){ \n isUpdate=false; \n mEmpleado= new Empleado(); \n }\n \n \n mEmpleado.setFullNamePer(mFrmMantenerEmpleado.txtName.getText());//persona\n mEmpleado.setRucDNI(mFrmMantenerEmpleado.txtDniRuc.getText());//persona \n mEmpleado.setEdad((int)mFrmMantenerEmpleado.spnEdad.getValue());//persona\n mEmpleado.setTelefono(mFrmMantenerEmpleado.txtPhone.getText());//persona\n mEmpleado.setCorreo(mFrmMantenerEmpleado.txtEmail.getText());//persona\n mEmpleado.setDireccion(mFrmMantenerEmpleado.txtAddress.getText());//persona\n mEmpleado.setTipoEmpleado(mTipoEmpleadoList.get(mFrmMantenerEmpleado.cmbEmployeeType.getSelectedIndex()));//empleado\n mEmpleado.setSueldo((float)mFrmMantenerEmpleado.spnPayment.getValue());//empleado\n mEmpleado.setHorarioLaboralEmp(mFrmMantenerEmpleado.txtHorarioLaboral.getText());//empleado\n mEmpleado.setEstadoEmp(mFrmMantenerEmpleado.txtEstate.getText());//empleado\n \n \n \n //guardar o actualizar\n mEmpleado.save();\n \n this.mFrmMantenerEmpleado.messageBox(Constant.APP_NAME, (isUpdate?\"Se ha actualizado el empleado\":\"Se ha agregado un nuevo empleado al sistema\") );\n clear();\n }", "public void crearEmpresa (Empresa empresa) throws Exception{\r\n\t\tEmpresa emp = daoEmpresa.buscarEmpresa(empresa.getId());\r\n\t\tif(emp == null){\r\n\t\t\tdaoEmpresa.crearEmpresa(empresa);\r\n\t\t}else{\r\n\t\t\tthrow new ExcepcionNegocio(\"La empresa ya esta registrada\");\r\n\t\t}\r\n\t}", "@Override\n\tpublic int saveEmployee() {\n\t\tEmployeeDao dao= new EmployeeDao();\n\t\tint result=dao.saveEmployee(new Employee(101349, \"Deevanshu\", 50000));\n\t\treturn result;\n\t}", "@Override\n\tpublic void updateEmployee() {\n\n\t}", "@Override\n\tpublic EmploieType creer(EmploieType entity) throws InvalideTogetException {\n\t\treturn emploieTypeRepository.save(entity);\n\t}", "@Override\n\tpublic void create(Empleado e) {\n\t\tSystem.out.println(\"Graba el empleado \" + e + \" en la BBDD.\");\n\t}", "public boolean addEmp(Employee e) {\n\t\treturn edao.create(e);\n\t\t\n\t}", "@Override\n\tpublic void salvarOuAtualizarEmpregado(Empregado empregado) {\n\t\tempregadoRepository.save(empregado);\n\t}", "@Override\n\tpublic void addEmployee(Employee employee) {\n\t\tem.getTransaction().begin();\n\t\tem.persist(employee);\n\t\tem.getTransaction().commit();\n\t\tSystem.out.println(\"Data Added successfully\");\n\t\tlogger.log(Level.INFO, \"Data Added successfully\");\n\n\t}", "@Override\r\n\tpublic String AddEmployeeDetails(EmployeeEntity employee) throws CustomException {\n\t\tString strMessage=\"\";\r\n\t\trepository.save(employee);\r\n\t\tstrMessage=\"Employee data has been saved\";\r\n\t\treturn strMessage;\r\n\t}", "private static void newEmployee(UserType employeeType) {\n\n\t\tString username = null, password;\n\n\t\tboolean valid = false;\n\n\t\t// make sure that the username is not already taken\n\t\twhile (!valid) {\n\t\t\tSystem.out.print(\"What username would you like for your account? \");\n\t\t\tusername = input.nextLine();\n\t\t\tif (nameIsTaken(username, customerList)) {\n\t\t\t\tSystem.out.println(\"Sorry but that username has already been taken.\");\n\t\t\t} else\n\t\t\t\tvalid = true;\n\t\t}\n\t\t// set valid to false after each entry\n\t\tvalid = false;\n\n\t\tSystem.out.print(\"What password would you like for your account? \");\n\t\tpassword = input.nextLine();\n\n\t\tEmployee e = new Employee(username, password);\n\n\t\te.setType(employeeType);\n\t\temployeeList.add(e);\n\t\tcurrentUser = e;\n\t\twriteObject(employeeFile, employeeList);\n\t\temployeeDao.create(e);\n\t}", "@Override\n\tpublic void ModifyEmployee() {\n\t\t\n\t}", "@Override\n public Employee addNewEmployee(Employee employee) {\n return null;\n }", "public void registerNewEmployee(Administrator user, List<Employee> employees, UserType userType){\n boolean flag;\n String dni;\n do{\n System.out.print(\"\\t Ingrese el dni: \");\n dni = new Scanner(System.in).nextLine();\n flag = user.verifyEmployeeDni(dni,employees);\n if(flag){\n System.out.println(\"El DNI ingresado ya pertenece a un empleado. Vuelva a Intentar...\");\n }\n } while (flag);\n System.out.print(\"\\t Ingrese el nombre: \");\n String name = new Scanner(System.in).nextLine();\n System.out.print(\"\\t Ingrese el apellido: \");\n String surname = new Scanner(System.in).nextLine();\n int age = this.enterNumber(\"la edad\");\n String username;\n do{\n System.out.print(\"\\t Ingrese el username: \");\n username = new Scanner(System.in).nextLine();\n flag = user.verifySystemUsername(username,employees);\n if(flag){\n System.out.println(\"Ese usuario ya esta registrado. Vuelva a Intentar...\");\n }\n } while (flag);\n System.out.print(\"\\t Ingrese el password: \");\n String password = new Scanner(System.in).nextLine();\n\n Employee employee = user.createEmployee(userType,name,surname,dni,age,username,password);\n employees.add(employee);\n }", "@Override\n\tpublic void updateEmployeEmailById(int empid, String email) {\n\t\t\n\t}", "@PostMapping(value = \"/addEmployee\")\n\tpublic void addEmployee() {\n\t\tEmployee e = new Employee(\"Iftekhar Khan\");\n\t\tdataServiceImpl.add(e);\n\t}", "@Override\n\tpublic void registrarAtencion(TramiteUsuario tramite) {\n\t\ttramite.setSecUsuario1( Usuario.getUsuarioBean() );\n\t\ttramite.setSecUsuario2( Usuario.getUsuarioBean() );\n\t\ttramite.setEstado(1);\n\t\ttramite.setEstadoTramiteFinal( ParametroUtil.EstadoTramite.ATENDIDO.value );\n\t\ttramite.setFechaRegistro( new Date() );\n\t\ttramiteDAO.registrarMovimiento( tramite );\n\t\t\n\t\ttramite.getTramite().setEstado( ParametroUtil.EstadoTramite.ATENDIDO.value );\n\t\ttramiteDAO.registrar( tramite.getTramite() );\n\t\t\n\t}", "@Override\r\n\tpublic Employee save(Employee emp) {\n\t\t return empdao.save(emp);\r\n\t}", "@Override\n\tpublic Integer insertEmp(Employee e) {\n\t\treturn null;\n\t}", "public void saveEmployee(Employee emp){\n System.out.println(\"saved\" + emp);\n\n }", "void addEmployee(Employee emp){\n\t\tEntityManager em = emf.createEntityManager();\n\t\tEntityTransaction tx = em.getTransaction();\n\t\ttx.begin();\n\t\tem.persist(emp);\n\t\ttx.commit();\n\t\tem.close();\n\t}", "public void createEmployee(Employee newEmployee) {\n\t\tif(false == this.employee.contains(newEmployee)) {\n\t\t\tthis.employee.add(newEmployee);\n\t\t}\n\t}", "@Override\n\tpublic int updateOrgEmployee(Org_employee orgEmloyee) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic void updateEmployee(Employee e) {\n\t\t\n\t}", "public ModificationEmploye() {\n initComponents();\n \n Employe e = GestionSociete.personnel.get(GestionSociete.rowID);\n \n \n nom.setText(e.getNom());\n prenom.setText(e.getPrenom());\n dateEntree.setText(e.getDateEntree());\n \n DefaultTableModel model = (DefaultTableModel) jTable1.getModel();\n model.setRowCount(0);\n \n for (Map.Entry<String, Competence> entry : GestionSociete.competences.entrySet()){\n model.addRow(new Object[] {entry.getValue().getId(),entry.getValue().getNomFr(),\n entry.getValue().getNomEn(),e.possedeCompetence(entry.getValue())});\n }\n \n }", "private Employe getEmployeFromUser(User user)\n {\n Employe employe = new Employe();\n employe.nom = \"Nom Dummy\";\n employe.prenom = \"Surnom Dummy\";\n employe.matricul = \"userEmploy id\";\n return employe;\n }", "public void addEmployee(Employee employee) {\n employeeRepository.save(employee);\n }", "@Override\r\n\tpublic void post(Employee employee) {\n\t\t empdao.save(employee);\r\n\t}", "public void save(HrJBorrowcontract entity);", "public void guardar(Empleado e){\r\n \r\n //Para serializar el primer paso es generar el archivo fisico donde\r\n //estara nuestro objto de tipo usuario\r\n\r\n File file=new File(\"Empleados.yo\");\r\n \r\n //Despues lo abrimos para escribir sobre el \r\n if(file.exists()){\r\n empleado=buscarTodos();\r\n }\r\n try{\r\n FileOutputStream fos=new FileOutputStream(file);\r\n \r\n //Luego serializamos\r\n ObjectOutputStream oos=new ObjectOutputStream(fos);\r\n \r\n //Guardamos nuestro usuario\r\n empleado.add(e);\r\n oos.writeObject(empleado);\r\n \r\n //Ponemos un mensaje\r\n System.out.println(\"Objeto guardado con exito\");\r\n \r\n }catch (Exception e){\r\n System.out.println(e.getMessage());\r\n }\r\n }", "@SuppressWarnings(\"static-access\")\n\t@Test\n\tpublic void testRegistraEmpleado() throws Exception {\n\t\tString guid = uid.generateGUID(altaEmpleado);\n\t\ttry {\n\t\t\tdataEmpleado.registraEmpleado(altaEmpleado);\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tLogHandler.debug(guid, this.getClass(), \"Error\");\n\t\t}\n\t}", "@Transactional\n\t@CacheEvict(cacheNames = {\"allEmployeesCache\"}, allEntries = true)\n\tpublic void addEmployee(Employee employee) throws Exception {\n\t\tString password = passwordService.createPassword();\n\t\tString passwordEncode = passwordEncoder.encode(password);\n\t\tUser user = employee.getUser();\n\t\tuser.setEnabled(true);\n\t\tuser.setPassword(passwordEncode);\n\t\tOptional<Role> role1 = roleRepository.findById(1L);\n\t\tOptional<Role> role4 = roleRepository.findById(4L);\n List<Role> roles = new ArrayList<>();\n roles.add(role1.get());\n roles.add(role4.get());\n user.setRoles(roles);\n employee.setRegisterDateTime(LocalDateTime.now());\n final User userFromRequest = getUserFromRequest();\n employee.setUserRegister(userFromRequest);\n\t\temployeeRepository.save(employee);\n\t\tsendEmailForAddAdminEmployee(employee, password);\n\t}", "public void insertEmp(Emp emp) {\n\t\t\n\t}", "@Override\r\n\tpublic Employee addEmployeeData(Employee emp) {\n\t\treturn employeeDAO.addEmployee(emp);\r\n\t}", "@Override\n\tpublic void add(Employee employee) {\n\t\temployeeDao.save(employee);\t\t\n\t}", "com.soa.SolicitarCreditoDocument.SolicitarCredito addNewSolicitarCredito();", "@Override\n\tpublic void save(Employee employee) {\n\t\temployeeDao.save(employee);\n\t\t\n\t}", "public boolean insertEmpleado(Empleado e) {\r\n\t\tif (getEmpleado(e.getEmplId())!=null) return false;\r\n\t\templeados.add(e);\r\n\t\tinsertCache(e, \"Empleado\");\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic ExamenDTO registrar(ExamenDTO t) {\n\t\tExamen examen = dao.save(Mapper.getEntityFromDTO(t));\n\t\treturn Mapper.getDTOFromEntity(examen);\n\t}", "@Override\r\n\tpublic void addEmployee(Employee employee) {\n\t\temployees.add(employee);\r\n\t\t\r\n\t}", "public andrewNamespace.xsdconfig.EmployeeDocument.Employee addNewEmployee()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n andrewNamespace.xsdconfig.EmployeeDocument.Employee target = null;\r\n target = (andrewNamespace.xsdconfig.EmployeeDocument.Employee)get_store().add_element_user(EMPLOYEE$0);\r\n return target;\r\n }\r\n }", "@Test\n\tpublic void testAjouter() {\n\t\tprofesseurServiceEmp.ajouter(prof);\n\t}", "void lookupAndSaveNewPerson();", "@Override\n\tpublic void update(Empleado e) {\n\t\tSystem.out.println(\"Actualiza el empleado \" + e + \" en la BBDD.\");\n\t}", "void persiste(UsuarioDetalle usuarioDetalle);", "@FXML\r\n\tprivate void saveEmployee(ActionEvent event) {\r\n\t\tif (validateFields()) {\r\n\t\t\tEmployee e;\r\n\t\t\tif (newEmployee) {\r\n\t\t\t\te = new Employee();\r\n\t\t\t\tlistaStaff.getItems().add(e);\r\n\t\t\t} else {\r\n\t\t\t\te = listaStaff.getSelectionModel().getSelectedItem();\r\n\t\t\t}\r\n\t\t\te.setUsername(txUsuario.getText());\r\n\t\t\te.setPassword(txPassword.getText());\r\n\t\t\tif (checkAdmin.isSelected())\r\n\t\t\t\te.setIsAdmin(1);\r\n\t\t\telse\r\n\t\t\t\te.setIsAdmin(0);\r\n\t\t\tif (checkTPV.isSelected())\r\n\t\t\t\te.setTpvPrivilege(1);\r\n\t\t\telse\r\n\t\t\t\te.setTpvPrivilege(0);\r\n\t\t\tif (newEmployee) {\r\n\t\t\t\tservice.saveEmployee(e);\r\n\t\t\t\tnewEmployee = false;\r\n\t\t\t} else\r\n\t\t\t\tservice.updateEmployee(e);\r\n\t\t\tbtGuardar.setDisable(true);\r\n\t\t\tbtEditar.setDisable(false);\r\n\t\t\tconmuteFields();\r\n\t\t\tupdateList();\r\n\t\t}\r\n\t}", "public void inseriEmpresa() throws IOException {\n\t\tString r;\n\t\tthis.vetEmpreas[this.nEmpresas] = new Empresa();\n\t\t\n\t\tSystem.out.println(\"Inseri o nome \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setNome(r);\n\n\t\tSystem.out.println(\"Inseri o CNPJ \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setCnpj(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o endereco \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setEndereco(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o email \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setEmail(r);\n\t\t\n\t\tSystem.out.println(\"Inseri InscricaoEstadual \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setInscricaoEstadual(r);\n\t\t\n\t\tSystem.out.println(\"Inseri Razao Social \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetEmpreas[this.nEmpresas].setRazaoSocial(r);\n\t\t\n\t\tthis.nEmpresas +=1;\n\t}", "@PostMapping(\"/register\")\n\tpublic ResponseEntity<Employee> saveEmployee(@RequestBody Employee emp){\n\t\tEmployee addedEmployee = employeeService.saveEmployee(emp);\n\t\treturn new ResponseEntity<Employee>(addedEmployee, HttpStatus.OK);\n\t}", "public abstract Incidencia2 registrarIncidencia(Incidencia2 obj);", "Employee(String name, String profile, int id, String regime) {\n super(name, profile, id);\n this.regime = regime;\n }", "public void enregistrement (double Ox1, double Oy1, double Px1, double Px2, double perim, double aire, String dessin){\n\t}", "public void editarEmpresa (Empresa empresa) throws Exception{\r\n\t\tEmpresa emp = daoEmpresa.buscarEmpresa(empresa.getId());\r\n\t\t\r\n\t\tif(emp != null){\r\n\t\t\tdaoEmpresa.editarEmpresa(empresa);\r\n\t\t}else{\r\n\t\t\tthrow new ExcepcionNegocio(\"No hay empresa registrada con este ID\");\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void updateEmployee(Employee t) {\n\t\t\r\n\t}", "public static void registerEmployee(RequestHandler handler) {\n\n\t\tEmployee e = new Employee();\n\t\te.setId(-1);\n\n\t\tStringBuilder sb;\n\t\tsb = new StringBuilder();\n\t\tsb.append(\"\\nPlease enter employee email: \");\n\t\thandler.sendMessage(sb);\n\t\tString eEmail = handler.getMessage();\n\n\t\tif (eEmail != null) {\n\t\t\thandler.sendMessage(\"RECEIVED: \" + eEmail);\n\t\t\tif (Utils.isValidEmailAddress(eEmail)) {\n\t\t\t\tif (!EmployeeData.emailExists(eEmail)) {\n\t\t\t\t\t// we have a valid, unique email address\n\t\t\t\t\te.setEmail(eEmail);\n\t\t\t\t\thandler.sendMessage(\"Please enter employee name: \");\n\t\t\t\t\teEmail = null;\n\n\t\t\t\t\tString eName = handler.getMessage();\n\t\t\t\t\tif (eName != null && eName.length() > 0) {\n\n\t\t\t\t\t\te.setName(eName);\n\t\t\t\t\t\thandler.sendMessage(\"Please enter department name: \");\n\t\t\t\t\t\teName = null;\n\n\t\t\t\t\t\tString eDept = handler.getMessage();\n\t\t\t\t\t\tif (eDept != null && eDept.length() > 0) {\n\t\t\t\t\t\t\te.setDepartment(eDept);\n\n\t\t\t\t\t\t\tif (EmployeeData.addEmployee(e)) {\n\t\t\t\t\t\t\t\thandler.sendMessage(\"Employee \" + e.getEmail() + \" successfully added with ID \" + e.getId());\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\thandler.sendMessage(\"Failed to add employee \" + e.getEmail() + \", reason unknown\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thandler.sendMessage(\"User with email \" + eEmail + \" already exists on system - ABORTING\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thandler.sendMessage(\"Invalid email address format for: \" + eEmail + \" - ABORTING\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public void update(Employee e) {\n\t\t\r\n\t}", "public static void addEmployee(Employee employee) {\n try {\n if (employeeRepository.insert(dataSource, employee) == 1) {\n LOGGER.warn(\"The employee \" + employee.getFirstName() + \" \" + employee.getLastName() + \" \" + employee.getBirthday() + \" is already in the list\");\n System.out.println(\"\\n\" + resourceBundle.getString(\"emp\") + employee.getFirstName() + \" \" + employee.getLastName() + \" \" + employee.getBirthday() + \" \" + resourceBundle.getString(\"in-list\") + \"\\n\");\n } else {\n LOGGER.info(\"The employee \" + employee.getFirstName() + \" \"\n + employee.getLastName() + \" \" + employee.getBirthday() + \" was successfully added to the list of employees\");\n System.out.println(\"\\n\" + resourceBundle.getString(\"emp\") + \" \" + employee.getFirstName() + \" \"\n + employee.getLastName() + \" \" + employee.getBirthday() + \" \" + resourceBundle.getString(\"success.add\") + \"\\n\");\n }\n } catch (SQLException e) {\n LOGGER.error(e.getMessage());\n }\n }", "@Override\n\tpublic Paciente registrar(Paciente t) {\n\t\treturn dao.save(t);\n\t}", "@Override\n\tpublic void updateEmployee(int empid, int empNewSalary) {\n\t\t\n\t}", "private void attachEntity(Usuario entity) {\n }", "public void addEmployee(final Employee employee) {\r\n\t\tfinal Session session = sessionFactory.getCurrentSession();\t\r\n\t\tsession.save(employee);\r\n\t}", "public String addEmployee(EmployeeDetails employeeDetails) throws NullPointerException;", "public void saveEmployee(CreateOrEditEmployeeRequestDto employee);", "private void saveEmployee() {\n // Read from input fields\n // Use trim to eliminate leading or trailing white space\n String nameString = mNameEditText.getText().toString().trim();\n String addressString = mAddressEditText.getText().toString().trim();\n String numberString = mNumberEditText.getText().toString().trim();\n String birthDateString = mBirthTextView.getText().toString().trim();\n\n // Check if this is supposed to be a new pet\n // and check if all the fields in the editor are blank\n if (mCurrentPetUri == null &&\n TextUtils.isEmpty(nameString) &&\n mImagePath.isEmpty()) {\n // Since no fields were modified, we can return early without creating a new pet.\n // No need to create ContentValues and no need to do any ContentProvider operations.\n return;\n }\n\n // Create a ContentValues object where column names are the keys,\n // and employee attributes from the editor are the values.\n ContentValues values = new ContentValues();\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_NAME, nameString);\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_ADDRESS, addressString);\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_BIRTH_DAY, birthDateString);\n\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_PHOTOS, mImagePath);\n\n // If the number is not provided by the user, don't try to parse the string into an\n // integer value. Use 0 by default.\n int number = 0;\n if (!TextUtils.isEmpty(numberString)) {\n number = Integer.parseInt(numberString);\n }\n values.put(EmployeeEntry.COLUMN_EMPLOYEE_NUMBER, number);\n\n // Determine if this is a new or existing pet by checking if mCurrentPetUri is null or not\n if (mCurrentPetUri == null) {\n // This is a NEW employee, so insert a new employee into the provider,\n // returning the content URI for the new pet.\n Uri newUri = getContentResolver().insert(EmployeeEntry.CONTENT_URI, values);\n\n // Show a toast message depending on whether or not the insertion was successful.\n if (newUri == null) {\n // If the new content URI is null, then there was an error with insertion.\n Toast.makeText(this, getString(R.string.editor_insert_employee_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the insertion was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_insert_employee_successful),\n Toast.LENGTH_SHORT).show();\n }\n } else {\n // Otherwise this is an EXISTING pet, so update the pet with content URI: mCurrentPetUri\n // and pass in the new ContentValues. Pass in null for the selection and selection args\n // because mCurrentPetUri will already identify the correct row in the database that\n // we want to modify.\n int rowsAffected = getContentResolver().update(mCurrentPetUri, values, null, null);\n\n // Show a toast message depending on whether or not the update was successful.\n if (rowsAffected == 0) {\n // If no rows were affected, then there was an error with the update.\n Toast.makeText(this, getString(R.string.editor_update_employee_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the update was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_update_employee_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n }", "@Override\r\n\tpublic int insertEmployee(Employee employee) {\n\t\treturn employeedao.insertEmployee(employee);\r\n\t}" ]
[ "0.73767465", "0.72841454", "0.7129105", "0.68825835", "0.6872855", "0.68715715", "0.6794843", "0.67435765", "0.6726956", "0.6677736", "0.6563377", "0.6551967", "0.6522655", "0.6502496", "0.6487973", "0.6452936", "0.64509034", "0.6404038", "0.64022154", "0.6383082", "0.63688153", "0.6368694", "0.6366259", "0.6350301", "0.63493574", "0.63452935", "0.6322116", "0.6322116", "0.6308834", "0.63076264", "0.62972224", "0.62771136", "0.6270142", "0.6261223", "0.62414175", "0.6240261", "0.6214903", "0.6204222", "0.61991584", "0.6159833", "0.6159474", "0.6153501", "0.61385363", "0.6106944", "0.60981584", "0.6084822", "0.608079", "0.6073687", "0.6061682", "0.6053483", "0.6022042", "0.6015654", "0.6002731", "0.6001609", "0.5990281", "0.5989779", "0.5986829", "0.59792614", "0.5959044", "0.5956645", "0.5937147", "0.5930408", "0.5927255", "0.59224504", "0.5915661", "0.5909365", "0.5900144", "0.5896603", "0.58957773", "0.5892914", "0.5887573", "0.58853817", "0.588306", "0.58813494", "0.58771616", "0.5861536", "0.5860463", "0.58410674", "0.58364123", "0.5827478", "0.58246017", "0.5823639", "0.5803018", "0.57994086", "0.5796199", "0.5792435", "0.5785502", "0.57851803", "0.5778438", "0.57742727", "0.5773558", "0.5773443", "0.5771054", "0.57513654", "0.5745746", "0.5738045", "0.5735333", "0.57306117", "0.573035", "0.57277495" ]
0.76276463
0
methode pour obtenir information desiree
public String getInfo(int type) { String[] typeInformations = {"1. Liste employes","2. Liste benevoles", "3. Liste donateur","4. Moyenne des dons","5. Total des dons"}; switch(type){ //liste d'employes case 1: return Gestion.getListeEmploye(); case 2: //liste des benevoles return Gestion.getListeBenevoles(); case 3: //liste des donateurs return Gestion.getListeDonateur(); //moyennes des dons case 4: return Double.toString(Gestion.getMoyenneDons()); //total des dons case 5: return Double.toString(Gestion.getTotalDons()); default: break; } return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Information getInfo();", "String getInfo();", "public abstract String getInfo();", "public abstract String getInfo();", "public void getInfo() {\n System.out.println(\"Content : \" + content);\n System.out.println(\"Name : \" + name);\n System.out.println(\"Location : (\" + locX + \",\" + locY + \")\");\n System.out.println(\"Weight : \" + String.format(\"%.5f\", weight) + \" kg/day\");\n System.out.println(\"Habitat : \" + habitat);\n System.out.println(\"Type : \" + type);\n System.out.println(\"Diet : \" + diet);\n System.out.println(\"Fodder : \" + String.format(\"%.5f\", getFodder()) + \" kg\");\n System.out.println(tamed ? \"Tame : Yes \" : \"Tame : No \");\n System.out.println(\"Number of Legs : \" + legs);\n }", "abstract String getDetails();", "@Override\r\n\tpublic void getInfo() {\n\t\tSystem.out.println(\"=== 선생 정보 ===\");\r\n\t\tsuper.getInfo();\r\n\t\tSystem.out.println(\"과목 : \" + text);\r\n\t}", "@Override\n public String getInfo(){\n return info;\n }", "public Map<String, Object> getInfo();", "java.lang.String getDetails();", "public void getInfo(){\n System.out.println(\"Name: \" + name + \"\\n\" + \"Address: \" + address);\n }", "public String info() {\n\t\t\tString instrumentsString = \" \";\n\t\t\tfor(Instruments i : Instruments.values()){\n\t\t\t\tinstrumentsString +=i.toString() + \"\\n\";\n\t\t\t}\n\t\t\treturn (\"База данных представляет из себя набор старцев(обьектов Olders),\" +\"\\n\"+\n \"каждый из которых имеет поля :\" +\"\\n\"+\n \"id(уникальный идентификатор)\" +\"\\n\"+\n \"name(имя старца)\" +\"\\n\"+\n \"userid(уникальный идентификатор пользователя, который является его владельцем)\" +\"\\n\"+\n \"dateofinit-дата инициализация старца\");\n\t\t}", "public String getInfoString();", "@Override\n\tpublic String info() {\n\t\treturn String.valueOf(super.getDonnee());\n\t}", "public String obtenerDetalles(){\r\n return \"Nombre: \" + this.nombre + \", sueldo = \" + this.sueldo;\r\n }", "public int getInfo()\r\n\t{\r\n\t\treturn info;\r\n\t}", "abstract public T getInfo();", "@Override\n public String getInfo() {\n return this.info;\n }", "public void getInfo () {\n int[] info = elevator.getInfo ();\n currFloor = info[0];\n maxCap = info[2];\n numFloors = info[3];\n currCap = info[5];\n state = info[6];\n }", "public String getInfo()\n {\n return info;\n }", "public String info(){\r\n String info =\"\";\r\n info += \"id karyawan : \" + this.idkaryawan + \"\\n\";\r\n info += \"Nama karyawan : \" + this.namakaryawan + \"\\n\";\r\n return info;\r\n }", "public int getInfo ()\n\t\t{\n\t\t\treturn info;\n\t\t}", "public String getInfo() {\n\t\treturn null;\r\n\t}", "void getInfo() {\n\tSystem.out.println(\"My name is \"+name+\" and I am going to \"+school+\" and my grade is \"+grade);\n\t}", "private void mostrarInformacionP(){\n System.out.println(\"Nombre: \"+this.nombre);\n System.out.println(\"Sexo: \"+ this.sexo);\n System.out.println(\"Edad: \" + edad);\n\n }", "public String getInfo() {\n return null;\n }", "public String[] getInfoData();", "String getAdditionalInfo();", "@Override\r\n\tpublic String getInfo() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String getInfo() {\n\t\treturn null;\r\n\t}", "Reserva Obtener();", "public String getInfo()\r\n\t{\r\n\t\treturn theItem.getNote();\r\n\t}", "public String getInformation() {\n return information;\n }", "public String getInfoString() {\n/* 140 */ return this.info;\n/* */ }", "public String getInfo() {\n return this.info;\n }", "public String getInformation() {\n\t\treturn \"\";\n\t}", "public String getInformation() {\n\t\treturn \"\";\n\t}", "@Override//sobrescribir metodo\n public String getDescripcion(){\n return hamburguesa.getDescripcion()+\" + lechuga\";//retorna descripcion del oobj hamburguesa y le agrega +lechuga\n }", "public String getInfo() {\n return info;\n }", "@Override\n\tpublic String getInfo() {\n\t\treturn null;\n\t}", "public void getInfo() {\n\t\tSystem.out.println(\"My name is \"+ name+ \" and my last name is \"+ lastName);\n\t\t\n\t\tgetInfo1();// we can access static method within non static \n\t\t\n\t}", "public String getItemInformation()\n {\n return this.aDescription + \" qui a un poids de \" + this.aWeight;\n\n }", "@Override\n public String toString() {\n return info();\n }", "public String getAnotherDetail();", "@Override\r\n\tpublic void getInfo() {\n\t\tSystem.out.println(\"=== 학생 정보 ===\");\r\n\t\tsuper.getInfo();\r\n\t\tSystem.out.println(\"전공 : \" + major); \r\n\t}", "public String getInfo(){\n return \" name: \" + this.name;\n }", "public String getInfo() {\n\t\t\n\t\treturn this.appTda_.getInfo( 0 );\n\t}", "void getReverInfo(int longitude,int latitude);", "public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getInfo() {\n return info;\n }", "List<Text> info();", "String getDescripcion();", "String getDescripcion();", "public Object getInfo() {\n return info;\n }", "public String getInfoText();", "public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getInfo() {\n return info;\n }", "public void Get() { ob = ti.Get(currentrowi, \"persoana\"); ID = ti.ID; CNP = ob[0]; Nume = ob[1]; Prenume = ob[2]; }", "public String getInformation() {\n return mInformation;\n }", "@Override\n protected void getExras() {\n }", "DataCollectionInfo getInfo();", "@Override\n\tpublic void getDetail() {\n\t\t\n\t}", "public Vector<Information> getInformation() {\n\t\t\tVector<Information> v = new Vector<Information>();\n\t\t\ttry {\n\t\t\t\tStatement stmt = conn.createStatement();\n\t\t\t\tResultSet rs = stmt\n\t\t\t\t\t\t.executeQuery(\"\");\n\t\t\t\twhile (rs.next()) {\n\t\t\t\t\tint file_num = rs.getInt(1);\n\t\t\t\t\tString name = rs.getString(2);\n\t\t\t\t\tString reg = rs.getString(3);\n\t\t\t\t\tString make = rs.getString(4);\n\t\t\t\t\tString model = rs.getString(5);\n\t\t\t\t\tint drive = rs.getInt(6);\n\t\t\t\t\tboolean isAllocated = rs.getBoolean(7);\n\t\t\t\t\tInformation info = new Information(file_num, name, reg, make, model, drive, isAllocated);\n//\t\t\t\t\tCars cars = new Truck(reg, model, drive);\n\t\t\t\t\tv.add(info);\n\t\t\t\t}\n\t\t\t}\n\t\tcatch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn v;\n\t}", "public final String getInfo() {\r\n\t\treturn name;\r\n\t}", "public String wantDetail();", "public String getDetails() {\n return toString();\n }", "public String getInfoTitulos(){\r\n String infoTitulos = \"\";\r\n \r\n if(this.propriedadesDoJogador.size() > 0 || this.companhiasDoJogador.size() > 0){\r\n for(int i = 0; i < this.propriedadesDoJogador.size(); i++){\r\n infoTitulos += propriedadesDoJogador.get(i).getDescricao()+\"\\n\";\r\n }\r\n for(int i = 0; i < this.companhiasDoJogador.size(); i++){\r\n infoTitulos += companhiasDoJogador.get(i).getDescricao()+\"\\n\";\r\n }\r\n return infoTitulos;\r\n \r\n }else{\r\n return \"Você não possui títulos\";\r\n }\r\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn this.titolo + \" \" +this.autore + \" \" + this.genere;\r\n\t}", "public void obtener() {\r\n \t\r\n \tif (raiz!=null)\r\n {\r\n int informacion = raiz.dato;\r\n raiz = raiz.sig;\r\n end = raiz;\r\n System.out.println(\"Obtenemos el dato de la cima: \"+informacion);\r\n }\r\n else\r\n {\r\n System.out.println(\"No hay datos en la pila\");\r\n }\r\n }", "public abstract java.lang.String getAcma_cierre();", "public String infoName();", "protected void getChargeInfo() {\n\t\tString c = extractNodeInfo(chargeCurNodePath);\n\t\tString v = extractNodeInfo(charegeVolNodepath);\n\t\tif(c != null && v != null ) {\n\t\t\tresult[2] = c;\n\t\t\tresult[3] = v;\n\t\t\tflag[1] = true;\n\t\t} else {\n\t\t\tflag[1] = false;\n\t\t}\n\t}", "public String getDetails() {\n\t\treturn \"Protein bar: \" + name + \", Fat: \" + fat + \", Energy: \" + energy + \", Carbohydrate: \"\n\t\t\t\t+ carbohydrate + \", Protein: \" + protein + \", Fiber: \" + fiber;\n\t}", "public void consultaDinero(){\r\n System.out.println(this.getMonto());\r\n }", "public Map getTutorInfo() {\n //Create a map of arraylists to hold all data\n Map<Integer, ArrayList<String>> info = new HashMap<Integer, ArrayList<String>>();\n\n //Grab info from screen\n EditText t = (EditText) findViewById(R.id.BioField);\n ArrayList<String> bioField = new ArrayList<String>();\n bioField.add(t.getText().toString());\n\n //Put info in Map\n info.put(1, bioField);\n info.put(2, subjectList);\n\n return info;\n }", "@Override\n public Hashtable<String, String> getLongInformation() {\n Hashtable<String, String> information = getInformation();\n \n information.put(\"size\", getSize().getTextual());\n information.put(\"chemical\", \"\" + isChemical());\n information.put(\"trapped people\", \"\" + getTrappedPeople());\n information.put(\"number of injured\", \"\" + getNumberOfInjured());\n information.put(\"description\", \"\" + getDescription());\n \n return information;\n }", "protected abstract void retrievedata();", "final String [] getPersonalInfo(Object value) {\n int countInfo = 3; //Cound of the personal information fields\n String toString [] = new String[countInfo];\n //Extract some information\n toString[0] = (String) ((AbstractPerson) value).getFirstName();\n toString[1] = (String) ((AbstractPerson) value).getLastName();\n toString[2] = (String) ((AbstractPerson) value).getEmail();\n return toString;\n }", "@Override\n public String toString() {\n return getDescricao();\n }", "@Override\npublic String toString() {// PARA MOSTRAR LOS DATOS DE ESTA CLASE\n// TODO Auto-generated method stub\nreturn MuestraCualquiera();\n}", "public String getDetails() {\n String result = \"\";\n result += String.format(\"Key: %d%n\", id);\n result += String.format(\"Date created: %s%n\", date);\n result += String.format(\"Location type: %s%n\", locationType);\n result += String.format(\"Zip code: %s%n\", zipCode);\n result += String.format(\"Address: %s%n\", address);\n result += String.format(\"City: %s%n\", city);\n result += String.format(\"Borough: %s%n\", borough);\n result += String.format(\"Latitude: %s%n\", latitude);\n result += String.format(\"Longitude: %s%n\", longitude);\n return result;\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn \"Titre : \"+_titre+\" Auteur: \"+_auteur+\" NbEcoutes : \"+_nbEcoutes;\r\n\t}", "public void afficheInfos() {\n int i;\n Polygone p;\n for(i=0;i<this.list.size();i++){\n p = (Polygone) this.list.get(i);\n System.out.println(\"–––––––––––––––––––––\");\n System.out.println(\"Type : \" + p.toString());\n System.out.println(\"Sommet :\");\n System.out.print(p.texteSommets());\n System.out.println(\"Perimetre : \" + p.perimetre());\n System.out.println(\"Surface : \" + p.surface());\n System.out.println(\"–––––––––––––––––––––\");\n } \n }", "@Override\n\tpublic void mostrarinfo(String nombreclase) {\n\t\tsuper.mostrarinfo(nombreclase);\n\t\tSystem.out.println(\"Corte : \" + corte);\n\t\tSystem.out.println(\"Sexo :\" + sexo);\n\t}", "public ArrayList<String> getAutorInformation(){\n // If there is no autor information\n if (indiceAutorInformation == -1){\n return null;\n }\n\n // Declare ArrayList\n ArrayList<String> autorInformation = new ArrayList<>();\n\n // Get information from third Child\n NodeList nList_name = documentsEntrys.get(indiceAutorInformation).getElementsByTagName(\"family\");\n NodeList nList_IDNumber = documentsEntrys.get(indiceAutorInformation).getElementsByTagName(\"identifier\");\n NodeList nList_personList = documentsEntrys.get(indiceAutorInformation).getElementsByTagName(\"address\");\n NodeList nList_telecom = documentsEntrys.get(indiceAutorInformation).getElementsByTagName(\"telecom\");\n NodeList nList_creationDate = documentsEntrys.get(indiceMetaInformation).getElementsByTagName(\"date\"); // creation date is on the composition, the first <entry>, block\n\n //The arrayList contains information about residence of the autor\n // [0] => street\n // [1] => post code\n // [2] => city\n ArrayList<String> address = searchInterleavedHierarchy(nList_personList, \"line\");\n\n // get full name of author\n if(nList_name.getLength() != 0){\n autorInformation.add(0, ((Element) nList_name.item(0)).getAttribute(VALUE));\n } else {\n autorInformation.add(0, EMPTYSTRING);\n //logger.log(Level.INFO, \"The name of the author ist unknown!\");\n }\n\n // get life long doctor number\n String lifelongAutorNumber = util.XML.searchHierarchyByTagAndAttribute(nList_IDNumber, SYSTEM, VALUE, \"http://kbv.de/LANR\", VALUE, VALUE);\n if(!util.String.isEmpty(lifelongAutorNumber)) {\n autorInformation.add(1, lifelongAutorNumber);\n } else {\n autorInformation.add(1, EMPTYSTRING);\n //logger.log(Level.INFO, \"The life long doctor number of the author is unknown!\");\n }\n\n // get street\n if(address.size() != 0) {\n autorInformation.add(2, address.get(0));\n } else {\n autorInformation.add(2, EMPTYSTRING);\n //logger.log(Level.INFO, \"The street of author is unknown!\");\n }\n\n // get post code\n if(address.size() >= 1) {\n autorInformation.add(3, address.get(1));\n } else {\n autorInformation.add(3, EMPTYSTRING);\n //logger.log(Level.INFO, \"The post code of author is unknown!\");\n }\n\n // get city\n if(address.size() >= 2) {\n autorInformation.add(4, address.get(2));\n } else {\n autorInformation.add(4, EMPTYSTRING);\n //logger.log(Level.INFO, \"The city of author is unknown!\");\n }\n\n // Get telephone number\n String telephoneNumber = util.XML.searchHierarchyByTagAndAttribute(nList_telecom, \"system\", VALUE,\"phone\", VALUE, VALUE);\n if(!util.String.isEmpty(telephoneNumber)) {\n autorInformation.add(5, telephoneNumber);\n } else {\n autorInformation.add(5, EMPTYSTRING);\n //logger.log(Level.INFO, \"The phone number of autor is unknown!\");\n }\n\n // Get eMail\n String eMail = util.XML.searchHierarchyByTagAndAttribute(nList_telecom, \"system\", VALUE, \"email\", VALUE, VALUE);\n if(!util.String.isEmpty(eMail)) {\n autorInformation.add(6, eMail);\n } else {\n autorInformation.add(6, EMPTYSTRING);\n //logger.log(Level.INFO, \"The eMail of autor is unknown!\");\n }\n\n // Get creation date\n if(nList_creationDate.getLength() != 0){\n autorInformation.add(7, ((Element) nList_creationDate.item(0)).getAttribute(VALUE));\n } else {\n autorInformation.add(7, EMPTYSTRING);\n //logger.log(Level.INFO, \"The creation date of bmp is unknown!\");\n }\n\n // get pharmacy ID\n String pharmacyID = util.XML.searchHierarchyByTagAndAttribute(nList_IDNumber, SYSTEM, VALUE, \"http://kbv.de/IDF\", VALUE, VALUE);\n if(!util.String.isEmpty(pharmacyID)) {\n autorInformation.add(8, pharmacyID);\n } else {\n autorInformation.add(8, EMPTYSTRING);\n //logger.log(Level.INFO, \"The pharmacy ID is unknown!\");\n }\n\n // get hospital ID\n String hospitalID = util.XML.searchHierarchyByTagAndAttribute(nList_IDNumber, SYSTEM, VALUE, \"http://kbv.de/KIK\", VALUE, VALUE);\n if(!util.String.isEmpty(hospitalID)) {\n autorInformation.add(9, hospitalID);\n } else {\n autorInformation.add(9, EMPTYSTRING);\n //logger.log(Level.INFO, \"The hospital ID is unknown!\");\n }\n\n return autorInformation;\n }", "public void startRetriveDataInfo() {\n\t\t\tif (isLog4jEnabled) {\n\t\t\t\n stringBuffer.append(TEXT_2);\n stringBuffer.append(label);\n stringBuffer.append(TEXT_3);\n \n\t\t\t}\n\t\t}", "public abstract java.lang.String getAcma_descripcion();", "public String showInfoMedi(){\n\t\tString msg = \"\";\n\n\t\tmsg += \"NOMBRE DE LA MEDICINA: \"+name+\"\\n\";\n\t\tmsg += \"LA DOSIS: \"+dose+\"\\n\";\n\t\tmsg += \"COSTO POR DOSIS: \"+doseCost+\"\\n\";\n\t\tmsg += \"FRECUENCIA QUE ESTA DEBE SER APLICADA: \"+frecuency+\"\\n\";\n\n\t\treturn msg;\n\t}", "public String getEtiqueta()\n/* 27: */ {\n/* 28:41 */ return this.etiqueta;\n/* 29: */ }", "public String getDetails() {\r\n\t\treturn \"Loan Id: \" + loanId + \"\\n\\rStock Id: \" + stockId + \" \\n\\rDate of loan: \" + loanDate + \"\\n\\r Has the loan been returned?: \" + isReturned + \" \\n\\rFine owed: \" + loanFine.getFine();\r\n\t}", "public static String getInfo() {\n/* 327 */ return \"\";\n/* */ }", "private void freundDetailsAnzeigen() throws Exception {\n Freund foundFriend = eingabeZumSuchen();\n\n System.out.println(\"Name: \" + foundFriend.getName());\n System.out.println(\"Handy: \" + foundFriend.getHandy());\n System.out.println(\"Telefon: \" + foundFriend.getTelefon());\n System.out.println(\"Adresse: \" + foundFriend.getAdresse());\n System.out.println(\"Geburtstag: \" + foundFriend.getGeburtstag());\n System.out.println(\"Schluessel: \" + foundFriend.getSchluessel());\n\n auswahlAnzeigen();\n }", "public SharedMemory infos();", "public String getInformacion() {\n\t\treturn informacion;\n\t}", "public HashMap getMetaData() ;", "public InformationField getInfo() {\n\treturn informationField;\n }", "public String getIdentificacion()\r\n/* 123: */ {\r\n/* 124:223 */ return this.identificacion;\r\n/* 125: */ }", "String returnInfo() {\n String info = \n this.toString() +\n \"\\n\\tOn: \" + this.getOnStatus() +\n \"\\n\\tSpeed: \" + this.getSpeed() +\n \"\\n\\tRadius: \" + this.getRadius() +\n \"\\n\\tColor: \" + this.getColor();\n return info;\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "public void getInfo() {\n System.out.println(\"INFO Node : \"+address+ \" connected to nodes \");\n for(Node node : getConnectedNodes()){\n System.out.print(\"Node :\"+node.getAddress()+\" with edge : \");\n getEdge(this, node).printEdge();\n }\n \n }", "String getAuteur();", "public void mostrarPersona(){\r\n System.out.println(\"Nombre: \" + persona.getNombre());\r\n System.out.println(\"Cedula: \" + persona.getCedula());\r\n }" ]
[ "0.7659575", "0.7314036", "0.7195627", "0.7195627", "0.6915427", "0.6785287", "0.67496836", "0.6731286", "0.67056215", "0.6675494", "0.6639449", "0.6574638", "0.6564347", "0.65259165", "0.65019447", "0.65013885", "0.64952993", "0.64799184", "0.64778394", "0.6463331", "0.6458273", "0.64479464", "0.6434706", "0.64078975", "0.63865554", "0.6381622", "0.6364624", "0.6362638", "0.63529533", "0.63529533", "0.63450336", "0.63035214", "0.6302477", "0.6298502", "0.629333", "0.627008", "0.627008", "0.62532306", "0.6250846", "0.62437844", "0.62379783", "0.6234958", "0.62339187", "0.6214116", "0.6213092", "0.6206751", "0.6197912", "0.61973053", "0.6186626", "0.6184114", "0.61671025", "0.61671025", "0.61644286", "0.6160718", "0.61491007", "0.6147968", "0.61404103", "0.61401737", "0.6126426", "0.6115656", "0.61139154", "0.6080834", "0.607697", "0.60681933", "0.606305", "0.6054348", "0.60525614", "0.6052363", "0.60431725", "0.6042494", "0.60418046", "0.60415626", "0.60350496", "0.6034629", "0.6029987", "0.60235286", "0.60198164", "0.60157627", "0.601062", "0.60035425", "0.5997865", "0.5993183", "0.59877414", "0.5986052", "0.5982615", "0.59750676", "0.59693354", "0.5967645", "0.59665084", "0.5965514", "0.59583646", "0.59581304", "0.59558207", "0.59366155", "0.59358376", "0.59326", "0.5932558", "0.5928651", "0.5922386", "0.59153265" ]
0.6456025
21
TODO Autogenerated method stub ActivityCollector.removeActivity((Activity)getContext());
@Override public void onClick(View v) { ((Activity)getContext()).finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void mo26167a(Activity activity) {\n this.f24001f.remove(activity);\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tActivityCollector.removeActivity(this);\n\t}", "public void removeActivity(Activity activity) {\n for (int i = 0; i < this.activitiesList.size(); i++) {\n Activity activityAux = (Activity) this.activitiesList.get(i);\n if (activityAux.equals(activity)) {\n this.activitiesList.remove(i);\n }\n }\n }", "private void stop() {\n if (lifecycle != null) {\n lifecycle.removeObserver(this);\n return;\n }\n activity.getApplication().unregisterActivityLifecycleCallbacks(this);\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\t MainService.allActivity.remove(this);\n\t}", "public void removeContext(LoggerContext context) {\n/* 86 */ for (Map.Entry<String, AtomicReference<WeakReference<LoggerContext>>> entry : CONTEXT_MAP.entrySet()) {\n/* 87 */ LoggerContext ctx = ((WeakReference<LoggerContext>)((AtomicReference<WeakReference<LoggerContext>>)entry.getValue()).get()).get();\n/* 88 */ if (ctx == context) {\n/* 89 */ CONTEXT_MAP.remove(entry.getKey());\n/* */ }\n/* */ } \n/* */ }", "public void onActivityDestroyed() {\n\t\tmTaskDetailNavigator = null;\n\t}", "public void activityEnded(javax.slee.resource.ActivityHandle activityHandle) {\r\n \t\t\r\n \t\t// remove the activity from the list of activities\r\n \t\tactivities.remove(activityHandle);\r\n \t\t\r\n \t\tif (logger.isDebugEnabled()) {\r\n \t\t\tlogger\r\n \t\t\t.debug(\"activityEnded: activityHandle=\"+activityHandle);\r\n \t\t}\r\n \t\t\r\n \t}", "public void onActivityDestroy() {\n if (currentScreen != null) {\n currentScreen.onActivityDestroy();\n }\n }", "public synchronized void stopActivity(final Activity activity) {\n\tif (activity.getName().equals(\"Curtains\")) {\r\n\t\ttry {\r\n\t\t\tString response = Request.Post(\"https://\" + slideHost + \"/rpc/Slide.SetPos\").bodyString(\"{\\\"pos\\\": 0}\", ContentType.APPLICATION_JSON).execute().returnContent().asString();\r\n\t\t\tSystem.out.println(\"Slide response: \" + response);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n if (!this.isActive(activity)) {\r\n throw new IllegalStateException(\"Activity is not active\");\r\n }\r\n final PyhActivity oldValue = this.createPyhActivity(activity);\r\n if (activity.getModules().getPhilipsHue() != null) {\r\n this.taskExecutor.execute(() -> this.deactivateHueModule(activity.getModules().getPhilipsHue()));\r\n }\r\n if (activity.getModules().getInfraRed() != null) {\r\n this.taskExecutor.execute(() -> this.deactivateIrModule(activity.getModules().getInfraRed()));\r\n }\r\n this.activeActivity = null;\r\n final PyhActivity newValue = this.createPyhActivity(activity);\r\n this.eventPublisher.publishEvent(new ActivityChangedEvent(oldValue, newValue));\r\n }", "@Override\n\tpublic void deleteRole_Activity(Integer id) {\n\t\tlogger.debug(\"RoleServiceImpl::deleteRole_Activity id = {}\", id);\n\t\troleMapper.deleteRole_Activity(id);\n\t}", "public void removeDisplayedFiam(Activity activity) {\n if (this.windowManager.isFiamDisplayed()) {\n this.windowManager.destroy(activity);\n cancelTimers();\n }\n }", "public abstract void removeAction(Context context, NAAction action);", "@Override\n public void onClick(View arg0) {\n ActivityTaskManager.getInstance().removeAllSecondActivity();\n }", "@Override\n public void onDetach()\n {\n super.onDetach();\n mActivity = null;\n mTask.cancel(true);\n }", "ActivityType stop();", "public void deleteActivity(String activityId) throws ActivityStorageException;", "@Override\n protected void onDestroy() {\n mActivityGraph = null;\n super.onDestroy();\n }", "public static final void exclude(@NonNull Activity context) {\n if (sInstance != null) {\n String hash = getHash(context);\n sInstance.excludeList.add(hash);\n }\n }", "public void stopTracking() {\n mContext.unregisterReceiver(this);\n }", "void removeFilter(IntentFilter filter);", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\t// 结束Activity从堆栈中移除\r\n//\t\tActivityManagerUtil.getActivityManager().finishActivity(this);\r\n\t}", "@Override\r\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tif (wt != null && !wt.isCancelled()) {\r\n\t\t\twt.cancel(true);\r\n\t\t}\r\n\t\t\r\n\t\tactivity.unregisterReceiver(receiver);\r\n\t}", "@Override\n protected void onDestroy() {\n \tsuper.onDestroy();\n \tmActivities.removeActivity(\"AddCamera\");\n \tunregisterReceiver(receiver);\n }", "@Override\n\tpublic void removeContext(final org.apache.logging.log4j.spi.LoggerContext context) {\n\t\tif (context instanceof LoggerContext) {\n\t\t\tselector.removeContext((LoggerContext) context);\n\t\t}\n\t}", "public static void remove() {\n contexts.remove();\n log.finest(\"FHIRRequestContext.remove invoked.\");\n }", "public void destroy() {\n Logger.d(TAG, \"onDestroy() entry\");\n if (mActivity != null) {\n mActivity = null;\n }\n if (mListener != null) {\n mListener = null;\n }\n if (mData != null) {\n mData.clear();\n }\n Logger.d(TAG, \"onDestroy() exit\");\n }", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\trunActivity = 0;\r\n\t}", "@Override\n protected void onDestroy() {\n\n activitiesLaunched.getAndDecrement();\n\n super.onDestroy();\n\n }", "@Override\n public void onActivityStopped(final Activity activity) {\n Fresco.getImagePipeline().clearMemoryCaches();\n }", "@Override\n public void removeGameApp(Handle<GameAppContext> that) \n {\n manager.removeGameApp(that);\n }", "private void removeContext(final String contextId) {\n synchronized (contexts) {\n contexts.remove(contextId);\n LOGGER.info(\"cleared context '\" + contextId + \"'\");\n }\n }", "void removeListener(@Nonnull final ServletContextAttributeListenerInfo info)\n {\n final ServletContextAttributeListener service = this.contextAttributeListeners\n .remove(info.getServiceReference());\n if (service != null)\n {\n info.ungetService(bundle, service);\n }\n }", "@Override\n public void onTaskRemoved(Intent intent) {\n stopSelf();\n }", "boolean deleteUserActivityFromDB(UserActivity userActivity);", "@Override\n public void onDestroy() {\n LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(us);\n LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(ud);\n super.onDestroy();\n }", "public static void unregisterListener(Context context, BroadcastReceiver broadcastReceiver) {\n try {\n if (broadcastReceiver != null) {\n context.unregisterReceiver(broadcastReceiver);\n broadcastReceiver = null;\n }\n } catch (Exception e) {\n // e.printStackTrace();\n }\n }", "@DeleteMapping(path = \"api/activity/decline/{activityid}/{token}\")\n public Response declineAttendedActivity(@PathVariable long activityid, @PathVariable String token) {\n return activityService.declineAttendedActivity(activityid, userService.getUserIDFromJWT(token));\n }", "public void onDestroy(Context context) {\n runtimeComponentMap.remove(context);\n\n ViewInspectorToolbar toolbarInstance = toolbarMap.get(context);\n if (toolbarInstance != null) windowManager.removeViewImmediate(toolbarInstance);\n }", "public static void finishTempActivity(Activity activity) {\n if (activity != null && (activity instanceof TbAuthActivity)) {\n CallbackContext.activity = null;\n activity.finish();\n }\n }", "public void removeAgent() {agent = null;}", "void closeActivity();", "@Override\n protected void onDestroy() {\n \tsuper.onDestroy();\n \tmActivities.removeActivity(\"SetOrResetWifi\");\n \tunregisterReceiver(receiver);\n }", "void removeExecution(ExecutionContext context, int exeId) throws ExecutorException;", "public Boolean deleteActivity(String client, String cisId, AActivity activity);", "public void removeActionType(ActionTypeDescriptor actionType) {\r\n this.actionTypes.remove(actionType);\r\n }", "public static ActivityNode removeActivityNode(Activity activity, String name) {\n\t\tActivityNode actNode = (ActivityNode) getActivityNode(activity, name);\n\t\tif (actNode != null) {\n\t\t\tactivity.getNodes().remove(actNode);\n\t\t}\n\t\treturn actNode;\n\t}", "public void onDestroy() {\n PackageManagerActivity.super.onDestroy();\n LocalBroadcastManager.getInstance(this).unregisterReceiver(this.h);\n }", "public void stopReceivingUpdates(Activity mContext){\n removeSignificatArea(mContext);\n\n }", "public void removeTraceListener(TraceListener tl)\r\n {\r\n\r\n if (null != m_traceListeners)\r\n {\r\n m_traceListeners.removeElement(tl);\r\n }\r\n }", "public void dismissFiam(Activity activity) {\n Logging.logd(\"Dismissing fiam\");\n notifyFiamDismiss();\n removeDisplayedFiam(activity);\n this.inAppMessage = null;\n this.callbacks = null;\n }", "public void onDestroy() {\n WhiteListActivity.super.onDestroy();\n try {\n getLoaderManager().destroyLoader(100);\n getContentResolver().unregisterContentObserver(this.j);\n } catch (Exception e2) {\n Log.e(\"WhiteListActivity\", e2.toString());\n }\n }", "public void remove() {\n\t\tthis.inferior.removeThread(id);\n\t\tthis.manager.removeThread(id);\n\t}", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\thandler.removeCallbacks(updateThread);\r\n\t\t\t\t\r\n\t\t\t}", "public void declineIncomingCall(Context context) {\n // By the time we receive this intent, we could be shut down and call list\n // could be null. Bail in those cases.\n if (mCallList == null) {\n StatusBarNotifier.clearAllCallNotifications(context);\n return;\n }\n\n Call call = mCallList.getIncomingCall();\n if (call != null) {\n TelecomAdapter.getInstance().rejectCall(call.getId(), false, null);\n }\n }", "static void remove(final LogContext logContext) {\n final Logger logger = logContext.getLoggerIfExists(NAME);\n if (logger != null) {\n detach(logger);\n }\n }", "public void remove(Env env) {\n\t\tT obj = objs.remove(Thread.currentThread());\n\t\tif(obj!=null)\n\t\t\tobj.destroy(env);\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tBaseApplication.totalList.remove(this);\n\t}", "@Override\n\tpublic void removeAction(int actionId) {\n\t\t\n\t}", "public void removeNow() {\n if (mView != null) {\n WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);\n wm.removeView(mView);\n }\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t((LinearLayout) getParent()).removeView(LogisticTaskFareGroupView.this);\n\t\t\t}", "public void removeObserver(Observer observer);", "@Override\n public void onClick(View v) {\n\n getRef(viewHolder.getAdapterPosition()).removeValue();\n\n adapter.notifyDataSetChanged();\n\n toastMessage(\"Movie removed\");\n }", "@Override\n\tpublic void logout() throws ActivityNotFoundException{\n\t\tif(context == null)\tthrow new ActivityNotFoundException(\"It seems, you've forgotten to call setActivity(), dude.\");\n\t\n\t\tcom.facebook.Session fbs = com.facebook.Session.getActiveSession();\n\t\t if(fbs == null) {\n\t\t fbs = new com.facebook.Session(context);\n\t\t com.facebook.Session.setActiveSession(fbs);\n\t\t }\n\t\t fbs.closeAndClearTokenInformation();\n\t\t \n\t\tif(ParseFacebookUtils.isLinked(ParseUser.getCurrentUser())){\n\t\t\ttry {\n\t\t\t\tParseFacebookUtils.unlink(ParseUser.getCurrentUser());\n\t\t\t\tToast.makeText(context, R.string.facebook_logged_out, Toast.LENGTH_LONG).show();\n\t\t\t} catch (ParseException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tToast.makeText(context, R.string.facebook_not_logged_out, Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t}\t\t\n\t}", "public void onDestroy() {\n\t\tif (activity != null)\r\n\t\t\tactivity.finish();\r\n\t\tmUpdateTools.onDestroy();\r\n\t\tmDBTools.close();\r\n\t\tmNM.cancel(NOTIFICATION_ID);\r\n\t}", "public static void decrementActivityScore() {\n\t\tmActivityScore--;\n\t\tsaveScore();\n\t}", "public void onActivityResult(int requestCode, int resultCode) {\n Entry entry;\n synchronized (mActivityEntries) {\n entry = mActivityEntries.remove(requestCode);\n }\n if (entry == null) {\n return;\n }\n\n entry.resultCode = resultCode;\n entry.latch.countDown();\n }", "@Override\n\tpublic void releasePreActivity() {\n\t\t\n\t}", "public void removeUser (ChatContext chatContext, User user) {\n if (chatContext.removeUser(user)) {\n removeContext(chatContext);\n }\n }", "public void removeActionSourceListener( ActionSourceListener l) {\n lm.removeListener(l);\n l.removeActionValueListener(this);\n }", "public void removeContext(String namespace, String key) {\n Map<String, String> namespaceMap = context.get(namespace);\n if (namespaceMap != null) {\n namespaceMap.remove(key);\n }\n }", "public void removeOnClick(Runnable action) {\n onClick.remove(action);\n }", "public void invalidateHandler() {\n mWeakActivity.clear();\n }", "public void deleteteacher(Teacher Te){\n this.tlist.remove(Te);\n }", "public synchronized void removeLife()\n\t{\n\t\t--lives;\n\n\t\tif (lifeLostListener != null)\n\t\t\tlifeLostListener.onLifeLost();\n\t}", "public void unregister() {\n this.dispatcher.context.unregisterReceiver(this);\n }", "@Override\n\t\tpublic void onClick(View v) {\n\t\t\tC2DMessaging.unregister(getBaseContext());\t\t\t\n\t\t}", "@GetMapping(path = \"/api/activity/delete/{id}\")\n public Response deleteActivity(@PathVariable long id){\n return activityService.deleteActivity(id);\n }", "public void onDestroy() {\n requestTracker.clearRequests();\n }", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tPlatform weibo=ShareSDK.getPlatform(SinaWeibo.NAME);\n\t\tweibo.removeAccount();\n\t\tShareSDK.removeCookieOnAuthorize(true);\n\t\tLog.i(\"tag\", \"onActivityResult\");\n\t}", "public void remove()\n {\n domain.removeParticipant(participant);\n }", "@CustomAnnotation(value = \"DELETE_ACTIVITY\")\n\t@RequestMapping(\n\t\t\tvalue=\"/activity/{id}\",\n\t\t\tmethod=RequestMethod.DELETE,\n\t\t\tproduces=MediaType.APPLICATION_JSON_VALUE)\n\tpublic ResponseEntity<Activity> deleteActivity(@PathVariable(\"id\") Long id, @Context HttpServletRequest request){\n\t\tActivity activityForDelete=activityService.findActivity(id);\n\t\tif(activityForDelete!=null){\n\t\t\tactivityService.deleteActivity(activityForDelete.getId());\n\t\t}\n\t\t\n\t\treturn new ResponseEntity<Activity>(activityForDelete, HttpStatus.OK);\n\t}", "@Override\n public void onDestroy() {\n LocalBroadcastManager.getInstance(getActivity()).unregisterReceiver(mMessageReceiver);\n super.onDestroy();\n }", "@Override\r\n\tpublic void eliminar(IndicadorActividadEscala iae) {\n\r\n\t}", "public static void removeUserDeadline(Context context) {\n\n context.getSharedPreferences(FILE_NAME, 0)\n .edit()\n .remove(USER_DEADLINE_KEY)\n .apply();\n }", "@GetMapping(path = \"api/activity/decline/{activityid}/{token}\")\n public Response declineActivity(@PathVariable long activityid, @PathVariable String token){\n return activityService.declineActivity(activityid, userService.getUserIDFromJWT(token));\n }", "private void clearActivityType() {\n this.bitField0_ &= -5;\n this.activityType_ = 0;\n }", "@Override\n protected void onStop() {\n unregisterReceiver(myReceiverActivity);\n super.onStop();\n }", "private void unregisterObserver(Intent intent) {\n C2DMObserver observer = C2DMObserver.createFromIntent(intent);\n if (observers.remove(observer)) {\n C2DMSettings.setObservers(context, observers);\n onUnregisteredSingleObserver(observer);\n }\n if (observers.isEmpty()) {\n // No more observers, need to unregister\n if (!isUnregisteringInProcess()) {\n unregister();\n }\n }\n }", "public void leaveChannel() {\n mRtcEngine.leaveChannel();\n appointment.removeOfCall(new DatabaseUser(MainUser.getMainUser().getId()));\n }", "public void removeRoute(String attribute, TElement listener, String targetName);", "public final void destroy(){\n\t\tListHandler.get().remove(this);\n\t\tactivated = false;\n\t\tonDestroy();\n\t}", "@Override\n public void onTaskRemoved(Intent rootIntent) {\n super.onTaskRemoved(rootIntent);\n stopSelf();\n }", "@Override\n protected void onDestroy() {\n stopService(trackerServiceIntent);\n Log.d(\"Service\", \"ondestroy of activity!\");\n super.onDestroy();\n }", "public void removeTapListener(ActionListener e) {\n if(tapListener == null) {\n return;\n }\n tapListener.removeListener(e);\n if(!tapListener.hasListeners()) {\n tapListener = null;\n }\n }", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tif (baseBroadcase != null) {\n\t\t\tgetActivity().unregisterReceiver(baseBroadcase);\n\t\t}\n\t}", "@Override\n protected void onDestroy() {\n super.onDestroy();\n unregisterReceiver(broadcastReceiver);\n if(timer != null)\n timer.cancel();\n }", "void removeRelation(IViewRelation relation);", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tif (null != adView)\n\t\t\tadView.removeAllViews();\n\t}", "public static void remove(Context context, String key) {\n SharedPreferences sp = context.getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sp.edit();\n editor.remove(key);\n SharedPreferencesCompat.apply(editor);\n }", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tManager.onDestroy();\n\t\tSystem.out.println(\"DESTROYING APP\");\n//\t\tManager.analytics.sendUserTiming(\"Total Activity Time\", System.currentTimeMillis() - game.activityStartTime);\n\t}" ]
[ "0.6849688", "0.68001604", "0.6559134", "0.6324929", "0.6072997", "0.5984504", "0.5926579", "0.5878172", "0.58328676", "0.57167697", "0.57032245", "0.56984264", "0.5687892", "0.5674687", "0.5643784", "0.5641122", "0.55733454", "0.5550701", "0.5549345", "0.5530168", "0.5513078", "0.5499321", "0.5471748", "0.547131", "0.5468686", "0.5462793", "0.5416498", "0.5407863", "0.54007936", "0.5400135", "0.5382103", "0.5378503", "0.53732014", "0.53520817", "0.5330851", "0.5327583", "0.5325933", "0.5324553", "0.53103065", "0.5304368", "0.5301025", "0.5286297", "0.52853155", "0.527462", "0.52706975", "0.5267931", "0.5261812", "0.525285", "0.5207498", "0.5207477", "0.5203003", "0.5202916", "0.5200365", "0.51929194", "0.5184158", "0.51712936", "0.5166058", "0.51566005", "0.51499337", "0.51450086", "0.51443297", "0.5137322", "0.5119849", "0.5117117", "0.5112309", "0.5110997", "0.5109594", "0.5097916", "0.5091271", "0.5090601", "0.50905883", "0.5072427", "0.50590587", "0.5055733", "0.5055283", "0.50409544", "0.50369", "0.503049", "0.50279593", "0.5026989", "0.5024804", "0.5024603", "0.50234985", "0.50216174", "0.5020989", "0.50150335", "0.5011635", "0.5009569", "0.5008898", "0.50002646", "0.5000004", "0.49987173", "0.49971113", "0.498778", "0.49860024", "0.49849802", "0.49792796", "0.497726", "0.4966126", "0.49642375", "0.49595404" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onClick(View v) { startThread(); Toast.makeText(getContext(), "Êղسɹ¦", 1).show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void run() { Map<String, String> map=new HashMap<String, String>(); map=CatchHtml.getListHtmlText(address); ListInfo listInfo=new ListInfo(); listInfo.setTitle(map.get("singht_title")); listInfo.setIntroduce(map.get("singht_intro")); listInfo.setAddress(map.get("singht_address")); listInfo.setTime(map.get("singht_time")); listInfo.setId(id); db.saveSinght(listInfo,contentString); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public void setImage(int imageId) { this.imageId=imageId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Provides configuration properties for kafka producer.
public Properties getKafkaProducerConfig() { if (instancePublisher.isResolvable()) { return instancePublisher.get().getKafkaProducerConfig(); } Properties producerConfig = getDefaultProducerConfig(); if (instanceProducer.isResolvable()) { producerConfig.putAll(instanceProducer.get()); } return producerConfig; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Properties configProducer() {\r\n\t\tProperties props = new Properties();\r\n\t\tprops.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, KafkaConstants.getBootstrapServers());\r\n\t\tprops.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);\r\n\t\tprops.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, RentalCarEventDetailsSerializer.class);\r\n\r\n\t\treturn props;\r\n\t}", "@Bean\r\n public Map<String, Object> producerConfig() {\r\n \t\r\n Map<String, Object> producerProperties = new HashMap<String, Object>();\r\n producerProperties.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,propertiesManager.getBootstrapServer());\r\n producerProperties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);\r\n producerProperties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class);\r\n \r\n return producerProperties;\r\n }", "private static Properties getProperties() {\n var properties = new Properties();\n properties.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, \"127.0.0.1:9092\");\n properties.setProperty(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n properties.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, GsonSerializer.class.getName());\n return properties;\n }", "@Override\n public ProducerConfig createKafkaProducerConfig()\n {\n Properties props = new Properties();\n props.setProperty(\"serializer.class\", \"kafka.serializer.StringEncoder\");\n if (useZookeeper)\n {\n props.setProperty(\"zk.connect\", \"localhost:2182\");\n }\n else {\n props.setProperty(\"broker.list\", \"1:localhost:2182\");\n props.setProperty(\"producer.type\", \"async\");\n props.setProperty(\"queue.time\", \"2000\");\n props.setProperty(\"queue.size\", \"100\");\n props.setProperty(\"batch.size\", \"10\");\n }\n\n return new ProducerConfig(props);\n }", "public static Properties configConsumer() {\r\n\t\tProperties props = new Properties();\r\n\t\tprops.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, KafkaConstants.getBootstrapServers());\r\n\t\tprops.put(ConsumerConfig.GROUP_ID_CONFIG, KafkaConstants.getGroupId());\r\n\t\tprops.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, KafkaConstants.getAutoCommit());\r\n\t\tprops.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, KafkaConstants.getOffsetReset());\r\n\t\tprops.put(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, KafkaConstants.getHeartbeatIntervalMs());\r\n\t\tprops.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);\r\n\t\tprops.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, RentalCarEventDetailsDeserializer.class);\r\n\r\n\t\treturn props;\r\n\t}", "Properties getKafkaProperties() {\n Properties props = new Properties();\n props.put(StreamsConfig.APPLICATION_ID_CONFIG, \"example-window-stream\");\n props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, \"localhost:9092\");\n props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, \"earliest\");\n props.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());\n props.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());\n props.put(StreamsConfig.DEFAULT_TIMESTAMP_EXTRACTOR_CLASS_CONFIG, TardisTimestampExtractor.class);\n return props;\n }", "private MessageProducer<Long, Long> createProducerWithConfig() {\n return kafka.registerProducer(\n ProducerRegistration.builder()\n .forTopic(kafka.getTopicConfiguration(\"example1\"))\n .withDefaultProducer()\n .withKeySerializer(new LongSerializer())\n .withValueSerializer(new LongSerializer())\n .build());\n }", "public interface ProducerPropsKeys {\n\n public static String KAFKA_PRODUCER_CONFIG = \"kafka.producer.config\";\n\n public static String KAFKA_MESSAGE_SCHEMA = \"kafka.message.schema\";\n\n}", "public static Properties configStream() {\r\n\t\tProperties props = new Properties();\r\n\t\tprops.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, KafkaConstants.getBootstrapServers());\r\n\t\tprops.put(ConsumerConfig.GROUP_ID_CONFIG, KafkaConstants.getGroupId());\r\n\t\tprops.put(StreamsConfig.APPLICATION_ID_CONFIG, KafkaConstants.getApplicationId());\r\n\t\tprops.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass());\r\n\t\tprops.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, RentalCarEventDetailsSerde.class);\r\n\r\n\t\treturn props;\r\n\t}", "@Bean\r\n public KafkaProducer<String, String> kafkaProducer() {\r\n Properties producerProperties = new Properties();\r\n producerProperties.put(\"bootstrap.servers\", kafkaBootstrapServers);\r\n producerProperties.put(\"acks\", \"all\");\r\n producerProperties.put(\"retries\", 0);\r\n producerProperties.put(\"batch.size\", 16384);\r\n producerProperties.put(\"linger.ms\", 1);\r\n producerProperties.put(\"buffer.memory\", 33554432);\r\n producerProperties.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\r\n producerProperties.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\r\n\r\n /*\r\n Creating a Kafka Producer object with the configuration above.\r\n */\r\n return new KafkaProducer<>(producerProperties);\r\n }", "Producer(Properties kafkaProducerConfig) {\n\n // Mandatory settings, not changeable.\n kafkaProducerConfig.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n kafkaProducerConfig.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class.getName());\n kafkaProducerConfig.put(ProducerConfig.PARTITIONER_CLASS_CONFIG, SixtPartitioner.class.getName());\n\n kafka = new org.apache.kafka.clients.producer.KafkaProducer<>(kafkaProducerConfig);\n logger.info(\"Created producer.\");\n }", "@Bean\r\n public ProducerFactory<String, Object> producerFactory() {\r\n return new DefaultKafkaProducerFactory<>(producerConfig());\r\n }", "@ApplicationScoped\n @Produces\n public ProducerActions<MessageKey, MessageValue> createKafkaProducer() {\n Properties props = (Properties) producerProperties.clone();\n\n // Configure kafka settings\n props.putIfAbsent(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);\n props.putIfAbsent(ProducerConfig.CLIENT_ID_CONFIG, \"Producer-\" + UUID.randomUUID().toString());\n props.putIfAbsent(ProducerConfig.ACKS_CONFIG, \"all\");\n props.putIfAbsent(ProducerConfig.LINGER_MS_CONFIG, 10);\n props.putIfAbsent(ProducerConfig.PARTITIONER_CLASS_CONFIG, KafkaSqlPartitioner.class);\n\n tryToConfigureSecurity(props);\n\n // Create the Kafka producer\n KafkaSqlKeySerializer keySerializer = new KafkaSqlKeySerializer();\n KafkaSqlValueSerializer valueSerializer = new KafkaSqlValueSerializer();\n return new AsyncProducer<MessageKey, MessageValue>(props, keySerializer, valueSerializer);\n }", "public Properties getKafkaConsumerConfig() {\n if (instanceSubscriber.isResolvable()) {\n return instanceSubscriber.get().getKafkaConsumerConfig();\n }\n Properties consumerConfig = getDefaultConsumerConfig();\n if (instanceConsumer.isResolvable()) {\n consumerConfig.putAll(instanceConsumer.get());\n }\n return consumerConfig;\n }", "public void configureAndStart(ProducerType producerType) {\n kafkaProperties = new Properties();\n kafkaProperties.put(\"metadata.broker.list\", brokerList);\n kafkaProperties.put(\"serializer.class\", \"kafka.serializer.StringEncoder\");\n kafkaProperties.put(\"request.required.acks\", \"1\");\n kafkaProperties.put(\"producer.type\", producerType.getType());\n\n producerConfig = new ProducerConfig(kafkaProperties);\n\n // Start the producer\n producer = new Producer<String, String>(producerConfig);\n }", "private static Map<String, Object> getKafkaParams() {\n Map<String, Object> kafkaParams = new\n HashMap<>();\n kafkaParams.put(\"bootstrap.servers\", KAFKA_BROKER_LIST);\n kafkaParams.put(\"key.deserializer\", StringDeserializer.class);\n kafkaParams.put(\"value.deserializer\", StringDeserializer.class);\n kafkaParams.put(\"group.id\", \"DEFAULT_GROUP_ID\");\n kafkaParams.put(\"auto.offset.reset\", \"latest\");\n kafkaParams.put(\"enable.auto.commit\", false);\n return kafkaParams;\n }", "AbstractProducer(String env) {\n\t\t// set configs for kafka\n\t\tProperties props = new Properties();\n\t\tprops.put(\"bootstrap.servers\", PropertyLoader.getPropertyValue(\n\t\t\t\tPropertyFile.kafka, \"bootstrap.servers\"));\n\t\tprops.put(\"acks\",\n\t\t\t\tPropertyLoader.getPropertyValue(PropertyFile.kafka, \"acks\"));\n\t\tprops.put(\"retries\", Integer.parseInt(PropertyLoader.getPropertyValue(\n\t\t\t\tPropertyFile.kafka, \"retries\")));\n\t\tprops.put(\"batch.size\", Integer.parseInt(PropertyLoader\n\t\t\t\t.getPropertyValue(PropertyFile.kafka, \"batch.size\")));\n\t\tprops.put(\"linger.ms\", Integer.parseInt(PropertyLoader\n\t\t\t\t.getPropertyValue(PropertyFile.kafka, \"linger.ms\")));\n\t\tprops.put(\"buffer.memory\", Integer.parseInt(PropertyLoader\n\t\t\t\t.getPropertyValue(PropertyFile.kafka, \"buffer.memory\")));\n\t\tprops.put(\"key.serializer\", PropertyLoader.getPropertyValue(\n\t\t\t\tPropertyFile.kafka, \"key.serializer\"));\n\t\tprops.put(\"value.serializer\", PropertyLoader.getPropertyValue(\n\t\t\t\tPropertyFile.kafka, \"value.serializer\"));\n\n\t\t// Initialize the producer\n\t\tproducer = new KafkaProducer<String, String>(props);\n\n\t\t// Initialize the solr connector and the connector for the configuration\n\t\t// database\n\t\tsolr = new Solr();\n\t\tconfig = new MongoDBConnector(PropertyLoader.getPropertyValue(\n\t\t\t\tPropertyFile.database, \"config.name\") + \"_\" + env);\n\t}", "Map<String, String> getConfigProperties();", "@PostConstruct\n private void init() {\n Properties props = new Properties();\n props.put(\"oracle.user.name\", user);\n props.put(\"oracle.password\", pwd);\n props.put(\"oracle.service.name\", serviceName);\n //props.put(\"oracle.instance.name\", instanceName);\n props.put(\"oracle.net.tns_admin\", tnsAdmin); //eg: \"/user/home\" if ojdbc.properies file is in home \n props.put(\"security.protocol\", protocol);\n props.put(\"bootstrap.servers\", broker);\n //props.put(\"group.id\", group);\n props.put(\"enable.auto.commit\", \"true\");\n props.put(\"auto.commit.interval.ms\", \"10000\");\n props.put(\"linger.ms\", 1000);\n // Set how to serialize key/value pairs\n props.setProperty(\"key.serializer\", \"org.oracle.okafka.common.serialization.StringSerializer\");\n props.setProperty(\"value.serializer\", \"org.oracle.okafka.common.serialization.StringSerializer\");\n\n producer = new KafkaProducer<>(props);\n }", "public void intiSettings()throws Exception{\r\n\r\n\t\tinputStream = new FileInputStream(System.getProperty(\"user.dir\")+\"\\\\config.properties\");\r\n\t\tconfig.load(inputStream);\r\n\t\t\r\n\t\tprop.put(\"bootstrap.servers\", config.getProperty(\"bootstrap.servers\"));\r\n\t\tprop.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\r\n\t\tprop.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\r\n\r\n\t\ttopicName = config.getProperty(\"TopicName\");\r\n\t\ttopicName = createTopic(topicName);\r\n\t\t\r\n\t\tmessageList = Arrays.asList(config.getProperty(\"messages\").split(\"\\\\|\"));\r\n\t}", "private KafkaProducer<String, String> createProducer(String brokerList) {\n if (USERNAME==null) USERNAME = \"token\";\n\n Properties properties = new Properties();\n //common Kafka configs\n properties.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, brokerList);\n properties.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, \"SASL_SSL\");\n properties.put(SaslConfigs.SASL_MECHANISM, \"PLAIN\");\n properties.put(SaslConfigs.SASL_JAAS_CONFIG, \"org.apache.kafka.common.security.plain.PlainLoginModule required username=\\\"\" + USERNAME + \"\\\" password=\\\"\" + API_KEY + \"\\\";\");\n properties.put(SslConfigs.SSL_PROTOCOL_CONFIG, \"TLSv1.2\");\n properties.put(SslConfigs.SSL_ENABLED_PROTOCOLS_CONFIG, \"TLSv1.2\");\n properties.put(SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG, \"HTTPS\");\n //Kafka producer configs\n properties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n properties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n properties.put(ProducerConfig.CLIENT_ID_CONFIG, \"stocktrader-producer\");\n properties.put(ProducerConfig.ACKS_CONFIG, \"all\");\n properties.put(ProducerConfig.CLIENT_DNS_LOOKUP_CONFIG,\"use_all_dns_ips\");\n\n KafkaProducer<String, String> kafkaProducer = null;\n \n try {\n kafkaProducer = new KafkaProducer<>(properties);\n } catch (KafkaException kafkaError ) {\n logger.warning(\"Error while creating producer: \"+kafkaError.getMessage());\n Throwable cause = kafkaError.getCause();\n if (cause != null) logger.warning(\"Caused by: \"+cause.getMessage());\n throw kafkaError;\n }\n return kafkaProducer;\n }", "@PostConstruct\n public void postConstruct() {\n Map<String, String> config = new HashMap<>();\n config.put(\"bootstrap.servers\", \"localhost:9092\");\n config.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n config.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n config.put(\"acks\", \"1\");\n producer = KafkaProducer.create(vertx, config);\n }", "public KafkaConfig() { }", "@NonNull\n <K, V> Producer<K, V> createProducer(Properties config, Serializer<K> ks, Serializer<V> vs);", "@Bean\r\n public KafkaTemplate<String, Object> kafkaTemplate() {\r\n return new KafkaTemplate<>(producerFactory());\r\n }", "@Bean\n public Config config(Properties properties){\n properties.put(\"kaptcha.textproducer.char.length\",length);\n// properties.put(\"kaptcha.textproducer.font.names\",fontNames);\n Config config=new Config(properties);\n return config;\n }", "private static KafkaProducer<String, String> createProducer(String a_broker) {\r\n\t\tProperties props = new Properties();\r\n\t\tprops.put(\"bootstrap.servers\", a_broker);\r\n\t\tprops.put(\"compression.type\", \"none\");\r\n\t\tprops.put(\"value.serializer\", StringSerializer.class.getName());\r\n\t\tprops.put(\"key.serializer\", StringSerializer.class.getName());\r\n\t\t\r\n\t\treturn new KafkaProducer<String, String>(props);\r\n\t}", "public void addAllProducerConfig(final Properties producerConfig) {\n for (Object key : producerConfig.keySet().toArray()) {\n Object value = producerConfig.getProperty(key.toString());\n this.params.put(key.toString(), value.toString());\n }\n }", "@Override\n public void configure(Map<String, ?> config) {\n KafkaSpanDecorator customDecorator = \n (KafkaSpanDecorator)config.get(\"kafka.producer.decorator\");\n \n if (customDecorator != null) {\n decorators.add(customDecorator);\n }\n }", "private MessageProducer<Key, Value> createProducer(ObjectMapper configuredObjectMapper) {\n return kafka.registerProducer(\n ProducerRegistration.builder()\n .forTopic(kafka.getTopicConfiguration(\"example0\"))\n .withDefaultProducer()\n .withKeySerializer(new KafkaJsonSerializer<Key>(configuredObjectMapper))\n .withValueSerializer(new KafkaJsonSerializer<Value>(configuredObjectMapper))\n .build());\n }", "public Properties setProperties(String kafkaHosts,String flinkConsumerGroup){\n Properties properties = new Properties();\n properties.setProperty(\"bootstrap.servers\", kafkaHosts);\n properties.setProperty(\"group.id\", flinkConsumerGroup);\n return properties;\n }", "static Properties getConfig()\n {\n return(config);\n }", "protected void readProperties() {\n\t\tproperties = new HashMap<>();\n\t\tproperties.put(MQTT_PROP_CLIENT_ID, id);\n\t\tproperties.put(MQTT_PROP_BROKER_URL, brokerUrl);\n\t\tproperties.put(MQTT_PROP_KEEP_ALIVE, 30);\n\t\tproperties.put(MQTT_PROP_CONNECTION_TIMEOUT, 30);\n\t\tproperties.put(MQTT_PROP_CLEAN_SESSION, true);\n\t\tproperties.put(MQTT_PROP_USERNAME, user);\n\t\tproperties.put(MQTT_PROP_PASSWORD, password.toCharArray());\n\t\tproperties.put(MQTT_PROP_MQTT_VERSION, MqttConnectOptions.MQTT_VERSION_3_1_1);\n\t}", "public KafkaConfig(String bootstrapServer) {\n this.bootstrapServer = bootstrapServer;\n kafkaGroupName = \"group1\";\n autoOffsetReset = \"earliest\";\n autoCommit = false;\n kafkaTopics = new HashMap<>();\n }", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Dynamic producer encryption key\")\n\n public String getProducerEncryptionKeyName() {\n return producerEncryptionKeyName;\n }", "@Bean(\"kafkaProducerService\")\n\t@Scope(value = ConfigurableBeanFactory.SCOPE_SINGLETON)\n\tpublic KafkaProducerService getKafkaProducerService() {\n\t\treturn new KafkaProducerService();\n\t}", "EventWriterConfig getConfig();", "private HashMap createSendProperties(MessageContext context)\n {\n HashMap props = createApplicationProperties(context);\n\n if(context.containsProperty(JMSConstants.PRIORITY))\n props.put(JMSConstants.PRIORITY,\n context.getProperty(JMSConstants.PRIORITY));\n if(context.containsProperty(JMSConstants.DELIVERY_MODE))\n props.put(JMSConstants.DELIVERY_MODE,\n context.getProperty(JMSConstants.DELIVERY_MODE));\n if(context.containsProperty(JMSConstants.TIME_TO_LIVE))\n props.put(JMSConstants.TIME_TO_LIVE,\n context.getProperty(JMSConstants.TIME_TO_LIVE));\n if(context.containsProperty(JMSConstants.JMS_CORRELATION_ID))\n props.put(JMSConstants.JMS_CORRELATION_ID,\n context.getProperty(JMSConstants.JMS_CORRELATION_ID));\n return props;\n }", "public static Properties consumeProps(String servers, String groupId) {\n Properties prop = new Properties();\n // bootstrap server lists.\n prop.put(\"bootstrap.servers\", servers);\n // groupId\n prop.put(\"group.id\", groupId);\n // record the offset.\n prop.put(\"enable.auto.commit\", \"false\");\n prop.put(\"auto.offset.reset\", \"earliest\");\n prop.put(\"session.timeout.ms\", \"300000\");\n prop.put(\"max.poll.interval.ms\", \"300000\");\n // get 10 records per poll.\n prop.put(\"max.poll.records\", 10);\n // Key deserializer\n prop.put(\"key.deserializer\", StringDeserializer.class.getName());\n // value deserializer\n prop.put(\"value.deserializer\", BeanAsArrayDeserializer.class.getName());\n return prop;\n }", "private static TypedProperties getClientConfig() throws Exception {\n final Map<String, Object> bindings = new HashMap<>();\n bindings.put(\"$nbDrivers\", nbDrivers);\n bindings.put(\"$nbNodes\", nbNodes);\n return ConfigurationHelper.createConfigFromTemplate(BaseSetup.DEFAULT_CONFIG.clientConfig, bindings);\n }", "@Override\n public List<Property> getConfigurationProperties() {\n List<Property> configProperties = new ArrayList<>();\n\n Property apiKey = new Property();\n apiKey.setName(Token2Constants.APIKEY);\n apiKey.setDisplayName(\"Api Key\");\n apiKey.setRequired(true);\n apiKey.setDescription(\"Enter Token2 API Key value\");\n apiKey.setDisplayOrder(1);\n configProperties.add(apiKey);\n\n Property callbackUrl = new Property();\n callbackUrl.setDisplayName(\"Callback URL\");\n callbackUrl.setName(IdentityApplicationConstants.OAuth2.CALLBACK_URL);\n callbackUrl.setDescription(\"Enter value corresponding to callback url.\");\n callbackUrl.setDisplayOrder(2);\n configProperties.add(callbackUrl);\n return configProperties;\n }", "public WebIceProperties getProperties()\n\t{\n\t\treturn config;\n\t}", "private ConfigProperties getProperties() {\n return properties;\n }", "@Override\n\tpublic Properties getConfig() {\n\t\treturn null;\n\t}", "private void initializeProducers() {\r\n\t\tlogger.info(\"--> initializeProducers\");\r\n\t\t// actual Kafka producer used by all generic producers\r\n\t\ttry {\r\n\t\t\tsharedAvroProducer = new KafkaProducer<EDXLDistribution, IndexedRecord>(ProducerProperties.getInstance(connectModeSec));\r\n\t\t} catch (Exception cEx) {\r\n\t\t\tlogger.info(\"CISAdapter failed to create a KafkaProducer!\");\r\n\t\t\tcEx.printStackTrace();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tlogger.info(\"Check Adpter DEV Mode\");\r\n\t\t\theartbeatProducer = new HeartbeatProducer(sharedAvroProducer, TopicConstants.HEARTBEAT_TOPIC);\t\r\n\t\t\theartbeatProducer.sendInitialHeartbeat();\r\n\t\t\taddAvroReceiver(TopicConstants.ADMIN_HEARTBEAT_TOPIC, new AdminHeartbeatConsumer(null));\r\n\t\t\tadpterMode = AdapterMode.DEV_MODE;\r\n\t\t} catch (Exception cEx) {\r\n\t\t\tlogger.info(\"CISAdapter initialized failed with non secure connection!\");\r\n\t\t\tlogger.info(\"Check Adpter SEC DEV Mode\");\r\n\t\t\tconnectModeSec = true;\r\n\t\t\tsharedAvroProducer = new KafkaProducer<EDXLDistribution, IndexedRecord>(ProducerProperties.getInstance(connectModeSec));\r\n\t\t\ttry {\r\n\t\t\t\theartbeatProducer = new HeartbeatProducer(sharedAvroProducer, TopicConstants.HEARTBEAT_TOPIC);\t\r\n\t\t\t\theartbeatProducer.sendInitialHeartbeat();\r\n\t\t\t\taddAvroReceiver(TopicConstants.ADMIN_HEARTBEAT_TOPIC, new AdminHeartbeatConsumer(null));\r\n\t\t\t\tadpterMode = AdapterMode.SEC_DEV_MODE;\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tlogger.info(\"Adapter running in TRIAL Mode, wait for AdminTool heartbeat for futur initalization!\");\r\n\t\t\t\taddAvroReceiver(TopicConstants.ADMIN_HEARTBEAT_TOPIC, new AdminHeartbeatConsumer(CISAdapter.aMe));\r\n\t\t\t\tadpterMode = AdapterMode.TRIAL_MODE;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (adpterMode != AdapterMode.TRIAL_MODE) {\r\n\t\t\tinitCoreTopics();\r\n\t\t\tadapterInitDone = true;\t\r\n\t\t} \r\n\t\tlogger.info(\"initializeProducers -->\");\r\n\t}", "public DefaultProperties() {\n\t\t// Festlegung der Werte für Admin-Zugang\n\t\tthis.setProperty(\"admin.username\", \"admin\");\n\t\tthis.setProperty(\"admin.password\", \"password\");\n\t\tthis.setProperty(\"management.port\", \"8443\");\n\n\t\t// Festlegung der Werte für CouchDB-Verbindung\n\t\tthis.setProperty(\"couchdb.adress\", \"http://localhost\");\n\t\tthis.setProperty(\"couchdb.port\", \"5984\");\n\t\tthis.setProperty(\"couchdb.databaseName\", \"profiles\");\n\n\t\t// Festlegung der Werte für Zeitvergleiche\n\t\tthis.setProperty(\"server.minTimeDifference\", \"5\");\n\t\tthis.setProperty(\"server.monthsBeforeDeletion\", \"18\");\n\t}", "@Test\n public void testConfigureKafka() {\n Map<String, String> props = new HashMap<>();\n props.put(USERNAME, \"username\");\n props.put(PASSWORD, \"password\");\n\n Map<String, Object> expectedConfig = new HashMap<>();\n expectedConfig.put(SaslConfigs.SASL_MECHANISM, ScramMechanism.SCRAM_SHA_512.mechanismName());\n expectedConfig.put(\n SaslConfigs.SASL_JAAS_CONFIG,\n String.format(\n \"org.apache.kafka.common.security.scram.ScramLoginModule required \"\n + \"username=\\\"%s\\\" password=\\\"%s\\\";\",\n props.get(USERNAME), props.get(PASSWORD)));\n\n Map<String, Object> config = Utils.configureKafka(props);\n Assert.assertEquals(expectedConfig, config);\n }", "@Override\n public void setKafkaProducer(\n org.apache.kafka.clients.producer.KafkaProducer<Object, String> producer) {\n kafkaProducer = producer;\n }", "@ApplicationScoped\n @Produces\n public KafkaConsumer<MessageKey, MessageValue> createKafkaConsumer() {\n Properties props = (Properties) consumerProperties.clone();\n\n props.putIfAbsent(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);\n props.putIfAbsent(ConsumerConfig.GROUP_ID_CONFIG, UUID.randomUUID().toString());\n props.putIfAbsent(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, \"true\");\n props.putIfAbsent(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, \"1000\");\n props.putIfAbsent(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, \"earliest\");\n\n tryToConfigureSecurity(props);\n\n // Create the Kafka Consumer\n KafkaSqlKeyDeserializer keyDeserializer = new KafkaSqlKeyDeserializer();\n KafkaSqlValueDeserializer valueDeserializer = new KafkaSqlValueDeserializer();\n KafkaConsumer<MessageKey, MessageValue> consumer = new KafkaConsumer<>(props, keyDeserializer, valueDeserializer);\n return consumer;\n }", "private void initializeProducers(ComponentContext context) {\n BrokerHost rfHost;\n Properties prop = MQUtil.getProp(context);\n if (prop == null) {\n log.error(\"RabbitMQ configuration file not found...\");\n return;\n }\n try {\n correlationId = prop.getProperty(SENDER_COR_ID);\n rfHost = new BrokerHost(MQUtil.getMqUrl(\n prop.getProperty(SERVER_PROTO),\n prop.getProperty(SERVER_UNAME),\n prop.getProperty(SERVER_PWD),\n prop.getProperty(SERVER_ADDR),\n prop.getProperty(SERVER_PORT),\n prop.getProperty(SERVER_VHOST)));\n\n manageSender = registerProducer(rfHost,\n MQUtil.rfProducerChannelConf(\n prop.getProperty(SENDER_EXCHG),\n prop.getProperty(ROUTE_KEY),\n prop.getProperty(SENDER_QUEUE)),\n msgOutQueue);\n } catch (Exception e) {\n throw new IllegalStateException(e);\n }\n manageSender.start();\n }", "public void setConfiguration(Properties props);", "public KafkaProducer<String, String> getProducer() {\n\t\tint r = random.nextInt(producers.length);\n\t\treturn producers[r];\n\t}", "public void createMiniKdcConf() {\n\t\tconf = MiniKdc.createConf();\n\t}", "void configure(Map<String, ?> configs) throws KafkaException;", "private static Properties getMailServerConfig() {\n\n Properties properties = new Properties();\n properties.put(\"mail.smtp.host\", host);\n properties.put(\"mail.smtp.port\", \"2525\");\n\n return properties;\n }", "@Override\n public void configure() throws Exception {\n from(\"direct:populateKafka\")\n // .threads(Integer.parseInt(Config.getProperty(\"threadPoolSize\")), Integer.parseInt(Config.getProperty(\"maxthreadPoolSize\")))\n .process(new Processor() {\n @Override\n public void process(Exchange exchange) throws Exception {\n try {\n exchange.getOut().setHeaders(exchange.getIn().getHeaders());\n DataSource ds = exchange.getIn().getHeader(\"dataSource\", DataSource.class);\n String kafkaPath = \"kafka:\" + Config.getProperty(\"kafkaURI\") + \"?topic=ds\" + ds.getSrcID() + \"&serializerClass=\" + Config.getProperty(\"kafkaSerializationClass\");\n exchange.getOut().setBody(exchange.getIn().getBody());\n exchange.getOut().setHeader(KafkaConstants.PARTITION_KEY, \"1\");\n exchange.getOut().setHeader(\"kPath\", kafkaPath);\n System.out.println(\"Successfully populated Kafka\");\n } catch (Exception e) {\n\n e.printStackTrace();\n }\n }\n })\n .recipientList(header(\"kPath\"));\n\n }", "private Map<String, String> getConfigProperties(ArcConfig arcConfig) {\n Map<String, String> props = new HashMap<>();\n props.put(\"quarkus.arc.remove-unused-beans\", arcConfig.removeUnusedBeans);\n props.put(\"quarkus.arc.unremovable-types\", arcConfig.unremovableTypes.map(Object::toString).orElse(\"\"));\n props.put(\"quarkus.arc.detect-unused-false-positives\", \"\" + arcConfig.detectUnusedFalsePositives);\n props.put(\"quarkus.arc.transform-unproxyable-classes\", \"\" + arcConfig.transformUnproxyableClasses);\n props.put(\"quarkus.arc.auto-inject-fields\", \"\" + arcConfig.autoInjectFields);\n props.put(\"quarkus.arc.auto-producer-methods\", \"\" + arcConfig.autoProducerMethods);\n props.put(\"quarkus.arc.selected-alternatives\", \"\" + arcConfig.selectedAlternatives.map(Object::toString).orElse(\"\"));\n props.put(\"quarkus.arc.exclude-types\", \"\" + arcConfig.excludeTypes.map(Object::toString).orElse(\"\"));\n props.put(\"quarkus.arc.config-properties-default-naming-strategy\",\n \"\" + arcConfig.configPropertiesDefaultNamingStrategy.toString());\n return props;\n }", "private static FlinkKinesisFirehoseProducer<String> createFirehoseSinkFromStaticConfig() {\n\n\t\tProperties outputProperties = new Properties();\n\t\toutputProperties.setProperty(ConsumerConfigConstants.AWS_REGION, region);\n\n\t\tFlinkKinesisFirehoseProducer<String> sink = new FlinkKinesisFirehoseProducer<>(outputStreamName, new SimpleStringSchema(), outputProperties);\n\t\tProducerConfigConstants config = new ProducerConfigConstants();\n\t\treturn sink;\n\t}", "public static void main(String[] args) throws Exception {\n\t\t\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss:SSS\"); \n\t\tDate date;\n\t\t\n\t\tString topicName = \"SampleTest4\";\n\t\tList colorResponseList = new ArrayList();\n\t\tList courseResponseList = new ArrayList();\n\t\t\n\t List colorList = new ArrayList();\n\t colorList.add(\"black\");\n\t colorList.add(\"white\");\n\t colorList.add(\"red\");\n\t colorList.add(\"blue\");\n\t colorList.add(\"yellow\");\n\t \n\t List courseList = new ArrayList();\n\t courseList.add(\"java\");\n\t courseList.add(\"mulesoft\");\n\t courseList.add(\"kafka\");\n\t\t\n\t Properties props = new Properties();\n\t props.put(\"bootstrap.servers\", \"localhost:9092\");\n\t props.put(\"acks\", \"all\");\n\t props.put(\"retries\", 0);\n\t props.put(\"batch.size\", 16384);\n\t props.put(\"linger.ms\", 1);\n\t props.put(\"buffer.memory\", 33554432);\n\t props.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n\t props.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n\t \n\t Producer<String, String> producer = new KafkaProducer<String, String>(props);\n\t \n\t for(int i = 30; i < 40; i++)\n\t {\n\t \t//RecordMetadata colorResponse = producer.send(new ProducerRecord<String, String>(topicName, 3, \"Color\", (String) colorList.get(i))).get();\n\t \t//colorResponseList.add(colorResponse);\n\t \tdate = new Date();\n\t \tSystem.out.println(producer.send(new ProducerRecord<String, String>(topicName, \"ColorCount\"+i)).get());\n\t \tSystem.out.println(\"String Message sent successfully\"+formatter.format(date));\n\t }\n\t \n\t /*for(int i = 21; i < 30; i++)\n\t {\n\t \t//RecordMetadata colorResponse = producer.send(new ProducerRecord<String, String>(topicName, 3, \"Color\", (String) colorList.get(i))).get();\n\t \t//colorResponseList.add(colorResponse);\n\t \tdate = new Date();\n\t \tSystem.out.println(producer.send(new ProducerRecord<String, String>(topicName, 0, \"Color\", \"ColorCount\"+i)).get());\n\t \tSystem.out.println(\"String Message sent successfully\"+formatter.format(date));\n\t }\n\t \n\t for(int j = 121; j < 130; j++)\n\t {\n\t \t//RecordMetadata colorResponse = producer.send(new ProducerRecord<String, String>(topicName, 3, \"Color\", (String) colorList.get(i))).get();\n\t \t//colorResponseList.add(colorResponse);\n\t \tdate = new Date();\n\t \tProducerRecord<String, String> record = new ProducerRecord<String, String>(topicName, 1, \"Place\", \"PlaceCount\"+j);\n\t \tproducer.send(record,\n\t \t\t\tnew Callback() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onCompletion(RecordMetadata metadata, Exception e) {\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\tif(e != null) {\n\t\t\t e.printStackTrace();\n\t\t\t } else {\n\t\t\t System.out.println(\"The offset of the record we just sent is: \" + metadata);\n\t\t\t }\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t });\n\t \tSystem.out.println(\"String Message sent successfully\"+formatter.format(date));\n\t }\n\t \n\t for(int i = 1021; i < 1030; i++)\n\t {\n\t \t//RecordMetadata colorResponse = producer.send(new ProducerRecord<String, String>(topicName, 3, \"Color\", (String) colorList.get(i))).get();\n\t \t//colorResponseList.add(colorResponse);\n\t \tdate = new Date();\n\t \tSystem.out.println(producer.send(new ProducerRecord<String, String>(topicName, 2, \"Subject\", \"SubjectCount\"+i)).get());\n\t \tSystem.out.println(\"String Message sent successfully\"+formatter.format(date));\n\t }*/\n\t \t \n\t /*for(int i = 0; i < colorList.size(); i++)\n\t {\n\t \t//RecordMetadata colorResponse = producer.send(new ProducerRecord<String, String>(topicName, 3, \"Color\", (String) colorList.get(i))).get();\n\t \t//colorResponseList.add(colorResponse);\n\t \tSystem.out.println(producer.send(new ProducerRecord<String, String>(topicName, 3, \"Color\", (String) colorList.get(i))).get());\n\t }\n\t System.out.println(\"colorResponseList : \"+colorResponseList);\n\t \n\t for(int j = 0; j < courseList.size(); j++)\n\t {\n\t \t//RecordMetadata courseResponse = producer.send(new ProducerRecord<String, String>(topicName, 2, \"Color\", (String) courseList.get(j))).get();\n\t \t//courseResponseList.add(courseResponse);\n\t \tSystem.out.println(producer.send(new ProducerRecord<String, String>(topicName, 2, \"Color\", (String) courseList.get(j))).get());\n\t }\n\t System.out.println(\"courseResponseList : \"+courseResponseList);*/\n\t \n\t \n\t /*System.out.println(producer.send(new ProducerRecord<String, String>(topicName, \"Color\", \"Violet\")).get());\t \n\t System.out.println(\"String Message sent successfully\"+formatter.format(date));\n\t \n\t System.out.println(producer.send(new ProducerRecord<String, String>(topicName, \"Color\", \"Indigo\")).get());\t \n\t System.out.println(\"String Message sent successfully\"+formatter.format(date));*/\n\t \n\t \n\t /*ProducerRecord<String, String> record = new ProducerRecord<String, String>(topicName, \"Color\", \"Green\");\n\t producer.send(record,\n\t \t\t\tnew Callback() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onCompletion(RecordMetadata metadata, Exception e) {\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\tif(e != null) {\n\t\t\t e.printStackTrace();\n\t\t\t } else {\n\t\t\t System.out.println(\"The offset of the record we just sent is: \" + metadata);\n\t\t\t }\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t }\n\t \t\t);*/\n\t \t\t\t\t \n\t \n\t producer.close();\n\n\t}", "public String getProducerName() {\n return PRODUCER_NAME;\n }", "public static void main(String[] args) throws Exception {\n\t\tProperties props = new Properties();\n\t\tprops.put(\"bootstrap.servers\", \"127.0.0.1:9092\");\n\t\tprops.put(\"acks\", \"all\");\n\t\tprops.put(\"retries\", 0);\n\t\tprops.put(\"batch.size\", 16384);\n\t\tprops.put(\"linger.ms\", 1);\n\t\tprops.put(\"buffer.memory\", 33554432);\n\t\tprops.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n\t\tprops.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n\n\t\t/*\n\t\t * Define new Kafka producer\n\t\t */\n\t\t@SuppressWarnings(\"resource\")\n\t\tProducer<String, String> producer = new KafkaProducer<>(props);\n\n\t\t/*\n\t\t * parallel generation of JSON messages on Transaction topic\n\t\t * \n\t\t * this could also include business logic, projection, aggregation, etc.\n\t\t */\n\t\tThread transactionThread = new Thread(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tString topic = \"Transaction\";\n\t\t\t\tList<JSONObject> transactions = new ArrayList<JSONObject>();\n\t\t\t\tinitJSONData(\"ETLSpark_Transactions.json\", transactions);\n\t\t\t\tfor (int i = 0; i < transactions.size(); i++) {\n\t\t\t\t\tif (i % 200 == 0) {\n\t\t\t\t\t\tSystem.out.println(\"200 Transaction Messages procuded\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tproducer.send(new ProducerRecord<String, String>(topic, Integer.toString(i), transactions.get(i).toString()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/*\n\t\t * parallel generation of customer topic messages \n\t\t */\n\t\tThread customerThread = new Thread(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tString topic = \"Customer\";\n\t\t\t\tList<JSONObject> customer = new ArrayList<JSONObject>();\n\t\t\t\tinitJSONData(\"ETLSpark_Customer.json\", customer);\n\t\t\t\tfor (int i = 0; i < customer.size(); i++) {\n\t\t\t\t\tif (i % 200 == 0) {\n\t\t\t\t\t\tSystem.out.println(\"200 Customer Messages procuded\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tproducer.send(new ProducerRecord<String, String>(topic, Integer.toString(i), customer.get(i).toString()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/*\n\t\t * parallel generation of messages (variable produceMessages)\n\t\t * \n\t\t * generated messages are based on mockaroo api\n\t\t */\n\t\tint produceMessages = 100000;\n\t\tThread accountThread = new Thread(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tString topic = \"Account\";\n\t\t\t\tfor (int i = 0; i < produceMessages; i++) {\n//\t\t\t\t\tSystem.out.println(\"Account procuded\");\n\t\t\t\t\tproducer.send(new ProducerRecord<String, String>(topic, Integer.toString(i), getRandomTransactionJSON(i)));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\ttransactionThread.start();\n\t\tcustomerThread.start();\n\t\taccountThread.start();\n\n\t}", "public TopicParameters getTopicParameters() {\n\t\treturn topicParameters;\n\t}", "protected AmqpTransportConfig() {\n\t\tsuper();\n\t}", "public void setupProperties() {\n // left empty for subclass to override\n }", "TransportLayerAttributes getConfig();", "public interface SupportedConfigurationProperties {\n interface Client {\n String ASK_SERVER_FOR_REPORTS = \"rtest.client.askServerForReports\";\n String SERVER_PORT = \"rtest.client.serverPort\";\n String SERVER_HOST = \"rtest.client.serverHost\";\n String REPORT_DIR = \"rtest.client.reportDir\";\n String MAX_CONNECTION_WAIT_PERIOD = \"rtest.client.maxConnectionWaitPeriodMs\";\n }\n}", "void configure(Properties properties);", "Map<String, String> properties();", "Map<String, String> properties();", "public static void main(String[] args) {\n\n\n final KafkaProducer<String, String> kafkaProducer = new KafkaProducer<String, String>(getKafkaProducerProperties());\n\n // kafka\n final String topic = \"test-4\";\n\n // queue manager.\n String PARAM_QUEUE_NAME = \"DEV.QUEUE.1\";\n String PARAM_USERNAME = \"app\";\n String PARAM_PASSWORD = \"passw0rd\";\n String PARAM_QMGR_CHANNEL_NAME = \"DEV.APP.SVRCONN\";\n String PARAM_QMGR_NAME = \"QM1\";\n int PARAM_QMGR_PORT = 1414;\n String PARAM_QMGR_HOST_NAME = \"localhost\";\n\n Connection conn = null;\n\n try {\n\n // Set up the connection factory to connect to the queue manager,\n // populating it with all the properties we have been provided.\n MQConnectionFactory cf = new MQQueueConnectionFactory();\n cf.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n cf.setHostName(PARAM_QMGR_HOST_NAME);\n cf.setPort(PARAM_QMGR_PORT);\n cf.setQueueManager(PARAM_QMGR_NAME);\n cf.setChannel(PARAM_QMGR_CHANNEL_NAME);\n\n // Create the connection to the queue manager\n conn = cf.createConnection(PARAM_USERNAME, PARAM_PASSWORD);\n\n // Create a session and a queue object to enable us to interact with the\n // queue manager. By creating a transactional session we can roll back\n // the message onto the queue if the processing fails.\n Session session = conn.createSession(true, 0);\n Queue q = session.createQueue(\"queue:///\"+PARAM_QUEUE_NAME);\n\n // For testing purposes we can put some messages onto the queue using this\n\n // Set up the consumer to read from the queue\n MessageConsumer consumer = session.createConsumer(q);\n\n // Don't forget to start the connection before trying to receive messages!\n conn.start();\n\n try {\n\n // Read messages from the queue and process them until there\n // are none left to read.\n while (true) {\n Message receivedMsg = consumer.receiveNoWait();\n if (receivedMsg != null) {\n // use final -> multithreading env\n final TextMessage rcvTxtMsg = (TextMessage) receivedMsg;\n final String txt = rcvTxtMsg.getText();\n final ProducerRecord<String, String> objectStringProducerRecord = new ProducerRecord<>(topic, null, txt);\n kafkaProducer.send(objectStringProducerRecord, (recordMetadata, e) -> {\n if (e!=null){\n logger.warn(\"Producer call back end up with exception\");\n try {\n session.rollback();\n logger.warn(\"Ibm mq session rollback\");\n } catch (JMSException ex) {\n logger.warn(\"Ibm mq session failed to rollback\");\n ex.printStackTrace();\n }\n } else {\n try {\n session.commit();\n logger.info(\"Transaction success: Message was committed by IBM MQ Session and was delivered by Kafka-producer to kafka topic: {}, with offset: {}\", recordMetadata.topic(), recordMetadata.offset());\n } catch (JMSException ex) {\n logger.info(\"Transaction failed: Message was not committed by IBM MQ Session\");\n throw new RuntimeException(e);\n }\n }\n });\n\n\n // Since we returned from processing the message without\n // an exception being thrown we have successfully\n // processed the message, so increment our success count\n // and commit the transaction so that the message is\n // permanently removed from the queue.\n// messagesProcessed++;\n// session.commit();\n }\n\n }\n\n } catch (JMSException jmse2)\n {\n // This block catches any JMS exceptions that are thrown during\n // the business processing of the message.\n jmse2.printStackTrace();\n\n // Roll the transaction back so that the message can be put back\n // onto the queue ready to have its proessing retried next time\n // the action is invoked.\n session.rollback();\n throw new RuntimeException(jmse2);\n\n } catch (RuntimeException e) {\n e.printStackTrace();\n\n // Roll the transaction back so that the message can be put back\n // onto the queue ready to have its proessing retried next time\n // the action is invoked.\n session.rollback();\n throw e;\n }\n\n // Indicate to the caller how many messages were successfully processed.\n\n } catch (JMSException jmse) {\n // This block catches any JMS exceptions that are thrown before the\n // message is retrieved from the queue, so we don't need to worry\n // about rolling back the transaction.\n jmse.printStackTrace();\n\n // Pass an indication about the error back to the caller.\n throw new RuntimeException(jmse);\n\n } finally {\n if (conn != null) {\n try {\n conn.close();\n } catch (JMSException jmse2) {\n // Swallow final errors.\n }\n }\n }\n\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic ProducerManager(String server, int numberOfProducers) {\n\t random = new Random();\n\t\tproducers = new KafkaProducer[numberOfProducers];\n\t\tfor(int i = 0; i < numberOfProducers; i++) {\n\t\t\tProperties props = new Properties();\n\t\t\tprops.put(\"bootstrap.servers\", server);\n\t \t props.put(\"acks\", \"all\");\n\t \t props.put(\"retries\", 0);\n\t \t props.put(\"batch.size\", 16384);\n\t \t props.put(\"linger.ms\", 1);\n\t \t props.put(\"buffer.memory\", 33554432);\n\t \t props.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n\t \t props.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n\n\t \t KafkaProducer<String, String> producer = new KafkaProducer<String, String>(props);\n\t \t producers[i] = producer;\n\t\t}\n\t}", "private static ChainedProperties getChainedProperties() {\n return new ChainedProperties(\"packagebuilder.conf\", BRMSPackageBuilder.class.getClassLoader(), // pass this as it searches currentThread anyway\n false);\n }", "public p getConfig() {\n return c.K();\n }", "public void setProducer(Producer producer){\n this.producer = producer;\n }", "@ApiModelProperty(required = true, value = \"Configuration parameters for the connector.\")\n public Map<String, String> getConfig() {\n return config;\n }", "private static Consumer<String, JsonNode> createConsumer() {\n final Properties props = new Properties();\n props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,\n BOOTSTRAP_SERVERS);\n props.put(ConsumerConfig.CLIENT_ID_CONFIG, \"EventsMultiplexer\");\n props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG,\n StringDeserializer.class.getName());\n props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG,\n JsonDeserializer.class.getName());\n props.put(ConsumerConfig.GROUP_ID_CONFIG, \"MainGroup\");\n return new KafkaConsumer<>(props);\n }", "private static Properties setup() {\n Properties props = System.getProperties();\n try {\n props.load(new FileInputStream(new File(\"src/config.properties\")));\n } catch (Exception e) {\n e.printStackTrace();\n System.exit(-1);\n }\n return props;\n }", "protected ProducerTemplate getProducerTemplate() {\n return producerTemplate;\n }", "void sendExampleWithConfiguration(Long key, Long value) {\n messageProducerWithConfig.send(key, value);\n }", "@Override\n public ConfigurablePropertyMap getProperties() {\n return properties;\n }", "public static void main(String[] args) throws ExecutionException, InterruptedException {\n String topicName = \"mockProducerTopic1\";\n MockProducer<String,String> mockProducer = new MockProducer<String,String>(true, new DefaultPartitioner(),new StringSerializer(),new StringSerializer());\n\n String KEY=\"\";\n for(int i=1;i<=10;i++) {\n KEY= i%2 == 0 ? \"CS\" : \"IT\";\n ProducerRecord<String, String> record = new ProducerRecord<>(\"mockProducerTopic1\", KEY, \"value\"+i);\n Future<RecordMetadata> metadata = mockProducer.send(record);\n System.out.println(\"Topic : \" + metadata.get().topic() + \", Partition : \" + metadata.get().partition() + \", Offset : \" + metadata.get().offset() + \", TimeStamp : \" + metadata.get().hasTimestamp());\n //System.out.println(\"Topic : \" + metadata.topic() + \", Partition : \" + metadata.partition() + \", Offset : \" + metadata.offset() + \", TimeStamp : \" + metadata.timestamp());\n\n }\n\n System.out.println(\"Topic Partitions Details : \" + mockProducer.partitionsFor(\"mockProducerTopic1\"));\n for(int i=0;i<mockProducer.history().size();i++)\n {\n System.out.println(\"Topic : \"+ mockProducer.history().get(i).topic()+ \", Key : \" + mockProducer.history().get(i).key()\n + \", Value : \"+mockProducer.history().get(i).value() );\n }\n\n mockProducer.clear();\n mockProducer.close();\n }", "@Override\n public void configureMessageBroker(MessageBrokerRegistry registry) {\n registry.enableSimpleBroker(TOPIC);\n }", "Properties getProperties();", "private static FlinkKafkaProducer<String> getKafkaSink(Tuple2<String, String> sinkTuple) {\n\t\tProperties props = new Properties();\n\t\tprops.setProperty(\"bootstrap.servers\", sinkTuple.f0);\t\t\t\t\n\t\treturn new FlinkKafkaProducer<>(\n\t\t\t\tsinkTuple.f0,\n\t\t\t\tsinkTuple.f1,\n\t\t\t\tnew SimpleStringSchema());\t\n\t}", "public void configure(PropertiesGetter properties) {\n\t\t// TODO Auto-generated method stub\n\n\t}", "private static FlinkKinesisFirehoseProducer<String> createFirehoseSinkFromApplicationProperties() throws IOException {\n\n\t\tMap<String, Properties> applicationProperties = KinesisAnalyticsRuntime.getApplicationProperties();\n\t\tFlinkKinesisFirehoseProducer<String> sink = new FlinkKinesisFirehoseProducer<>(outputStreamName, new SimpleStringSchema(),\n\t\t\t\tapplicationProperties.get(\"ProducerConfigProperties\"));\n\t\treturn sink;\n\t}", "public JobServiceBusBrokeredMessageProperties getBrokeredMessageProperties() {\n return this.brokeredMessageProperties;\n }", "public Config() {\n this(System.getProperties());\n\n }", "public ModbusWritePropertyConfig[] getPropConfigs() {\n\t\treturn propConfigs;\n\t}", "private static void printConfig(Properties prop) {\n prop.keySet().forEach(x -> System.out.println(x));\n prop.forEach((key, value) -> System.out.println(\"Key : \" + key + \", Value : \" + value));\n }", "public Map<String, Object> getStreamsConfig() {\n // returns a copy of the original properties\n return streamsConfig.originals();\n }", "public interface KafkaClientFactory {\n\n /**\n * Creates and returns a {@link Consumer} by merging default Bootique configuration with settings provided in a\n * {@link ConsumerConfig} argument. Uses default Kafka cluster connection information (default == single configuration\n * found in Bootique; if none or more than one exists, an exception is thrown). Returned Consumer needs to be\n * closed by the calling code when it is no longer in use.\n *\n * @param config Configuration of consumer specific to the given method call.\n * @param <K> Consumed message key type.\n * @param <V> Consumed message value type.\n * @return a new instance of Consumer.\n */\n <K, V> Consumer<K, V> createConsumer(ConsumerConfig<K, V> config);\n\n /**\n * Creates and returns a {@link Consumer} by merging default Bootique configuration with settings provided in a\n * {@link ConsumerConfig} argument. Returned Consumer needs to be closed by the calling code when it is no longer\n * in use.\n *\n * @param clusterName symbolic configuration name for the Kafka cluser coming from configuration.\n * @param config Configuration of consumer specific to the given method call.\n * @param <K> Consumed message key type.\n * @param <V> Consumed message value type.\n * @return a new instance of Consumer.\n */\n <K, V> Consumer<K, V> createConsumer(String clusterName, ConsumerConfig<K, V> config);\n\n <K, V> Producer<K, V> createProducer(ProducerConfig<K, V>config);\n\n <K, V> Producer<K, V> createProducer(String clusterName, ProducerConfig<K, V>config);\n}", "@Before(order=0)\n\tpublic void getProperty() {\n\t\tconfigReader = new ConfigReaders();\n\t\tprop = configReader.init_prop();\n\t\t\n\t}", "public ConfigureEvent(ReplicatorProperties props) {\n super(props);\n }", "Map<String, String> getProperties();", "Map<String, String> getProperties();", "@Bean(name = \"kafkaConsumer\")\n public KafkaConsumer<String, String> createConsumer(\n @Value(\"${kafka.bootstrap.servers.enable}\") String bootstrapServersEnable,\n @Value(\"${kafka.bootstrap.servers}\") String bootstrapServers,\n @Value(\"${kafka.consumer.groupid}\") String groupID,\n @Value(\"${kafka.consumer.from.beginning}\") String fromBeginning,\n @Value(\"${kafka.consumer.from.beginning.groupid}\") String customGroupId)\n\n {\n String KEY_DESERIALIZER = \"key.deserializer\";\n String KEY_DESERIALIZER_CLASS = \"org.apache.kafka.common.serialization.StringDeserializer\";\n String VALUE_DESERIALIZER = \"value.deserializer\";\n String VALUE_DESERIALIZER_CLASS = \"org.apache.kafka.common.serialization.StringDeserializer\";\n String AUTO_OFFSET_RESET = \"auto.offset.reset\";\n\n Properties properties = System.getProperties();\n if (bootstrapServersEnable.equalsIgnoreCase(\"on\")) {\n properties.setProperty(\"bootstrap.servers\", bootstrapServers);\n }\n properties.setProperty(KEY_DESERIALIZER, KEY_DESERIALIZER_CLASS);\n properties.setProperty(VALUE_DESERIALIZER, VALUE_DESERIALIZER_CLASS);\n properties.setProperty(\"group.id\", Boolean.valueOf(fromBeginning) ? customGroupId : groupID);\n properties.setProperty(AUTO_OFFSET_RESET, Boolean.valueOf(fromBeginning) ? \"earliest\" : \"latest\");\n\n return new KafkaConsumer<>(properties);\n }", "public void printConfig() {\n\t\tProperty props = Property.getInstance();\n\t\tSystem.out.println(\"You are using the following settings. If this is correct, \"\n\t\t\t\t+ \"you do not have to do anything. If they are not correct, please alter \" + \"your config files.\");\n\t\tString[] importantSettings = new String[] { \"apkname\", \"alphabetFile\", \"learningAlgorithm\", \"EquivMethod\",\"deviceName\" };\n\t\tfor (int i = 0; i < importantSettings.length; i++) {\n\t\t\tSystem.out.printf(\"%-25s%s%n\", importantSettings[i], \" = \" + props.get(importantSettings[i]));\n\t\t}\n\t}", "@Override\n public void configureMessageBroker(MessageBrokerRegistry config) {\n config.enableSimpleBroker(\"/topic\");\n //for posting messages back - clients write to this\n config.setApplicationDestinationPrefixes(\"/app\");\n }", "protected Map<String, Object> getConfigurationParameters(){\n\t\treturn configurationParameters;\n\t}" ]
[ "0.835553", "0.78541905", "0.7627807", "0.7341887", "0.7319776", "0.7318685", "0.7098622", "0.7010297", "0.6956676", "0.6888487", "0.68228287", "0.65302235", "0.63557255", "0.6277854", "0.62680763", "0.62656665", "0.623795", "0.6201894", "0.61925626", "0.61071235", "0.60937476", "0.6073141", "0.5903609", "0.58097947", "0.58020884", "0.5783817", "0.5745294", "0.573978", "0.5722683", "0.5693684", "0.568958", "0.5575984", "0.5548817", "0.55408293", "0.55305934", "0.5517468", "0.5508965", "0.54932153", "0.5488327", "0.54742587", "0.54735106", "0.54673547", "0.544433", "0.54364616", "0.54156387", "0.535926", "0.5342498", "0.53381354", "0.53304327", "0.5313524", "0.53047746", "0.5295861", "0.52950406", "0.5274685", "0.5255993", "0.5252817", "0.522125", "0.5218548", "0.52069044", "0.5198861", "0.5198817", "0.5196085", "0.51898396", "0.5180845", "0.51644355", "0.5147889", "0.51177955", "0.51038253", "0.51038253", "0.5099417", "0.5072906", "0.50647736", "0.5062154", "0.50375104", "0.5033078", "0.5029698", "0.50255054", "0.5014089", "0.5012738", "0.50106895", "0.50074804", "0.50072044", "0.5007021", "0.49984106", "0.49906984", "0.4987364", "0.49791703", "0.4972703", "0.49719757", "0.49706382", "0.4961726", "0.49570587", "0.49550194", "0.4949985", "0.4947509", "0.4947509", "0.49385375", "0.49208513", "0.4920299", "0.49175176" ]
0.74764717
3
Provides configuration properties for kafka consumer.
public Properties getKafkaConsumerConfig() { if (instanceSubscriber.isResolvable()) { return instanceSubscriber.get().getKafkaConsumerConfig(); } Properties consumerConfig = getDefaultConsumerConfig(); if (instanceConsumer.isResolvable()) { consumerConfig.putAll(instanceConsumer.get()); } return consumerConfig; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Properties configConsumer() {\r\n\t\tProperties props = new Properties();\r\n\t\tprops.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, KafkaConstants.getBootstrapServers());\r\n\t\tprops.put(ConsumerConfig.GROUP_ID_CONFIG, KafkaConstants.getGroupId());\r\n\t\tprops.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, KafkaConstants.getAutoCommit());\r\n\t\tprops.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, KafkaConstants.getOffsetReset());\r\n\t\tprops.put(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, KafkaConstants.getHeartbeatIntervalMs());\r\n\t\tprops.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);\r\n\t\tprops.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, RentalCarEventDetailsDeserializer.class);\r\n\r\n\t\treturn props;\r\n\t}", "Properties getKafkaProperties() {\n Properties props = new Properties();\n props.put(StreamsConfig.APPLICATION_ID_CONFIG, \"example-window-stream\");\n props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, \"localhost:9092\");\n props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, \"earliest\");\n props.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());\n props.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());\n props.put(StreamsConfig.DEFAULT_TIMESTAMP_EXTRACTOR_CLASS_CONFIG, TardisTimestampExtractor.class);\n return props;\n }", "public static Properties configStream() {\r\n\t\tProperties props = new Properties();\r\n\t\tprops.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, KafkaConstants.getBootstrapServers());\r\n\t\tprops.put(ConsumerConfig.GROUP_ID_CONFIG, KafkaConstants.getGroupId());\r\n\t\tprops.put(StreamsConfig.APPLICATION_ID_CONFIG, KafkaConstants.getApplicationId());\r\n\t\tprops.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass());\r\n\t\tprops.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, RentalCarEventDetailsSerde.class);\r\n\r\n\t\treturn props;\r\n\t}", "public static Properties configProducer() {\r\n\t\tProperties props = new Properties();\r\n\t\tprops.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, KafkaConstants.getBootstrapServers());\r\n\t\tprops.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);\r\n\t\tprops.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, RentalCarEventDetailsSerializer.class);\r\n\r\n\t\treturn props;\r\n\t}", "@Bean\r\n public Map<String, Object> producerConfig() {\r\n \t\r\n Map<String, Object> producerProperties = new HashMap<String, Object>();\r\n producerProperties.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,propertiesManager.getBootstrapServer());\r\n producerProperties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);\r\n producerProperties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class);\r\n \r\n return producerProperties;\r\n }", "private static Properties getProperties() {\n var properties = new Properties();\n properties.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, \"127.0.0.1:9092\");\n properties.setProperty(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n properties.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, GsonSerializer.class.getName());\n return properties;\n }", "public KafkaConfig() { }", "private static Map<String, Object> getKafkaParams() {\n Map<String, Object> kafkaParams = new\n HashMap<>();\n kafkaParams.put(\"bootstrap.servers\", KAFKA_BROKER_LIST);\n kafkaParams.put(\"key.deserializer\", StringDeserializer.class);\n kafkaParams.put(\"value.deserializer\", StringDeserializer.class);\n kafkaParams.put(\"group.id\", \"DEFAULT_GROUP_ID\");\n kafkaParams.put(\"auto.offset.reset\", \"latest\");\n kafkaParams.put(\"enable.auto.commit\", false);\n return kafkaParams;\n }", "private static Consumer<String, JsonNode> createConsumer() {\n final Properties props = new Properties();\n props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,\n BOOTSTRAP_SERVERS);\n props.put(ConsumerConfig.CLIENT_ID_CONFIG, \"EventsMultiplexer\");\n props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG,\n StringDeserializer.class.getName());\n props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG,\n JsonDeserializer.class.getName());\n props.put(ConsumerConfig.GROUP_ID_CONFIG, \"MainGroup\");\n return new KafkaConsumer<>(props);\n }", "Map<String, String> getConfigProperties();", "@Override\n public ProducerConfig createKafkaProducerConfig()\n {\n Properties props = new Properties();\n props.setProperty(\"serializer.class\", \"kafka.serializer.StringEncoder\");\n if (useZookeeper)\n {\n props.setProperty(\"zk.connect\", \"localhost:2182\");\n }\n else {\n props.setProperty(\"broker.list\", \"1:localhost:2182\");\n props.setProperty(\"producer.type\", \"async\");\n props.setProperty(\"queue.time\", \"2000\");\n props.setProperty(\"queue.size\", \"100\");\n props.setProperty(\"batch.size\", \"10\");\n }\n\n return new ProducerConfig(props);\n }", "public void intiSettings()throws Exception{\r\n\r\n\t\tinputStream = new FileInputStream(System.getProperty(\"user.dir\")+\"\\\\config.properties\");\r\n\t\tconfig.load(inputStream);\r\n\t\t\r\n\t\tprop.put(\"bootstrap.servers\", config.getProperty(\"bootstrap.servers\"));\r\n\t\tprop.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\r\n\t\tprop.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\r\n\r\n\t\ttopicName = config.getProperty(\"TopicName\");\r\n\t\ttopicName = createTopic(topicName);\r\n\t\t\r\n\t\tmessageList = Arrays.asList(config.getProperty(\"messages\").split(\"\\\\|\"));\r\n\t}", "public interface ProducerPropsKeys {\n\n public static String KAFKA_PRODUCER_CONFIG = \"kafka.producer.config\";\n\n public static String KAFKA_MESSAGE_SCHEMA = \"kafka.message.schema\";\n\n}", "@ApplicationScoped\n @Produces\n public KafkaConsumer<MessageKey, MessageValue> createKafkaConsumer() {\n Properties props = (Properties) consumerProperties.clone();\n\n props.putIfAbsent(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);\n props.putIfAbsent(ConsumerConfig.GROUP_ID_CONFIG, UUID.randomUUID().toString());\n props.putIfAbsent(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, \"true\");\n props.putIfAbsent(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, \"1000\");\n props.putIfAbsent(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, \"earliest\");\n\n tryToConfigureSecurity(props);\n\n // Create the Kafka Consumer\n KafkaSqlKeyDeserializer keyDeserializer = new KafkaSqlKeyDeserializer();\n KafkaSqlValueDeserializer valueDeserializer = new KafkaSqlValueDeserializer();\n KafkaConsumer<MessageKey, MessageValue> consumer = new KafkaConsumer<>(props, keyDeserializer, valueDeserializer);\n return consumer;\n }", "public Properties getKafkaProducerConfig() {\n if (instancePublisher.isResolvable()) {\n return instancePublisher.get().getKafkaProducerConfig();\n }\n Properties producerConfig = getDefaultProducerConfig();\n if (instanceProducer.isResolvable()) {\n producerConfig.putAll(instanceProducer.get());\n }\n return producerConfig;\n }", "public GeneralConsumer() {\n // Kafka consumer configuration settings\n Properties props = new Properties();\n\n// props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, IKafkaConstants.KAFKA_BROKERS);\n// props.put(ConsumerConfig.GROUP_ID_CONFIG, IKafkaConstants.GROUP_ID_CONFIG);\n// props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, LongDeserializer.class.getName());\n// props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());\n props.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 1000);\n props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, \"false\");\n props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, \"earliest\");\n// Consumer<Long, String> consumer = new KafkaConsumer<>(props);\n// consumer.subscribe(Collections.singletonList(IKafkaConstants.TOPIC_NAME));\n\n// props.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, \"localhost:9092\");\n\n props.put(\"bootstrap.servers\", BOOTSTRAP_SERVERS);\n// props.put(\"acks\", \"all\");\n// props.put(\"retries\", 1);\n props.put(\"group.id\", \"dd\");\n// props.put(\"enable.auto.commit\", \"true\");\n// props.put(\"auto.commit.interval.ms\", \"1000\");\n// props.put(\"session.timeout.ms\", \"30000\");\n\n props.put(\"key.deserializer\",\n \"org.apache.kafka.common.serialization.StringDeserializer\");\n// props.put(\"value.deserializer\",\n// \"org.apache.kafka.common.serialization.StringDeserializer\");\n// consumer = new KafkaConsumer\n// <String, String>(props);\n\n props.put(\"value.deserializer\",\n \"org.apache.kafka.common.serialization.ByteArrayDeserializer\");\n consumer = new KafkaConsumer<String, byte[]>(props);\n\n// adminClient = AdminClient.create(props);\n }", "EventWriterConfig getConfig();", "public KafkaConfig(String bootstrapServer) {\n this.bootstrapServer = bootstrapServer;\n kafkaGroupName = \"group1\";\n autoOffsetReset = \"earliest\";\n autoCommit = false;\n kafkaTopics = new HashMap<>();\n }", "@Bean(name = \"kafkaConsumer\")\n public KafkaConsumer<String, String> createConsumer(\n @Value(\"${kafka.bootstrap.servers.enable}\") String bootstrapServersEnable,\n @Value(\"${kafka.bootstrap.servers}\") String bootstrapServers,\n @Value(\"${kafka.consumer.groupid}\") String groupID,\n @Value(\"${kafka.consumer.from.beginning}\") String fromBeginning,\n @Value(\"${kafka.consumer.from.beginning.groupid}\") String customGroupId)\n\n {\n String KEY_DESERIALIZER = \"key.deserializer\";\n String KEY_DESERIALIZER_CLASS = \"org.apache.kafka.common.serialization.StringDeserializer\";\n String VALUE_DESERIALIZER = \"value.deserializer\";\n String VALUE_DESERIALIZER_CLASS = \"org.apache.kafka.common.serialization.StringDeserializer\";\n String AUTO_OFFSET_RESET = \"auto.offset.reset\";\n\n Properties properties = System.getProperties();\n if (bootstrapServersEnable.equalsIgnoreCase(\"on\")) {\n properties.setProperty(\"bootstrap.servers\", bootstrapServers);\n }\n properties.setProperty(KEY_DESERIALIZER, KEY_DESERIALIZER_CLASS);\n properties.setProperty(VALUE_DESERIALIZER, VALUE_DESERIALIZER_CLASS);\n properties.setProperty(\"group.id\", Boolean.valueOf(fromBeginning) ? customGroupId : groupID);\n properties.setProperty(AUTO_OFFSET_RESET, Boolean.valueOf(fromBeginning) ? \"earliest\" : \"latest\");\n\n return new KafkaConsumer<>(properties);\n }", "@Bean\n public ConsumerFactory<String, String> consumerFactory() {\n return new DefaultKafkaConsumerFactory<>(\n kafkaProperties.buildConsumerProperties(), new StringDeserializer(), new StringDeserializer()\n );\n }", "void configure(Map<String, ?> configs) throws KafkaException;", "public Properties setProperties(String kafkaHosts,String flinkConsumerGroup){\n Properties properties = new Properties();\n properties.setProperty(\"bootstrap.servers\", kafkaHosts);\n properties.setProperty(\"group.id\", flinkConsumerGroup);\n return properties;\n }", "private MessageProducer<Long, Long> createProducerWithConfig() {\n return kafka.registerProducer(\n ProducerRegistration.builder()\n .forTopic(kafka.getTopicConfiguration(\"example1\"))\n .withDefaultProducer()\n .withKeySerializer(new LongSerializer())\n .withValueSerializer(new LongSerializer())\n .build());\n }", "public static Properties consumeProps(String servers, String groupId) {\n Properties prop = new Properties();\n // bootstrap server lists.\n prop.put(\"bootstrap.servers\", servers);\n // groupId\n prop.put(\"group.id\", groupId);\n // record the offset.\n prop.put(\"enable.auto.commit\", \"false\");\n prop.put(\"auto.offset.reset\", \"earliest\");\n prop.put(\"session.timeout.ms\", \"300000\");\n prop.put(\"max.poll.interval.ms\", \"300000\");\n // get 10 records per poll.\n prop.put(\"max.poll.records\", 10);\n // Key deserializer\n prop.put(\"key.deserializer\", StringDeserializer.class.getName());\n // value deserializer\n prop.put(\"value.deserializer\", BeanAsArrayDeserializer.class.getName());\n return prop;\n }", "@Override\n public List<Property> getConfigurationProperties() {\n List<Property> configProperties = new ArrayList<>();\n\n Property apiKey = new Property();\n apiKey.setName(Token2Constants.APIKEY);\n apiKey.setDisplayName(\"Api Key\");\n apiKey.setRequired(true);\n apiKey.setDescription(\"Enter Token2 API Key value\");\n apiKey.setDisplayOrder(1);\n configProperties.add(apiKey);\n\n Property callbackUrl = new Property();\n callbackUrl.setDisplayName(\"Callback URL\");\n callbackUrl.setName(IdentityApplicationConstants.OAuth2.CALLBACK_URL);\n callbackUrl.setDescription(\"Enter value corresponding to callback url.\");\n callbackUrl.setDisplayOrder(2);\n configProperties.add(callbackUrl);\n return configProperties;\n }", "static Properties getConfig()\n {\n return(config);\n }", "@Bean\n public Config config(Properties properties){\n properties.put(\"kaptcha.textproducer.char.length\",length);\n// properties.put(\"kaptcha.textproducer.font.names\",fontNames);\n Config config=new Config(properties);\n return config;\n }", "private EndpointProperties getConsumerEndpointProperties(ExtendedConsumerProperties<SolaceConsumerProperties> properties) {\n\t\treturn SolaceProvisioningUtil.getEndpointProperties(properties.getExtension());\n\t}", "public interface KafkaClientFactory {\n\n /**\n * Creates and returns a {@link Consumer} by merging default Bootique configuration with settings provided in a\n * {@link ConsumerConfig} argument. Uses default Kafka cluster connection information (default == single configuration\n * found in Bootique; if none or more than one exists, an exception is thrown). Returned Consumer needs to be\n * closed by the calling code when it is no longer in use.\n *\n * @param config Configuration of consumer specific to the given method call.\n * @param <K> Consumed message key type.\n * @param <V> Consumed message value type.\n * @return a new instance of Consumer.\n */\n <K, V> Consumer<K, V> createConsumer(ConsumerConfig<K, V> config);\n\n /**\n * Creates and returns a {@link Consumer} by merging default Bootique configuration with settings provided in a\n * {@link ConsumerConfig} argument. Returned Consumer needs to be closed by the calling code when it is no longer\n * in use.\n *\n * @param clusterName symbolic configuration name for the Kafka cluser coming from configuration.\n * @param config Configuration of consumer specific to the given method call.\n * @param <K> Consumed message key type.\n * @param <V> Consumed message value type.\n * @return a new instance of Consumer.\n */\n <K, V> Consumer<K, V> createConsumer(String clusterName, ConsumerConfig<K, V> config);\n\n <K, V> Producer<K, V> createProducer(ProducerConfig<K, V>config);\n\n <K, V> Producer<K, V> createProducer(String clusterName, ProducerConfig<K, V>config);\n}", "@Override\n\tpublic Properties getConfig() {\n\t\treturn null;\n\t}", "private ConfigProperties getProperties() {\n return properties;\n }", "@PostConstruct\n private void init() {\n Properties props = new Properties();\n props.put(\"oracle.user.name\", user);\n props.put(\"oracle.password\", pwd);\n props.put(\"oracle.service.name\", serviceName);\n //props.put(\"oracle.instance.name\", instanceName);\n props.put(\"oracle.net.tns_admin\", tnsAdmin); //eg: \"/user/home\" if ojdbc.properies file is in home \n props.put(\"security.protocol\", protocol);\n props.put(\"bootstrap.servers\", broker);\n //props.put(\"group.id\", group);\n props.put(\"enable.auto.commit\", \"true\");\n props.put(\"auto.commit.interval.ms\", \"10000\");\n props.put(\"linger.ms\", 1000);\n // Set how to serialize key/value pairs\n props.setProperty(\"key.serializer\", \"org.oracle.okafka.common.serialization.StringSerializer\");\n props.setProperty(\"value.serializer\", \"org.oracle.okafka.common.serialization.StringSerializer\");\n\n producer = new KafkaProducer<>(props);\n }", "@Bean\r\n public KafkaProducer<String, String> kafkaProducer() {\r\n Properties producerProperties = new Properties();\r\n producerProperties.put(\"bootstrap.servers\", kafkaBootstrapServers);\r\n producerProperties.put(\"acks\", \"all\");\r\n producerProperties.put(\"retries\", 0);\r\n producerProperties.put(\"batch.size\", 16384);\r\n producerProperties.put(\"linger.ms\", 1);\r\n producerProperties.put(\"buffer.memory\", 33554432);\r\n producerProperties.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\r\n producerProperties.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\r\n\r\n /*\r\n Creating a Kafka Producer object with the configuration above.\r\n */\r\n return new KafkaProducer<>(producerProperties);\r\n }", "public FlinkConsumerFromKafkaUtil(){\n env = StreamExecutionEnvironment.getExecutionEnvironment();\n }", "@ApiModelProperty(required = true, value = \"Configuration parameters for the connector.\")\n public Map<String, String> getConfig() {\n return config;\n }", "public WebIceProperties getProperties()\n\t{\n\t\treturn config;\n\t}", "public KafkaConfig(String bootstrapServer, String kafkaGroupName, String autoOffsetReset, Boolean autoCommit, Map<String, Integer> kafkaTopics) {\n this.bootstrapServer = bootstrapServer;\n this.kafkaGroupName = kafkaGroupName;\n this.autoOffsetReset = autoOffsetReset;\n this.autoCommit = autoCommit;\n this.kafkaTopics = kafkaTopics;\n }", "TransportLayerAttributes getConfig();", "public SelfManagedKafkaAccessConfigurationCredentials getCredentials() {\n return this.credentials;\n }", "private static Properties getMailServerConfig() {\n\n Properties properties = new Properties();\n properties.put(\"mail.smtp.host\", host);\n properties.put(\"mail.smtp.port\", \"2525\");\n\n return properties;\n }", "public KafkaConnector(BulletConfig bulletConfig) {\n super(bulletConfig);\n topics = config.getAs(BulletDSLConfig.CONNECTOR_KAFKA_TOPICS, List.class);\n startAtEnd = config.getAs(BulletDSLConfig.CONNECTOR_KAFKA_START_AT_END_ENABLE, Boolean.class);\n autoCommit = config.getAs(BulletDSLConfig.CONNECTOR_KAFKA_ENABLE_AUTO_COMMIT, Boolean.class);\n asyncCommit = config.getAs(BulletDSLConfig.CONNECTOR_ASYNC_COMMIT_ENABLE, Boolean.class);\n timeout = Duration.ofMillis(config.getAs(BulletDSLConfig.CONNECTOR_READ_TIMEOUT_MS, Number.class).longValue());\n }", "public String getConsumerId() {\n return consumerId;\n }", "public p getConfig() {\n return c.K();\n }", "protected OeTemplateProcessorConfig getConfig() {\n final OeTemplateProcessorConfig config = OeTemplateProcessorConfig.create();\n config\n //.setPollingIntervalMillis(1000)\n //.setPollingMaxDurationSecs(5)\n //.setResultsBatchSize(100)\n .getInferenceParameterOverrides()\n .setMaxAnswerCount(MAX_ANSWERS);\n return config;\n }", "@Bean\r\n public KafkaTemplate<String, Object> kafkaTemplate() {\r\n return new KafkaTemplate<>(producerFactory());\r\n }", "@Override\n public void configure(Map<String, ?> config) {\n KafkaSpanDecorator customDecorator = \n (KafkaSpanDecorator)config.get(\"kafka.producer.decorator\");\n \n if (customDecorator != null) {\n decorators.add(customDecorator);\n }\n }", "private static TypedProperties getClientConfig() throws Exception {\n final Map<String, Object> bindings = new HashMap<>();\n bindings.put(\"$nbDrivers\", nbDrivers);\n bindings.put(\"$nbNodes\", nbNodes);\n return ConfigurationHelper.createConfigFromTemplate(BaseSetup.DEFAULT_CONFIG.clientConfig, bindings);\n }", "protected void readProperties() {\n\t\tproperties = new HashMap<>();\n\t\tproperties.put(MQTT_PROP_CLIENT_ID, id);\n\t\tproperties.put(MQTT_PROP_BROKER_URL, brokerUrl);\n\t\tproperties.put(MQTT_PROP_KEEP_ALIVE, 30);\n\t\tproperties.put(MQTT_PROP_CONNECTION_TIMEOUT, 30);\n\t\tproperties.put(MQTT_PROP_CLEAN_SESSION, true);\n\t\tproperties.put(MQTT_PROP_USERNAME, user);\n\t\tproperties.put(MQTT_PROP_PASSWORD, password.toCharArray());\n\t\tproperties.put(MQTT_PROP_MQTT_VERSION, MqttConnectOptions.MQTT_VERSION_3_1_1);\n\t}", "public FabricCommonConfig getConfig() {\n if (null == config) {\n config = new FabricCommonConfig();\n }\n return config;\n }", "protected Config getConfig () {\n return this.conf;\n }", "@Test\n public void testConfigureKafka() {\n Map<String, String> props = new HashMap<>();\n props.put(USERNAME, \"username\");\n props.put(PASSWORD, \"password\");\n\n Map<String, Object> expectedConfig = new HashMap<>();\n expectedConfig.put(SaslConfigs.SASL_MECHANISM, ScramMechanism.SCRAM_SHA_512.mechanismName());\n expectedConfig.put(\n SaslConfigs.SASL_JAAS_CONFIG,\n String.format(\n \"org.apache.kafka.common.security.scram.ScramLoginModule required \"\n + \"username=\\\"%s\\\" password=\\\"%s\\\";\",\n props.get(USERNAME), props.get(PASSWORD)));\n\n Map<String, Object> config = Utils.configureKafka(props);\n Assert.assertEquals(expectedConfig, config);\n }", "public Map getJMSConnectorConfig()\n\t{\n\t\tMap params = getParams( \"jmsConnectorConfig\" );\n\t\t\n\t\treturn( params );\n\t}", "@Bean\r\n public ProducerFactory<String, Object> producerFactory() {\r\n return new DefaultKafkaProducerFactory<>(producerConfig());\r\n }", "int getConsumerCount() {\n return mNoOfConsumers;\n }", "@Override\n public void configure() throws Exception {\n from(\"direct:populateKafka\")\n // .threads(Integer.parseInt(Config.getProperty(\"threadPoolSize\")), Integer.parseInt(Config.getProperty(\"maxthreadPoolSize\")))\n .process(new Processor() {\n @Override\n public void process(Exchange exchange) throws Exception {\n try {\n exchange.getOut().setHeaders(exchange.getIn().getHeaders());\n DataSource ds = exchange.getIn().getHeader(\"dataSource\", DataSource.class);\n String kafkaPath = \"kafka:\" + Config.getProperty(\"kafkaURI\") + \"?topic=ds\" + ds.getSrcID() + \"&serializerClass=\" + Config.getProperty(\"kafkaSerializationClass\");\n exchange.getOut().setBody(exchange.getIn().getBody());\n exchange.getOut().setHeader(KafkaConstants.PARTITION_KEY, \"1\");\n exchange.getOut().setHeader(\"kPath\", kafkaPath);\n System.out.println(\"Successfully populated Kafka\");\n } catch (Exception e) {\n\n e.printStackTrace();\n }\n }\n })\n .recipientList(header(\"kPath\"));\n\n }", "@Bean\n Exchange topicExchange() {\n return new TopicExchange(CUSTOMER_TOPIC_EXCHANGE,\n true,\n false,\n Collections.emptyMap());\n }", "@Override\n\tpublic Map<String, String> getConfig() {\n\t\treturn null;\n\t}", "public String getConfig() {\n\t\treturn(config);\n\t}", "public KafkaBacksideEnvironment() {\n\t\tConfigPullParser p = new ConfigPullParser(\"kafka-props.xml\");\n\t\tproperties = p.getProperties();\n\t\tconnectors = new HashMap<String, IPluginConnector>();\n\t\t//chatApp = new SimpleChatApp(this);\n\t\t//mainChatApp = new ChatApp(this);\n\t\t//elizaApp = new ElizaApp(this);\n\t\tbootPlugins();\n\t\t//TODO other stuff?\n\t\tSystem.out.println(\"Booted\");\n\t\t//Register a shutdown hook so ^c will properly close things\n\t\tRuntime.getRuntime().addShutdownHook(new Thread() {\n\t\t public void run() { shutDown(); }\n\t\t});\n\t}", "public interface PropertyConsumer {\n\n /**\n * Key in the associated propertyInfo object. Holds a list of\n * property names, which should be displayed and editable when\n * configuring a PropertyConsumer object interatively. List is\n * space seperated and the order is the order in which the\n * properties will appear (initProperties).\n */\n public static final String initPropertiesProperty = \"initProperties\";\n\n /**\n * Keyword for PropertyEditor class from PropertyInfo Property\n * object (editor).\n */\n public static final String EditorProperty = \"editor\";\n /**\n * Scoped keyword for PropertyEditor class from PropertyInfo\n * Property object, same as EditorProperty with a period in front\n * (.editor).\n */\n public static final String ScopedEditorProperty = \".editor\";\n /**\n * Scoped keyword for PropertyEditor class from PropertyInfo\n * Property object, to scope the label for the property as\n * displayed in the Inspector (label).\n */\n public static final String LabelEditorProperty = \".label\";\n\n /**\n * Method to set the properties in the PropertyConsumer. It is\n * assumed that the properties do not have a prefix associated\n * with them, or that the prefix has already been set.\n * \n * @param setList a properties object that the PropertyConsumer\n * can use to retrieve expected properties it can use for\n * configuration.\n */\n public void setProperties(Properties setList);\n\n /**\n * Method to set the properties in the PropertyConsumer. The\n * prefix is a string that should be prepended to each property\n * key (in addition to a separating '.') in order for the\n * PropertyConsumer to uniquely identify properties meant for it,\n * in the midst of of Properties meant for several objects.\n * \n * @param prefix a String used by the PropertyConsumer to prepend\n * to each property value it wants to look up -\n * setList.getProperty(prefix.propertyKey). If the prefix\n * had already been set, then the prefix passed in should\n * replace that previous value.\n * @param setList a Properties object that the PropertyConsumer\n * can use to retrieve expected properties it can use for\n * configuration.\n */\n public void setProperties(String prefix, Properties setList);\n\n /**\n * Method to fill in a Properties object, reflecting the current\n * values of the PropertyConsumer. If the PropertyConsumer has a\n * prefix set, the property keys should have that prefix plus a\n * separating '.' prepended to each property key it uses for\n * configuration.\n * \n * @param getList a Properties object to load the PropertyConsumer\n * properties into. If getList equals null, then a new\n * Properties object should be created.\n * @return Properties object containing PropertyConsumer property\n * values. If getList was not null, this should equal\n * getList. Otherwise, it should be the Properties object\n * created by the PropertyConsumer.\n */\n public Properties getProperties(Properties getList);\n\n /**\n * Method to fill in a Properties object with values reflecting\n * the properties able to be set on this PropertyConsumer. The key\n * for each property should be the raw property name (without a\n * prefix) with a value that is a String that describes what the\n * property key represents, along with any other information about\n * the property that would be helpful (range, default value,\n * etc.).\n * \n * @param list a Properties object to load the PropertyConsumer\n * properties into. If getList equals null, then a new\n * Properties object should be created.\n * @return Properties object containing PropertyConsumer property\n * values. If getList was not null, this should equal\n * getList. Otherwise, it should be the Properties object\n * created by the PropertyConsumer.\n */\n public Properties getPropertyInfo(Properties list);\n\n /**\n * Set the property key prefix that should be used by the\n * PropertyConsumer. The prefix, along with a '.', should be\n * prepended to the property keys known by the PropertyConsumer.\n * \n * @param prefix the prefix String.\n */\n public void setPropertyPrefix(String prefix);\n\n /**\n * Get the property key prefix that is being used to prepend to\n * the property keys for Properties lookups.\n * \n * @return the prefix string\n */\n public String getPropertyPrefix();\n\n}", "Producer(Properties kafkaProducerConfig) {\n\n // Mandatory settings, not changeable.\n kafkaProducerConfig.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n kafkaProducerConfig.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class.getName());\n kafkaProducerConfig.put(ProducerConfig.PARTITIONER_CLASS_CONFIG, SixtPartitioner.class.getName());\n\n kafka = new org.apache.kafka.clients.producer.KafkaProducer<>(kafkaProducerConfig);\n logger.info(\"Created producer.\");\n }", "public void configure(PropertiesGetter properties) {\n\t\t// TODO Auto-generated method stub\n\n\t}", "public Config getConfig();", "public ConfigProvider getConfig() {\n return config;\n }", "public WriterConfig getConfig() {\n return mConfig;\n }", "public KernelConfig getConfig()\n {\n Kernel.checkAccess();\n return config;\n }", "ConfigBlock getConfig();", "public void setConfiguration(Properties props);", "public String getConfig();", "@Override\n public Map<String, Object> getComponentConfiguration() {\n Config conf = new Config();\n // Configure a tick every 10 seconds\n conf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, 10);\n return conf;\n }", "public Config() {\n this(System.getProperties());\n\n }", "void configure(Properties properties);", "public static Config config() {\n return LiveEventBusCore.get().config();\n }", "public String getConfig() {\n\n return config;\n }", "private void readComponentConfiguration(ComponentContext context) {\n Dictionary<?, ?> properties = context.getProperties();\n\n String addressStr = Tools.get(properties, \"address\");\n address = addressStr != null ? addressStr : DEFAULT_ADDRESS;\n log.info(\"Configured. Ganglia server address is {}\", address);\n\n String metricNameStr = Tools.get(properties, \"metricNames\");\n metricNames = metricNameStr != null ? metricNameStr : DEFAULT_METRIC_NAMES;\n log.info(\"Configured. Metric name is {}\", metricNames);\n\n Integer portConfigured = Tools.getIntegerProperty(properties, \"port\");\n if (portConfigured == null) {\n port = DEFAULT_PORT;\n log.info(\"Ganglia port is not configured, default value is {}\", port);\n } else {\n port = portConfigured;\n log.info(\"Configured. Ganglia port is configured to {}\", port);\n }\n\n Integer ttlConfigured = Tools.getIntegerProperty(properties, \"ttl\");\n if (ttlConfigured == null) {\n ttl = DEFAULT_TTL;\n log.info(\"Ganglia TTL is not configured, default value is {}\", ttl);\n } else {\n ttl = ttlConfigured;\n log.info(\"Configured. Ganglia TTL is configured to {}\", ttl);\n }\n\n Boolean monitorAllEnabled = Tools.isPropertyEnabled(properties, \"monitorAll\");\n if (monitorAllEnabled == null) {\n log.info(\"Monitor all metrics is not configured, \" +\n \"using current value of {}\", monitorAll);\n } else {\n monitorAll = monitorAllEnabled;\n log.info(\"Configured. Monitor all metrics is {}\",\n monitorAll ? \"enabled\" : \"disabled\");\n }\n }", "@PostConstruct\n public void postConstruct() {\n Map<String, String> config = new HashMap<>();\n config.put(\"bootstrap.servers\", \"localhost:9092\");\n config.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n config.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n config.put(\"acks\", \"1\");\n producer = KafkaProducer.create(vertx, config);\n }", "public C getConfig()\n {\n return config;\n }", "public Object getConf() {\n return this.conf;\n }", "public void createMiniKdcConf() {\n\t\tconf = MiniKdc.createConf();\n\t}", "public void buildTwitterBaseConfiguration() {\n ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();\n configurationBuilder\n .setOAuthConsumerKey(getBaseContext().getString(R.string.consumer_key))\n .setOAuthConsumerSecret(getBaseContext().getString(R.string.consumer_secret))\n .setOAuthAccessToken(getBaseContext().getString(R.string.access_token))\n .setOAuthAccessTokenSecret(getBaseContext().getString(R.string.access_token_secret));\n\n Configuration configuration = configurationBuilder.build();\n\n twitterStreamFactory = new TwitterStreamFactory(configuration);\n }", "private Map<String, String> getConfigProperties(ArcConfig arcConfig) {\n Map<String, String> props = new HashMap<>();\n props.put(\"quarkus.arc.remove-unused-beans\", arcConfig.removeUnusedBeans);\n props.put(\"quarkus.arc.unremovable-types\", arcConfig.unremovableTypes.map(Object::toString).orElse(\"\"));\n props.put(\"quarkus.arc.detect-unused-false-positives\", \"\" + arcConfig.detectUnusedFalsePositives);\n props.put(\"quarkus.arc.transform-unproxyable-classes\", \"\" + arcConfig.transformUnproxyableClasses);\n props.put(\"quarkus.arc.auto-inject-fields\", \"\" + arcConfig.autoInjectFields);\n props.put(\"quarkus.arc.auto-producer-methods\", \"\" + arcConfig.autoProducerMethods);\n props.put(\"quarkus.arc.selected-alternatives\", \"\" + arcConfig.selectedAlternatives.map(Object::toString).orElse(\"\"));\n props.put(\"quarkus.arc.exclude-types\", \"\" + arcConfig.excludeTypes.map(Object::toString).orElse(\"\"));\n props.put(\"quarkus.arc.config-properties-default-naming-strategy\",\n \"\" + arcConfig.configPropertiesDefaultNamingStrategy.toString());\n return props;\n }", "public DefaultProperties() {\n\t\t// Festlegung der Werte für Admin-Zugang\n\t\tthis.setProperty(\"admin.username\", \"admin\");\n\t\tthis.setProperty(\"admin.password\", \"password\");\n\t\tthis.setProperty(\"management.port\", \"8443\");\n\n\t\t// Festlegung der Werte für CouchDB-Verbindung\n\t\tthis.setProperty(\"couchdb.adress\", \"http://localhost\");\n\t\tthis.setProperty(\"couchdb.port\", \"5984\");\n\t\tthis.setProperty(\"couchdb.databaseName\", \"profiles\");\n\n\t\t// Festlegung der Werte für Zeitvergleiche\n\t\tthis.setProperty(\"server.minTimeDifference\", \"5\");\n\t\tthis.setProperty(\"server.monthsBeforeDeletion\", \"18\");\n\t}", "public void init() {\n initiateConfig();\n initiateKafkaStuffs();\n log.info(\"Kafka consumer and producer for topic [{}] started.\", topic);\n\n service.submit(() -> {\n while (true) {\n try {\n ConsumerRecords<String, byte[]> records = consumer.poll(3000);\n for (ConsumerRecord<String, byte[]> record : records) {\n log.info(\"Reveive kafka message from topic [{}] with key [{}]\", topic, record.key());\n repository.get(record.key()).offer(record.value());\n accounter.incrementAndGet();\n }\n while (accounter.get() != 0) {\n Thread.sleep(5);\n }\n consumer.commitSync();\n } catch (Exception e) {\n log.warn(\"Something wrong happened during message pulling process\", e);\n consumer.close();\n consumer = null;\n initiateConsumer();\n }\n }\n });\n }", "@Override\n\tpublic Map<String, String> getConf() {\n\t\treturn null;\n\t}", "private void initTwitterConfigs() {\n consumerKey = getString(com.socialscoutt.R.string.twitter_consumer_key);\n consumerSecret = getString(com.socialscoutt.R.string.twitter_consumer_secret);\n }", "public String getUserConfig() {\n return userConfig;\n }", "private static ConfigSource config()\n {\n return CONFIG_MAPPER_FACTORY.newConfigSource()\n .set(\"type\", \"mailchimp\")\n .set(\"auth_method\", \"api_key\")\n .set(\"apikey\", \"xxxxxxxxxxxxxxxxxxx\")\n .set(\"access_token\", \"xxxxxxxxxxxxxxxxxxx\")\n .set(\"list_id\", \"xxxxxxxxxxxxxxxxxxx\")\n .set(\"email_column\", \"email\")\n .set(\"fname_column\", \"fname\")\n .set(\"lname_column\", \"lname\");\n }", "public Object getConfig() {\n return config;\n }", "public interface SupportedConfigurationProperties {\n interface Client {\n String ASK_SERVER_FOR_REPORTS = \"rtest.client.askServerForReports\";\n String SERVER_PORT = \"rtest.client.serverPort\";\n String SERVER_HOST = \"rtest.client.serverHost\";\n String REPORT_DIR = \"rtest.client.reportDir\";\n String MAX_CONNECTION_WAIT_PERIOD = \"rtest.client.maxConnectionWaitPeriodMs\";\n }\n}", "@ApplicationScoped\n @Produces\n public ProducerActions<MessageKey, MessageValue> createKafkaProducer() {\n Properties props = (Properties) producerProperties.clone();\n\n // Configure kafka settings\n props.putIfAbsent(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);\n props.putIfAbsent(ProducerConfig.CLIENT_ID_CONFIG, \"Producer-\" + UUID.randomUUID().toString());\n props.putIfAbsent(ProducerConfig.ACKS_CONFIG, \"all\");\n props.putIfAbsent(ProducerConfig.LINGER_MS_CONFIG, 10);\n props.putIfAbsent(ProducerConfig.PARTITIONER_CLASS_CONFIG, KafkaSqlPartitioner.class);\n\n tryToConfigureSecurity(props);\n\n // Create the Kafka producer\n KafkaSqlKeySerializer keySerializer = new KafkaSqlKeySerializer();\n KafkaSqlValueSerializer valueSerializer = new KafkaSqlValueSerializer();\n return new AsyncProducer<MessageKey, MessageValue>(props, keySerializer, valueSerializer);\n }", "public Map<String, Object> getStreamsConfig() {\n // returns a copy of the original properties\n return streamsConfig.originals();\n }", "public void getConfigProperty() {\n Properties properties = new Properties();\n try(InputStream input = new FileInputStream(\"config.properties\");){\n properties.load(input);\n logger.info(\"BASE URL :\" + properties.getProperty(\"BASEURL\"));\n setBaseUrl(properties.getProperty(\"BASEURL\"));\n setLoginMode(properties.getProperty(\"LOGINMODE\"));\n setProjectId(properties.getProperty(\"PROJECTID\"));\n setReportId(properties.getProperty(\"REPORTID\"));\n if (!(properties.getProperty(\"PASSWORD\").trim().equals(\"\"))) {\n setPassword(properties.getProperty(\"PASSWORD\"));\n }\n if (!(properties.getProperty(\"USERNAME\").trim().equals(\"\"))) {\n setUserName(properties.getProperty(\"USERNAME\"));\n }\n }catch(IOException ex) {\n logger.debug(\"Failed to fetch value from configure file: \", ex);\n }\n\n }", "public abstract String getConfig();", "public Config getConfig() {\n return config;\n }", "@Test\n public void testConfigureKafkaNoUsername() {\n Map<String, String> props = new HashMap<>();\n props.put(PASSWORD, \"password\");\n Map<String, Object> config = Utils.configureKafka(props);\n Assert.assertEquals(new HashMap<>(), config);\n }", "public ConfigureEvent(ReplicatorProperties props) {\n super(props);\n }", "public ModbusWritePropertyConfig[] getPropConfigs() {\n\t\treturn propConfigs;\n\t}", "@Test\n public void testConfigureKafkaNoPassword() {\n Map<String, String> props = new HashMap<>();\n props.put(USERNAME, \"username\");\n Map<String, Object> config = Utils.configureKafka(props);\n Assert.assertEquals(new HashMap<>(), config);\n }", "public ReadConfigProperty() {\n\n\t\ttry {\n\t\t\tString filename = \"com/unitedcloud/resources/config.properties\";\n\t\t\tinput = ReadConfigProperty.class.getClassLoader().getResourceAsStream(filename);\n\t\t\tif (input == null) {\n\t\t\t\tSystem.out.println(\"Sorry, unable to find \" + filename);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tprop = new Properties();\n\t\t\tprop.load(input);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public String getConfiguration(){\n\t\treturn this.config;\n\t}" ]
[ "0.8296565", "0.7014036", "0.68825465", "0.68824995", "0.6784259", "0.6527374", "0.6287299", "0.6229372", "0.6192189", "0.6181453", "0.6166122", "0.61495143", "0.61211294", "0.6051356", "0.60257554", "0.601541", "0.59599656", "0.5951949", "0.58542085", "0.58460987", "0.57969004", "0.57335055", "0.57239836", "0.57060903", "0.5668996", "0.5658526", "0.56572455", "0.5639535", "0.55944365", "0.5582492", "0.5582398", "0.5574325", "0.5543284", "0.55124277", "0.5510702", "0.5480754", "0.53714776", "0.53687644", "0.5366896", "0.5340184", "0.5337486", "0.533604", "0.5304554", "0.5294135", "0.52855605", "0.5283609", "0.5279878", "0.5264818", "0.52521914", "0.52451617", "0.5244949", "0.5239851", "0.5231454", "0.5217894", "0.519553", "0.5193823", "0.5190573", "0.51899266", "0.5182861", "0.5181472", "0.5173477", "0.5172731", "0.5167381", "0.51595706", "0.51534224", "0.51527214", "0.5150974", "0.5147881", "0.51346654", "0.5119791", "0.5119271", "0.5110546", "0.51093316", "0.5100664", "0.5098028", "0.5085273", "0.50696945", "0.5064733", "0.5059127", "0.5054868", "0.5041917", "0.50390637", "0.50358725", "0.5019113", "0.50027454", "0.49946553", "0.49937555", "0.49865863", "0.49854407", "0.49808484", "0.49749362", "0.49747908", "0.49659938", "0.4957251", "0.49430406", "0.49425665", "0.49374977", "0.49300912", "0.49132407", "0.49056542" ]
0.75190175
1
Reverse a LinkedList (easy) Iterative Apporach
public ListNode reverseList1(ListNode head) { ListNode curr = head, next, prev = null; while (curr != null) { next = curr.next; curr.next = prev; prev = curr; curr = next; } return prev; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void iterateLinkedListInReverseOrder() {\n\t\tLinkedList<Integer> list = new LinkedList<Integer>();\n\t\tlist.add(10);\n\t\tlist.add(20);\n\t\tlist.add(30);\n\t\tlist.add(40);\n\t\tlist.add(50);\n\t\tSystem.out.println(\"LinkedList is : \" + list);\n\t\tCollections.reverse(list);\n\t\tSystem.out.println(\"Reverse the LinkedList is : \" + list);\n\t}", "Node reverseIterative(Node head) {\n\t\tNode prev = null;\n\t\tNode current = head;\n\t\tNode next = null;\n\t\twhile (current != null) {\n\t\t\tnext = current.next;\n\t\t\tcurrent.next = prev;\n\t\t\tprev = current;\n\t\t\tcurrent = next;\n\t\t}\n\t\thead = prev;\n\t\treturn head;\n\t}", "public static LinkedList iterativeReverse(LinkedList linkedList) {\n if (linkedList == null || linkedList.next == null) {\n return linkedList;\n }\n\n LinkedList prevNode, currNode, nextNode;\n prevNode = null;\n nextNode = null;\n currNode = linkedList;\n\n while (currNode != null) {\n nextNode = currNode.next;\n currNode.next = prevNode;\n prevNode = currNode;\n currNode = nextNode;\n }\n return prevNode;\n }", "void reverseList(){\n\n Node prev = null;\n Node next = null;\n Node iter = this.head;\n\n while(iter != null)\n {\n next = iter.next;\n iter.next = prev;\n prev = iter;\n iter = next;\n\n }\n\n //prev is the link to the head of the new list\n this.head = prev;\n\n }", "public void reverse() {\n var previous = first;\n var current = first.next;\n\n last = first;\n last.next = null;\n while (current != null) {\n var next = current.next;\n current.next = previous;\n previous = current;\n current = next;\n\n }\n first = previous;\n\n }", "public void _reverse() {\n\n var prev = first;\n var current = first.next;\n last = first;\n last.next = null;\n while (current != null) {\n var next = current.next;\n current.next = prev;\n prev = current;\n current = next;\n\n }\n first = prev;\n\n }", "public void reverse() {\n\n\t\tif (head == null) {\n\t\t\tSystem.out.println(\"List is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tint nodes = nodeCounter();\n\t\tDLNode t = tail.prev;\n\t\thead = tail;\n\t\tfor (int i = 0; i < nodes - 1; i++) {\n\n\t\t\tif (t.list == null && t.val != Integer.MIN_VALUE) {\n\t\t\t\tthis.reverseHelperVal(t.val);\n\t\t\t\tt = t.prev;\n\t\t\t} else {\n\t\t\t\tthis.reverseHelperList(t.list);\n\t\t\t\tt = t.prev;\n\t\t\t}\n\t\t}\n\t\ttail.next = null;\n\t\thead.prev = null;\n\n\t}", "public DoubleLinkedSeq reverse(){\r\n\t DoubleLinkedSeq rev = new DoubleLinkedSeq();\r\n\t for(cursor = head; cursor != null; cursor = cursor.getLink()){\r\n\t\t rev.addBefore(this.getCurrent());\r\n\t }\r\n\t \r\n\t return rev; \r\n }", "public ListNode reverseIter(ListNode head) {\n if (head == null || head.next == null) return head;\n // a -> b -> c -> d\n // pre<-cur next\n //\n ListNode pre = null;\n while (head != null) {\n ListNode next = head.next;\n head.next = pre;\n pre = head;\n head = next;\n }\n return pre;\n }", "public static ListNode reverseListIteratively(ListNode head) {\n // The reversed list node that will be returned finally\n ListNode prev = null;\n\n // Input - 1 -> 2 -> null\n // Output - 2 -> 1 -> null\n\n while(head != null) {\n // Obtain the head.next first\n ListNode next = head.next; // #1 next = 2 -> 3 -> null | #2 next = 3 -> null |\n\n // Assign the head's next to prev (that's initially null)\n head.next = prev; // #1 head = 1 -> null | #2 head = 2 -> 1 -> null\n\n // Assign the current head of linked list to the prev node\n prev = head; // #1 prev = 1 -> null | #2 | 2 -> 1 -> null | #3 |\n\n // Assign the next stored earlier to the head\n head = next; // #1 head = 2 -> 3 -> null | #2 head = 3 -> null |\n }\n return prev;\n }", "private static LinkedList<? extends Object> reverseLinkedList(LinkedList<? extends Object> linkedList) {\n\t\tLinkedList<Object> reversedLinkedList = new LinkedList<>();\n\t\tfor (int i = linkedList.size() - 1; i >= 0; i--) {\n\t\t\treversedLinkedList.add(linkedList.get(i));\n\t\t}\n\t\treturn reversedLinkedList;\n\t}", "public void reverseLinkedList(){\n\t\tNode prev = null;\n\t\tNode current = head;\n\t\twhile (current != null){\n\t\t\tNode temp = current.next;\n\t\t\tcurrent.next = prev;\n\t\t\t// move pointers be careful must move previous to current first\n\t\t\tprev = current;\n\t\t\tcurrent = temp;\n\t\t\t\n\n\t\t}\n\t\tthis.head = prev;\n\t}", "public void reverse() {\n\t\t// write you code for reverse using the specifications above\t\t\n\t\tNode nodeRef = head;\n\t\thead = null;\n\t\t\n\t\twhile(nodeRef != null) {\n\t\t\tNode tmp = nodeRef;\n\t\t\tnodeRef = nodeRef.next;\n\t\t\ttmp.next = head;\n\t\t\thead = tmp;\n\t\t}\n\t}", "public ListNode reverseListIter(ListNode head) {\n\t\tif (head == null || head.next == null) {\n\t\t\treturn head;\n\t\t}\n\n\t\tListNode start = head;\n\t\tListNode mid = head.next;\n\t\tListNode end = mid.next;\n\t\thead.next = null;\n\n\t\twhile (end != null) {\n\t\t\tmid.next = head;\n\t\t\thead = mid;\n\t\t\tmid = end;\n\t\t\tend = end.next;\n\t\t}\n\n\t\tmid.next = head;\n\t\treturn mid;\n\t}", "public void reverse()\n\t{\n\t\tSinglyLinkedListNode nextNode = head;\n\t\tSinglyLinkedListNode prevNode = null;\n\t\tSinglyLinkedListNode prevPrevNode = null;\n\t\twhile(head != null)\n\t\t{\n\t\t\tprevPrevNode = prevNode;\n\t\t\tprevNode = nextNode;\n\t\t\tnextNode = prevNode.getNext();\n\t\t\tprevNode.setNext(prevPrevNode);\n\t\t\tif(nextNode == null)\n\t\t\t{\n\t\t\t\thead = prevNode;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "LinkedListDemo reverse() {\n\t\tListNode rev = null; // rev will be the reversed list.\n\t\tListNode current = getHead(); // For running through the nodes of list.\n\t\twhile (current != null) {\n\t\t\t// construct a new node\n\t\t\tListNode newNode = new ListNode();\n\t\t\t// copy the data to new node from runner\n\t\t\tnewNode.data = current.data;\n\t\t\t// \"Push\" the next node of list onto the front of rev.\n\t\t\tnewNode.next = rev;\n\t\t\trev = newNode;\n\t\t\t// Move on to the next node in the list.\n\t\t\tcurrent = current.next;\n\t\t}\n\t\treturn new LinkedListDemo(rev);\n\t}", "private Node reverseLinkedlisthelper(Node current){\n\t\tif (current.next == null){\n\t\t\tthis.head = current; // new head end of list\n\t\t\treturn current;\n\t\t}\n\t\tNode ptr_ahead = reverseLinkedlisthelper(current.next); // get to end of list\n\t\tptr_ahead.next = current;\n\t\treturn current;\n\n\n\t\t// TAIL RECURSION similar to for loop and iterative method i did above!! nothing is done coming back from recursive stack!\n\t}", "public static LinkedList<Integer> Reverse2(LinkedList<Integer> list) {\n\t\tLinkedList<Integer> listReverse = new LinkedList<Integer>();\n\t\tIterator<Integer> re = list.descendingIterator();\n\t\twhile (re.hasNext()) {\n\t\t\tlistReverse.add(re.next());\n\t\t}\n\n\t\treturn listReverse;\n\t}", "private static Node reverseLinkedList(Node head) {\n\t\t \n\t\tNode prev = null;\n\t\tNode next = null;\n\t\t\n\t\t// check boundary condition\n\t\tif(head ==null)\n\t\t\t\n\t\t\t\n\t\t\treturn head;\n\t\t\n\t\tnext = head.rightSibling;\n\t\twhile(next!=null) {\n\t\t\t// point current node backwards\n\t\t\thead.rightSibling = prev;\n\t\t\t\n\t\t\t// move all three pointers ahead\n\t\t\tprev = head;\n\t\t\thead = next;\n\t\t\tnext = next.rightSibling;\n\t\t}\n\t\t\n\t\t// Point last node backwards\n\t\thead.rightSibling = prev;\n\t\treturn head;\n\t}", "private static Node reverseList(Node start) {\n Node runner = start;\n // initialize the return value\n Node rev = null;\n // set the runner to the last item in the list\n while (runner != null) {\n Node next = new Node(runner.value);\n next.next = rev;\n rev = next;\n runner = runner.next;\n }\n return rev;\n }", "static void reverse(Linkedlists list){\r\n\t\tNode current=list.head;\r\n\r\n\t\tNode nextNode=null;\r\n\t\tNode previous=null;\r\n\t\twhile(current != null){\r\n\t\t\tnextNode=current.next;\r\n\t\t\t//System.out.println(\"current.next:\"+current.data);\r\n\t\t\tcurrent.next=previous;\r\n\t\t\tprevious=current;\r\n\t\t\tcurrent=nextNode;\r\n\r\n\t\t}\r\n\t\t//current.next=previous;\r\n\t\tlist.head=previous;\r\n\r\n\t}", "private ListNode reverseList(ListNode head) {\n if (head == null || head.next == null) {\n return head;\n }\n\n ListNode now = head;\n ListNode next = now.next;\n ListNode prev = null;\n\n while (next != null) {\n now.next = prev;\n\n // move to next node\n prev = now;\n now = next;\n next = next.next;\n }\n now.next = prev;\n return now;\n }", "public static void main(String args[]) {\n LinkedList linkedList = new LinkedList(5);\n linkedList.next = new LinkedList(4);\n linkedList.next.next = new LinkedList(3);\n linkedList.next.next.next = new LinkedList(2);\n linkedList.next.next.next.next = new LinkedList(1);\n\n System.out.println(\"Original Linked List: \" + linkedList.toString());\n\n // recursively reverse and print\n linkedList = recursiveReverse(linkedList);\n System.out.println(\"Recursively Reversed List: \" + linkedList.toString());\n\n // iteratively reverse and print\n linkedList = iterativeReverse(linkedList);\n System.out.println(\"Iteratively Recursed to Original: \" + linkedList.toString());\n }", "public void reverse() {\n\t\tNode previous = first;\n\t\tNode current = first.next;\n\n\t\twhile (current != null) {\n\t\t\tNode next = current.next;\n\t\t\tcurrent.next = previous;\n\n\t\t\tprevious = current;\n\t\t\tcurrent = next;\n\t\t}\n\t\tlast = first;\n\t\tlast.next = null;\n\t\tfirst = previous;\n\t}", "public static void reverselist ( LinkedList list)\r\n\t\t{\r\n\t\t Node reversedpart = null;\r\n\t\t\tNode current = list.head;\t\r\n\t\t\tSystem.out.println(\" Reverse LinkedList: \"); \r\n\t\t \r\n\t\t while (current != null)\r\n\t\t {\r\n\t\t\t Node next = current.next;\r\n\t\t\t current.next = reversedpart;\r\n\t\t\t reversedpart = current;\r\n\t\t\t current = next; \r\n\t\t\t \r\n\t\t\t //System.out.print(reversedpart.data + \" \");\r\n\t\t\t //current = current.next;\r\n\t\t }\r\n\t\t System.out.println(\"\"); \r\n\t\t System.out.println(\" Reverse LinkedList: \"); \r\n\t\t \r\n\t\t while (reversedpart != null)\r\n\t\t {\r\n\t\t\t \t\t\t \r\n\t\t\t System.out.print(reversedpart.data + \" \");\r\n\t\t\t reversedpart = reversedpart.next;\r\n\t\t }\r\n\t\t System.out.println(\"\"); \r\n\t\t \r\n\t\t \r\n\t\t}", "public static LinkedList<Integer> Reverse(LinkedList<Integer> list) {\n\t\tLinkedList<Integer> listReverse = new LinkedList<Integer>();\n\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\tint value = list.get(i);\n\t\t\tlistReverse.addFirst(value);\n\t\t}\n\t\treturn listReverse;\n\t}", "public static LinkedList<String> revLinkedList(LinkedList<String> lst) {\r\n\t\tStack<String> stk = new Stack<String>();\r\n\t\tLinkedList<String> ret = new LinkedList<String>();\r\n\t\tfor (String item : lst) {\r\n\t\t\tstk.push(item);\r\n\t\t}\r\n\t\twhile (!stk.isEmpty()) {\r\n\t\t\tret.add(stk.pop());\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "@NonNull\n ConsList<E> reverse();", "public static ListNode iterativeReverseNode(ListNode node) {\n\t\tif (node.getNext() == null) {\n\t\t\treturn node;\n\t\t}\n\t\tListNode previous = new ListNode(node);\n\t\tListNode middle = new ListNode(previous.getNext());\n\t\tListNode next = new ListNode(middle.getNext());\n\t\tprevious.setNext(null);\n\n\t\twhile (next != null) {\n\t\t\tmiddle.setNext(previous);\n\t\t\tprevious = middle;\n\t\t\tmiddle = next;\n\t\t\tnext = middle.getNext();\n\t\t}\n\t\tmiddle.setNext(previous);\n\t\treturn middle;\n\t}", "public static void reversList(Linkedlist list)\r\n\t {\r\n\t\t Node prev = null;\r\n\t\t Node current = list.head;\r\n\t\t Node next = null;\r\n\t\t \r\n\t\t while(current!=null)\r\n\t\t {\r\n\t\t\t next = current.next;\r\n\t\t\t current.next = prev;\r\n\t\t\t prev = current;\r\n\t\t\t current = next;\r\n\t\t\t \r\n\t\t\t \r\n\t\t }\r\n\t\t \r\n\t\t list.head = prev;\r\n\t\t \r\n\t }", "public void reverse() {\n\t\tNode<E> temp = null;\n\t\tNode<E> n = root;\n\n\t\twhile (n != null) {\n\t\t\ttemp = n.getBefore();\n\t\t\tn.setBefore(n.getNext());\n\t\t\tn.setNext(temp);\n\t\t\tn = n.getBefore();\n\t\t}\n\n\t\ttemp = root;\n\t\troot = tail;\n\t\ttail = temp;\n\t}", "private static SingleLinkedNode reverseWithLoopBreaking(SingleLinkedNode head) {\n\t\tSingleLinkedNode loopstart = findLoopStart(head);\r\n\t\tif (loopstart != null) {\r\n\t\t\t// re-find the previous element.\r\n\t\t\tSingleLinkedNode prev = loopstart;\r\n\t\t\twhile (prev.getNext() != loopstart) {\r\n\t\t\t\tprev = prev.getNext();\r\n\t\t\t}\r\n\t\t\tprev.setNext(null);\r\n\t\t}\r\n\t\t\r\n\t\treturn (Reverse(head));\r\n\t}", "@Override\n\tpublic IDnaStrand reverse() {\n\t\tLinkStrand reversed = new LinkStrand();\n\t\tNode current = new Node(null);\n\t\tcurrent = myFirst;\n\t\t\n\t\twhile (current != null) {\n\t\t\t\n\t\t\tStringBuilder copy = new StringBuilder(current.info);\n\t\t\tcopy.reverse();\n\t\t\tNode first = new Node(copy.toString());\n\t\t\t\n\t\t\tfirst.next = reversed.myFirst;\n\t\t\tif (reversed.myLast == null) {\n\t\t\t\treversed.myLast = reversed.myFirst;\n\t\t\t\treversed.myLast.next = null;\n\t\t\t\t\n\t\t\t}\n\t\t\treversed.myFirst = first;\n\t\t\treversed.mySize += copy.length();\n\t\t\treversed.myAppends ++;\n\t\t\t\n\t\t\t\n\t\t\tcurrent = current.next;\n\t\t\t\n\t\t}\n\t\treturn reversed;\n\t}", "public static LinkedList reverseLinkedList(LinkedList head) {\n // Write your code here.\n if (head.next == null)\n return head;\n\n // Eg: 1 -> 2 -> 3 -> null;\n\n // 1 is made as currentNode\n // 2 is captured as nextNode from currentNode next, after capturing\n // make current node as tail by making its next to null\n\n var currNode = head;\n var nextNode = head.next;\n currNode.next = null;\n // iterate until nextNode becomes null.\n // before changing nextNode next pointer to currentNode, hold it in temp\n // make nextNode next pointer to currentNode\n // make currentNode as nextNode\n // make nextNode as captured temp.\n while(nextNode != null) {\n var temp = nextNode.next;\n nextNode.next = currNode;\n currNode = nextNode;\n nextNode = temp;\n }\n return currNode;\n }", "public static ListNode reverse(ListNode head) {\n if (head == null || head.next == null)\n return head;\n\n ListNode prev = null, curr = head;\n while (curr != null) {\n ListNode forw = curr.next; // backup\n\n curr.next = prev; // link\n\n prev = curr; // move\n curr = forw;\n }\n\n return prev;\n }", "private void reverse(ListNode startNode, ListNode endNode) {\n endNode.next = null;\n ListNode pre = startNode, cur = startNode.next, newEnd = pre;\n while (cur != null) {\n ListNode nextNode = cur.next;\n cur.next = pre;\n pre = cur;\n cur = nextNode;\n }\n }", "public void reverseLinkedlistRecursive(){\n\t\tif (this.head == null) return;\n\t\tNode newEnd = reverseLinkedlisthelper(this.head);\n\t\tnewEnd.next = null;\n\t}", "Node reverse(Node head) {\n\n\t\t// Write your code here\n\t\tNode curr = head;\n\t\tNode prev = null;\n\t\twhile (curr != null) {\n\t\t\twhile (curr != null && curr.data % 2 != 0) {\n\t\t\t\tprev = curr;\n\t\t\t\tcurr = curr.next;\n\t\t\t}\n\t\t\tif (curr != null && curr.data % 2 == 0) {\n\t\t\t\tif (prev != null) {\n\t\t\t\t\tprev.next = reverseHelper(curr);\n\t\t\t\t} else {\n\t\t\t\t\thead = reverseHelper(curr);\n\t\t\t\t}\n\t\t\t\tcurr = curr.next;\n\t\t\t}\n\t\t}\n\t\treturn head;\n\t}", "public ListNode reverseList(ListNode head) {\n\n ListNode prev = null;\n ListNode curr = head;\n while( curr!=null){\n ListNode next = curr.next;\n curr.next= prev;\n prev = curr;\n curr = next;\n }\n return prev;\n }", "private ListNode reverseList(ListNode head) {\r\n\t\tif (head == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tListNode previous = null;\r\n\t\tListNode current = head;\r\n\t\twhile (current != null) {\r\n\t\t\tListNode next = current.next;\r\n\t\t\tcurrent.next = previous;\r\n\t\t\tprevious = current;\r\n\t\t\tcurrent = next;\r\n\t\t}\r\n\t\thead = previous;\r\n\t\treturn head;\r\n\t}", "public MyLinkedList reverse() {\r\n\t\tif (this.isEmpty()) {\r\n\t\t\tSystem.out.println(\"the empty linked list leads to a failure of reversion\");\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\tStack<Node> stack = new Stack<Node>();\r\n\t\tpointer = head;\r\n\t\twhile (pointer != null) {\r\n\t\t\tstack.push(pointer);\r\n\t\t\tpointer = pointer.getNext();\r\n\t\t}\r\n\t\tMyLinkedList temp = new MyLinkedList();\r\n\t\twhile (stack.size() > 0) {\r\n\t\t\tNode node = stack.pop();\r\n\t\t\t//Original mappings have to be reset \r\n\t\t\tnode.setNext(null);\r\n\t\t\ttemp.add(node);\r\n\t\t}\r\n\t\treturn temp;\r\n\t}", "public void reverseLinkedList() {\n\t\tSystem.out.println(\" Started reverseLinkedList () \"); \n\t\tNode currentNode = headNode;\n\t//\tNode reverseHeadNode = null;\n\t\tNode previousNode = null;\n\t\t\n\t\t// Node prev = null; \n\t\t// Node current = headNode; \n\t\t\tNode next = currentNode.getNextNode();\n\t\t\t\n\t\t while(currentNode.getNextNode() != null) {\n\t\t \tcurrentNode.setNextNode(previousNode);\n\t\t \tpreviousNode = currentNode;\n\t\t currentNode = next;\n\t\t // System.out.println(\"next.data Before \"+next.getData());\n\t\t next = currentNode.getNextNode();\n\t\t // System.out.println(\"next.data After \"+next.getData());\n\t\t }\n\t\t // System.out.println(\" previousNode is \"+previousNode);\n\t\t currentNode.setNextNode(previousNode);\n\t\t headNode = currentNode;\n\t\t \n//\t\tif(headNode==null) {\n//\t\t\treturn;\n//\t\t} else {\n//\t\t\tif(currentNode.getNextNode()==null) {\n//\t\t\t\treturn;\n//\t\t\t} else {\n//\t\t\t\twhile(currentNode.getNextNode()!=null) {\n//\t\t\t\t\tpreviousNode = currentNode;\n//\t\t\t\t//\tSystem.out.println(\" previousNode Data \"+previousNode.getData());\n//\t\t\t\t\tcurrentNode = currentNode.getNextNode();\n//\n//\t\t\t\t\tSystem.out.println(\"1111 currentNode Data \"+currentNode.getData()\n//\t\t\t\t\t\t\t+\" previousNode Data \"+previousNode.getData());\n//\t\t\t\t\t\n//\t\t\t\t\t//currentNode = currentNode.getNextNode();\n//\t\t\t\t\t\n//\t\t\t\t\tcurrentNode.setNextNode(previousNode);\n//\t\t\t\t\t\n//\t\t\t\t\tcurrentNode = currentNode.getNextNode();\n//\t\t\t\t\t\n//\t\t\t\t\tSystem.out.println(\"2222 currentNode Data \"+currentNode.getData()\n//\t\t\t\t\t+\" previousNode Data \"+previousNode.getData()\n//\t\t\t\t\t+\" currentNode.getNextNode() Data \"+currentNode.getNextNode().getData());\n//\n//\t\t\t\t//\tcurrentNode = currentNode.getNextNode();\n//\t\t\t\t\t\n//\n//\t\t\t\t\tlullaby();\n//\n//\n//\t\t\t\t}\n//\t\t\t\t\n//\t\t\t\t//headNode = previousNode;\n//\t\t\t\t\n//\t\t\t}\n//\t\t}\n\t\tSystem.out.println(\" Completed reverseLinkedList () \"); \n\t}", "void reverse()\n\t{\n\t\tint a;\n\t\tif(isEmpty())\n\t\t\treturn;\n\t\telse\n\t\t{\t\n\t\t\ta = dequeue();\n\t\t\treverse(); \n\t\t\tenqueue(a);\n\t\t}\n\t}", "public Node reverseMe(Node head) {\n Node current = head;\n Node prev = null;\n while (current != null) {\n Node next = current.next;\n current.next = prev;\n prev = current;\n current = next;\n }\n head = prev;\n return head;\n }", "Node reversedLinkedList(Node oldList) {\n Node newList = null;\n while (oldList != null) {\n\tNode element = oldList;\n\toldList = oldList.next;\n\telement.next = newList;\n\tnewList = element;\n }\n return newList;\n}", "public static void reversePrint(SinglyLinkedListNode llist) {\n SinglyLinkedListNode next=null;\n SinglyLinkedListNode current=llist;\n SinglyLinkedListNode previous=null;\n while(current!=null)\n {\n next=current.next;\n current.next=previous;\n previous=current;\n current=next;\n }\n while(previous!=null)\n {\n System.out.println(previous.data);\n previous=previous.next;\n }\n }", "public static ListNode reverseList2(ListNode head) {\n ListNode n = head;\n ListNode p = null;\n ListNode q = null;\n while (n != null) {\n p = q;\n q = n;\n n = n.next;\n q.next = p;\n }\n return q;\n }", "private static LinkedListNode reverseLinkedList(LinkedListNode head) {\n if (head == null) {\n return null;\n }\n LinkedListNode revHead = head, temp = null;\n while (head.next != null) {\n temp = head.next;\n head.next = temp.next;\n temp.next = revHead;\n revHead = temp;\n }\n return revHead;\n }", "public void reverseDi() {\n int hi = size - 1;\n int lo = 0;\n\n while (lo < hi) {\n Node left = getNodeAt(lo);\n Node right = getNodeAt(hi);\n\n Object temp = left.data;\n left.data = right.data;\n right.data = temp;\n\n lo++;\n hi--;\n }\n }", "public ListNode reverseList(ListNode l) {\n ListNode prev = null;\n ListNode cur = l;\n ListNode next = null;\n while (cur != null) {\n next = cur.next;\n cur.next = prev;\n prev = cur;\n cur = next;\n }\n \n return prev;\n }", "private static void printList() {\n\tNode n=head;\n\tint size=0;\n\twhile(n!=null)\n\t{\n\t\tSystem.out.print(n.data+\" \");\n\t\tn=n.next;\n\t\tsize++;\n\t}\n\tn=head;\n\tfor(int i=0;i<size-1;i++)\n\t\tn=n.next;\n\tSystem.out.println(\"\\nreverse direction\");\n\twhile(n!=null)\n\t{\n\t\t\n\t\tSystem.out.print(n.data+\" \");\n\t\tn=n.prev;\n\t}\n\t\n}", "Node Reverse(Node head) {\n Node p = null;\n Node q = head;\n Node r = null;\n while(q!=null) {\n r = q.next;\n q.next = p;\n p = q;\n q = r;\n }\n head = p;\n return head;\n}", "public static SinglyLinkedList reverse(SinglyLinkedList list) {\r\n\t\tNode prev=null;\r\n\t\tNode current=list.getFirst();\r\n\t\tNode next=null;\r\n\t\t\r\n\t\twhile (current != null) {\r\n\t\t\tSystem.out.println(\"current: \" + current.getData());\r\n\t\t\tnext=current.next();\r\n\t\t\tcurrent.setNext(prev);\r\n\t\t\tprev=current;\r\n\t\t\tcurrent=next;\r\n\t\t}\r\n\t\tlist.setHead(prev); //have to reset head\r\n\t\treturn list;\r\n\t}", "public void reverse(){\n\n\n SNode reverse =null;\n\n while(head != null) {\n\n SNode next= head.next;\n head.next=reverse;\n reverse = head;\n\n head=next;\n\n\n }\n head=reverse; // set head to reverse node. it mean next node was null and head should be previous node.\n\n\n }", "LinkedListProblems.Node reverseLinkedList(LinkedListProblems.Node head){\n if(head==null || head.next==null){\n return head;\n }\n LinkedListProblems.Node result = reverseLinkedList(head.next);\n head.next.next = head;//new link\n head.next = null;//null existing links\n return result;\n }", "public void reverse_Iteratively_Data() throws Exception {\r\n\t\tint left = 0, right = this.size() - 1;\r\n\r\n\t\twhile (left <= right) {\r\n\t\t\tNode leftNode = this.getNodeAt(left);\r\n\t\t\tNode rightNode = this.getNodeAt(right);\r\n\r\n\t\t\tT temp = leftNode.data;\r\n\t\t\tleftNode.data = rightNode.data;\r\n\t\t\trightNode.data = temp;\r\n\r\n\t\t\tleft++;\r\n\t\t\tright--;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n List<Node<Integer>> lst = new ArrayList<Node<Integer>>();\n for (int i = 0; i < 10; i++) {\n Node<Integer> n1 = new Node<Integer>(i);\n lst.add(n1);\n }\n for (int i = 0; i < lst.size() - 1; i++) {\n lst.get(i).next = lst.get(i + 1);\n }\n Node<Integer> start = lst.get(0);\n\n LinkListLearn l = new LinkListLearn();\n\n l.printLinkList(start);\n\n start = l.reverseRecursively(start);\n System.out.println();\n l.printLinkList(start);\n }", "public ListNode reverseList(ListNode head) {\n ListNode current = head;\n ListNode prev = null;\n \n while(current != null){\n ListNode temp = current.next;\n current.next = prev;\n \n prev = current;\n current = temp;\n }\n return prev;\n }", "public static LinkedList recursiveReverse(LinkedList linkedList) {\n // check for empty or size 1 linked list. This is a base condition to\n // terminate recursion.\n if (linkedList == null || linkedList.next == null) {\n return linkedList;\n }\n\n LinkedList remainingReverse = recursiveReverse(linkedList.next);\n\n // update the tail as beginning\n LinkedList current = remainingReverse;\n while (current.next != null) {\n current = current.next;\n\n }\n // assign the head as a tail\n current.next = linkedList;\n linkedList.next = null;\n\n return remainingReverse;\n }", "public static ListNode reverseList(ListNode head) {\n ListNode h = head;\n ListNode n = h;\n ListNode p = null;\n ListNode rev = new ListNode(0);\n ListNode cur = rev;\n \n while (n != null) {\n p = n;\n n = n.next;\n if (n == null) {\n cur.next = new ListNode(p.val);\n head = rev.next;\n } else if (n.next == null) {\n cur.next = new ListNode(n.val);\n cur = cur.next;\n p.next = null;\n n = h;\n }\n }\n return head; \n }", "public ListNode reverse(ListNode head) {\n if(head == null || head.next == null){\n return head;\n }\n ListNode prev = head;\n ListNode cur = head.next;\n prev.next = null;\n while(cur.next != null){\n ListNode nextNode = cur.next;\n cur.next = prev;\n prev = cur;\n cur = nextNode;\n }\n cur.next = prev;\n return cur;\n }", "void reverse();", "void reverse();", "public static void main(String[] args) {\n \n LinkedList<Integer> l = new LinkedList<Integer>();\n l.add(1);\n l.add(2);\n l.add(3);\n l.add(4);\n ReverseCollection rev = new ReverseCollection();\n rev.reverse(l);\n System.out.println(Arrays.toString(l.toArray()));\n\n }", "public ListNode reverseList(ListNode head) {\n if (head == null) {\n return null;\n }\n ListNode newHead = new ListNode(1);\n ListNode p = head;\n ListNode q = null;\n while(p != null) {\n q = p.next;\n p.next = newHead.next;\n newHead.next = p;\n p = q;\n }\n\n return newHead.next;\n }", "public void printLinkedListInReverse(ImmutableListNode head) {\n if (head == null) return;\n printLinkedListInReverse(head.getNext());\n head.printValue();\n }", "public ListNode reverseList(ListNode head) {\n ListNode first = head;\n ListNode reverse = null;\n while (first != null) {\n ListNode temp = first.next;\n first.next = reverse;\n reverse = first;\n first = temp;\n }\n return reverse;\n }", "public ListNode reverseList(ListNode head) {\n return recursionVersion2_3rdTime(head);\n }", "public static LinkedList reverseLinkedList(LinkedList head) {\n\t\tLinkedList t1=head;\n\t\tLinkedList t2=head.next;\n\t\tLinkedList t3=null;\n\t\tif (t1.next==null){\n\t\treturn t1;\n\t\t}\n\t\twhile(t2.next!=null){\n\t\t\tt3=t2.next;\n\t\t\tt2.next=t1;\n\t\t\tt1=t2;\n\t\t\tt2=t3;\n\t\t}\n\t\tt2.next=t1;\n\t\thead.next=null;\n\t\thead=t2;\n return head;\n }", "public void reverse() {\n\t\tif (!this.isEmpty()) {\n\t\t\tT x = this.peek();\n\t\t\tthis.pop();\n\t\t\treverse();\n\t\t\tinsert_at_bottom(x);\n\t\t} else\n\t\t\treturn;\n\t}", "public void printInReverseOrder() {\n\t\tNode currentNode = headNode;\n\t\tNode previousNode = headNode;\n\t\t\n\t\tif(currentNode==null) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tList<Node> listOfNodes = new ArrayList<Node>();\n\t\t\t//deal One element LinkedList\n\t\t\tif(currentNode.getNextNode()==null) {\n\t\t\t\tSystem.out.println(currentNode.getData());\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\twhile(currentNode.getNextNode()!=null) {\n\t\t\t\t\tpreviousNode = currentNode;\n\t\t\t\t\tcurrentNode = currentNode.getNextNode();\n\t\t\t\t\tlistOfNodes.add(previousNode);\n\t\t\t\t\tSystem.out.println(\" Adding Node value to the List as \"+currentNode.getData());\n\t\t\t\t}\n\t\t\t\tif(currentNode!=null) {\n\t\t\t\t\tSystem.out.println(\" The Last Node is \"+currentNode.getData());\n\t\t\t\t\tcurrentNode = previousNode.getNextNode();\n\t\t\t\t\tSystem.out.println(\" The Last Node's Next Node is \"+currentNode.getData());\n\n\t\t\t\t\tlistOfNodes.add(currentNode);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(listOfNodes!=null && listOfNodes.size()>0) {\n\t\t\t\t\tCollections.reverse(listOfNodes);\n\t\t\t\t\tlistOfNodes.stream().forEach(elem->System.out.print(elem.data+\" =>\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public void reverseHelperList(DoubleLinkedList _list) {\n\t\tDLNode n = tail;\n\t\tDLNode k = new DLNode(_list);\n\t\tn.next = k;\n\t\tk.prev = n;\n\t\ttail = k;\n\n\t}", "public void recursiveReverse (Node currentNode)\n{\nif (currentNode==NULL)\nreturn;\n\n/*if we are at the tail node:\n recursive base case:\n*/\nif(currentNode.next==NULL)\n{\n//set HEAD to the current tail since we are reversing list\nhead=currentNode;\nreturn; //since this is the base case\n}\n\nrecursiveReverse(currentNode.next);\ncurrentNode.next.next=currentNode;\ncurrentNode.next=null; //set \"old\" next pointer to NULL\n}", "public Node reverserLinkedList(Node head){\n // size == 0\n if(head == null){\n return null;\n }\n // size == 1\n if(head.getNext() == null){\n return head;\n }\n\n Node newHead = reverserLinkedList(head.getNext());\n head.getNext().setNext(head);\n head.setNext(null);\n return newHead;\n }", "public void reverseList(List<Integer> list) {\n for (int i = list.size() - 1; i >= 0; i--) {\n System.out.println(list.get(i));\n }\n }", "public ListNode reverse(ListNode head){\n if(head == null || head.next == null) return head;\n\n ListNode curr = head, prev = null;\n\n while(curr != null){\n ListNode temp = curr.next;\n curr.next = prev;\n prev = curr;\n curr = temp;\n }\n\n return prev;\n }", "static void ReversePrint(Node head) {\n\t\t while(head.next != null){\n\t\t head.next = head;\n\t\t head.next.next= head.next;\n\t\t }\n\t\t }", "public static void main(String[] args) {\n ListNode<Integer> head = new ListNode<>(5);\n LinkedListBasic<Integer> linkedListBasic = new LinkedListBasic<>();\n for (int i = 10; i < 50; i+=5){\n linkedListBasic.insertNewNode(i, head);\n }\n\n /*linkedListBasic.printLinkedList(head);\n reverseSubList(head, 2, 6);\n linkedListBasic.printLinkedList(head);*/\n\n linkedListBasic.printLinkedList(head);\n ListNode<Integer> newHead = reverseLinkedList2(head);\n linkedListBasic.printLinkedList(newHead);\n reverseSubList(newHead, 2, 6);\n linkedListBasic.printLinkedList(newHead);\n\n }", "public static void main(String[] args) {\n\t\tLinkedList ll = new LinkedList();\n\t\tll.insertAtEnd(new ListNode(1));\n\t\tll.insertAtEnd(new ListNode(2));\n\t\tll.insertAtEnd(new ListNode(4));\n\t\tll.insertAtEnd(new ListNode(5));\n\t\tll.insertAtEnd(new ListNode(6));\n\t\tll.insertAtEnd(new ListNode(7));\n\t\tll.insertAtEnd(new ListNode(8));\n\t\tll.insertAtEnd(new ListNode(9));\n\t\tll.insertAtEnd(new ListNode(10));\n\t\t\n\t\tSystem.out.println(\"Before Reversal \" + ll);\n\t\t\n\t\tll.reverseRecursive(null,ll.getHead());\n\t\t\n\t\tSystem.out.println(\"After Reversal \" + ll);\n\t}", "public ListNode reverse(ListNode prev, ListNode start, ListNode end) {\n\t\tListNode current = start.next;\n\t\tListNode preCurrent = start;\n\t\twhile(current != end){\n\t\t\tListNode temp = current.next;\n\t\t\tcurrent.next = preCurrent;\n\t\t\tpreCurrent = current;\n\t\t\tcurrent = temp;\n\t\t}\n\t\tstart.next = end.next;\n\t\tend.next = preCurrent;\n\t\tprev.next = end;\n\t\treturn start;\n\t}", "public ListNode reverseList(ListNode head) {\n if(head==null || head.next==null) return head;\n \n ListNode prev=reverseList(head.next);\n head.next.next=head;\n head.next=null;\n \n return prev;\n}", "public ListNode reverse(ListNode head) {\n if(head == null || head.next == null) {\n return head;\n }\n ListNode prev = null;\n while(head != null) {\n ListNode temp = head.next;\n head.next = prev;\n prev = head;\n head = temp;\n }\n //head.next = null;\n return prev;\n }", "public ListNode reverse(ListNode head){\n\t\t\n\t\tif (head == NULL || head.next == NULL)\n\t\treturn; //empty or just one node in list\n\n\t\tListNode Second = head.next;\n\t\n\t\t//store third node before we change \n\t\tListNode Third = Second.next; \n\n\t\t//Second's next pointer\n\t\tSecond.next = head; //second now points to head\n\t\thead.next = NULL; //change head pointer to NULL\n\n\t\t//only two nodes, which we already reversed\n\t\tif (Third == NULL) return; \n\n\t\tListNode CurrentNode = Third;\n\n\t\tListNode PreviousNode = Second;\n\n\t\twhile (CurrentNode != NULL){\n\t\t\tListNode NextNode = CurrentNode.next;\n\n\t\t\tCurrentNode.next = PreviousNode;\n\n\t\t\t/* repeat the process, but have to reset\n\t \t\tthe PreviousNode and CurrentNode\n\t\t\t*/\n\n\t\t\tPreviousNode = CurrentNode;\n\t\t\tCurrentNode = NextNode; \n\t\t}\n\n\t\t\thead = PreviousNode; //reset the head node\n\t\t}", "public /*@ non_null @*/ JMLListEqualsNode<E> reverse() {\n JMLListEqualsNode<E> ptr = this;\n JMLListEqualsNode<E> ret = null;\n //@ loop_invariant ptr != this ==> ret != null;\n //@ maintaining (* ret is the reverse of items in this up to ptr *);\n while (ptr != null) {\n //@ assume ptr.val != null ==> \\typeof(ptr.val) <: elementType;\n ret = new JMLListEqualsNode<E>(ptr.val == null ? null\n : (ptr.val) ,\n ret);\n ptr = ptr.next;\n }\n //@ assert ptr == null && ret != null;\n //@ assume elementType == ret.elementType;\n //@ assume containsNull <==> ret.containsNull;\n return ret;\n }", "public void reverse() {\n ArrayList<Character> newSeq = new ArrayList<Character>();\n for (int i = 0; i < seq.size(); i++) {\n newSeq.add(seq.get(seq.size() - 1 - i));\n }\n seq = newSeq;\n }", "public NodeRandom reverse(NodeRandom start)\n\t{\n\t\tNodeRandom curr=start;\n\t\t\n\t\tNodeRandom temp;\n\t\tNodeRandom prev2=null;\n\t\twhile(curr!=null)\n\t\t{\t\t\t\n\t\t\ttemp=curr.next;\t\t\t\n\t\t\tcurr.next=prev2;\n\t\t\tprev2=curr;\n\t\t\tcurr=temp;\n\t\t}\t\t\n\t\tNodeRandom newstart=prev2;\t\t\t\t\n\t\tSystem.out.println(\"reverse a list\");\n\t\tdisplay(newstart);\n\t\treturn newstart;\n\t}", "public static void reverse(java.util.List arg0)\n { return; }", "public static LinkedList recursiveReverseList(LinkedList list) {\n\t\tif (list.getHead() == null) {\n\t\t\treturn list;\n\t\t} else if (list.getHead().getNext() == null) {\n\t\t\treturn list;\n\t\t} else {\n\t\t\tListNode currentHead = list.getHead();\n\t\t\tListNode newHead = list.getHead().getNext();\n\t\t\tLinkedList rest = new LinkedList();\n\t\t\trest.setHead(newHead);\n\t\t\tLinkedList reversedRest = recursiveReverseList(rest);\n\t\t\treversedRest.add(currentHead.getData());\n\t\t\treturn reversedRest;\n\t\t}\n\t}", "public void reverse() {\n\t\t\n\t\tif(isEmpty()==false){\n\t\t\tDoubleNode left=head, right=tail;\n\t\t\tchar temp;\n\t\t\twhile(left!=right&&right!=left.getPrev()){\n\t\t\t\ttemp=left.getC();\n\t\t\t\tleft.setC(right.getC());\n\t\t\t\tright.setC(temp);\n\t\t\t\tleft=left.getNext();\n\t\t\t\tright=right.getPrev();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@Test\n public void testReverse() {\n System.out.println(\"reverse\");\n al.add(1);\n al.add(2);\n al.add(3);\n ArrayList<Integer> rl = new ArrayList<>();\n rl.add(3);\n rl.add(2);\n rl.add(1);\n al.reverse();\n assertEquals(rl.get(0), al.get(0));\n assertEquals(rl.get(1), al.get(1));\n assertEquals(rl.get(2), al.get(2));\n }", "public ListNode reverse(ListNode head) {\n if(head == null || head.next == null){\n return head;\n }\n ListNode curr = head;\n ListNode newHead = reverse(curr.next);\n curr.next.next = curr;\n curr.next = null;\n return newHead;\n }", "public static IntNode reverse( IntNode head ) {\r\n\t\t\r\n\t\t// method should return the linked list with the new head\r\n\t\tif( head != null ) {\r\n\t\t\tIntNode prev = null;\r\n\t\t\tIntNode cursor = head;\r\n\t\t\tIntNode link = null;\r\n\t\t\twhile( cursor != null ) {\r\n\t\t\t\tlink = cursor.link;\r\n\t\t\t\tcursor.link = prev;\r\n\t\t\t\tprev = cursor;\r\n\t\t\t\tcursor = link;\r\n\t\t\t}\r\n\t\t\thead = prev;\r\n\t\t\treturn head;\r\n\t\t} // end if\r\n\t\t\r\n\t\treturn null;\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n ListNode l0 = new ListNode(1);\n ListNode l1 = new ListNode(2);\n ListNode l2 = new ListNode(3);\n ListNode l3 = new ListNode(4);\n l0.next = l1;\n l1.next = l2;\n l2.next = l3;\n\n System.out.println(l0);\n reverseList(l0);\n System.out.println(l3);\n }", "public ListNode reverseList(ListNode head) {\n if (head == null) return null;\n ListNode prev = null;\n ListNode cur = head;\n while (cur != null) {\n ListNode temp = cur.next;\n cur.next = prev;\n prev = cur;\n cur = temp;\n }\n return prev;\n }", "public void reverse() {\n\t\tif(isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\tNodo <T> pri_n= fin;\n\t\t\n\t\tint cont= tamanio-1;\n\t\tNodo<T> nodo_act= pri_n;\n\t\twhile(cont >0) {\n\t\t\tNodo <T> aux= getNode(cont-1);\n\t\t\tnodo_act.setSiguiente(aux);\n\t\t\tnodo_act= aux;\n\t\t\tcont--;\n\t\t}\n\t\tinicio = pri_n;\n\t\tfin= nodo_act;\n\t\tfin.setSiguiente(null);\n\t}", "public void printListRev(){\n System.out.println(\"My current doubly linked list in reverse:\");\n if (head.next != tail || tail.prev != head){\n MyDoubleNode<T> counter = tail;\n while (counter.prev != head){\n counter = counter.prev;\n if (counter.prev != head){\n System.out.print(counter.data + \", \");\n }\n else {\n System.out.print(counter.data + \"\\n\");\n }\n }\n }\n }", "public static void main(String[] args) {\n\t\tListAll myList = new ListAll();\n\t\tListNode head = myList.create(10);\n\t\tListNode cur = head;\n\t\twhile(cur != null){\n\t\t\tSystem.out.print(cur.val);\n\t\t\tcur = cur.next;\n\t\t}\n\t\tSystem.out.println();\n\t\tListNode reverseHead = myList.change(head);\n\t\twhile(reverseHead != null){\n\t\t\tSystem.out.print(reverseHead.val);\n\t\t\treverseHead = reverseHead.next;\n\t\t}\n\t}", "private Object asReversedIteration(final List<Object> list, final boolean recursive, final List<Object> disc) {\n Stack<Object> s = new Stack<>();\n disc.add(list);\n outerLoop:\n for (Object m : list) {\n s.push(m);\n\n for (Object e : disc) {\n {\n if (e == m) {\n continue outerLoop;\n }\n }\n }\n if (recursive) {\n if (m instanceof List<?>) {\n asReversedIteration((List<Object>) m, true, disc);\n }\n if (m instanceof Map<?, ?>) {\n asReversedIteration((Map<String, Object>) m, true, disc);\n }\n }\n\n }\n list.clear();\n int size = s.size();\n for (int i = 0; i < size; i++) {\n list.add(s.pop());\n }\n return list;\n }", "public void revPrintList(){\n\t\tCollections.reverse(listStr); //reverse ArrayList\n\t\t//cast the array list to a linked list\n\t\tLinkedList<Object> linkedString = new LinkedList<Object>(listStr);\n\t\t//while there is something in the LinkedList, run following code\n\t\twhile (linkedString.size() > 0) {\n\t\t\t//print out the current first in \"queue\" word\n\t\t\tSystem.out.print(linkedString.get(0) + \" \");\n\t\t\t//remove the first item in the linked list\n\t\t\tlinkedString.removeFirst();\n\t\t}\n\t\t//print out a new blank line for better readability\n\t\tSystem.out.println(\"\\n\");\n\t}", "public static void main(String[] args)\n {\n reverse_linkedlist reverse=new reverse_linkedlist();\n Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n\n for(int i=0;i<n;i++)\n {\n int data=sc.nextInt();\n reverse.append(data);\n }\n reverse.reverse_recursion(reverse.head);\n // reverse.printlist();\n\n }" ]
[ "0.8033501", "0.7782093", "0.7507352", "0.7418958", "0.7398225", "0.73602706", "0.7307109", "0.7259685", "0.7240721", "0.7216046", "0.72045666", "0.71895224", "0.716126", "0.7146147", "0.7098927", "0.70899534", "0.70676327", "0.7063953", "0.70005864", "0.69548184", "0.6931322", "0.6904231", "0.6875597", "0.6870483", "0.6859137", "0.6805367", "0.680309", "0.6788072", "0.6774249", "0.6772582", "0.6768283", "0.6750332", "0.6749376", "0.6748805", "0.6747794", "0.6741392", "0.6740663", "0.6714823", "0.6691801", "0.6687723", "0.66791314", "0.6678916", "0.6657443", "0.6654041", "0.6648159", "0.66340864", "0.6617427", "0.66012526", "0.65862226", "0.65806246", "0.65693146", "0.65632313", "0.6557119", "0.6543879", "0.6542035", "0.6470206", "0.6470104", "0.64438426", "0.643508", "0.6429012", "0.64193153", "0.641144", "0.641144", "0.6406295", "0.64017403", "0.63955384", "0.6392034", "0.63803214", "0.63741344", "0.6345791", "0.6329195", "0.6326997", "0.63244456", "0.63174766", "0.6308809", "0.6304431", "0.6296493", "0.6276458", "0.6275558", "0.6261298", "0.6239044", "0.62388426", "0.6238335", "0.6235835", "0.6227104", "0.62259614", "0.62178105", "0.6215123", "0.62120473", "0.619377", "0.6186239", "0.61825496", "0.6182244", "0.61629593", "0.61514026", "0.6141643", "0.613682", "0.6116729", "0.6112519", "0.6102401" ]
0.62133294
88
Reverse a Sublist (medium) Reverse a linked list II: Reverse a linked list from position m to n. Do it in onepass.
public ListNode reverseBetween(ListNode head, int m, int n) { ListNode fakeHead = new ListNode(-1); fakeHead.next = head; ListNode curr = fakeHead.next; ListNode prev = fakeHead; int i = 1; // Move to node 'm' while (i < m) { prev = curr; curr = curr.next; i++; } // End of first m node ListNode mthNode = prev; // Reverse the node from 'm' to node 'n' while (i <= n) { ListNode next = curr.next; curr.next = prev; prev = curr; curr = next; i++; } // mthNode 'next of next' will point to curr node mthNode.next.next = curr; // mthNode next will point to reversed node mthNode.next = prev; return fakeHead.next; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ListNode reverseBetween(ListNode head, int m, int n) {\n if (head.next == null) return head;\n m--; //the index of first element is 1 , hence decrement as we are starting first from 0\n int i =0;\n\n //progress the pointers forward\n ListNode origHead = head;\n ListNode priorEnd = null;\n for (; i < m && head != null; i++) {\n priorEnd = head;\n head = head.next;\n }\n int noToReverse = n-m;\n\n //add to stack the number of elements needed to be reversed\n Stack<ListNode> stack = new Stack<>();\n for (i=0; i < noToReverse && head != null; i++) {\n stack.add(head);\n head = head.next;\n }\n //keep track of what was next\n ListNode next = head;\n\n //adjust pointers by popping last from stack\n while (!stack.isEmpty()) {\n ListNode node = stack.pop();\n if (priorEnd == null) {\n origHead = node; //if you starting from the first element in the list priorEnd is null\n } else {\n priorEnd.next = node;\n }\n priorEnd = node;\n }\n //adjust prior end to next\n if (priorEnd != null) {\n priorEnd.next = next;\n }\n return origHead;\n }", "public void _reverse() {\n\n var prev = first;\n var current = first.next;\n last = first;\n last.next = null;\n while (current != null) {\n var next = current.next;\n current.next = prev;\n prev = current;\n current = next;\n\n }\n first = prev;\n\n }", "public void reverse() {\n var previous = first;\n var current = first.next;\n\n last = first;\n last.next = null;\n while (current != null) {\n var next = current.next;\n current.next = previous;\n previous = current;\n current = next;\n\n }\n first = previous;\n\n }", "void reverseList(){\n\n Node prev = null;\n Node next = null;\n Node iter = this.head;\n\n while(iter != null)\n {\n next = iter.next;\n iter.next = prev;\n prev = iter;\n iter = next;\n\n }\n\n //prev is the link to the head of the new list\n this.head = prev;\n\n }", "public void reverse() {\n\n\t\tif (head == null) {\n\t\t\tSystem.out.println(\"List is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tint nodes = nodeCounter();\n\t\tDLNode t = tail.prev;\n\t\thead = tail;\n\t\tfor (int i = 0; i < nodes - 1; i++) {\n\n\t\t\tif (t.list == null && t.val != Integer.MIN_VALUE) {\n\t\t\t\tthis.reverseHelperVal(t.val);\n\t\t\t\tt = t.prev;\n\t\t\t} else {\n\t\t\t\tthis.reverseHelperList(t.list);\n\t\t\t\tt = t.prev;\n\t\t\t}\n\t\t}\n\t\ttail.next = null;\n\t\thead.prev = null;\n\n\t}", "private void reverse(ListNode startNode, ListNode endNode) {\n endNode.next = null;\n ListNode pre = startNode, cur = startNode.next, newEnd = pre;\n while (cur != null) {\n ListNode nextNode = cur.next;\n cur.next = pre;\n pre = cur;\n cur = nextNode;\n }\n }", "public static ListNode reverseList2(ListNode head) {\n ListNode n = head;\n ListNode p = null;\n ListNode q = null;\n while (n != null) {\n p = q;\n q = n;\n n = n.next;\n q.next = p;\n }\n return q;\n }", "private static Node reverseList(Node start) {\n Node runner = start;\n // initialize the return value\n Node rev = null;\n // set the runner to the last item in the list\n while (runner != null) {\n Node next = new Node(runner.value);\n next.next = rev;\n rev = next;\n runner = runner.next;\n }\n return rev;\n }", "public Node reverseBetween(Node head, int m, int n) {\n\t\tif(head == null) return null;\n\t\tNode before = null;\n\t\tNode start = head;\n\t\t\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\tif(start == null) return null;\n\t\t\tbefore = start;\n\t\t\tstart = start.next;\n\t\t}\n\t\t\n\t\tNode curr = start;\n\t\tNode prev = null;\n\t\tNode next = null;\n\t\tint count = 0;\n\t\twhile(count <= (n-m)) {\n\t\t\tnext = curr.next;\n\t\t\tcurr.next = prev;\n\t\t\tprev = curr;\n\t\t\tcurr = next;\n\t\t\tcount++;\n\t\t}\n\t\t\n\t\tif(m == 0) {\n\t\t\tstart.next = curr;\n\t\t\treturn prev;\n\t\t}\n\t\tbefore.next.next = curr;\n\t\tbefore.next = prev;\n\t\t\n\t\treturn head;\n\t}", "public void reverseBetween(Node head, int m, int n) {\r\n\t\tif(head ==null||head.next==null){\r\n\t\t\treturn ;\r\n\t\t}\t\r\n\t\tNode last_current =null;\r\n\t\tNode next = null;\r\n\t\tint m_count=1;\r\n\t\tint n_count=1;\r\n\t\tNode pre_m = null;\r\n\t\tNode m_node = null;\t\t\r\n////////////n\r\n\t/*Input: 1->2->3->4->5->NULL, m = 2, n = 4\r\n\t * \r\n\tOutput: 1->4->3->2->5->NULL*/\r\n\t\tNode current = head;\r\n\t\twhile(current!=null){\r\n\t\t\tnext = current.next;\r\n\t\t\tif(m-1==m_count){ \r\n\t\t\t\tpre_m=current;\r\n\t\t\t}\r\n\t\t\tif(m==m_count){\r\n\t\t\t\tm_node = current;\r\n\t\t\t\tlast_current = m_node;\r\n\t\t\t}\r\n\t\t\tif(m_count>m&&n_count<n){\r\n\t\t\t\tcurrent.next = last_current;\r\n\t\t\t}\r\n\t\t\tif(n_count==n){\r\n\t\t\t\tpre_m.next = current;\r\n\t\t\t\tm_node.next = current.next;\t\t\t\r\n\t\t\t\tcurrent.next = last_current;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tlast_current = current;\r\n\t\t\tcurrent = next;\r\n\t\t\tm_count++;\r\n\t\t\tn_count++;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//return reversehead;\r\n\t \r\n\t}", "@NonNull\n ConsList<E> reverse();", "public static LinkedList<Integer> Reverse2(LinkedList<Integer> list) {\n\t\tLinkedList<Integer> listReverse = new LinkedList<Integer>();\n\t\tIterator<Integer> re = list.descendingIterator();\n\t\twhile (re.hasNext()) {\n\t\t\tlistReverse.add(re.next());\n\t\t}\n\n\t\treturn listReverse;\n\t}", "public void reverseDi() {\n int hi = size - 1;\n int lo = 0;\n\n while (lo < hi) {\n Node left = getNodeAt(lo);\n Node right = getNodeAt(hi);\n\n Object temp = left.data;\n left.data = right.data;\n right.data = temp;\n\n lo++;\n hi--;\n }\n }", "public void reverse()\n\t{\n\t\tSinglyLinkedListNode nextNode = head;\n\t\tSinglyLinkedListNode prevNode = null;\n\t\tSinglyLinkedListNode prevPrevNode = null;\n\t\twhile(head != null)\n\t\t{\n\t\t\tprevPrevNode = prevNode;\n\t\t\tprevNode = nextNode;\n\t\t\tnextNode = prevNode.getNext();\n\t\t\tprevNode.setNext(prevPrevNode);\n\t\t\tif(nextNode == null)\n\t\t\t{\n\t\t\t\thead = prevNode;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void reverse() {\n\t\t// write you code for reverse using the specifications above\t\t\n\t\tNode nodeRef = head;\n\t\thead = null;\n\t\t\n\t\twhile(nodeRef != null) {\n\t\t\tNode tmp = nodeRef;\n\t\t\tnodeRef = nodeRef.next;\n\t\t\ttmp.next = head;\n\t\t\thead = tmp;\n\t\t}\n\t}", "public void reverseEasy(int pos1, int pos2){\n \t // If pos1 == pos2, reversing a single list element does nothing\n \t // If pos1 > pos2, reversing an empty sublist does nothing\n \t if (pos1 >= pos2)\n \t return;\n \t\t\t\t\t\t\t\t\t\t\n \t // We swap the 1st and last items in the sublist,\n \t // then recursively reverse the remaining sublist\n \t // We stop when the remaining sublist has size 0 or 1\n\n \t // Swap list items at pos1 and pos2\n \t E temp = remove(pos2);\n \t add(pos2, get(pos1));\n \t remove(pos1);\n \t add(pos1, temp);\n\n \t // Now recursively reverse remainder of sublist (if any)\n \t // The remaining sublist is from pos1+1 to pos2-1\n \t reverseEasy(pos1+1, pos2-1);\n \t}", "public DoubleLinkedSeq reverse(){\r\n\t DoubleLinkedSeq rev = new DoubleLinkedSeq();\r\n\t for(cursor = head; cursor != null; cursor = cursor.getLink()){\r\n\t\t rev.addBefore(this.getCurrent());\r\n\t }\r\n\t \r\n\t return rev; \r\n }", "ListNode<Integer> rearrangeLastN(ListNode<Integer> l, int n) {\r\n\t\t\r\n\r\n\t\t\r\n\t\tListNode<Integer> result = new ListNode<Integer>(0);\r\n\t\tListNode<Integer> head_result = result;\r\n\t\t\r\n\t\tListNode<Integer> temp = new ListNode<Integer>(0);\r\n\t\tListNode<Integer> pointer = temp;\r\n\t\t\r\n\t/* 1. */\r\n\t\tint size = (listSize(l) - n);\r\n\t\t\r\n\t/* 2. */\r\n\t\tfor(int i = 0;i < size; i++)\t{\r\n\t\t\tresult.next = l;\r\n\t\t\tresult = result.next;\r\n\t\t\tl = l.next;\r\n\t\t}\r\n\t\tresult.next = null;\r\n\t\tresult = head_result.next;\r\n\t/*3.*/ \r\n\t\twhile(l != null)\t{\r\n\t\t\ttemp.next = l;\r\n\t\t\ttemp = temp.next;\r\n\t\t\tl = l.next;\r\n\t\t}\r\n\t\ttemp.next = head_result.next;\r\n\t\ttemp = pointer.next;\r\n\t\tresult = temp;\r\n\t\t\r\n\t\treturn result;\r\n\t}", "public static void reverselist ( LinkedList list)\r\n\t\t{\r\n\t\t Node reversedpart = null;\r\n\t\t\tNode current = list.head;\t\r\n\t\t\tSystem.out.println(\" Reverse LinkedList: \"); \r\n\t\t \r\n\t\t while (current != null)\r\n\t\t {\r\n\t\t\t Node next = current.next;\r\n\t\t\t current.next = reversedpart;\r\n\t\t\t reversedpart = current;\r\n\t\t\t current = next; \r\n\t\t\t \r\n\t\t\t //System.out.print(reversedpart.data + \" \");\r\n\t\t\t //current = current.next;\r\n\t\t }\r\n\t\t System.out.println(\"\"); \r\n\t\t System.out.println(\" Reverse LinkedList: \"); \r\n\t\t \r\n\t\t while (reversedpart != null)\r\n\t\t {\r\n\t\t\t \t\t\t \r\n\t\t\t System.out.print(reversedpart.data + \" \");\r\n\t\t\t reversedpart = reversedpart.next;\r\n\t\t }\r\n\t\t System.out.println(\"\"); \r\n\t\t \r\n\t\t \r\n\t\t}", "public void reverse(int pos1, int pos2){\n \t // If pos1 == pos2, reversing a single list element does nothing\n \t // If pos1 > pos2, reversing an empty sublist does nothing\n \t if (pos1 >= pos2) {\n \t return;\n \t }\n \t \n \t // If either positions are out of bonds, throw IndexOutOfBoundsException\n if (pos1 < 0 || pos1 > numItems-1 || pos2 < 0 || pos2 > numItems-1) {\n throw new IndexOutOfBoundsException();\n }\t\t\t\t\n \n // We swap the 1st and last items in the sublist,\n \t // then recursively reverse the remaining sublist\n \t // We stop when the remaining sublist has size 0 or 1\n \n \t // Find the node in pos1\n DblListnode<E> pos1node = items.getNext(); // items is the header node so n is the first node in the list\n for (int k = 0; k < pos1; k++) {\n \t pos1node = pos1node.getNext();\n }\n \n // Find the node in pos2\n DblListnode<E> pos2node = items.getNext(); // items is the header node so n is the first node in the list\n for (int j = 0; j < pos2; j++) {\n \t pos2node = pos2node.getNext();\n }\n \n // Establish the previous and next nodes for each except pos2Next\n // this is in case pos2 is the last position in the list\n DblListnode<E> pos1Prev = pos1node.getPrev();\n DblListnode<E> pos1Next = pos1node.getNext();\n DblListnode<E> pos2Prev = pos2node.getPrev();\n \n // If pos2 is the last node, swap pos1 and pos2 linkages with the exception that \n // pos1node will not have a linkage out to a next position\n if (pos2 == numItems-1) {\n \t if (pos1node.getNext() == pos2node) {\n \t\t pos1node.setNext(null);\n \t pos1node.setPrev(pos2node);\n \t pos1Prev.setNext(pos2node);\n \t pos2node.setPrev(pos1Prev);\n \t pos2node.setNext(pos1node);\n }\n else {\n \t pos1node.setNext(null);\n \t pos1node.setPrev(pos2Prev);\n pos2Prev.setNext(pos1node);\n pos2node.setPrev(pos1Prev);\n pos2node.setNext(pos1Next);\n pos1Prev.setNext(pos2node);\n pos1Next.setPrev(pos2node);\n }\n }\n // If pos2node isn't the last node, we do the full swamp and linkage for both\n else {\n \t DblListnode<E> pos2Next = pos2node.getNext();\n \n if (pos1node.getNext() == pos2node) {\n \t pos1node.setNext(pos2Next);\n \t pos1node.setPrev(pos2node);\n \t pos1Prev.setNext(pos2node);\n \t pos2node.setPrev(pos1Prev);\n \t pos2node.setNext(pos1node);\n \t pos2Next.setPrev(pos1node);\n }\n else {\n \t pos1node.setPrev(pos2Prev);\n pos1node.setNext(pos2Next);\n pos2Prev.setNext(pos1node);\n pos2Next.setPrev(pos1node);\n pos2node.setPrev(pos1Prev);\n pos2node.setNext(pos1Next);\n pos1Prev.setNext(pos2node);\n pos1Next.setPrev(pos2node);\n }\n }\n \t \n \t // Now recursively reverse remainder of sublist (if any)\n \t // The remaining sublist is from pos1+1 to pos2-1\n \t reverse(pos1+1, pos2-1);\n \t}", "public void reverse() {\n\t\tNode previous = first;\n\t\tNode current = first.next;\n\n\t\twhile (current != null) {\n\t\t\tNode next = current.next;\n\t\t\tcurrent.next = previous;\n\n\t\t\tprevious = current;\n\t\t\tcurrent = next;\n\t\t}\n\t\tlast = first;\n\t\tlast.next = null;\n\t\tfirst = previous;\n\t}", "public static void main(String[] args) {\n ListNode<Integer> head = new ListNode<>(5);\n LinkedListBasic<Integer> linkedListBasic = new LinkedListBasic<>();\n for (int i = 10; i < 50; i+=5){\n linkedListBasic.insertNewNode(i, head);\n }\n\n /*linkedListBasic.printLinkedList(head);\n reverseSubList(head, 2, 6);\n linkedListBasic.printLinkedList(head);*/\n\n linkedListBasic.printLinkedList(head);\n ListNode<Integer> newHead = reverseLinkedList2(head);\n linkedListBasic.printLinkedList(newHead);\n reverseSubList(newHead, 2, 6);\n linkedListBasic.printLinkedList(newHead);\n\n }", "public void reverseLinkedlistRecursive(){\n\t\tif (this.head == null) return;\n\t\tNode newEnd = reverseLinkedlisthelper(this.head);\n\t\tnewEnd.next = null;\n\t}", "static void reverse(Linkedlists list){\r\n\t\tNode current=list.head;\r\n\r\n\t\tNode nextNode=null;\r\n\t\tNode previous=null;\r\n\t\twhile(current != null){\r\n\t\t\tnextNode=current.next;\r\n\t\t\t//System.out.println(\"current.next:\"+current.data);\r\n\t\t\tcurrent.next=previous;\r\n\t\t\tprevious=current;\r\n\t\t\tcurrent=nextNode;\r\n\r\n\t\t}\r\n\t\t//current.next=previous;\r\n\t\tlist.head=previous;\r\n\r\n\t}", "public ListNode reverse(ListNode prev, ListNode start, ListNode end) {\n\t\tListNode current = start.next;\n\t\tListNode preCurrent = start;\n\t\twhile(current != end){\n\t\t\tListNode temp = current.next;\n\t\t\tcurrent.next = preCurrent;\n\t\t\tpreCurrent = current;\n\t\t\tcurrent = temp;\n\t\t}\n\t\tstart.next = end.next;\n\t\tend.next = preCurrent;\n\t\tprev.next = end;\n\t\treturn start;\n\t}", "Node Reverse(Node head) {\n Node p = null;\n Node q = head;\n Node r = null;\n while(q!=null) {\n r = q.next;\n q.next = p;\n p = q;\n q = r;\n }\n head = p;\n return head;\n}", "private Node reverseLinkedlisthelper(Node current){\n\t\tif (current.next == null){\n\t\t\tthis.head = current; // new head end of list\n\t\t\treturn current;\n\t\t}\n\t\tNode ptr_ahead = reverseLinkedlisthelper(current.next); // get to end of list\n\t\tptr_ahead.next = current;\n\t\treturn current;\n\n\n\t\t// TAIL RECURSION similar to for loop and iterative method i did above!! nothing is done coming back from recursive stack!\n\t}", "public void reverseLinkedList(){\n\t\tNode prev = null;\n\t\tNode current = head;\n\t\twhile (current != null){\n\t\t\tNode temp = current.next;\n\t\t\tcurrent.next = prev;\n\t\t\t// move pointers be careful must move previous to current first\n\t\t\tprev = current;\n\t\t\tcurrent = temp;\n\t\t\t\n\n\t\t}\n\t\tthis.head = prev;\n\t}", "private static Node reverseLinkedList(Node head) {\n\t\t \n\t\tNode prev = null;\n\t\tNode next = null;\n\t\t\n\t\t// check boundary condition\n\t\tif(head ==null)\n\t\t\t\n\t\t\t\n\t\t\treturn head;\n\t\t\n\t\tnext = head.rightSibling;\n\t\twhile(next!=null) {\n\t\t\t// point current node backwards\n\t\t\thead.rightSibling = prev;\n\t\t\t\n\t\t\t// move all three pointers ahead\n\t\t\tprev = head;\n\t\t\thead = next;\n\t\t\tnext = next.rightSibling;\n\t\t}\n\t\t\n\t\t// Point last node backwards\n\t\thead.rightSibling = prev;\n\t\treturn head;\n\t}", "private ListNode reverseList(ListNode head) {\n if (head == null || head.next == null) {\n return head;\n }\n\n ListNode now = head;\n ListNode next = now.next;\n ListNode prev = null;\n\n while (next != null) {\n now.next = prev;\n\n // move to next node\n prev = now;\n now = next;\n next = next.next;\n }\n now.next = prev;\n return now;\n }", "private static void iterateLinkedListInReverseOrder() {\n\t\tLinkedList<Integer> list = new LinkedList<Integer>();\n\t\tlist.add(10);\n\t\tlist.add(20);\n\t\tlist.add(30);\n\t\tlist.add(40);\n\t\tlist.add(50);\n\t\tSystem.out.println(\"LinkedList is : \" + list);\n\t\tCollections.reverse(list);\n\t\tSystem.out.println(\"Reverse the LinkedList is : \" + list);\n\t}", "public void reverseList(List<Integer> list) {\n for (int i = list.size() - 1; i >= 0; i--) {\n System.out.println(list.get(i));\n }\n }", "public NodeRandom reverse(NodeRandom start)\n\t{\n\t\tNodeRandom curr=start;\n\t\t\n\t\tNodeRandom temp;\n\t\tNodeRandom prev2=null;\n\t\twhile(curr!=null)\n\t\t{\t\t\t\n\t\t\ttemp=curr.next;\t\t\t\n\t\t\tcurr.next=prev2;\n\t\t\tprev2=curr;\n\t\t\tcurr=temp;\n\t\t}\t\t\n\t\tNodeRandom newstart=prev2;\t\t\t\t\n\t\tSystem.out.println(\"reverse a list\");\n\t\tdisplay(newstart);\n\t\treturn newstart;\n\t}", "public static SinglyLinkedList reverse(SinglyLinkedList list) {\r\n\t\tNode prev=null;\r\n\t\tNode current=list.getFirst();\r\n\t\tNode next=null;\r\n\t\t\r\n\t\twhile (current != null) {\r\n\t\t\tSystem.out.println(\"current: \" + current.getData());\r\n\t\t\tnext=current.next();\r\n\t\t\tcurrent.setNext(prev);\r\n\t\t\tprev=current;\r\n\t\t\tcurrent=next;\r\n\t\t}\r\n\t\tlist.setHead(prev); //have to reset head\r\n\t\treturn list;\r\n\t}", "public static ListNode reverseList(ListNode head) {\n ListNode h = head;\n ListNode n = h;\n ListNode p = null;\n ListNode rev = new ListNode(0);\n ListNode cur = rev;\n \n while (n != null) {\n p = n;\n n = n.next;\n if (n == null) {\n cur.next = new ListNode(p.val);\n head = rev.next;\n } else if (n.next == null) {\n cur.next = new ListNode(n.val);\n cur = cur.next;\n p.next = null;\n n = h;\n }\n }\n return head; \n }", "LinkedListDemo reverse() {\n\t\tListNode rev = null; // rev will be the reversed list.\n\t\tListNode current = getHead(); // For running through the nodes of list.\n\t\twhile (current != null) {\n\t\t\t// construct a new node\n\t\t\tListNode newNode = new ListNode();\n\t\t\t// copy the data to new node from runner\n\t\t\tnewNode.data = current.data;\n\t\t\t// \"Push\" the next node of list onto the front of rev.\n\t\t\tnewNode.next = rev;\n\t\t\trev = newNode;\n\t\t\t// Move on to the next node in the list.\n\t\t\tcurrent = current.next;\n\t\t}\n\t\treturn new LinkedListDemo(rev);\n\t}", "void reverse()\n\t{\n\t\tint a;\n\t\tif(isEmpty())\n\t\t\treturn;\n\t\telse\n\t\t{\t\n\t\t\ta = dequeue();\n\t\t\treverse(); \n\t\t\tenqueue(a);\n\t\t}\n\t}", "public ListNode reverseList(ListNode l) {\n ListNode prev = null;\n ListNode cur = l;\n ListNode next = null;\n while (cur != null) {\n next = cur.next;\n cur.next = prev;\n prev = cur;\n cur = next;\n }\n \n return prev;\n }", "public void reverse() {\n\t\tNode<E> temp = null;\n\t\tNode<E> n = root;\n\n\t\twhile (n != null) {\n\t\t\ttemp = n.getBefore();\n\t\t\tn.setBefore(n.getNext());\n\t\t\tn.setNext(temp);\n\t\t\tn = n.getBefore();\n\t\t}\n\n\t\ttemp = root;\n\t\troot = tail;\n\t\ttail = temp;\n\t}", "private ListNode reverseList(ListNode head) {\r\n\t\tif (head == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tListNode previous = null;\r\n\t\tListNode current = head;\r\n\t\twhile (current != null) {\r\n\t\t\tListNode next = current.next;\r\n\t\t\tcurrent.next = previous;\r\n\t\t\tprevious = current;\r\n\t\t\tcurrent = next;\r\n\t\t}\r\n\t\thead = previous;\r\n\t\treturn head;\r\n\t}", "public void reverse(){\n\n\n SNode reverse =null;\n\n while(head != null) {\n\n SNode next= head.next;\n head.next=reverse;\n reverse = head;\n\n head=next;\n\n\n }\n head=reverse; // set head to reverse node. it mean next node was null and head should be previous node.\n\n\n }", "private void reverseAfter(int i) {\n int start = i + 1;\n int end = n - 1;\n while (start < end) {\n swap(index, start, end);\n start++;\n end--;\n }\n }", "public ListNode reverseList(ListNode head) {\n return recursionVersion2_3rdTime(head);\n }", "public ListNode reverseList(ListNode head) {\n\n ListNode prev = null;\n ListNode curr = head;\n while( curr!=null){\n ListNode next = curr.next;\n curr.next= prev;\n prev = curr;\n curr = next;\n }\n return prev;\n }", "public static LinkedList<Integer> Reverse(LinkedList<Integer> list) {\n\t\tLinkedList<Integer> listReverse = new LinkedList<Integer>();\n\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\tint value = list.get(i);\n\t\t\tlistReverse.addFirst(value);\n\t\t}\n\t\treturn listReverse;\n\t}", "@Override\n\tpublic IDnaStrand reverse() {\n\t\tLinkStrand reversed = new LinkStrand();\n\t\tNode current = new Node(null);\n\t\tcurrent = myFirst;\n\t\t\n\t\twhile (current != null) {\n\t\t\t\n\t\t\tStringBuilder copy = new StringBuilder(current.info);\n\t\t\tcopy.reverse();\n\t\t\tNode first = new Node(copy.toString());\n\t\t\t\n\t\t\tfirst.next = reversed.myFirst;\n\t\t\tif (reversed.myLast == null) {\n\t\t\t\treversed.myLast = reversed.myFirst;\n\t\t\t\treversed.myLast.next = null;\n\t\t\t\t\n\t\t\t}\n\t\t\treversed.myFirst = first;\n\t\t\treversed.mySize += copy.length();\n\t\t\treversed.myAppends ++;\n\t\t\t\n\t\t\t\n\t\t\tcurrent = current.next;\n\t\t\t\n\t\t}\n\t\treturn reversed;\n\t}", "void reverse();", "void reverse();", "public MyLinkedList reverse() {\r\n\t\tif (this.isEmpty()) {\r\n\t\t\tSystem.out.println(\"the empty linked list leads to a failure of reversion\");\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\tStack<Node> stack = new Stack<Node>();\r\n\t\tpointer = head;\r\n\t\twhile (pointer != null) {\r\n\t\t\tstack.push(pointer);\r\n\t\t\tpointer = pointer.getNext();\r\n\t\t}\r\n\t\tMyLinkedList temp = new MyLinkedList();\r\n\t\twhile (stack.size() > 0) {\r\n\t\t\tNode node = stack.pop();\r\n\t\t\t//Original mappings have to be reset \r\n\t\t\tnode.setNext(null);\r\n\t\t\ttemp.add(node);\r\n\t\t}\r\n\t\treturn temp;\r\n\t}", "public ListNode reverseListIter(ListNode head) {\n\t\tif (head == null || head.next == null) {\n\t\t\treturn head;\n\t\t}\n\n\t\tListNode start = head;\n\t\tListNode mid = head.next;\n\t\tListNode end = mid.next;\n\t\thead.next = null;\n\n\t\twhile (end != null) {\n\t\t\tmid.next = head;\n\t\t\thead = mid;\n\t\t\tmid = end;\n\t\t\tend = end.next;\n\t\t}\n\n\t\tmid.next = head;\n\t\treturn mid;\n\t}", "public Node updateList(Node head,int size) {\r\n\t\t Node temp=head;\r\n\t\t Stack<Integer> stack = new Stack<Integer>();\t//Stack for storing the linklist in order to get elements in reverse order\r\n\t\t \r\n\t\t for(int i=0;i<size;i++){\r\n\t\t \tstack.push(temp.data);\t\t//pushing elements in stack\r\n\t\t \ttemp=temp.next;\r\n\t\t }\r\n\t\t temp=head;\r\n\t\t for(int i=0;i<size/2;i++){\t\t//popping elements in reverse order\r\n\t\t \tint val=stack.pop();\r\n\t\t \ttemp.data=temp.data - val;\r\n\t\t \ttemp=temp.next;\r\n\t\t }\r\n\t\t return head;\r\n\t }", "public ListNode reverse(ListNode head){\n\t\t\n\t\tif (head == NULL || head.next == NULL)\n\t\treturn; //empty or just one node in list\n\n\t\tListNode Second = head.next;\n\t\n\t\t//store third node before we change \n\t\tListNode Third = Second.next; \n\n\t\t//Second's next pointer\n\t\tSecond.next = head; //second now points to head\n\t\thead.next = NULL; //change head pointer to NULL\n\n\t\t//only two nodes, which we already reversed\n\t\tif (Third == NULL) return; \n\n\t\tListNode CurrentNode = Third;\n\n\t\tListNode PreviousNode = Second;\n\n\t\twhile (CurrentNode != NULL){\n\t\t\tListNode NextNode = CurrentNode.next;\n\n\t\t\tCurrentNode.next = PreviousNode;\n\n\t\t\t/* repeat the process, but have to reset\n\t \t\tthe PreviousNode and CurrentNode\n\t\t\t*/\n\n\t\t\tPreviousNode = CurrentNode;\n\t\t\tCurrentNode = NextNode; \n\t\t}\n\n\t\t\thead = PreviousNode; //reset the head node\n\t\t}", "Node reversedLinkedList(Node oldList) {\n Node newList = null;\n while (oldList != null) {\n\tNode element = oldList;\n\toldList = oldList.next;\n\telement.next = newList;\n\tnewList = element;\n }\n return newList;\n}", "public static void reversList(Linkedlist list)\r\n\t {\r\n\t\t Node prev = null;\r\n\t\t Node current = list.head;\r\n\t\t Node next = null;\r\n\t\t \r\n\t\t while(current!=null)\r\n\t\t {\r\n\t\t\t next = current.next;\r\n\t\t\t current.next = prev;\r\n\t\t\t prev = current;\r\n\t\t\t current = next;\r\n\t\t\t \r\n\t\t\t \r\n\t\t }\r\n\t\t \r\n\t\t list.head = prev;\r\n\t\t \r\n\t }", "public ListNode reverseList(ListNode head) {\n ListNode first = head;\n ListNode reverse = null;\n while (first != null) {\n ListNode temp = first.next;\n first.next = reverse;\n reverse = first;\n first = temp;\n }\n return reverse;\n }", "public abstract void reverseRange(int index, int count, int stride);", "public void reverseHelperList(DoubleLinkedList _list) {\n\t\tDLNode n = tail;\n\t\tDLNode k = new DLNode(_list);\n\t\tn.next = k;\n\t\tk.prev = n;\n\t\ttail = k;\n\n\t}", "public List<E> reverseList(List<E> toReverse) {\n\t\tfor (int i = 0; i < toReverse.size() / 2; i++) {\n\t\t\tE temp = toReverse.get(i);\n\t\t\ttoReverse.set(i, toReverse.get(toReverse.size() - 1 - i));\n\t\t\ttoReverse.set(toReverse.size() - 1 - i, temp);\n\t\t}\n\t\treturn toReverse;\n\t}", "public static void reverse(java.util.List arg0)\n { return; }", "private static void printList() {\n\tNode n=head;\n\tint size=0;\n\twhile(n!=null)\n\t{\n\t\tSystem.out.print(n.data+\" \");\n\t\tn=n.next;\n\t\tsize++;\n\t}\n\tn=head;\n\tfor(int i=0;i<size-1;i++)\n\t\tn=n.next;\n\tSystem.out.println(\"\\nreverse direction\");\n\twhile(n!=null)\n\t{\n\t\t\n\t\tSystem.out.print(n.data+\" \");\n\t\tn=n.prev;\n\t}\n\t\n}", "Node reverse(Node head) {\n\n\t\t// Write your code here\n\t\tNode curr = head;\n\t\tNode prev = null;\n\t\twhile (curr != null) {\n\t\t\twhile (curr != null && curr.data % 2 != 0) {\n\t\t\t\tprev = curr;\n\t\t\t\tcurr = curr.next;\n\t\t\t}\n\t\t\tif (curr != null && curr.data % 2 == 0) {\n\t\t\t\tif (prev != null) {\n\t\t\t\t\tprev.next = reverseHelper(curr);\n\t\t\t\t} else {\n\t\t\t\t\thead = reverseHelper(curr);\n\t\t\t\t}\n\t\t\t\tcurr = curr.next;\n\t\t\t}\n\t\t}\n\t\treturn head;\n\t}", "public static LinkedList<String> revLinkedList(LinkedList<String> lst) {\r\n\t\tStack<String> stk = new Stack<String>();\r\n\t\tLinkedList<String> ret = new LinkedList<String>();\r\n\t\tfor (String item : lst) {\r\n\t\t\tstk.push(item);\r\n\t\t}\r\n\t\twhile (!stk.isEmpty()) {\r\n\t\t\tret.add(stk.pop());\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "public ListNode reverseList(ListNode head) {\n if (head == null) {\n return null;\n }\n ListNode newHead = new ListNode(1);\n ListNode p = head;\n ListNode q = null;\n while(p != null) {\n q = p.next;\n p.next = newHead.next;\n newHead.next = p;\n p = q;\n }\n\n return newHead.next;\n }", "public static ListNode iterativeReverseNode(ListNode node) {\n\t\tif (node.getNext() == null) {\n\t\t\treturn node;\n\t\t}\n\t\tListNode previous = new ListNode(node);\n\t\tListNode middle = new ListNode(previous.getNext());\n\t\tListNode next = new ListNode(middle.getNext());\n\t\tprevious.setNext(null);\n\n\t\twhile (next != null) {\n\t\t\tmiddle.setNext(previous);\n\t\t\tprevious = middle;\n\t\t\tmiddle = next;\n\t\t\tnext = middle.getNext();\n\t\t}\n\t\tmiddle.setNext(previous);\n\t\treturn middle;\n\t}", "public void recursiveReverse (Node currentNode)\n{\nif (currentNode==NULL)\nreturn;\n\n/*if we are at the tail node:\n recursive base case:\n*/\nif(currentNode.next==NULL)\n{\n//set HEAD to the current tail since we are reversing list\nhead=currentNode;\nreturn; //since this is the base case\n}\n\nrecursiveReverse(currentNode.next);\ncurrentNode.next.next=currentNode;\ncurrentNode.next=null; //set \"old\" next pointer to NULL\n}", "public ListNode rotateRight(ListNode head, int n) {\n \n if (head == null || head.next == null)\n return head;\n int i = 0;\n ListNode tail = head;\n ListNode dummy = new ListNode(0);\n dummy.next = head;\n ListNode pre = dummy;\n \n // get the length of the list\n int len = 0;\n while (head != null){\n head = head.next;\n len ++;\n if (head != null)\n tail = head;\n }\n head = dummy.next;\n if (n%len == 0)\n\t\t return dummy.next;\n\t n = len - n%len;\n\t ListNode cur = dummy.next;\n while (i < n){\n pre = cur;\n cur = cur.next;\n i++;\n }\n dummy.next = cur;\n tail.next = head;\n pre.next = null;\n return dummy.next;\n }", "public static ListNode recursiveReverseNode(ListNode node) {\n\t\tif (node == null) {\n\t\t\treturn node;\n\t\t} else if (node.getNext() == null) {\n\t\t\treturn node;\n\t\t} else {\n\t\t\tListNode rest = node.getNext();\n\t\t\tListNode reversedRest = recursiveReverseNode(rest);\n\t\t\tListNode pointer = reversedRest;\n\t\t\twhile (pointer.getNext() != null) {\n\t\t\t\tpointer = pointer.getNext();\t\n\t\t\t}\n\t\t\tnode.setNext(null);\n\t\t\tpointer.setNext(node);\n\t\t\treturn reversedRest;\n\t\t}\n\t}", "private static LinkedList<? extends Object> reverseLinkedList(LinkedList<? extends Object> linkedList) {\n\t\tLinkedList<Object> reversedLinkedList = new LinkedList<>();\n\t\tfor (int i = linkedList.size() - 1; i >= 0; i--) {\n\t\t\treversedLinkedList.add(linkedList.get(i));\n\t\t}\n\t\treturn reversedLinkedList;\n\t}", "Node reverseIterative(Node head) {\n\t\tNode prev = null;\n\t\tNode current = head;\n\t\tNode next = null;\n\t\twhile (current != null) {\n\t\t\tnext = current.next;\n\t\t\tcurrent.next = prev;\n\t\t\tprev = current;\n\t\t\tcurrent = next;\n\t\t}\n\t\thead = prev;\n\t\treturn head;\n\t}", "public static LinkedList recursiveReverseList(LinkedList list) {\n\t\tif (list.getHead() == null) {\n\t\t\treturn list;\n\t\t} else if (list.getHead().getNext() == null) {\n\t\t\treturn list;\n\t\t} else {\n\t\t\tListNode currentHead = list.getHead();\n\t\t\tListNode newHead = list.getHead().getNext();\n\t\t\tLinkedList rest = new LinkedList();\n\t\t\trest.setHead(newHead);\n\t\t\tLinkedList reversedRest = recursiveReverseList(rest);\n\t\t\treversedRest.add(currentHead.getData());\n\t\t\treturn reversedRest;\n\t\t}\n\t}", "public void isPalindromeListReverseListMethod() {\n\n\t\tNode slow = head, fast = head;\n\t\tNode middleHalf = null, prev = null;\n\n\t\tif(head == null) {\n\t\t\tSystem.out.println(\"\\n List is empty\");\n\t\t}\n\t\telse if(head != null && head.next == null) {\n\t\t\tSystem.out.println(\"\\n List is Palindrome\");\n\t\t}\n\t\telse{\n\t\t\twhile(fast != null && fast.next != null) {\n\t\t\t\tfast = fast.next.next;\n\t\t\t\tprev = slow;\n\t\t\t\tslow = slow.next;\n\t\t\t}\n\n\t\t\t// odd number of element in list\n\t\t\tif(fast != null) {\n\t\t\t\tmiddleHalf = slow;\n\t\t\t\tslow = slow.next;\n\t\t\t}\n\n\t\t\tsecondHalf = slow;\n\t\t\tfirstHalf = head;\n\t\t\tprev.next = null;\n\t\t\t\n\t\t\treverse();\n\t\t\tlistCompare();\n\t\t\treverse();\n\n\t\t\tif(middleHalf != null) {\n\t\t\t\tprev.next = middleHalf;\n\t\t\t\tmiddleHalf.next = secondHalf;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tprev.next = secondHalf;\n\t\t\t}\n\t\t}\n\t}", "public void reverse() {\n\t\tif(isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\tNodo <T> pri_n= fin;\n\t\t\n\t\tint cont= tamanio-1;\n\t\tNodo<T> nodo_act= pri_n;\n\t\twhile(cont >0) {\n\t\t\tNodo <T> aux= getNode(cont-1);\n\t\t\tnodo_act.setSiguiente(aux);\n\t\t\tnodo_act= aux;\n\t\t\tcont--;\n\t\t}\n\t\tinicio = pri_n;\n\t\tfin= nodo_act;\n\t\tfin.setSiguiente(null);\n\t}", "public static void main(String[] args) {\n List<Node<Integer>> lst = new ArrayList<Node<Integer>>();\n for (int i = 0; i < 10; i++) {\n Node<Integer> n1 = new Node<Integer>(i);\n lst.add(n1);\n }\n for (int i = 0; i < lst.size() - 1; i++) {\n lst.get(i).next = lst.get(i + 1);\n }\n Node<Integer> start = lst.get(0);\n\n LinkListLearn l = new LinkListLearn();\n\n l.printLinkList(start);\n\n start = l.reverseRecursively(start);\n System.out.println();\n l.printLinkList(start);\n }", "public static Node reverse(Node n) {\n if (n == null) return null;\n\n Node next = n.next;\n Node curr = n;\n Node prev = null;\n while (next != null) {\n next = curr.next;\n curr.next = prev;\n prev = curr;\n curr = next;\n }\n return prev;\n }", "public static ListNode reverse(ListNode head) {\n if (head == null || head.next == null)\n return head;\n\n ListNode prev = null, curr = head;\n while (curr != null) {\n ListNode forw = curr.next; // backup\n\n curr.next = prev; // link\n\n prev = curr; // move\n curr = forw;\n }\n\n return prev;\n }", "public ListNode reverse(ListNode head) {\n if(head == null || head.next == null){\n return head;\n }\n ListNode curr = head;\n ListNode newHead = reverse(curr.next);\n curr.next.next = curr;\n curr.next = null;\n return newHead;\n }", "public ListNode reverseList(ListNode head) {\n if(head==null || head.next==null) return head;\n \n ListNode prev=reverseList(head.next);\n head.next.next=head;\n head.next=null;\n \n return prev;\n}", "public Node reverseMe(Node head) {\n Node current = head;\n Node prev = null;\n while (current != null) {\n Node next = current.next;\n current.next = prev;\n prev = current;\n current = next;\n }\n head = prev;\n return head;\n }", "public ListNode reverse(ListNode head) {\n if(head == null || head.next == null){\n return head;\n }\n ListNode prev = head;\n ListNode cur = head.next;\n prev.next = null;\n while(cur.next != null){\n ListNode nextNode = cur.next;\n cur.next = prev;\n prev = cur;\n cur = nextNode;\n }\n cur.next = prev;\n return cur;\n }", "public ListNode removeNthFromEnd(ListNode list, int n)\r\n {\r\n ListNode head = new ListNode();\r\n head.next = list;\r\n ListNode prev = head;\r\n ListNode after = head;\r\n for (int i = 0; i < n; i++)\r\n {\r\n if (after.next == null && i < n)\r\n {\r\n return head.next;\r\n }\r\n after = after.next;\r\n }\r\n while (after.next != null)\r\n {\r\n prev = prev.next;\r\n after = after.next;\r\n }\r\n prev.next = prev.next.next;\r\n return head.next;\r\n }", "public static ListNode reverse(ListNode head, int k) {\n\t\tListNode curr = head;\n\t\tListNode prev = null;\n\t\twhile (true) {\n\t\t\tListNode prevLast = prev; // null for head,1 for 4,5,6\n\t\t\tListNode first = curr;\n\n\t\t\t// reversing\n\t\t\tprev = null;\n\t\t\tfor (int i = 0; i < k && curr != null; i++) {\n\t\t\t\tListNode temp = curr.next;\n\t\t\t\tcurr.next = prev;\n\t\t\t\tprev = curr;\n\t\t\t\tcurr = temp;\n\t\t\t}\n\n\t\t\t// setting prevElement next pointer\n\t\t\tif (prevLast == null) {\n\t\t\t\thead = prev;\n\n\t\t\t} else {\n\t\t\t\tprevLast.next = prev;\n\t\t\t}\n\n\t\t\tif (curr == null)\n\t\t\t\tbreak;\n\n\t\t\tprev = first;\n\n\t\t}\n\n\t\treturn head;\n\n\t}", "public static void reversePrint(SinglyLinkedListNode llist) {\n SinglyLinkedListNode next=null;\n SinglyLinkedListNode current=llist;\n SinglyLinkedListNode previous=null;\n while(current!=null)\n {\n next=current.next;\n current.next=previous;\n previous=current;\n current=next;\n }\n while(previous!=null)\n {\n System.out.println(previous.data);\n previous=previous.next;\n }\n }", "public ListNode rotateRight(ListNode head, int n) {\n if(n==0||head==null)\n return head;\n ListNode fast=head;\n ListNode slow=head;\n ListNode res=new ListNode(0);\n res.next=head;\n \n int count=0;\n for(int i=0;i<n;i++){\n if(fast==null){\n break; \n }else{\n count++;\n fast=fast.next;\n }\n }\n \n if(fast==null)\n return rotateRight(head,n%count);\n \n while(fast.next!=null){\n fast=fast.next;\n slow=slow.next;\n }\n \n ListNode b=slow.next;\n \n res.next=b;\n slow.next=null;\n fast.next=head;\n \n return res.next;\n }", "public ListNode reverseList(ListNode head) {\n ListNode current = head;\n ListNode prev = null;\n \n while(current != null){\n ListNode temp = current.next;\n current.next = prev;\n \n prev = current;\n current = temp;\n }\n return prev;\n }", "final private void decrementMirrorIndexesOfLast(int index, int size) {\n // indexIsCenter - odd number of digits in the last palindrome\n boolean indexIsCenter = (((size % 2) == 1) && ((size/2) == index));\n int digitValue = last.get(index);\n\n int newDigitValue = (digitValue+9) % 10;\n // decrement digit with index\n last.set(index, newDigitValue);\n if (!indexIsCenter) {\n // decrement also digit with mirror index\n last.set(\n LargestPalindromeProduct.mirror.applyAsInt(index, size),\n newDigitValue\n );\n }\n\n // decrement newghbrs\n if ((digitValue == 0) && (index < (size-1))) {\n decrementMirrorIndexesOfLast(index+1, size);\n } else if ((digitValue == 1) && (index == (size-1))) { //no zeros on borders\n // drop the last element from list and set all element values to 9\n last.remove(last.size()-1);\n for (int i = 0; i < last.size(); i++) {\n last.set(i, 9);\n }\n }\n\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic static List reverse(List list)\r\n\t{\r\n\t\tList newList = new ArrayList();\r\n\t\t\r\n\t\tfor(int x = list.size()-1; x>=0; x--)\r\n\t\t{\r\n\t\t\tnewList.add(list.get(x));\r\n\t\t}\r\n\t\t\r\n\t\treturn newList;\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n ListNode l0 = new ListNode(1);\n ListNode l1 = new ListNode(2);\n ListNode l2 = new ListNode(3);\n ListNode l3 = new ListNode(4);\n l0.next = l1;\n l1.next = l2;\n l2.next = l3;\n\n System.out.println(l0);\n reverseList(l0);\n System.out.println(l3);\n }", "public ListNode rotateRight(ListNode head, int n) {\n \n int len = 0;\n \n if (head == null) return head;\n \n ListNode node = head;\n ListNode prev = head;\n \n while (node != null) {\n prev = node;\n node = node.next;\n len++;\n }\n \n n = n % len;\n \n if (n == 0) return head;\n \n int current = 1;\n \n prev.next = head;\n \n node = head;\n \n while (current < len - n) {\n node = node.next;\n current++;\n }\n \n prev = node.next;\n node.next = null;\n \n return prev;\n }", "public ListNode reverse(ListNode head){\n if(head == null || head.next == null) return head;\n\n ListNode curr = head, prev = null;\n\n while(curr != null){\n ListNode temp = curr.next;\n curr.next = prev;\n prev = curr;\n curr = temp;\n }\n\n return prev;\n }", "@Test\n public void testReverse() {\n System.out.println(\"reverse\");\n al.add(1);\n al.add(2);\n al.add(3);\n ArrayList<Integer> rl = new ArrayList<>();\n rl.add(3);\n rl.add(2);\n rl.add(1);\n al.reverse();\n assertEquals(rl.get(0), al.get(0));\n assertEquals(rl.get(1), al.get(1));\n assertEquals(rl.get(2), al.get(2));\n }", "public ListNode rotateRight(ListNode head, int n) {\n if(n == 0 || head == null) {\r\n return head;\r\n } \r\n ListNode curr = head;\r\n int length = 0;\r\n while(curr!=null) {\r\n length++;\r\n curr = curr.next;\r\n }\r\n n = n % length;\r\n //skip the zero\r\n if(n == 0) {\r\n return head;\r\n }\r\n //do the rotating\r\n ListNode newHead = new ListNode(-1);\r\n newHead.next = head;\r\n \r\n int step = length - n;\r\n curr = newHead;\r\n for(int i = 0; i < step; i++) {\r\n curr = curr.next;\r\n }\r\n \r\n //be aware need to break the loop\r\n ListNode tmp = curr.next;\r\n curr.next = null;\r\n curr = tmp;\r\n \r\n newHead.next = curr;\r\n while(curr.next != null) {\r\n curr = curr.next;\r\n }\r\n curr.next = head;\r\n \r\n return newHead.next;\r\n }", "static Node Reverse(Node node) {\n // If empty list, return\n if (node == null) return null;\n if (node.next == null) return null;\n\n Node newNode = Reverse(node.next);\n node.next.next = node;\n node.prev = node.next;\n node.next = null;\n\n return newNode;\n }", "public ListNode reverse(ListNode head) {\n if(head == null || head.next == null) {\n return head;\n }\n ListNode prev = null;\n while(head != null) {\n ListNode temp = head.next;\n head.next = prev;\n prev = head;\n head = temp;\n }\n //head.next = null;\n return prev;\n }", "public static ListNode reverseListRecursively(ListNode head) {\n if(head == null || head.next == null)\n return head;\n\n /* Call the same method recursively. So, 1 being the current head gets\n called first, then 2, finally, when the head is 5, and since its next == null,\n 5 gets returned as the head */\n ListNode next = reverseListRecursively(head.next);\n\n /* When the recursive call gets returned to caller method call,\n we can reverse the linked list by assigning the head.next.next,\n which is 4.5.null to the head itself. Therefore, the next node will\n become 5 -> 4 -> 5 -> 4 -> 5 -> 4 in a chain*/\n head.next.next = head;\n\n /* To stop the chaining and to cut it off, assign the head.next to null\n Thus, the next node will now have 5 -> 4 -> null*/\n head.next = null;\n\n // Return the next node that will be reversed now\n return next;\n }", "public static void reverse(long[] p, int from, int to) {\n\t\tlong tmp;\n\t\tint l = to-1;\n\t\tint k = from;\n\t\tfor (; k<l; k++, l--) {\n\t\t\ttmp = p[k];\n\t\t\tp[k] = p[l];\n\t\t\tp[l] = tmp;\n\t\t}\n\t}", "public void reverse() {\n ArrayList<Character> newSeq = new ArrayList<Character>();\n for (int i = 0; i < seq.size(); i++) {\n newSeq.add(seq.get(seq.size() - 1 - i));\n }\n seq = newSeq;\n }", "public Node<T> reverse() {\n Node<T> reverse = null;\n if (First == null) {\n return reverse;\n }\n Node<T> firstNode = First;\n Node<T> secondNode = First.next;\n\n while (firstNode != null) {\n //basic operation\n firstNode.next = reverse;\n reverse = firstNode;\n\n if (secondNode == null) {\n //this is the last node needs to be moved\n firstNode = secondNode;\n } else {\n firstNode = secondNode;\n secondNode = secondNode.next;\n }\n }\n return reverse;\n }", "public static void main(String[] args) {\n\n\n Node head = MyList.getList();\n MyList.printList(head);\n\n System.out.println(\"After Reverse\");\n head = reverseAlternateKNodes(head, 3);\n System.out.println(\"Reversed\");\n MyList.printList(head);\n\n }", "public ListNode reverseListRecv(ListNode head) {\n\t\tif (head == null || head.next == null) {\n\t\t\treturn head;\n\t\t}\n\t\t \n\t\tListNode parent = reverseListRecv(head.next);\n\t\thead.next.next = head;\n\t\thead.next = null;\n\t\treturn parent;\n\t}", "public ListNode reverseList(ListNode head) {\n if (head == null) return null;\n ListNode prev = null;\n ListNode cur = head;\n while (cur != null) {\n ListNode temp = cur.next;\n cur.next = prev;\n prev = cur;\n cur = temp;\n }\n return prev;\n }" ]
[ "0.7135603", "0.6922328", "0.6893776", "0.675141", "0.6727945", "0.66966945", "0.66876894", "0.66421074", "0.66065145", "0.6591924", "0.6571743", "0.6550504", "0.6485142", "0.6420912", "0.63972664", "0.6396012", "0.6386947", "0.63686526", "0.6330585", "0.6299242", "0.62991285", "0.6294844", "0.6292779", "0.62744105", "0.6243425", "0.6237125", "0.62366885", "0.6232521", "0.6224507", "0.6220449", "0.6205195", "0.61903596", "0.6186303", "0.61829937", "0.6181408", "0.61813325", "0.6173573", "0.616867", "0.6164835", "0.6157293", "0.6152931", "0.6133813", "0.61056066", "0.610244", "0.6102051", "0.61002195", "0.6081815", "0.6081815", "0.6053026", "0.60513186", "0.6048515", "0.60445076", "0.60443604", "0.60342264", "0.602342", "0.6017897", "0.6017325", "0.6014912", "0.6005916", "0.6002678", "0.60000885", "0.599661", "0.5996167", "0.59838057", "0.5960088", "0.59571487", "0.5940495", "0.5932031", "0.5931804", "0.593055", "0.5917694", "0.5899747", "0.5886169", "0.5885664", "0.5880053", "0.5877075", "0.5875397", "0.58748233", "0.5871136", "0.5859758", "0.5795519", "0.5783068", "0.5782526", "0.57775575", "0.5768837", "0.5759448", "0.5757224", "0.5749535", "0.5743751", "0.5739389", "0.5739063", "0.57167006", "0.5692032", "0.568757", "0.56862384", "0.568539", "0.56832093", "0.56787723", "0.5678097", "0.5674971" ]
0.68324697
3
Reverse every Kelement Sublist (medium) / Reverse Nodes in kGroup: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
public ListNode reverseKGroup(ListNode head, int k) { if (head == null) return head; int count = 0; ListNode curr = head, prev = null, next = null; // Find the k+1 node while (count != k && curr != null) { curr = curr.next; count++; } if (count != k) return head; // reverse list with k+1 node as head prev = reverseKGroup(curr, k); // LL Reversal Alg: reverse current k-group from head ptr while (count-- > 0) { next = head.next; head.next = prev; prev = head; head = next; } return prev; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static ListNode reverseKGroup(ListNode head, int k) {\n\t\tListNode runner = head;\n\t\tint counter = 0;\n\t\twhile(runner != null){\n\t\t\trunner = runner.next;\n\t\t\tcounter++;\n\t\t}\n\t\tif(counter < k){return head;}\n\t\t\n\t\t// reverse first k nodes\n\t\tListNode dummy = new ListNode(0);\n\t\tdummy.next = head;\n\t\t\n\t\tListNode oriHead = head;\n\t\tListNode prev = null;\n\t\t\n\t\tfor(int i=0; i<k; i++){\n\t\t\tListNode temp = head.next;\n\t\t\thead.next = prev;\n\t\t\tprev = head;\n\t\t\thead = temp;\n\t\t}\n\t\t\n\t\t// append rest nodes by recur\n\t\tdummy.next = prev;\n\t\toriHead.next = reverseKGroup(head, k);\n\t\t\n\t\treturn dummy.next;\n\t\n\t}", "public ListNode reverseKGroup(ListNode head, int k) {\n int len = getLength(head);\n ListNode dummy = new ListNode(-1);\n dummy.next = head;\n ListNode prepare = dummy;\n\n for (int i = 0; i <= len - k; i = i + k) {\n prepare = reverse(prepare, k);\n }\n return dummy.next;\n }", "public ListNode reverseKGroup(ListNode head, int k) {\n if(head == null || head.next == null || k < 2)\n return head;\n \n ListNode dummy = new ListNode(0);\n ListNode curr = dummy;\n ListNode tail = head;\n int count = 0;\n while(head != null) {\n count++;\n if(count == k) {\n // Reverse nodes \n // Store location of head next\n // Store location of rear, this will be used to know where to continue next\n ListNode temp = head.next;\n ListNode last = tail;\n \n // Move pointers around to reverse the nodes\n ListNode next = tail;\n while(next != temp) {\n ListNode prev = tail;\n tail = next == tail ? tail.next : next;\n next = tail.next;\n tail.next = prev;\n }\n curr.next = head;\n curr = last;\n head = temp;\n tail = temp;\n count = 0;\n }\n else {\n head = head.next;\n }\n }\n curr.next = tail;\n return dummy.next;\n }", "public MyListNode reverseKGroup(MyListNode head, int k) {\n if (k == 1)\n return head;\n MyListNode H = new MyListNode(0);\n H.next = head;\n MyListNode q = H;\n for (MyListNode p = head; p != null; p = p.next) {\n p = reverseK(q, k);\n if (p == null)\n break;\n q = p;\n }\n return H.next;\n }", "public ListNode reverseKGroup(ListNode head, int k) {\n if(head==null || head.next==null || k==0)\n return head;\n ListNode left = head;\n ListNode right = head;\n int count = 1;\n while(count<=k && right!=null){\n right = right.next;\n count++;\n }\n if(count-1!=k && right==null)\n return left;\n ListNode pre = null;\n ListNode cur = left;\n while(cur!=right){\n ListNode next = cur.next;\n cur.next = pre;\n pre = cur;\n cur = next;\n }\n left.next = reverseKGroup(cur, k);\n return pre;\n }", "ListNode kAltReverse(ListNode head, int k) {\r\n\t\tListNode curr = head, next = null, prev = null;\r\n\t\tint count = 0;\r\n\t\t/*1) LL Revese Alg: reverse first k nodes of the linked list */\r\n\t\twhile (curr != null && count < k) {\r\n\t\t\tnext = curr.next;\r\n\t\t\tcurr.next = prev;\r\n\t\t\tprev = curr;\r\n\t\t\tcurr = next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\t/* 2) Now head points to the kth node. So change next of head to (k+1)th node*/\r\n\t\tif (head != null) {\r\n\t\t\thead.next = curr;\r\n\t\t}\r\n\t\t/* 3) We do not want to reverse next k nodes. So move the curr pointer to skip next k nodes */\r\n\t\tcount = 0;\r\n\t\twhile (count < k - 1 && curr != null) {\r\n\t\t\tcurr = curr.next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\t/* 4) Recursively call for the list starting from curr->next. \r\n\t\tAnd make rest of the list as next of first node */\r\n\t\tif (curr != null) {\r\n\t\t\tcurr.next = kAltReverse(curr.next, k);\r\n\t\t}\r\n\t\t/* 5) prev is new head of the input list */\r\n\t\treturn prev;\r\n\t}", "public static ListNode reverse(ListNode head, int k) {\n\t\tListNode curr = head;\n\t\tListNode prev = null;\n\t\twhile (true) {\n\t\t\tListNode prevLast = prev; // null for head,1 for 4,5,6\n\t\t\tListNode first = curr;\n\n\t\t\t// reversing\n\t\t\tprev = null;\n\t\t\tfor (int i = 0; i < k && curr != null; i++) {\n\t\t\t\tListNode temp = curr.next;\n\t\t\t\tcurr.next = prev;\n\t\t\t\tprev = curr;\n\t\t\t\tcurr = temp;\n\t\t\t}\n\n\t\t\t// setting prevElement next pointer\n\t\t\tif (prevLast == null) {\n\t\t\t\thead = prev;\n\n\t\t\t} else {\n\t\t\t\tprevLast.next = prev;\n\t\t\t}\n\n\t\t\tif (curr == null)\n\t\t\t\tbreak;\n\n\t\t\tprev = first;\n\n\t\t}\n\n\t\treturn head;\n\n\t}", "public Node reverse(Node headNode, int k) {\n\n Node currNode = headNode;\n Node next = null;\n Node prev = null;\n\n int count = 0;\n\n /* reverse first k nodes of the linked list */\n while (currNode != null && count < k) {\n next = currNode.getNextNode();\n currNode.setNextNode(prev);\n prev = currNode;\n currNode = next;\n count++;\n }\n if (next != null) {\n headNode.setNextNode(reverse(next, k));\n }\n\n return prev;\n }", "private ListNode kthNodeInReverseOrder(ListNode head, int k) {\n if (k == 0 || head == null) {\n return head;\n }\n\n ListNode node = head;\n for (int i = 1; i <= k-1; i++) {\n if (node.next != null) {\n node = node.next;\n } else {\n return null;\n }\n }\n\n ListNode kthNodeInReverse = head;\n\n while (node.next != null) {\n kthNodeInReverse = kthNodeInReverse.next;\n node = node.next;\n }\n\n return kthNodeInReverse;\n }", "public static Nodelink rotate(Nodelink node, int k){ 1 2 3 4 5\n //\n\n Nodelink head = node;\n Nodelink temp = null;\n Nodelink temp2 = null;\n\n for(int i = 0; i < k; i++){\n while(node != null){\n\n temp = node;\n temp2 = node.next;\n\n node.next = temp;\n\n\n node = node.next;\n\n }\n\n head = node;\n }\n\n\n return head;\n }", "public static ListNode swapNodes2(ListNode head, int k) {\n ListNode KthFromStart = head, out = head, KthFromLast = head;\n for (int i = 1; i < k; i++) {\n KthFromStart = KthFromStart.next;\n }\n ListNode temp_Node = KthFromStart;\n while (temp_Node.next != null) {\n temp_Node = temp_Node.next;\n KthFromLast = KthFromLast.next;\n }\n int temp = KthFromLast.val;\n KthFromLast.val = KthFromStart.val;\n KthFromStart.val = temp;\n return out;\n }", "public static void removeKthToLast(Node head, int k) {\n if (head == null) return;\n if (k <= 0) return;\n\n Node first = head;\n Node second = head;\n int i = 0;\n while (i < k) {\n if (first == null) return;\n first = first.next;\n i++;\n }\n\n while (first != null) {\n first = first.next;\n second = second.next;\n }\n Node next = second.next;\n if (next == null) {\n second.next = null;\n } else {\n second.data = next.data;\n second.next = next.next;\n }\n }", "private static SLLNode removeKthLast(SLLNode node, int k) {\n\n if (node == null) {\n throw new IllegalArgumentException(\"Node is empty\");\n }\n\n SLLNode first = node;\n while (k + 1 > 0) {\n first = first.next;\n k = k - 1;\n }\n\n SLLNode second = node;\n while (first != null) {\n second = second.next;\n first = first.next;\n }\n\n if (second != null && second.next != null) {\n second.next = second.next.next;\n }\n return node;\n }", "public static ListNode swapNodes(ListNode head, int k) {\n if(head == null || head.next == null){\n return head;\n }\n ListNode tail = head;\n int begin = k;\n int len = 0;\n int index = 1;\n Map<Integer,Integer> map = new HashMap<>();\n while(tail != null){\n len++;\n map.put(index++,tail.val);\n tail = tail.next;\n }\n int end = len - k + 1;\n tail = head;\n index = 1;\n while(tail != null){\n if(index == begin){\n tail.val = map.get(end);\n }\n if(index == end){\n tail.val = map.get(begin);\n }\n index++;\n tail = tail.next;\n }\n return head;\n }", "public ListNode rotateRight(ListNode head, int k) {\n \tif (head == null || k == 0 || head.next == null)\n \t\treturn head;\n \tint size = 1;\n \tListNode curr = head,end=head;\n \tListNode newHead = new ListNode(0);\n \twhile (end.next != null){\n \t\tend = end.next;\n \t\tsize++;\n \t}\n \tif (k%size == 0)\n\t return head;\n \tint start = 1;\n \twhile(start < size - k%size){\n \t\tcurr = curr.next;\n \t\tstart++;\n \t}\n \tnewHead.next = curr.next;\n \tcurr.next = null;\n \tend.next = head;\n \treturn newHead.next;\n }", "public void rotateReverse(int[] nums, int k){\n int n = nums.length;\n \n //in case k is greater than the length\n k = k % n;\n \n reverse(nums, 0, n-1);\n reverse(nums, 0, k-1);\n reverse(nums, k, n-1);\n }", "public ListNode rotateRight(ListNode head, int k) {\r\n\t\tint size = listSize(head);\r\n\t\tif (head == null || k <= 0 || k == size) return head;\r\n\t\tif (k > size) k %= size;\r\n\t\tint count = 1;\r\n\t\tListNode curr = head;\r\n\t\tk = size - k;\r\n\t\twhile (count < k && curr != null) {\r\n\t\t\tcurr = curr.next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tListNode nextHead = curr;\r\n\t\twhile (curr.next != null)\r\n\t\t\tcurr = curr.next;\r\n\t\tcurr.next = head;\r\n\t\thead = nextHead.next;\r\n\t\tnextHead.next = null;\r\n\t\treturn head;\r\n\t}", "public int kToTheEnd(int k) {\n\n if(k<1 || k > this.size())\n return 0;\n\n Node p1=head, p2=head;\n\n for(int i=0; i<k; i++) {\n p2=p2.next;\n }\n\n while(null!=p2.next) {\n p1=p1.next;\n p2=p2.next;\n }\n\n print(\"k to end, k:\" + k + \" data: \" + p1.data);\n return p1.data;\n\n }", "public ListNode SolveUsingAdditionalLinkedList(ListNode head, int k)\n {\n // Edge cases\n if (head == null)\n return null;\n if (k == 0)\n return head;\n\n // Create blank list to store new result\n ListNode result = new ListNode(-1, null);\n\n // Find the length of the list\n int listLength = FindLength(head);\n\n // Calculate the actual number of rotations (since k can be greater than list length)\n int numberOfRotations = k >= listLength? k % listLength : k;\n\n // Another edge case - may not need to rotate at all\n if (listLength == 1 || numberOfRotations == 0)\n return head;\n\n // Iterate through list until we get to the numbers that need to be moved to beginning...\n int counter = listLength - numberOfRotations;\n ListNode temp = head;\n while (counter != 0)\n {\n temp = temp.next;\n counter -= 1;\n }\n\n // ... Then add the rotated numbers to list\n while (temp != null)\n {\n AddLast(result, temp.val);\n temp = temp.next;\n }\n\n // Lastly, reset counters and add the remaining numbers to the back\n counter = listLength - numberOfRotations;\n temp = head;\n while (counter != 0)\n {\n AddLast(result, temp.val);\n temp = temp.next;\n counter -= 1;\n }\n\n // Since result is dummy node, return result.next\n return result.next;\n }", "private static int[] reverseFromKtoEnd(int[] digits, int k, int length) {\r\n\t\tint temp[] = Arrays.copyOfRange(digits, k + 1, length);\r\n\t\tint l = temp.length;\r\n\t\tfor (int i = k + 1; i < length; i++) {\r\n\t\t\tdigits[i] = temp[l - 1];\r\n\t\t\tl--;\r\n\t\t}\r\n\t\treturn digits;\r\n\t}", "static int reverseRecursiveTravesal(Node node, int k) {\n\t\tif(node == null)\n\t\t\treturn -1;\n\t\t\n\t\tint indexFromLast = reverseRecursiveTravesal(node.getNext(), k) + 1;\n\t\tif(indexFromLast == k) \n\t\t\tSystem.out.println(node.getData());\n\t\t\n\t\treturn indexFromLast;\n\t\t\n\t}", "public void rotateReverse(int[] nums, int k) {\n\t\tint n = nums.length;\n\t\tk %= n;\n\t\treverse(nums, 0, n - 1);\n\t\treverse(nums, 0, k - 1);\n\t\treverse(nums, k, n - 1);\n\t}", "public ListNode SolveByMovingPointers(ListNode head, int k)\n {\n // Edge cases\n if (head == null)\n return null;\n if (k == 0)\n return head;\n\n // Calculate list length + actual number of rotations\n int listLength = FindLength(head);\n int numberOfRotations = k >= listLength? k % listLength : k;\n\n // Another edge case - may not need to rotate at all\n if (listLength == 1 || numberOfRotations == 0)\n return head;\n\n // Iterate to the node before the node with number that needs to be rotated to beginning...\n ListNode oldHeadIterator = head;\n int counter = listLength - numberOfRotations - 1;\n while (counter != 0)\n {\n counter -= 1;\n oldHeadIterator = oldHeadIterator.next;\n }\n\n // ... Then make the following node be the beginning of new head + nullify tail of old head\n ListNode newHead = oldHeadIterator.next;\n oldHeadIterator.next = null;\n\n // Iterate to end of the new head, then simply add the old head contents to the tail\n ListNode newHeadIterator = newHead;\n while (newHeadIterator.next != null)\n newHeadIterator = newHeadIterator.next;\n newHeadIterator.next = head;\n\n return newHead;\n }", "Node nthToLast(int k) {\n Node p1 = head;\n Node p2 = head;\n for (int i = 0; i < k; i++) {\n if (p1 == null) return null;\n p1 = p1.getNext();\n }\n\n while (p1 != null) {\n p1 = p1.getNext();\n p2 = p2.getNext();\n }\n return p2;\n }", "public int kthFromEnd(int k) {\r\n\r\n if (head == null) {\r\n return 0;\r\n }\r\n Node lead = head;\r\n while (k >= 0) {\r\n lead = lead.next;\r\n k--;\r\n }\r\n Node tail = head;\r\n while (lead != null) {\r\n lead = lead.next;\r\n tail = tail.next;\r\n }\r\n int i = tail.data;\r\n return i;\r\n }", "public static void printKLevelsDown(Node node, int k){\n Queue<Node> q = new ArrayDeque<>();\n q.add(node);\n if( k == 0)\n {\n System.out.println(node.data);\n }\n \n \n \n else{\n while(k>0)\n {\n Queue<Node> qc = new ArrayDeque<>();\n \n \n while( q.size() > 0)\n {\n node = q.element();\n if(node.left != null)\n {\n qc.add(node.left);\n }\n if(node.right != null)\n {\n qc.add(node.right);\n }\n q.remove();\n }\n \n q = qc;\n k--;\n }\n while( q.size() > 0)\n {\n node = q.remove();\n System.out.println(node.data);\n }\n }\n }", "public void deleteAll(Key k) {\n\t\tNode temp = getFirstNode(); // this does not work because Java is pass by value, not pass by reference\n\t\tfor (int i = 0; i < size-1; i++) {\n\t\t\tif(temp.next.key==k){\n\t\t\t\ttemp.next = temp.next.next;\n\t\t\t}\n\t\t}\n\t\tif (lastNode.key == k)\n\t\t\tlastNode = null;\n\t}", "static void all_sub_groups_of_size_k(int num_of_nodes,\r\n int k, long numOfGroups,\r\n LinkedList<Integer>[] groups)\r\n {\r\n //create array of all the nodes\r\n int arr[] = new int[num_of_nodes];\r\n for (int i = 0; i < num_of_nodes; i++){\r\n arr[i] = i;\r\n }\r\n\r\n int data[] = new int[k]; // temporary array which will hold the subgroup\r\n\r\n currNumOfGroups = 0;\r\n // Print all combination using temprary\r\n // array 'data[]'\r\n getAllGroupsOfSizeK(arr, num_of_nodes, k, 0, data, 0,\r\n numOfGroups, groups);\r\n }", "private List<MyPair> sortAndTrim(int k, List<MyPair> neighbours) {\n\n for (int i = 0; i <= neighbours.size() - 2; i++) {\n for (int j = 0; j <= neighbours.size() - 2 - i; j++) {\n if (neighbours.get(j + 1).getValue() > neighbours.get(j).getValue()) {\n Collections.swap(neighbours, j, j + 1);\n }\n }\n }\n if (k != -1) {\n try {\n neighbours = neighbours.subList(0, k);\n } catch (IndexOutOfBoundsException e) {\n return neighbours;\n }\n }\n return neighbours;\n }", "public void rotate2(int[] nums, int k) {\n int start = 0, n = nums.length;\n k %= n;\n while (n > 0 && k > 0) {\n // Swap the last k elements with the first k elements.\n // The last k elements will be in the correct positions\n // but we need to rotate the remaining (n - k) elements\n // to the right by k steps.\n for (int i = 0; i < k; i++) {\n swap(nums, i + start, n - k + i + start);\n }\n n -= k;\n start += k;\n k %= n;\n }\n }", "public static void main(String[] args) {\n\n\n Node head = MyList.getList();\n MyList.printList(head);\n\n System.out.println(\"After Reverse\");\n head = reverseAlternateKNodes(head, 3);\n System.out.println(\"Reversed\");\n MyList.printList(head);\n\n }", "public void rotateLeftWithReverse(int arr[], int n, int k) {\n reverse(arr, 0, k-1);\n\n //reverse last k elements\n reverse(arr, n-k-1, n-1);\n\n //reverse all array\n reverse(arr, 0, n-1);\n printArray(arr);\n\n /*\n * Time Complexity : O(n) loop ran for k times\n * Space Complexity : O(1)\n */\n }", "public static <V> ListNode<V> Rotate (\n\t\tfinal ListNode<V> head,\n\t\tfinal int k)\n\t{\n\t\tif (null == head || 0 >= k)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tint rotationCount = 0;\n\t\tListNode<V> prevNode = null;\n\t\tListNode<V> currentNode = head;\n\n\t\tListNode<V> nextNode = head.next();\n\n\t\twhile (++rotationCount < k)\n\t\t{\n\t\t\tif (null == nextNode)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tprevNode = currentNode;\n\t\t\tcurrentNode = nextNode;\n\n\t\t\tnextNode = nextNode.next();\n\t\t}\n\n\t\tif (!prevNode.setNext (\n\t\t\tnull\n\t\t))\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tListNode<V> rotatedHead = currentNode;\n\n\t\tnextNode = currentNode.next();\n\n\t\twhile (null != nextNode)\n\t\t{\n\t\t\tcurrentNode = nextNode;\n\n\t\t\tnextNode = nextNode.next();\n\t\t}\n\n\t\treturn currentNode.setNext (\n\t\t\thead\n\t\t) ? rotatedHead : null;\n\t}", "public int getKthNodeFromEnd(int k){\n // [10 -> 20 -> 30 -> 40 -> 50]\n // k = 1(50) dist = 0;\n // k = 2(40) dist = 1\n\n if(isEmpty()) throw new IllegalStateException();\n\n int distance = k - 1;\n var pointerOne = first;\n var pointerSecond = first;\n\n for(int i = 0; i < distance; i++){\n if(pointerSecond.next != null)\n pointerSecond = pointerSecond.next;\n else\n throw new IllegalArgumentException();\n }\n\n while(pointerSecond.next != null){\n pointerOne = pointerOne.next;\n pointerSecond = pointerSecond.next;\n }\n\n return pointerOne.value;\n }", "public Node theLastNele(MyList ml,int k)\n\t{\n\t\tif(ml==null|| ml.head==null) return null;\n\t\tNode rt=ml.head,cur = ml.head;\n\t\tint i;\n\t\tfor( i=0;i<k-1;i++) {\n\t\t\tif(cur == null) break;\n\t\t\tcur = cur.next;\n\t\t}\n\t\tif(i!=k-1) return null;\n\t\t\n\t\twhile(cur!=ml.tail)\n\t\t{\n\t\t\tcur = cur.next;\n\t\t rt = rt.next;\n\t\t}\n\t\t\n\t\treturn rt;\n\t}", "private static SingleLinkedNode findFromEnd(SinglyLinkedList sll, int k) {\n\t\tSingleLinkedNode fast = sll.getHead();\r\n\t\tSingleLinkedNode slow = fast;\r\n\t\tint count = 1;\r\n\t\twhile (fast != null && count < k) {\r\n\t\t\tfast = fast.getNext();\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tif (fast == null) {\r\n\t\t\treturn null; // not enough elements.\r\n\t\t}\r\n\t\tif (fast.getNext() == null) {\r\n\t\t\t// remove 1st element.\r\n\t\t\tsll.setHead(slow.getNext());\r\n\t\t\treturn slow;\r\n\t\t}\r\n\t\t// Now slow and fast are k elements apart.\r\n\t\t// look 2 ahead so we can remove the element\r\n\t\twhile (fast.getNext().getNext() != null) {\r\n\t\t\tfast = fast.getNext();\r\n\t\t\tslow = slow.getNext();\r\n\t\t}\r\n\t\tfast = slow.getNext(); // temp pointer\r\n\t\tslow.setNext(slow.getNext().getNext());\r\n\t\treturn fast;\r\n\t\t\r\n\t}", "public Node ceil(K k){\n int ceiRank = rank(k);\n// Node res = select(ceiRank);\n// if(res.e.equals(e))\n// ceiRank = ceiRank+1;\n return select(ceiRank);\n }", "public void rotate(int[] nums, int k) {\n \n k = k % nums.length;\n reverse(nums, 0, nums.length-1);\n reverse(nums, 0, k-1);\n reverse(nums, k, nums.length-1);\n }", "private static void rightRotate(int[] nums, int k) {\r\n\t if (nums.length == 0) return;\r\n\t \r\n\t k %= nums.length;\r\n\t \r\n\t if (k == 0) return;\r\n\t \r\n\t int left=0, right=nums.length-1, tmp;\r\n\t \r\n\t while(left < right) {\r\n\t tmp = nums[left];\r\n\t nums[left] = nums[right];\r\n\t nums[right] = tmp;\r\n\t \r\n\t left++;\r\n\t right--;\r\n\t }\r\n\t \r\n\t left=0;\r\n\t right=k-1;\r\n\t \r\n\t while(left < right) {\r\n\t \ttmp = nums[left];\r\n\t \tnums[left] = nums[right];\r\n\t \tnums[right] = tmp;\r\n\t \t \r\n\t \tleft++;\r\n\t \tright--;\r\n\t }\r\n\t \r\n\t left=k;\r\n\t right=nums.length-1;\r\n\t \r\n\t while(left < right) {\r\n\t \ttmp = nums[left];\r\n\t \tnums[left] = nums[right];\r\n\t \tnums[right] = tmp;\r\n\t \t \r\n\t \tleft++;\r\n\t \tright--;\r\n\t }\r\n\t }", "public E findKthNodeFromEnd(int k) {\n\t\tif (k <= 0 || k > size())\n\t\t\tthrow new IllegalArgumentException();\n\n\t\tNode current = first;\n\t\tNode next = current;\n\n\t\twhile (k > 0) {\n\t\t\tnext = next.next;\n\t\t\tk--;\n\t\t}\n\n\t\twhile (next != null) {\n\t\t\tcurrent = current.next;\n\t\t\tnext = next.next;\n\t\t}\n\t\treturn (E) current.value;\n\t}", "public void printKDistantIter(Node root, int k) {\r\n if(root == null) {\r\n return;\r\n }\r\n\r\n Queue<Node> queue = new LinkedList<>();\r\n queue.add(root);\r\n while(!queue.isEmpty() && k != 0) {\r\n k--;\r\n int nodeCount = queue.size();\r\n while(nodeCount > 0) {\r\n Node top = queue.poll();\r\n\r\n if(top.left != null) {\r\n queue.add(top.left);\r\n }\r\n\r\n if(top.right != null) {\r\n queue.add(top.right);\r\n }\r\n nodeCount--;\r\n }\r\n }\r\n\r\n while(!queue.isEmpty()) {\r\n Node node = queue.poll();\r\n System.out.println(node.data);\r\n }\r\n }", "private static void back(int k) {\r\n\t\tfor (int i = 0; i < SIZE; i++) {\r\n\t\t\tcurrentPerm[k] = i;\r\n\t\t\tif (validateCurrentPerm(currentPerm, k)) {\r\n\t\t\t\tif (k == SIZE - 1) {\r\n\t\t\t\t\tString currentPermString = \"\";\r\n\t\t\t\t\tfor (int t : currentPerm) {\r\n\t\t\t\t\t\tcurrentPermString += t;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tperms.add(currentPermString);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tback(k + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void Free_SSL(int k){\n // Link deleted element to a alternate link list\n // Let free element become the second element of alternate link list\n StaticLinkList[k].cur = StaticLinkList[0].cur;\n // Let the deleted element become the first element of alternate link list\n StaticLinkList[0].cur = k;\n }", "public static void main(String[] args) {\n\t\tNode head=GroupReverse.createList();\n\t\thead=GroupReverse.reverseK2(head, 3);\n\t\tint count=0;\n\t\twhile(head!=null)\n\t\t{\n\t\t\tSystem.out.print(head.value+\" \");\n\t\t\thead=head.next;\n\t\t}\n\t\t\n\t}", "public ListNode findK(ListNode head,int k) {\n\t\tListNode fast,slow;\n\t\tfast=slow=head;\n\t\t//Move Kth first\n\t\twhile (k-->0) {\n\t\t\tfast=fast.next();\n\t\t}\n\t\twhile(fast!=null & fast.next()!=null) {\n\t\t\tfast=fast.next();\n\t\t\tslow=slow.next();\t\t\n\t\t}\n\t\treturn slow;\n\t}", "private List<List<Node>> combinationHelper(int k, int n) {\n\t\tList<List<Node>> res = new ArrayList<List<Node>>();\n\t\tList<int[]> combRes = combinationHelperImpl(k, n);\n\t\tfor (int[] elem : combRes) {\n\t\t\tArrays.sort(elem);\n\t\t\tList<Node> tmp = new ArrayList<Node>();\n\t\t\tfor (int i : elem) {\n\t\t\t\ttmp.add(queryNodes.get(i));\n\t\t\t}\n\t\t\tres.add(new ArrayList<Node>(tmp));\n\t\t}\n\t\treturn res;\n\t}", "public void rotateold2(int[] a, int k) {\n\n\t\tif (a == null || a.length == 0)\n\t\t\treturn;\n\n\t\tint jump = 0, len = a.length, cur = a[0], next, count = 0;\n\n\t\tk %= len; \n\t\tif (k == 0) return;\n\n\t\tif (len % k != 0 || k == 1)\n\t\t{ \n\t\t\tint i = 0;\n\t\t\twhile (i < len)\n\t\t\t{\n\t\t\t\tjump = (jump + k) % len;\n\t\t\t\tnext = a[jump];\n\t\t\t\ta[jump] = cur;\n\t\t\t\tcur = next;\n\t\t\t\ti++;\n\t\t\t} \n\t\t} \n\t\telse\n\t\t{\n\t\t\tfor (int i = 0; i <= len/k; i ++)\n\t\t\t{\n\t\t\t\tint start = 0;\n\t\t\t\tjump = i;\n\t\t\t\tnext = a[jump];\n\t\t\t\tcur = a[i];\n\t\t\t\twhile (start <= len/k)\n\t\t\t\t{\n\t\t\t\t\tjump = (jump + k) % len;\n\t\t\t\t\tnext = a[jump];\n\t\t\t\t\ta[jump] = cur;\n\t\t\t\t\tcur = next;\n\t\t\t\t\tstart++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "static Node reserveIterativeTraversal(MyLinkedList l, int k) {\n\t\tNode p1 = l.getHead();\n\t\tNode p2 = l.getHead();\n\t\t\n\t\tfor(int i = 0; i < k; i++) \n\t\t\tp1 = p1.getNext();\n\t\t\t\n\t\twhile(p1.getNext() != null) {\n\t\t\tp1 = p1.getNext();\n\t\t\tp2 = p2.getNext();\n\t\t}\n\t\t\n\t\treturn p2;\n\t}", "public void pruneK(Integer k) {\n\n Integer sum = (Integer)root.element;\n if (largestPath(root.left, sum) >= k) {\n pruneRecur(root.left, sum, k);\n } else {\n root.left = null;\n }\n if (largestPath(root.right, sum) >= k) {\n pruneRecur(root.right, sum, k);\n } else {\n root.right = null;\n }\n }", "private void swim(int k) {\r\n while (k > 1 && greater(k/2, k)) {\r\n swap(k, k / 2);\r\n k = k/2;\r\n }\r\n }", "public ArrayList<ArrayList<Integer>> combine(int n, int k) {\r\n\r\n\tArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();\r\n\r\n\t// Key: constraints of recursion\r\n\tif (n < 1 || n < k || k < 1)\r\n\t return result;\r\n\r\n\tif (k == 1) {\r\n\t for (int i = 1; i <= n; i++) {\r\n\t\tArrayList<Integer> aList = new ArrayList<Integer>();\r\n\t\taList.add(i);\r\n\t\tresult.add(aList);\r\n\t }\r\n\t return result;\r\n\t}\r\n\r\n\tfor (int i = n; i > 0; i--) {\r\n\t ArrayList<ArrayList<Integer>> temp = combine(i - 1, k - 1);\r\n\r\n\t for (ArrayList<Integer> aList : temp) {\r\n\t\taList.add(i);\r\n\t }\r\n\r\n\t result.addAll(temp);\r\n\t}\r\n\r\n\treturn result;\r\n }", "public void rotate(int[] nums, int k) {\n\t\tif(nums == null || nums.length == 0 || k <= 0){\n\t\t\treturn;\n\t\t}\n\t\tint n = nums.length, count = 0;\n\t\tk %= n;\n\t\tfor(int start = 0; count < n; start++){\n\t\t\tint cur = start;\n\t\t\tint prev = nums[start];\n\t\t\tdo{\n\t\t\t\tint next = (cur + k) % n;\n\t\t\t\tint temp = nums[next];\n\t\t\t\tnums[next] = prev;\n\t\t\t\tcur = next;\n\t\t\t\tprev = temp;\n\t\t\t\tcount++;\n\t\t\t}while(start != cur);\n\t\t}\n\t}", "public void deleteAt(int k) {\n if (isEmpty()) return;\n if (k == 0) {//check if node is head\n Cus_Node p = head;\n head = head.next;\n p.next = null;\n } else {\t\n Cus_Node p = pos(k);//get node position k\n if (p == null) return;\n Cus_Node q = pos(k - 1);//q is node before of p\n // Remove p\n q.next = p.next;\n p.next = null;\n if (p == tail) tail = q;\n }\n }", "@Override\n protected void downHeap(int k)\n {\n while (2 * k <= this.count)\n {\n //identify which of the 2 children are smaller\n int j = 2 * k;\n if (j < this.count && this.isGreater(j, j + 1))\n {\n j++;\n }\n //if the current value is < the smaller child, we're done\n if (!this.isGreater(k, j))\n {\n break;\n }\n //if not, swap and continue testing\n this.swap(k, j);\n k = j;\n }\n \tthis.elementsToArrayIndex.put(elements[k], k);\n }", "public static void main(String[] args) {\n\t\tNode current=new Node(10);\r\n\t\tcurrent.next = new Node(20); \r\n\t\tcurrent.next.next = new Node(30); \r\n\t\tcurrent.next.next.next = new Node(40); \r\n\t\tcurrent.next.next.next.next = new Node(50); \r\n Node r=Rotatelinkedlistbyk(current,2);\r\n if(r==null)\r\n {\r\n \t System.out.print(\"no element to return\");\r\n }\r\n while(r != null)\r\n {\r\n \t System.out.print(r.data);\r\n \t r=r.next;\r\n }\r\n\r\n\t}", "public List<Integer> rotateEfficiently(List<Integer> a, int k, List<Integer> queries) {\n\n List<Integer> newList = new ArrayList<>(a);\n int counter=0;\n int size = a.size();\n for (int count=k;count<k+size;count++) {\n newList.set(counter++, a.get(count%size));\n }\n\n return putInSpecifiedQueries(newList,queries);\n }", "public List<List<Integer>> combineIterative(int n, int k) {\n if (k > n) return Collections.emptyList();\n List<List<Integer>> result = new ArrayList<>();\n for (int i = 1; i <= n - k + 1; ++i) result.add(Arrays.asList(i));\n for (int i = 2; i <= k; ++i) {\n List<List<Integer>> tmp = new ArrayList<>();\n for (List<Integer> elem : result) {\n int lastNum = elem.get(elem.size() - 1);\n for (int j = lastNum + 1; j <= n - k + i; ++j) {\n List<Integer> copy = new ArrayList<>(elem);\n copy.add(j);\n tmp.add(copy);\n }\n }\n result = tmp;\n }\n return result;\n }", "public void compareLeaf(int k){\n\t\twhile(k > 1 && lessThan(k, k/2)){\n\t\t\tString tempKey = queueArray[k/2][0];\n\t\t\tString tempVal = queueArray[k/2][1];\n\t\t\tqueueArray[k/2][0] = queueArray[k][0];\n\t\t\tqueueArray[k/2][1] = queueArray[k][1];\n\t\t\tqueueArray[k][0] = tempKey;\n\t\t\tqueueArray[k][1] = tempVal;\n\t\t\tk = k/2;\n\t\t}\n\t}", "public static ArrayList<ArrayList<Integer>> combine1(int n, int k) {\r\n\tArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();\r\n\tif (n < 1 || k < 1) {\r\n\t return result;\r\n\t}\r\n\tif (n < k) {\r\n\t return result;\r\n\t}\r\n\tif (k == 1) {\r\n\t for (int i = 1; i <= n; i++) {\r\n\t\tArrayList<Integer> aResult = new ArrayList<Integer>();\r\n\t\taResult.add(i);\r\n\t\tresult.add(aResult);\r\n\t }\r\n\t return result;\r\n\t}\r\n\r\n\tfor (int i = n; i > 0; i--) {\r\n\t ArrayList<ArrayList<Integer>> temp = combine1(i - 1, k - 1);\r\n\t for (ArrayList<Integer> aResult : temp) {\r\n\t\taResult.add(i);\r\n\t }\r\n\t result.addAll(temp);\r\n\t}\r\n\r\n\t// get rid of duplicate sets\r\n\tLinkedHashSet<ArrayList<Integer>> finalResult = new LinkedHashSet<ArrayList<Integer>>();\r\n\tfor (ArrayList<Integer> aResult : result) {\r\n\t Collections.sort(aResult);\r\n\t finalResult.add(aResult);\r\n\t}\r\n\tresult = new ArrayList<ArrayList<Integer>>(finalResult);\r\n\r\n\treturn result;\r\n }", "private void swim(int k) {\n if (k > 1 && aHeap.get(parent(k)).compareTo(aHeap.get(k)) > 0) {\n swap(k, parent(k));\n swim(parent(k));\n }\n }", "public static ArrayList<Integer> longestSubseq4 (int k) {\r\n\t\tfor (int n = 0; n <= k; n++) {\r\n\t\t\tArrayList<Integer> longest = new ArrayList<Integer>();\r\n\t\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\t\tif (A[n] > A[i]) {\r\n\t\t\t\t\tArrayList<Integer> subseq = cache.get(i);\r\n\t\t\t\t\tif (subseq.size() > longest.size()) {\r\n\t\t\t\t\t\tlongest = subseq;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlongest = new ArrayList<Integer>(longest);\r\n\t\t\tlongest.add(A[n]);\r\n\t\t\tcache.put(n, longest);\r\n\t\t}\r\n\t\treturn cache.get(k);\r\n\t}", "public String removeKthElement(int k) {\n for (int i = 1; i < k; i++) {\n next();\n }\n String kElement = elements[index];\n remove();\n return kElement;\n }", "public LinkedListNode kth(LinkedListNode head, int k){\n\t\tif(head==null) return null;\n\t\t\n\t\tNode p1=head;\n\t\tNdde p2=head;\n\t\t\n\t\tfor(int i=0;i<k;i++){\n\t\t\tif(p2==null) return null;\n\t\t\tp2=p2.next\n\t\t}\n\t\t\n\t\tif(p2==null) return null;\n\t\t\n\t\twhile(p2.next!=null){\n\t\t\tp2=p2.next;\n\t\t\tp1=p1.next;\n\t\t}\n\t\treturn p1;\n\t}", "public static void rotate(int[] nums, int k) {\n // get the kth index from the end to rotate\n\t\tint n = nums.length;\n\t\tk = k % n ;\n\t\tif(k == 0) return ;\n\t\tint prev = 0, tmp = 0;\n\t\tfor(int i = 0 ; i < k ; i++) {\n\t\t\tprev = nums[n - 1];\n\t\t\tfor(int j = 0 ; j < nums.length ; j++) {\n\t\t\t\ttmp = nums[j];\n\t\t\t\tnums[j] = prev;\n\t\t\t\tprev = tmp;\n\t\t\t}\n\t\t}\n }", "private void siftDown(int k, T x) {\n int half = size >>> 1;\n while (k < half) {\n int child = (k << 1) + 1;\n Object c = heap[child];\n int right = child + 1;\n if (right < size &&\n comparator.compare((T) c, (T) heap[right]) > 0)\n c = heap[child = right];\n if (comparator.compare(x, (T) c) <= 0)\n break;\n heap[k] = c;\n k = child;\n }\n heap[k] = x;\n }", "public void reverseDi() {\n int hi = size - 1;\n int lo = 0;\n\n while (lo < hi) {\n Node left = getNodeAt(lo);\n Node right = getNodeAt(hi);\n\n Object temp = left.data;\n left.data = right.data;\n right.data = temp;\n\n lo++;\n hi--;\n }\n }", "public List<GraphNode> reverse (List<GraphNode> list){\n\t\tMap<GraphNode, GraphNode> map = new HashMap<> ();\n\t\tfor(GraphNode node : list){\n\t\t\tmap.put(node, new GraphNode(node.key));\n\t\t}\n\t\tfor(GraphNode node : list){\n\t\t\tfor(GraphNode nei : node.neighbors){\n\t\t\t\tmap.get(nei).addNeibor(map.get(node));\n\t\t\t}\n\t\t}\n\t\tList<GraphNode> sol = new ArrayList<GraphNode>();\n\t\tfor(Map.Entry<GraphNode, GraphNode> node : map.entrySet()){\n\t\t\tsol.add(node.getValue());\n\t\t}\n\t\treturn sol;\n\t}", "private Object asReversedIteration(final List<Object> list, final boolean recursive, final List<Object> disc) {\n Stack<Object> s = new Stack<>();\n disc.add(list);\n outerLoop:\n for (Object m : list) {\n s.push(m);\n\n for (Object e : disc) {\n {\n if (e == m) {\n continue outerLoop;\n }\n }\n }\n if (recursive) {\n if (m instanceof List<?>) {\n asReversedIteration((List<Object>) m, true, disc);\n }\n if (m instanceof Map<?, ?>) {\n asReversedIteration((Map<String, Object>) m, true, disc);\n }\n }\n\n }\n list.clear();\n int size = s.size();\n for (int i = 0; i < size; i++) {\n list.add(s.pop());\n }\n return list;\n }", "public static Node lastKNode(Node head, int lastK) {\n int k = lastK;\n // 快指针\n Node p = head;\n while((k = k-1) > 0 && p != null) {\n p = p.getNext();\n }\n\n // 慢指针\n Node q = head;\n while(p.getNext() != null) {\n p = p.getNext();\n q = q.getNext();\n }\n return q;\n }", "private long removeHelper(long r, int k) throws IOException {\n if (r == 0) {\r\n return 0;\r\n }\r\n long ret = r;\r\n Node current = new Node(r);\r\n if (current.key == k) {\r\n if (current.left == 0) {\r\n ret = current.right;\r\n addToFree(r);\r\n }\r\n else if (current.right == 0) {\r\n ret = current.left;\r\n addToFree(r);\r\n }\r\n else {\r\n current.left = replace(current.left, current);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n }\r\n }\r\n else if (current.key > k) {\r\n current.left = removeHelper(current.left, k);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n }\r\n else {\r\n current.right = removeHelper(current.right, k);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n }\r\n int heightDifference = getHeightDifference(r);\r\n if (heightDifference < -1) {\r\n if (getHeightDifference(current.right) > 0) {\r\n current.right = rightRotate(current.right);\r\n current.writeNode(r);\r\n return leftRotate(r);\r\n }\r\n else {\r\n return leftRotate(r);\r\n }\r\n }\r\n else if (heightDifference > 1) {\r\n if (getHeightDifference(current.left) < 0) {\r\n current.left = leftRotate(current.left);\r\n current.writeNode(r);\r\n return rightRotate(r);\r\n }\r\n else {\r\n return rightRotate(r);\r\n }\r\n }\r\n return ret;\r\n }", "public static Node findLastKth3(Node n, int k) {\n\t\tif (n == null) {\n\t\t\treturn null;\n\t\t}\n\t\tNode result = findLastKth3(n.next, k);\n\t\tindex++;\n\t\tif (index == k)\n\t\t\treturn n;\n\t\telse\n\t\t\treturn result;\n\t}", "public ListNode rotateLeft(ListNode head, int k) {\r\n\t\tif (k <= 0) return head;\r\n\t\tListNode curr = head;\r\n\t\tint count = 1;\r\n\t\twhile (count++ < k && curr != null)\r\n\t\t\tcurr = curr.next;\r\n\t\tif (curr == null) return head;\r\n\t\tListNode nextHead = curr;\r\n\t\twhile (curr.next != null)\r\n\t\t\tcurr = curr.next;\r\n\t\tcurr.next = head;\r\n\t\thead = nextHead.next;\r\n\t\tnextHead.next = null;\r\n\t\treturn head;\r\n\t}", "public static String reverseStr(String s, int k) {\n\n\t\tchar[] chars = s.toCharArray();\n\n\t\tint i = 0;\n\t\tint j = k - 1;\n\t\tint skip = 2 * k;\n\n\t\tif (j >= chars.length) {\n\t\t\tj = chars.length - 1;\n\t\t}\n\n\t\twhile (j < chars.length) {\n\t\t\t\n\t\t\treverseString(chars, i, j);\n\t\t\ti = i + skip;\n\t\t\tj = i + k - 1;\n\n\t\t\tif (i < chars.length && j >= chars.length) {\n\t\t\t\tj = chars.length - 1;\n\t\t\t}\n\t\t}\n\n\t\treturn new String(chars);\n\t}", "public void flipBit(int k) {\n if (this.inBitRange(k)) {\n int i = k / 8;\n int j = k % 8;\n int b = this.data.get(i);\n int c = 1 << (7 - j);\n b = b ^ c;\n byte d = (byte) b;\n this.data.set(i, d);\n }\n }", "private Node select(Node x, int k) {\n if (x == null) return null;\n int t = size(x.left);\n// TODO:根据size和rank的关系,进行定位,右子树需要用k-t-1,\n if (t > k) return select(x.left, k);\n else if (t < k) return select(x.right, k - t - 1);\n else return x;\n }", "private static void test1() {\n ListNode listOne = new ListNode(1);\n listOne.next = new ListNode(2);\n listOne.next.next = new ListNode(3);\n listOne.next.next.next = new ListNode(4);\n listOne.next.next.next.next = new ListNode(5);\n\n ListNode listTwo = new ListNode(1);\n listTwo.next = new ListNode(3);\n listTwo.next.next = new ListNode(4);\n\n ListNode listThree = new ListNode(2);\n listThree.next = new ListNode(6);\n\n ListNode[] lists = {listOne, listTwo, listThree};\n\n mergeKLists(lists);\n }", "private void dfs(List<List<Integer>> res, List<Integer> tmp, int n, int k, int start) {\n\t\tif(tmp.size() == k) {\n\t\t\tres.add(new ArrayList<Integer>(tmp));\n\t\t\treturn;\n\t\t}\n\t\tfor(int i=start;i<=n;i++) {\n\t\t\t//i <= (n - (k - tmp.size()) + 1) 剪枝,当可选的数已经不够时,直接剪枝\n\t\t\ttmp.add(i);\n\t\t\tdfs(res,tmp,n,k,i+1);//i+1,别老忘写+1\n\t\t\ttmp.remove(tmp.size()-1);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tLinkedList ll=new LinkedList();\r\n\t\tScanner sc=new Scanner(System.in);int ch;int ele,k;\r\n\t\t\r\n\t\tdo {\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Enter 1.insert 2.reverse 3.display 4.reverse with k nodes 5.getMiddle 6.detectLoop 7.endNth 8.exit\");\r\n\t\t\tch=sc.nextInt();\r\n\t\t\tswitch(ch) {\r\n\t\t\t\r\n\t\t\t\tcase 1:System.out.println(\"enter the element to be inserted:\");\r\n\t\t\t\t\t\tele=sc.nextInt(); \r\n\t\t\t\t\t\tll.insert(ele); \r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\tcase 2:ll.reverse(ll.head);\r\n\t\t\t\t\t\tSystem.out.print(\"Reversed list:\");\r\n\t\t\t\t\t\tll.print();\r\n\t\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\tcase 3:ll.print();System.out.println();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\tcase 4:System.out.println(\"enter k:\");\r\n\t\t\t\t\t\tk=sc.nextInt();\r\n\t\t\t\t\t\tll.head=ll.reverseGroup(ll.head,k);\r\n\t\t\t\t\t\tll.print();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\tcase 5:System.out.println(\"middle element:\"+ll.getMiddle().data);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\tcase 6:if(ll.detectLoop())\r\n\t\t\t\t\t \t\tSystem.out.println(\"Loop is present\");\r\n\t\t\t\t\t else\r\n\t\t\t\t\t\t System.out.println(\"Loop is not present\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t break;\r\n\t\t\t\t\t \r\n\t\t\t\tcase 7:System.out.println(\"enter n from the end:\");\r\n\t\t\t\t\t\tk=sc.nextInt();\r\n\t\t\t\t\t\tll.endNth(k);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\tcase 8:if(ll.Palindrome()) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"Yes! It is a Palindrome\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tSystem.out.println(\"No! It is not a Palindrome\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\tcase 9:break;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}while(ch!=9);\r\n\r\n\t}", "protected void sink(int k) {\n\n while (2*k <= N) {\n int j = 2*k;\n\n if (j < N && less(j, j+1)) j++;\n if (!less(k, j)) break;\n exchange(k, j);\n k = j;\n }\n }", "public List<Integer> rotate(List<Integer> a, int k, List<Integer> queries) {\n\n List<Integer> arrAfterRotation = new ArrayList<>(a);\n\n List<Integer> lastArrAfterRotation = new ArrayList<>(a);\n\n //Set the last one after rotation equal to provided array at initialization\n lastArrAfterRotation = a;\n\n for(int i=0; i<k; i++) {\n arrAfterRotation.set(0,lastArrAfterRotation.get(lastArrAfterRotation.size()-1));\n int counter=1;\n for (int elem=1; elem<lastArrAfterRotation.size();elem++ ) {\n arrAfterRotation.set(counter++, lastArrAfterRotation.get(elem-1));\n }\n List<Integer> tempList = new ArrayList<>(arrAfterRotation);\n lastArrAfterRotation= tempList;\n }\n printList(lastArrAfterRotation);\n\n List<Integer> returnList = new ArrayList<>(lastArrAfterRotation);\n\n for (int i : queries) {\n returnList.set(i,lastArrAfterRotation.get(i));\n }\n\n return returnList;\n\n }", "public static void main(String[] args) {\n\t\tKthReverseLinkedList rll = new KthReverseLinkedList();\r\n\t\tReverseLinkedList rl = new ReverseLinkedList();\r\n\t\tNode node = rl.new Node();\r\n\t\tnode.data = 'a';\r\n\t\tnode.link = rl.new Node();\r\n\t\tnode.link.data = 'b';\r\n\t\tnode.link.link = rl.new Node();\r\n\t\tnode.link.link.data = 'c';\r\n\t\tnode.link.link.link = rl.new Node();\r\n\t\tnode.link.link.link.data = 'd';\r\n\t\tnode.link.link.link.link = rl.new Node();\r\n\t\tnode.link.link.link.link.data = 'e';\r\n\t\tnode.link.link.link.link.link = rl.new Node();\r\n\t\tnode.link.link.link.link.link.data = 'f';\r\n\t\tnode.link.link.link.link.link.link = rl.new Node();\r\n\t\tnode.link.link.link.link.link.link.data = 'g';\r\n\t\tnode.link.link.link.link.link.link.link = rl.new Node();\r\n\t\tnode.link.link.link.link.link.link.link.data = 'h';\r\n\t\trl.printNode(node);\r\n\t\tnode = rll.kthReverse(node, 3);\r\n\t\trl.printNode(node);\r\n\r\n\t}", "public void reverse() {\n\t\t// write you code for reverse using the specifications above\t\t\n\t\tNode nodeRef = head;\n\t\thead = null;\n\t\t\n\t\twhile(nodeRef != null) {\n\t\t\tNode tmp = nodeRef;\n\t\t\tnodeRef = nodeRef.next;\n\t\t\ttmp.next = head;\n\t\t\thead = tmp;\n\t\t}\n\t}", "public void rotateNoSpace(int[] nums, int k){\n //in case k is greater than the length\n k = k % nums.length;\n \n for(int i = 0; i < k; i++){\n int last = nums[nums.length-1];\n for(int j = nums.length - 1; j >= 1; j--){\n nums[j] = nums[j-1];\n }\n nums[0] = last;\n }\n }", "public ListNode mergeKLists(ListNode[] lists) {\n LinkedList<Integer> a= new LinkedList<Integer>();\n \n for(int i=0;i<lists.length;i++) {\n ListNode temp = lists[i];\n \n while(temp!=null) {\n // System.out.println(temp.val);\n a.add(temp.val);\n temp=temp.next;\n }\n }\n Collections.sort(a);\n //copy all the elements into ListNode linked list.\n if(a.size()==0) { return null; }\n ListNode head = new ListNode(a.get(0));\n ListNode res = head;\n if(head== null) {\n head = new ListNode(a.get(0));\n }\n for(int j=1;j<a.size();j++) {\n \n res.next = new ListNode(a.get(j));\n res=res.next;\n \n }\n res=head;\n \n return res;\n \n \n \n \n }", "public List<List<Integer>> combineRecursive(int n, int k) {\n if (k > n) return Collections.emptyList();\n List<List<Integer>> result = new ArrayList<>();\n List<Integer> elem = new ArrayList<>();\n combine(n, k, 1, elem, result);\n return result;\n }", "public static void KswapPermutation(int arr[], int n, int k) {\n\t\tint[] pos = new int[n + 1];\r\n\r\n\t\tfor (int i = 0; i < n; ++i)\r\n\t\t\tpos[arr[i]] = i;\r\n\r\n\t\tfor (int i = 0; i < n && k > 0; ++i) {\r\n\t\t\t// If element is already i'th largest,\r\n\t\t\t// then no need to swap\r\n\t\t\tif (arr[i] == n - i)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t// Find position of i'th largest value, n-i\r\n\t\t\tint temp = pos[n - i];\r\n\r\n\t\t\t// Swap the elements position\r\n\t\t\tpos[arr[i]] = pos[n - i];\r\n\t\t\tpos[n - i] = i;\r\n\r\n\t\t\t// Swap the ith largest value with the\r\n\t\t\t// current value at ith place\r\n\t\t\tswap(arr, temp, i);\r\n\r\n\t\t\t// decrement number of swaps\r\n\t\t\t--k;\r\n\t\t}\r\n\t}", "public List<List<Integer>> combine(int n, int k) {\n List<List<Integer>> res = new ArrayList<>();\n dfs(res,1,k,new ArrayList<>(),n);\n return res;\n }", "ListNode<Integer> rearrangeLastN(ListNode<Integer> l, int n) {\r\n\t\t\r\n\r\n\t\t\r\n\t\tListNode<Integer> result = new ListNode<Integer>(0);\r\n\t\tListNode<Integer> head_result = result;\r\n\t\t\r\n\t\tListNode<Integer> temp = new ListNode<Integer>(0);\r\n\t\tListNode<Integer> pointer = temp;\r\n\t\t\r\n\t/* 1. */\r\n\t\tint size = (listSize(l) - n);\r\n\t\t\r\n\t/* 2. */\r\n\t\tfor(int i = 0;i < size; i++)\t{\r\n\t\t\tresult.next = l;\r\n\t\t\tresult = result.next;\r\n\t\t\tl = l.next;\r\n\t\t}\r\n\t\tresult.next = null;\r\n\t\tresult = head_result.next;\r\n\t/*3.*/ \r\n\t\twhile(l != null)\t{\r\n\t\t\ttemp.next = l;\r\n\t\t\ttemp = temp.next;\r\n\t\t\tl = l.next;\r\n\t\t}\r\n\t\ttemp.next = head_result.next;\r\n\t\ttemp = pointer.next;\r\n\t\tresult = temp;\r\n\t\t\r\n\t\treturn result;\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"LinkedList 1: \");\r\n\t\tListNode<Integer> l1=new ListNode<Integer>(0);\r\n\t\tListNode<Integer> l2=new ListNode<Integer>(1);\r\n\t\tListNode<Integer> l3=new ListNode<Integer>(3);\r\n\t\tListNode<Integer> l4=new ListNode<Integer>(5);\r\n\t\tListNode<Integer> l5=new ListNode<Integer>(7);\r\n\t\tListNode<Integer> l6=new ListNode<Integer>(22);\r\n\t\tl1.next=l2;l2.next=l3;l3.next=l4;l4.next=l5;l5.next=l6;\r\n\t\tdisplay(l1);\r\n\t\tint pos=5;\r\n\t\tremoveKthLastNode(l1,pos);\r\n\t\tSystem.out.println(\"\\nAfter Deletion : \");\r\n\t\tdisplay(l1);\r\n\t\t\r\n\r\n\t}", "void reverseList(){\n\n Node prev = null;\n Node next = null;\n Node iter = this.head;\n\n while(iter != null)\n {\n next = iter.next;\n iter.next = prev;\n prev = iter;\n iter = next;\n\n }\n\n //prev is the link to the head of the new list\n this.head = prev;\n\n }", "public void rotate1(int[] nums, int k) {\n k %= nums.length;\n reverse(nums, 0, nums.length - 1);\n reverse(nums, 0, k - 1);\n reverse(nums, k, nums.length - 1);\n }", "public Node floor(K k){\n int floorRank = rank(k);\n Node res = select(floorRank);\n if(res.k.compareTo(k)>0) floorRank = floorRank - 1;\n return select(floorRank);\n }", "private void pruneRecur(BinaryNode node, Integer sum, Integer k) {\n\n if (node == null) return;\n else {\n sum += (Integer)node.element;\n if (largestPath(node.left, sum) >= k) {\n pruneRecur(node.left, sum, k);\n } else {\n node.left = null;\n }\n if (largestPath(node.right, sum) >= k) {\n pruneRecur(node.right, sum, k);\n } else {\n node.right = null;\n }\n }\n }", "public static int[] rotate(int[] nums, int k) {\n int[] temp = new int[k];\n int acc = k % nums.length;\n for (int i = 0; i < acc; i++) {\n temp[i] = nums[(nums.length - acc) + i];\n }\n for (int i = nums.length - acc - 1; i >= 0; i--) {\n nums[i + acc] = nums[i];\n }\n for (int i = 0; i < acc; i++) {\n nums[i] = temp[i];\n }\n return nums;\n }", "TreeNode removeNodesRecur(TreeNode root, int k, int level) {\n\n\t\tif (root == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\troot.left = removeNodesRecur(root.left, k, level + 1);\n\t\troot.right = removeNodesRecur(root.right, k, level + 1);\n\n\t\tif (root.left == null && root.right == null && level < k) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn root;\n\t}", "private static LinkedList<? extends Object> reverseLinkedList(LinkedList<? extends Object> linkedList) {\n\t\tLinkedList<Object> reversedLinkedList = new LinkedList<>();\n\t\tfor (int i = linkedList.size() - 1; i >= 0; i--) {\n\t\t\treversedLinkedList.add(linkedList.get(i));\n\t\t}\n\t\treturn reversedLinkedList;\n\t}", "private static Node reverseList(Node start) {\n Node runner = start;\n // initialize the return value\n Node rev = null;\n // set the runner to the last item in the list\n while (runner != null) {\n Node next = new Node(runner.value);\n next.next = rev;\n rev = next;\n runner = runner.next;\n }\n return rev;\n }", "k value.\nFor 2nd tallest group (and the rest), insert each one of them into (S) by k value. So on and so forth.\n\npublic class Solution {\n public int[][] reconstructQueue(int[][] people) {\n Arrays.sort(people,new Comparator<int[]>() {\n @Override\n public int compare(int[] o1, int[] o2){\n return o1[0] != o2[0]? -o1[0] + o2[0]: o1[1] - o2[1];\n }\n });\n\n List<int[]> res = new ArrayList<>();\n for (int[] cur : people) {\n res.add(cur[1], cur); \n }\n return res.toArray(new int[people.length][]);\n }", "public Node updateList(Node head,int size) {\r\n\t\t Node temp=head;\r\n\t\t Stack<Integer> stack = new Stack<Integer>();\t//Stack for storing the linklist in order to get elements in reverse order\r\n\t\t \r\n\t\t for(int i=0;i<size;i++){\r\n\t\t \tstack.push(temp.data);\t\t//pushing elements in stack\r\n\t\t \ttemp=temp.next;\r\n\t\t }\r\n\t\t temp=head;\r\n\t\t for(int i=0;i<size/2;i++){\t\t//popping elements in reverse order\r\n\t\t \tint val=stack.pop();\r\n\t\t \ttemp.data=temp.data - val;\r\n\t\t \ttemp=temp.next;\r\n\t\t }\r\n\t\t return head;\r\n\t }", "public void siftDown( int k) \r\n {\r\n int v, j;\r\n \r\n v = h[k];\r\n while(k <= N/2)\r\n {\r\n j = 2k;\r\n if(j>N && dist[h[j]] > dist[h[j+1]])//If the node is > left child\r\n {\r\n ++j;//Increment child \r\n }\r\n if(dist[v] <= dist[h[j]])//If the parent is greater than the child\r\n {\r\n break;//Stop the system\r\n }\r\n h[k] = h[j];//If the parent is greater than the child, child is given parent pos\r\n\t\t\thPos[h[k]] = k;//Update pos of last child\r\n k=j;//Assign a new vertex pos\r\n }\r\n h[k] = v; //assign vertex for heap \r\n hPos[v] = k;//Update the vertex in hPos\r\n\t\t\r\n // code yourself --\r\n // must use hPos[] and dist[] arrays\r\n }" ]
[ "0.8323239", "0.81915677", "0.81697416", "0.80998695", "0.7972523", "0.7385646", "0.7248575", "0.6947995", "0.65006405", "0.6377008", "0.63007474", "0.6286045", "0.626273", "0.6238575", "0.62145036", "0.6122783", "0.61179596", "0.6053552", "0.60104644", "0.59734064", "0.5937779", "0.58918923", "0.5888818", "0.57928896", "0.57186985", "0.57180816", "0.5677189", "0.5648707", "0.5644493", "0.5639757", "0.5624081", "0.556484", "0.55500436", "0.5532153", "0.55112624", "0.54955095", "0.5486157", "0.5421407", "0.5416977", "0.53837144", "0.53676575", "0.5362505", "0.5362357", "0.5321001", "0.5262433", "0.5258039", "0.52443486", "0.5241775", "0.52209336", "0.52118766", "0.52112573", "0.5209566", "0.52004075", "0.51847804", "0.51816636", "0.5172731", "0.5162533", "0.5157936", "0.51527566", "0.51511854", "0.5145627", "0.51315725", "0.51301503", "0.5124315", "0.51065636", "0.51059675", "0.510532", "0.509401", "0.5093612", "0.50891525", "0.50872314", "0.5083041", "0.50811845", "0.5080664", "0.5054098", "0.50427103", "0.50277364", "0.502632", "0.50088805", "0.5001659", "0.4994112", "0.49880826", "0.4979266", "0.4975085", "0.4968766", "0.4960432", "0.4960017", "0.49446607", "0.49430954", "0.494254", "0.49408376", "0.49141896", "0.49085942", "0.49023318", "0.48784852", "0.48643184", "0.48533756", "0.4851296", "0.48504132", "0.48434463" ]
0.79902047
4
Reverse alternating Kelement Sublist (medium) / Reverses alternate k nodes and returns the pointer to the new head node
ListNode kAltReverse(ListNode head, int k) { ListNode curr = head, next = null, prev = null; int count = 0; /*1) LL Revese Alg: reverse first k nodes of the linked list */ while (curr != null && count < k) { next = curr.next; curr.next = prev; prev = curr; curr = next; count++; } /* 2) Now head points to the kth node. So change next of head to (k+1)th node*/ if (head != null) { head.next = curr; } /* 3) We do not want to reverse next k nodes. So move the curr pointer to skip next k nodes */ count = 0; while (count < k - 1 && curr != null) { curr = curr.next; count++; } /* 4) Recursively call for the list starting from curr->next. And make rest of the list as next of first node */ if (curr != null) { curr.next = kAltReverse(curr.next, k); } /* 5) prev is new head of the input list */ return prev; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static ListNode reverse(ListNode head, int k) {\n\t\tListNode curr = head;\n\t\tListNode prev = null;\n\t\twhile (true) {\n\t\t\tListNode prevLast = prev; // null for head,1 for 4,5,6\n\t\t\tListNode first = curr;\n\n\t\t\t// reversing\n\t\t\tprev = null;\n\t\t\tfor (int i = 0; i < k && curr != null; i++) {\n\t\t\t\tListNode temp = curr.next;\n\t\t\t\tcurr.next = prev;\n\t\t\t\tprev = curr;\n\t\t\t\tcurr = temp;\n\t\t\t}\n\n\t\t\t// setting prevElement next pointer\n\t\t\tif (prevLast == null) {\n\t\t\t\thead = prev;\n\n\t\t\t} else {\n\t\t\t\tprevLast.next = prev;\n\t\t\t}\n\n\t\t\tif (curr == null)\n\t\t\t\tbreak;\n\n\t\t\tprev = first;\n\n\t\t}\n\n\t\treturn head;\n\n\t}", "public Node reverse(Node headNode, int k) {\n\n Node currNode = headNode;\n Node next = null;\n Node prev = null;\n\n int count = 0;\n\n /* reverse first k nodes of the linked list */\n while (currNode != null && count < k) {\n next = currNode.getNextNode();\n currNode.setNextNode(prev);\n prev = currNode;\n currNode = next;\n count++;\n }\n if (next != null) {\n headNode.setNextNode(reverse(next, k));\n }\n\n return prev;\n }", "private ListNode kthNodeInReverseOrder(ListNode head, int k) {\n if (k == 0 || head == null) {\n return head;\n }\n\n ListNode node = head;\n for (int i = 1; i <= k-1; i++) {\n if (node.next != null) {\n node = node.next;\n } else {\n return null;\n }\n }\n\n ListNode kthNodeInReverse = head;\n\n while (node.next != null) {\n kthNodeInReverse = kthNodeInReverse.next;\n node = node.next;\n }\n\n return kthNodeInReverse;\n }", "public ListNode reverseKGroup(ListNode head, int k) {\n if(head == null || head.next == null || k < 2)\n return head;\n \n ListNode dummy = new ListNode(0);\n ListNode curr = dummy;\n ListNode tail = head;\n int count = 0;\n while(head != null) {\n count++;\n if(count == k) {\n // Reverse nodes \n // Store location of head next\n // Store location of rear, this will be used to know where to continue next\n ListNode temp = head.next;\n ListNode last = tail;\n \n // Move pointers around to reverse the nodes\n ListNode next = tail;\n while(next != temp) {\n ListNode prev = tail;\n tail = next == tail ? tail.next : next;\n next = tail.next;\n tail.next = prev;\n }\n curr.next = head;\n curr = last;\n head = temp;\n tail = temp;\n count = 0;\n }\n else {\n head = head.next;\n }\n }\n curr.next = tail;\n return dummy.next;\n }", "public static ListNode reverseKGroup(ListNode head, int k) {\n\t\tListNode runner = head;\n\t\tint counter = 0;\n\t\twhile(runner != null){\n\t\t\trunner = runner.next;\n\t\t\tcounter++;\n\t\t}\n\t\tif(counter < k){return head;}\n\t\t\n\t\t// reverse first k nodes\n\t\tListNode dummy = new ListNode(0);\n\t\tdummy.next = head;\n\t\t\n\t\tListNode oriHead = head;\n\t\tListNode prev = null;\n\t\t\n\t\tfor(int i=0; i<k; i++){\n\t\t\tListNode temp = head.next;\n\t\t\thead.next = prev;\n\t\t\tprev = head;\n\t\t\thead = temp;\n\t\t}\n\t\t\n\t\t// append rest nodes by recur\n\t\tdummy.next = prev;\n\t\toriHead.next = reverseKGroup(head, k);\n\t\t\n\t\treturn dummy.next;\n\t\n\t}", "public MyListNode reverseKGroup(MyListNode head, int k) {\n if (k == 1)\n return head;\n MyListNode H = new MyListNode(0);\n H.next = head;\n MyListNode q = H;\n for (MyListNode p = head; p != null; p = p.next) {\n p = reverseK(q, k);\n if (p == null)\n break;\n q = p;\n }\n return H.next;\n }", "public void reverseDi() {\n int hi = size - 1;\n int lo = 0;\n\n while (lo < hi) {\n Node left = getNodeAt(lo);\n Node right = getNodeAt(hi);\n\n Object temp = left.data;\n left.data = right.data;\n right.data = temp;\n\n lo++;\n hi--;\n }\n }", "public ListNode reverseKGroup(ListNode head, int k) {\n if(head==null || head.next==null || k==0)\n return head;\n ListNode left = head;\n ListNode right = head;\n int count = 1;\n while(count<=k && right!=null){\n right = right.next;\n count++;\n }\n if(count-1!=k && right==null)\n return left;\n ListNode pre = null;\n ListNode cur = left;\n while(cur!=right){\n ListNode next = cur.next;\n cur.next = pre;\n pre = cur;\n cur = next;\n }\n left.next = reverseKGroup(cur, k);\n return pre;\n }", "public ListNode reverseKGroup(ListNode head, int k) {\n int len = getLength(head);\n ListNode dummy = new ListNode(-1);\n dummy.next = head;\n ListNode prepare = dummy;\n\n for (int i = 0; i <= len - k; i = i + k) {\n prepare = reverse(prepare, k);\n }\n return dummy.next;\n }", "public static ListNode swapNodes2(ListNode head, int k) {\n ListNode KthFromStart = head, out = head, KthFromLast = head;\n for (int i = 1; i < k; i++) {\n KthFromStart = KthFromStart.next;\n }\n ListNode temp_Node = KthFromStart;\n while (temp_Node.next != null) {\n temp_Node = temp_Node.next;\n KthFromLast = KthFromLast.next;\n }\n int temp = KthFromLast.val;\n KthFromLast.val = KthFromStart.val;\n KthFromStart.val = temp;\n return out;\n }", "public void reverse() {\n\t\t// write you code for reverse using the specifications above\t\t\n\t\tNode nodeRef = head;\n\t\thead = null;\n\t\t\n\t\twhile(nodeRef != null) {\n\t\t\tNode tmp = nodeRef;\n\t\t\tnodeRef = nodeRef.next;\n\t\t\ttmp.next = head;\n\t\t\thead = tmp;\n\t\t}\n\t}", "public ListNode reverseKGroup(ListNode head, int k) {\r\n\t\tif (head == null) return head;\r\n\t\tint count = 0;\r\n\t\tListNode curr = head, prev = null, next = null;\r\n\t\t// Find the k+1 node\r\n\t\twhile (count != k && curr != null) {\r\n\t\t\tcurr = curr.next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\r\n\t\tif (count != k) return head;\r\n\t\t// reverse list with k+1 node as head\r\n\t\tprev = reverseKGroup(curr, k);\r\n\t\t// LL Reversal Alg: reverse current k-group from head ptr\r\n\t\twhile (count-- > 0) {\r\n\t\t\tnext = head.next;\r\n\t\t\thead.next = prev;\r\n\t\t\tprev = head;\r\n\t\t\thead = next;\r\n\t\t}\r\n\t\treturn prev;\r\n\t}", "private static Node reverseList(Node start) {\n Node runner = start;\n // initialize the return value\n Node rev = null;\n // set the runner to the last item in the list\n while (runner != null) {\n Node next = new Node(runner.value);\n next.next = rev;\n rev = next;\n runner = runner.next;\n }\n return rev;\n }", "public Node reverseMe(Node head) {\n Node current = head;\n Node prev = null;\n while (current != null) {\n Node next = current.next;\n current.next = prev;\n prev = current;\n current = next;\n }\n head = prev;\n return head;\n }", "public static ListNode reverseList2(ListNode head) {\n ListNode n = head;\n ListNode p = null;\n ListNode q = null;\n while (n != null) {\n p = q;\n q = n;\n n = n.next;\n q.next = p;\n }\n return q;\n }", "Node Reverse(Node head) {\n Node p = null;\n Node q = head;\n Node r = null;\n while(q!=null) {\n r = q.next;\n q.next = p;\n p = q;\n q = r;\n }\n head = p;\n return head;\n}", "public ListNode rotateRight(ListNode head, int k) {\n \tif (head == null || k == 0 || head.next == null)\n \t\treturn head;\n \tint size = 1;\n \tListNode curr = head,end=head;\n \tListNode newHead = new ListNode(0);\n \twhile (end.next != null){\n \t\tend = end.next;\n \t\tsize++;\n \t}\n \tif (k%size == 0)\n\t return head;\n \tint start = 1;\n \twhile(start < size - k%size){\n \t\tcurr = curr.next;\n \t\tstart++;\n \t}\n \tnewHead.next = curr.next;\n \tcurr.next = null;\n \tend.next = head;\n \treturn newHead.next;\n }", "Node nthToLast(int k) {\n Node p1 = head;\n Node p2 = head;\n for (int i = 0; i < k; i++) {\n if (p1 == null) return null;\n p1 = p1.getNext();\n }\n\n while (p1 != null) {\n p1 = p1.getNext();\n p2 = p2.getNext();\n }\n return p2;\n }", "Node reverse(Node head) {\n\n\t\t// Write your code here\n\t\tNode curr = head;\n\t\tNode prev = null;\n\t\twhile (curr != null) {\n\t\t\twhile (curr != null && curr.data % 2 != 0) {\n\t\t\t\tprev = curr;\n\t\t\t\tcurr = curr.next;\n\t\t\t}\n\t\t\tif (curr != null && curr.data % 2 == 0) {\n\t\t\t\tif (prev != null) {\n\t\t\t\t\tprev.next = reverseHelper(curr);\n\t\t\t\t} else {\n\t\t\t\t\thead = reverseHelper(curr);\n\t\t\t\t}\n\t\t\t\tcurr = curr.next;\n\t\t\t}\n\t\t}\n\t\treturn head;\n\t}", "public void reverse() {\n var previous = first;\n var current = first.next;\n\n last = first;\n last.next = null;\n while (current != null) {\n var next = current.next;\n current.next = previous;\n previous = current;\n current = next;\n\n }\n first = previous;\n\n }", "private static SLLNode removeKthLast(SLLNode node, int k) {\n\n if (node == null) {\n throw new IllegalArgumentException(\"Node is empty\");\n }\n\n SLLNode first = node;\n while (k + 1 > 0) {\n first = first.next;\n k = k - 1;\n }\n\n SLLNode second = node;\n while (first != null) {\n second = second.next;\n first = first.next;\n }\n\n if (second != null && second.next != null) {\n second.next = second.next.next;\n }\n return node;\n }", "public void _reverse() {\n\n var prev = first;\n var current = first.next;\n last = first;\n last.next = null;\n while (current != null) {\n var next = current.next;\n current.next = prev;\n prev = current;\n current = next;\n\n }\n first = prev;\n\n }", "Node reverseIterative(Node head) {\n\t\tNode prev = null;\n\t\tNode current = head;\n\t\tNode next = null;\n\t\twhile (current != null) {\n\t\t\tnext = current.next;\n\t\t\tcurrent.next = prev;\n\t\t\tprev = current;\n\t\t\tcurrent = next;\n\t\t}\n\t\thead = prev;\n\t\treturn head;\n\t}", "public DoubleLinkedSeq reverse(){\r\n\t DoubleLinkedSeq rev = new DoubleLinkedSeq();\r\n\t for(cursor = head; cursor != null; cursor = cursor.getLink()){\r\n\t\t rev.addBefore(this.getCurrent());\r\n\t }\r\n\t \r\n\t return rev; \r\n }", "private Node reverseLinkedlisthelper(Node current){\n\t\tif (current.next == null){\n\t\t\tthis.head = current; // new head end of list\n\t\t\treturn current;\n\t\t}\n\t\tNode ptr_ahead = reverseLinkedlisthelper(current.next); // get to end of list\n\t\tptr_ahead.next = current;\n\t\treturn current;\n\n\n\t\t// TAIL RECURSION similar to for loop and iterative method i did above!! nothing is done coming back from recursive stack!\n\t}", "private static Node reverseLinkedList(Node head) {\n\t\t \n\t\tNode prev = null;\n\t\tNode next = null;\n\t\t\n\t\t// check boundary condition\n\t\tif(head ==null)\n\t\t\t\n\t\t\t\n\t\t\treturn head;\n\t\t\n\t\tnext = head.rightSibling;\n\t\twhile(next!=null) {\n\t\t\t// point current node backwards\n\t\t\thead.rightSibling = prev;\n\t\t\t\n\t\t\t// move all three pointers ahead\n\t\t\tprev = head;\n\t\t\thead = next;\n\t\t\tnext = next.rightSibling;\n\t\t}\n\t\t\n\t\t// Point last node backwards\n\t\thead.rightSibling = prev;\n\t\treturn head;\n\t}", "public Node reverserLinkedList(Node head){\n // size == 0\n if(head == null){\n return null;\n }\n // size == 1\n if(head.getNext() == null){\n return head;\n }\n\n Node newHead = reverserLinkedList(head.getNext());\n head.getNext().setNext(head);\n head.setNext(null);\n return newHead;\n }", "public void reverse()\n\t{\n\t\tSinglyLinkedListNode nextNode = head;\n\t\tSinglyLinkedListNode prevNode = null;\n\t\tSinglyLinkedListNode prevPrevNode = null;\n\t\twhile(head != null)\n\t\t{\n\t\t\tprevPrevNode = prevNode;\n\t\t\tprevNode = nextNode;\n\t\t\tnextNode = prevNode.getNext();\n\t\t\tprevNode.setNext(prevPrevNode);\n\t\t\tif(nextNode == null)\n\t\t\t{\n\t\t\t\thead = prevNode;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public static ListNode swapNodes(ListNode head, int k) {\n if(head == null || head.next == null){\n return head;\n }\n ListNode tail = head;\n int begin = k;\n int len = 0;\n int index = 1;\n Map<Integer,Integer> map = new HashMap<>();\n while(tail != null){\n len++;\n map.put(index++,tail.val);\n tail = tail.next;\n }\n int end = len - k + 1;\n tail = head;\n index = 1;\n while(tail != null){\n if(index == begin){\n tail.val = map.get(end);\n }\n if(index == end){\n tail.val = map.get(begin);\n }\n index++;\n tail = tail.next;\n }\n return head;\n }", "public static Nodelink rotate(Nodelink node, int k){ 1 2 3 4 5\n //\n\n Nodelink head = node;\n Nodelink temp = null;\n Nodelink temp2 = null;\n\n for(int i = 0; i < k; i++){\n while(node != null){\n\n temp = node;\n temp2 = node.next;\n\n node.next = temp;\n\n\n node = node.next;\n\n }\n\n head = node;\n }\n\n\n return head;\n }", "public static void removeKthToLast(Node head, int k) {\n if (head == null) return;\n if (k <= 0) return;\n\n Node first = head;\n Node second = head;\n int i = 0;\n while (i < k) {\n if (first == null) return;\n first = first.next;\n i++;\n }\n\n while (first != null) {\n first = first.next;\n second = second.next;\n }\n Node next = second.next;\n if (next == null) {\n second.next = null;\n } else {\n second.data = next.data;\n second.next = next.next;\n }\n }", "void reverseList(){\n\n Node prev = null;\n Node next = null;\n Node iter = this.head;\n\n while(iter != null)\n {\n next = iter.next;\n iter.next = prev;\n prev = iter;\n iter = next;\n\n }\n\n //prev is the link to the head of the new list\n this.head = prev;\n\n }", "public static ListNode reverseList(ListNode head) {\n ListNode h = head;\n ListNode n = h;\n ListNode p = null;\n ListNode rev = new ListNode(0);\n ListNode cur = rev;\n \n while (n != null) {\n p = n;\n n = n.next;\n if (n == null) {\n cur.next = new ListNode(p.val);\n head = rev.next;\n } else if (n.next == null) {\n cur.next = new ListNode(n.val);\n cur = cur.next;\n p.next = null;\n n = h;\n }\n }\n return head; \n }", "@Override\n\tpublic IDnaStrand reverse() {\n\t\tLinkStrand reversed = new LinkStrand();\n\t\tNode current = new Node(null);\n\t\tcurrent = myFirst;\n\t\t\n\t\twhile (current != null) {\n\t\t\t\n\t\t\tStringBuilder copy = new StringBuilder(current.info);\n\t\t\tcopy.reverse();\n\t\t\tNode first = new Node(copy.toString());\n\t\t\t\n\t\t\tfirst.next = reversed.myFirst;\n\t\t\tif (reversed.myLast == null) {\n\t\t\t\treversed.myLast = reversed.myFirst;\n\t\t\t\treversed.myLast.next = null;\n\t\t\t\t\n\t\t\t}\n\t\t\treversed.myFirst = first;\n\t\t\treversed.mySize += copy.length();\n\t\t\treversed.myAppends ++;\n\t\t\t\n\t\t\t\n\t\t\tcurrent = current.next;\n\t\t\t\n\t\t}\n\t\treturn reversed;\n\t}", "public void reverse() {\n\t\tNode<E> temp = null;\n\t\tNode<E> n = root;\n\n\t\twhile (n != null) {\n\t\t\ttemp = n.getBefore();\n\t\t\tn.setBefore(n.getNext());\n\t\t\tn.setNext(temp);\n\t\t\tn = n.getBefore();\n\t\t}\n\n\t\ttemp = root;\n\t\troot = tail;\n\t\ttail = temp;\n\t}", "static int reverseRecursiveTravesal(Node node, int k) {\n\t\tif(node == null)\n\t\t\treturn -1;\n\t\t\n\t\tint indexFromLast = reverseRecursiveTravesal(node.getNext(), k) + 1;\n\t\tif(indexFromLast == k) \n\t\t\tSystem.out.println(node.getData());\n\t\t\n\t\treturn indexFromLast;\n\t\t\n\t}", "public void reverse() {\n\t\t\n\t\tif(isEmpty()==false){\n\t\t\tDoubleNode left=head, right=tail;\n\t\t\tchar temp;\n\t\t\twhile(left!=right&&right!=left.getPrev()){\n\t\t\t\ttemp=left.getC();\n\t\t\t\tleft.setC(right.getC());\n\t\t\t\tright.setC(temp);\n\t\t\t\tleft=left.getNext();\n\t\t\t\tright=right.getPrev();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void reverse(){\n\n\n SNode reverse =null;\n\n while(head != null) {\n\n SNode next= head.next;\n head.next=reverse;\n reverse = head;\n\n head=next;\n\n\n }\n head=reverse; // set head to reverse node. it mean next node was null and head should be previous node.\n\n\n }", "public void reverse() {\n\n\t\tif (head == null) {\n\t\t\tSystem.out.println(\"List is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tint nodes = nodeCounter();\n\t\tDLNode t = tail.prev;\n\t\thead = tail;\n\t\tfor (int i = 0; i < nodes - 1; i++) {\n\n\t\t\tif (t.list == null && t.val != Integer.MIN_VALUE) {\n\t\t\t\tthis.reverseHelperVal(t.val);\n\t\t\t\tt = t.prev;\n\t\t\t} else {\n\t\t\t\tthis.reverseHelperList(t.list);\n\t\t\t\tt = t.prev;\n\t\t\t}\n\t\t}\n\t\ttail.next = null;\n\t\thead.prev = null;\n\n\t}", "public ListNode reverseList(ListNode head) {\n if (head == null) {\n return null;\n }\n ListNode newHead = new ListNode(1);\n ListNode p = head;\n ListNode q = null;\n while(p != null) {\n q = p.next;\n p.next = newHead.next;\n newHead.next = p;\n p = q;\n }\n\n return newHead.next;\n }", "private void reverse(ListNode startNode, ListNode endNode) {\n endNode.next = null;\n ListNode pre = startNode, cur = startNode.next, newEnd = pre;\n while (cur != null) {\n ListNode nextNode = cur.next;\n cur.next = pre;\n pre = cur;\n cur = nextNode;\n }\n }", "public ListNode reverseList(ListNode head) {\n\n ListNode prev = null;\n ListNode curr = head;\n while( curr!=null){\n ListNode next = curr.next;\n curr.next= prev;\n prev = curr;\n curr = next;\n }\n return prev;\n }", "public Node updateList(Node head,int size) {\r\n\t\t Node temp=head;\r\n\t\t Stack<Integer> stack = new Stack<Integer>();\t//Stack for storing the linklist in order to get elements in reverse order\r\n\t\t \r\n\t\t for(int i=0;i<size;i++){\r\n\t\t \tstack.push(temp.data);\t\t//pushing elements in stack\r\n\t\t \ttemp=temp.next;\r\n\t\t }\r\n\t\t temp=head;\r\n\t\t for(int i=0;i<size/2;i++){\t\t//popping elements in reverse order\r\n\t\t \tint val=stack.pop();\r\n\t\t \ttemp.data=temp.data - val;\r\n\t\t \ttemp=temp.next;\r\n\t\t }\r\n\t\t return head;\r\n\t }", "public int kToTheEnd(int k) {\n\n if(k<1 || k > this.size())\n return 0;\n\n Node p1=head, p2=head;\n\n for(int i=0; i<k; i++) {\n p2=p2.next;\n }\n\n while(null!=p2.next) {\n p1=p1.next;\n p2=p2.next;\n }\n\n print(\"k to end, k:\" + k + \" data: \" + p1.data);\n return p1.data;\n\n }", "public ListNode SolveUsingAdditionalLinkedList(ListNode head, int k)\n {\n // Edge cases\n if (head == null)\n return null;\n if (k == 0)\n return head;\n\n // Create blank list to store new result\n ListNode result = new ListNode(-1, null);\n\n // Find the length of the list\n int listLength = FindLength(head);\n\n // Calculate the actual number of rotations (since k can be greater than list length)\n int numberOfRotations = k >= listLength? k % listLength : k;\n\n // Another edge case - may not need to rotate at all\n if (listLength == 1 || numberOfRotations == 0)\n return head;\n\n // Iterate through list until we get to the numbers that need to be moved to beginning...\n int counter = listLength - numberOfRotations;\n ListNode temp = head;\n while (counter != 0)\n {\n temp = temp.next;\n counter -= 1;\n }\n\n // ... Then add the rotated numbers to list\n while (temp != null)\n {\n AddLast(result, temp.val);\n temp = temp.next;\n }\n\n // Lastly, reset counters and add the remaining numbers to the back\n counter = listLength - numberOfRotations;\n temp = head;\n while (counter != 0)\n {\n AddLast(result, temp.val);\n temp = temp.next;\n counter -= 1;\n }\n\n // Since result is dummy node, return result.next\n return result.next;\n }", "public int getKthNodeFromEnd(int k){\n // [10 -> 20 -> 30 -> 40 -> 50]\n // k = 1(50) dist = 0;\n // k = 2(40) dist = 1\n\n if(isEmpty()) throw new IllegalStateException();\n\n int distance = k - 1;\n var pointerOne = first;\n var pointerSecond = first;\n\n for(int i = 0; i < distance; i++){\n if(pointerSecond.next != null)\n pointerSecond = pointerSecond.next;\n else\n throw new IllegalArgumentException();\n }\n\n while(pointerSecond.next != null){\n pointerOne = pointerOne.next;\n pointerSecond = pointerSecond.next;\n }\n\n return pointerOne.value;\n }", "public ListNode reverse(ListNode head) {\n if(head == null || head.next == null){\n return head;\n }\n ListNode curr = head;\n ListNode newHead = reverse(curr.next);\n curr.next.next = curr;\n curr.next = null;\n return newHead;\n }", "public ListNode rotateRight(ListNode head, int k) {\r\n\t\tint size = listSize(head);\r\n\t\tif (head == null || k <= 0 || k == size) return head;\r\n\t\tif (k > size) k %= size;\r\n\t\tint count = 1;\r\n\t\tListNode curr = head;\r\n\t\tk = size - k;\r\n\t\twhile (count < k && curr != null) {\r\n\t\t\tcurr = curr.next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tListNode nextHead = curr;\r\n\t\twhile (curr.next != null)\r\n\t\t\tcurr = curr.next;\r\n\t\tcurr.next = head;\r\n\t\thead = nextHead.next;\r\n\t\tnextHead.next = null;\r\n\t\treturn head;\r\n\t}", "public ListNode reverseList(ListNode head) {\n return recursionVersion2_3rdTime(head);\n }", "public ListNode SolveByMovingPointers(ListNode head, int k)\n {\n // Edge cases\n if (head == null)\n return null;\n if (k == 0)\n return head;\n\n // Calculate list length + actual number of rotations\n int listLength = FindLength(head);\n int numberOfRotations = k >= listLength? k % listLength : k;\n\n // Another edge case - may not need to rotate at all\n if (listLength == 1 || numberOfRotations == 0)\n return head;\n\n // Iterate to the node before the node with number that needs to be rotated to beginning...\n ListNode oldHeadIterator = head;\n int counter = listLength - numberOfRotations - 1;\n while (counter != 0)\n {\n counter -= 1;\n oldHeadIterator = oldHeadIterator.next;\n }\n\n // ... Then make the following node be the beginning of new head + nullify tail of old head\n ListNode newHead = oldHeadIterator.next;\n oldHeadIterator.next = null;\n\n // Iterate to end of the new head, then simply add the old head contents to the tail\n ListNode newHeadIterator = newHead;\n while (newHeadIterator.next != null)\n newHeadIterator = newHeadIterator.next;\n newHeadIterator.next = head;\n\n return newHead;\n }", "LinkedListDemo reverse() {\n\t\tListNode rev = null; // rev will be the reversed list.\n\t\tListNode current = getHead(); // For running through the nodes of list.\n\t\twhile (current != null) {\n\t\t\t// construct a new node\n\t\t\tListNode newNode = new ListNode();\n\t\t\t// copy the data to new node from runner\n\t\t\tnewNode.data = current.data;\n\t\t\t// \"Push\" the next node of list onto the front of rev.\n\t\t\tnewNode.next = rev;\n\t\t\trev = newNode;\n\t\t\t// Move on to the next node in the list.\n\t\t\tcurrent = current.next;\n\t\t}\n\t\treturn new LinkedListDemo(rev);\n\t}", "public MyLinkedList reverse() {\r\n\t\tif (this.isEmpty()) {\r\n\t\t\tSystem.out.println(\"the empty linked list leads to a failure of reversion\");\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\tStack<Node> stack = new Stack<Node>();\r\n\t\tpointer = head;\r\n\t\twhile (pointer != null) {\r\n\t\t\tstack.push(pointer);\r\n\t\t\tpointer = pointer.getNext();\r\n\t\t}\r\n\t\tMyLinkedList temp = new MyLinkedList();\r\n\t\twhile (stack.size() > 0) {\r\n\t\t\tNode node = stack.pop();\r\n\t\t\t//Original mappings have to be reset \r\n\t\t\tnode.setNext(null);\r\n\t\t\ttemp.add(node);\r\n\t\t}\r\n\t\treturn temp;\r\n\t}", "private void doubleDemoteright (WAVLNode z) {\n\t z.rank--;\r\n\t z.left.rank--;\r\n }", "public ListNode reverse(ListNode head){\n if(head == null || head.next == null) return head;\n\n ListNode curr = head, prev = null;\n\n while(curr != null){\n ListNode temp = curr.next;\n curr.next = prev;\n prev = curr;\n curr = temp;\n }\n\n return prev;\n }", "public static void main(String[] args) {\n\n\n Node head = MyList.getList();\n MyList.printList(head);\n\n System.out.println(\"After Reverse\");\n head = reverseAlternateKNodes(head, 3);\n System.out.println(\"Reversed\");\n MyList.printList(head);\n\n }", "public /*@ non_null @*/ JMLListEqualsNode<E> reverse() {\n JMLListEqualsNode<E> ptr = this;\n JMLListEqualsNode<E> ret = null;\n //@ loop_invariant ptr != this ==> ret != null;\n //@ maintaining (* ret is the reverse of items in this up to ptr *);\n while (ptr != null) {\n //@ assume ptr.val != null ==> \\typeof(ptr.val) <: elementType;\n ret = new JMLListEqualsNode<E>(ptr.val == null ? null\n : (ptr.val) ,\n ret);\n ptr = ptr.next;\n }\n //@ assert ptr == null && ret != null;\n //@ assume elementType == ret.elementType;\n //@ assume containsNull <==> ret.containsNull;\n return ret;\n }", "private static SingleLinkedNode findFromEnd(SinglyLinkedList sll, int k) {\n\t\tSingleLinkedNode fast = sll.getHead();\r\n\t\tSingleLinkedNode slow = fast;\r\n\t\tint count = 1;\r\n\t\twhile (fast != null && count < k) {\r\n\t\t\tfast = fast.getNext();\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tif (fast == null) {\r\n\t\t\treturn null; // not enough elements.\r\n\t\t}\r\n\t\tif (fast.getNext() == null) {\r\n\t\t\t// remove 1st element.\r\n\t\t\tsll.setHead(slow.getNext());\r\n\t\t\treturn slow;\r\n\t\t}\r\n\t\t// Now slow and fast are k elements apart.\r\n\t\t// look 2 ahead so we can remove the element\r\n\t\twhile (fast.getNext().getNext() != null) {\r\n\t\t\tfast = fast.getNext();\r\n\t\t\tslow = slow.getNext();\r\n\t\t}\r\n\t\tfast = slow.getNext(); // temp pointer\r\n\t\tslow.setNext(slow.getNext().getNext());\r\n\t\treturn fast;\r\n\t\t\r\n\t}", "public static ListNode reverse(ListNode head) {\n if (head == null || head.next == null)\n return head;\n\n ListNode prev = null, curr = head;\n while (curr != null) {\n ListNode forw = curr.next; // backup\n\n curr.next = prev; // link\n\n prev = curr; // move\n curr = forw;\n }\n\n return prev;\n }", "Node reversedLinkedList(Node oldList) {\n Node newList = null;\n while (oldList != null) {\n\tNode element = oldList;\n\toldList = oldList.next;\n\telement.next = newList;\n\tnewList = element;\n }\n return newList;\n}", "public ListNode reverse(ListNode head) {\n if(head == null || head.next == null) {\n return head;\n }\n ListNode prev = null;\n while(head != null) {\n ListNode temp = head.next;\n head.next = prev;\n prev = head;\n head = temp;\n }\n //head.next = null;\n return prev;\n }", "private ListNode reverseList(ListNode head) {\n if (head == null || head.next == null) {\n return head;\n }\n\n ListNode now = head;\n ListNode next = now.next;\n ListNode prev = null;\n\n while (next != null) {\n now.next = prev;\n\n // move to next node\n prev = now;\n now = next;\n next = next.next;\n }\n now.next = prev;\n return now;\n }", "private ListNode reverseList(ListNode head) {\r\n\t\tif (head == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tListNode previous = null;\r\n\t\tListNode current = head;\r\n\t\twhile (current != null) {\r\n\t\t\tListNode next = current.next;\r\n\t\t\tcurrent.next = previous;\r\n\t\t\tprevious = current;\r\n\t\t\tcurrent = next;\r\n\t\t}\r\n\t\thead = previous;\r\n\t\treturn head;\r\n\t}", "public ListNode reverse(ListNode head){\n\t\t\n\t\tif (head == NULL || head.next == NULL)\n\t\treturn; //empty or just one node in list\n\n\t\tListNode Second = head.next;\n\t\n\t\t//store third node before we change \n\t\tListNode Third = Second.next; \n\n\t\t//Second's next pointer\n\t\tSecond.next = head; //second now points to head\n\t\thead.next = NULL; //change head pointer to NULL\n\n\t\t//only two nodes, which we already reversed\n\t\tif (Third == NULL) return; \n\n\t\tListNode CurrentNode = Third;\n\n\t\tListNode PreviousNode = Second;\n\n\t\twhile (CurrentNode != NULL){\n\t\t\tListNode NextNode = CurrentNode.next;\n\n\t\t\tCurrentNode.next = PreviousNode;\n\n\t\t\t/* repeat the process, but have to reset\n\t \t\tthe PreviousNode and CurrentNode\n\t\t\t*/\n\n\t\t\tPreviousNode = CurrentNode;\n\t\t\tCurrentNode = NextNode; \n\t\t}\n\n\t\t\thead = PreviousNode; //reset the head node\n\t\t}", "public void reverse() {\n\t\tNode previous = first;\n\t\tNode current = first.next;\n\n\t\twhile (current != null) {\n\t\t\tNode next = current.next;\n\t\t\tcurrent.next = previous;\n\n\t\t\tprevious = current;\n\t\t\tcurrent = next;\n\t\t}\n\t\tlast = first;\n\t\tlast.next = null;\n\t\tfirst = previous;\n\t}", "public ListNode reverse(ListNode head) {\n if(head == null || head.next == null){\n return head;\n }\n ListNode prev = head;\n ListNode cur = head.next;\n prev.next = null;\n while(cur.next != null){\n ListNode nextNode = cur.next;\n cur.next = prev;\n prev = cur;\n cur = nextNode;\n }\n cur.next = prev;\n return cur;\n }", "private void doubleDemoteLeft (WAVLNode z) {\n\t z.rank--;\r\n\t z.right.rank--;\r\n }", "static public ListNode reorder(ListNode head) {\n\t\tif (head == null || head.next == null) {\n\t\t\treturn head;\n\t\t}\n\t\tListNode one = head;\n\t\tListNode mid = findMidle(head);\n\t\tSystem.out.println(\"mid: \"+ mid.val);\n\t\tListNode two = reverse(mid.next);\n\t\tmid.next = null;\n\t\tListNodeUtils.printList(head);\n\t\tListNodeUtils.printList(two);\n\t\tListNode curr = one;\n\t\twhile (one != null && two != null) {\n\t\t\tone = one.next;\n\t\t\tcurr.next = two;\n\t\t\tcurr = curr.next;\n\n\t\t\ttwo = two.next;\n\t\t\tcurr.next = one;\n\t\t\tcurr = curr.next;\n\t\t}\n\t\tif (one != null) {\n\t\t\tcurr.next = null;\n//\t\t curr = curr.next; \n\t\t}\n\n\t\t// curr.next = null;\n\t\treturn head;\n\t}", "Digraph reverse() {\n return null;\n }", "public Node<T> reverse() {\n Node<T> reverse = null;\n if (First == null) {\n return reverse;\n }\n Node<T> firstNode = First;\n Node<T> secondNode = First.next;\n\n while (firstNode != null) {\n //basic operation\n firstNode.next = reverse;\n reverse = firstNode;\n\n if (secondNode == null) {\n //this is the last node needs to be moved\n firstNode = secondNode;\n } else {\n firstNode = secondNode;\n secondNode = secondNode.next;\n }\n }\n return reverse;\n }", "public static void main(String[] args) {\n\t\tKthReverseLinkedList rll = new KthReverseLinkedList();\r\n\t\tReverseLinkedList rl = new ReverseLinkedList();\r\n\t\tNode node = rl.new Node();\r\n\t\tnode.data = 'a';\r\n\t\tnode.link = rl.new Node();\r\n\t\tnode.link.data = 'b';\r\n\t\tnode.link.link = rl.new Node();\r\n\t\tnode.link.link.data = 'c';\r\n\t\tnode.link.link.link = rl.new Node();\r\n\t\tnode.link.link.link.data = 'd';\r\n\t\tnode.link.link.link.link = rl.new Node();\r\n\t\tnode.link.link.link.link.data = 'e';\r\n\t\tnode.link.link.link.link.link = rl.new Node();\r\n\t\tnode.link.link.link.link.link.data = 'f';\r\n\t\tnode.link.link.link.link.link.link = rl.new Node();\r\n\t\tnode.link.link.link.link.link.link.data = 'g';\r\n\t\tnode.link.link.link.link.link.link.link = rl.new Node();\r\n\t\tnode.link.link.link.link.link.link.link.data = 'h';\r\n\t\trl.printNode(node);\r\n\t\tnode = rll.kthReverse(node, 3);\r\n\t\trl.printNode(node);\r\n\r\n\t}", "public ListNode reverseList1(ListNode head) {\r\n\t\tListNode curr = head, next, prev = null;\r\n\t\twhile (curr != null) {\r\n\t\t\tnext = curr.next;\r\n\t\t\tcurr.next = prev;\r\n\t\t\tprev = curr;\r\n\t\t\tcurr = next;\r\n\t\t}\r\n\t\treturn prev;\r\n\t}", "public ListNode reverseListIter(ListNode head) {\n\t\tif (head == null || head.next == null) {\n\t\t\treturn head;\n\t\t}\n\n\t\tListNode start = head;\n\t\tListNode mid = head.next;\n\t\tListNode end = mid.next;\n\t\thead.next = null;\n\n\t\twhile (end != null) {\n\t\t\tmid.next = head;\n\t\t\thead = mid;\n\t\t\tmid = end;\n\t\t\tend = end.next;\n\t\t}\n\n\t\tmid.next = head;\n\t\treturn mid;\n\t}", "public ListNode reverseList(ListNode head) {\n ListNode current = head;\n ListNode prev = null;\n \n while(current != null){\n ListNode temp = current.next;\n current.next = prev;\n \n prev = current;\n current = temp;\n }\n return prev;\n }", "public static void main(String[] args) {\n\t\tNode current=new Node(10);\r\n\t\tcurrent.next = new Node(20); \r\n\t\tcurrent.next.next = new Node(30); \r\n\t\tcurrent.next.next.next = new Node(40); \r\n\t\tcurrent.next.next.next.next = new Node(50); \r\n Node r=Rotatelinkedlistbyk(current,2);\r\n if(r==null)\r\n {\r\n \t System.out.print(\"no element to return\");\r\n }\r\n while(r != null)\r\n {\r\n \t System.out.print(r.data);\r\n \t r=r.next;\r\n }\r\n\r\n\t}", "public ListNode reverseList(ListNode head) {\n if(head==null || head.next==null) return head;\n \n ListNode prev=reverseList(head.next);\n head.next.next=head;\n head.next=null;\n \n return prev;\n}", "Node Reverse(Node head) {\n\n Stack<Node> node_stack = new Stack<Node>();\n while(head.next != null){\n node_stack.push(head);\n head = head.next;\n }\n Node first = head;\n while(!node_stack.isEmpty()){\n head.next = node_stack.pop();\n head = head.next;\n }\n head.next = null;\n return first;\n}", "public ListNode reverse(ListNode prev, ListNode start, ListNode end) {\n\t\tListNode current = start.next;\n\t\tListNode preCurrent = start;\n\t\twhile(current != end){\n\t\t\tListNode temp = current.next;\n\t\t\tcurrent.next = preCurrent;\n\t\t\tpreCurrent = current;\n\t\t\tcurrent = temp;\n\t\t}\n\t\tstart.next = end.next;\n\t\tend.next = preCurrent;\n\t\tprev.next = end;\n\t\treturn start;\n\t}", "public void reverseLinkedList(){\n\t\tNode prev = null;\n\t\tNode current = head;\n\t\twhile (current != null){\n\t\t\tNode temp = current.next;\n\t\t\tcurrent.next = prev;\n\t\t\t// move pointers be careful must move previous to current first\n\t\t\tprev = current;\n\t\t\tcurrent = temp;\n\t\t\t\n\n\t\t}\n\t\tthis.head = prev;\n\t}", "public ListNode reverse(ListNode head) {\n if (head == null) {\n return null;\n }\n \n ListNode dummy = new ListNode(0);\n while (head != null) {\n // store the next node.\n ListNode tmp = head.next;\n \n // insert the head into the head!\n head.next = dummy.next;\n dummy.next = head;\n \n head = tmp;\n }\n \n return dummy.next;\n }", "Node reverseConstMem(Node first) {\n \r\n if(first == null || first.next == null)\r\n return first;\r\n \r\n Node node0 = new Node(0);\r\n node0.next = first;\r\n Node prev = null;\r\n Node node = first;\r\n Node after = first.next;\r\n while(node !=null) {\r\n node.next = prev;\r\n \r\n prev = node;\r\n node = after;\r\n if(after!=null)\r\n after = after.next;\r\n }\r\n return prev;\r\n }", "public Node theLastNele(MyList ml,int k)\n\t{\n\t\tif(ml==null|| ml.head==null) return null;\n\t\tNode rt=ml.head,cur = ml.head;\n\t\tint i;\n\t\tfor( i=0;i<k-1;i++) {\n\t\t\tif(cur == null) break;\n\t\t\tcur = cur.next;\n\t\t}\n\t\tif(i!=k-1) return null;\n\t\t\n\t\twhile(cur!=ml.tail)\n\t\t{\n\t\t\tcur = cur.next;\n\t\t rt = rt.next;\n\t\t}\n\t\t\n\t\treturn rt;\n\t}", "public ListNode reverseList(ListNode head) {\n ListNode first = head;\n ListNode reverse = null;\n while (first != null) {\n ListNode temp = first.next;\n first.next = reverse;\n reverse = first;\n first = temp;\n }\n return reverse;\n }", "public void reverseLinkedlistRecursive(){\n\t\tif (this.head == null) return;\n\t\tNode newEnd = reverseLinkedlisthelper(this.head);\n\t\tnewEnd.next = null;\n\t}", "public static void main(String[] args) {\n ListNode<Integer> head = new ListNode<>(5);\n LinkedListBasic<Integer> linkedListBasic = new LinkedListBasic<>();\n for (int i = 10; i < 50; i+=5){\n linkedListBasic.insertNewNode(i, head);\n }\n\n /*linkedListBasic.printLinkedList(head);\n reverseSubList(head, 2, 6);\n linkedListBasic.printLinkedList(head);*/\n\n linkedListBasic.printLinkedList(head);\n ListNode<Integer> newHead = reverseLinkedList2(head);\n linkedListBasic.printLinkedList(newHead);\n reverseSubList(newHead, 2, 6);\n linkedListBasic.printLinkedList(newHead);\n\n }", "public void recursiveReverse (Node currentNode)\n{\nif (currentNode==NULL)\nreturn;\n\n/*if we are at the tail node:\n recursive base case:\n*/\nif(currentNode.next==NULL)\n{\n//set HEAD to the current tail since we are reversing list\nhead=currentNode;\nreturn; //since this is the base case\n}\n\nrecursiveReverse(currentNode.next);\ncurrentNode.next.next=currentNode;\ncurrentNode.next=null; //set \"old\" next pointer to NULL\n}", "private static LinkedListNode reverseLinkedList(LinkedListNode head) {\n if (head == null) {\n return null;\n }\n LinkedListNode revHead = head, temp = null;\n while (head.next != null) {\n temp = head.next;\n head.next = temp.next;\n temp.next = revHead;\n revHead = temp;\n }\n return revHead;\n }", "public ListNode reverseList(ListNode head) {\n if (head == null) return null;\n ListNode prev = null;\n ListNode cur = head;\n while (cur != null) {\n ListNode temp = cur.next;\n cur.next = prev;\n prev = cur;\n cur = temp;\n }\n return prev;\n }", "private static SingleLinkedNode reverseWithLoopBreaking(SingleLinkedNode head) {\n\t\tSingleLinkedNode loopstart = findLoopStart(head);\r\n\t\tif (loopstart != null) {\r\n\t\t\t// re-find the previous element.\r\n\t\t\tSingleLinkedNode prev = loopstart;\r\n\t\t\twhile (prev.getNext() != loopstart) {\r\n\t\t\t\tprev = prev.getNext();\r\n\t\t\t}\r\n\t\t\tprev.setNext(null);\r\n\t\t}\r\n\t\t\r\n\t\treturn (Reverse(head));\r\n\t}", "private void demote(WAVLNode z) {\n\t z.rank--;\r\n }", "static Node reserveIterativeTraversal(MyLinkedList l, int k) {\n\t\tNode p1 = l.getHead();\n\t\tNode p2 = l.getHead();\n\t\t\n\t\tfor(int i = 0; i < k; i++) \n\t\t\tp1 = p1.getNext();\n\t\t\t\n\t\twhile(p1.getNext() != null) {\n\t\t\tp1 = p1.getNext();\n\t\t\tp2 = p2.getNext();\n\t\t}\n\t\t\n\t\treturn p2;\n\t}", "public E findKthNodeFromEnd(int k) {\n\t\tif (k <= 0 || k > size())\n\t\t\tthrow new IllegalArgumentException();\n\n\t\tNode current = first;\n\t\tNode next = current;\n\n\t\twhile (k > 0) {\n\t\t\tnext = next.next;\n\t\t\tk--;\n\t\t}\n\n\t\twhile (next != null) {\n\t\t\tcurrent = current.next;\n\t\t\tnext = next.next;\n\t\t}\n\t\treturn (E) current.value;\n\t}", "public ListNode reverseBetween(ListNode head, int m, int n) {\n if (head.next == null) return head;\n m--; //the index of first element is 1 , hence decrement as we are starting first from 0\n int i =0;\n\n //progress the pointers forward\n ListNode origHead = head;\n ListNode priorEnd = null;\n for (; i < m && head != null; i++) {\n priorEnd = head;\n head = head.next;\n }\n int noToReverse = n-m;\n\n //add to stack the number of elements needed to be reversed\n Stack<ListNode> stack = new Stack<>();\n for (i=0; i < noToReverse && head != null; i++) {\n stack.add(head);\n head = head.next;\n }\n //keep track of what was next\n ListNode next = head;\n\n //adjust pointers by popping last from stack\n while (!stack.isEmpty()) {\n ListNode node = stack.pop();\n if (priorEnd == null) {\n origHead = node; //if you starting from the first element in the list priorEnd is null\n } else {\n priorEnd.next = node;\n }\n priorEnd = node;\n }\n //adjust prior end to next\n if (priorEnd != null) {\n priorEnd.next = next;\n }\n return origHead;\n }", "static void reverse(Linkedlists list){\r\n\t\tNode current=list.head;\r\n\r\n\t\tNode nextNode=null;\r\n\t\tNode previous=null;\r\n\t\twhile(current != null){\r\n\t\t\tnextNode=current.next;\r\n\t\t\t//System.out.println(\"current.next:\"+current.data);\r\n\t\t\tcurrent.next=previous;\r\n\t\t\tprevious=current;\r\n\t\t\tcurrent=nextNode;\r\n\r\n\t\t}\r\n\t\t//current.next=previous;\r\n\t\tlist.head=previous;\r\n\r\n\t}", "static void ReversePrint(Node head) {\n\t\t while(head.next != null){\n\t\t head.next = head;\n\t\t head.next.next= head.next;\n\t\t }\n\t\t }", "public static LinkedList<String> revLinkedList(LinkedList<String> lst) {\r\n\t\tStack<String> stk = new Stack<String>();\r\n\t\tLinkedList<String> ret = new LinkedList<String>();\r\n\t\tfor (String item : lst) {\r\n\t\t\tstk.push(item);\r\n\t\t}\r\n\t\twhile (!stk.isEmpty()) {\r\n\t\t\tret.add(stk.pop());\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "public static Node reverse(Node n) {\n if (n == null) return null;\n\n Node next = n.next;\n Node curr = n;\n Node prev = null;\n while (next != null) {\n next = curr.next;\n curr.next = prev;\n prev = curr;\n curr = next;\n }\n return prev;\n }", "public ListNode reverseIter(ListNode head) {\n if (head == null || head.next == null) return head;\n // a -> b -> c -> d\n // pre<-cur next\n //\n ListNode pre = null;\n while (head != null) {\n ListNode next = head.next;\n head.next = pre;\n pre = head;\n head = next;\n }\n return pre;\n }", "public NodeRandom reverse(NodeRandom start)\n\t{\n\t\tNodeRandom curr=start;\n\t\t\n\t\tNodeRandom temp;\n\t\tNodeRandom prev2=null;\n\t\twhile(curr!=null)\n\t\t{\t\t\t\n\t\t\ttemp=curr.next;\t\t\t\n\t\t\tcurr.next=prev2;\n\t\t\tprev2=curr;\n\t\t\tcurr=temp;\n\t\t}\t\t\n\t\tNodeRandom newstart=prev2;\t\t\t\t\n\t\tSystem.out.println(\"reverse a list\");\n\t\tdisplay(newstart);\n\t\treturn newstart;\n\t}", "public LinkedListNode kth(LinkedListNode head, int k){\n\t\tif(head==null) return null;\n\t\t\n\t\tNode p1=head;\n\t\tNdde p2=head;\n\t\t\n\t\tfor(int i=0;i<k;i++){\n\t\t\tif(p2==null) return null;\n\t\t\tp2=p2.next\n\t\t}\n\t\t\n\t\tif(p2==null) return null;\n\t\t\n\t\twhile(p2.next!=null){\n\t\t\tp2=p2.next;\n\t\t\tp1=p1.next;\n\t\t}\n\t\treturn p1;\n\t}", "public static SinglyLinkedList reverse(SinglyLinkedList list) {\r\n\t\tNode prev=null;\r\n\t\tNode current=list.getFirst();\r\n\t\tNode next=null;\r\n\t\t\r\n\t\twhile (current != null) {\r\n\t\t\tSystem.out.println(\"current: \" + current.getData());\r\n\t\t\tnext=current.next();\r\n\t\t\tcurrent.setNext(prev);\r\n\t\t\tprev=current;\r\n\t\t\tcurrent=next;\r\n\t\t}\r\n\t\tlist.setHead(prev); //have to reset head\r\n\t\treturn list;\r\n\t}" ]
[ "0.71482253", "0.69513047", "0.68091273", "0.6783951", "0.6620868", "0.66153055", "0.65806305", "0.64580005", "0.643771", "0.63793766", "0.6338437", "0.6318472", "0.6316613", "0.6232248", "0.620157", "0.6177651", "0.6169351", "0.6162767", "0.6161414", "0.61481637", "0.6144121", "0.6117946", "0.61026216", "0.61013883", "0.6099336", "0.60900617", "0.60844505", "0.6080829", "0.6075693", "0.6045674", "0.60407275", "0.603909", "0.6029363", "0.60264325", "0.601617", "0.6007431", "0.5966907", "0.5963462", "0.5957367", "0.5953396", "0.5935069", "0.59264463", "0.59256583", "0.5922688", "0.5921615", "0.5921209", "0.5919104", "0.5919014", "0.5913691", "0.59087974", "0.5900963", "0.5885379", "0.5880789", "0.5858965", "0.58578885", "0.5853236", "0.58513117", "0.58242774", "0.58211195", "0.58032864", "0.5802764", "0.579661", "0.57936364", "0.5759339", "0.5731523", "0.5725476", "0.57014006", "0.5683268", "0.56740123", "0.56660897", "0.566428", "0.5663058", "0.56566113", "0.56515455", "0.5649481", "0.5649445", "0.5642211", "0.5637902", "0.5619752", "0.5592703", "0.5586341", "0.5579374", "0.5577202", "0.55678844", "0.5541242", "0.5532516", "0.5524074", "0.55081713", "0.5508036", "0.5505081", "0.54965526", "0.5494453", "0.5493691", "0.5490119", "0.5487442", "0.5487343", "0.5481915", "0.54765725", "0.54755473", "0.5471041" ]
0.73274
0
Rotate a LinkedList (medium) / Eg:Input: 1>2>3>4>5>NULL, k = 2; Output: 3>4>5>1>2>NULL
public ListNode rotateLeft(ListNode head, int k) { if (k <= 0) return head; ListNode curr = head; int count = 1; while (count++ < k && curr != null) curr = curr.next; if (curr == null) return head; ListNode nextHead = curr; while (curr.next != null) curr = curr.next; curr.next = head; head = nextHead.next; nextHead.next = null; return head; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <V> ListNode<V> Rotate (\n\t\tfinal ListNode<V> head,\n\t\tfinal int k)\n\t{\n\t\tif (null == head || 0 >= k)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tint rotationCount = 0;\n\t\tListNode<V> prevNode = null;\n\t\tListNode<V> currentNode = head;\n\n\t\tListNode<V> nextNode = head.next();\n\n\t\twhile (++rotationCount < k)\n\t\t{\n\t\t\tif (null == nextNode)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tprevNode = currentNode;\n\t\t\tcurrentNode = nextNode;\n\n\t\t\tnextNode = nextNode.next();\n\t\t}\n\n\t\tif (!prevNode.setNext (\n\t\t\tnull\n\t\t))\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tListNode<V> rotatedHead = currentNode;\n\n\t\tnextNode = currentNode.next();\n\n\t\twhile (null != nextNode)\n\t\t{\n\t\t\tcurrentNode = nextNode;\n\n\t\t\tnextNode = nextNode.next();\n\t\t}\n\n\t\treturn currentNode.setNext (\n\t\t\thead\n\t\t) ? rotatedHead : null;\n\t}", "public ListNode SolveByMovingPointers(ListNode head, int k)\n {\n // Edge cases\n if (head == null)\n return null;\n if (k == 0)\n return head;\n\n // Calculate list length + actual number of rotations\n int listLength = FindLength(head);\n int numberOfRotations = k >= listLength? k % listLength : k;\n\n // Another edge case - may not need to rotate at all\n if (listLength == 1 || numberOfRotations == 0)\n return head;\n\n // Iterate to the node before the node with number that needs to be rotated to beginning...\n ListNode oldHeadIterator = head;\n int counter = listLength - numberOfRotations - 1;\n while (counter != 0)\n {\n counter -= 1;\n oldHeadIterator = oldHeadIterator.next;\n }\n\n // ... Then make the following node be the beginning of new head + nullify tail of old head\n ListNode newHead = oldHeadIterator.next;\n oldHeadIterator.next = null;\n\n // Iterate to end of the new head, then simply add the old head contents to the tail\n ListNode newHeadIterator = newHead;\n while (newHeadIterator.next != null)\n newHeadIterator = newHeadIterator.next;\n newHeadIterator.next = head;\n\n return newHead;\n }", "public static Nodelink rotate(Nodelink node, int k){ 1 2 3 4 5\n //\n\n Nodelink head = node;\n Nodelink temp = null;\n Nodelink temp2 = null;\n\n for(int i = 0; i < k; i++){\n while(node != null){\n\n temp = node;\n temp2 = node.next;\n\n node.next = temp;\n\n\n node = node.next;\n\n }\n\n head = node;\n }\n\n\n return head;\n }", "public ListNode rotateRight(ListNode head, int k) {\n \tif (head == null || k == 0 || head.next == null)\n \t\treturn head;\n \tint size = 1;\n \tListNode curr = head,end=head;\n \tListNode newHead = new ListNode(0);\n \twhile (end.next != null){\n \t\tend = end.next;\n \t\tsize++;\n \t}\n \tif (k%size == 0)\n\t return head;\n \tint start = 1;\n \twhile(start < size - k%size){\n \t\tcurr = curr.next;\n \t\tstart++;\n \t}\n \tnewHead.next = curr.next;\n \tcurr.next = null;\n \tend.next = head;\n \treturn newHead.next;\n }", "public ListNode rotateRight(ListNode head, int k) {\r\n\t\tint size = listSize(head);\r\n\t\tif (head == null || k <= 0 || k == size) return head;\r\n\t\tif (k > size) k %= size;\r\n\t\tint count = 1;\r\n\t\tListNode curr = head;\r\n\t\tk = size - k;\r\n\t\twhile (count < k && curr != null) {\r\n\t\t\tcurr = curr.next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tListNode nextHead = curr;\r\n\t\twhile (curr.next != null)\r\n\t\t\tcurr = curr.next;\r\n\t\tcurr.next = head;\r\n\t\thead = nextHead.next;\r\n\t\tnextHead.next = null;\r\n\t\treturn head;\r\n\t}", "public ListNode SolveUsingAdditionalLinkedList(ListNode head, int k)\n {\n // Edge cases\n if (head == null)\n return null;\n if (k == 0)\n return head;\n\n // Create blank list to store new result\n ListNode result = new ListNode(-1, null);\n\n // Find the length of the list\n int listLength = FindLength(head);\n\n // Calculate the actual number of rotations (since k can be greater than list length)\n int numberOfRotations = k >= listLength? k % listLength : k;\n\n // Another edge case - may not need to rotate at all\n if (listLength == 1 || numberOfRotations == 0)\n return head;\n\n // Iterate through list until we get to the numbers that need to be moved to beginning...\n int counter = listLength - numberOfRotations;\n ListNode temp = head;\n while (counter != 0)\n {\n temp = temp.next;\n counter -= 1;\n }\n\n // ... Then add the rotated numbers to list\n while (temp != null)\n {\n AddLast(result, temp.val);\n temp = temp.next;\n }\n\n // Lastly, reset counters and add the remaining numbers to the back\n counter = listLength - numberOfRotations;\n temp = head;\n while (counter != 0)\n {\n AddLast(result, temp.val);\n temp = temp.next;\n counter -= 1;\n }\n\n // Since result is dummy node, return result.next\n return result.next;\n }", "public ListNode rotateKplace(ListNode head, int n) {\n if (head == null) return head;\n\n int len = getLen(head);\n int half = n % len;\n if (half == 0) return head;\n\n int index = len - half; // index to rotate\n ListNode curr = head;\n\n for (int i = 0; i < index - 1; i++) {\n curr = curr.next;\n } // curr is last node before rotate\n\n ListNode h1 = curr.next;\n curr.next = null;\n\n ListNode tail = h1;\n while (tail.next != null) {\n tail = tail.next;\n }\n tail.next = head;\n return h1;\n }", "public ListNode rotateRight(ListNode head, int n) {\n if(n == 0 || head == null) {\r\n return head;\r\n } \r\n ListNode curr = head;\r\n int length = 0;\r\n while(curr!=null) {\r\n length++;\r\n curr = curr.next;\r\n }\r\n n = n % length;\r\n //skip the zero\r\n if(n == 0) {\r\n return head;\r\n }\r\n //do the rotating\r\n ListNode newHead = new ListNode(-1);\r\n newHead.next = head;\r\n \r\n int step = length - n;\r\n curr = newHead;\r\n for(int i = 0; i < step; i++) {\r\n curr = curr.next;\r\n }\r\n \r\n //be aware need to break the loop\r\n ListNode tmp = curr.next;\r\n curr.next = null;\r\n curr = tmp;\r\n \r\n newHead.next = curr;\r\n while(curr.next != null) {\r\n curr = curr.next;\r\n }\r\n curr.next = head;\r\n \r\n return newHead.next;\r\n }", "public static void main(String[] args) {\n\t\tNode current=new Node(10);\r\n\t\tcurrent.next = new Node(20); \r\n\t\tcurrent.next.next = new Node(30); \r\n\t\tcurrent.next.next.next = new Node(40); \r\n\t\tcurrent.next.next.next.next = new Node(50); \r\n Node r=Rotatelinkedlistbyk(current,2);\r\n if(r==null)\r\n {\r\n \t System.out.print(\"no element to return\");\r\n }\r\n while(r != null)\r\n {\r\n \t System.out.print(r.data);\r\n \t r=r.next;\r\n }\r\n\r\n\t}", "public ListNode rotateRight(ListNode head, int n) {\n \n if (head == null || head.next == null)\n return head;\n int i = 0;\n ListNode tail = head;\n ListNode dummy = new ListNode(0);\n dummy.next = head;\n ListNode pre = dummy;\n \n // get the length of the list\n int len = 0;\n while (head != null){\n head = head.next;\n len ++;\n if (head != null)\n tail = head;\n }\n head = dummy.next;\n if (n%len == 0)\n\t\t return dummy.next;\n\t n = len - n%len;\n\t ListNode cur = dummy.next;\n while (i < n){\n pre = cur;\n cur = cur.next;\n i++;\n }\n dummy.next = cur;\n tail.next = head;\n pre.next = null;\n return dummy.next;\n }", "public void rotate() { // rotate the first element to the back of the list\n // TODO\n if ( tail != null){\n tail = tail.getNext();\n }\n\n }", "public static ListNode reverseKGroup(ListNode head, int k) {\n\t\tListNode runner = head;\n\t\tint counter = 0;\n\t\twhile(runner != null){\n\t\t\trunner = runner.next;\n\t\t\tcounter++;\n\t\t}\n\t\tif(counter < k){return head;}\n\t\t\n\t\t// reverse first k nodes\n\t\tListNode dummy = new ListNode(0);\n\t\tdummy.next = head;\n\t\t\n\t\tListNode oriHead = head;\n\t\tListNode prev = null;\n\t\t\n\t\tfor(int i=0; i<k; i++){\n\t\t\tListNode temp = head.next;\n\t\t\thead.next = prev;\n\t\t\tprev = head;\n\t\t\thead = temp;\n\t\t}\n\t\t\n\t\t// append rest nodes by recur\n\t\tdummy.next = prev;\n\t\toriHead.next = reverseKGroup(head, k);\n\t\t\n\t\treturn dummy.next;\n\t\n\t}", "public ListNode rotateRight(ListNode head, int n) {\n if(head==null)\n return null;\n ListNode p2=head;\n ListNode p1=head;\n ListNode newhead=head;\n int count=0;\n \n if(n==0)\n return head;\n \n for(int i=0;i<n;i++)\n {\n p1=p1.next;\n count++;\n if(p1==null)\n break;\n }\n \n if(count==1&&p1==null)\n return head;\n \n if(p1==null)\n {\n p1=head;\n n=n%count;\n if(n==0)\n return head;\n for(int i=0;i<n;i++)\n {\n p1=p1.next; \n }\n while(p1.next!=null)\n {\n p1=p1.next;\n p2=p2.next;\n }\n ListNode tail=p2;\n newhead=p2.next;\n while(tail.next!=null)\n tail=tail.next;\n tail.next=head;\n p2.next=null;\n }\n else\n {\n while(p1.next!=null)\n {\n p1=p1.next;\n p2=p2.next;\n }\n ListNode tail=p2;\n newhead=p2.next;\n while(tail.next!=null)\n {\n tail=tail.next;\n }\n tail.next=head;\n p2.next=null;\n }\n \n return newhead;\n }", "public ListNode rotateRight(ListNode head, int n) {\n \n int len = 0;\n \n if (head == null) return head;\n \n ListNode node = head;\n ListNode prev = head;\n \n while (node != null) {\n prev = node;\n node = node.next;\n len++;\n }\n \n n = n % len;\n \n if (n == 0) return head;\n \n int current = 1;\n \n prev.next = head;\n \n node = head;\n \n while (current < len - n) {\n node = node.next;\n current++;\n }\n \n prev = node.next;\n node.next = null;\n \n return prev;\n }", "public ListNode reverseKGroup(ListNode head, int k) {\n if(head == null || head.next == null || k < 2)\n return head;\n \n ListNode dummy = new ListNode(0);\n ListNode curr = dummy;\n ListNode tail = head;\n int count = 0;\n while(head != null) {\n count++;\n if(count == k) {\n // Reverse nodes \n // Store location of head next\n // Store location of rear, this will be used to know where to continue next\n ListNode temp = head.next;\n ListNode last = tail;\n \n // Move pointers around to reverse the nodes\n ListNode next = tail;\n while(next != temp) {\n ListNode prev = tail;\n tail = next == tail ? tail.next : next;\n next = tail.next;\n tail.next = prev;\n }\n curr.next = head;\n curr = last;\n head = temp;\n tail = temp;\n count = 0;\n }\n else {\n head = head.next;\n }\n }\n curr.next = tail;\n return dummy.next;\n }", "public MyListNode reverseKGroup(MyListNode head, int k) {\n if (k == 1)\n return head;\n MyListNode H = new MyListNode(0);\n H.next = head;\n MyListNode q = H;\n for (MyListNode p = head; p != null; p = p.next) {\n p = reverseK(q, k);\n if (p == null)\n break;\n q = p;\n }\n return H.next;\n }", "public ListNode reverseKGroup(ListNode head, int k) {\n if(head==null || head.next==null || k==0)\n return head;\n ListNode left = head;\n ListNode right = head;\n int count = 1;\n while(count<=k && right!=null){\n right = right.next;\n count++;\n }\n if(count-1!=k && right==null)\n return left;\n ListNode pre = null;\n ListNode cur = left;\n while(cur!=right){\n ListNode next = cur.next;\n cur.next = pre;\n pre = cur;\n cur = next;\n }\n left.next = reverseKGroup(cur, k);\n return pre;\n }", "public static ListNode reverse(ListNode head, int k) {\n\t\tListNode curr = head;\n\t\tListNode prev = null;\n\t\twhile (true) {\n\t\t\tListNode prevLast = prev; // null for head,1 for 4,5,6\n\t\t\tListNode first = curr;\n\n\t\t\t// reversing\n\t\t\tprev = null;\n\t\t\tfor (int i = 0; i < k && curr != null; i++) {\n\t\t\t\tListNode temp = curr.next;\n\t\t\t\tcurr.next = prev;\n\t\t\t\tprev = curr;\n\t\t\t\tcurr = temp;\n\t\t\t}\n\n\t\t\t// setting prevElement next pointer\n\t\t\tif (prevLast == null) {\n\t\t\t\thead = prev;\n\n\t\t\t} else {\n\t\t\t\tprevLast.next = prev;\n\t\t\t}\n\n\t\t\tif (curr == null)\n\t\t\t\tbreak;\n\n\t\t\tprev = first;\n\n\t\t}\n\n\t\treturn head;\n\n\t}", "public ListNode rotateRight(ListNode head, int n) {\n if(n==0||head==null)\n return head;\n ListNode fast=head;\n ListNode slow=head;\n ListNode res=new ListNode(0);\n res.next=head;\n \n int count=0;\n for(int i=0;i<n;i++){\n if(fast==null){\n break; \n }else{\n count++;\n fast=fast.next;\n }\n }\n \n if(fast==null)\n return rotateRight(head,n%count);\n \n while(fast.next!=null){\n fast=fast.next;\n slow=slow.next;\n }\n \n ListNode b=slow.next;\n \n res.next=b;\n slow.next=null;\n fast.next=head;\n \n return res.next;\n }", "public ListNode reverseKGroup(ListNode head, int k) {\r\n\t\tif (head == null) return head;\r\n\t\tint count = 0;\r\n\t\tListNode curr = head, prev = null, next = null;\r\n\t\t// Find the k+1 node\r\n\t\twhile (count != k && curr != null) {\r\n\t\t\tcurr = curr.next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\r\n\t\tif (count != k) return head;\r\n\t\t// reverse list with k+1 node as head\r\n\t\tprev = reverseKGroup(curr, k);\r\n\t\t// LL Reversal Alg: reverse current k-group from head ptr\r\n\t\twhile (count-- > 0) {\r\n\t\t\tnext = head.next;\r\n\t\t\thead.next = prev;\r\n\t\t\tprev = head;\r\n\t\t\thead = next;\r\n\t\t}\r\n\t\treturn prev;\r\n\t}", "public void rotateold2(int[] a, int k) {\n\n\t\tif (a == null || a.length == 0)\n\t\t\treturn;\n\n\t\tint jump = 0, len = a.length, cur = a[0], next, count = 0;\n\n\t\tk %= len; \n\t\tif (k == 0) return;\n\n\t\tif (len % k != 0 || k == 1)\n\t\t{ \n\t\t\tint i = 0;\n\t\t\twhile (i < len)\n\t\t\t{\n\t\t\t\tjump = (jump + k) % len;\n\t\t\t\tnext = a[jump];\n\t\t\t\ta[jump] = cur;\n\t\t\t\tcur = next;\n\t\t\t\ti++;\n\t\t\t} \n\t\t} \n\t\telse\n\t\t{\n\t\t\tfor (int i = 0; i <= len/k; i ++)\n\t\t\t{\n\t\t\t\tint start = 0;\n\t\t\t\tjump = i;\n\t\t\t\tnext = a[jump];\n\t\t\t\tcur = a[i];\n\t\t\t\twhile (start <= len/k)\n\t\t\t\t{\n\t\t\t\t\tjump = (jump + k) % len;\n\t\t\t\t\tnext = a[jump];\n\t\t\t\t\ta[jump] = cur;\n\t\t\t\t\tcur = next;\n\t\t\t\t\tstart++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "ListNode kAltReverse(ListNode head, int k) {\r\n\t\tListNode curr = head, next = null, prev = null;\r\n\t\tint count = 0;\r\n\t\t/*1) LL Revese Alg: reverse first k nodes of the linked list */\r\n\t\twhile (curr != null && count < k) {\r\n\t\t\tnext = curr.next;\r\n\t\t\tcurr.next = prev;\r\n\t\t\tprev = curr;\r\n\t\t\tcurr = next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\t/* 2) Now head points to the kth node. So change next of head to (k+1)th node*/\r\n\t\tif (head != null) {\r\n\t\t\thead.next = curr;\r\n\t\t}\r\n\t\t/* 3) We do not want to reverse next k nodes. So move the curr pointer to skip next k nodes */\r\n\t\tcount = 0;\r\n\t\twhile (count < k - 1 && curr != null) {\r\n\t\t\tcurr = curr.next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\t/* 4) Recursively call for the list starting from curr->next. \r\n\t\tAnd make rest of the list as next of first node */\r\n\t\tif (curr != null) {\r\n\t\t\tcurr.next = kAltReverse(curr.next, k);\r\n\t\t}\r\n\t\t/* 5) prev is new head of the input list */\r\n\t\treturn prev;\r\n\t}", "public ListNode reverseKGroup(ListNode head, int k) {\n int len = getLength(head);\n ListNode dummy = new ListNode(-1);\n dummy.next = head;\n ListNode prepare = dummy;\n\n for (int i = 0; i <= len - k; i = i + k) {\n prepare = reverse(prepare, k);\n }\n return dummy.next;\n }", "public static ListNode swapNodes2(ListNode head, int k) {\n ListNode KthFromStart = head, out = head, KthFromLast = head;\n for (int i = 1; i < k; i++) {\n KthFromStart = KthFromStart.next;\n }\n ListNode temp_Node = KthFromStart;\n while (temp_Node.next != null) {\n temp_Node = temp_Node.next;\n KthFromLast = KthFromLast.next;\n }\n int temp = KthFromLast.val;\n KthFromLast.val = KthFromStart.val;\n KthFromStart.val = temp;\n return out;\n }", "public static ListNode swapNodes(ListNode head, int k) {\n if(head == null || head.next == null){\n return head;\n }\n ListNode tail = head;\n int begin = k;\n int len = 0;\n int index = 1;\n Map<Integer,Integer> map = new HashMap<>();\n while(tail != null){\n len++;\n map.put(index++,tail.val);\n tail = tail.next;\n }\n int end = len - k + 1;\n tail = head;\n index = 1;\n while(tail != null){\n if(index == begin){\n tail.val = map.get(end);\n }\n if(index == end){\n tail.val = map.get(begin);\n }\n index++;\n tail = tail.next;\n }\n return head;\n }", "public static void main(String[] args) {\r\n RotateList rl = new RotateList();\r\n // test list : 1->2->3->4->5->NULL.\r\n ListNode testList = new ListNode(0);\r\n for (int i = 1; i < 6; i++) {\r\n testList.addNodeTail(new ListNode(i));\r\n }\r\n System.out.println(\"The input list is the following:\");\r\n testList.printList();\r\n ListNode result = rl.rotateRight(testList, 3);\r\n System.out.println(\"And the output is the following:\");\r\n result.printList();\r\n }", "public Node reverse(Node headNode, int k) {\n\n Node currNode = headNode;\n Node next = null;\n Node prev = null;\n\n int count = 0;\n\n /* reverse first k nodes of the linked list */\n while (currNode != null && count < k) {\n next = currNode.getNextNode();\n currNode.setNextNode(prev);\n prev = currNode;\n currNode = next;\n count++;\n }\n if (next != null) {\n headNode.setNextNode(reverse(next, k));\n }\n\n return prev;\n }", "static Node reserveIterativeTraversal(MyLinkedList l, int k) {\n\t\tNode p1 = l.getHead();\n\t\tNode p2 = l.getHead();\n\t\t\n\t\tfor(int i = 0; i < k; i++) \n\t\t\tp1 = p1.getNext();\n\t\t\t\n\t\twhile(p1.getNext() != null) {\n\t\t\tp1 = p1.getNext();\n\t\t\tp2 = p2.getNext();\n\t\t}\n\t\t\n\t\treturn p2;\n\t}", "LinkList rotate(int numberOfRotations){\n\t\twhile(numberOfRotations!=0){\n\t\t\tNode temp=this.head;\n\t\t\twhile(temp.getNext()!=null){\n\t\t\t\ttemp=temp.getNext();\n\t\t\t}\n\t\t\ttemp.setNext(head);\n\t\t\thead=head.getNext();\n\t\t\ttemp.getNext().setNext(null);\n\t\t\tnumberOfRotations--;\n\t\t}\n\t\t\n\t\treturn this;\n\t}", "public ListNode rotateRight(ListNode head, int n) {\r\n\t\t// Note: The Solution object is instantiated only once and is reused by\r\n\t\t// each test case.\r\n\t\tif (null == head) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tListNode p = head;\r\n\t\tint length = 0;\r\n\t\twhile (null != p) {\r\n\t\t\tp = p.next;\r\n\t\t\tlength++;\r\n\t\t}\r\n\t\tif (n % length == 0) {\r\n\t\t\treturn head;\r\n\t\t} else {\r\n\t\t\tn = n % length;\r\n\t\t}\r\n\t\tint num = n;\r\n\t\tListNode first = head;\r\n\t\tListNode second = head;\r\n\t\twhile (num > 0) {\r\n\t\t\tfirst = first.next;\r\n\t\t\tnum--;\r\n\t\t}\r\n\r\n\t\twhile (null != first.next) {\r\n\t\t\tfirst = first.next;\r\n\t\t\tsecond = second.next;\r\n\t\t}\r\n\r\n\t\tListNode newHead = second.next;\r\n\t\tsecond.next = null;\r\n\t\tfirst.next = head;\r\n\t\treturn newHead;\r\n\t}", "private ListNode kthNodeInReverseOrder(ListNode head, int k) {\n if (k == 0 || head == null) {\n return head;\n }\n\n ListNode node = head;\n for (int i = 1; i <= k-1; i++) {\n if (node.next != null) {\n node = node.next;\n } else {\n return null;\n }\n }\n\n ListNode kthNodeInReverse = head;\n\n while (node.next != null) {\n kthNodeInReverse = kthNodeInReverse.next;\n node = node.next;\n }\n\n return kthNodeInReverse;\n }", "public Node reverserLinkedList(Node head){\n // size == 0\n if(head == null){\n return null;\n }\n // size == 1\n if(head.getNext() == null){\n return head;\n }\n\n Node newHead = reverserLinkedList(head.getNext());\n head.getNext().setNext(head);\n head.setNext(null);\n return newHead;\n }", "private static SLLNode removeKthLast(SLLNode node, int k) {\n\n if (node == null) {\n throw new IllegalArgumentException(\"Node is empty\");\n }\n\n SLLNode first = node;\n while (k + 1 > 0) {\n first = first.next;\n k = k - 1;\n }\n\n SLLNode second = node;\n while (first != null) {\n second = second.next;\n first = first.next;\n }\n\n if (second != null && second.next != null) {\n second.next = second.next.next;\n }\n return node;\n }", "private static void rightRotate(int[] nums, int k) {\r\n\t if (nums.length == 0) return;\r\n\t \r\n\t k %= nums.length;\r\n\t \r\n\t if (k == 0) return;\r\n\t \r\n\t int left=0, right=nums.length-1, tmp;\r\n\t \r\n\t while(left < right) {\r\n\t tmp = nums[left];\r\n\t nums[left] = nums[right];\r\n\t nums[right] = tmp;\r\n\t \r\n\t left++;\r\n\t right--;\r\n\t }\r\n\t \r\n\t left=0;\r\n\t right=k-1;\r\n\t \r\n\t while(left < right) {\r\n\t \ttmp = nums[left];\r\n\t \tnums[left] = nums[right];\r\n\t \tnums[right] = tmp;\r\n\t \t \r\n\t \tleft++;\r\n\t \tright--;\r\n\t }\r\n\t \r\n\t left=k;\r\n\t right=nums.length-1;\r\n\t \r\n\t while(left < right) {\r\n\t \ttmp = nums[left];\r\n\t \tnums[left] = nums[right];\r\n\t \tnums[right] = tmp;\r\n\t \t \r\n\t \tleft++;\r\n\t \tright--;\r\n\t }\r\n\t }", "public static void removeKthToLast(Node head, int k) {\n if (head == null) return;\n if (k <= 0) return;\n\n Node first = head;\n Node second = head;\n int i = 0;\n while (i < k) {\n if (first == null) return;\n first = first.next;\n i++;\n }\n\n while (first != null) {\n first = first.next;\n second = second.next;\n }\n Node next = second.next;\n if (next == null) {\n second.next = null;\n } else {\n second.data = next.data;\n second.next = next.next;\n }\n }", "static public ListNode reorder(ListNode head) {\n\t\tif (head == null || head.next == null) {\n\t\t\treturn head;\n\t\t}\n\t\tListNode one = head;\n\t\tListNode mid = findMidle(head);\n\t\tSystem.out.println(\"mid: \"+ mid.val);\n\t\tListNode two = reverse(mid.next);\n\t\tmid.next = null;\n\t\tListNodeUtils.printList(head);\n\t\tListNodeUtils.printList(two);\n\t\tListNode curr = one;\n\t\twhile (one != null && two != null) {\n\t\t\tone = one.next;\n\t\t\tcurr.next = two;\n\t\t\tcurr = curr.next;\n\n\t\t\ttwo = two.next;\n\t\t\tcurr.next = one;\n\t\t\tcurr = curr.next;\n\t\t}\n\t\tif (one != null) {\n\t\t\tcurr.next = null;\n//\t\t curr = curr.next; \n\t\t}\n\n\t\t// curr.next = null;\n\t\treturn head;\n\t}", "public LinkedListNode kth(LinkedListNode head, int k){\n\t\tif(head==null) return null;\n\t\t\n\t\tNode p1=head;\n\t\tNdde p2=head;\n\t\t\n\t\tfor(int i=0;i<k;i++){\n\t\t\tif(p2==null) return null;\n\t\t\tp2=p2.next\n\t\t}\n\t\t\n\t\tif(p2==null) return null;\n\t\t\n\t\twhile(p2.next!=null){\n\t\t\tp2=p2.next;\n\t\t\tp1=p1.next;\n\t\t}\n\t\treturn p1;\n\t}", "private long leftRotate(long n) throws IOException {\n Node current = new Node(n);\r\n long currentRight = current.right;\r\n Node tempN = new Node(current.right);\r\n current.right = tempN.left;\r\n tempN.left = n;\r\n current.height = getHeight(current);\r\n current.writeNode(n);\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(currentRight);\r\n return currentRight;\r\n }", "public static void main(String [] args) {\n ArrayList<String> all;\n LinkedList<String> ll;\n CircularlyLinkedList<String> sll = new CircularlyLinkedList<>();\n\n String[] alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split(\"\");\n\n for (String s : alphabet) {\n sll.addFirst(s);\n sll.addLast(s);\n }\n System.out.println(sll.toString());\n\n sll.rotate();\n sll.rotate();\n\n for (String s : sll) {\n System.out.print(s + \", \");\n }\n\n }", "public void rotateNoSpace(int[] nums, int k){\n //in case k is greater than the length\n k = k % nums.length;\n \n for(int i = 0; i < k; i++){\n int last = nums[nums.length-1];\n for(int j = nums.length - 1; j >= 1; j--){\n nums[j] = nums[j-1];\n }\n nums[0] = last;\n }\n }", "private long removeHelper(long r, int k) throws IOException {\n if (r == 0) {\r\n return 0;\r\n }\r\n long ret = r;\r\n Node current = new Node(r);\r\n if (current.key == k) {\r\n if (current.left == 0) {\r\n ret = current.right;\r\n addToFree(r);\r\n }\r\n else if (current.right == 0) {\r\n ret = current.left;\r\n addToFree(r);\r\n }\r\n else {\r\n current.left = replace(current.left, current);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n }\r\n }\r\n else if (current.key > k) {\r\n current.left = removeHelper(current.left, k);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n }\r\n else {\r\n current.right = removeHelper(current.right, k);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n }\r\n int heightDifference = getHeightDifference(r);\r\n if (heightDifference < -1) {\r\n if (getHeightDifference(current.right) > 0) {\r\n current.right = rightRotate(current.right);\r\n current.writeNode(r);\r\n return leftRotate(r);\r\n }\r\n else {\r\n return leftRotate(r);\r\n }\r\n }\r\n else if (heightDifference > 1) {\r\n if (getHeightDifference(current.left) < 0) {\r\n current.left = leftRotate(current.left);\r\n current.writeNode(r);\r\n return rightRotate(r);\r\n }\r\n else {\r\n return rightRotate(r);\r\n }\r\n }\r\n return ret;\r\n }", "public void rotate(int[] nums, int k) {\n\t\tif(nums == null || nums.length == 0 || k <= 0){\n\t\t\treturn;\n\t\t}\n\t\tint n = nums.length, count = 0;\n\t\tk %= n;\n\t\tfor(int start = 0; count < n; start++){\n\t\t\tint cur = start;\n\t\t\tint prev = nums[start];\n\t\t\tdo{\n\t\t\t\tint next = (cur + k) % n;\n\t\t\t\tint temp = nums[next];\n\t\t\t\tnums[next] = prev;\n\t\t\t\tcur = next;\n\t\t\t\tprev = temp;\n\t\t\t\tcount++;\n\t\t\t}while(start != cur);\n\t\t}\n\t}", "public MyCircularDeque(int k) {\n head = new DoublyLinkedList(-1);\n tail = new DoublyLinkedList(-1);\n head.next = tail;\n tail.prev = head;\n this.k = k;\n this.size = size;\n}", "private AvlNode<E> rotateWithLeftChild(AvlNode<E> k1){\n AvlNode<E> k2 = k1.left;\n k1.left = k2.right;\n k2.right = k1;\n k1.height = max(height(k1.left), height(k2.right)) + 1;\n k2.height = max(height(k2.left), k1.height) + 1;\n return k2;\n }", "public void rotate(int[] nums, int k) {\n \n k = k % nums.length;\n reverse(nums, 0, nums.length-1);\n reverse(nums, 0, k-1);\n reverse(nums, k, nums.length-1);\n }", "public void rotate(int [] a, int k)\n\t{\n\t\tif (a == null || k == 0)\n\t\t\treturn;\n\n\t\tint [] b = new int[a.length];\n\t\tfor (int i = 0; i < a.length; i++)\n\t\t{\n\t\t\tint jump = (i + k) % a.length;\n\t\t\tb[jump] = a[i];\n\t\t}\n\t\tfor (int i = 0; i <a.length;i++)\n\t\t{\n\t\t\ta[i] = b[i];\n\t\t}\n\t}", "ListNode<Integer> rearrangeLastN(ListNode<Integer> l, int n) {\r\n\t\t\r\n\r\n\t\t\r\n\t\tListNode<Integer> result = new ListNode<Integer>(0);\r\n\t\tListNode<Integer> head_result = result;\r\n\t\t\r\n\t\tListNode<Integer> temp = new ListNode<Integer>(0);\r\n\t\tListNode<Integer> pointer = temp;\r\n\t\t\r\n\t/* 1. */\r\n\t\tint size = (listSize(l) - n);\r\n\t\t\r\n\t/* 2. */\r\n\t\tfor(int i = 0;i < size; i++)\t{\r\n\t\t\tresult.next = l;\r\n\t\t\tresult = result.next;\r\n\t\t\tl = l.next;\r\n\t\t}\r\n\t\tresult.next = null;\r\n\t\tresult = head_result.next;\r\n\t/*3.*/ \r\n\t\twhile(l != null)\t{\r\n\t\t\ttemp.next = l;\r\n\t\t\ttemp = temp.next;\r\n\t\t\tl = l.next;\r\n\t\t}\r\n\t\ttemp.next = head_result.next;\r\n\t\ttemp = pointer.next;\r\n\t\tresult = temp;\r\n\t\t\r\n\t\treturn result;\r\n\t}", "private AvlNode<E> rotateWithRightChild(AvlNode<E> k1){\n AvlNode<E> k2 = k1.right;\n k1.right = k2.left;\n k2.left = k1;\n k1.height = max(height(k1.left), height(k2.right)) + 1;\n k2.height = max(k1.height, height(k2.right)) + 1;\n return k2;\n }", "public MyCircularQueue0(int k) {\n this.size=k;\n this.l = new ArrayList<>();\n this.head=-1;\n this.tail=-1;\n }", "public static void rotate1 (int [] nums, int k ) {\n\t\tint n = nums.length;\n\t\tk = k % n ;\n\t\tif(k == 0) return ;\n\t\tint prev = 0, currIndex = 0, temp = 0, count = 0;\n\t\tfor(int start = 0 ; count < nums.length ; start++) {\n\t\t\tprev = nums[start];\n\t\t\tcurrIndex = start;\n\t\t\t// keep rotating till reach the initial point\n\t\t\tdo {\n\t\t\t\tint nextIndex = (currIndex + k) % n;\n\t\t\t\ttemp = nums[nextIndex];\n\t\t\t\tnums[nextIndex] = prev;\n\t\t\t\tprev = temp;\n\t\t\t\tcurrIndex = nextIndex;\n\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t} while(start != currIndex);\n\t\t}\n\t}", "public void rotate2(int[] nums, int k) {\n int start = 0, n = nums.length;\n k %= n;\n while (n > 0 && k > 0) {\n // Swap the last k elements with the first k elements.\n // The last k elements will be in the correct positions\n // but we need to rotate the remaining (n - k) elements\n // to the right by k steps.\n for (int i = 0; i < k; i++) {\n swap(nums, i + start, n - k + i + start);\n }\n n -= k;\n start += k;\n k %= n;\n }\n }", "public List<Integer> rotate(List<Integer> a, int k, List<Integer> queries) {\n\n List<Integer> arrAfterRotation = new ArrayList<>(a);\n\n List<Integer> lastArrAfterRotation = new ArrayList<>(a);\n\n //Set the last one after rotation equal to provided array at initialization\n lastArrAfterRotation = a;\n\n for(int i=0; i<k; i++) {\n arrAfterRotation.set(0,lastArrAfterRotation.get(lastArrAfterRotation.size()-1));\n int counter=1;\n for (int elem=1; elem<lastArrAfterRotation.size();elem++ ) {\n arrAfterRotation.set(counter++, lastArrAfterRotation.get(elem-1));\n }\n List<Integer> tempList = new ArrayList<>(arrAfterRotation);\n lastArrAfterRotation= tempList;\n }\n printList(lastArrAfterRotation);\n\n List<Integer> returnList = new ArrayList<>(lastArrAfterRotation);\n\n for (int i : queries) {\n returnList.set(i,lastArrAfterRotation.get(i));\n }\n\n return returnList;\n\n }", "public static void rotate(int[] nums, int k) {\n // get the kth index from the end to rotate\n\t\tint n = nums.length;\n\t\tk = k % n ;\n\t\tif(k == 0) return ;\n\t\tint prev = 0, tmp = 0;\n\t\tfor(int i = 0 ; i < k ; i++) {\n\t\t\tprev = nums[n - 1];\n\t\t\tfor(int j = 0 ; j < nums.length ; j++) {\n\t\t\t\ttmp = nums[j];\n\t\t\t\tnums[j] = prev;\n\t\t\t\tprev = tmp;\n\t\t\t}\n\t\t}\n }", "Node partition(Node l,Node h)\n {\n // set pivot as h element\n int x = h.data;\n \n // similar to i = l-1 for array implementation\n Node i = l.prev;\n \n // Similar to \"for (int j = l; j <= h- 1; j++)\"\n for(Node j=l; j!=h; j=j.next)\n {\n if(j.data <= x)\n {\n // Similar to i++ for array\n i = (i==null) ? l : i.next;\n int temp = i.data;\n i.data = j.data;\n j.data = temp;\n }\n }\n i = (i==null) ? l : i.next; // Similar to i++\n int temp = i.data;\n i.data = h.data;\n h.data = temp;\n return i;\n }", "private Node rotateLeft(Node h) {\n Node x = h.right;\n h.right = x.left;\n x.left = h;\n x.color = x.left.color;\n x.left.color = RED;\n x.size = h.size;\n h.size = size(h.left) + size(h.right) + 1;\n return x;\n }", "public int getKthNodeFromEnd(int k){\n // [10 -> 20 -> 30 -> 40 -> 50]\n // k = 1(50) dist = 0;\n // k = 2(40) dist = 1\n\n if(isEmpty()) throw new IllegalStateException();\n\n int distance = k - 1;\n var pointerOne = first;\n var pointerSecond = first;\n\n for(int i = 0; i < distance; i++){\n if(pointerSecond.next != null)\n pointerSecond = pointerSecond.next;\n else\n throw new IllegalArgumentException();\n }\n\n while(pointerSecond.next != null){\n pointerOne = pointerOne.next;\n pointerSecond = pointerSecond.next;\n }\n\n return pointerOne.value;\n }", "public LinkedList(){\n count = 0;\n front = rear = null;\n }", "public static void main(String[] args){\n LinkedList<Integer> linkedList = new LinkedList<>();\n linkedList.add(0);\n linkedList.add(3);\n linkedList.add(5);\n linkedList.add(7);\n linkedList.add(6);\n linkedList.add(77);\n linkedList.add(2);\n linkedList.add(1);\n for (int i=0;i<linkedList.size();i++){\n System.out.println(linkedList.get(i));\n }\n\n\n// LinkedHashMap<Integer,Integer> map = new LinkedHashMap<>(0,0.75f,false);\n// map.put(0,0);\n// map.put(1,1);\n// map.put(2,2);\n// map.put(3,3);\n// map.put(4,4);\n// map.put(5,5);\n// map.put(6,6);\n// map.put(7,7);\n//\n// map.get(1);\n// map.get(2);\n//\n// for (Map.Entry<Integer,Integer> entry : map.entrySet()){\n// System.out.println(entry.getKey()+\":-----value:\"+entry.getValue());\n// }\n\n //---------------------最近最少次序------true-------\n// 0:-----value:0\n// 3:-----value:3\n// 4:-----value:4\n// 5:-----value:5\n// 6:-----value:6\n// 7:-----value:7\n// 1:-----value:1\n// 2:-----value:2\n\n //--------------------插入顺序-------------false------------\n// 0:-----value:0\n// 1:-----value:1\n// 2:-----value:2\n// 3:-----value:3\n// 4:-----value:4\n// 5:-----value:5\n// 6:-----value:6\n// 7:-----value:7\n\n }", "public Node theLastNele(MyList ml,int k)\n\t{\n\t\tif(ml==null|| ml.head==null) return null;\n\t\tNode rt=ml.head,cur = ml.head;\n\t\tint i;\n\t\tfor( i=0;i<k-1;i++) {\n\t\t\tif(cur == null) break;\n\t\t\tcur = cur.next;\n\t\t}\n\t\tif(i!=k-1) return null;\n\t\t\n\t\twhile(cur!=ml.tail)\n\t\t{\n\t\t\tcur = cur.next;\n\t\t rt = rt.next;\n\t\t}\n\t\t\n\t\treturn rt;\n\t}", "public void leftRotate(Node n) {\r\n\t\tNode y = n.right;\r\n\t\tn.right = y.left;\r\n\t\tif(!y.left.isNil)\r\n\t\t\ty.left.parent = n;\r\n\t\ty.parent = n.parent;\r\n\t\tif(n.parent.isNil)\r\n\t\t\troot = y;\r\n\t\telse if(n == n.parent.left)\r\n\t\t\tn.parent.left = y;\r\n\t\telse\r\n\t\t\tn.parent.right = y;\r\n\t\ty.left = n;\r\n\t\tn.parent = y;\r\n\t}", "public static void rotate(java.util.List arg0, int arg1)\n { return; }", "public void rotate1(int[] nums, int k) {\n k %= nums.length;\n reverse(nums, 0, nums.length - 1);\n reverse(nums, 0, k - 1);\n reverse(nums, k, nums.length - 1);\n }", "void jokerA() { \n\n\t\tSystem.out.println(\"OG\");\n\t\tprintList(deckRear);\n\n\t\tint target = 27;\n\t\tCardNode prev = null;\n\t\tCardNode pointer = deckRear; \n\n\t\twhile(pointer.cardValue != target){\n\t\t\tprev= pointer;\n\t\t\tpointer = pointer.next;\n\t\t}\n\n\t\tCardNode secondL = deckRear;\n\t\tint x=0;\n\t\twhile(x < 27){\n\t\t\tsecondL = secondL.next;\n\t\t\tx++;\n\t\t}\n\n\n\t\tif(deckRear.cardValue == 27){ //joker is the last card\n\n\t\t\tCardNode temp = deckRear;\n\t\t\tCardNode temp2 = deckRear.next.next;\n\t\t\tdeckRear=deckRear.next;\n\t\t\tdeckRear.next = temp;\n\t\t\tdeckRear.next.next = temp2;\n\t\t\tsecondL.next = deckRear;\n\n\t\t}else{\n\t\t\tCardNode temp= pointer.next.next;\n\t\t\tprev.next= pointer.next;\n\t\t\tprev.next.next = pointer;\n\t\t\tpointer.next= temp ;\n\t\t}\n\t\tSystem.out.println(\"jokerA\");\n\t\tprintList(deckRear);\n\t}", "private void rotateLeftDel (WAVLNode z) {\n\t WAVLNode y = z.right;\r\n\t WAVLNode a = y.left;\r\n\t y.parent=z.parent;\r\n\t if(z.parent!=null) {\r\n\t\t if(parentside(z.parent, z).equals(\"left\")) {\r\n\t\t\t z.parent.left=y;\r\n\r\n\t }\r\n\t else {\r\n\t\t\t z.parent.right=y;\r\n\r\n\t }\r\n\t }\r\n\r\n\t else {\r\n\t\t this.root=y;\r\n\t }\r\n\t \r\n\t y.left = z;\r\n\t y.rank++;\r\n\t z.parent=y;\r\n\t z.right = a;\r\n\t z.rank--;\r\n\t if(a.rank>=0) {\r\n\t\t a.parent=z; \r\n\t }\r\n\t if(z.left==EXT_NODE&&z.right==EXT_NODE&&z.rank!=0) {\r\n\t\t z.rank--;\r\n\t }\r\n\t z.sizen = z.left.sizen+a.sizen+1;\r\n\t y.sizen = z.sizen+y.right.sizen+1;\r\n }", "public int kToTheEnd(int k) {\n\n if(k<1 || k > this.size())\n return 0;\n\n Node p1=head, p2=head;\n\n for(int i=0; i<k; i++) {\n p2=p2.next;\n }\n\n while(null!=p2.next) {\n p1=p1.next;\n p2=p2.next;\n }\n\n print(\"k to end, k:\" + k + \" data: \" + p1.data);\n return p1.data;\n\n }", "private long rightRotate(long n) throws IOException {\n Node current = new Node(n);\r\n long currentLeft = current.left;\r\n Node tempN = new Node(current.left);\r\n current.left = tempN.right;\r\n tempN.right = n;\r\n current.height = getHeight(current);\r\n current.writeNode(n);\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(currentLeft);\r\n return currentLeft;\r\n }", "public void rotateReverse(int[] nums, int k){\n int n = nums.length;\n \n //in case k is greater than the length\n k = k % n;\n \n reverse(nums, 0, n-1);\n reverse(nums, 0, k-1);\n reverse(nums, k, n-1);\n }", "public List<Integer> rotateEfficiently(List<Integer> a, int k, List<Integer> queries) {\n\n List<Integer> newList = new ArrayList<>(a);\n int counter=0;\n int size = a.size();\n for (int count=k;count<k+size;count++) {\n newList.set(counter++, a.get(count%size));\n }\n\n return putInSpecifiedQueries(newList,queries);\n }", "@Override\r\n public void rotateClockwise() {\r\n super.rotateClockwise(); //To change body of generated methods, choose Tools | Templates.\r\n // TODO: Fix me\r\n undo.push('c');\r\n redo = new LinkedListStack();\r\n }", "public void reorderList(ListNode head) {\n\tif (head == null || head.next == null) {\n\t return;\n\t}\n\n\tDeque<Integer> dq = new LinkedList<>();\n\tListNode cur = head;\n\twhile (cur != null) {\n\t dq.add(cur.val);\n\t cur = cur.next;\n\t}\n\n\tListNode cur1 = head;\n\twhile (cur1 != null && cur1.next != null) {\n\t cur1.val = dq.pollFirst();\n\t cur1.next.val = dq.pollLast();\n\t cur1 = cur1.next.next;\n\t}\n\n\tif (cur1 != null) {\n\t cur1.val = dq.poll();\n\t}\n }", "public static int[] rotate(int[] nums, int k) {\n int[] temp = new int[k];\n int acc = k % nums.length;\n for (int i = 0; i < acc; i++) {\n temp[i] = nums[(nums.length - acc) + i];\n }\n for (int i = nums.length - acc - 1; i >= 0; i--) {\n nums[i + acc] = nums[i];\n }\n for (int i = 0; i < acc; i++) {\n nums[i] = temp[i];\n }\n return nums;\n }", "public void rotateLeftWithReverse(int arr[], int n, int k) {\n reverse(arr, 0, k-1);\n\n //reverse last k elements\n reverse(arr, n-k-1, n-1);\n\n //reverse all array\n reverse(arr, 0, n-1);\n printArray(arr);\n\n /*\n * Time Complexity : O(n) loop ran for k times\n * Space Complexity : O(1)\n */\n }", "private Node rotateRight(Node h) {\n Node x = h.left;\n h.left = x.right;\n x.right = h;\n x.color = x.right.color;\n x.right.color = RED;\n x.size = h.size;\n h.size = size(h.left) + size(h.right) + 1;\n return x;\n }", "private Node rotateLeft(Node h){\n\n\t\tNode x = h.right;\n\t\th.right = x.left;\n\t\tx.left = h;\n\t\tx.color = h.color;\n\t\th.color = RED;\n\t\treturn x;\n\t}", "public void rotate(int[] nums, int k) {\n int[] tmp = new int[nums.length];\n for (int i = 0; i < nums.length; ++i) {\n tmp[(i + k) % nums.length] = nums[i];\n }\n\n for (int i = 0; i < nums.length; ++i) {\n nums[i] = tmp[i];\n }\n }", "private void LRRotation(IAVLNode node)\r\n\t{\r\n\r\n\t\tRRRotation(node.getLeft());\r\n\t\tLLRotation(node);\r\n\t}", "public ListNode findK(ListNode head,int k) {\n\t\tListNode fast,slow;\n\t\tfast=slow=head;\n\t\t//Move Kth first\n\t\twhile (k-->0) {\n\t\t\tfast=fast.next();\n\t\t}\n\t\twhile(fast!=null & fast.next()!=null) {\n\t\t\tfast=fast.next();\n\t\t\tslow=slow.next();\t\t\n\t\t}\n\t\treturn slow;\n\t}", "public void rotateNextPlayer(){\n\t\t\n\t\tif(this.toRight)\n\t\t\tthis.nextElem = (this.nextElem + 1) % players.size();\n\t\telse\t\t\t\n\t\t\tthis.nextElem = (this.nextElem - 1 + players.size()) % players.size();\n\t}", "public static Node lastKNode(Node head, int lastK) {\n int k = lastK;\n // 快指针\n Node p = head;\n while((k = k-1) > 0 && p != null) {\n p = p.getNext();\n }\n\n // 慢指针\n Node q = head;\n while(p.getNext() != null) {\n p = p.getNext();\n q = q.getNext();\n }\n return q;\n }", "public ReturnKthToLast() {\n\t\thead = null;\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"LinkedList 1: \");\r\n\t\tListNode<Integer> l1=new ListNode<Integer>(0);\r\n\t\tListNode<Integer> l2=new ListNode<Integer>(1);\r\n\t\tListNode<Integer> l3=new ListNode<Integer>(3);\r\n\t\tListNode<Integer> l4=new ListNode<Integer>(5);\r\n\t\tListNode<Integer> l5=new ListNode<Integer>(7);\r\n\t\tListNode<Integer> l6=new ListNode<Integer>(22);\r\n\t\tl1.next=l2;l2.next=l3;l3.next=l4;l4.next=l5;l5.next=l6;\r\n\t\tdisplay(l1);\r\n\t\tint pos=5;\r\n\t\tremoveKthLastNode(l1,pos);\r\n\t\tSystem.out.println(\"\\nAfter Deletion : \");\r\n\t\tdisplay(l1);\r\n\t\t\r\n\r\n\t}", "public void reorderList(ListNode head) {\n\n if(head == null||head.next == null) return;\n int len = 0;\n\n for (ListNode cur = head; cur!= null; cur = cur.next) len++;\n\n int middle = (len%2 == 1) ? len/2 + 1: len/2 ;\n\n ListNode midNode = head;\n for (int i = 0; i < middle - 1; i++)\n midNode = midNode.next;\n\n ListNode head1 = head;\n ListNode head2 = midNode.next;\n midNode.next = null;\n head2 = revertListAndReturnHead(head2);\n\n //MERGE\n ListNode cur1 = head1;\n ListNode cur2 = head2;\n while (cur1 != null && cur2 != null) {\n ListNode nextCur1 = cur1.next;\n ListNode nextCur2 = cur2.next;\n cur1.next = cur2;\n cur2.next = nextCur1;\n cur1 = nextCur1;\n cur2 = nextCur2;\n }\n\n }", "private void RLRotation(IAVLNode node)\r\n\t{\r\n\t\tLLRotation(node.getRight());\r\n\t\tRRRotation(node);\r\n\t}", "private BinaryNode<AnyType> rotateLeft1(BinaryNode<AnyType>t, AnyType x)\r\n\t{\r\n\t\tBinaryNode<AnyType> no=find(t,x);\r\n\t\tBinaryNode<AnyType> parno=findParentNode(t,x);\r\n\r\n\t\tif(no==parno)\r\n\t\t{\r\n\t\t BinaryNode temp1=parno.left;\r\n\t\t BinaryNode temp2=parno.right;\r\n\t\t BinaryNode temp3=parno.right.left;\r\n\t\t parno.left=null;\r\n\t\t parno.right=null;\r\n\t\t temp2.left=null;\r\n\t\t root=temp2;\r\n\t\t root.left=parno;\r\n\t\t root.left.right=temp3;\r\n\t\t root.left.left=temp1;\r\n\t\t}\r\n\r\n\t\t\r\n\t\tif(no.element.compareTo(parno.element)<0)\r\n\t\t{\r\n\t\t\tBinaryNode temp=parno.left;\r\n\t\t\tparno.left=no.right;\r\n\t\t\ttemp.right=null;\r\n\t\t\tBinaryNode templ=parno.left.left;\r\n\t\t\tparno.left.left=temp;\r\n\t\t\tparno.left.left.right=templ;\r\n\t\t}\r\n\t\t\r\n\t\tif(no.element.compareTo(parno.element)>0)\r\n\t\t{\r\n\t\t\tBinaryNode temp=parno.right;\r\n\t\t\tparno.right=no.right;\r\n\t\t\ttemp.right=null;\r\n\t\t\tBinaryNode templ=parno.right.left;\r\n\t\t\tparno.right.left=temp;\r\n\t\t\tparno.right.left.right=templ;\r\n\t\t}\r\n\t\treturn t;\r\n\t}", "private void doubleRotateLeftDel (WAVLNode z) {\n\t WAVLNode a = z.right.left;\r\n\t WAVLNode y = z.right;\r\n\t WAVLNode c = z.right.left.left;\r\n\t WAVLNode d = z.right.left.right;\r\n\t if(z.parent!=null) {\r\n\t\t if(parentside(z.parent, z).equals(\"left\")) {\r\n\t\t\t z.parent.left=a;\r\n\r\n\t }\r\n\t else {\r\n\t\t\t z.parent.right=a;\r\n\r\n\t }\r\n\t\t \r\n\t }\r\n\t else {\r\n\t\t this.root=a;\r\n\t }\r\n\t a.left=z;\r\n\t a.right=y;\r\n\t a.rank=a.rank+2;\r\n\t a.parent=z.parent;\r\n\t y.parent=a;\r\n\t y.left=d;\r\n\t y.rank--;\r\n\t z.parent=a;\r\n\t z.right=c;\r\n\t z.rank=z.rank-2;\r\n\t c.parent=z;\r\n\t d.parent=y;\r\n\t z.sizen=z.right.sizen+z.left.sizen+1;\r\n\t y.sizen=y.right.sizen+y.left.sizen+1;\r\n\t a.sizen=a.right.sizen+a.left.sizen+1;\r\n }", "public void rightRotate(Node n) {\r\n\t\tNode y = n.left;\r\n\t\tn.left = y.right;\r\n\t\tif(!y.right.isNil)\r\n\t\t\ty.right.parent = n;\r\n\t\ty.parent = n.parent;\r\n\t\tif(n.parent.isNil)\r\n\t\t\troot = y;\r\n\t\telse if(n == n.parent.right)\r\n\t\t\tn.parent.right = y;\r\n\t\telse\r\n\t\t\tn.parent.left = y;\r\n\t\ty.right = n;\r\n\t\tn.parent = y;\r\n\t}", "private void spiralOrder(Node root) \n { \n \n \tLinkedList<Node> ls = new LinkedList<Node>(); \n \n // Push root \n ls.addLast(root); \n \n // Direction 0 shows print right to left \n // and for Direction 1 left to right \n int dir = 0; \n while (ls.size() > 0) \n { \n int size = ls.size(); \n while (size-->0) \n { \n // One whole level \n // will be print in this loop \n \n if (dir == 0) \n { \n Node temp = ls.peekLast(); \n ls.pollLast(); \n if (temp.right != null) \n ls.addFirst(temp.right); \n if (temp.left != null) \n ls.addFirst(temp.left); \n System.out.print(temp.value + \" \"); \n } \n else \n { \n Node temp = ls.peekFirst(); \n ls.pollFirst(); \n if (temp.left != null) \n ls.addLast(temp.left); \n if (temp.right != null) \n ls.addLast(temp.right); \n System.out.print(temp.value + \" \"); \n } \n } \n System.out.println(); \n \n // Direction change \n dir = 1 - dir; \n } \n }", "private BinaryNode<AnyType> rotateRight1(BinaryNode<AnyType>t, AnyType x)\r\n\t{\r\n\t\tBinaryNode<AnyType> no=find(t,x);\r\n\t\tBinaryNode<AnyType> parno=findParentNode(t,x);\r\n\r\n\t\tif(no==parno)\r\n\t\t{\r\n\t\t\tBinaryNode temp1=parno.left;\r\n\t\t BinaryNode temp2=parno.right;\r\n\t\t BinaryNode temp3=parno.left.right;\r\n\t\t parno.left=null;\r\n\t\t parno.right=null;\r\n\t\t temp1.right=null;\r\n\t\t root=temp1;\r\n\t\t root.right=parno;\r\n\t\t root.right.left=temp3;\r\n\t\t root.right.right=temp2;\r\n\t\t}\r\n\t\t\r\n\r\n\t\tif(no.element.compareTo(parno.element)<0)\r\n\t\t{\r\n\t\t\tBinaryNode temp = parno.left;\r\n\t\t\tparno.left=no.left;\r\n\t\t\ttemp.left=null;\r\n\t\t\tBinaryNode tempr=parno.left.right;\r\n\t\t\tparno.left.right=temp;\r\n\t\t\tparno.left.right.left=tempr;\r\n\t\t}\r\n\r\n\t\tif(no.element.compareTo(parno.element)>0)\r\n\t\t{\r\n\t\t\tBinaryNode temp = parno.right;\t\t\r\n\t\t\tparno.right=no.left;\r\n\t\t\ttemp.left=null;\r\n\t\t\tBinaryNode tempr=parno.right.right;\r\n\t\t\tparno.right.right=temp;\r\n\t\t\tparno.right.right.left=tempr;\r\n\r\n\t\t}\r\n\t\treturn t;\r\n\t}", "static int reverseRecursiveTravesal(Node node, int k) {\n\t\tif(node == null)\n\t\t\treturn -1;\n\t\t\n\t\tint indexFromLast = reverseRecursiveTravesal(node.getNext(), k) + 1;\n\t\tif(indexFromLast == k) \n\t\t\tSystem.out.println(node.getData());\n\t\t\n\t\treturn indexFromLast;\n\t\t\n\t}", "public void Free_SSL(int k){\n // Link deleted element to a alternate link list\n // Let free element become the second element of alternate link list\n StaticLinkList[k].cur = StaticLinkList[0].cur;\n // Let the deleted element become the first element of alternate link list\n StaticLinkList[0].cur = k;\n }", "private void rotateRightDel (WAVLNode z) {\n\t WAVLNode x = z.left;\r\n\t WAVLNode d = x.right;\r\n\t x.parent=z.parent;\r\n\t if(z.parent!=null) {\r\n\t\t if(parentside(z.parent, z).equals(\"left\")) {\r\n\t\t\t z.parent.left=x;\r\n\r\n\t }\r\n\t else {\r\n\t\t\t z.parent.right=x;\r\n\r\n\t }\r\n\t }\r\n\r\n\t else {\r\n\t\t this.root=x;\r\n\t }\r\n\t x.right = z;\r\n\t x.rank++;\r\n\t z.parent=x;\r\n\t z.left = d;\r\n\t z.rank--;\r\n\t if(d.rank>=0) {\r\n\t\t d.parent=z; \r\n\t }\r\n\t if(z.left==EXT_NODE&&z.right==EXT_NODE&&z.rank!=0) {\r\n\t\t z.rank--;\r\n\t }\r\n\t z.sizen = z.right.sizen+d.sizen+1;\r\n\t x.sizen = z.sizen+x.left.sizen+1;\r\n }", "public int kthFromEnd(int k) {\r\n\r\n if (head == null) {\r\n return 0;\r\n }\r\n Node lead = head;\r\n while (k >= 0) {\r\n lead = lead.next;\r\n k--;\r\n }\r\n Node tail = head;\r\n while (lead != null) {\r\n lead = lead.next;\r\n tail = tail.next;\r\n }\r\n int i = tail.data;\r\n return i;\r\n }", "public static LinkedList reverseLinkedList(LinkedList head) {\n // Write your code here.\n if (head.next == null)\n return head;\n\n // Eg: 1 -> 2 -> 3 -> null;\n\n // 1 is made as currentNode\n // 2 is captured as nextNode from currentNode next, after capturing\n // make current node as tail by making its next to null\n\n var currNode = head;\n var nextNode = head.next;\n currNode.next = null;\n // iterate until nextNode becomes null.\n // before changing nextNode next pointer to currentNode, hold it in temp\n // make nextNode next pointer to currentNode\n // make currentNode as nextNode\n // make nextNode as captured temp.\n while(nextNode != null) {\n var temp = nextNode.next;\n nextNode.next = currNode;\n currNode = nextNode;\n nextNode = temp;\n }\n return currNode;\n }", "public LinkedListIterator(){\n position = null;\n previous = null; \n isAfterNext = false;\n }", "public boolean insertFront(int value) {\n if(size == k) return false;\n DoublyLinkedList temp = new DoublyLinkedList(value);\n DoublyLinkedList curr = head.next;\n head.next = temp;\n temp.prev = head;\n temp.next = curr;\n curr.prev = temp;\n size += 1;\n return true;\n}", "public synchronized void rotate(Object o) {\n dataSource.rotateItem(o);\n // remove the first item from the queue, but do not decrease size so it will be picked up again\n buffer.poll();\n }", "private static Node reverseLinkedList(Node head) {\n\t\t \n\t\tNode prev = null;\n\t\tNode next = null;\n\t\t\n\t\t// check boundary condition\n\t\tif(head ==null)\n\t\t\t\n\t\t\t\n\t\t\treturn head;\n\t\t\n\t\tnext = head.rightSibling;\n\t\twhile(next!=null) {\n\t\t\t// point current node backwards\n\t\t\thead.rightSibling = prev;\n\t\t\t\n\t\t\t// move all three pointers ahead\n\t\t\tprev = head;\n\t\t\thead = next;\n\t\t\tnext = next.rightSibling;\n\t\t}\n\t\t\n\t\t// Point last node backwards\n\t\thead.rightSibling = prev;\n\t\treturn head;\n\t}", "private Node rotateRight(Node h){\n\t\tNode x = h.left;\n\t\th.left = x.right;\n\t\tx.right = h;\n\t\tx.color = h.color;\n\t\th.color = RED;\n\t\treturn x;\n\t}", "public final void rot() {\n\t\tif (size > 2) {\n\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tdouble thirdTopMostValue = pop();\n\n\t\t\tpush(secondTopMostValue);\n\t\t\tpush(topMostValue);\n\t\t\tpush(thirdTopMostValue);\n\n\t\t}\n\t}", "public static Node rearrange(Node head)\n\t {\n\t if (head == null || head.next == null) {\n\t return head;\n\t }\n\t \n\t Node curr = head, prev = null;\n\t \n\t // consider two nodes at a time and swap their links\n\t while (curr != null && curr.next != null)\n\t {\n\t Node temp = curr.next;\n\t curr.next = temp.next;\n\t temp.next = curr;\n\t \n\t if (prev == null) {\n\t head = temp;\n\t }\n\t else {\n\t prev.next = temp;\n\t }\n\t \n\t prev = curr;\n\t curr = curr.next;\n\t }\n\t \n\t return head;\n\t }" ]
[ "0.7966714", "0.79058856", "0.78949255", "0.7865921", "0.7744919", "0.77034134", "0.7201035", "0.6951432", "0.6936748", "0.68897617", "0.6852235", "0.68240076", "0.68081367", "0.6802204", "0.6752109", "0.6604176", "0.6598208", "0.65759826", "0.65539616", "0.65023196", "0.6493641", "0.6479472", "0.6443086", "0.63707906", "0.6366564", "0.6313765", "0.6312053", "0.6297562", "0.6237204", "0.6225768", "0.6164499", "0.6146085", "0.6092524", "0.60438466", "0.6031427", "0.6003974", "0.6000179", "0.597229", "0.59499884", "0.5922194", "0.5887691", "0.58687013", "0.58318275", "0.5828087", "0.5825591", "0.58252174", "0.5772138", "0.573787", "0.5734742", "0.57294387", "0.5715545", "0.571186", "0.5693378", "0.5687333", "0.5654113", "0.5643691", "0.5616041", "0.5613057", "0.5610701", "0.56092566", "0.5595266", "0.5594476", "0.55913264", "0.5589415", "0.5588927", "0.55829495", "0.55788445", "0.5549893", "0.5530794", "0.5513567", "0.550715", "0.54586583", "0.5454821", "0.5448732", "0.5448594", "0.5442473", "0.54369", "0.5423717", "0.54195666", "0.54171693", "0.541712", "0.5402531", "0.5400766", "0.53927195", "0.5382561", "0.53689", "0.53681123", "0.5364298", "0.5362988", "0.5359673", "0.53306746", "0.53289354", "0.5325981", "0.53221196", "0.5308077", "0.52913177", "0.52892107", "0.52889997", "0.5281423", "0.5277857" ]
0.7796688
4
/ Rotate Right: Eg:Input: 1>2>3>4>5>NULL, k = 2; Output: 4>5>1>2>3>NULL
public ListNode rotateRight(ListNode head, int k) { int size = listSize(head); if (head == null || k <= 0 || k == size) return head; if (k > size) k %= size; int count = 1; ListNode curr = head; k = size - k; while (count < k && curr != null) { curr = curr.next; count++; } ListNode nextHead = curr; while (curr.next != null) curr = curr.next; curr.next = head; head = nextHead.next; nextHead.next = null; return head; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void rightRotate(int[] nums, int k) {\r\n\t if (nums.length == 0) return;\r\n\t \r\n\t k %= nums.length;\r\n\t \r\n\t if (k == 0) return;\r\n\t \r\n\t int left=0, right=nums.length-1, tmp;\r\n\t \r\n\t while(left < right) {\r\n\t tmp = nums[left];\r\n\t nums[left] = nums[right];\r\n\t nums[right] = tmp;\r\n\t \r\n\t left++;\r\n\t right--;\r\n\t }\r\n\t \r\n\t left=0;\r\n\t right=k-1;\r\n\t \r\n\t while(left < right) {\r\n\t \ttmp = nums[left];\r\n\t \tnums[left] = nums[right];\r\n\t \tnums[right] = tmp;\r\n\t \t \r\n\t \tleft++;\r\n\t \tright--;\r\n\t }\r\n\t \r\n\t left=k;\r\n\t right=nums.length-1;\r\n\t \r\n\t while(left < right) {\r\n\t \ttmp = nums[left];\r\n\t \tnums[left] = nums[right];\r\n\t \tnums[right] = tmp;\r\n\t \t \r\n\t \tleft++;\r\n\t \tright--;\r\n\t }\r\n\t }", "public ListNode rotateRight(ListNode head, int k) {\n \tif (head == null || k == 0 || head.next == null)\n \t\treturn head;\n \tint size = 1;\n \tListNode curr = head,end=head;\n \tListNode newHead = new ListNode(0);\n \twhile (end.next != null){\n \t\tend = end.next;\n \t\tsize++;\n \t}\n \tif (k%size == 0)\n\t return head;\n \tint start = 1;\n \twhile(start < size - k%size){\n \t\tcurr = curr.next;\n \t\tstart++;\n \t}\n \tnewHead.next = curr.next;\n \tcurr.next = null;\n \tend.next = head;\n \treturn newHead.next;\n }", "public void rotateReverse(int[] nums, int k){\n int n = nums.length;\n \n //in case k is greater than the length\n k = k % n;\n \n reverse(nums, 0, n-1);\n reverse(nums, 0, k-1);\n reverse(nums, k, n-1);\n }", "public void rotateNoSpace(int[] nums, int k){\n //in case k is greater than the length\n k = k % nums.length;\n \n for(int i = 0; i < k; i++){\n int last = nums[nums.length-1];\n for(int j = nums.length - 1; j >= 1; j--){\n nums[j] = nums[j-1];\n }\n nums[0] = last;\n }\n }", "public static <V> ListNode<V> Rotate (\n\t\tfinal ListNode<V> head,\n\t\tfinal int k)\n\t{\n\t\tif (null == head || 0 >= k)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tint rotationCount = 0;\n\t\tListNode<V> prevNode = null;\n\t\tListNode<V> currentNode = head;\n\n\t\tListNode<V> nextNode = head.next();\n\n\t\twhile (++rotationCount < k)\n\t\t{\n\t\t\tif (null == nextNode)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tprevNode = currentNode;\n\t\t\tcurrentNode = nextNode;\n\n\t\t\tnextNode = nextNode.next();\n\t\t}\n\n\t\tif (!prevNode.setNext (\n\t\t\tnull\n\t\t))\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tListNode<V> rotatedHead = currentNode;\n\n\t\tnextNode = currentNode.next();\n\n\t\twhile (null != nextNode)\n\t\t{\n\t\t\tcurrentNode = nextNode;\n\n\t\t\tnextNode = nextNode.next();\n\t\t}\n\n\t\treturn currentNode.setNext (\n\t\t\thead\n\t\t) ? rotatedHead : null;\n\t}", "private AvlNode<E> rotateWithRightChild(AvlNode<E> k1){\n AvlNode<E> k2 = k1.right;\n k1.right = k2.left;\n k2.left = k1;\n k1.height = max(height(k1.left), height(k2.right)) + 1;\n k2.height = max(k1.height, height(k2.right)) + 1;\n return k2;\n }", "private long removeHelper(long r, int k) throws IOException {\n if (r == 0) {\r\n return 0;\r\n }\r\n long ret = r;\r\n Node current = new Node(r);\r\n if (current.key == k) {\r\n if (current.left == 0) {\r\n ret = current.right;\r\n addToFree(r);\r\n }\r\n else if (current.right == 0) {\r\n ret = current.left;\r\n addToFree(r);\r\n }\r\n else {\r\n current.left = replace(current.left, current);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n }\r\n }\r\n else if (current.key > k) {\r\n current.left = removeHelper(current.left, k);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n }\r\n else {\r\n current.right = removeHelper(current.right, k);\r\n current.height = getHeight(current);\r\n current.writeNode(r);\r\n }\r\n int heightDifference = getHeightDifference(r);\r\n if (heightDifference < -1) {\r\n if (getHeightDifference(current.right) > 0) {\r\n current.right = rightRotate(current.right);\r\n current.writeNode(r);\r\n return leftRotate(r);\r\n }\r\n else {\r\n return leftRotate(r);\r\n }\r\n }\r\n else if (heightDifference > 1) {\r\n if (getHeightDifference(current.left) < 0) {\r\n current.left = leftRotate(current.left);\r\n current.writeNode(r);\r\n return rightRotate(r);\r\n }\r\n else {\r\n return rightRotate(r);\r\n }\r\n }\r\n return ret;\r\n }", "public void rotate(int[] nums, int k) {\n \n k = k % nums.length;\n reverse(nums, 0, nums.length-1);\n reverse(nums, 0, k-1);\n reverse(nums, k, nums.length-1);\n }", "public ListNode rotateRight(ListNode head, int n) {\n if(n == 0 || head == null) {\r\n return head;\r\n } \r\n ListNode curr = head;\r\n int length = 0;\r\n while(curr!=null) {\r\n length++;\r\n curr = curr.next;\r\n }\r\n n = n % length;\r\n //skip the zero\r\n if(n == 0) {\r\n return head;\r\n }\r\n //do the rotating\r\n ListNode newHead = new ListNode(-1);\r\n newHead.next = head;\r\n \r\n int step = length - n;\r\n curr = newHead;\r\n for(int i = 0; i < step; i++) {\r\n curr = curr.next;\r\n }\r\n \r\n //be aware need to break the loop\r\n ListNode tmp = curr.next;\r\n curr.next = null;\r\n curr = tmp;\r\n \r\n newHead.next = curr;\r\n while(curr.next != null) {\r\n curr = curr.next;\r\n }\r\n curr.next = head;\r\n \r\n return newHead.next;\r\n }", "public ListNode rotateLeft(ListNode head, int k) {\r\n\t\tif (k <= 0) return head;\r\n\t\tListNode curr = head;\r\n\t\tint count = 1;\r\n\t\twhile (count++ < k && curr != null)\r\n\t\t\tcurr = curr.next;\r\n\t\tif (curr == null) return head;\r\n\t\tListNode nextHead = curr;\r\n\t\twhile (curr.next != null)\r\n\t\t\tcurr = curr.next;\r\n\t\tcurr.next = head;\r\n\t\thead = nextHead.next;\r\n\t\tnextHead.next = null;\r\n\t\treturn head;\r\n\t}", "public ListNode SolveByMovingPointers(ListNode head, int k)\n {\n // Edge cases\n if (head == null)\n return null;\n if (k == 0)\n return head;\n\n // Calculate list length + actual number of rotations\n int listLength = FindLength(head);\n int numberOfRotations = k >= listLength? k % listLength : k;\n\n // Another edge case - may not need to rotate at all\n if (listLength == 1 || numberOfRotations == 0)\n return head;\n\n // Iterate to the node before the node with number that needs to be rotated to beginning...\n ListNode oldHeadIterator = head;\n int counter = listLength - numberOfRotations - 1;\n while (counter != 0)\n {\n counter -= 1;\n oldHeadIterator = oldHeadIterator.next;\n }\n\n // ... Then make the following node be the beginning of new head + nullify tail of old head\n ListNode newHead = oldHeadIterator.next;\n oldHeadIterator.next = null;\n\n // Iterate to end of the new head, then simply add the old head contents to the tail\n ListNode newHeadIterator = newHead;\n while (newHeadIterator.next != null)\n newHeadIterator = newHeadIterator.next;\n newHeadIterator.next = head;\n\n return newHead;\n }", "public void rotateold2(int[] a, int k) {\n\n\t\tif (a == null || a.length == 0)\n\t\t\treturn;\n\n\t\tint jump = 0, len = a.length, cur = a[0], next, count = 0;\n\n\t\tk %= len; \n\t\tif (k == 0) return;\n\n\t\tif (len % k != 0 || k == 1)\n\t\t{ \n\t\t\tint i = 0;\n\t\t\twhile (i < len)\n\t\t\t{\n\t\t\t\tjump = (jump + k) % len;\n\t\t\t\tnext = a[jump];\n\t\t\t\ta[jump] = cur;\n\t\t\t\tcur = next;\n\t\t\t\ti++;\n\t\t\t} \n\t\t} \n\t\telse\n\t\t{\n\t\t\tfor (int i = 0; i <= len/k; i ++)\n\t\t\t{\n\t\t\t\tint start = 0;\n\t\t\t\tjump = i;\n\t\t\t\tnext = a[jump];\n\t\t\t\tcur = a[i];\n\t\t\t\twhile (start <= len/k)\n\t\t\t\t{\n\t\t\t\t\tjump = (jump + k) % len;\n\t\t\t\t\tnext = a[jump];\n\t\t\t\t\ta[jump] = cur;\n\t\t\t\t\tcur = next;\n\t\t\t\t\tstart++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void rotateReverse(int[] nums, int k) {\n\t\tint n = nums.length;\n\t\tk %= n;\n\t\treverse(nums, 0, n - 1);\n\t\treverse(nums, 0, k - 1);\n\t\treverse(nums, k, n - 1);\n\t}", "public ListNode rotateRight(ListNode head, int n) {\n \n if (head == null || head.next == null)\n return head;\n int i = 0;\n ListNode tail = head;\n ListNode dummy = new ListNode(0);\n dummy.next = head;\n ListNode pre = dummy;\n \n // get the length of the list\n int len = 0;\n while (head != null){\n head = head.next;\n len ++;\n if (head != null)\n tail = head;\n }\n head = dummy.next;\n if (n%len == 0)\n\t\t return dummy.next;\n\t n = len - n%len;\n\t ListNode cur = dummy.next;\n while (i < n){\n pre = cur;\n cur = cur.next;\n i++;\n }\n dummy.next = cur;\n tail.next = head;\n pre.next = null;\n return dummy.next;\n }", "public void rotate2(int[] nums, int k) {\n int start = 0, n = nums.length;\n k %= n;\n while (n > 0 && k > 0) {\n // Swap the last k elements with the first k elements.\n // The last k elements will be in the correct positions\n // but we need to rotate the remaining (n - k) elements\n // to the right by k steps.\n for (int i = 0; i < k; i++) {\n swap(nums, i + start, n - k + i + start);\n }\n n -= k;\n start += k;\n k %= n;\n }\n }", "public static Nodelink rotate(Nodelink node, int k){ 1 2 3 4 5\n //\n\n Nodelink head = node;\n Nodelink temp = null;\n Nodelink temp2 = null;\n\n for(int i = 0; i < k; i++){\n while(node != null){\n\n temp = node;\n temp2 = node.next;\n\n node.next = temp;\n\n\n node = node.next;\n\n }\n\n head = node;\n }\n\n\n return head;\n }", "public void rotateLeftWithReverse(int arr[], int n, int k) {\n reverse(arr, 0, k-1);\n\n //reverse last k elements\n reverse(arr, n-k-1, n-1);\n\n //reverse all array\n reverse(arr, 0, n-1);\n printArray(arr);\n\n /*\n * Time Complexity : O(n) loop ran for k times\n * Space Complexity : O(1)\n */\n }", "public static int[] rotate(int[] nums, int k) {\n int[] temp = new int[k];\n int acc = k % nums.length;\n for (int i = 0; i < acc; i++) {\n temp[i] = nums[(nums.length - acc) + i];\n }\n for (int i = nums.length - acc - 1; i >= 0; i--) {\n nums[i + acc] = nums[i];\n }\n for (int i = 0; i < acc; i++) {\n nums[i] = temp[i];\n }\n return nums;\n }", "public ListNode rotateRight(ListNode head, int n) {\n \n int len = 0;\n \n if (head == null) return head;\n \n ListNode node = head;\n ListNode prev = head;\n \n while (node != null) {\n prev = node;\n node = node.next;\n len++;\n }\n \n n = n % len;\n \n if (n == 0) return head;\n \n int current = 1;\n \n prev.next = head;\n \n node = head;\n \n while (current < len - n) {\n node = node.next;\n current++;\n }\n \n prev = node.next;\n node.next = null;\n \n return prev;\n }", "public ListNode rotateRight(ListNode head, int n) {\n if(n==0||head==null)\n return head;\n ListNode fast=head;\n ListNode slow=head;\n ListNode res=new ListNode(0);\n res.next=head;\n \n int count=0;\n for(int i=0;i<n;i++){\n if(fast==null){\n break; \n }else{\n count++;\n fast=fast.next;\n }\n }\n \n if(fast==null)\n return rotateRight(head,n%count);\n \n while(fast.next!=null){\n fast=fast.next;\n slow=slow.next;\n }\n \n ListNode b=slow.next;\n \n res.next=b;\n slow.next=null;\n fast.next=head;\n \n return res.next;\n }", "public static void rotate(int[] nums, int k) {\n // get the kth index from the end to rotate\n\t\tint n = nums.length;\n\t\tk = k % n ;\n\t\tif(k == 0) return ;\n\t\tint prev = 0, tmp = 0;\n\t\tfor(int i = 0 ; i < k ; i++) {\n\t\t\tprev = nums[n - 1];\n\t\t\tfor(int j = 0 ; j < nums.length ; j++) {\n\t\t\t\ttmp = nums[j];\n\t\t\t\tnums[j] = prev;\n\t\t\t\tprev = tmp;\n\t\t\t}\n\t\t}\n }", "private long rightRotate(long n) throws IOException {\n Node current = new Node(n);\r\n long currentLeft = current.left;\r\n Node tempN = new Node(current.left);\r\n current.left = tempN.right;\r\n tempN.right = n;\r\n current.height = getHeight(current);\r\n current.writeNode(n);\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(currentLeft);\r\n return currentLeft;\r\n }", "public void rotate(int [] a, int k)\n\t{\n\t\tif (a == null || k == 0)\n\t\t\treturn;\n\n\t\tint [] b = new int[a.length];\n\t\tfor (int i = 0; i < a.length; i++)\n\t\t{\n\t\t\tint jump = (i + k) % a.length;\n\t\t\tb[jump] = a[i];\n\t\t}\n\t\tfor (int i = 0; i <a.length;i++)\n\t\t{\n\t\t\ta[i] = b[i];\n\t\t}\n\t}", "public static int[] RotateByGivenNumber(int[] num, int k) \n\t{\n\t\tif(num == null || num.length == 0 || k < 0)\n\t\t\tthrow new IllegalArgumentException(\"Illegal argument!\");\n\t\t// This will take care of the value of k greater then the length of array\n\t\tif(k > num.length)\n\t\t\tk = k % num.length;\n\t\tint div = num.length - k; // get the remaining segment of the array.\n\t\t//Reverse(num,0,num.length-1); // rotate left side\n\t\tReverse(num,0,div-1); // rotate right side\n\t\tReverse(num,div,num.length-1); // keep in middle to rotate right and left\n\t\tReverse(num,0,num.length-1); // rotate right side\n\t\t//Reverse(num,0,div-1); // rotate left side\n\t\t//for(int e : Reverse(num,0,num.length-1))\n\t\t//\tSystem.out.println(e);\n\t\t\n\t\treturn num;\n\t}", "public void rotate1(int[] nums, int k) {\n k %= nums.length;\n reverse(nums, 0, nums.length - 1);\n reverse(nums, 0, k - 1);\n reverse(nums, k, nums.length - 1);\n }", "public void rotate(int[] nums, int k) {\n\t\tif(nums == null || nums.length == 0 || k <= 0){\n\t\t\treturn;\n\t\t}\n\t\tint n = nums.length, count = 0;\n\t\tk %= n;\n\t\tfor(int start = 0; count < n; start++){\n\t\t\tint cur = start;\n\t\t\tint prev = nums[start];\n\t\t\tdo{\n\t\t\t\tint next = (cur + k) % n;\n\t\t\t\tint temp = nums[next];\n\t\t\t\tnums[next] = prev;\n\t\t\t\tcur = next;\n\t\t\t\tprev = temp;\n\t\t\t\tcount++;\n\t\t\t}while(start != cur);\n\t\t}\n\t}", "private Node rotateRight(Node h) {\n Node x = h.left;\n h.left = x.right;\n x.right = h;\n x.color = x.right.color;\n x.right.color = RED;\n x.size = h.size;\n h.size = size(h.left) + size(h.right) + 1;\n return x;\n }", "public int[] rotate2(int[] arr, int k) {\n\t\tif (arr == null || k < 0)// handles exceptions\n\t\t\tthrow new IllegalArgumentException(\"Illegal argument!\");\n\n\t\t// Goes through entire array for each space shifted\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\t// Go through the array starting at the end\n\t\t\tfor (int j = arr.length - 1; j > 0; j--) {\n\n\t\t\t\t// Shifts the value at the current index back one space:\n\t\t\t\tint temp = arr[j];\n\t\t\t\tarr[j] = arr[j - 1];\n\t\t\t\tarr[j - 1] = temp;\n\t\t\t} // end for loop\n\t\t} // end for loop\n\n\t\treturn arr;\n\n\t}", "private void rightRotate(int[] nums, int n) {\n\t\tint temp;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ttemp = nums[nums.length - 1];\n\t\t\tfor (int j = nums.length - 1; j > 0; j--) {\n\t\t\t\tnums[j] = nums[j - 1];\n\n\t\t\t}\n\n\t\t\tnums[0] = temp;\n\n\t\t}\n\t\tSystem.out.println(Arrays.toString(nums));\n\n\t}", "public ListNode rotateRight(ListNode head, int n) {\n if(head==null)\n return null;\n ListNode p2=head;\n ListNode p1=head;\n ListNode newhead=head;\n int count=0;\n \n if(n==0)\n return head;\n \n for(int i=0;i<n;i++)\n {\n p1=p1.next;\n count++;\n if(p1==null)\n break;\n }\n \n if(count==1&&p1==null)\n return head;\n \n if(p1==null)\n {\n p1=head;\n n=n%count;\n if(n==0)\n return head;\n for(int i=0;i<n;i++)\n {\n p1=p1.next; \n }\n while(p1.next!=null)\n {\n p1=p1.next;\n p2=p2.next;\n }\n ListNode tail=p2;\n newhead=p2.next;\n while(tail.next!=null)\n tail=tail.next;\n tail.next=head;\n p2.next=null;\n }\n else\n {\n while(p1.next!=null)\n {\n p1=p1.next;\n p2=p2.next;\n }\n ListNode tail=p2;\n newhead=p2.next;\n while(tail.next!=null)\n {\n tail=tail.next;\n }\n tail.next=head;\n p2.next=null;\n }\n \n return newhead;\n }", "public void rotate(int[] nums, int k) {\n int[] tmp = new int[nums.length];\n for (int i = 0; i < nums.length; ++i) {\n tmp[(i + k) % nums.length] = nums[i];\n }\n\n for (int i = 0; i < nums.length; ++i) {\n nums[i] = tmp[i];\n }\n }", "public ListNode rotateRight(ListNode head, int n) {\r\n\t\t// Note: The Solution object is instantiated only once and is reused by\r\n\t\t// each test case.\r\n\t\tif (null == head) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tListNode p = head;\r\n\t\tint length = 0;\r\n\t\twhile (null != p) {\r\n\t\t\tp = p.next;\r\n\t\t\tlength++;\r\n\t\t}\r\n\t\tif (n % length == 0) {\r\n\t\t\treturn head;\r\n\t\t} else {\r\n\t\t\tn = n % length;\r\n\t\t}\r\n\t\tint num = n;\r\n\t\tListNode first = head;\r\n\t\tListNode second = head;\r\n\t\twhile (num > 0) {\r\n\t\t\tfirst = first.next;\r\n\t\t\tnum--;\r\n\t\t}\r\n\r\n\t\twhile (null != first.next) {\r\n\t\t\tfirst = first.next;\r\n\t\t\tsecond = second.next;\r\n\t\t}\r\n\r\n\t\tListNode newHead = second.next;\r\n\t\tsecond.next = null;\r\n\t\tfirst.next = head;\r\n\t\treturn newHead;\r\n\t}", "static void rotate_right(int[] arr, int rotate){\n for (int j = 0; j < rotate; j++) {\n int temp = arr[j];\n for (int i = j; i < arr.length+rotate; i+=rotate) {\n if(i-rotate < 0)\n temp = arr[i];\n else if(i >= arr.length)\n arr[i-rotate] = temp;\n else\n arr[i-rotate] = arr[i]; \n }\n }\n }", "public void rightRotate(Node n) {\r\n\t\tNode y = n.left;\r\n\t\tn.left = y.right;\r\n\t\tif(!y.right.isNil)\r\n\t\t\ty.right.parent = n;\r\n\t\ty.parent = n.parent;\r\n\t\tif(n.parent.isNil)\r\n\t\t\troot = y;\r\n\t\telse if(n == n.parent.right)\r\n\t\t\tn.parent.right = y;\r\n\t\telse\r\n\t\t\tn.parent.left = y;\r\n\t\ty.right = n;\r\n\t\tn.parent = y;\r\n\t}", "public ListNode SolveUsingAdditionalLinkedList(ListNode head, int k)\n {\n // Edge cases\n if (head == null)\n return null;\n if (k == 0)\n return head;\n\n // Create blank list to store new result\n ListNode result = new ListNode(-1, null);\n\n // Find the length of the list\n int listLength = FindLength(head);\n\n // Calculate the actual number of rotations (since k can be greater than list length)\n int numberOfRotations = k >= listLength? k % listLength : k;\n\n // Another edge case - may not need to rotate at all\n if (listLength == 1 || numberOfRotations == 0)\n return head;\n\n // Iterate through list until we get to the numbers that need to be moved to beginning...\n int counter = listLength - numberOfRotations;\n ListNode temp = head;\n while (counter != 0)\n {\n temp = temp.next;\n counter -= 1;\n }\n\n // ... Then add the rotated numbers to list\n while (temp != null)\n {\n AddLast(result, temp.val);\n temp = temp.next;\n }\n\n // Lastly, reset counters and add the remaining numbers to the back\n counter = listLength - numberOfRotations;\n temp = head;\n while (counter != 0)\n {\n AddLast(result, temp.val);\n temp = temp.next;\n counter -= 1;\n }\n\n // Since result is dummy node, return result.next\n return result.next;\n }", "public abstract void rotateRight();", "public ListNode rotateKplace(ListNode head, int n) {\n if (head == null) return head;\n\n int len = getLen(head);\n int half = n % len;\n if (half == 0) return head;\n\n int index = len - half; // index to rotate\n ListNode curr = head;\n\n for (int i = 0; i < index - 1; i++) {\n curr = curr.next;\n } // curr is last node before rotate\n\n ListNode h1 = curr.next;\n curr.next = null;\n\n ListNode tail = h1;\n while (tail.next != null) {\n tail = tail.next;\n }\n tail.next = head;\n return h1;\n }", "private void rotateRightDel (WAVLNode z) {\n\t WAVLNode x = z.left;\r\n\t WAVLNode d = x.right;\r\n\t x.parent=z.parent;\r\n\t if(z.parent!=null) {\r\n\t\t if(parentside(z.parent, z).equals(\"left\")) {\r\n\t\t\t z.parent.left=x;\r\n\r\n\t }\r\n\t else {\r\n\t\t\t z.parent.right=x;\r\n\r\n\t }\r\n\t }\r\n\r\n\t else {\r\n\t\t this.root=x;\r\n\t }\r\n\t x.right = z;\r\n\t x.rank++;\r\n\t z.parent=x;\r\n\t z.left = d;\r\n\t z.rank--;\r\n\t if(d.rank>=0) {\r\n\t\t d.parent=z; \r\n\t }\r\n\t if(z.left==EXT_NODE&&z.right==EXT_NODE&&z.rank!=0) {\r\n\t\t z.rank--;\r\n\t }\r\n\t z.sizen = z.right.sizen+d.sizen+1;\r\n\t x.sizen = z.sizen+x.left.sizen+1;\r\n }", "private Node rotateRight(Node h){\n\t\tNode x = h.left;\n\t\th.left = x.right;\n\t\tx.right = h;\n\t\tx.color = h.color;\n\t\th.color = RED;\n\t\treturn x;\n\t}", "public int[] rotate(int[] arr, int k) {\n\t\tif (k > arr.length)// if k>n or (steps rotated)>(num of elts)\n\t\t\tk = k % arr.length;// then k is changed to k mod n\n\n\t\t// Create a new array of the same length\n\t\tint[] result = new int[arr.length];\n\n\t\tfor (int i = 0; i < k; i++)\n\t\t\tresult[i] = arr[arr.length - k + i];\n\n\t\tint j = 0;\n\t\tfor (int i = k; i < arr.length; i++) {\n\t\t\tresult[i] = arr[j];\n\t\t\tj++;\n\t\t}\n\n\t\t// Copy the shifted array into the original\n\t\tSystem.arraycopy(result, 0, arr, 0, arr.length);\n\t\treturn arr;\n\n\t}", "public static void rotate1 (int [] nums, int k ) {\n\t\tint n = nums.length;\n\t\tk = k % n ;\n\t\tif(k == 0) return ;\n\t\tint prev = 0, currIndex = 0, temp = 0, count = 0;\n\t\tfor(int start = 0 ; count < nums.length ; start++) {\n\t\t\tprev = nums[start];\n\t\t\tcurrIndex = start;\n\t\t\t// keep rotating till reach the initial point\n\t\t\tdo {\n\t\t\t\tint nextIndex = (currIndex + k) % n;\n\t\t\t\ttemp = nums[nextIndex];\n\t\t\t\tnums[nextIndex] = prev;\n\t\t\t\tprev = temp;\n\t\t\t\tcurrIndex = nextIndex;\n\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t} while(start != currIndex);\n\t\t}\n\t}", "private Node rotateRight() {\n Node left = this.leftChild;\n this.leftChild = left.rightChild;\n left.rightChild = this;\n\n this.updateHeight();\n left.updateHeight();\n\n return left;\n }", "public Node rotateRight(Node n)\r\n\t{\r\n\t\tNode target = n.left;//rotate target to node\r\n\t\tNode subTree = target.right;//get its subtree\r\n\t\t\r\n\t\ttarget.right = n; //set targets old sub tree to nodes sub tree\r\n\t\tn.left =subTree;// set old sub tree to nodes subtree\r\n\t\t\r\n\t\t//increment the height of the tree\r\n\t\tn.height = maxHeight(height(n.left),height(n.right))+1;\r\n\t\ttarget.height = maxHeight(height(target.left),height(target.right))+1;\r\n\t\t\r\n\t\treturn target;\r\n\t}", "private void rotateRight(Node tree) {\n assert tree != null;\n assert tree.left != null;\n\n Node temp = tree.left;\n tree.left = temp.right;\n if(temp.right != null) { //no null pointers\n temp.right.parent = tree;\n }\n temp.parent = tree.parent;\n if(temp.parent != null) { //am i at the root?\n if(temp.parent.left == tree) {\n temp.parent.left = temp;\n } else if (temp.parent.right == tree) {\n temp.parent.right = temp;\n }\n }\n tree.parent = temp;\n temp.right = tree;\n if(tree == root) { root = temp; } //rewrite the root\n rotations += 1;\n }", "protected Node<E> rotateRight( Node<E> root ) {\n\n if( root == null || root.left == null ) {\n return null;\n }\n\n Node<E> tempNode = root.left;\n root.left = tempNode.right;\n tempNode.right = root;\n return tempNode;\n\n }", "public static void rotateAntiClockWise(int[] arr, int k)\r\n {\r\n\t for(int i=0; i< k; i++)\r\n\t {\r\n\t\t for(int j=0; j<arr.length-1; j++)\r\n\t\t {\r\n\t\t\t int temp = arr[j+1];\r\n\t\t\t arr[j+1] = arr[j];\r\n\t\t\t arr[j] = temp;\r\n\t\t\t\r\n\t\t }\r\n\t }\r\n }", "public static ListNode reverseKGroup(ListNode head, int k) {\n\t\tListNode runner = head;\n\t\tint counter = 0;\n\t\twhile(runner != null){\n\t\t\trunner = runner.next;\n\t\t\tcounter++;\n\t\t}\n\t\tif(counter < k){return head;}\n\t\t\n\t\t// reverse first k nodes\n\t\tListNode dummy = new ListNode(0);\n\t\tdummy.next = head;\n\t\t\n\t\tListNode oriHead = head;\n\t\tListNode prev = null;\n\t\t\n\t\tfor(int i=0; i<k; i++){\n\t\t\tListNode temp = head.next;\n\t\t\thead.next = prev;\n\t\t\tprev = head;\n\t\t\thead = temp;\n\t\t}\n\t\t\n\t\t// append rest nodes by recur\n\t\tdummy.next = prev;\n\t\toriHead.next = reverseKGroup(head, k);\n\t\t\n\t\treturn dummy.next;\n\t\n\t}", "public void rightRotate(RBNode<T, E> node) {\r\n\t\t// Keep Track of the root and the pivot and roots parent\r\n\t\tRBNode<T, E> root = node;\r\n\t\tRBNode<T, E> pivot = node.leftChild;\r\n\t\tRBNode<T, E> rParent = root.parent;\r\n\t\t// if the pivot is not null, then proceed to rotate\r\n\t\tif (pivot != nillLeaf) {\r\n\t\t\tif (rParent != nillLeaf) {\r\n\t\t\t\tif (root.uniqueKey.compareTo(rParent.uniqueKey) < 0) {\r\n\t\t\t\t\t// root must be to the left of the root's parent\r\n\t\t\t\t\troot.leftChild = pivot.rightChild;\r\n\t\t\t\t\tpivot.rightChild.parent = root;\r\n\t\t\t\t\tpivot.rightChild = root;\r\n\t\t\t\t\trParent.leftChild = pivot;\r\n\t\t\t\t\troot.parent = pivot;\r\n\t\t\t\t\tpivot.parent = rParent;\r\n\t\t\t\t\tthis.root = searchRoot(rParent);\r\n\r\n\t\t\t\t} else if (root.uniqueKey.compareTo(rParent.uniqueKey) > 0) {\r\n\t\t\t\t\t// root must be to the right of the root's parent\r\n\t\t\t\t\troot.leftChild = pivot.rightChild;\r\n\t\t\t\t\tpivot.rightChild.parent = root;\r\n\t\t\t\t\tpivot.rightChild = root;\r\n\t\t\t\t\trParent.rightChild = pivot;\r\n\t\t\t\t\troot.parent = pivot;\r\n\t\t\t\t\tpivot.parent = rParent;\r\n\t\t\t\t\tthis.root = searchRoot(rParent);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// else if root has no parent, then rotate with no parent\r\n\t\t\telse {\r\n\t\t\t\troot.leftChild = pivot.rightChild;\r\n\t\t\t\tpivot.rightChild.parent = root;\r\n\t\t\t\tpivot.leftChild = root;\r\n\t\t\t\troot.parent = pivot;\r\n\t\t\t\tthis.root = pivot;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private RedBlackNode rotateRight(RedBlackNode x){\n\t RedBlackNode xParent = x.parent;\n\t RedBlackNode BSubTree = x.left.right;\n\t RedBlackNode y = x.left;\n\t y.right = x;\n\t x.parent = y;\n\t x.left = BSubTree;\n\t //Need to anlayse whether Nil check need to have or Not\n\t BSubTree.parent = x;\n\t if( xParent == this.Nil){\n\t\t this.root = y;\n\t }else if(xParent.left == x){\n\t\t xParent.left = y;\n\t }else{\n\t\t xParent.right = y;\n\t }\n\t y.parent = xParent;\n\t return y;\n }", "private BinaryNode<AnyType> rotateRight1(BinaryNode<AnyType>t, AnyType x)\r\n\t{\r\n\t\tBinaryNode<AnyType> no=find(t,x);\r\n\t\tBinaryNode<AnyType> parno=findParentNode(t,x);\r\n\r\n\t\tif(no==parno)\r\n\t\t{\r\n\t\t\tBinaryNode temp1=parno.left;\r\n\t\t BinaryNode temp2=parno.right;\r\n\t\t BinaryNode temp3=parno.left.right;\r\n\t\t parno.left=null;\r\n\t\t parno.right=null;\r\n\t\t temp1.right=null;\r\n\t\t root=temp1;\r\n\t\t root.right=parno;\r\n\t\t root.right.left=temp3;\r\n\t\t root.right.right=temp2;\r\n\t\t}\r\n\t\t\r\n\r\n\t\tif(no.element.compareTo(parno.element)<0)\r\n\t\t{\r\n\t\t\tBinaryNode temp = parno.left;\r\n\t\t\tparno.left=no.left;\r\n\t\t\ttemp.left=null;\r\n\t\t\tBinaryNode tempr=parno.left.right;\r\n\t\t\tparno.left.right=temp;\r\n\t\t\tparno.left.right.left=tempr;\r\n\t\t}\r\n\r\n\t\tif(no.element.compareTo(parno.element)>0)\r\n\t\t{\r\n\t\t\tBinaryNode temp = parno.right;\t\t\r\n\t\t\tparno.right=no.left;\r\n\t\t\ttemp.left=null;\r\n\t\t\tBinaryNode tempr=parno.right.right;\r\n\t\t\tparno.right.right=temp;\r\n\t\t\tparno.right.right.left=tempr;\r\n\r\n\t\t}\r\n\t\treturn t;\r\n\t}", "public void rotate() { // rotate the first element to the back of the list\n // TODO\n if ( tail != null){\n tail = tail.getNext();\n }\n\n }", "protected Node<E> rotateRight(Node<E> root) {\r\n\t\tNode<E> temp = root.left;\r\n\t\troot.left = temp.right;\r\n\t\ttemp.right = root;\r\n\t\treturn temp;\r\n\t}", "@Override\r\n\tpublic void rotateRight() {\n\t\tsetDirection((this.getDirection() + 1) % 4);\r\n\t}", "private void singleRotateRight(Node n) {\n Node l = n.mLeft, lr = l.mRight, p = n.mParent;\n n.mLeft = lr;\n lr.mParent = n;\n l.mRight = n;\n if (n == mRoot) {\n mRoot = l;\n l.mParent = null;\n }\n else if (p.mLeft == n) {\n p.mLeft = l;\n l.mParent = p;\n }\n else {\n p.mRight = l;\n l.mParent = p;\n }\n n.mParent = l;\n }", "public ListNode reverseKGroup(ListNode head, int k) {\n if(head==null || head.next==null || k==0)\n return head;\n ListNode left = head;\n ListNode right = head;\n int count = 1;\n while(count<=k && right!=null){\n right = right.next;\n count++;\n }\n if(count-1!=k && right==null)\n return left;\n ListNode pre = null;\n ListNode cur = left;\n while(cur!=right){\n ListNode next = cur.next;\n cur.next = pre;\n pre = cur;\n cur = next;\n }\n left.next = reverseKGroup(cur, k);\n return pre;\n }", "private void rightRotate(WAVLNode x) {\n\t WAVLNode a=x.left;\r\n\t WAVLNode b=x.right;\r\n\t WAVLNode y=x.parent;\r\n\t WAVLNode c=y.right;\r\n\t x.right=y;\r\n\t y.left=b;\r\n\t if (y.parent!=null) {\r\n\t\t WAVLNode d=y.parent;\r\n\t\t String side=parentside(d,y);\r\n\r\n\t\t if (side.equals(\"right\")) {\r\n\t\t\t d.right=x;\r\n\t\t\t x.parent=d;\r\n\t\t }\r\n\t\t else {\r\n\t\t\t d.left=x;\r\n\t\t\t x.parent=d;\r\n\t\t }\r\n\t }\r\n\t else {\r\n\t\t x.parent=null;\r\n\t\t this.root=x;\r\n\t }\r\n\t y.parent=x;\r\n\t b.parent=y;\r\n\t y.rank=y.rank-1;\r\n\t \r\n\t y.sizen=b.sizen+c.sizen+1;\r\n\t x.sizen=a.sizen+y.sizen+1;\r\n\t \r\n }", "public ListNode reverseKGroup(ListNode head, int k) {\n if(head == null || head.next == null || k < 2)\n return head;\n \n ListNode dummy = new ListNode(0);\n ListNode curr = dummy;\n ListNode tail = head;\n int count = 0;\n while(head != null) {\n count++;\n if(count == k) {\n // Reverse nodes \n // Store location of head next\n // Store location of rear, this will be used to know where to continue next\n ListNode temp = head.next;\n ListNode last = tail;\n \n // Move pointers around to reverse the nodes\n ListNode next = tail;\n while(next != temp) {\n ListNode prev = tail;\n tail = next == tail ? tail.next : next;\n next = tail.next;\n tail.next = prev;\n }\n curr.next = head;\n curr = last;\n head = temp;\n tail = temp;\n count = 0;\n }\n else {\n head = head.next;\n }\n }\n curr.next = tail;\n return dummy.next;\n }", "public static void rotateAntiClockBetter(int[] arr, int k)\r\n {\r\n\t int[] arr2 = arr.clone();\r\n\t for(int i =0; i< arr.length; i++)\r\n\t {\r\n\t\t arr2[i] = arr[(i+k)%arr.length];\r\n\t }\r\n\t System.out.println(Arrays.toString(arr2));\r\n }", "public Node<T> rightRotate(Node<T> node){\n\n Node<T> temp = node.left;//pointer set to the nodes left child\n node.left = temp.right;//node.left set to the right child\n temp.right = node;//temp.right equal to the node that is rotating\n return temp;\n }", "static String leftrotate(String s) {\n\n System.out.print(\" left rotate \" + s + \" \");\n char arr[] = s.toCharArray();\n char newarr[]= new char[arr.length];\n for (int i = 0; i < arr.length - 1; i++) {\n newarr[i + 1] = arr[i];\n }\n newarr[0]=s.charAt(s.length()-1);\n\n s = \"\";\n for (int i = 0; i < arr.length; i++)\n s += newarr[i];\n System.out.println(\"Return \" + s);\n return s;\n\n }", "public static void main (String[] args) \n { \n int arr[] = {1, 2, 3, 4, 5, 6, 7}; \n int n = arr.length; \n int d = 2; \n \n // in case the rotating factor is \n // greater than array length \n d = d % n; \n leftRotate(arr, 2, 7); // Rotate array by d \n printArray(arr); \n }", "public static void rotateArray(final int[] nums, final int k) {\n final var rot = k % nums.length;\n\n int temp, previous;\n for (int i = 0; i < rot; i++) {\n previous = nums[nums.length - 1];\n for (int j = 0; j < nums.length; j++) {\n temp = nums[j];\n nums[j] = previous;\n previous = temp;\n }\n }\n }", "private static void back(int k) {\r\n\t\tfor (int i = 0; i < SIZE; i++) {\r\n\t\t\tcurrentPerm[k] = i;\r\n\t\t\tif (validateCurrentPerm(currentPerm, k)) {\r\n\t\t\t\tif (k == SIZE - 1) {\r\n\t\t\t\t\tString currentPermString = \"\";\r\n\t\t\t\t\tfor (int t : currentPerm) {\r\n\t\t\t\t\t\tcurrentPermString += t;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tperms.add(currentPermString);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tback(k + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void rightRotate(Entry<T> child, Entry<T> p) {\n\t\tif(p.parent != null) {\n\t\t\tif(p == p.parent.left)\n\t\t\t\tp.parent.left = child;\n\t\t\telse\n\t\t\t\tp.parent.right = child;\n\t\t}\n\t\tif(child.right != null)\n\t\t\tgetSplay(child.right).parent = p;\n\t\t\n\t\tchild.parent = p.parent;\n\t\tp.parent = child;\n\t\tp.left = child.right;\n\t\tchild.right = p;\n\t\t\t\t\n\t}", "private long leftRotate(long n) throws IOException {\n Node current = new Node(n);\r\n long currentRight = current.right;\r\n Node tempN = new Node(current.right);\r\n current.right = tempN.left;\r\n tempN.left = n;\r\n current.height = getHeight(current);\r\n current.writeNode(n);\r\n tempN.height = getHeight(tempN);\r\n tempN.writeNode(currentRight);\r\n return currentRight;\r\n }", "private Node rightRotate(Node a) {\n Node b = a.getLeftChild();\n Node n3 = b.getRightChild();\n b.setRightChild(a);\n a.setLeftChild(n3);\n setHeights(a, b);\n return b;\n }", "public List<Integer> rotate(List<Integer> a, int k, List<Integer> queries) {\n\n List<Integer> arrAfterRotation = new ArrayList<>(a);\n\n List<Integer> lastArrAfterRotation = new ArrayList<>(a);\n\n //Set the last one after rotation equal to provided array at initialization\n lastArrAfterRotation = a;\n\n for(int i=0; i<k; i++) {\n arrAfterRotation.set(0,lastArrAfterRotation.get(lastArrAfterRotation.size()-1));\n int counter=1;\n for (int elem=1; elem<lastArrAfterRotation.size();elem++ ) {\n arrAfterRotation.set(counter++, lastArrAfterRotation.get(elem-1));\n }\n List<Integer> tempList = new ArrayList<>(arrAfterRotation);\n lastArrAfterRotation= tempList;\n }\n printList(lastArrAfterRotation);\n\n List<Integer> returnList = new ArrayList<>(lastArrAfterRotation);\n\n for (int i : queries) {\n returnList.set(i,lastArrAfterRotation.get(i));\n }\n\n return returnList;\n\n }", "private NodeRB<K, V> rotateRight(NodeRB<K, V> x) {\n\t\tNodeRB<K, V> xParent = x.parent;\n\n\t\tNodeRB<K, V> y = x.left;\n\t\tx.left = y.right;\n\t\ty.right = x;\n\n\t\t// Parents relations fix\n\t\tif (xParent != null) {\n\t\t\tif (x.isLeftChild()) {\n\t\t\t\txParent.left = y;\n\t\t\t} else {\n\t\t\t\txParent.right = y;\n\t\t\t}\n\t\t}\n\t\tx.parent = y;\n\t\ty.parent = xParent;\n\t\tif (x.left != null) {\n\t\t\tx.left.parent = x;\n\t\t}\n\n\t\tx.height = 1 + Math.max(height(x.left), height(x.right));\n\t\ty.height = 1 + Math.max(height(y.left), height(y.right));\n\t\treturn y;\n\t}", "private BTNode<T> rotateRight(BTNode<T> p){\n\t\tBTNode<T> q = p.getLeft();\n\t\tp.setLeft(q.getRight());\n\t\tq.setRight(p);\n\t\tfixHeight(p);\n\t\tfixHeight(q);\n\t\treturn q;\n\t}", "private Node<T> rotateWithRight(Node<T> a) {\n Node<T> b = a.getRight();\n a.setRight(b.getLeft());\n b.setLeft(a);\n int aH = Math.max(findHeight(a.getLeft()),\n findHeight(a.getRight())) + 1;\n a.setHeight(aH);\n int bH = Math.max(findHeight(b.getRight()), aH) + 1;\n b.setHeight(bH);\n hAndBF(a);\n hAndBF(b);\n return b;\n }", "public int[] rotate3(int[] arr, int k) {\n\t\tk = k % arr.length;\n\n\t\tif (arr == null || k < 0)// handles exceptions\n\t\t\tthrow new IllegalArgumentException(\"Illegal argument!\");\n\n\t\tint a = arr.length - k;// length of the first part\n\t\treverse(arr, 0, a - 1);// rotate the first part\n\t\treverse(arr, a, arr.length - 1);// rotate the second part\n\t\treverse(arr, 0, arr.length - 1);// rotate the whole array\n\n\t\treturn arr;\n\n\t}", "public static int[] rotateRight(int[] arr) {\n int[] newArr=new int[arr.length];\n for (int i =0;i< arr.length;i++){\n if (!(i== (arr.length-1))){\n newArr[i+1]=arr[i];\n }\n else{\n newArr[0]=arr[i];\n }\n }\n return newArr;\n }", "private static void rotateArray(int[] arr, int gcd, int k) {\n\t\t// gcd is the set length for which the rotation will happen\n\t\tint len = arr.length;\n\t\tfor (int i = 0; i < gcd; i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint j = i;\n\t\t\tint l = -1;\n\t\t\twhile (true) {\n\t\t\t\tl = ((j + k) % len);\n\t\t\t\tif (l == i) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tarr[j] = arr[l];\n\t\t\t\tj = l;\n\t\t\t}\n\t\t\tarr[j] = temp;\n\t\t}\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\tSystem.out.print(arr[i] + \" \");\n\t\t}\n\t}", "public NodeRB rotateRight(NodeRB y) {\n NodeRB x = y.left;\r\n //System.out.println(\"[...] Left of the pivot: \" + x.value);\r\n NodeRB c = x.right;\r\n NodeRB p = fetchParentOf(y.value);\r\n //System.out.println(y.value + \" is now the right of \" + x.value);\r\n if (y == this.root){\r\n this.root = x;\r\n }\r\n x.right = y;\r\n y.left = c;\r\n if (p != null){\r\n //System.out.print(\"[....] The pivot has a parent \" + p.value + \". Setting \" + x.value + \" to its \");\r\n if (p.getRight() == y){\r\n //System.out.println(\"right.\");\r\n p.right = (x);\r\n }\r\n else{\r\n //System.out.println(\"left.\");\r\n p.left = (x);\r\n }\r\n }\r\n return x;\r\n }", "public void rotateRight(int numberOfTurns);", "@Override\r\n\tpublic void rotateRight() {\n\t\tfinal int THETA = 10;\r\n\t\tint dir = this.getDirection();\r\n\t\tthis.setDirection(dir + THETA);\r\n\t\t\r\n\t}", "void rightRotate(Node<K, V> y) {\n\t\tassert IsNotNil(y.getLeft());\n\t\tNode<K, V> x = y.getLeft();\n\n\t\t// B in postion\n\t\ty.setLeft(x.getRight());\n\n\t\t// X to root\n\t\tif (y == root) {\n\t\t\troot = x;\n\t\t} else if (y.isRightChild()) {\n\t\t\ty.getParent().setRight(x);\n\t\t} else if (y.isLeftChild()) {\n\t\t\ty.getParent().setLeft(x);\n\t\t}\n\n\t\t// y in position\n\t\tx.setRight(y);\n\t}", "private void doubleRotateRightDel (WAVLNode z) {\n\t WAVLNode a = z.left.right;\r\n\t WAVLNode y = z.left;\r\n\t WAVLNode c = z.left.right.right;\r\n\t WAVLNode d = z.left.right.left;\r\n\t if(z.parent!=null) {\r\n\t\t if(parentside(z.parent, z).equals(\"left\")) {\r\n\t\t\t z.parent.left=a;\r\n\r\n\t }\r\n\t else {\r\n\t\t\t z.parent.right=a;\r\n\r\n\t }\r\n\t\t \r\n\t }\r\n\t else {\r\n\t\t this.root=a;\r\n\t }\r\n\t a.right=z;\r\n\t a.left=y;\r\n\t a.rank=a.rank+2;\r\n\t a.parent=z.parent;\r\n\t y.parent=a;\r\n\t y.right=d;\r\n\t y.rank--;\r\n\t z.parent=a;\r\n\t z.left=c;\r\n\t z.rank=z.rank-2;\r\n\r\n\t c.parent=z;\r\n\t d.parent=y;\r\n\t z.sizen=z.right.sizen+z.left.sizen+1;\r\n\t y.sizen=y.right.sizen+y.left.sizen+1;\r\n\t a.sizen=a.right.sizen+a.left.sizen+1;\r\n }", "private AvlNode<E> rotateWithLeftChild(AvlNode<E> k1){\n AvlNode<E> k2 = k1.left;\n k1.left = k2.right;\n k2.right = k1;\n k1.height = max(height(k1.left), height(k2.right)) + 1;\n k2.height = max(height(k2.left), k1.height) + 1;\n return k2;\n }", "private RedBlackNode rotationWithRightChild(RedBlackNode node1) \n { \n RedBlackNode node2 = node1.rightChild; \n node1.rightChild = node2.leftChild; \n node2.leftChild = node1.leftChild; \n return node2; \n }", "public ListNode reverseKGroup(ListNode head, int k) {\n int len = getLength(head);\n ListNode dummy = new ListNode(-1);\n dummy.next = head;\n ListNode prepare = dummy;\n\n for (int i = 0; i <= len - k; i = i + k) {\n prepare = reverse(prepare, k);\n }\n return dummy.next;\n }", "@Override\n\tpublic void rotateRight(int degrees) {\n\t\t\n\t}", "public void removeByRightShift(int pos) {\r\n if (pos > 0 || pos < size - 1) {\r\n int nshift = pos;\r\n int from = ((start + pos) - 1) % cir.length;\r\n int to = (from + 1) % cir.length;\r\n // int to=from--;\r\n for (int i = 0; i < nshift; i++) {\r\n cir[to % cir.length] = cir[from % cir.length];\r\n to = from;\r\n from--;\r\n if (from < 0) {\r\n from = cir.length - 1;\r\n }\r\n }\r\n cir[start] = \"null\";\r\n start++;\r\n size--;\r\n }\r\n }", "void rotate();", "public final void rot() {\n\t\tif (size > 2) {\n\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tdouble thirdTopMostValue = pop();\n\n\t\t\tpush(secondTopMostValue);\n\t\t\tpush(topMostValue);\n\t\t\tpush(thirdTopMostValue);\n\n\t\t}\n\t}", "@Override\r\n public void rotateClockwise() {\r\n super.rotateClockwise(); //To change body of generated methods, choose Tools | Templates.\r\n // TODO: Fix me\r\n undo.push('c');\r\n redo = new LinkedListStack();\r\n }", "public ListNode reverseKGroup(ListNode head, int k) {\r\n\t\tif (head == null) return head;\r\n\t\tint count = 0;\r\n\t\tListNode curr = head, prev = null, next = null;\r\n\t\t// Find the k+1 node\r\n\t\twhile (count != k && curr != null) {\r\n\t\t\tcurr = curr.next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\r\n\t\tif (count != k) return head;\r\n\t\t// reverse list with k+1 node as head\r\n\t\tprev = reverseKGroup(curr, k);\r\n\t\t// LL Reversal Alg: reverse current k-group from head ptr\r\n\t\twhile (count-- > 0) {\r\n\t\t\tnext = head.next;\r\n\t\t\thead.next = prev;\r\n\t\t\tprev = head;\r\n\t\t\thead = next;\r\n\t\t}\r\n\t\treturn prev;\r\n\t}", "private AVLNode<T> rotateRight(AVLNode<T> node) {\n AVLNode<T> substiute = node.left;\n node.left = substiute.right;\n substiute.right = node;\n\n // node = substitute;\n\n return substiute;\n }", "private void rotateRight(Node curr, boolean colorChangeNeeded) {\n\t\tNode parent = curr.parent;\n\t\tcurr.parent = parent.parent;\n if(parent.parent != null) {\n if(parent.parent.right == parent) {\n \tparent.parent.right = curr;\n } else {\n \tparent.parent.left = curr;\n }\n }\n Node right = curr.right;\n curr.right = parent;\n parent.parent = curr;\n parent.left = right;\n if(right != null) {\n right.parent = parent;\n }\n if(colorChangeNeeded) {\n curr.color = Color.BLACK;\n parent.color = Color.RED;\n }\n\t}", "public MutableImage rotateRight() {\n return rotate(90);\n }", "private void rightRotate(RedBlackNode<T> y){\n rightRotateFixup(y);\n\n RedBlackNode<T> x = y.left;\n y.left = x.right;\n\n // Czy istnieje x.right\n if (!isNil(x.right))\n x.right.parent = y;\n x.parent = y.parent;\n\n // y.parent jest nil\n if (isNil(y.parent))\n root = x;\n\n // y jest prawym dzieckiem swojego rodzica\n else if (y.parent.right == y)\n y.parent.right = x;\n\n // y jest lewym dzieckiem swojego rodzica\n else\n y.parent.left = x;\n x.right = y;\n\n y.parent = x;\n\n }", "public void rotateRight() {\n\t\tthis.direction = this.direction.rotateRight();\n\t}", "static void leftRotate(int arr[], int d, int n) \n\t{\n\t\tint i, j;\n\t\tif (d == 0 || d == n)\n\t\t\treturn;\n\t\ti = d;\n\t\tj = n - d;\n\t\twhile (i != j) {\n\t\t\tif (i < j) /* A is shorter */\n\t\t\t{\n\t\t\t\tswap(arr, d - i, d + j - i, i);\n\t\t\t\tj -= i;\n\t\t\t} else /* B is shorter */\n\t\t\t{\n\t\t\t\tswap(arr, d - i, d, j);\n\t\t\t\ti -= j;\n\t\t\t}\n\t\t\t// printArray(arr, 7);\n\t\t}\n\t\t/* Finally, block swap A and B */\n\t\tswap(arr, d - i, d, i);\n\t}", "public static void main(String[] args) {\r\n RotateList rl = new RotateList();\r\n // test list : 1->2->3->4->5->NULL.\r\n ListNode testList = new ListNode(0);\r\n for (int i = 1; i < 6; i++) {\r\n testList.addNodeTail(new ListNode(i));\r\n }\r\n System.out.println(\"The input list is the following:\");\r\n testList.printList();\r\n ListNode result = rl.rotateRight(testList, 3);\r\n System.out.println(\"And the output is the following:\");\r\n result.printList();\r\n }", "public void rotateRight(Node node){\n\t\tNode ptrLeft = node.left;\n\t\tnode.left = ptrLeft.right;\n\t\t\n\t\tif(ptrLeft.right != nil){\n\t\t\tptrLeft.right.parent = node;\n\t\t}\n\t\t\n\t\tptrLeft.parent = node.parent;\n\t\t\n\t\tif(ptrLeft.parent==nil){\n\t\t\troot = ptrLeft;\n\t\t}else if(node == node.parent.left){\n\t\t\tnode.parent.left = ptrLeft;\n\t\t}else{\n\t\t\tnode.parent.right = ptrLeft;\n\t\t}\n\t\t\n\t\tptrLeft.right = node;\n\t\tnode.parent = ptrLeft;\n\t}", "public static void main(String[] args) {\n\t\tNode current=new Node(10);\r\n\t\tcurrent.next = new Node(20); \r\n\t\tcurrent.next.next = new Node(30); \r\n\t\tcurrent.next.next.next = new Node(40); \r\n\t\tcurrent.next.next.next.next = new Node(50); \r\n Node r=Rotatelinkedlistbyk(current,2);\r\n if(r==null)\r\n {\r\n \t System.out.print(\"no element to return\");\r\n }\r\n while(r != null)\r\n {\r\n \t System.out.print(r.data);\r\n \t r=r.next;\r\n }\r\n\r\n\t}", "private AVLNode<T, U> rotateRight(AVLNode<T, U> oldRoot) {\n\t\tAVLNode<T, U> newRoot = oldRoot.getLeft();\n\t\t\n\t\tnewRoot.setParent(oldRoot.getParent());\n\t\toldRoot.setLeft(newRoot.getRight());\n\t\t\t \n\t\tif(oldRoot.getLeft() != null) {\n\t\t\toldRoot.getLeft().setParent(oldRoot);\n\t\t}\n\t\t\n\t\tnewRoot.setRight(oldRoot);\n\t\toldRoot.setParent(newRoot);\n\t\t\n\t\tif(newRoot.getParent() != null){\n\t\t\tif(newRoot.getParent().getRight() == oldRoot){\n\t\t\t\tnewRoot.getParent().setRight(newRoot);\n\t\t\t}else if(newRoot.getParent().getLeft() == oldRoot){\n\t\t\t\tnewRoot.getParent().setLeft(newRoot);\n\t\t\t}\n\t\t}\n\t\t\n\t\tcomputeHeightsToRoot(oldRoot);\n\t\treturn newRoot;\n\t}", "private void rightRotateFixup(RedBlackNode y){\n\n // Przypadek 1: tylko y, y.left i y.left.left są nil.\n if (isNil(y.right) && isNil(y.left.right)){\n y.numRight = 0;\n y.numLeft = 0;\n y.left.numRight = 1;\n }\n\n // Przypadek 2: y.left.right istnieje w dodatku do przypadku 1\n else if (isNil(y.right) && !isNil(y.left.right)){\n y.numRight = 0;\n y.numLeft = 1 + y.left.right.numRight +\n y.left.right.numLeft;\n y.left.numRight = 2 + y.left.right.numRight +\n y.left.right.numLeft;\n }\n\n // Przypadek 3: y.right istnieje w dodatku do przypadku 1\n else if (!isNil(y.right) && isNil(y.left.right)){\n y.numLeft = 0;\n y.left.numRight = 2 + y.right.numRight +y.right.numLeft;\n\n }\n\n // Przypadek 4: y.right i y.left.right istnieją w dodatku do przypadku 1\n else{\n y.numLeft = 1 + y.left.right.numRight +\n y.left.right.numLeft;\n y.left.numRight = 3 + y.right.numRight +\n y.right.numLeft +\n y.left.right.numRight + y.left.right.numLeft;\n }\n\n }", "public void rotateRight(int time) {\n\t\tdouble step = 3;\r\n\t\t\r\n\t\tif( rotation + step > 360 )\r\n\t\t\trotation = rotation + step - 360;\r\n\t\telse\r\n\t\t\trotation += step;\r\n\t}", "public MyListNode reverseKGroup(MyListNode head, int k) {\n if (k == 1)\n return head;\n MyListNode H = new MyListNode(0);\n H.next = head;\n MyListNode q = H;\n for (MyListNode p = head; p != null; p = p.next) {\n p = reverseK(q, k);\n if (p == null)\n break;\n q = p;\n }\n return H.next;\n }" ]
[ "0.78646576", "0.7801626", "0.6979887", "0.69700694", "0.6969403", "0.6880429", "0.6856202", "0.6756981", "0.67168784", "0.6700389", "0.6629936", "0.6623515", "0.66218", "0.6591183", "0.6580033", "0.6566541", "0.6563252", "0.65276134", "0.65191925", "0.6505386", "0.6503575", "0.648948", "0.6473704", "0.6460064", "0.64595133", "0.6425559", "0.6386476", "0.63800436", "0.63547045", "0.6338503", "0.6330379", "0.63085306", "0.63052076", "0.62798685", "0.62678504", "0.626774", "0.625779", "0.62452376", "0.62361705", "0.62135553", "0.6207078", "0.62047136", "0.6195235", "0.61256856", "0.6121125", "0.61058605", "0.6100227", "0.60826033", "0.6079041", "0.60781616", "0.60583293", "0.6053671", "0.6052964", "0.6029584", "0.60248363", "0.60088974", "0.5961667", "0.5952548", "0.59520364", "0.5950903", "0.59431887", "0.59409714", "0.5937987", "0.5927276", "0.59227616", "0.5901415", "0.5897174", "0.58929116", "0.5892201", "0.5888678", "0.58824885", "0.5856474", "0.58444", "0.5838267", "0.5835084", "0.5823954", "0.58218443", "0.58087236", "0.58035916", "0.5795867", "0.57952905", "0.57857096", "0.5774733", "0.5773401", "0.5767388", "0.57621527", "0.57515126", "0.5731939", "0.5730383", "0.57265544", "0.5714556", "0.5703747", "0.56842923", "0.5670482", "0.5667124", "0.56456846", "0.56437653", "0.563722", "0.56290704", "0.56217027" ]
0.7895184
0
Find all moves by game from Game repo.
List<Move> findByGame(Game game);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Move> findByGameAndPlayer(Game game, Player player);", "public List<ScoredMove> allValidMoves(GameState gm){\n\t\tList<ScoredMove> validMoves = new ArrayList<ScoredMove>();\n\t\t\n\t\t// check for draw move\n\t\tif (getDeckSize() > 0) {\n\t\t\tvalidMoves.add(new ScoredMove(ACTION.DRAW, null, null));\n\t\t}\n\t\t/*\n\t\telse {\n\t\t\t// check for discarding move (note: only allowing if decksize is empty)\n\t\t\tfor (Card c: getHand().getCards()){\n\t\t\t\tif (!(c instanceof MerchantShip)) {\n\t\t\t\t\tvalidMoves.add(new ScoredMove(ACTION.DISCARD, c, null));\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\t\t\n\t\tvalidMoves.addAll(allDiscardMoves(gm));\n\t\t\n\t\t// check for playing merchant ships\n\t\tvalidMoves.addAll(allmShipMoves(gm));\n\t\t\n\t\t// add all attacks\n\t\tvalidMoves.addAll(allAttackMoves(gm));\n\t\t\n\t\tif (super.getVerbosity()) {\n\t\t\tSystem.out.println(\"Valid moves found: \" + validMoves.size());\n\t\t}\n\t\treturn validMoves;\n\t}", "List<Move> getLegalMoves(Player player);", "public List<ScoredMove> allmShipMoves(GameState gm){\n\t\t\n\t\tList<ScoredMove> mShipMoves = new ArrayList<ScoredMove>();\n\t\t\n\t\tif (getHand().hasMShip()) {\n\t\t\tfor (Card c: getHand().getCards()) {\n\t\t\t\tif (c instanceof MerchantShip) {\n\t\t\t\t\tmShipMoves.add(new ScoredMove(ACTION.PLAY_MERCHANT_SHIP, c, null));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn mShipMoves;\n\t}", "@Transactional(readOnly = true)\n public List<Game> findAll() {\n log.debug(\"Request to get all Games\");\n return gameRepository.findAll();\n }", "public List<ScoredMove> allAttackMoves(GameState gm) {\n\t\tList<ScoredMove> attackMoves = new ArrayList<ScoredMove>();\n\t\t\n\t\t// check for attacking battles\n\t\tif (gm.getBattleList().size() > 0) {\n\t\t\tfor (Battle b: gm.getBattleList()) {\n\t\t\t\tif (!b.isBattleUsingTrumps()) {\n\t\t\t\t\tfor (Card c: getHand().getCards()){\n\t\t\t\t\t\tif (c instanceof PirateShip) {\n\t\t\t\t\t\t\tif (canPirateShipCardAttack(b, (PirateShip)c)){\n\t\t\t\t\t\t\t\tattackMoves.add(new ScoredMove(ACTION.PLAY_ATTACK, c, b));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (Card c: getHand().getCards()) {\n\t\t\t\t\tif (c instanceof Trump) {\n\t\t\t\t\t\tif (canTrumpCardAttack(b, (Trump)c)) {\n\t\t\t\t\t\t\tattackMoves.add(new ScoredMove(ACTION.PLAY_ATTACK, c, b));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn attackMoves;\n\t}", "@Override\n\tpublic Move getMove(Board game) {\n\t\t\n\t\tthis.maximumDepthReachedThisTurn = 0;\n\t\tArrayList<Move> moveList = game.getLegalMoves();\n\t\t/* tell the player what her options are */\n\t\tSystem.out.println(\"Turn \" + game.getTurn() + \", legal moves (\" + moveList.size() + \"): \");\n\t\tfor(Move m : moveList) {\n\t\t\tSystem.out.println(m.toString());\n\t\t}\n\t\t\n\t\tthis.nodesExploredThisTurn = 0;\n\t\tthis.isEndGameStatusFound = false;\n\t\tthis.maxDepth = 1;\n\t\tthis.bestMoveSoFar = null;\n\t\tthis.startMili = System.currentTimeMillis();\n\t\n\t\twhile (System.currentTimeMillis() - startMili < this.maxTime * 1000) {\n\t\t\tNode state = new Node(game, null, 0);\n\t\t\tthis.bestMoveSoFar = this.alphaBetaSearch(state);\n\t\t\t\n\t\t\tif (this.isEndGameStatusFound)\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tthis.maxDepth++;\n\t\t}\n\n\t\tlong endMili=System.currentTimeMillis();\n\t\tdouble duration = ((double)(endMili - startMili)) / 1000.0;\n\t\t\n\t\tthis.maximumDepthReached += this.maximumDepthReachedThisTurn;\n\t\tSystem.out.println(\"Maximum depth reached at this turn: \" + this.maximumDepthReachedThisTurn);\n\t\tSystem.out.println(\"Maximum depth reached from game start state: \" + this.maximumDepthReached);\n\t\tSystem.out.println(\"Nodes explored at this turn: \" + this.nodesExploredThisTurn);\n\t\tSystem.out.println(\"Total nodes explored: \" + this.nodesExplored);\n\t\tSystem.out.println(\"Time to decide on a move: \" + duration);\n\n\t\treturn this.bestMoveSoFar;\n\t\t\n\t}", "public Set<GameDTO> getGamesWhichCanBeMovedToHistory() {\n return appealService.findAllByAppealStage(AppealStage.CONSIDERED)\n .stream()\n .map(Appeal::getGame)\n .map(gameDTOService::toGameDTO)\n .collect(Collectors.toSet());\n }", "abstract public List<Move> getPossibleMoves();", "public Collection<Game> getAllActiveGames() {\n return gameRepository.findAllActive();\n }", "@Override\n public ArrayList<xMCTSStringGameState> getPossibleMoves(xMCTSStringGameState gameState)\n {\n\t ArrayList<xMCTSStringGameState> posMoves = new ArrayList<xMCTSStringGameState>();\n\t if (gameStatus(gameState) == xMCTSGame.status.ONGOING) {\n\t \t String activeCard = gameState.toString().substring(gameState.toString().length() - 2, gameState.toString().length());\n\t \t int gridSize = SIZE*2;\n\t for (int i = 0; i < gridSize; i += 2) {\n\t for (int j = 0; j < gridSize; j += 2) {\n\t int pos = i * SIZE + j;\n\t if (gameState.toString().charAt(pos) == '_') {\n\t String temp = gameState.toString().substring(0, pos)\n\t \t\t + activeCard\n\t + gameState.toString().substring(pos + 2,\n\t gameState.toString().length());\n\t posMoves.add(new xMCTSStringGameState(temp, 0.0, 0));\n\t }\n\t }\n\n\t }\n\t }\n\t else {\n\t \t // System.out.println(\"No moves can be made from this state\");\n\t \t// callsFromFullBoards++;\n\t \t// System.out.println(\"There have been \" + callsFromFullBoards + \"attempts to get possible moves from a full board\");\n\t }\n\t return posMoves;\n }", "private List<Coordinate> getAvailableMoves(ImmutableGameBoard gameBoard) {\n List<Coordinate> availableMoves = new ArrayList<Coordinate>();\n\n for (int x = 0; x < gameBoard.getWidth(); x++) {\n for (int y = 0; y < gameBoard.getHeight(); y++) {\n if(gameBoard.getSquare(x, y) == TicTacToeGame.EMPTY)\n availableMoves.add(new Coordinate(x, y));\n }\n }\n\n return availableMoves;\n }", "public List<PlayerGame> findAllByGame(Long gameId) {\n return playerGames.stream()\n .filter(p -> p.getGame().getId().equals(gameId))\n .collect(Collectors.toList());\n }", "Iterator<BoardPosition> possibleMovingPositions(BoardPosition from, Game game, Map<BoardPosition, Piece> pieceMap);", "List<GameResult> getAllGameResults();", "public ArrayList<PentagoGame> nextPossibleMoves() {\n ArrayList<PentagoGame> children = new ArrayList<>();\n for(int i = 0; i < 6; i++) { // for each row I can place a piece\n for(int j = 0; j < 6; j++) { // for each column\n for(int k = 0; k < 4; k++ ) { // for each board to rotate\n for(int d = 0; d < 2; d ++) {// for each direction to rotate\n boolean leftRotate = false;\n if(d == 0) {\n leftRotate = true;\n }\n Move move = new Move(i, j, k, leftRotate);\n if(validMove(whosTurn(), move)) {\n PentagoGame tempGame = new PentagoGame(this);\n tempGame.playPiece(whosTurn(), move);\n tempGame.rotateBoard(whosTurn(), move);\n tempGame.turnOver();\n move.setGameState(tempGame);\n move.setUtility(calulateUtility(move));\n // todo\n children.add(tempGame);\n }\n }\n }\n }\n }\n\n return children;\n }", "@Test\n void testAllLegalMoves() {\n \tplayer1 = new HumanPlayer(\"Arnold\");\n player2 = new HumanPlayer(\"Intelligent Twig\");\n gameState = new GameState(Arrays.asList(player1, player2));\n board = gameState.getBoard();\n \n Set<PlayableMove> moves = Move.allLegalMoves(gameState);\n\n assertTrue(moves.stream().allMatch(e -> e.isLegal()));\n assertEquals(44, moves.size());\n }", "@Test\r\n\tpublic void findAllGames() {\r\n\t\t// DO: JUnit - Populate test inputs for operation: findAllGames \r\n\t\tInteger startResult = 0;\r\n\t\tInteger maxRows = 0;\r\n\t\t@SuppressWarnings(\"unused\")\r\n\t\tList<Game> response = null;\r\n\t\tTswacct tswacct = null;\r\n\t\tresponse = service.findAllGames4tsw(tswacct, startResult, maxRows);\r\n\t\t// DO: JUnit - Add assertions to test outputs of operation: findAllGames\r\n\t}", "public List<Position> getAllMoves(Board chessBoard) {\n return getAllDiscreteMoves(chessBoard);\n }", "public static Game[] getAllGames(){\n \tGame[] games = null;\n \ttry {\n\t\t\tgames = DBHandler.getAllGames(c);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n \treturn games;\n }", "public abstract HashSet<Location> getPossibleMovements(GameBoard board);", "public static void getMoves(Player p, GameSquare[][] board) {\n\t\t// keep track of the number of possible moves\n\t\t// and number of unique pieces you could move\n\t\tint moveCount = 0;\n\t\tint uniquePieceCount = 0;\n\n\t\tArrayList<GameSquare> playerSpotsWithPieces = p.places;\n\t\tArrayList<GameSquare> validMoves;\n\n\t\t// for each square with a piece on it\n\t\t// find out where you can move that piece\n\t\tfor (GameSquare currentSquare : playerSpotsWithPieces) {\n\t\t\tvalidMoves = new ArrayList<GameSquare>();\n\n\t\t\t// grab all valid moves from\n\t\t\tvalidMoves.addAll(currentSquare.getValidMoves(board));\n\t\t\tif (validMoves.size() > 0)\n\t\t\t\tuniquePieceCount++;\n\t\t\tfor (GameSquare move : validMoves) {\n\t\t\t\tSystem.out.printf(\"%s at <%d:%d> can move to <%d:%d>\\n\", currentSquare.pieceType(), currentSquare.x,\n\t\t\t\t\t\tcurrentSquare.y, move.x, move.y);\n\t\t\t\tmoveCount++;\n\t\t\t}\n\t\t}\n\n\t\t// print the number of possible moves and number of unique pieces that\n\t\t// can be moved\n\t\tSystem.out.printf(\"%d legal moves (%d unique pieces) for %s player\", moveCount, uniquePieceCount,\n\t\t\t\tp.color.toString().toLowerCase());\n\n\t}", "public List<Grid> getPossibleMoves(Grid g){\n\t\tint i=g.row, j=g.col;\n\t\tif(i>=0 && i<data.length && j>=0 && j<data[i].length){\n\t\t\tList<Grid> list=new ArrayList<>();\n\t\t\tif(isFree(i, j-1)) list.add(new Grid(i,j-1));\n\t\t\tif(isFree(i-1, j-1)) list.add(new Grid(i-1,j-1));\n\t\t\tif(isFree(i-1, j)) list.add(new Grid(i-1,j));\n\t\t\tif(isFree(i-1, j+1)) list.add(new Grid(i-1,j+1));\n\t\t\tif(isFree(i, j+1)) list.add(new Grid(i,j+1));\n\t\t\tif(isFree(i+1, j+1)) list.add(new Grid(i+1,j+1));\n\t\t\tif(isFree(i+1, j)) list.add(new Grid(i+1,j));\n\t\t\tif(isFree(i+1, j-1)) list.add(new Grid(i+1,j-1));\n\t\t\treturn list;\n\t\t}\n\t\treturn null;\n\t}", "Collection<GameEnvironment> getPendingGames();", "public List<Game> getAllGames() {\n List<Game> games = new ArrayList<>(data.values());\n games.sort((o1, o2) -> {\n if (o1.getId() < o2.getId()) {\n return 1;\n } else if (o1.getId() > o2.getId()) {\n return -1;\n } else {\n return 0;\n }\n });\n return games;\n }", "@Transactional(readOnly = true)\n public Page<Game> findAll(Pageable pageable) {\n return gameRepository.findAll(pageable);\n }", "public SmallGameBoard[] getAllGames(){return games;}", "private List<Games> findAllInitialWerewolvesFromDB(Games games) {\n List<Games> werewolves = new ArrayList<>();\n werewolves.addAll(gamesRepository.findByGameIDAndRoomIDAndPlayerInitialRole(games.getGameID(), games.getRoomID(), \"WEREWOLF\"));\n werewolves.addAll(gamesRepository.findByGameIDAndRoomIDAndPlayerInitialRole(games.getGameID(), games.getRoomID(), \"MYSTICWOLF\"));\n werewolves.removeIf(werewolf -> werewolf.getPlayerID().length() == 1);\n return werewolves;\n }", "public abstract ArrayList<Move> possibleMoves(Board board);", "List<Moves> getMoveSet();", "void getMoves(ArrayList<Move> moves) {\n if (gameOver()) {\n return;\n }\n if (jumpPossible()) {\n for (int k = 0; k <= MAX_INDEX; k += 1) {\n getJumps(moves, k);\n }\n } else {\n for (int k = 0; k <= MAX_INDEX; k += 1) {\n getMoves(moves, k);\n }\n }\n }", "ArrayList<Move> getMoves() {\n ArrayList<Move> result = new ArrayList<>();\n getMoves(result);\n return result;\n }", "public IGameAlgo.GameState getGameState (GameBoard.GameMove move){\n\t\t/*\n\t\t * If last move made by computer,check if computer wins.\n\t\t */\n\t\tif(this.board[lastMove.getRow()][lastMove.getColumn()]==BoardSigns.COMPUTER.getSign()) {\n\t\t\t if(\n\t\t (board[0][0] == BoardSigns.COMPUTER.getSign() && board[0][1] == BoardSigns.COMPUTER.getSign() && board[0][2] == BoardSigns.COMPUTER.getSign()) ||\n\t\t (board[1][0] == BoardSigns.COMPUTER.getSign() && board[1][1] == BoardSigns.COMPUTER.getSign() && board[1][2] == BoardSigns.COMPUTER.getSign()) ||\n\t\t (board[2][0] == BoardSigns.COMPUTER.getSign() && board[2][1] == BoardSigns.COMPUTER.getSign() && board[2][2] == BoardSigns.COMPUTER.getSign()) ||\n\t\t (board[0][0] == BoardSigns.COMPUTER.getSign() && board[1][0] == BoardSigns.COMPUTER.getSign() && board[2][0] == BoardSigns.COMPUTER.getSign()) ||\n\t\t (board[0][1] == BoardSigns.COMPUTER.getSign() && board[1][1] == BoardSigns.COMPUTER.getSign() && board[2][1] == BoardSigns.COMPUTER.getSign()) ||\n\t\t (board[0][2] == BoardSigns.COMPUTER.getSign() && board[1][2] == BoardSigns.COMPUTER.getSign() && board[2][2] == BoardSigns.COMPUTER.getSign()) ||\n\t\t (board[0][0] == BoardSigns.COMPUTER.getSign() && board[1][1] == BoardSigns.COMPUTER.getSign() && board[2][2] == BoardSigns.COMPUTER.getSign()) ||\n\t\t (board[0][2] == BoardSigns.COMPUTER.getSign() && board[1][1] == BoardSigns.COMPUTER.getSign() && board[2][0] == BoardSigns.COMPUTER.getSign())\n\t\t )\n\t\t\t\t return GameState.PLAYER_LOST;\t\t\t\t\t\t \n\t\t}\n\t\t/*\n\t\t * If last move made by player,check if player wins.\n\t\t */\n\t\telse {\n\t\t\t if(\n\t\t (board[0][0] == BoardSigns.PLAYER.getSign() && board[0][1] == BoardSigns.PLAYER.getSign() && board[0][2] == BoardSigns.PLAYER.getSign()) ||\n\t\t (board[1][0] == BoardSigns.PLAYER.getSign() && board[1][1] == BoardSigns.PLAYER.getSign() && board[1][2] == BoardSigns.PLAYER.getSign()) ||\n\t\t (board[2][0] == BoardSigns.PLAYER.getSign() && board[2][1] == BoardSigns.PLAYER.getSign() && board[2][2] == BoardSigns.PLAYER.getSign()) ||\n\t\t (board[0][0] == BoardSigns.PLAYER.getSign() && board[1][0] == BoardSigns.PLAYER.getSign() && board[2][0] == BoardSigns.PLAYER.getSign()) ||\n\t\t (board[0][1] == BoardSigns.PLAYER.getSign() && board[1][1] == BoardSigns.PLAYER.getSign() && board[2][1] == BoardSigns.PLAYER.getSign()) ||\n\t\t (board[0][2] == BoardSigns.PLAYER.getSign() && board[1][2] == BoardSigns.PLAYER.getSign() && board[2][2] == BoardSigns.PLAYER.getSign()) ||\n\t\t (board[0][0] == BoardSigns.PLAYER.getSign() && board[1][1] == BoardSigns.PLAYER.getSign() && board[2][2] == BoardSigns.PLAYER.getSign()) ||\n\t\t (board[0][2] == BoardSigns.PLAYER.getSign() && board[1][1] == BoardSigns.PLAYER.getSign() && board[2][0] == BoardSigns.PLAYER.getSign())\n\t\t )\n\t\t\t\t return GameState.PLAYER_WON;\t\n\t\t}\n\t\t/*\n\t\t * No one wins,check if in progress or game ends with tie.\n\t\t */\n\t\t\n\t\t //check if exist empty spots. \n\t\t\tfor(int i=0;i<3;i++)\n\t\t\tfor(int j=0;j<3;j++)\n\t\t\t\tif(board[i][j]==TicTacTow.BoardSigns.BLANK.getSign()) \n\t\t\t\t return GameState.IN_PROGRESS;\n\t\t\treturn GameState.TIE;\t\t\t\n\t}", "public static Mission[] getAllMissions(String game){\n \tMission[] missions = null;\n\t\ttry {\n\t\t\tmissions = DBHandler.getAllMissions(game, c);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n \treturn missions;\n }", "public Game populateGames(String name);", "public void executeMove(Game game) {\n int bestScore = 0;\n int comScore = 0;\n Board board = game.getBoard();\n int col = (board.getCols());\n int row = (board.getRows());\n \n // Basic for loop to go through and grab each gem and call the score policy on it\n // it stores the best opton in best score\n for(int i = 0; i < row; i++){\n for(int ii = 0; ii < col; ii++){\n if(board.gemAt(i,ii).isEmpty() == true){\n continue;\n }\n comScore = game.getPolicy().scoreMove(i,ii,board);\n if(comScore >= bestScore){\n bestScore = comScore;\n }\n }\n }\n \n // This for loop makes a Coord with the rows and col i and ii to keep track of where the best gem was located \n for(int i = 0; i < row; i++){\n for(int ii = 0; ii < col; ii++){\n if(board.gemAt(i,ii).isEmpty() == true){\n continue;\n }\n if(game.getPolicy().scoreMove(i,ii,board) == bestScore){\n holder.add(new Coord(i,ii));\n }\n }\n }\n \n // For loop to choose the best Gem out of the holders Coords to call \"removeGemAdjustScore()\"\n for(int i = 0; i < holder.size(); i++){\n if(holder.size() == 1){\n game.removeGemAdjustScore(holder.get(i).row,holder.get(i).col);\n break;\n }\n game.removeGemAdjustScore(holder.get(i).row,holder.get(i).col);\n break;\n }\n \n // Resets the holder and best score for the next move\n holder = new ArrayList<Coord>();\n bestScore = 0;\n \n }", "@Override\n\tpublic List<Games> allGamesView() {\n\t\treturn gameDAO.viewAllGame();\n\t}", "public List<Move> getMoves(ChessBoard chessBoard) {\r\n\t\tList<Move> moves = new ArrayList<>();\r\n\t\tfor (Direction direction : directions) {\r\n\t\t\tfor (int n = 1; n <= maxRange ; n++) {\r\n\t\t\t\tMove move = new Move(x, y, direction, n);\r\n\t\t\t\tif (chessBoard.allows(move)) {\r\n\t\t\t\t\tif (move.isTake(chessBoard)) {\r\n\t\t\t\t\t\tTakeMove takeMove = new TakeMove(x, y, direction, n);\r\n\t\t\t\t\t\ttakeMove.setPiece(this);\r\n\t\t\t\t\t\tPiece pieceAtDestination = chessBoard.pieceAtField(move.getToX(), move.getToY());\r\n\t\t\t\t\t\ttakeMove.setTaken(pieceAtDestination);\r\n\t\t\t\t\t\tmoves.add(takeMove);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tmove.setPiece(this);\r\n\t\t\t\t\t\tmoves.add(move);\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn moves;\r\n\t}", "public void executegenmoves() {\n \t\tObject state = gm.hashToState(new BigInteger(conf.getProperty(\"gamesman.hash\")));\n \t\tfor (Object nextstate : gm.validMoves(state)) {\n \t\t\tSystem.out.println(gm.stateToHash(nextstate));\n \t\t\tSystem.out.println(gm.displayState(nextstate));\n \t\t}\n \t}", "List<ValidMove> getValidMoves();", "Game getGameById(long id);", "public ArrayList<Pair<Coord,Coord>> returnMoves(Board b) {\r\n\t\t//copy Piece grid\r\n\t\tPiece[][] g = b.getGrid();\r\n\t\t\r\n\t\t//return array of all the possible moves\r\n\t\tArrayList<Pair<Coord,Coord>> possibleMoves = new ArrayList<Pair<Coord,Coord>>();\r\n\r\n\t\t//System.out.println(team + \": (\" + c.y + \", \" + c.x + \")\");\r\n\t\t//if the team is moving north (white team)\r\n\t\tif(team) {\r\n\t\t\t//first move, two square pawn advance\r\n\t\t\tif(moves==0 && g[c.y-1][c.x] == null && g[c.y-2][c.x] == null)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-2,c.x),null));\r\n\t\t\t\r\n\t\t\t//single square pawn advance\r\n\t\t\tif(g[c.y-1][c.x] == null)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x),null));\r\n\t\t\t\r\n\t\t\t//capture diagonally west\r\n\t\t\tif(c.x-1>=0 && c.x-1<=7 && g[c.y-1][c.x-1]!=null && (!g[c.y-1][c.x-1].team))\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x-1),null));\r\n\t\t\t\r\n\t\t\t//capture diagonally east\r\n\t\t\tif(c.x+1>=0 && c.x+1<=7 && g[c.y-1][c.x+1]!=null && (!g[c.y-1][c.x+1].team))\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x+1),null));\r\n\t\t\t\r\n\t\t\t//en passant west\r\n\t\t\tif(c.x-1>=0 && c.y==3 && g[c.y-1][c.x-1]==null && g[c.y][c.x-1]!=null && !g[c.y][c.x-1].team \r\n\t\t\t\t\t&& g[c.y][c.x-1].toString().equals(\"P\") && g[c.y][c.x-1].moves==1)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x-1),new Coord(c.y, c.x-1)));\r\n\t\t\t\r\n\t\t\t//en passant east\r\n\t\t\tif(c.x+1<=7 && c.y==3 && g[c.y-1][c.x+1]==null && g[c.y][c.x+1]!=null && !g[c.y][c.x+1].team\r\n\t\t\t\t\t&& g[c.y][c.x+1].toString().equals(\"P\") && g[c.y][c.x+1].moves==1)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x+1),new Coord(c.y, c.x+1)));\r\n\t\t\t\r\n\t\t//if the team is moving south (black team)\r\n\t\t} else {\r\n\t\t\t//first move, two square pawn advance\r\n\t\t\tif(moves==0 && g[c.y+1][c.x] == null && g[c.y+2][c.x] == null)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+2,c.x),null));\r\n\r\n\t\t\t//single square pawn advance\r\n\t\t\tif(g[c.y+1][c.x] == null)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x),null));\r\n\t\t\t\r\n\t\t\t//capture diagonally west\r\n\t\t\tif(c.x-1>=0 && c.x-1<=7 && g[c.y+1][c.x-1]!=null && (g[c.y+1][c.x-1].team))\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x-1),null));\r\n\t\t\t\r\n\t\t\t//capture diagonally east\r\n\t\t\tif(c.x+1>=0 && c.x+1<=7 && g[c.y+1][c.x+1]!=null && (g[c.y+1][c.x+1].team))\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x+1),null));\r\n\t\t\t\r\n\t\t\t//en passant west\r\n\t\t\tif(c.x-1>=0 && c.y==4 && g[c.y+1][c.x-1]==null && g[c.y][c.x-1]!=null && g[c.y][c.x-1].team \r\n\t\t\t\t\t&& g[c.y][c.x-1].toString().equals(\"P\") && g[c.y][c.x-1].moves==1)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x-1),new Coord(c.y, c.x-1)));\r\n\t\t\t\r\n\t\t\t//en passant east\r\n\t\t\tif(c.x+1<=7 && c.y==4 && g[c.y-1][c.x+1]==null && g[c.y][c.x+1]!=null && g[c.y][c.x+1].team \r\n\t\t\t\t\t&& g[c.y][c.x+1].toString().equals(\"P\") && g[c.y][c.x+1].moves==1)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x+1),new Coord(c.y, c.x+1)));\r\n\t\t\t\r\n\t\t}\t\t\r\n\r\n\t\treturn possibleMoves;\r\n\t}", "public List<IMove> getMoves() {\n List<ICard> hand = hands.get(currentTurn);\n\n List<IMove> moves = new ArrayList<>(hand.size() + 1);\n for (ICard card : hand) {\n if (isValidPlay(card)) {\n moves.addAll(card.getMoves(this));\n }\n }\n\n moves.add(new DrawCardMove(currentTurn));\n\n return moves;\n }", "public List<ScoredMove> allDiscardMoves(GameState gm) {\n\t\tList<ScoredMove> discardMoves = new ArrayList<ScoredMove>();\n\t\t\n\t\tfor (Card c: getHand().getCards()) {\n\t\t\tif (!(c instanceof MerchantShip)) {\n\t\t\t\tdiscardMoves.add(new ScoredMove(ACTION.DISCARD, c, null));\n\t\t\t}\n\t\t}\n\t\treturn discardMoves;\n\t}", "@Override\n public void getMoves(ArrayList<Move> moves) {\n // WARNING: This function must not return duplicate moves\n moves.clear();\n\n for (int i = 0; i < 81; ++i) {\n if (board[i] == currentPlayer) {\n getMovesSingleStep(moves, i);\n getMovesJump(moves, i, i);\n }\n }\n }", "public LinkedList<Move> getPossibleMoves() {\n\t\tAIPossibleMoves.clear();\n\t\tint xOrigin = 0, yOrigin = 0, xMove1 = 0, xMove2 = 0, yMove1 = 0, yMove2 = 0;\n\t\tMove move = null;\t\n\t\t\tint type = 0;\n\t\t\tfor(Checker checker: model.whitePieces) {\n\t\t\t\t\n\t\t\t\txOrigin = checker.getCurrentXPosition();\n\t\t\t\tyOrigin = checker.getCurrentYPosition();\n\t\t\t\txMove1 = (checker.getCurrentXPosition() - 1);\n\t\t\t\txMove2 = (checker.getCurrentXPosition() + 1);\n\t\t\t\tyMove1 = (checker.getCurrentYPosition() - 1);\n\t\t\t\tyMove2 = (checker.getCurrentYPosition() + 1);\n\t\t\t\ttype = checker.getType();\n\t\t\t\tswitch(type) {\n\t\t\t\tcase 2:\n\n\t\t\t\t\tif((xMove1 < 0) || (yMove1 <0)) {\n\t\t\t\t\t//\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove1, yMove1, false, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove1,yMove1)) {\n\t\t\t\t\t\t\t//System.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove1,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove1, yMove1, false, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n \n\t\t\t\t\tif((xMove2 > 7) || (yMove1 < 0)) {\n\t\t\t\t\t//\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove2, yMove1, true, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove2,yMove1)) {\n\t\t\t\t\t\t\t// System.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove2,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove2, yMove1, true, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 4:\n\t\t\t\t\t//Moving up and left isMovingRight,IsMovingDown\n\t\t\t\t\tif((xMove1 <0) || (yMove1 < 0)) {\n\t\t\t\t\t\t//continue;\n\t\t\t\t\t} else {\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove1, yMove1, false, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove1,yMove1)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove1,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove1, yMove1, false, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((xMove2 > 7) || (yMove1 < 0)) {\n\t\t\t\t\t//continue;\n\t\t\t\t} else {\n\t\t\t\t\t//moving up and right\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove2, yMove1, true, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove2,yMove1)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove2,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove2, yMove1, true, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((xMove1 < 0) || (yMove2 > 7)) {\n\t\t\t\t//\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t//moving down and left isMovingRight,IsMovingDown\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove1, yMove2, false, true )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove1,yMove2)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove2);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove1,yMove2,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove1, yMove2, false, true)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove2);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((xMove2 > 7) || (yMove2 > 7)) {\n\t\t\t\t\t//continue;\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\t//moving down and right isMovingRight,IsMovingDown\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove2, yMove2, true, true )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove2,yMove2)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove2);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove2,yMove2,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove2, yMove2, true, true)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove2);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tbreak;\t\n\t\t\t\t}\t\n\t\t\t\n\t\t\t}\n\n\t\t\treturn AIPossibleMoves;\n\t\t\t\n\t\t}", "@Override public GameList getAllGamesFromServer() throws RemoteException, SQLException {\r\n return gameListClientModel.getGamesFromServer();\r\n }", "public static Array<GamePiece> getAllFirstMoves(PlayerArea pa, GameMode.Tile[][] grid){\n int ox = 0, oy = 0;\n\n switch(pa.playerColor){\n case BLUE:\n ox = -1;\n oy = -1;\n break;\n case RED:\n ox = 20;\n oy = -1;\n break;\n case GREEN:\n ox = 20;\n oy = 20;\n break;\n case YELLOW:\n ox = -1;\n oy = 20;\n break;\n }\n\n Array<GamePiece> possibleMoves = new Array<GamePiece>();\n for(GamePiece gp : pa.gamePieces){\n if(gp != null) {\n Piece p = gp.template;\n for (int i = 0; i < p.rotations; i++) {\n for (int j = 0; j < p.corners[i].length; j++) {\n Pair pair = p.corners[i][j];\n int x = ox - pair.x;\n int y = oy - pair.y;\n if (validPartial(p, i, x, y, grid, pa.playerColor)) {\n possibleMoves.add(new GamePiece(x, y, i, p, pa.playerColor));\n }\n }\n }\n }\n }\n return possibleMoves;\n }", "ArrayList<Move> legalMoves() {\n ArrayList<Move> result = new ArrayList<Move>();\n int f, b;\n Move m;\n for (int i = 1; i < 8; i++) {\n for (int j = 1; j < 8; j++) {\n if (get(i,j).side() == _turn) {\n f = forward(j, i);\n b = backward(j, i);\n c = _col[j];\n r = _row[i];\n m = Move.create(j, i, j - b, i - b);\n addMove(result, m);\n m = Move.create(j, i, j + b, i + b);\n addMove(result, m);\n m = Move.create(j, i, j + f, i - f);\n addMove(result, m);\n m = Move.create(j, i, j - f, i + f);\n addMove(result, m);\n m = Move.create(j, i, j + c, i);\n addMove(result, m);\n m = Move.create(j, i, j - c, i);\n addMove(result, m);\n m = Move.create(j, i, j, i + r);\n addMove(result, m);\n m = Move.create(j, i, j, i - r);\n addMove(result, m);\n } else {\n continue;\n }\n }\n }\n return result;\n }", "public ArrayList<Move> getPossibleMoves() \n\t{\n\t\tArrayList<Move> possibleMoves = new ArrayList<Move>();\n\t\t\n\t\tfor(int i = - 1; i <= 1; i += 2)\n\t\t{\n\t\t\tfor(int j = -1; j <= 1; j += 2)\n\t\t\t{\n\t\t\t\tLocation currentLoc = new Location(getLoc().getRow() + j, getLoc().getCol() + i);\n\t\t\t\t\n\t\t\t\tif(getBoard().isValid(currentLoc))\n\t\t\t\t{\n\t\t\t\t\tif(getBoard().getPiece(currentLoc) == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tArrayList<Node> move = new ArrayList<Node>();\n\t\t\t\t\t\tmove.add(getNode());\n\t\t\t\t\t\tmove.add(getBoard().getNode(currentLoc));\n\t\t\t\t\t\t\n\t\t\t\t\t\tpossibleMoves.add(new CheckersMove(move, getBoard(), getLoyalty()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(ArrayList<Node> move : getNextJumps(getLoc(), new ArrayList<Location>()))\n\t\t{\n\t\t\tif(move.size() > 1)\n\t\t\t{\n\t\t\t\tpossibleMoves.add(new CheckersMove(move, getBoard(), getLoyalty()));\n\t\t\t}\n\t\t}\n\t\t\n\t\tArrayList<Move> jumpMoves = new ArrayList<Move>();\n\t\t\n\t\tfor(Move possibleMove : possibleMoves)\n\t\t{\n\t\t\tif(!possibleMove.getJumped().isEmpty())\n\t\t\t{\n\t\t\t\tjumpMoves.add(possibleMove);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!jumpMoves.isEmpty())\n\t\t{\n\t\t\treturn jumpMoves;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn possibleMoves;\n\t\t}\n\t}", "List<Player> findAllPlayers();", "@Override\n public Map<Coordinate, List<Coordinate>> getAllLegalMoves(List<Integer> playerStates) {\n Map<Coordinate, List<Coordinate>> allLegalMoves = new TreeMap<>();\n for (List<GamePiece> row: myGamePieces) {\n for(GamePiece currPiece: row){\n if (playerStates.contains(currPiece.getState()) || currPiece.getState() == myEmptyState) {\n Coordinate currCoord = currPiece.getPosition();\n List<Coordinate> moves = currPiece.calculateAllPossibleMoves(getNeighbors(currPiece), playerStates.get(0));\n if (moves.size() > 0) {\n allLegalMoves.put(currCoord, moves);\n }\n }\n }\n }\n return allLegalMoves;\n }", "public Set<Move> getMovesForPlayer(Player player) {\n\t\tfinal Set<Move> moveList = new HashSet<Move>();\n\t\tfor (Map.Entry<Position, Piece> entry : positionToPieceMap.entrySet()) {\n\t\t\tfinal Position positionFrom = entry.getKey();\n\t\t\tfinal Piece piece = entry.getValue();\n\t\t\tif (player == piece.getOwner()) {\n\t\t\t\tfor (char column = Position.MIN_COLUMN; column <= Position.MAX_COLUMN; column++) {\n\t\t\t\t\tfor (int row = Position.MIN_ROW; row <= Position.MAX_ROW; row++) {\n\t\t\t\t\t\tfinal Position positionTo = new Position(column, row);\n\t\t\t\t\t\tif (!positionFrom.equals(positionTo)) {\n\t\t\t\t\t\t\tfinal Piece possiblePieceOnPosition = getPieceAt(positionTo);\n\t\t\t\t\t\t\tif (possiblePieceOnPosition == null || possiblePieceOnPosition.getOwner() != player) { //can move to free position \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //or position where enemy is placed\n\t\t\t\t\t\t\t\tif (piece instanceof Pawn) {\n\t\t\t\t\t\t\t\t\tPawn pawn = (Pawn) piece;\n\t\t\t\t\t\t\t\t\tpawn.isValidFightMove(positionFrom, positionTo);\n\t\t\t\t\t\t\t\t\tmoveList.add(new Move(positionFrom, positionTo));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfinal boolean isKnight = (piece instanceof Knight); // knight can jump over sheets\n\t\t\t\t\t\t\t\tif (piece.isValidMove(positionFrom, positionTo) && !isBlocked(positionFrom, positionTo, isKnight)) {\n\t\t\t\t\t\t\t\t\tmoveList.add(new Move(positionFrom, positionTo));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn moveList;\n\t}", "private Set<SteamUserNode> bindGames(Set<SteamUserNode> players) {\n\t\tString dest = \"http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?\" +\r\n\t\t\t\t\"key=%s&steamid=%d&include_appinfo=1&include_played_free_games=1&format=json\";\r\n\t\tString response = \"\";\r\n\t\tfor (SteamUserNode p : players) {\r\n\t\t\ttry {\r\n\t\t\t\tthis.apiCalls += 1;\r\n\t\t\t\tString query = String.format(dest, key, p.getId());\r\n\t\t\t\tURL url = new URL(query);\r\n\t\t\t\tHttpURLConnection con = (HttpURLConnection) url.openConnection();\r\n\t\t\t\tcon.setRequestMethod(\"GET\");\r\n\t\t\t\tcon.setConnectTimeout(3000);\r\n\t\t\t\tcon.connect();\r\n\t\t\t\tint respCode = con.getResponseCode();\r\n\t\t\t\tif (respCode != 200)\r\n\t\t\t\t\tSystem.out.println(\"Status code: \" + respCode + \"\\nFor request: \" + query);\r\n\t\t\t\telse {\r\n\t\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(con.getInputStream()));\r\n\t\t\t\t\tresponse = reader.lines().collect(Collectors.joining());\r\n\t\t\t\t\tint numGames = new JSONObject(response).getJSONObject(\"response\").getInt(\"game_count\");\r\n\t\t\t\t\tif (numGames > 0) {\r\n\t\t\t\t\t\tJSONArray ownedGames = new JSONObject(response).getJSONObject(\"response\").getJSONArray(\"games\");\r\n\t\t\t\t\t\tfor (int i=0;i<ownedGames.length();++i) {\r\n\t\t\t\t\t\t\tJSONObject g = ownedGames.getJSONObject(i);\r\n\t\t\t\t\t\t\tlong appId = g.getLong(\"appid\");\r\n\t\t\t\t\t\t\tString name = g.getString(\"name\");\r\n\t\t\t\t\t\t\tString logoHash = g.getString(\"img_logo_url\");\r\n\t\t\t\t\t\t\tint playForever = g.getInt(\"playtime_forever\");\r\n\t\t\t\t\t\t\tint play2Wks = g.has(\"playtime_2weeks\") ? g.getInt(\"playtime_2weeks\") : 0;\r\n\t\t\t\t\t\t\tPlayedGame game = new PlayedGame(appId, name, logoHash, play2Wks, playForever);\r\n\t\t\t\t\t\t\tp.addPlayedGame(game);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (!knownGames.contains(game)) {\r\n\t\t\t\t\t\t\t\tknownGames.add((SteamGame) game);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (localWrite) {\r\n\t\t\t\t\t\t\tjsonWriter.writeOwnedGames(response, p);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (JSONException jse) {\r\n\t\t\t\tSystem.err.println(jse.getMessage());\r\n\t\t\t\tSystem.out.println(response);\r\n\t\t\t} catch (MalformedURLException mue) {\r\n\t\t\t\t//once again, this better not happen...\r\n\t\t\t\tSystem.err.println(mue.getMessage());\r\n\t\t\t} catch (IOException ioe) {\r\n\t\t\t\tSystem.err.println(ioe.getMessage());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn players;\r\n\t}", "List<GameResult> getAllResults();", "@Override\r\n\tpublic ArrayList<String> allPossibleMoves(boolean whoPlays) {\r\n\t\t\r\n\t\tArrayList<String> Moves = new ArrayList<String>();\r\n\t\t\r\n\t\tif(whoPlays) {\r\n\t\t\tif( (new Board2048model(this)).moveUP()) \r\n\t\t\tMoves.add(\"UP\");\r\n\t\t\tif( (new Board2048model(this)).moveDOWN()) \r\n\t\t\tMoves.add(\"DOWN\");\r\n\t\t\tif( (new Board2048model(this)).moveRIGHT()) \r\n\t\t\tMoves.add(\"RIGHT\");\r\n\t\t\tif( (new Board2048model(this)).moveLEFT()) \r\n\t\t\tMoves.add(\"LEFT\");\r\n\t\t\t}\r\n\t\telse { \r\n\t\t\tfor( int i = 0; i < rows_size ; i++) {\r\n\t\t\t\tfor(int j = 0; j < columns_size; j++) {\r\n\t\t\t\t\tif(isEmpty(i,j)) {\r\n\t\t\t\t\t\tMoves.add(new String(Integer.toString(i) + \",\" + Integer.toString(j) + \",\" + Integer.toString(2)));\r\n\t\t\t\t\t\tMoves.add(new String(Integer.toString(i) + \",\" + Integer.toString(j) + \",\" + Integer.toString(4)));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t}\r\n\treturn Moves;\r\n\t}", "public ArrayList<ArrayList<Move>> getMoves(int color){//TODO\n \tArrayList<ArrayList<Move>> moves = new ArrayList<ArrayList<Move>>();\n \tboolean jumpsExist = false;\n \t//look for jumps\n \t//search the board for pieces of your color\n for (int i=0; i<8; i++){\n \tfor(int j=0; j<8; j++){\n \t\t//if the piece is the right color\n \t\tif ((gameState.getStateOfSquare(i, j) != 0)&&(gameState.getStateOfSquare(i, j)%2 == color)){\n// \t\t\tSystem.out.println(\"found a piece you own\");\n \t\t\t//find all jumps of that piece\n \t\t\t//get jumps\n \t\t\tArrayList<ArrayList<Move>> jumps = getJumps(color, i, j);\n \t\t\t//if there are jumps return only the jumps\n \t\t\tif (jumps.isEmpty() == false){\n \t\t\t\tmoves.addAll(jumps);\n \t\t\t\tjumpsExist = true;\n \t\t\t}\n \t\t}\n \t}\n }\n if (jumpsExist == false){\n\t //look for diagonals\n\t \t//search the board for pieces of your color\n\t for (int i=0; i<8; i++){\n\t \tfor(int j=0; j<8; j++){\n\t \t\t//if the piece is the right color\n\t \t\tif ((gameState.getStateOfSquare(i, j) != 0)&&(gameState.getStateOfSquare(i, j)%2 == color)){\n//\t \t\t\tSystem.out.println(\"found a piece you own\");\n\t \t\t\t//get diagonals\n\t \t\t\t//try up right\n\t \t\t\tMove tryMove = new Move(i,j,i+1,j+1);\n\t \t\t\tif (attemptMove(tryMove, color)){// if this move is valid add it to moves\n\t \t\t\t\taddMove(tryMove, moves);\n\t \t\t\t}\n\t \t\t\t//try up left\n\t \t\t\ttryMove = new Move(i,j,i-1,j+1);\n\t \t\t\tif (attemptMove(tryMove, color)){// if this move is valid add it to moves\n\t \t\t\t\taddMove(tryMove, moves);\n\t \t\t\t}\n\t \t\t\t//try down right\n\t \t\t\ttryMove = new Move(i,j,i+1,j-1);\n\t \t\t\tif (attemptMove(tryMove, color)){// if this move is valid add it to moves\n\t \t\t\t\taddMove(tryMove, moves);\n\t \t\t\t}\n\t \t\t\t//try down left\n\t \t\t\ttryMove = new Move(i,j,i-1,j-1);\n\t \t\t\tif (attemptMove(tryMove, color)){// if this move is valid add it to moves\n\t \t\t\t\taddMove(tryMove, moves);\n\t \t\t\t}\n\t \t\t\t}\n\t \t\t}\n\t }\n\t }\n if (moves.isEmpty() == true){\n \tnoMoves = true;\n }\n \t\t\t//\n \treturn moves;\n }", "@Override\n\tpublic List<Game> listGames(Player player) {\n\t\treturn iGameRepository.findAllByPlayer(player);\n\t}", "private Cell[] allPossibleMoves(Cell source) {\n\t\tCell[] moves = new Cell[2 * Board.BOARD_SIZE - 2]; // Вертикаль и горизонталь, которые бьет ладья\n\t\tint columnIndex = source.getColumn();\n\t\tint rowIndex = source.getRow();\n\t\tint k = 0;\n\t\tfor (int i = 0; i < Board.BOARD_SIZE; i++) {\n\t\t\tif (i != rowIndex) {\n\t\t\t\tmoves[k++] = new Cell(columnIndex, i);\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < Board.BOARD_SIZE; i++) {\n\t\t\tif (i != columnIndex) {\n\t\t\t\tmoves[k++] = new Cell(i, rowIndex);\n\t\t\t}\n\t\t}\n\t\treturn moves;\n\t}", "public PossibleMoves getPossibleMoves(State state){\n if(possibleMoves == null){\n possibleMoves = new PossibleMoves(state);\n }\n return possibleMoves;\n }", "public List<Move> validMoves(){\n List<Move> results = new LinkedList<>();\n int kingVal = turn == WHITE ? WHITE_KING : BLACK_KING;\n int kingX = 0, kingY = 0;\n List<Piece> checks = null;\n kingSearch:\n for (int y = 0; y < 8; y++){\n for (int x = 0; x < 8; x++){\n if (board[y][x] == kingVal){\n kingX = x;\n kingY = y;\n checks = inCheck(x,y);\n break kingSearch;\n }\n }\n }\n if (checks.size() > 1){ // must move king\n for (int x = -1; x < 2; x++){\n for (int y = -1; y < 2; y++){\n if (kingX+x >= 0 && kingX + x < 8 && kingY+y >= 0 && kingY+y < 8){\n int val = board[kingY+y][kingX+x];\n if (val == 0 || turn == WHITE && val > WHITE_KING || turn == BLACK && val < BLACK_PAWN){\n // may still be a move into check, must test at end\n results.add(new Move(kingVal, kingX, kingY, kingX+x, kingY+y, val, 0, this));\n }\n }\n }\n }\n } else { // could be in check TODO: split into case of single check and none, identify pin/capture lines\n int queen = turn == WHITE ? WHITE_QUEEN : BLACK_QUEEN;\n int knight = turn == WHITE ? WHITE_KNIGHT : BLACK_KNIGHT;\n int rook = turn == WHITE ? WHITE_ROOK : BLACK_ROOK;\n int bishop = turn == WHITE ? WHITE_BISHOP : BLACK_BISHOP;\n for (int y = 0; y < 8; y++) {\n for (int x = 0; x < 8; x++) {\n int piece = board[y][x];\n if (piece == (turn == WHITE ? WHITE_PAWN : BLACK_PAWN)) { // pawns\n // regular | 2 move\n if (board[y+turn][x] == 0){\n if (y+turn == 0 || y + turn == 7){ // promotion\n results.add(new Move(piece, x, y, x, y + turn, 0, queen, this));\n results.add(new Move(piece, x, y, x, y + turn, 0, knight, this));\n results.add(new Move(piece, x, y, x, y + turn, 0, rook, this));\n results.add(new Move(piece, x, y, x, y + turn, 0, bishop, this));\n }\n else {\n results.add(new Move(piece, x, y, x, y + turn, 0, 0, this));\n if ((y == (turn == WHITE ? 1 : 6)) && board[y + 2 * turn][x] == 0) { // initial 2 move\n results.add(new Move(piece, x, y, x, y + 2*turn, 0, 0, this));\n }\n }\n }\n // capture\n for (int dx = -1; dx <= 1; dx += 2){\n if (x + dx >= 0 && x + dx < 8) {\n int val = board[y+turn][x+dx];\n if (val > 0 && (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n if (y + turn == 0 || y + turn == 7){ // promotion\n results.add(new Move(piece, x, y, x+dx, y + turn, val, queen, this));\n results.add(new Move(piece, x, y, x+dx, y + turn, val, knight, this));\n results.add(new Move(piece, x, y, x+dx, y + turn, val, rook, this));\n results.add(new Move(piece, x, y, x+dx, y + turn, val, bishop, this));\n } else {\n results.add(new Move(piece, x, y, x+dx, y + turn, val, 0, this));\n }\n }\n if (val == 0 && y == (turn == WHITE ? 4 : 3) && x+dx == enPassant){ // en passant\n results.add(new Move(piece, x, y, x+dx, y + turn, 0, 0, this));\n }\n }\n }\n\n } else if (piece == knight) { // knights TODO: lookup table\n for (int dx = -1; dx <= 1; dx += 2){\n for (int dy = -2; dy <= 2; dy += 4){\n if (x+dx >= 0 && x + dx < 8 && y + dy >= 0 && y + dy < 8){\n int val = board[y+dy][x+dx];\n if (val == 0 || (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n results.add(new Move(piece,x,y,x+dx,y+dy,val,0,this));\n }\n }\n if (x+dy >= 0 && x + dy < 8 && y + dx >= 0 && y + dx < 8){\n int val = board[y+dx][x+dy];\n if (val == 0 || (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n results.add(new Move(piece,x,y,x+dy,y+dx,val,0,this));\n }\n }\n }\n }\n } else if (piece == bishop) { // bishops\n for (int dx = -1; dx <= 1; dx += 2){\n for (int dy = -1; dy <= 1; dy += 2){\n int i = 1;\n while (x + dx*i >= 0 && x + dx*i < 8 && y + dy*i >= 0 && y + dy*i < 8){\n int val = board[y+dy*i][x+dx*i];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n } else if (piece == rook) { // rooks\n for (int dx = -1; dx <= 1; dx+= 2){\n for (int ax = 0; ax < 2; ax++){\n int i = 1;\n while (ax==0 ? y+dx*i >= 0 && y+dx*i < 8 : x+dx*i >= 0 && x+dx*i < 8){\n int val = board[y+dx*i*(1-ax)][x+dx*i*ax];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n } else if (piece == (turn == WHITE ? WHITE_QUEEN : BLACK_QUEEN)) { // queens\n // Diagonals - same as bishops\n for (int dx = -1; dx <= 1; dx += 2){\n for (int dy = -1; dy <= 1; dy += 2){\n int i = 1;\n while (x + dx*i >= 0 && x + dx*i < 8 && y + dy*i >= 0 && y + dy*i < 8){\n int val = board[y+dy*i][x+dx*i];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n for (int dx = -1; dx <= 1; dx+= 2){\n for (int ax = 0; ax < 2; ax++){\n int i = 1;\n while (ax==0 ? y+dx*i >= 0 && y+dx*i < 8 : x+dx*i >= 0 && x+dx*i < 8){\n int val = board[y+dx*i*(1-ax)][x+dx*i*ax];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n } else if (piece == (turn == WHITE ? WHITE_KING : BLACK_KING)) { // king\n for (int dx = -1; dx < 2; dx++){\n for (int dy = -1; dy < 2; dy++){\n if ((dx != 0 || dy != 0) && x+dx >= 0 && x + dx < 8 && y + dy >= 0 && y + dy < 8){\n int val = board[y+dy][x+dx];\n if (val == 0 || (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n results.add(new Move(piece,x,y,x+dx,y+dy,val,0,this));\n }\n }\n }\n }\n }\n }\n }\n // castle\n if (checks.size() == 0){\n if (turn == WHITE && (castles & 0b11) != 0){//(castles[0] || castles[1])){\n board[0][4] = 0; // remove king to avoid check test collisions with extra king\n if ((castles & WHITE_SHORT) != 0 && board[0][5] == 0 && board[0][6] == 0 && inCheck(5,0).size() == 0){\n //if (castles[0] && board[0][5] == 0 && board[0][6] == 0 && inCheck(5,0).size() == 0){\n results.add(new Move(WHITE_KING, 4, 0, 6, 0, 0, 0, this));\n }\n if ((castles & WHITE_LONG) != 0 && board[0][1] == 0 && board[0][2] == 0 && board[0][3] == 0 &&\n inCheck(3,0).size() == 0){\n //if (castles[1] && board[0][1] == 0 && board[0][2] == 0 && board[0][3] == 0 && inCheck(3,0).size() == 0){\n results.add(new Move(WHITE_KING, 4, 0, 2, 0, 0, 0, this));\n }\n board[0][4] = WHITE_KING;\n }else if (turn == BLACK && (castles & 0b1100) != 0){//(castles[2] || castles[3])) {\n board[7][4] = 0; // remove king to avoid check test collisions with extra king\n //if (castles[2] && board[7][5] == 0 && board[7][6] == 0 && inCheck(5, 7).size() == 0) {\n if ((castles & BLACK_SHORT) != 0 && board[7][5] == 0 && board[7][6] == 0 && inCheck(5, 7).size() == 0) {\n results.add(new Move(BLACK_KING, 4, 7, 6, 7, 0, 0, this));\n }\n //if (castles[3] && board[7][1] == 0 && board[7][2] == 0 && board[7][3] == 0 && inCheck(3, 7).size() == 0) {\n if ((castles & BLACK_LONG) != 0 && board[7][1] == 0 && board[7][2] == 0 && board[7][3] == 0 &&\n inCheck(3, 7).size() == 0) {\n results.add(new Move(BLACK_KING, 4, 7, 2, 7, 0, 0, this));\n }\n board[7][4] = BLACK_KING;\n }\n }\n }\n List<Move> fullLegal = new LinkedList<>();\n for (Move m : results){\n makeMove(m);\n turn = -turn;\n if (m.piece == WHITE_KING || m.piece == BLACK_KING){\n if (inCheck(m.toX,m.toY).size() == 0){\n fullLegal.add(m);\n }\n }else if (inCheck(kingX,kingY).size() == 0){\n fullLegal.add(m);\n }\n turn = -turn;\n undoMove(m);\n }\n Collections.sort(fullLegal, (o1, o2) -> o2.score - o1.score); // greatest score treated as least so appears first\n return fullLegal;\n }", "public List<Game> getFullGameList() {\n List<Game> listOfGames = null;\n Session session = sessionFactory.openSession();\n // Try to return the user by the given nickname\n try {\n session.beginTransaction();\n // if mode equals ALL then get full list of games\n listOfGames = session.createCriteria(Game.class).list();\n \n session.getTransaction().commit();\n session.flush();\n } \n catch (HibernateException e) { return null; } \n finally { session.close(); }\n // Return userID if seted\n return listOfGames;\n }", "public PossibleMove[] getPossibleMoves(Coordinate from);", "public VwStatsPerGame[] findAll() throws VwStatsPerGameDaoException\n\t{\n\t\treturn findByDynamicSelect( SQL_SELECT, null );\n\t}", "List<Move> legalMoves(Piece side) {\r\n legalMovesArr = new ArrayList<Move>();\r\n HashSet<Square> pieceSide = pieceLocations(side);\r\n for (Square pieces : pieceSide) {\r\n for (int i = 0; i <= 8; i++) {\r\n Move x = mv(pieces, sq(pieces.col(), i));\r\n legalMovesArr.add(x);\r\n }\r\n for (int j = 0; j <= 8; j++) {\r\n Move y = mv(pieces, sq(j, pieces.row()));\r\n legalMovesArr.add(y);\r\n }\r\n while (legalMovesArr.remove(null));\r\n }\r\n return legalMovesArr;\r\n }", "protected List<Move> getMoves() {\n return moves;\n }", "protected void executeSearch(MonteCarloTree<A> tree, Game<A, ActionEnum<A>> clonedGame) {\n int currentPlayer = clonedGame.getCurrentPlayer().getActorRef();\n AllPlayerDeterminiser apd = clonedGame.getAPD(currentPlayer);\n // this cannot be a Decider level variable, and should be linked to the Game\n\n MCTSChildDecider<A> childDecider;\n if (openLoop) {\n OpenLoopStateFactory<A> factory = new OpenLoopStateFactory<>(treeSetting, treeMap, clonedGame);\n childDecider = createChildDecider(apd, factory, tree, currentPlayer, false);\n } else {\n childDecider = createChildDecider(apd, stateFactory, tree, currentPlayer, false);\n }\n if (useAVDForOpponent)\n opponentModel = new MCActionValueDecider<>(tree, this.stateFactory, currentPlayer);\n\n MCTSUtilities.launchGame(treeMap, apd, childDecider, opponentModel, decProp);\n }", "@RequestMapping(value = \"/game\", method = RequestMethod.GET)\n @ResponseStatus(value = HttpStatus.OK)\n public List<Game> getAllGame() {\n return serviceLayer.getAllGame();\n }", "@Test\n\tpublic void testGetMoves() {\n\t\tGameState test = new GameState();\n\t\ttest.move(4);\n\t\ttest.move(7);\n\t\ttest.move(15);\n\t\ttest.move(20);\n\t\tassertEquals(4, test.getMoves());\n\t\ttest.move(24);\n\t\ttest.move(16);\n\t\tassertEquals(6, test.getMoves());\n\t}", "@Override\n @Transactional(readOnly = true)\n public Page<PositionMoveDTO> findAll(Pageable pageable) {\n log.debug(\"Request to get all PositionMoves\");\n Page<PositionMove> result = positionMoveRepository.findAll(pageable);\n return result.map(positionMove -> positionMoveMapper.positionMoveToPositionMoveDTO(positionMove));\n }", "@Repository\npublic interface GameRepository extends JpaRepository<Game, Long> {\n\n /**\n * 查找指定分类的前4条游戏记录并且不包含指定游戏 id 的记录\n *\n * @param categoryId 分类 id\n * @param gameId 游戏 id\n * @return 游戏列表\n */\n List<Game> findTop4ByCategoryIdAndIdNotIn(Long categoryId, Long gameId);\n\n @EntityGraph(value = \"graph.Game.images\", type = EntityGraph.EntityGraphType.FETCH)\n Game getOne(Long id);\n\n /**\n * 根据名字查找游戏\n *\n * @param name 游戏名\n * @return 游戏实体\n */\n @EntityGraph(value = \"graph.Game.images\", type = EntityGraph.EntityGraphType.FETCH)\n Game findFirstByName(String name);\n\n\n /**\n * 根据类别查找游戏列表\n *\n * @param categoryId\n * @return 列表\n */\n @EntityGraph(value = \"graph.Game.images\", type = EntityGraph.EntityGraphType.FETCH)\n List<Game> findAllByCategoryId(Long categoryId);\n\n /**\n * 游戏分页\n *\n * @param pageable 分页\n * @return 列表\n */\n @EntityGraph(value = \"graph.Game.images\", type = EntityGraph.EntityGraphType.FETCH)\n Page<Game> findAll(Pageable pageable);\n\n /**\n * 根据游戏名字模糊查询\n * @param keyword 游戏名字\n * @return 游戏列表\n */\n List<Game> findByNameContaining(String keyword);\n}", "public MahjongSolitaireMove findMove()\n {\n // MAKE A MOVE TO FILL IN \n MahjongSolitaireMove move = new MahjongSolitaireMove();\n\n // GO THROUGH THE ENTIRE GRID TO FIND A MATCH BETWEEN AVAILABLE TILES\n for (int i = 0; i < gridColumns; i++)\n {\n for (int j = 0; j < gridRows; j++)\n {\n ArrayList<MahjongSolitaireTile> stack1 = tileGrid[i][j];\n if (stack1.size() > 0)\n {\n // GET THE FIRST TILE\n MahjongSolitaireTile testTile1 = stack1.get(stack1.size()-1);\n for (int k = 0; k < gridColumns; k++)\n {\n for (int l = 0; l < gridRows; l++)\n {\n if (!((i == k) && (j == l)))\n { \n ArrayList<MahjongSolitaireTile> stack2 = tileGrid[k][l];\n if (stack2.size() > 0) \n {\n // AND TEST IT AGAINST THE SECOND TILE\n MahjongSolitaireTile testTile2 = stack2.get(stack2.size()-1);\n \n // DO THEY MATCH\n if (testTile1.match(testTile2))\n {\n // YES, FILL IN THE MOVE AND RETURN IT\n move.col1 = i;\n move.row1 = j;\n move.col2 = k;\n move.row2 = l;\n return move;\n }\n }\n }\n }\n }\n }\n }\n }\n // WE'VE SEARCHED THE ENTIRE GRID AND THERE\n // ARE NO POSSIBLE MOVES REMAINING\n return null;\n }", "public List<Game> getGamesForTable() throws ServiceException {\r\n\r\n List<Game> allNotPlayedGames = null;\r\n try {\r\n allNotPlayedGames = gameDao.findAllNotPlayedGames();\r\n } catch (DaoException e) {\r\n logger.error(e);\r\n throw new ServiceException(e);\r\n }\r\n List<Game> gamesForTable = new ArrayList<>();\r\n\r\n for(Game game : allNotPlayedGames){\r\n\r\n buildGame(game);\r\n\r\n boolean validHorseBets = isHorseBetsValidForTable(game);\r\n\r\n if (validHorseBets) {\r\n gamesForTable.add(game);\r\n }\r\n }\r\n\r\n return gamesForTable;\r\n }", "public synchronized List<Game> getGameList() {\n return games;\n }", "public Move[] getAllPossibleMoves(boolean isWhitesMove)\r\n\t{\r\n\t\tArrayList<Move> legalMoves = new ArrayList<Move>();\r\n\r\n\t\tPiece[] piecesToMove = isWhitesMove ? whitePieces : blackPieces;\r\n\t\tfor (int i = 0; i < piecesToMove.length; i++)\r\n\t\t{\r\n\t\t\tlegalMoves.addAll(getPieceMove(piecesToMove[i]));\r\n\t\t}\r\n\r\n\t\tlegalMoves.trimToSize();\r\n\t\tMove[] moves = legalMoves.toArray(new Move[legalMoves.size()]);\r\n\t\tisKingCheck(moves, isWhitesMove);\r\n\t\treturn moves;\r\n\t}", "public void locateGame() {\n int[] screenPixels;\n BufferedImage screenshot;\n System.out.print(\"Detecting game...\");\n while (!gameDetected) {\n screenshot = robot.createScreenCapture(new Rectangle(screenWidth, screenHeight));\n screenPixels = screenshot.getRGB(0, 0, screenWidth, screenHeight, null, 0, screenWidth);\n detectMaze(screenPixels);\n delay(20);\n }\n System.out.print(\"game detected!\\n\");\n }", "@Override\n\tpublic Collection<Move> calculateLegalMoves(final Board board) {\n\t\t\n\t\t//Array that will hold of the legal moves for the Pawn\n\t\tfinal List<Move> legalMoves = new ArrayList<>();\n\t\t\n\t\t//Loop through all possible moves by applying of the offsets to the Pawn's current position\n\t\tfor(final int currentCandidateOffset: CANDIDATE_MOVE_COORDINATES){\n\t\t\t\n\t\t\t//Apply the offset to the Pawn's current position\n\t\t\tfinal int candidateDestinationCoordinate = this.piecePosition + (this.getPieceTeam().getDirection() * currentCandidateOffset);\n\t\t\t\n\t\t\t//Checks if the Destination Coordinate is valid\n\t\t\tif(!BoardUtils.isValidTileCoordinate(candidateDestinationCoordinate)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//Checks if this tile is occupied\n\t\t\tif(currentCandidateOffset == 8 && !board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnMove(board, this, candidateDestinationCoordinate)));\n\t\t\t\telse\n\t\t\t\t\tlegalMoves.add(new Move.PawnMove(board, this, candidateDestinationCoordinate));\t\n\t\t\t}\n\t\t\t//Checks if the Pawn is on it's first move\n\t\t\telse if(currentCandidateOffset == 16 && this.isFirstMove() && ((BoardUtils.SEVENTH_RANK[this.piecePosition] && \n\t\t\t\t\tthis.getPieceTeam().isBlack()) || (BoardUtils.SECOND_RANK[this.piecePosition] && this.getPieceTeam().isWhite()))) {\n\t\t\t\t\n\t\t\t\t//Calculate coordinate of the tile behind candidate coordinate\n\t\t\t\tfinal int behindCandidateDestinationCoordinate = this.piecePosition + (this.pieceTeam.getDirection() * 8);\n\t\t\t\t\n\t\t\t\t//Checks if the tile behind the candidate destination is NOT occupied & if the Tile at the Candidate Destination is NOT occupied\n\t\t\t\tif(!board.getTile(behindCandidateDestinationCoordinate).isTileOccupied() && \n\t\t\t !board.getTile(candidateDestinationCoordinate).isTileOccupied())\n\t\t\t\t\t\tlegalMoves.add(new Move.PawnJump(board, this, candidateDestinationCoordinate));\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t//Checks for edge cases in the 7 direction\t\n\t\t\t} else if(currentCandidateOffset == 7 &&\n\t\t\t\t\t!((BoardUtils.FILE_H[this.piecePosition] && this.getPieceTeam().isWhite() ||\n\t\t\t\t\t(BoardUtils.FILE_A[this.piecePosition] && this.getPieceTeam().isBlack())))){\n\t\t\t\t\n\t\t\t\tif(board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\t\tfinal Piece pieceOnCandidate = board.getTile(candidateDestinationCoordinate).getPiece();\n\t\t\t\t\t//If the pieces are not on the same team an Attack move is added to legal moves.\n\t\t\t\t\tif(this.getPieceTeam() != pieceOnCandidate.getPieceTeam())\n\t\t\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate)));\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t\n\t\t\t\t//This basically checks if En Passant Pawn is next to Player's pawn\t\n\t\t\t\t} else if(board.getEnPassantPawn() != null){\n\t\t\t\t\tif(board.getEnPassantPawn().getPiecePosition() == (this.piecePosition + (this.pieceTeam.getOppositeDirection()))){\n\t\t\t\t\t\tfinal Piece pieceOnCandidate = board.getEnPassantPawn();\n\t\t\t\t\t\tif(this.pieceTeam != pieceOnCandidate.getPieceTeam()){\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnEnPassantAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t//Checks for edge cases in the 9 direction\t\n\t\t\t} else if(currentCandidateOffset == 9 && \n\t\t\t\t\t!((BoardUtils.FILE_A[this.piecePosition] && this.getPieceTeam().isWhite() ||\n\t\t\t\t\t(BoardUtils.FILE_H[this.piecePosition] && this.getPieceTeam().isBlack())))){\n\t\t\t\t\n\t\t\t\tif(board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\t\tfinal Piece pieceOnCandidate = board.getTile(candidateDestinationCoordinate).getPiece();\n\t\t\t\t\t//If the pieces are not on the same team an Attack move is added to legal moves.\n\t\t\t\t\tif(this.getPieceTeam() != pieceOnCandidate.getPieceTeam())\n\t\t\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate)));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t} else if(board.getEnPassantPawn() != null){\n\t\t\t\t\tif(board.getEnPassantPawn().getPiecePosition() == (this.piecePosition - (this.pieceTeam.getOppositeDirection()))){\n\t\t\t\t\t\tfinal Piece pieceOnCandidate = board.getEnPassantPawn();\n\t\t\t\t\t\tif(this.pieceTeam != pieceOnCandidate.getPieceTeam()){\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnEnPassantAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\treturn ImmutableList.copyOf(legalMoves);\n\t}", "public int[] findMove(){\n int[] blackCheckerSpots = new int[12];\n int i =0;\n while(mCheckerBoard.indexOf(new Checker(1, false)) != -1){\n int startPosition = mCheckerBoard.indexOf(new Checker(1, false)); //need to override Checker equals method\n Checker current = mCheckerBoard.get(startPosition);\n int[] answer = jumpRight(startPosition, false, current);\n if(answer.length > 1)\n {\n //jumped right downwards\n return answer;\n }\n answer = jumpLeft(startPosition, false, current);\n if(answer.length > 1){\n //jumped left downwards\n return answer;\n }\n answer = moveDiagonalRight(startPosition, false, current);\n if(answer.length > 1){\n //moved diagonal right downwards\n return;\n }\n answer = moveDiagonalLeft(startPosition, false, current);\n if(answer.length > 1){\n //moved diagonal left downwards\n return;\n }\n\n //end of loop\n //these are the ones that need to be set back to black at the end\n current.setIsRed(true);\n blackCheckerSpots[i]=startPosition;\n i++;\n }\n\n for(int j =0; j<blackCheckerSpots.length; j++){\n Checker changed = mCheckerBoard.get(blackCheckerSpots[j]);\n changed.setIsRed(false);\n mCheckerBoard.set(blackCheckerSpots[j], changed);\n }\n\n }", "public static boolean hasWinningMove(int[][] gamePlay){\n\t\tfor(int i=0;i<4;i++){\n\t\t\tfor(int j=0;j<4;j++){\n\t\t\t\tif(gamePlay[i][j]==1){\n\t\t\t\t\tfor(int k=1;k<9;k++){\n\t\t\t\t\t\tint[] root={i,j};\n\t\t\t\t\t\tint[] root1={i,j};\n\t\t\t\t\t\tint[] source=root;\n\t\t\t\t\t\tsource=calculatePosition(root,k);\n\t\t\t\t\t\t//System.out.println(\"Looking in direction \"+k+\" For root\"+i+\",\"+j);\n\t\t\t\t\t\tif(isValidLocation(source)){ \n\t\t\t\t\t\t\tif(gamePlay[source[0]][source[1]]==1){\n\t\t\t\t\t\t\t\tint[] newSource=calculatePosition(source,k);\n\t//System.out.println(\"Two contigous isValid:\"+isValidLocation(newSource)+\"newSource(\"+newSource[0]+\",\"+newSource[1]+\")\"+\" gamePlay:\"+(isValidLocation(newSource)?gamePlay[newSource[0]][newSource[1]]:-1));\n\t\t\t\t\t\t\t\tif(isValidLocation(newSource)){ \n\t\t\t\t\t\t\t\t\tif(gamePlay[newSource[0]][newSource[1]]==0){\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Looking in opposite direction\");\n\t\t\t\t\t\t\t\t\t//Lookup in opposite direction\n\t\t\t\t\t\t\t\t\tnewSource=calculatePosition(root1,9-k);\n\t\t\t\t\t\t\t\t\tif(isValidLocation(newSource) && gamePlay[newSource[0]][newSource[1]]==1){\n\t\t\t\t\t\t\t\t\t\t//System.out.println(\"Valid Location:\"+newSource[0]+\" \"+newSource[1]+\" gamePlay\"+gamePlay[newSource[0]][newSource[1]]);\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t}else if(gamePlay[source[0]][source[1]]==0){\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Looking for alternate\");\n\t\t\t\t\t\t\t\t\tsource=calculatePosition(source,k);\n\t\t\t\t\t\t\t\t\tif(isValidLocation(source) && gamePlay[source[0]][source[1]]==1){\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//System.out.println(\"Invalid direction or no move here isValid:\"+isValidLocation(source)+\"Source(\"+source[0]+\",\"+source[1]+\")\"+\" gamePlay:\"+(isValidLocation(source)?gamePlay[source[0]][source[1]]:-1));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public ArrayList<GameData> getGames() {\n\t\tCursor dbGames = getReadableDatabase().rawQuery(\n\t\t\t\t\"SELECT game_id, name, hosting from game\", null);\n\t\tdbGames.moveToFirst();\n\t\tArrayList<GameData> games = new ArrayList<GameData>();\n\t\twhile (!dbGames.isAfterLast()) {\n\t\t\tgames.add(new GameData(dbGames.getInt(0), dbGames.getString(1),\n\t\t\t\t\tdbGames.getInt(2)));\n\t\t\tdbGames.moveToNext();\n\t\t}\n\t\tdbGames.close();\n\t\treturn games;\n\t}", "public List<RubiksMove> getSolutionMoves() {\n return solutionMoves;\n }", "public List<RPSGame> getGamesByPlayer(String playerId) {\n\t\tif (playerId == null) {\n\t\t\tthrow new RuntimeException(\"Player ID can't be null!\");\n\t\t}\n\t\treturn games.entrySet().stream().map(entry -> entry.getValue()).filter(game -> game.isPlayerGame(playerId))\n\t\t\t\t.collect(Collectors.toList());\n\n\t}", "public abstract List<Direction> searchForCheese(Maze maze);", "ArrayList<int[]> findValidMoves();", "public int[] getMove(){\n\t\tArrayList<Node> children = root.getChildren();\n\t\tint i;\n\t\tfor(i = 0; i < children.size(); i++){\n\t\t\tif(children.get(i).getScore() == root.getScore()){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tArrayList<int[]> legalMoves = activeBoard.getLegalMoves();\n\t\treturn legalMoves.get(i);\n\t}", "public ArrayList<Cell> getPseudoLegalMoves() {\n\n Cell[][] board = Board.getBoard();\n ArrayList<Cell> moves = new ArrayList<Cell>();\n\n //Possible ways to move a knight\n int[][] possibleOffsets = {{-2,-1},{-2,1},{-1,-2},{-1,2},{1,-2},{1,2},{2,1},{2,-1}};\n\n for(int i=0; i<possibleOffsets.length; i++){\n int x = possibleOffsets[i][0] + getRow();\n int y = possibleOffsets[i][1] + getColumn();\n\n //Making sure we dont leave the board\n if(x >= board.length || x < 0\n || y >= board.length || y < 0)\n continue;\n\n //Making sure destination does not contain a friendly piece\n if(Board.containsPieceOfColor(x,y,this.getColor()))\n continue;\n\n moves.add(board[x][y]);\n }\n\n return moves;\n }", "private static PlayerDto[] getPlayersDto(Game game) {\n return Arrays.stream(game.getPlayers()).map(GameMapper::getPlayerDto).toArray(PlayerDto[]::new);\n }", "public void getPossibleMoves() {\n\t\tGameWindow.potentialMoves.clear();\n\t}", "public String[] search() {\n\t\t\n\t\troot.setScore(0);\n\t\tleaves = 0;\n\t\t\n\t\t/*\n\t\t * Interrupt the think() thread so we can have the updated game tree\n\t\t */\n\t\t\n\t\tString[] move = new String[2];\n\t\t\n\t\t// Find the max or min value for the white or black player respectively\n\t\tfloat val = alphaBeta(root, max_depth, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, player);\n\t\t\n\t\t// Retrieve the move that has the min/max vlaue\n\t\tArrayList<Node> moves = root.getChildren();\n\t\tfor(Node n : moves) {\n\t\t\tif(Float.compare(n.value, val) == 0) {\n\t\t\t\tint[] m = new int[6];\n\t\t\t\tint encodedM = n.move;\n\t\t\t\t\n\t\t\t\t// Decode the move\n\t\t\t\tfor(int i = 0; i < 6; i++) {\n\t\t\t\t\tm[i] = encodedM & 0xf;\n\t\t\t\t\tencodedM >>= 4;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Convert the array into a string array with the format [0] => \"a7-b7\", [1] => \"b5\"\n\t\t\t\tmove[0] = ((char)(m[0] + 97)) + \"\" + (m[1]) + \"-\" + ((char)(m[2] + 97)) + \"\" + (m[3]);\n\t\t\t\tmove[1] = ((char)(m[4] + 97)) + \"\" + (m[5]);\n\t\t\t\t\n\t\t\t\t// Play the move on the AI's g_board, set the root to this node and break out of the loop\n\t\t\t\tg_board.doMove(n.move);\n\t\t\t\t\n\t\t\t\t// Reset the root rather than set it to a branch since we can currently only achieve a depth of 2-ply\n\t\t\t\troot.getChildren().clear();\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(leaves <= 2000) {\n\t\t\tmax_depth++;\n\t\t}\n\t\t\n\t\t/*\n\t\t * Start the think() thread\n\t\t */\n\t\t\n\t\treturn move;\n\t}", "public static int[][] getAllBasicMoves(int[][] board, int player) {\r\n\t\t\r\n\t\tint[][] moves = new int [0][4];\r\n\t\tint[][] SaveMoves = new int [0][4];/*save our moves of the soldures*/\r\n\t\tint[][] positions = playerDiscs(board,player);\r\n\t\tint SumAllMove=0;/*varibel ho count all the posible moves*/\r\n\t\t\r\n\t\tfor(int IPD=0;IPD<positions.length;IPD=IPD+1){/*running on all the solduers*/\r\n\t\t\t//tow loops running in the 4 moves of the soldures\r\n\t\t\tfor(int indxMove1=-1;indxMove1<2;indxMove1=indxMove1+2){\r\n\t\t\t\tfor(int indxMove2=-1;indxMove2<2;indxMove2=indxMove2+2){\r\n\t\t\t\t\tboolean MovePossible = isBasicMoveValid(board,player,positions[IPD][0],positions[IPD][1],positions[IPD][0]+indxMove1,positions[IPD][1]+indxMove2);/*is the move is legal*/\r\n\t\t\t\t\tif (MovePossible){/*if the move legal enter the move in the arry*/\r\n\t\t\t\t\t\tSumAllMove=SumAllMove+1;\r\n\t\t\t\t\t\tSaveMoves = moves;\r\n\t\t\t\t\t\tmoves = new int [SumAllMove][4];\r\n\t\t\t\t\t\tmoves [SumAllMove-1][0]=positions[IPD][0];\r\n\t\t\t\t\t\tmoves [SumAllMove-1][1]=positions[IPD][1];\r\n\t\t\t\t\t\tmoves [SumAllMove-1][2]=positions[IPD][0]+indxMove1;\r\n\t\t\t\t\t\tmoves [SumAllMove-1][3]=positions[IPD][1]+indxMove2;\r\n\t\t\t\t\t\tif (SumAllMove>1) {\r\n\t\t\t\t\t\t\tfor (int idxSAM1=SumAllMove-2;idxSAM1>-1;idxSAM1=idxSAM1-1){\r\n\t\t\t\t\t\t\tfor (int idxSAM2=0;idxSAM2<4;idxSAM2=idxSAM2+1){\r\n\t\t\t\t\t\t\t\tmoves[idxSAM1][idxSAM2]=SaveMoves[idxSAM1][idxSAM2];\r\n\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn moves;\r\n\t}", "public String[] search(boolean hybrid) {\n\t\t/*\n\t\t * Interrupt the think() thread so we can have the updated game tree\n\t\t */\n\t\t\n\t\t// MCTS and minimax response vars, respectively\n\t\tint[] response = null;\n\t\tString[] move = new String[2];\n\t\tint encodedM = 0;\n\t\tint[] m = new int[6];\n\t\t\n\t\tif(mcts) {\n\t\t\tmctsBoard = createBoard(g_board.getBoard());\n\t\t\tresponse = mcts();\n\t\t} else {\n\t\t\troot.setScore(0);\n\t\t\tleaves = 0;\n\t\t\t\n\t\t\t// Find the max or min value for the white or black player respectively\n\t\t\tfloat val = alphaBeta(root, max_depth, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, player);\n\t\t\t\n\t\t\t// Retrieve the move that has the min/max vlaue\n\t\t\tArrayList<Node> moves = root.getChildren();\n\t\t\tfor(Node n : moves) {\n\t\t\t\tif(Float.compare(n.value, val) == 0) {\n\t\t\t\t\tencodedM = n.move;\n\t\t\t\t\t\n\t\t\t\t\t// Play the move on the AI's g_board, set the root to this node and break out of the loop\n\t\t\t\t\tg_board.doMove(n.move);\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Switch to Monte Carlo after a set amount of moves\n\t\t\tturns += 2;\n\t\t\tif(turns > 40) {\n\t\t\t\tmcts = true;\n\t\t\t\tfirstMoves = new ArrayList<Node>();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Reset the root rather than set it to a branch since we can currently only achieve a depth of 2-ply\n\t\troot.getChildren().clear();\n\t\t\n\t\t// If we ran MCTS\n\t\tif(response != null) {\n\t\t\tencodedM = response[0];\n\t\t\tSystem.out.println(\"Simulations run: \" + response[3] + \"\\tConfidence: \" + response[1] + \"%\");\n\t\t}\n\t\t\n\t\t// Decode the move\n\t\tfor(int i = 0; i < 6; i++) {\n\t\t\tm[i] = encodedM & 0xf;\n\t\t\tencodedM >>= 4;\n\t\t}\n\t\t\n\t\t// Convert the array into a string array with the format [0] => \"a7-b7\", [1] => \"b5\"\n\t\tmove[0] = ((char)(m[0] + 97)) + \"\" + (m[1]) + \"-\" + ((char)(m[2] + 97)) + \"\" + (m[3]);\n\t\tmove[1] = ((char)(m[4] + 97)) + \"\" + (m[5]);\n\t\t\n\t\t/*\n\t\t * Start the think() thread\n\t\t */\n\t\t\n\t\treturn move;\n\t}", "public static LinkedList<Gioco> getGames() throws SQLException {\n\t\t\tString query = \"SELECT * FROM gioco;\";\n\t\t\tConnection con = connectToDB();\n\t\t\t// Creiamo un oggetto Statement per poter interrogare il db.\n\t\t\tStatement cmd = con.createStatement ();\n\t\t\t// Eseguiamo una query e immagazziniamone i risultati in un oggetto ResultSet.\n\t\t\t// String qry = \"SELECT * FROM utente\";\n\t\t\tResultSet res = cmd.executeQuery(query);\n\n\t\t\tLinkedList<Gioco> mList = new LinkedList<Gioco>();\n\t\t\t\n\t\t\t// Stampiamone i risultati riga per riga\n\t\t\twhile (res.next()) {\n\t\t\t\t// (id, nome, xp).\n\t\t\t\tGioco g = new Gioco(res.getInt(\"id\"), res.getString(\"nome\"), res.getInt(\"punti\"));\n\t\t\t\tmList.add(g);\n\t\t\t}\n\t\t\tcloseConnectionToDB(con);\n\t\t\treturn mList;\n\t\t}", "@Override\n\tpublic boolean execute(Game game) {\n\t\tgame.list();\n\t\treturn false;\n\t}", "public static void compute_possible_moves(Board s){\n\t\tint b [][] = s.board;\n\t\tint x = -1;\n\t\tint y = -1;\n\t\tfor (int i = 0;i < b.length;i++) {\n\t\t\tfor (int j = 0;j < b[i].length;j++) {\n\t\t\t\tif(b[i][j] == 0){\n\t\t\t\t\tx = i;\n\t\t\t\t\ty = j;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\n\t\tint left [][];\n\t\tint right [][];\n\t\tint up [][];\n\t\tint down [][];\n\t\tpossible_boards.clear();\n\t\tif(x - 1 != -1 && x >= 0 && x < 3){\n\t\t\t//up is a legal move\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\n\t\t\tint temp = temporary_board[x - 1][y];\n\t\t\ttemporary_board[x - 1][y] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tup = temporary_board;\n\n\t\t\tBoard up_board = new Board(up);\n\t\t\tpossible_boards.add(up_board);\n\n\t\t}\n\t\tif(x + 1 != 3 && x >= 0 && x < 3){\n\t\t\t//down is a legal move\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x + 1][y];\n\t\t\ttemporary_board[x + 1][y] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tdown = temporary_board;\n\t\t\tBoard down_board = new Board(down);\n\t\t\tpossible_boards.add(down_board);\n\t\t}\n\t\tif(y - 1 != -1 && y >= 0 && y < 3){\n\t\t\t//left move is legal\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x][y - 1];\n\t\t\ttemporary_board[x][y - 1] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tleft = temporary_board;\n\t\t\tBoard left_board = new Board(left);\n\t\t\tpossible_boards.add(left_board);\n\n\t\t}\n\t\tif(y + 1 != 3 && y >= 0 && y < 3){\n\t\t\t//right move is legal\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x][y + 1];\n\t\t\ttemporary_board[x][y + 1] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tright = temporary_board;\n\t\t\tBoard right_board = new Board(right);\n\t\t\tpossible_boards.add(right_board);\n\n\t\t}\n\n\t}", "public interface GameHome {\r\n\r\n\tvoid storePlayer(Player player);\r\n\r\n\tPlayer findPlayer(String playerAlias);\r\n\r\n\tGame<? extends PlayingSpace> findGame(String gameId);\r\n\r\n\tvoid store(Game<? extends PlayingSpace> game);\r\n\r\n\tIterable<Player> findPlayers(Predicate<Player> playerFilter);\r\n\r\n\tvoid deleteGame(String gameId);\r\n\r\n\tIterable<Game<?>> findGames(Predicate<Game<?>> gameFilter);\r\n}", "public List<Integer> GetMoves() {\n return GetMoves(true, true, true, Settings.MaxVolcanoLevel);\n }", "public List<Move> getAvailableSpaces() {\n List<Move> availableMoves = new ArrayList<>();\n for (int i = 0; i < LENGTH; i++) {\n for (int j = 0; j < LENGTH; j++) {\n Move move = new Move(i, j);\n if (isValidMove(move)) {\n availableMoves.add(move);\n }\n }\n }\n return availableMoves;\n }", "@Override\n public Map<Direction, List<Coordinate>> getPossibleMoves() {\n\n Map<Direction, List<Coordinate>> moves = new HashMap<>();\n\n Coordinate coordinate = this.getCoordinate();\n int row = coordinate.getRow();\n int col = coordinate.getCol();\n\n //Jumps\n List<Coordinate> jumps = new ArrayList<>();\n\n //\n //\n ////\n int tempRow1 = row - 2;\n int tempCol1 = col - 1;\n Coordinate tempCoordinate1 = new Coordinate(tempRow1, tempCol1);\n if (Board.inBounds(tempCoordinate1)) {\n jumps.add(tempCoordinate1);\n }\n\n ////\n //\n //\n int tempRow2 = row + 2;\n int tempCol2 = col - 1;\n Coordinate tempCoordinate2 = new Coordinate(tempRow2, tempCol2);\n if (Board.inBounds(tempCoordinate2)) {\n jumps.add(tempCoordinate2);\n }\n\n //////\n //\n int tempRow3 = row - 1;\n int tempCol3 = col - 2;\n Coordinate tempCoordinate3 = new Coordinate(tempRow3, tempCol3);\n if (Board.inBounds(tempCoordinate3)) {\n jumps.add(tempCoordinate3);\n }\n\n ///////\n //\n int tempRow4 = row - 1;\n int tempCol4 = col + 2;\n Coordinate tempCoordinate4 = new Coordinate(tempRow4, tempCol4);\n if (Board.inBounds(tempCoordinate4)) {\n jumps.add(tempCoordinate4);\n }\n\n ////\n //\n //\n int tempRow5 = row + 2;\n int tempCol5 = col + 1;\n Coordinate tempCoordinate5 = new Coordinate(tempRow5, tempCol5);\n if (Board.inBounds(tempCoordinate5)) {\n jumps.add(tempCoordinate5);\n }\n\n //\n //\n ////\n int tempRow6 = row - 2;\n int tempCol6 = col + 1;\n Coordinate tempCoordinate6 = new Coordinate(tempRow6, tempCol6);\n if (Board.inBounds(tempCoordinate6)) {\n jumps.add(tempCoordinate6);\n }\n\n //\n //////\n int tempRow7 = row + 1;\n int tempCol7 = col - 2;\n Coordinate tempCoordinate7 = new Coordinate(tempRow7, tempCol7);\n if (Board.inBounds(tempCoordinate7)) {\n jumps.add(tempCoordinate7);\n }\n\n //\n //////\n int tempRow8 = row + 1;\n int tempCol8 = col + 2;\n Coordinate tempCoordinate8 = new Coordinate(tempRow8, tempCol8);\n if (Board.inBounds(tempCoordinate8)) {\n jumps.add(tempCoordinate8);\n }\n\n if (!jumps.isEmpty()) {\n moves.put(Direction.Jump, jumps);\n }\n return moves;\n }", "public Collection<Key> getAllPossibleMoves(Key currentKey,\n\t\t\tint numberGeneratedSoFarLength) {\n\n\t\tif (KeyPad.isFirstTwoRows(currentKey)) {\n\t\t\tif (isFirstMove(numberGeneratedSoFarLength)) {\n\t\t\t\taddTwoStepForwardToPositionCache(currentKey);\n\t\t\t} else if (isSecondMove(numberGeneratedSoFarLength)) {\n\t\t\t\tremoveTwoStepForwardFromPositionCache(currentKey);\n\t\t\t}\n\t\t}\n\n\t\treturn positionCache.get(currentKey);\n\t}", "public ArrayList<ArrayList<Tile>> getAllMovePaths(Board board) {\n ArrayList<ArrayList<Tile>> result = new ArrayList<>();\n for (int row = 0; row < board.getRows(); row++) {\n for (int col = 0; col < board.getColumns(); col++) {\n if(isValidMove(row,col)){\n result.add(getMovePath(board, row, col));\n }\n }\n }\n return result;\n }" ]
[ "0.7047403", "0.6281085", "0.6259387", "0.62573594", "0.62474185", "0.6066109", "0.6059667", "0.6058115", "0.603526", "0.5933197", "0.5904347", "0.58997536", "0.58148324", "0.5804944", "0.58035445", "0.57931197", "0.5788303", "0.5773921", "0.57200444", "0.56912124", "0.56907344", "0.5675937", "0.5649931", "0.55770946", "0.5566301", "0.5550818", "0.55361676", "0.5519087", "0.5502873", "0.5500029", "0.54846287", "0.547962", "0.5478831", "0.5471678", "0.5464243", "0.5455852", "0.5450352", "0.5445907", "0.5438108", "0.54364705", "0.5431656", "0.54262465", "0.5425947", "0.5420381", "0.5390536", "0.5385181", "0.5384257", "0.53767055", "0.5370229", "0.53666335", "0.5365467", "0.5364538", "0.534873", "0.53437126", "0.53366786", "0.5335276", "0.52985626", "0.5288387", "0.52876794", "0.52825314", "0.527525", "0.5267751", "0.52655923", "0.52571154", "0.5252757", "0.52325076", "0.5229617", "0.5228884", "0.52048784", "0.52042544", "0.5197019", "0.5194772", "0.5189211", "0.5141558", "0.51384765", "0.51373214", "0.51304233", "0.51223516", "0.5117823", "0.5108669", "0.5098693", "0.50871706", "0.50809383", "0.5079697", "0.5078899", "0.5078441", "0.507159", "0.5062331", "0.5058197", "0.5057968", "0.5057292", "0.50568026", "0.5055611", "0.50531393", "0.5050741", "0.50487715", "0.5048651", "0.5048245", "0.50449836", "0.5042861" ]
0.77362615
0
Find all player move in game from Game repository.
List<Move> findByGameAndPlayer(Game game, Player player);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Move> findByGame(Game game);", "List<Move> getLegalMoves(Player player);", "public List<Player> findAllPlayers(){\n\t\treturn playerRepository.findAll();\n\t}", "List<Player> findAllPlayers();", "@Transactional(readOnly = true)\n public List<Game> findAll() {\n log.debug(\"Request to get all Games\");\n return gameRepository.findAll();\n }", "public List<PlayerGame> findAllByGame(Long gameId) {\n return playerGames.stream()\n .filter(p -> p.getGame().getId().equals(gameId))\n .collect(Collectors.toList());\n }", "public List<Player> getAll() {\n PlayerDB pdb = new PlayerDB();\n return pdb.getAll();\n }", "@Override\r\n\tpublic ArrayList<PlayerPO> getAllPlayers() {\n\t\treturn playerController.getAllPlayers();\r\n\t}", "@Override\n\tpublic List<Game> listGames(Player player) {\n\t\treturn iGameRepository.findAllByPlayer(player);\n\t}", "public List<ScoredMove> allmShipMoves(GameState gm){\n\t\t\n\t\tList<ScoredMove> mShipMoves = new ArrayList<ScoredMove>();\n\t\t\n\t\tif (getHand().hasMShip()) {\n\t\t\tfor (Card c: getHand().getCards()) {\n\t\t\t\tif (c instanceof MerchantShip) {\n\t\t\t\t\tmShipMoves.add(new ScoredMove(ACTION.PLAY_MERCHANT_SHIP, c, null));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn mShipMoves;\n\t}", "private static PlayerDto[] getPlayersDto(Game game) {\n return Arrays.stream(game.getPlayers()).map(GameMapper::getPlayerDto).toArray(PlayerDto[]::new);\n }", "static List<Player> getAllPlayers() {\n\t\treturn null;\r\n\t}", "public Collection<Game> getAllActiveGames() {\n return gameRepository.findAllActive();\n }", "public VwStatsPerGame[] findAll() throws VwStatsPerGameDaoException\n\t{\n\t\treturn findByDynamicSelect( SQL_SELECT, null );\n\t}", "@Override\n @Transactional(readOnly = true)\n public Page<PositionMoveDTO> findAll(Pageable pageable) {\n log.debug(\"Request to get all PositionMoves\");\n Page<PositionMove> result = positionMoveRepository.findAll(pageable);\n return result.map(positionMove -> positionMoveMapper.positionMoveToPositionMoveDTO(positionMove));\n }", "public List<ScoredMove> allValidMoves(GameState gm){\n\t\tList<ScoredMove> validMoves = new ArrayList<ScoredMove>();\n\t\t\n\t\t// check for draw move\n\t\tif (getDeckSize() > 0) {\n\t\t\tvalidMoves.add(new ScoredMove(ACTION.DRAW, null, null));\n\t\t}\n\t\t/*\n\t\telse {\n\t\t\t// check for discarding move (note: only allowing if decksize is empty)\n\t\t\tfor (Card c: getHand().getCards()){\n\t\t\t\tif (!(c instanceof MerchantShip)) {\n\t\t\t\t\tvalidMoves.add(new ScoredMove(ACTION.DISCARD, c, null));\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\t\t\n\t\tvalidMoves.addAll(allDiscardMoves(gm));\n\t\t\n\t\t// check for playing merchant ships\n\t\tvalidMoves.addAll(allmShipMoves(gm));\n\t\t\n\t\t// add all attacks\n\t\tvalidMoves.addAll(allAttackMoves(gm));\n\t\t\n\t\tif (super.getVerbosity()) {\n\t\t\tSystem.out.println(\"Valid moves found: \" + validMoves.size());\n\t\t}\n\t\treturn validMoves;\n\t}", "abstract public List<Move> getPossibleMoves();", "public List<Player> getAllOrdered() {\n PlayerDB pdb = new PlayerDB();\n return pdb.getAllOrdered();\n }", "public List<Player> getAvailablePlayers(Round round) {\r\n\t\tList<Player> availablePlayers = playerLogic.createNew(round.getPlayers());\r\n\r\n\t\tfor (Match match : round.getMatches()) {\r\n\t\t\tavailablePlayers.removeAll(match.getHomeTeam());\r\n\t\t\tavailablePlayers.removeAll(match.getAwayTeam());\r\n\t\t}\r\n\t\treturn availablePlayers;\r\n\t}", "public ArrayList<PentagoGame> nextPossibleMoves() {\n ArrayList<PentagoGame> children = new ArrayList<>();\n for(int i = 0; i < 6; i++) { // for each row I can place a piece\n for(int j = 0; j < 6; j++) { // for each column\n for(int k = 0; k < 4; k++ ) { // for each board to rotate\n for(int d = 0; d < 2; d ++) {// for each direction to rotate\n boolean leftRotate = false;\n if(d == 0) {\n leftRotate = true;\n }\n Move move = new Move(i, j, k, leftRotate);\n if(validMove(whosTurn(), move)) {\n PentagoGame tempGame = new PentagoGame(this);\n tempGame.playPiece(whosTurn(), move);\n tempGame.rotateBoard(whosTurn(), move);\n tempGame.turnOver();\n move.setGameState(tempGame);\n move.setUtility(calulateUtility(move));\n // todo\n children.add(tempGame);\n }\n }\n }\n }\n }\n\n return children;\n }", "@Transactional(readOnly = true)\n public Page<Game> findAll(Pageable pageable) {\n return gameRepository.findAll(pageable);\n }", "List<GameResult> getAllGameResults();", "public Set<GameDTO> getGamesWhichCanBeMovedToHistory() {\n return appealService.findAllByAppealStage(AppealStage.CONSIDERED)\n .stream()\n .map(Appeal::getGame)\n .map(gameDTOService::toGameDTO)\n .collect(Collectors.toSet());\n }", "public List<Player> getAllPlayers() {\r\n // TODO fix actual order of players in the List.\r\n\r\n List<Player> players = new ArrayList<>();\r\n players.addAll(teamRed.getPlayers());\r\n players.addAll(teamBlue.getPlayers());\r\n\r\n return players;\r\n }", "public List<ScoredMove> allAttackMoves(GameState gm) {\n\t\tList<ScoredMove> attackMoves = new ArrayList<ScoredMove>();\n\t\t\n\t\t// check for attacking battles\n\t\tif (gm.getBattleList().size() > 0) {\n\t\t\tfor (Battle b: gm.getBattleList()) {\n\t\t\t\tif (!b.isBattleUsingTrumps()) {\n\t\t\t\t\tfor (Card c: getHand().getCards()){\n\t\t\t\t\t\tif (c instanceof PirateShip) {\n\t\t\t\t\t\t\tif (canPirateShipCardAttack(b, (PirateShip)c)){\n\t\t\t\t\t\t\t\tattackMoves.add(new ScoredMove(ACTION.PLAY_ATTACK, c, b));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (Card c: getHand().getCards()) {\n\t\t\t\t\tif (c instanceof Trump) {\n\t\t\t\t\t\tif (canTrumpCardAttack(b, (Trump)c)) {\n\t\t\t\t\t\t\tattackMoves.add(new ScoredMove(ACTION.PLAY_ATTACK, c, b));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn attackMoves;\n\t}", "public List<PlayerInfo> getPlayerList(GameInfo gi){\n\t\tClientModelFacade facade = ClientModelFacade.getInstance(null);\n\t\t\n\t\tGameInfo[] gameList = facade.getGamesList();\n\n\t\tfor(int i = 0; i < gameList.length; i++){\n\t\t\tif(gameList[i].getId() == gi.getId()){\n\t\t\t\treturn gameList[i].getPlayers();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public List<Game> getFullGameList() {\n List<Game> listOfGames = null;\n Session session = sessionFactory.openSession();\n // Try to return the user by the given nickname\n try {\n session.beginTransaction();\n // if mode equals ALL then get full list of games\n listOfGames = session.createCriteria(Game.class).list();\n \n session.getTransaction().commit();\n session.flush();\n } \n catch (HibernateException e) { return null; } \n finally { session.close(); }\n // Return userID if seted\n return listOfGames;\n }", "public Set<Move> getMovesForPlayer(Player player) {\n\t\tfinal Set<Move> moveList = new HashSet<Move>();\n\t\tfor (Map.Entry<Position, Piece> entry : positionToPieceMap.entrySet()) {\n\t\t\tfinal Position positionFrom = entry.getKey();\n\t\t\tfinal Piece piece = entry.getValue();\n\t\t\tif (player == piece.getOwner()) {\n\t\t\t\tfor (char column = Position.MIN_COLUMN; column <= Position.MAX_COLUMN; column++) {\n\t\t\t\t\tfor (int row = Position.MIN_ROW; row <= Position.MAX_ROW; row++) {\n\t\t\t\t\t\tfinal Position positionTo = new Position(column, row);\n\t\t\t\t\t\tif (!positionFrom.equals(positionTo)) {\n\t\t\t\t\t\t\tfinal Piece possiblePieceOnPosition = getPieceAt(positionTo);\n\t\t\t\t\t\t\tif (possiblePieceOnPosition == null || possiblePieceOnPosition.getOwner() != player) { //can move to free position \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //or position where enemy is placed\n\t\t\t\t\t\t\t\tif (piece instanceof Pawn) {\n\t\t\t\t\t\t\t\t\tPawn pawn = (Pawn) piece;\n\t\t\t\t\t\t\t\t\tpawn.isValidFightMove(positionFrom, positionTo);\n\t\t\t\t\t\t\t\t\tmoveList.add(new Move(positionFrom, positionTo));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfinal boolean isKnight = (piece instanceof Knight); // knight can jump over sheets\n\t\t\t\t\t\t\t\tif (piece.isValidMove(positionFrom, positionTo) && !isBlocked(positionFrom, positionTo, isKnight)) {\n\t\t\t\t\t\t\t\t\tmoveList.add(new Move(positionFrom, positionTo));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn moveList;\n\t}", "@Test\n void testAllLegalMoves() {\n \tplayer1 = new HumanPlayer(\"Arnold\");\n player2 = new HumanPlayer(\"Intelligent Twig\");\n gameState = new GameState(Arrays.asList(player1, player2));\n board = gameState.getBoard();\n \n Set<PlayableMove> moves = Move.allLegalMoves(gameState);\n\n assertTrue(moves.stream().allMatch(e -> e.isLegal()));\n assertEquals(44, moves.size());\n }", "List<Player> getPlayers();", "ArrayList<Player> getAllPlayer();", "private List<Coordinate> getAvailableMoves(ImmutableGameBoard gameBoard) {\n List<Coordinate> availableMoves = new ArrayList<Coordinate>();\n\n for (int x = 0; x < gameBoard.getWidth(); x++) {\n for (int y = 0; y < gameBoard.getHeight(); y++) {\n if(gameBoard.getSquare(x, y) == TicTacToeGame.EMPTY)\n availableMoves.add(new Coordinate(x, y));\n }\n }\n\n return availableMoves;\n }", "@Override\n\tpublic List<Games> allGamesView() {\n\t\treturn gameDAO.viewAllGame();\n\t}", "public TennisPlayer[] getAllPlayers() throws TennisDatabaseRuntimeException {\n\t\t \t\n\t\tTennisPlayerContainerIterator iterator = this.iterator();\n\t\t\n iterator.setInorder();\n \t\n TennisPlayer[] outputArray = new TennisPlayer[playerCount];\n \n int index = 0;\n \n while (iterator.hasNext()) {\n \t\n outputArray[index] = iterator.next();\n \n index++;\n \n }\n \n return outputArray;\n \n\t}", "public static void getMoves(Player p, GameSquare[][] board) {\n\t\t// keep track of the number of possible moves\n\t\t// and number of unique pieces you could move\n\t\tint moveCount = 0;\n\t\tint uniquePieceCount = 0;\n\n\t\tArrayList<GameSquare> playerSpotsWithPieces = p.places;\n\t\tArrayList<GameSquare> validMoves;\n\n\t\t// for each square with a piece on it\n\t\t// find out where you can move that piece\n\t\tfor (GameSquare currentSquare : playerSpotsWithPieces) {\n\t\t\tvalidMoves = new ArrayList<GameSquare>();\n\n\t\t\t// grab all valid moves from\n\t\t\tvalidMoves.addAll(currentSquare.getValidMoves(board));\n\t\t\tif (validMoves.size() > 0)\n\t\t\t\tuniquePieceCount++;\n\t\t\tfor (GameSquare move : validMoves) {\n\t\t\t\tSystem.out.printf(\"%s at <%d:%d> can move to <%d:%d>\\n\", currentSquare.pieceType(), currentSquare.x,\n\t\t\t\t\t\tcurrentSquare.y, move.x, move.y);\n\t\t\t\tmoveCount++;\n\t\t\t}\n\t\t}\n\n\t\t// print the number of possible moves and number of unique pieces that\n\t\t// can be moved\n\t\tSystem.out.printf(\"%d legal moves (%d unique pieces) for %s player\", moveCount, uniquePieceCount,\n\t\t\t\tp.color.toString().toLowerCase());\n\n\t}", "@Override\r\n\tpublic ArrayList<String> allPossibleMoves(boolean whoPlays) {\r\n\t\t\r\n\t\tArrayList<String> Moves = new ArrayList<String>();\r\n\t\t\r\n\t\tif(whoPlays) {\r\n\t\t\tif( (new Board2048model(this)).moveUP()) \r\n\t\t\tMoves.add(\"UP\");\r\n\t\t\tif( (new Board2048model(this)).moveDOWN()) \r\n\t\t\tMoves.add(\"DOWN\");\r\n\t\t\tif( (new Board2048model(this)).moveRIGHT()) \r\n\t\t\tMoves.add(\"RIGHT\");\r\n\t\t\tif( (new Board2048model(this)).moveLEFT()) \r\n\t\t\tMoves.add(\"LEFT\");\r\n\t\t\t}\r\n\t\telse { \r\n\t\t\tfor( int i = 0; i < rows_size ; i++) {\r\n\t\t\t\tfor(int j = 0; j < columns_size; j++) {\r\n\t\t\t\t\tif(isEmpty(i,j)) {\r\n\t\t\t\t\t\tMoves.add(new String(Integer.toString(i) + \",\" + Integer.toString(j) + \",\" + Integer.toString(2)));\r\n\t\t\t\t\t\tMoves.add(new String(Integer.toString(i) + \",\" + Integer.toString(j) + \",\" + Integer.toString(4)));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t}\r\n\treturn Moves;\r\n\t}", "public List<Position> getAllMoves(Board chessBoard) {\n return getAllDiscreteMoves(chessBoard);\n }", "@Override public GameList getAllGamesFromServer() throws RemoteException, SQLException {\r\n return gameListClientModel.getGamesFromServer();\r\n }", "@RequestMapping(value = \"/game\", method = RequestMethod.GET)\n @ResponseStatus(value = HttpStatus.OK)\n public List<Game> getAllGame() {\n return serviceLayer.getAllGame();\n }", "public List<RPSGame> getGamesByPlayer(String playerId) {\n\t\tif (playerId == null) {\n\t\t\tthrow new RuntimeException(\"Player ID can't be null!\");\n\t\t}\n\t\treturn games.entrySet().stream().map(entry -> entry.getValue()).filter(game -> game.isPlayerGame(playerId))\n\t\t\t\t.collect(Collectors.toList());\n\n\t}", "public List<String> getAllPlayers() throws ServerProblem {\r\n\ttry (Connection connTDB = ConnectionManager.getInstance().getConnection()) {\r\n\t LOGGER.debug(\"Getting all players\");\r\n\t List<String> results = engine.getAllPlayers(connTDB);\r\n\t LOGGER.debug(\"Players found in the database: \" + results);\r\n\t return results;\r\n\t} catch (Exception ex) {\r\n\t String error = \"Problem encountered getting all players: \" + ex;\r\n\t LOGGER.error(error);\r\n\t throw new ServerProblem(error, ex);\r\n\t}\r\n }", "public static Game[] getAllGames(){\n \tGame[] games = null;\n \ttry {\n\t\t\tgames = DBHandler.getAllGames(c);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n \treturn games;\n }", "public ArrayList<Player> getPlayersInGame() {\n return playersInGame;\n }", "Iterator<BoardPosition> possibleMovingPositions(BoardPosition from, Game game, Map<BoardPosition, Piece> pieceMap);", "@Override\n public ArrayList<xMCTSStringGameState> getPossibleMoves(xMCTSStringGameState gameState)\n {\n\t ArrayList<xMCTSStringGameState> posMoves = new ArrayList<xMCTSStringGameState>();\n\t if (gameStatus(gameState) == xMCTSGame.status.ONGOING) {\n\t \t String activeCard = gameState.toString().substring(gameState.toString().length() - 2, gameState.toString().length());\n\t \t int gridSize = SIZE*2;\n\t for (int i = 0; i < gridSize; i += 2) {\n\t for (int j = 0; j < gridSize; j += 2) {\n\t int pos = i * SIZE + j;\n\t if (gameState.toString().charAt(pos) == '_') {\n\t String temp = gameState.toString().substring(0, pos)\n\t \t\t + activeCard\n\t + gameState.toString().substring(pos + 2,\n\t gameState.toString().length());\n\t posMoves.add(new xMCTSStringGameState(temp, 0.0, 0));\n\t }\n\t }\n\n\t }\n\t }\n\t else {\n\t \t // System.out.println(\"No moves can be made from this state\");\n\t \t// callsFromFullBoards++;\n\t \t// System.out.println(\"There have been \" + callsFromFullBoards + \"attempts to get possible moves from a full board\");\n\t }\n\t return posMoves;\n }", "public List<Player> lookForShootPeople(Player player)\n {\n List<Player> playerList = new LinkedList<>();\n\n playerList.addAll(player.getSquare().getRoom().getPlayerRoomList()); //adds all the players in the room\n\n /*\n * Now i have to check if the player is close to a door. In this case i can see all the players in this adiacent room.\n * I will implement the method in this way:\n * 1. I check if the player can move to a different room with a distance 1 using the method squareReachableNoWall\n * 2. If the player can effectively move to a different room it means it is close to a door\n * 3. I will add to the list all the players in this different room\n */\n\n for (Square square : player.getSquare().getGameBoard().getArena().squareReachableNoWall(player.getSquare().getX(), player.getSquare().getY(), 1))\n {\n if (!(player.getSquare().getColor().equals(square.getColor()))) // if the color of the reachable square is different from the color of the square\n // where the player is this means player can see in a different room\n {\n playerList.addAll(player.getSquare().getRoom().getPlayerRoomList()); //adds all the players in the room\n }\n\n }\n\n Set<Player> playerSet = new HashSet<>();\n playerSet.addAll(playerList);\n\n playerList.clear();\n\n playerList.addAll(playerSet);\n playerList.remove(player);\n\n\n return playerList;\n }", "public SmallGameBoard[] getAllGames(){return games;}", "List<Moves> getMoveSet();", "List<Player> listPlayers();", "List<ValidMove> getValidMoves();", "public List<Game> getAllGames() {\n List<Game> games = new ArrayList<>(data.values());\n games.sort((o1, o2) -> {\n if (o1.getId() < o2.getId()) {\n return 1;\n } else if (o1.getId() > o2.getId()) {\n return -1;\n } else {\n return 0;\n }\n });\n return games;\n }", "public synchronized List<Game> getGameList() {\n return games;\n }", "Collection<User> players();", "@Test\r\n\tpublic void findAllGames() {\r\n\t\t// DO: JUnit - Populate test inputs for operation: findAllGames \r\n\t\tInteger startResult = 0;\r\n\t\tInteger maxRows = 0;\r\n\t\t@SuppressWarnings(\"unused\")\r\n\t\tList<Game> response = null;\r\n\t\tTswacct tswacct = null;\r\n\t\tresponse = service.findAllGames4tsw(tswacct, startResult, maxRows);\r\n\t\t// DO: JUnit - Add assertions to test outputs of operation: findAllGames\r\n\t}", "public List<IMove> getMoves() {\n List<ICard> hand = hands.get(currentTurn);\n\n List<IMove> moves = new ArrayList<>(hand.size() + 1);\n for (ICard card : hand) {\n if (isValidPlay(card)) {\n moves.addAll(card.getMoves(this));\n }\n }\n\n moves.add(new DrawCardMove(currentTurn));\n\n return moves;\n }", "ArrayList<Move> getMoves() {\n ArrayList<Move> result = new ArrayList<>();\n getMoves(result);\n return result;\n }", "public List<Player> getPlayers() {\r\n\t\tList<Player> playerList = new ArrayList<Player>();\r\n\r\n\t\tfor (Player p : players.values()) {\r\n\t\t\tif (p != null)\r\n\t\t\t\tplayerList.add(p);\r\n\t\t}\r\n\r\n\t\treturn playerList;\r\n\t}", "public List <FootballPlayer> getAllPlayers() {\n\t\treturn market.getAllPlayers();\n\t}", "public List<Move> getValidMoves(Player player) {\n LinkedList<Move> listOfMoves = new LinkedList<>();\n Pawn aPawn;\n int Size;\n Size = getSize();\n\n //parcours du plateau pour trouver tous les pions de player\n for (int numLine = 0; numLine < Size; numLine++) {\n for (int numCol = 0; numCol < Size; numCol++) {\n\n aPawn = field[numLine][numCol];\n if (aPawn != null) {\n if (aPawn.getPlayer().getColor() == player.getColor()) { //if the pawn belong to player\n addValidMovesAux(numCol, numLine, listOfMoves, player);\n }\n }\n }\n }\n return listOfMoves;\n }", "public ArrayList<Entity> getPlayers() {\n ArrayList<Entity> players = new ArrayList<>();\n students.forEach(student -> players.add(student.getPlayer()));\n return players;\n }", "public List<Player> getPlayersInRoom() {\n\t\treturn playersInRoom;\n\t}", "@Override\n\tpublic Move getMove(Board game) {\n\t\t\n\t\tthis.maximumDepthReachedThisTurn = 0;\n\t\tArrayList<Move> moveList = game.getLegalMoves();\n\t\t/* tell the player what her options are */\n\t\tSystem.out.println(\"Turn \" + game.getTurn() + \", legal moves (\" + moveList.size() + \"): \");\n\t\tfor(Move m : moveList) {\n\t\t\tSystem.out.println(m.toString());\n\t\t}\n\t\t\n\t\tthis.nodesExploredThisTurn = 0;\n\t\tthis.isEndGameStatusFound = false;\n\t\tthis.maxDepth = 1;\n\t\tthis.bestMoveSoFar = null;\n\t\tthis.startMili = System.currentTimeMillis();\n\t\n\t\twhile (System.currentTimeMillis() - startMili < this.maxTime * 1000) {\n\t\t\tNode state = new Node(game, null, 0);\n\t\t\tthis.bestMoveSoFar = this.alphaBetaSearch(state);\n\t\t\t\n\t\t\tif (this.isEndGameStatusFound)\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tthis.maxDepth++;\n\t\t}\n\n\t\tlong endMili=System.currentTimeMillis();\n\t\tdouble duration = ((double)(endMili - startMili)) / 1000.0;\n\t\t\n\t\tthis.maximumDepthReached += this.maximumDepthReachedThisTurn;\n\t\tSystem.out.println(\"Maximum depth reached at this turn: \" + this.maximumDepthReachedThisTurn);\n\t\tSystem.out.println(\"Maximum depth reached from game start state: \" + this.maximumDepthReached);\n\t\tSystem.out.println(\"Nodes explored at this turn: \" + this.nodesExploredThisTurn);\n\t\tSystem.out.println(\"Total nodes explored: \" + this.nodesExplored);\n\t\tSystem.out.println(\"Time to decide on a move: \" + duration);\n\n\t\treturn this.bestMoveSoFar;\n\t\t\n\t}", "List<GameResult> getAllResults();", "public List<PlayerInstance> getAllPlayers()\n\t{\n\t\tfinal List<PlayerInstance> players = new ArrayList<>();\n\t\tfor (Creature temp : getCharactersInside())\n\t\t{\n\t\t\tif (temp instanceof PlayerInstance)\n\t\t\t{\n\t\t\t\tplayers.add((PlayerInstance) temp);\n\t\t\t}\n\t\t}\n\t\treturn players;\n\t}", "public static ArrayList<Player> getAllPlayingPlayers() {\n // Anton fix: Would copy the list itself, we want just the items.\n // Remove/add manipulations would affect original list\n /*\n * ArrayList<Player> all = players; for (Player player: all) { if\n * (!player.isPlaying()) { all.remove(player); } }\n */\n\n ArrayList<Player> all = new ArrayList<Player>();\n for (Player player : players) {\n if (player.isPlaying()) all.add(player);\n }\n\n return all;\n }", "public List<PlayerItem> getAll();", "protected List<Move> getMoves() {\n return moves;\n }", "public List<Game> getGameList() {\n return this.games;\n }", "public List<Integer> GetMoves() {\n return GetMoves(true, true, true, Settings.MaxVolcanoLevel);\n }", "public List<Grid> getPossibleMoves(Grid g){\n\t\tint i=g.row, j=g.col;\n\t\tif(i>=0 && i<data.length && j>=0 && j<data[i].length){\n\t\t\tList<Grid> list=new ArrayList<>();\n\t\t\tif(isFree(i, j-1)) list.add(new Grid(i,j-1));\n\t\t\tif(isFree(i-1, j-1)) list.add(new Grid(i-1,j-1));\n\t\t\tif(isFree(i-1, j)) list.add(new Grid(i-1,j));\n\t\t\tif(isFree(i-1, j+1)) list.add(new Grid(i-1,j+1));\n\t\t\tif(isFree(i, j+1)) list.add(new Grid(i,j+1));\n\t\t\tif(isFree(i+1, j+1)) list.add(new Grid(i+1,j+1));\n\t\t\tif(isFree(i+1, j)) list.add(new Grid(i+1,j));\n\t\t\tif(isFree(i+1, j-1)) list.add(new Grid(i+1,j-1));\n\t\t\treturn list;\n\t\t}\n\t\treturn null;\n\t}", "public List<Player> getSortedListOfPlayersDesc(Long idGame) {\n Game game = this.getGameById(idGame);\n\n if(game == null) {\n return null;\n }\n\n List<Player> players= new ArrayList<>(game.getPlayers());\n game.getPlayers().sort((o1, o2) -> {\n if(o1.getHandValue() < o2.getHandValue())\n return 1;\n if(o1.getHandValue() > o2.getHandValue())\n return -1;\n return 0 ;\n });\n\n return players;\n }", "public List<PlayerWon> findByLeagueId(int leagueId);", "public List<Player> loadAll() throws SQLException {\n\t\tfinal Connection connection = _database.getConnection();\n\t\tfinal String sql = \"SELECT * FROM \" + table_name + \" ORDER BY id ASC \";\n\t\tfinal List<Player> searchResults = listQuery(connection.prepareStatement(sql));\n\n\t\treturn searchResults;\n\t}", "public List<Game> getGamesForTable() throws ServiceException {\r\n\r\n List<Game> allNotPlayedGames = null;\r\n try {\r\n allNotPlayedGames = gameDao.findAllNotPlayedGames();\r\n } catch (DaoException e) {\r\n logger.error(e);\r\n throw new ServiceException(e);\r\n }\r\n List<Game> gamesForTable = new ArrayList<>();\r\n\r\n for(Game game : allNotPlayedGames){\r\n\r\n buildGame(game);\r\n\r\n boolean validHorseBets = isHorseBetsValidForTable(game);\r\n\r\n if (validHorseBets) {\r\n gamesForTable.add(game);\r\n }\r\n }\r\n\r\n return gamesForTable;\r\n }", "public Set<GamePiece> getPlayerPieces() \n\t{\n\t\tSet<GamePiece> pieces = new HashSet<GamePiece>();\n\t\tfor(GamePiece piece: playerPieces.values())\n\t\t{\n\t\t\tpieces.add(piece);\n\t\t}\n\t\treturn pieces;\n\t}", "public int numTurnsUntilMove(GameState gm, Player p) {\n\t\tint count = 0;\n\t\t\n\t\tcount = gm.getPlayers().indexOf(p)-gm.getPlayers().indexOf(this);\n\t\tif (count < 0) {\n\t\t\treturn count + gm.getPlayers().size();\n\t\t}\n\t\telse {\n\t\t\treturn count;\n\t\t}\n\t}", "public List<RubiksMove> getSolutionMoves() {\n return solutionMoves;\n }", "private Set<SteamUserNode> bindGames(Set<SteamUserNode> players) {\n\t\tString dest = \"http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?\" +\r\n\t\t\t\t\"key=%s&steamid=%d&include_appinfo=1&include_played_free_games=1&format=json\";\r\n\t\tString response = \"\";\r\n\t\tfor (SteamUserNode p : players) {\r\n\t\t\ttry {\r\n\t\t\t\tthis.apiCalls += 1;\r\n\t\t\t\tString query = String.format(dest, key, p.getId());\r\n\t\t\t\tURL url = new URL(query);\r\n\t\t\t\tHttpURLConnection con = (HttpURLConnection) url.openConnection();\r\n\t\t\t\tcon.setRequestMethod(\"GET\");\r\n\t\t\t\tcon.setConnectTimeout(3000);\r\n\t\t\t\tcon.connect();\r\n\t\t\t\tint respCode = con.getResponseCode();\r\n\t\t\t\tif (respCode != 200)\r\n\t\t\t\t\tSystem.out.println(\"Status code: \" + respCode + \"\\nFor request: \" + query);\r\n\t\t\t\telse {\r\n\t\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(con.getInputStream()));\r\n\t\t\t\t\tresponse = reader.lines().collect(Collectors.joining());\r\n\t\t\t\t\tint numGames = new JSONObject(response).getJSONObject(\"response\").getInt(\"game_count\");\r\n\t\t\t\t\tif (numGames > 0) {\r\n\t\t\t\t\t\tJSONArray ownedGames = new JSONObject(response).getJSONObject(\"response\").getJSONArray(\"games\");\r\n\t\t\t\t\t\tfor (int i=0;i<ownedGames.length();++i) {\r\n\t\t\t\t\t\t\tJSONObject g = ownedGames.getJSONObject(i);\r\n\t\t\t\t\t\t\tlong appId = g.getLong(\"appid\");\r\n\t\t\t\t\t\t\tString name = g.getString(\"name\");\r\n\t\t\t\t\t\t\tString logoHash = g.getString(\"img_logo_url\");\r\n\t\t\t\t\t\t\tint playForever = g.getInt(\"playtime_forever\");\r\n\t\t\t\t\t\t\tint play2Wks = g.has(\"playtime_2weeks\") ? g.getInt(\"playtime_2weeks\") : 0;\r\n\t\t\t\t\t\t\tPlayedGame game = new PlayedGame(appId, name, logoHash, play2Wks, playForever);\r\n\t\t\t\t\t\t\tp.addPlayedGame(game);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (!knownGames.contains(game)) {\r\n\t\t\t\t\t\t\t\tknownGames.add((SteamGame) game);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (localWrite) {\r\n\t\t\t\t\t\t\tjsonWriter.writeOwnedGames(response, p);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (JSONException jse) {\r\n\t\t\t\tSystem.err.println(jse.getMessage());\r\n\t\t\t\tSystem.out.println(response);\r\n\t\t\t} catch (MalformedURLException mue) {\r\n\t\t\t\t//once again, this better not happen...\r\n\t\t\t\tSystem.err.println(mue.getMessage());\r\n\t\t\t} catch (IOException ioe) {\r\n\t\t\t\tSystem.err.println(ioe.getMessage());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn players;\r\n\t}", "public static ArrayList<EntityPlayer> getAll() {\r\n\t\ttry {\r\n\t\t\tArrayList<EntityPlayer> players = new ArrayList<EntityPlayer>();\r\n\t\t\t\r\n\t\t\tfor (EntityPlayer player : mc.world.playerEntities) {\r\n\t\t\t\tif (!player.isEntityEqual(mc.player)) {\r\n\t\t\t\t\tplayers.add(player);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn players;\r\n\t\t} catch (NullPointerException ignored) {\r\n\t\t\treturn new ArrayList<EntityPlayer>();\r\n\t\t}\r\n\t}", "public abstract HashSet<Location> getPossibleMovements(GameBoard board);", "public ArrayList<Location> getMoveLocations()\n {\n ArrayList<Location> locs = new ArrayList<Location>();\n ArrayList<Location> validLocations = getGrid().getValidAdjacentLocations(getLocation());\n for (Location neighborLoc : validLocations)\n {\n if (getGrid().get(neighborLoc) == null || getGrid().get(neighborLoc) instanceof AbstractPokemon || getGrid().get(neighborLoc) instanceof PokemonTrainer)\n locs.add(neighborLoc);\n }\n return locs;\n }", "@RequestMapping(\"/players\")\n public List<Player> getAllPlayers() {\n return playerService.getPlayerList();\n }", "Collection<GameEnvironment> getPendingGames();", "@Override\n public Map<Coordinate, List<Coordinate>> getAllLegalMoves(List<Integer> playerStates) {\n Map<Coordinate, List<Coordinate>> allLegalMoves = new TreeMap<>();\n for (List<GamePiece> row: myGamePieces) {\n for(GamePiece currPiece: row){\n if (playerStates.contains(currPiece.getState()) || currPiece.getState() == myEmptyState) {\n Coordinate currCoord = currPiece.getPosition();\n List<Coordinate> moves = currPiece.calculateAllPossibleMoves(getNeighbors(currPiece), playerStates.get(0));\n if (moves.size() > 0) {\n allLegalMoves.put(currCoord, moves);\n }\n }\n }\n }\n return allLegalMoves;\n }", "public List<PlayerItem> getAllPlayerItemById(Player player);", "public PlayerGame findByGameAndPlayer(Long gameId, Long playerId) {\n return playerGames.stream()\n .filter(p -> p.getGame().getId().equals(gameId) && p.getPlayer().getId().equals(playerId))\n .findFirst()\n .orElse(null);\n }", "public interface Game {\n\n\t/**\n\t * return a specific tile. Precondition: Position p is a valid position in the world.\n\t * \n\t * @param p\n\t * the position in the world that must be returned.\n\t * @return the tile at position p.\n\t */\n\tpublic Tile getTileAt(Position p);\n\n\t/**\n\t * return the uppermost unit in the stack of units at position 'p' in the world. Precondition: Position p is a valid\n\t * position in the world.\n\t * \n\t * @param p\n\t * the position in the world.\n\t * @return the unit that is at the top of the unit stack at position p, OR null if no unit is present at position p.\n\t */\n\tpublic Unit getUnitAt(Position p);\n\n\t/**\n\t * return the city at position 'p' in the world. Precondition: Position p is a valid position in the world.\n\t * \n\t * @param p\n\t * the position in the world.\n\t * @return the city at this position or null if no city here.\n\t */\n\tpublic City getCityAt(Position p);\n\n\t/**\n\t * return the player that is 'in turn', that is, is able to move units and manage cities.\n\t * \n\t * @return the player that is in turn\n\t */\n\tpublic Player getPlayerInTurn();\n\n\t/**\n\t * return the player that has won the game.\n\t * \n\t * @return the player that has won. If the game is still not finished then return null.\n\t */\n\tpublic Player getWinner();\n\n\t/**\n\t * return the age of the world. Negative numbers represent a world age BC (-4000 equals 4000 BC) while positive\n\t * numbers are AD.\n\t * \n\t * @return world age.\n\t */\n\tpublic int getAge();\n\n\t/**\n\t * move a unit from one position to another. If that other position is occupied by an opponent unit, a battle is\n\t * conducted leading to either victory or defeat. If victorious then the opponent unit is removed from the game and\n\t * the move conducted. If defeated then the attacking unit is removed from the game. If a successful move results in\n\t * the unit entering the position of a city then this city becomes owned by the owner of the moving unit.\n\t * Precondition: both from and to are within the limits of the world. Precondition: there is a unit located at\n\t * position from.\n\t * \n\t * @param from\n\t * the position that the unit has now\n\t * @param to\n\t * the position the unit should move to\n\t * @return true if the move is valid (no mountain, move is valid under the rules of the game variant etc.), and\n\t * false otherwise. If false is returned, the unit stays in the same position and its \"move\" is intact (it\n\t * can be moved to another position.)\n\t */\n\tpublic boolean moveUnit(Position from, Position to);\n\n\t/**\n\t * Tell the game that the current player has finished his/her turn. The next player is then in turn. If all players\n\t * have had their turns then do end-of-round processing: A) restore all units' move counts B) produce food and\n\t * production in all cities C) produce units in all cities (if enough production) D) increase population size in all\n\t * cities (if enough food) E) increment the world age.\n\t */\n\tpublic void endOfTurn();\n\n\t/**\n\t * change the work force's focus in a city, i.e. what kind of production there will be emphasis on in the city.\n\t * Precondition: there is a city at location 'p'.\n\t * \n\t * @param p\n\t * the position of the city whose focus should be changed.\n\t * @param balance\n\t * a string defining the focus of the work force in a city. Valid values are at least\n\t * GameConstants.productionFocus and GameConstants.foodFocus.\n\t */\n\tpublic void changeWorkForceFocusInCityAt(Position p, String balance);\n\n\t/**\n\t * change the type of unit a city will produce next. Precondition: there is a city at location 'p'.\n\t * \n\t * @param p\n\t * the position of the city whose production should be changed.\n\t * @param unitType\n\t * a string defining the type of unit that the city should produce next.\n\t */\n\tpublic void changeProductionInCityAt(Position p, String unitType);\n\n\t/**\n\t * perform the action associated with the unit at position p. Example: a settler unit may create a new city at its\n\t * location. Precondition: there is a unit at location 'p'.\n\t * \n\t * @param p\n\t * the position of a unit that must perform its action. Nothing happens in case the unit has no\n\t * associated action.\n\t */\n\tpublic void performUnitActionAt(Position p);\n}", "@Override\n public List<Player> getPlayers() {\n return players;\n }", "public List<Player> getPlayers() {\r\n return players;\r\n }", "public List<Player> getPlayers() {\r\n return players;\r\n }", "public int[] getMove(){\n\t\tArrayList<Node> children = root.getChildren();\n\t\tint i;\n\t\tfor(i = 0; i < children.size(); i++){\n\t\t\tif(children.get(i).getScore() == root.getScore()){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tArrayList<int[]> legalMoves = activeBoard.getLegalMoves();\n\t\treturn legalMoves.get(i);\n\t}", "List<Team> findAll();", "public Player getPlayerToMove()\n {\n return playerToMove;\n }", "@Override\n public void process(GameData gameData, World world) {\n for (Player player : world.getEntities(Player.class).stream().map(Player.class::cast).collect(Collectors.toList())) {\n if(player.isAlive()) {\n PositionPart positionPart = player.getPart(PositionPart.class);\n MovingPart movingPart = player.getPart(MovingPart.class);\n ShootingPart shootingPart = player.getPart(ShootingPart.class);\n\n movingPart.setLeft(gameData.getKeys().isDown(GameKeys.LEFT));\n movingPart.setRight(gameData.getKeys().isDown(GameKeys.RIGHT));\n if (shootingPart != null) {\n shootingPart.setShooting(gameData.getKeys().isDown(GameKeys.SPACE));\n }\n\n //Optional.ofNullable(world.getNearestTile((int) positionPart.getX(), (int) positionPart.getY())).ifPresent(tile -> tile.getEntities().remove(player));\n\n movingPart.process(gameData, player);\n positionPart.process(gameData, player);\n\n //Optional.ofNullable(world.getNearestTile((int) positionPart.getX(), (int) positionPart.getY())).ifPresent(tile -> tile.getEntities().add(player));\n }\n }\n }", "private List<Games> findAllInitialWerewolvesFromDB(Games games) {\n List<Games> werewolves = new ArrayList<>();\n werewolves.addAll(gamesRepository.findByGameIDAndRoomIDAndPlayerInitialRole(games.getGameID(), games.getRoomID(), \"WEREWOLF\"));\n werewolves.addAll(gamesRepository.findByGameIDAndRoomIDAndPlayerInitialRole(games.getGameID(), games.getRoomID(), \"MYSTICWOLF\"));\n werewolves.removeIf(werewolf -> werewolf.getPlayerID().length() == 1);\n return werewolves;\n }", "public void copyAllTournamentPlayers(Tournament tournament, Round round) {\r\n\t\tround.getPlayers().clear();\r\n\t\tround.getPlayers().addAll(tournament.getPlayers());\r\n\t}", "public List<Board> neighbors(int player)\n\t{\n\t\tList<Board> ret = new ArrayList<Board>();\n\t\t\n\t\tList<Integer> moves = getLegalMoves();\n\t\tfor (int i : moves)\n\t\t{\n\t\t\tret.add(makeMove(i,player));\n\t\t}\n\t\t\n\t\treturn ret;\n\t}", "public List<Game> getGameList() {\n return gameList;\n }", "public Collection<Move> getLegalMoves(){\n return legalMoves;\n }", "public Set<Location> getPlayerLocations()\n\t{\n\t\tSet<Location> places = new HashSet<Location>();\n\t\tfor(Location place: playerLocations.values())\n\t\t{\n\t\t\tplaces.add(place);\n\t\t}\n\t\treturn places;\n\t}" ]
[ "0.7450942", "0.6629578", "0.65751517", "0.6502967", "0.64915586", "0.63238347", "0.6200253", "0.61041", "0.5980756", "0.5966588", "0.5965822", "0.5945045", "0.59053206", "0.5893158", "0.58857006", "0.58726704", "0.5823933", "0.5799328", "0.5789164", "0.57886404", "0.5780386", "0.5775504", "0.57686394", "0.5765705", "0.5749131", "0.57486814", "0.5747951", "0.5734132", "0.5715314", "0.56637394", "0.56588686", "0.5606928", "0.5600535", "0.5598932", "0.55919874", "0.5585975", "0.5571971", "0.5558534", "0.55505234", "0.5542639", "0.5536054", "0.55303943", "0.55198705", "0.55077374", "0.55040765", "0.5486193", "0.5452815", "0.5424071", "0.5418757", "0.54080874", "0.5407797", "0.53904545", "0.53888714", "0.5387189", "0.538057", "0.53787863", "0.5370157", "0.5367165", "0.53654706", "0.5349899", "0.53364843", "0.532985", "0.5325829", "0.53093934", "0.53083116", "0.53021055", "0.5298841", "0.52897877", "0.52814317", "0.5276988", "0.52723575", "0.5272142", "0.52718425", "0.52640086", "0.5262922", "0.5262349", "0.5260082", "0.5250146", "0.5246443", "0.5243184", "0.52422136", "0.52409524", "0.52367055", "0.52333254", "0.52327996", "0.5223193", "0.51913136", "0.5188837", "0.51851624", "0.51851624", "0.5182041", "0.5182005", "0.5178982", "0.51703155", "0.5165655", "0.51613444", "0.5157203", "0.51526916", "0.5143345", "0.51391095" ]
0.7589925
0
Validation Functions Description : To validate the required frame available or not in Customer Account Summary of Customer Tab Coded by :Rajan Created Data:20 Oct 2016 Last Modified Date: Modified By: Parameter:
public void verify_required_FrameVisibility_Customer_Tab(String Frame,boolean status)throws Exception { if(status) { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_FrameAvailibility.replaceAll("M_Header", Frame), "Required frame availiable is "+Frame); Report.fnReportPageBreak(Frame+ " Frame is Visible", driver); } else { VerifyElementNotPresent(Desktop_XPATH_Verify_Customer_Page_FrameAvailibility.replaceAll("M_Header", Frame), "Required frame not availiable and "+Frame); Report.fnReportPageBreak(Frame+ " Frame is not Visible", driver); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "@Test\r\n\tpublic void view3_current_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Columns\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t//Removing Column data from another table.\r\n\t\tdata_of_table1 = helper.modify_cols_data_of_table(col_of_table1, data_of_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table1, data_of_table1 );\r\n\t}", "private void validateData() {\n }", "@Test\r\n\tpublic void view3_todays_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"CML Service Level\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table2 = driver.findElements(view3_todays_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table2 = driver.findElements(By.xpath(view3_today_data_table));\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table2, data_of_table2 );\r\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "@Test\r\n\tpublic void view3_COEs_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\t\t//Table 3 - Data .\r\n\t\tList<WebElement> data_of_table3 = driver.findElements(view3_COEs_table_data_val);\r\n\t\t//Table 3 - Columns\r\n\t\tList<WebElement> col_of_table3 = driver.findElements(By.xpath(view3_curr_agent_stats_col));\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> updated_col_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t\r\n\t\t//Adding Column data from another table.\r\n\t\tdata_of_table3 = helper.modify_cols_data_of_table(col_of_table1, data_of_table3, updated_col_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table3, data_of_table3 );\r\n\t}", "private boolean tableDataValid()\r\n {\r\n // if there are any form level validations that should go there\r\n int rowTotal = tblProtoCorresp.getRowCount();\r\n int colTotal = tblProtoCorresp.getColumnCount();\r\n for (int rowIndex = 0; rowIndex < rowTotal ; rowIndex++)\r\n {\r\n for (int colIndex = 0; colIndex < colTotal; colIndex++)\r\n {\r\n TableColumn column = codeTableColumnModel.getColumn(colIndex) ;\r\n\r\n ColumnBean columnBean = (ColumnBean)column.getIdentifier() ;\r\n\r\n if (columnBean.getColumnEditable()\r\n && !columnBean.getColumnCanBeNull())\r\n {\r\n if ( tblProtoCorresp.getValueAt(rowIndex,colIndex) != null)\r\n {\r\n if (tblProtoCorresp.getValueAt(rowIndex,colIndex).equals(\"\")\r\n || tblProtoCorresp.getValueAt(rowIndex,colIndex).toString().trim().equals(\"\") )\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n else\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n }\r\n return true ;\r\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "private boolean validateData() {\n if (!mCommon.validateData()) return false;\n\n Core core = new Core(this);\n\n // Due Date is required\n if (TextUtils.isEmpty(getRecurringTransaction().getDueDateString())) {\n core.alert(R.string.due_date_required);\n return false;\n }\n\n if (TextUtils.isEmpty(mCommon.viewHolder.dateTextView.getText().toString())) {\n core.alert(R.string.error_next_occurrence_not_populate);\n\n return false;\n }\n\n // Payments Left must have a value\n if (getRecurringTransaction().getPaymentsLeft() == null) {\n core.alert(R.string.payments_left_required);\n return false;\n }\n return true;\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "abstract void fiscalCodeValidity();", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "@Test(enabled=true, priority =1)\r\n\tpublic void view3_validate_table_data() {\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_curr_data) , \"Test_View3\" , \"view3_curr_data\" );\t\r\n\t\thelper.validate_table_columns( view3_curr_data_table , driver , \"\" , \"Test_View3\" , \"view3_curr_data_table\" );\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_today_data) , \"Test_View3\" , \"view3_today_data\" );\r\n\t\thelper.validate_table_columns( view3_today_data_table , driver , \"\" , \"Test_View3\" , \"view3_today_data_table\" );\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_curr_agent_stats_tbl) , \"Test_View3\" , \"view3_curr_agent_stats_tbl\" );\r\n\t\thelper.validate_table_columns( view3_curr_agent_stats_col , driver , \"\" , \"Test_View3\" , \"view3_curr_agent_stats_col\" );\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_agent_details) , \"Test_View3\" , \"view3_agent_details\" );\t\r\n\t\thelper.validate_table_columns( view3_Agent_table_data_start , driver , view3_Agent_table_data_end , \"Test_View3\" , \"view3_Agent_table_data\" );\r\n\t}", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private void validateDetails() {\n\n clearErrors();\n Utils.hide_keyboard(getActivity());\n\n boolean valid = true;\n\n String cvv = cvvTv.getText().toString();\n String expiryDate = cardExpiryTv.getText().toString();\n String cardNo = cardNoTv.getText().toString();\n\n if (cvv.length() < 3) {\n valid = false;\n cvvTil.setError(\"Enter a valid cvv\");\n }\n\n if (expiryDate.length() != 5) {\n cardExpiryTil.setError(\"Enter a valid expiry date\");\n valid = false;\n }\n\n String cardNoStripped = cardNo.replaceAll(\"\\\\s\", \"\");\n\n if (cardNoStripped.length() < 12 ) {\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n else {\n try {\n Long parsed = Long.parseLong(cardNoStripped);\n }\n catch (Exception e) {\n e.printStackTrace();\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n }\n\n if (valid) {\n\n if (saveCardSwitch.isChecked()) {\n int cardLen = cardNoStripped.length();\n cardFirst6 = cardNoStripped.substring(0, 6);\n cardLast4 = cardNoStripped.substring(cardLen - 4, cardLen);\n shouldISaveThisCard = true;\n presenter.savePotentialCardDets(cardFirst6, cardLast4);\n }\n\n //make request\n PayloadBuilder builder = new PayloadBuilder();\n builder.setAmount(thetellerInitializer.getAmount() + \"\")\n .setNarration(thetellerInitializer.getNarration())\n .setCardno(cardNoStripped)\n .set3dUrl(thetellerInitializer.get3dUrl())\n .setEmail(thetellerInitializer.getEmail())\n .setCurrency(thetellerInitializer.getCurrency())\n .setMerchant_id(thetellerInitializer.getMerchant_id())\n .setCvv(cvv).setFirstname(thetellerInitializer.getfName())\n .setLastname(thetellerInitializer.getlName())\n .setIP(Utils.getDeviceImei(getActivity()))\n .setTxRef(thetellerInitializer.getTxRef())\n .setExpiryyear(expiryDate.substring(3,5))\n .setExpirymonth(expiryDate.substring(0,2))\n .setMeta(thetellerInitializer.getMeta())\n .setApiUser(thetellerInitializer.getApiUser())\n .setApiKey(thetellerInitializer.getApiKey())\n .setDevice_fingerprint(Utils.getDeviceImei(getActivity()))\n .setCardType(cardType);\n\n if (thetellerInitializer.getPayment_plan() != null) {\n builder.setPaymentPlan(thetellerInitializer.getPayment_plan());\n }\n\n body = builder.createPayload();\n\n presenter.chargeCard(body, thetellerConstants.API_KEY);\n }\n }", "@Test\n public void test10020ATS001ValidationofDatefieldsinPayHistory() throws Exception {\n driver.get(\"http://Clarity\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_UserNameTextBox\")).clear();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_UserNameTextBox\")).sendKeys(\"02.08.09\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_PasswordTextBox\")).clear();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_PasswordTextBox\")).sendKeys(\"password\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_LoginButton\")).click();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_btnLogin\")).click();\n //driver.findElement(By.linkText(\"Select\")).click();\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*How much is my pension[\\\\s\\\\S][\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).clear();\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).sendKeys(\"02/10/20\");\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*Start date is later than end date\\\\.[\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).clear();\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).sendKeys(\"25/07/2017\");\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).clear();\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate\")).clear();\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate\")).sendKeys(\"02/10/2\");\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).sendKeys(\"02/10/2\");\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton\")).click();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton']\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*End Date is not recognized as a valid date\\\\.[\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate']\")).clear();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate']\")).sendKeys(\"21221\\\"\\\"\\\"\");\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).clear();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).sendKeys(\"wewe\\\"\\\"\\\"\");\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton']\")).click();\n Thread.sleep(1000);\n //try {\n //assertTrue(driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDateTypeValidator\")).getText().matches(\"^exact:[\\\\s\\\\S]*$\"));\n //} catch (Error e) {\n // verificationErrors.append(e.toString());\n //}\n // ERROR: Caught exception [Error: locator strategy either id or name must be specified explicitly.]\n driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_LoginStatus\")).click();\n }", "public void validate() {}", "private boolean validateInput(){\n Window owner=root.getScene().getWindow();\n inputFileds.addAll(txtfn,txtln,txtsurname,txtDOB,txtResidence,txtMobile,txtID,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().isEmpty()){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n inputFileds.removeAll(txtDOB,txtMobile,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().length()>30){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Sorry the text you entered can not be greater that 30 characters\",\"Text too Long\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n if(username.getText().length()>20 || username.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Username has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid input\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n if(pass.getText().isEmpty()){\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n if(pass.getText().length()>20 || pass.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Password has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n SimpleDateFormat yearFormat = new SimpleDateFormat(\"yyyy\");\n try {\n date = dateFormat.parse(txtDOB.getText());\n Calendar cal=Calendar.getInstance();\n int year=Integer.parseInt(yearFormat.format(date));\n if (year <= 1900 || year>cal.get(Calendar.YEAR)) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n String initialEntry=txtDOB.getText();\n String parsedValue=dateFormat.format(date);\n if(!initialEntry.equals(parsedValue)){\n Dialog.showMessageDialog(owner, \"Note your Date of Birth has been corrected\", \"Date Corrected\",DialogIcon.INFORMATION);\n }\n txtDOB.setText(dateFormat.format(date));\n } catch (ParseException ex) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n try {\n int mobile=Integer.parseInt(txtMobile.getText());\n } catch (NumberFormatException e) {\n Dialog.showMessageDialog(owner, \"Invalid Mobile Number\", \"Invalid data\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n if(txtMobile.getText().length() != 10){\n Dialog.showMessageDialog(owner, \"Sorry your Mobile Number is invalid\", \"Invalid input\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n String sql=\"select Username,Password from users where Username=?\";\n try(PreparedStatement prstmt=con.prepareStatement(sql)) {\n prstmt.setString(1, username.getText());\n ResultSet rs=prstmt.executeQuery();\n if(rs.next()){\n Dialog.showMessageDialog(owner, \"Sorry Username already exists\\n Please change to different Username\", \"Username Exists\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n rs.close();\n } catch (SQLException e) {\n System.err.println(e);\n }\n return true;\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "void validateTransactionForPremiumWorksheet(Record inputRecord, Connection conn);", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validateRpd15s1()\n {\n // This guideline cannot be automatically tested.\n }", "@Test(groups ={Slingshot,Regression})\n\tpublic void EditViewLessthan15AcctsErrorValidation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify whether proper error message is displayed in view when continuing with out enabling the accounts check box\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMvManageView\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t\t.clicktestacct();\n\t\t/*.ClickManageUserLink()\n\t\t.ManageViews()\n\t\t.VerifyEditviewname(userProfile)\n\t\t.EditViewNameErrorValidation(userProfile); \t \t\t\t\t\t\t \t \t\t\n\t}*/\n\t}", "public void validate(DataRecord value) {\n\r\n\t}", "private void validt() {\n\t\t// -\n\t\tnmfkpinds.setPgmInd99(false);\n\t\tstateVariable.setZmsage(blanks(78));\n\t\tfor (int idxCntdo = 1; idxCntdo <= 1; idxCntdo++) {\n\t\t\tproductMaster.retrieve(stateVariable.getXwabcd());\n\t\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t\t// BR00005 Product not found on Product_Master\n\t\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\t\tmsgObjIdx = setMsgObj(\"OEM0003\", \"XWABCD\", msgObjIdx, messages);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// - If addition, pull the price from file:\n\t\t\tif (nmfkpinds.funKey06()) {\n\t\t\t\tstateVariable.setXwpric(stateVariable.getXwanpr());\n\t\t\t}\n\t\t\t// -\n\t\t\tstoreMaster.retrieve(stateVariable.getXwaacs());\n\t\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t\t// BR00006 Store not found on Store_Master\n\t\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\t\tmsgObjIdx = setMsgObj(\"OES0369\", \"XWAACS\", msgObjIdx, messages);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tstockBalances.retrieve(stateVariable.getXwabcd(), stateVariable.getXwaacs());\n\t\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t\t// BR00007 Store not found on Stock_Balances or CONDET.Contract_Qty >\n\t\t\t// BR Onhand_Quantity\n\t\t\tif (nmfkpinds.pgmInd99() || (stateVariable.getXwa5qt() > stateVariable.getXwbhqt())) {\n\t\t\t\tmsgObjIdx = setMsgObj(\"OES0370\", \"XWAACS\", msgObjIdx, messages);\n\t\t\t\tnmfkpinds.setPgmInd99(true);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// - Transaction Type:\n\t\t\ttransactionTypeDescription.retrieve(stateVariable.getXwricd());\n\t\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t\t// BR00008 Trn_Hst_Trn_Type not found on Transaction_type_description\n\t\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\t\tstateVariable.setXwtdsc(all(\"-\", 20));\n\t\t\t\tmsgObjIdx = setMsgObj(\"OES0371\", \"XWRICD\", msgObjIdx, messages);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// - Unit of measure:\n\t\t\t// BR00009 U_M = 'EAC'\n\t\t\tif (equal(\"EAC\", stateVariable.getXwa2cd())) {\n\t\t\t\tstateVariable.setUmdes(replaceStr(stateVariable.getUmdes(), 1, 11, um[1]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnmfkpinds.setPgmInd99(true);\n\t\t\t\tmsgObjIdx = setMsgObj(\"OES0372\", \"XWA2CD\", msgObjIdx, messages);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private boolean Validate() {\n EditText titleText = findViewById(R.id.register_movie_title_txt);\n EditText yearText = findViewById(R.id.register_movie_year_txt);\n EditText ratingText = findViewById(R.id.register_movie_rating_txt);\n\n\n boolean is_filled_required_fields = false;\n is_filled_required_fields = titleText.getText().toString().length() > 0\n && yearText.getText().toString().length() > 0\n && ratingText.getText().toString().length() > 0;\n\n if (!is_filled_required_fields) {\n Snackbar mySnackbar = Snackbar.make(findViewById(R.id.activity_register_base_layout), \"Please fill required fields\", BaseTransientBottomBar.LENGTH_SHORT);\n mySnackbar.show();\n }\n return is_filled_required_fields;\n }", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "public void validation() {\n ValidationData();\n if (Validation == null) {\n Toast.makeText(this, \"No Data Found\", Toast.LENGTH_SHORT).show();\n } else {\n getHistory();\n }\n }", "public void validateRpd14s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "@Override\r\n\tpublic void validate() {\n\t\t\r\n\t}", "private void validateInputParameters(){\n\n }", "void validate();", "void validate();", "@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyfiftyAcctsviewValidatation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify whether proper error message is diplayed when accounts added more than 50 on clicking the confirm button\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMvManageView\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ManageViews()\n\t\t.FiftyAcctsViewnameErrorValidation(userProfile); \t \t\t\t\t\t\t \t \t\t\t \t \t \t\t\t\t\t\t \t \t\t\n\t}", "@Override\n\tpublic void validate()\n\t{\n\n\t}", "public static Sale validateSale(TextField billno, LocalDate startdate, ComboBox customername, TextField nextdate, String onekgQty, String twokgQty, String fourkgQty, String fivekgQty, String sixkgQty, String ninekgQty, String onekgAmt, String twokgAmt, String fourkgAmt, String fivekgAmt, String sixkgAmt, String ninekgAmt, TextField amount) {\r\n Sale sale = new Sale();\r\n try {\r\n if (billno.getText().isEmpty() || startdate == null || customername.getValue() == null || nextdate.getText().isEmpty() || amount.getText().isEmpty()) {\r\n new PopUp(\"Error\", \"Field is Empty\").alert();\r\n } else {\r\n sale = new Sale();\r\n Date ndd = new SimpleDateFormat(\"dd-MM-yyyy\").parse(nextdate.getText());\r\n java.sql.Date nd = new java.sql.Date(ndd.getTime());\r\n sale.setBillno(Integer.valueOf(billno.getText()));\r\n sale.setStartdate(java.sql.Date.valueOf(startdate));\r\n sale.setShopname(customername.getValue().toString());\r\n sale.setNextdate(nd);\r\n if (onekgQty == null) {\r\n onekgQty = \"0\";\r\n }\r\n if (twokgQty == null) {\r\n twokgQty = \"0\";\r\n }\r\n if (fourkgQty == null) {\r\n fourkgQty = \"0\";\r\n }\r\n if (fivekgQty == null) {\r\n fivekgQty = \"0\";\r\n }\r\n if (sixkgQty == null) {\r\n sixkgQty = \"0\";\r\n }\r\n if (ninekgQty == null) {\r\n ninekgQty = \"0\";\r\n }\r\n sale.setOnekgqty(Integer.valueOf(onekgQty));\r\n sale.setTwokgqty(Integer.valueOf(twokgQty));\r\n sale.setFourkgqty(Integer.valueOf(fourkgQty));\r\n sale.setFivekgqty(Integer.valueOf(fivekgQty));\r\n sale.setSixkgqty(Integer.valueOf(sixkgQty));\r\n sale.setNinekgqty(Integer.valueOf(ninekgQty));\r\n if (onekgAmt == null) {\r\n onekgAmt = \"0.00\";\r\n }\r\n if (twokgAmt == null) {\r\n twokgAmt = \"0.00\";\r\n }\r\n if (fourkgAmt == null) {\r\n fourkgAmt = \"0.00\";\r\n }\r\n if (fivekgAmt == null) {\r\n fivekgAmt = \"0.00\";\r\n }\r\n if (sixkgAmt == null) {\r\n sixkgAmt = \"0.00\";\r\n }\r\n if (ninekgAmt == null) {\r\n ninekgAmt = \"0.00\";\r\n }\r\n sale.setOnekgamount(BigDecimal.valueOf(Double.valueOf(onekgAmt)));\r\n sale.setTwokgamount(BigDecimal.valueOf(Double.valueOf(twokgAmt)));\r\n sale.setFourkgamount(BigDecimal.valueOf(Double.valueOf(fourkgAmt)));\r\n sale.setFivekgamount(BigDecimal.valueOf(Double.valueOf(fivekgAmt)));\r\n sale.setSixkgamount(BigDecimal.valueOf(Double.valueOf(sixkgAmt)));\r\n sale.setNinekgamount(BigDecimal.valueOf(Double.valueOf(ninekgAmt)));\r\n sale.setAmount(BigDecimal.valueOf(Double.valueOf(amount.getText())));\r\n\r\n }\r\n } catch (ParseException error) {\r\n error.printStackTrace();\r\n }\r\n return sale;\r\n }", "private void checkInvalidInformation(EditPlanDirectToManaged editPlanPage) throws Exception {\n //\n Reporter.log(\"Verifying Error Messages on Edit Plan Page\", true);\n editPlanPage.invalidEditPlanUpdate();\n softAssert.assertTrue(editPlanPage.verifyEditPlanErrorMessage());\n\n //Re-Enter correct details\n editPlanPage.updateAnnualHouseHoldincome(Constants.DEFAULT_ANNUAL_HOUSEHOLD_INCOME);\n editPlanPage.updateRetirementAge(Constants.DEFAULT_RETIREMENT_AGE + \"\");\n }", "@Override\n\t@FXML\n\tpublic boolean validate() {\n\t\t\n\t\tboolean isDataEntered = true;\n\t\tLocalDate startDate = Database.getInstance().getStartingDate();\n\t\tSystem.out.println();\n\t\tif(amountField.getText() == null || amountField.getText().trim().isEmpty())\n\t\t\tisDataEntered = setErrorTxt(\"You left the amount field empty.\");\n\t\telse if(!(Validation.validateAmount(amountField.getText())))\n\t\t\tisDataEntered = setErrorTxt(\"Please enter a valid amount\");\n\t\telse if(creditTextField.getText() == null || creditTextField.getText().trim().isEmpty())\n\t\t\tisDataEntered = setErrorTxt(\"You left the credit text field empty.\");\n\t\telse if(!(Validation.validateChars(creditTextField.getText())))\n\t\t\tisDataEntered = setErrorTxt(\"Please only enter valid characters\");\n\t\telse if(dateField.getValue() == null) {\n\t\t\tisDataEntered = setErrorTxt(\"You left the date field empty.\");\t\t\t\n\t\t}\n\t\telse if(dateField.getValue().isBefore(startDate))\n\t\t\tisDataEntered = setErrorTxt(\"Sorry, the date you entered is before the starting date.\");\n\t\treturn isDataEntered;\n\t}", "public void validateRequestToBuyPage(){\r\n\t\tsearchByShowMeAll();\r\n\t\tclickCheckboxAndRenewBuyButton();\r\n\t\tverifyRequestToBuyPage();\r\n\t}", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "public void validateRpd15s2()\n {\n // This guideline cannot be automatically tested.\n }", "public PaymentRequestPage validateNEFTFieldErrorMessages() {\r\n\r\n\t\treportStep(\"About to validate the NEFT field error validation - \", \"INFO\");\r\n\r\n\t\tvalidateTheElementPresence(nameOfBankAccountHolderName);\r\n\t\tvalidateTheElementPresence(pleaseEnterValidACHolderName);\r\n\t\tvalidateTheElementPresence(bank_Name);\r\n\t\tvalidateTheElementPresence(pleaseEnterValidBankName);\r\n\t\tvalidateTheElementPresence(bank_BranchName);\r\n\r\n\t\tscrollFromDownToUpinApp();\r\n\r\n\t\tvalidateTheElementPresence(pleaseEnterBranchNameOr4DigitBranchCode);\r\n\t\tvalidateTheElementPresence(bank_AccountNumber);\r\n\t\tscrollFromDownToUpinApp();\t\t\r\n\t\tvalidateTheElementPresence(pleaseEnterTheBankAccountNum);\r\n\t\tscrollFromDownToUpinApp();\t\t\r\n\t\tvalidateTheElementPresence(ifscCodeForBank);\r\n\t\tvalidateTheElementPresence(pleaseEnterTheIFSC);\r\n\r\n\t\treturn this;\r\n\r\n\t}", "@Override\r\n public void validate() {\r\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public PaymentRequestPage paymentRequestPaymentAvailabilityValidation(String cashbackType,String cashbackValue,String rewardsValue) {\r\n\r\n\t\tString actual = \"\";\r\n\r\n\t\treportStep(\"About to validate the Cashback and Rewards Payment avilablity section in the payment Request page \", \"INFO\");\r\n\r\n\t\tswitch (cashbackType) {\r\n\r\n\t\tcase \"Only_Cashback\":\r\n\r\n\t\t\tvalidateTheElementPresence(cashbackAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, cashbackValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"Only_Rewards\":\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, rewardsValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase \"BothCashback_Rewards\":\r\n\r\n\t\t\tfloat cashbackAmount = Float.parseFloat(cashbackValue);\r\n\t\t\tfloat rewardsAmount = Float.parseFloat(rewardsValue);\r\n\t\t\tfloat totalAmount = cashbackAmount + rewardsAmount ;\r\n\r\n\t\t\tString strTotalAmount = Float.toString(totalAmount) + \"0\";\r\n\t\t\tString strOnlyCashbackAmount = Float.toString(cashbackAmount) + \"0\";\r\n\t\t\tString strOnlyRewardsAmount = Float.toString(rewardsAmount) + \"0\";\r\n\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\t\t\tvalidateTheElementPresence(cashbackText);\r\n\t\t\tvalidateTheElementPresence(rewardsText);\r\n\r\n\t\t\t//validate total cashback amount\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strTotalAmount);\r\n\r\n\t\t\t//validate only cashback amount\r\n\t\t\tactual = getText(cashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyCashbackAmount);\r\n\r\n\r\n\t\t\t//validate only rewards amount\r\n\t\t\tactual = getText(rewardsAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyRewardsAmount);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\r\n\t}", "public void validateRpd15s7()\n {\n // This guideline cannot be automatically tested.\n }", "void checkValid();", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "@Test\n\tpublic void testCase2()\n\t{\n\t\tint numberOfCases=-1;\n\t\t\n\t\t//checking number of case is positive or not\n\t\tboolean valid=BillEstimation.numberOfCaseValidation(numberOfCases);\n\t\tassertFalse(valid);\n\t\t\n\t}", "protected boolean isValidData() {\n return true;\n }", "public void checkData2019() {\n\n }", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "private void validateFunctionData(FunctionData functionData) throws EQException\n\t{\n\t\tFunctionValidate functionValidate = new FunctionValidate(fhd, screenSetPrint, functionData);\n\t\tfunctionValidate.setHaltOnError(false);\n\t\tfunctionValidate.setDefaultValues(false);\n\t\tfunctionValidate.setApplicationValidate(false);\n\t\tfunctionValidate.validate();\n\t}", "private void checkValidation() {\n String getInstituteName = NameofInstitute.getText().toString();\n String getDegreename = SpinnerDegree.getSelectedItem().toString();\n\n\n // Check if all strings are null or not\n if (getInstituteName.equals(\"\") || getInstituteName.length() == 0 || getDegreename.equals(\"\") || getDegreename.length() == 0)\n new CustomToast().Show_Toast(getActivity(), getView(),\"All fields are required.\");\n // Else do signup or do your stuff\n else {\n //Toast.makeText(getActivity(), \"All Ok till Now\", Toast.LENGTH_SHORT).show();\n AddQualifications(getDegreename,getInstituteName);\n }\n\n }", "private void checkValid() {\n getSimType();\n getInitialConfig();\n getIsOutlined();\n getEdgePolicy();\n getNeighborPolicy();\n getCellShape();\n }", "public void validateRpd3s12()\n {\n // This guideline cannot be automatically tested.\n }", "public Boolean validEntries() {\n String orderNumber = orderNo.getText();\n String planTime = plannedTime.getText();\n String realTime = actualTime.getText();\n String worker = workerSelected();\n String productType = productTypeSelected();\n Boolean validData = false;\n if (orderNumber.equals(\"\")) {\n warning.setText(emptyOrderNum);\n } else if (!Validation.isValidOrderNumber(orderNumber)) {\n warning.setText(invalidOrderNum);\n } else if (worker.equals(\"\")) {\n warning.setText(workerNotSelected);\n } else if (productType.equals(\"\")) {\n warning.setText(productTypeNotSelected);\n } else if (planTime.equals(\"\")) {\n warning.setText(emptyPlannedTime);\n } else if (!Validation.isValidPlannedTime(planTime)) {\n warning.setText(invalidPlannedTime);\n } else if (!actualTime.getText().isEmpty() && !Validation.isValidActualTime(realTime)) {\n warning.setText(invalidActualTime);\n } else if (comboStatus.getSelectionModel().isEmpty()) {\n warning.setText(emptyStatus);\n } else validData = true;\n return validData;\n }", "ValidationResponse validate();", "@Override\r\n\tprotected void validate() {\n\t}", "public void validateRpd13s9()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd15s4()\n {\n // This guideline cannot be automatically tested.\n }", "public abstract FieldReport validate(int fieldSequence, Object fieldValue);", "public boolean isValid() {\r\n/* */ try {\r\n/* 326 */ validate();\r\n/* 327 */ } catch (ValidationException vex) {\r\n/* 328 */ return false;\r\n/* */ } \r\n/* 330 */ return true;\r\n/* */ }", "public void VerifyCouponfieldsinCheckout(){\r\n\t\tString countriess1 = \"Denmark,France,PresselSwitzerland,Norway,Spain,BernardFrance,,BernardBelgium,PresselAustria,UK,PresselGermany\";\r\n\t\tString countriess2 = \"Germany,Spain\";\r\n\t\tString countriess3 = \"Netherland,Italy\";\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Cupon Input txt box and Apply button should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(countriess1.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput2inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput3inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"3 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"3 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess2.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"1 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"1 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess3.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput2inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"2 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"2 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"incorret country is entered in method for -\"+countries.get(countrycount));\r\n\t\t\t\tthrow new Exception();\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Incorrect country is entered in method for -\"+countries.get(countrycount)+\" or\"\r\n\t\t\t\t\t+ \" Element not found\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"imgShiptoStoreinCartinCheckout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\t\tcatch(Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Number of cupons is not matching for country or Apply button not present for-\"+countries.get(countrycount));\r\n\t\t\tthrow new Error(\"Number of cupons is not matching for country or Apply button not present for-\"+countries.get(countrycount));\r\n\t\t}\r\n\r\n\t}", "public void validateRpd11s6()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validateInputs(String iStart, String iEnd, String country, String type) {\n \thideErrors();\n \tint validStart;\n \tint validEnd;\n boolean valid = true;\n// \t//will not occur due to UI interface\n// if (isComboBoxEmpty(type)) {\n// \tvalid = false;\n// \tT3_type_error_Text.setVisible(true);\n// }\n if (isComboBoxEmpty(country)) {\n \tvalid = false;\n \tT3_country_error_Text.setVisible(true);\n }\n \t//checking if start year and end year are set\n if (isComboBoxEmpty(iStart)){\n //start is empty\n T3_start_year_error_Text.setVisible(true);\n valid = false;\n }\n if (isComboBoxEmpty(iEnd)){\n //end is empty\n T3_end_year_error_Text.setVisible(true);\n valid = false;\n }\n \tif (valid){\n //if years are not empty and valid perform further testing\n \t\t//fetch valid data range\n \tPair<String,String> validRange = DatasetHandler.getValidRange(type, country);\n \tvalidStart = Integer.parseInt(validRange.getKey());\n \tvalidEnd = Integer.parseInt(validRange.getValue());\n //check year range validity\n \t\tint start = Integer.parseInt(iStart);\n \t\tint end = Integer.parseInt(iEnd);\n \tif (start>=end) {\n \t\tT3_range_error_Text.setText(\"Start year should be < end year\");\n \t\tT3_range_error_Text.setVisible(true);\n \t\tvalid=false;\n \t}\n// \t//will not occur due to UI interface\n// \telse if (start<validStart) {\n// \t\tT3_range_error_Text.setText(\"Start year should be >= \" + Integer.toString(validStart));\n// \t\tT3_range_error_Text.setVisible(true);\n// \t\tvalid=false;\n// \t}else if (end>validEnd) {\n// \t\tT3_range_error_Text.setText(\"End year should be <= \" + Integer.toString(validEnd));\n// \t\tT3_range_error_Text.setVisible(true);\n// \t\tvalid=false;\n// \t}\n \t}\n// \t//will not occur due to UI interface\n// \tif(isComboBoxEmpty(type)) {\n// \t\t//if type is not set\n// T3_type_error_Text.setVisible(true);\n// \t}\n \t\n if(isComboBoxEmpty(country)) {\n //if country is not set\n T3_country_error_Text.setVisible(true);\n }\n \treturn valid;\n }", "public void validateRpd13s17()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s6()\n {\n // This guideline cannot be automatically tested.\n }", "public void SetCreditCarddetails(String ccnumber, String ccname, String ccmonth, String ccyear, String ccseccode){\r\n\t\tString countrygroup_ccdetails= \"UK,PresselAustria\";\r\n\t\tString CCnum = getValue(ccnumber);\r\n\t\tString CCName = getValue(ccname);\r\n\t\tString CCMonth = getValue(ccmonth);\r\n\t\tString CCYear = getValue(ccyear);\r\n\t\tString CCSecCode = getValue(ccseccode);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+CCnum+\", \"+CCName+\", \"+CCMonth+\", \"+CCYear+\", \"+CCSecCode);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The CreditCard details should be entered\");\r\n\t\ttry{\r\n\t\t\tif(!(countrygroup_ccdetails).contains(countries.get(countrycount))){\r\n\t\t\t\tswitchframe(\"TokenizationPage\");\r\n\t\t\t\tsleep(2000);\r\n\t\t\t\tsendKeys(locator_split(\"txtCCnumber\"), CCnum);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCname\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCname\"), CCName);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCMonth\"), CCMonth);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCYear\"), CCYear);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCcode\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCcode\"), CCSecCode);\t\t\t\t\t\t\r\n\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The CreditCard details are entered\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The new CreditCard details are applicable to this \" +country);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- The CreditCard details are not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"One of the element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCnumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCname\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCMonth\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCYear\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCcode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" are not found\");\r\n\r\n\t\t}\r\n\t}", "public void validateRpd18s1()\n {\n // This guideline cannot be automatically tested.\n }", "private static boolean isValidateRecord(Map<String, Object> m)\n throws Exception{\n float crsArrTime = (float) m.get(\"CRS_ARR_TIME\");\n float crsDeptTime = (float) m.get(\"CRS_DEP_TIME\");\n float crsElapsedTime = (float) m.get(\"CRS_ELAPSED_TIME\");\n float actElapsedTime = (float) m.get(\"ACTUAL_ELAPSED_TIME\");\n float arrDelay = (float) m.get(\"ARR_DELAY\");\n float arrDelayMin = (float) m.get(\"ARR_DELAY_NEW\");\n float timeZone = crsArrTime - crsDeptTime - crsElapsedTime;\n float cancelledCheck = timeZone - actElapsedTime;\n float timeModulo = timeZone % 60;\n\n // CRSArrTime and CRSDepTime should not be zero\n // timeZone = CRSArrTime - CRSDepTime - CRSElapsedTime and timeZone % 60 should be 0\n if (crsArrTime == 0 || crsDeptTime == 0 || timeModulo != 0) return false;\n\n // AirportID, AirportSeqID, CityMarketID, StateFips, Wac should be larger than 0\n if ((float) m.get(\"ORIGIN_AIRPORT_ID\") <= 0) return false;\n if ((float) m.get(\"ORIGIN_AIRPORT_SEQ_ID\") <= 0) return false;\n if ((float) m.get(\"ORIGIN_CITY_MARKET_ID\") <= 0) return false;\n if ((float) m.get(\"ORIGIN_STATE_FIPS\") <= 0) return false;\n if ((float) m.get(\"ORIGIN_WAC\") <= 0) return false;\n\n if ((float) m.get(\"DEST_AIRPORT_ID\") <= 0) return false;\n if ((float) m.get(\"DEST_AIRPORT_SEQ_ID\") <= 0) return false;\n if ((float) m.get(\"DEST_CITY_MARKET_ID\") <= 0) return false;\n if ((float) m.get(\"DEST_STATE_FIPS\") <= 0) return false;\n if ((float) m.get(\"DEST_WAC\") <= 0) return false;\n\n // Origin, Destination, CityName, State, StateName should not be empty\n if (m.get(\"ORIGIN\").toString().equals(\"\")) return false;\n if (m.get(\"ORIGIN_CITY_NAME\").toString().equals(\"\")) return false;\n if (m.get(\"ORIGIN_STATE_ABR\").toString().equals(\"\")) return false;\n if (m.get(\"ORIGIN_STATE_NM\").toString().equals(\"\")) return false;\n if (m.get(\"DEST\").toString().equals(\"\")) return false;\n if (m.get(\"DEST_CITY_NAME\").toString().equals(\"\")) return false;\n if (m.get(\"DEST_STATE_ABR\").toString().equals(\"\")) return false;\n if (m.get(\"DEST_STATE_NM\").toString().equals(\"\")) return false;\n\n // For flights that are not Cancelled: ArrTime - DepTime - ActualElapsedTime - timeZone should be zero\n if ((boolean)m.get(\"CANCELLED\") && cancelledCheck != 0) return false;\n\n // if ArrDelay > 0 then ArrDelay should equal to ArrDelayMinutes if ArrDelay < 0 then ArrDelayMinutes should be zero\n // if ArrDelayMinutes >= 15 then ArrDel15 should be true\n if (arrDelay > 0 && arrDelay != arrDelayMin) return false;\n if (arrDelay < 0 && arrDelayMin != 0) return false;\n if (arrDelayMin >= 15 && !(boolean)m.get(\"ARR_DEL15\")) return false;\n\n return true;\n }", "public void validateRpd13s15()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean checkInfo()\n {\n boolean flag = true;\n if(gName.isEmpty())\n {\n groupName.setError(\"Invalid name\");\n flag = false;\n }\n if(gId.isEmpty())\n {\n groupId.setError(\"Invalid id\");\n flag = false;\n }\n if(gAddress.isEmpty())\n {\n groupAddress.setError(\"Invalid address\");\n flag = false;\n }\n\n for(char c : gName.toCharArray()){\n if(Character.isDigit(c)){\n groupName.setError(\"Invalid Name\");\n flag = false;\n groupName.requestFocus();\n }\n }\n\n if(groupType.isEmpty())\n {\n flag = false;\n rPublic.setError(\"Choose one option\");\n }\n\n if(time.isEmpty())\n time = \"not set\";\n\n if(groupDescription.getText().toString().length()<20||groupDescription.getText().toString().length()>200)\n groupDescription.setError(\"Invalid description\");\n\n return flag;\n }", "public boolean validateTab();", "private boolean verifyObligedFields() {\n if(label.getText().toString().isEmpty() || label.getText().toString().equals(\"\"))\n {\n Toast.makeText(ExpenseCardViewDetails.this, R.string.label_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(category.getSelectedItem().toString().isEmpty())\n {\n Toast.makeText(ExpenseCardViewDetails.this, R.string.category_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(cost.getText().toString().isEmpty()){\n Toast.makeText(ExpenseCardViewDetails.this, R.string.cost_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(dateDue.getText().toString().isEmpty()){\n Toast.makeText(ExpenseCardViewDetails.this, R.string.date_due_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "public void validateRpd22s9()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd11s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd3s14()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validate() {\n if(edtMobileNumber.getText().toString().length() <= 0){\n edtMobileNumber.setFocusable(true);\n edtMobileNumber.setError(Constants.ERR_MSG_MOBILE);\n return false;\n }else if(edtFirstName.getText().toString().length() <= 0){\n edtFirstName.setFocusable(true);\n edtFirstName.setError(Constants.ERR_MSG_FIRST_NAME);\n return false;\n }else if(edtLastName.getText().toString().length() <= 0){\n edtLastName.setFocusable(true);\n edtLastName.setError(Constants.ERR_MSG_LAST_NAME);\n return false;\n }else if(edtDateOfBirth.getText().toString().length() <= 0){\n edtDateOfBirth.setFocusable(true);\n edtDateOfBirth.setError(Constants.ERR_MSG_DATE_OF_BIRTH);\n return false;\n }else if(edtEnterPin.getText().toString().length() <= 0){\n edtEnterPin.setFocusable(true);\n edtEnterPin.setError(Constants.ERR_MSG_PIN);\n return false;\n }else if(edtConfirmPin.getText().toString().length() <= 0){\n edtConfirmPin.setFocusable(true);\n edtConfirmPin.setError(Constants.ERR_MSG_CONFIRM_PIN);\n return false;\n }else if(spnStatus.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_STATUS, Toast.LENGTH_SHORT).show();\n return false;\n }else if(spnBloodGroup.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_BLOOD_GROUP, Toast.LENGTH_SHORT).show();\n return false;\n }else if(rgGender.getCheckedRadioButtonId() == -1){\n Toast.makeText(context,Constants.ERR_MSG_GENDER,Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "public void validateSchedular() {\n boolean startDateCheck = false, cronTimeCheck = false, dateFormatCheck = false;\n /*\n Schedular Properties\n */\n\n System.out.println(\"Date: \" + startDate.getValue());\n if (startDate.getValue() != null) {\n System.out.println(\"Date: \" + startDate.getValue());\n startDateCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Start Date should not be empty.\\n\");\n }\n\n if (!cronTime.getText().isEmpty()) {\n cronTimeCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Cron Time should not be empty.\\n\");\n }\n// if (!dateFormat.getText().isEmpty()) {\n// dateFormatCheck = true;\n// } else {\n// execptionData.append((++exceptionCount) + \". Date Format should not be empty.\\n\");\n// }\n\n if (startDateCheck == true && cronTimeCheck == true) {\n schedularCheck = true;\n } else {\n schedularCheck = false;\n startDateCheck = false;\n cronTimeCheck = false;\n dateFormatCheck = false;\n }\n\n }", "void validate() {\n int quality = mQuality;\n int matchType = mMatchType;\n if (mZoneId == null) {\n if (quality != QUALITY_NA || matchType != MATCH_TYPE_NA) {\n throw new RuntimeException(\"Invalid quality or match type for null zone ID.\"\n + \" quality=\" + quality + \", matchType=\" + matchType);\n }\n } else {\n boolean qualityValid = (quality == QUALITY_SINGLE_ZONE\n || quality == QUALITY_MULTIPLE_ZONES_WITH_SAME_OFFSET\n || quality == QUALITY_MULTIPLE_ZONES_WITH_DIFFERENT_OFFSETS);\n boolean matchTypeValid = (matchType == MATCH_TYPE_NETWORK_COUNTRY_ONLY\n || matchType == MATCH_TYPE_NETWORK_COUNTRY_AND_OFFSET\n || matchType == MATCH_TYPE_EMULATOR_ZONE_ID\n || matchType == MATCH_TYPE_TEST_NETWORK_OFFSET_ONLY);\n if (!qualityValid || !matchTypeValid) {\n throw new RuntimeException(\"Invalid quality or match type with zone ID.\"\n + \" quality=\" + quality + \", matchType=\" + matchType);\n }\n }\n }", "public boolean isValidPart() {\n boolean result = false;\n boolean isComplete = !partPrice.getText().equals(\"\")\n && !partName.getText().equals(\"\")\n && !inventoryCount.getText().equals(\"\")\n && !partId.getText().equals(\"\")\n && !maximumInventory.getText().equals(\"\")\n && !minimumInventory.getText().equals(\"\")\n && !variableTextField.getText().equals(\"\");\n boolean isValidPrice = isDoubleValid(partPrice);\n boolean isValidName = isCSVTextValid(partName);\n boolean isValidId = isIntegerValid(partId);\n boolean isValidMax = isIntegerValid(maximumInventory);\n boolean isValidMin = isIntegerValid(minimumInventory);\n boolean isMinLessThanMax = false;\n if (isComplete)\n isMinLessThanMax = Integer.parseInt(maximumInventory.getText()) > Integer.parseInt(minimumInventory.getText());\n\n if (!isComplete) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Missing Information\");\n errorMessage.setHeaderText(\"You didn't enter required information!\");\n errorMessage.setContentText(\"All fields are required! Your part has not been saved. Press \\\"OK\\\" and try again.\");\n errorMessage.show();\n } else if (!isMinLessThanMax) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Invalid Entry\");\n errorMessage.setHeaderText(\"Min must be less than Max!\");\n errorMessage.setContentText(\"Re-enter your data! Your part has not been saved.Press \\\"OK\\\" and try again.\");\n errorMessage.show();\n } else if (!isValidPrice) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Price is not valid\");\n errorMessage.setHeaderText(\"The value you entered for price is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered does\" +\n \" not include more than one decimal point (.), does not contain any letters, and does not \" +\n \"have more than two digits after the decimal. \");\n errorMessage.show();\n } else if (!isValidName) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Invalid Name\");\n errorMessage.setHeaderText(\"The value you entered for name is not valid.\");\n errorMessage.setContentText(\"Please ensure that the text you enter does not\" +\n \" include any quotation marks,\" +\n \"(\\\"), or commas (,).\");\n errorMessage.show();\n } else if (!isValidId) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect ID\");\n errorMessage.setHeaderText(\"The value you entered for ID is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else if (!isValidMax) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect Max Inventory\");\n errorMessage.setHeaderText(\"The value you entered for Max is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else if (!isValidMin) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect Min Inventory\");\n errorMessage.setHeaderText(\"The value you entered for Min is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else {\n result = true;\n }\n\n return result;\n }", "UserPayment validate(String cardHolderName,String cardType,String securityCode,String paymentType);", "@Override\n\tpublic void validate() {\n\t}", "private void validation() {\n Pattern pattern = validationfilterStringData();\n if (pattern.matcher(txtDrug.getText().trim()).matches() && pattern.matcher(txtGenericName.getText().trim()).matches()) {\n try {\n TblTreatmentadvise treatmentadvise = new TblTreatmentadvise();\n treatmentadvise.setDrugname(txtDrug.getText());\n treatmentadvise.setGenericname(txtGenericName.getText());\n treatmentadvise.setTiming(cmbDosestiming.getSelectedItem().toString());\n cmbtiming.setSelectedItem(cmbDosestiming);\n treatmentadvise.setDoses(loadcomboDoses());\n treatmentadvise.setDuration(loadcomboDuration());\n PatientService.saveEntity(treatmentadvise);\n JOptionPane.showMessageDialog(this, \"SAVE SUCCESSFULLY\");\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(this, \"STARTUP THE DATABASE CONNECTION\");\n }\n } else {\n JOptionPane.showMessageDialog(this, \"WRONG DATA ENTERED.\");\n }\n }", "@Override\n\tprotected Boolean isValid(String[] fields) {\n\t\t//check - evnet_id, yes, maybe, invited, no\n return (fields.length > 4);\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "@Override\n public void validate(ValidationContext vc) {\n Map<String,Property> beanProps = vc.getProperties(vc.getProperty().getBase());\n \n validateKode(vc, (String)beanProps.get(\"idKurikulum\").getValue(), (Boolean)vc.getValidatorArg(\"tambahBaru\")); \n validateDeskripsi(vc, (String)beanProps.get(\"deskripsi\").getValue()); \n }", "@Value.Check\n default void checkPreconditions()\n {\n RangeCheck.checkIncludedInInteger(\n this.feedback(),\n \"Feedback\",\n RangeInclusiveI.of(0, 7),\n \"Valid feedback values\");\n\n RangeCheck.checkIncludedInInteger(\n this.transpose(),\n \"Transpose\",\n RangeInclusiveI.of(-24, 24),\n \"Valid transpose values\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR1Level(),\n \"Pitch R1 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR1Rate(),\n \"Pitch R1 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR2Level(),\n \"Pitch R2 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR2Rate(),\n \"Pitch R2 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR3Level(),\n \"Pitch R3 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR3Rate(),\n \"Pitch R3 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR4Level(),\n \"Pitch R4 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR4Rate(),\n \"Pitch R4 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoPitchModulationDepth(),\n \"LFO Pitch Modulation Depth\",\n RangeInclusiveI.of(0, 99),\n \"Valid pitch modulation depth values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoPitchModulationSensitivity(),\n \"LFO Pitch Modulation Sensitivity\",\n RangeInclusiveI.of(0, 7),\n \"Valid pitch modulation sensitivity values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoAmplitudeModulationDepth(),\n \"LFO Amplitude Modulation Depth\",\n RangeInclusiveI.of(0, 99),\n \"Valid amplitude modulation depth values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoSpeed(),\n \"LFO Speed\",\n RangeInclusiveI.of(0, 99),\n \"Valid LFO speed values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoDelay(),\n \"LFO Delay\",\n RangeInclusiveI.of(0, 99),\n \"Valid LFO delay values\");\n }", "private boolean triggerValidation()\r\n {\r\n System.out.println(\"*** Validation row : \" + selRow + \" col : \" + selColumn + \" ***\") ;\r\n /*\r\n * using the colIndex u can get the column bean for that column and then depending the\r\n * datatype of the column u apply appropriate validation rules\r\n */\r\n Object newValue = ((CoeusTextField)txtCell).getText();\r\n\r\n if (!tableStructureBeanPCDR.isIdAutoGenerated()\r\n && (selColumn == tableStructureBeanPCDR.getPrimaryKeyIndex(0)))\r\n {\r\n if (checkDependency(selRow, \"\"))\r\n {\r\n if(!CheckUniqueId(newValue.toString(), selRow, selColumn))\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"chkPKeyUniqVal_exceptionCode.2401\");\r\n\r\n CoeusOptionPane.showInfoDialog(msg);\r\n //after failure of checking, make sure selecting the failed row\r\n\r\n return false; //fail in uniqueid check\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }\r\n else\r\n {\r\n return false;//fail in dependency check\r\n }\r\n\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n\r\n\r\n }", "public void validateRpd15s5()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean verifyData()\n {\n if(jTextFieldName.getText().equals(\"\") && jTextFieldNumber.getText().equals(\"\") \n || jTextFieldSupplier.getText().equals(\"\") || jTextArea1.getText().equals(\"\") || jTextFieldModel.getText().equals(\"\"))\n {\n JOptionPane.showMessageDialog(null, \"One or More Fields Are Empty\");\n return false;\n }\n \n else\n {\n return true;\n }\n \n }", "protected void validate() {\n // no op\n }" ]
[ "0.6825345", "0.66612804", "0.66153866", "0.6603709", "0.6526585", "0.6521978", "0.6419764", "0.6417063", "0.6342049", "0.6331564", "0.6331564", "0.6219315", "0.6156434", "0.61018324", "0.60800266", "0.6071028", "0.60590386", "0.6049881", "0.6025239", "0.6001989", "0.6001686", "0.59953785", "0.5994352", "0.59728634", "0.59260195", "0.59172773", "0.5894946", "0.58886516", "0.58881843", "0.58665526", "0.5856804", "0.58490855", "0.5849016", "0.5848416", "0.5847956", "0.5825697", "0.5825697", "0.5801351", "0.57953334", "0.5761849", "0.57457155", "0.5743436", "0.57421225", "0.5720666", "0.5718146", "0.57127076", "0.57022655", "0.56967837", "0.56921273", "0.5688419", "0.56857604", "0.56818163", "0.5679759", "0.5675083", "0.56740683", "0.5672292", "0.5670386", "0.5670161", "0.5665535", "0.56648123", "0.56617224", "0.5660054", "0.56568617", "0.56553304", "0.56546783", "0.56476474", "0.5646097", "0.5640619", "0.5639866", "0.56242985", "0.56154096", "0.56119156", "0.5611362", "0.56113607", "0.56103337", "0.5606049", "0.5598778", "0.5593542", "0.5592787", "0.5591196", "0.5589843", "0.55890965", "0.55837864", "0.55826575", "0.5581967", "0.55745447", "0.5571677", "0.55662537", "0.55601144", "0.5554729", "0.55536646", "0.5548328", "0.5541539", "0.5538406", "0.5537641", "0.5535686", "0.55324", "0.553045", "0.5526096", "0.5524424" ]
0.5779664
39
Validation Functions Description : To validate the Account Number in Customer Account Summary of Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:25 Oct 2016 Modified By:Rajan Parameter:AccountNumber
public void validate_the_Account_Number_in_Customer_Account_Summary_of_Customer_Tab(String AccountNumber)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll("M_Header", "Landline Account Summary").replaceAll("M_Category", "Account Number").replaceAll("M_InnerText", AccountNumber), "Account Number - "+AccountNumber, false); Report.fnReportPageBreak("Customer Account Summary", driver); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean validateAccountNumber() {\n\t\tif (!this.setAccountNumber(this.account))\n\t\t\treturn false;\n\t\treturn this.getAccountNumber().length() > 0 && this.getAccountNumber().length() <= 11;\n\t}", "boolean validateAccount(String Account) {\n\t\treturn true;\n\n\t}", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "public void validate_the_Account_Status_in_Customer_Account_Summary_of_Customer_Tab(String AccountStatus)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Account Status\").replaceAll(\"M_InnerText\", AccountStatus), \"Account Status - \"+AccountStatus, false);\n\t}", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public static String accountValid(String account){\n return \"select u_accountnum from users having u_accountnum = '\" + account + \"'\";\n }", "@Test(priority=1)\n\tpublic void checkFirstNameAndLastNameFieldValiditywithNumbers(){\n\t\tsignup.clearAllFields();\n\t\tsignup.enterId(\"[email protected]\");\n\t\tsignup.enterFirstName(\"12345\");\n\t\tsignup.enterLastName(\"56386\");\n\t\tsignup.clickSubmit();\n\t\tList<String> errors = signup.getErrors();\n\t\t// given page accepts numbers into the firstname and lastname fields\n\t\tAssert.assertFalse(TestHelper.isStringPresent(errors, \"Please enter your last name.\"));\n\t\tAssert.assertFalse(TestHelper.isStringPresent(errors, \"Please enter your first name.\"));\n\t}", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "@Test\r\n\tpublic void testReceiverAccountNumberPattern() {\r\n\t\tAccountTransferRequest accountTransferRequest = new AccountTransferRequest();\r\n\t\taccountTransferRequest.setUsername(VALID_USERNAME);\r\n\t\taccountTransferRequest.setPassword(VALID_PASSWORD);\r\n\t\taccountTransferRequest.setSenderAccount(VALID_SENDER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setReceiverAccount(\"*654rt\");\r\n\t\taccountTransferRequest.setTransferAmount(400.0);\t\t\r\n\t\ttry {\r\n\t\t\ttransferValidationUnit.validate(accountTransferRequest);\r\n\t\t\tAssert.fail(\"Exception_Expected\");\r\n\t\t} catch (ValidationException exception) {\r\n\t\t\tAssert.assertNotNull(exception);\r\n\t\t\tAssert.assertEquals(\"Invalid_Sender_And_Receiver_AccountNumber\", exception.getMessage());\r\n\r\n\t\t}\r\n\t}", "@Test\r\n\tpublic void view3_todays_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"CML Service Level\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table2 = driver.findElements(view3_todays_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table2 = driver.findElements(By.xpath(view3_today_data_table));\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table2, data_of_table2 );\r\n\t}", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private void validateData() {\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "void validateTransactionForPremiumWorksheet(Record inputRecord, Connection conn);", "@Test\r\n\tpublic void testReceiverAccountNumberLength() {\r\n\t\tAccountTransferRequest accountTransferRequest = new AccountTransferRequest();\r\n\t\taccountTransferRequest.setUsername(VALID_USERNAME);\r\n\t\taccountTransferRequest.setPassword(VALID_PASSWORD);\r\n\t\taccountTransferRequest.setSenderAccount(VALID_SENDER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setReceiverAccount(\"56789054\");\r\n\t\taccountTransferRequest.setTransferAmount(400.0);\t\t\r\n\t\ttry {\r\n\t\t\ttransferValidationUnit.validate(accountTransferRequest);\r\n\t\t\tAssert.fail(\"Exception_Expected\");\r\n\t\t} catch (ValidationException exception) {\r\n\t\t\tAssert.assertNotNull(exception);\r\n\t\t\tAssert.assertEquals(\"Invalid_Sender_And_Receiver_AccountNumber\", exception.getMessage());\r\n\r\n\t\t}\r\n\t}", "boolean isSetAccountNumber();", "public boolean isAccountValid(String accountNumber, BankFusionEnvironment env) {\n boolean isAccountValid = false;\n errorMessage = CommonConstants.EMPTY_STRING;\n try {\n IBOAttributeCollectionFeature accValues = (IBOAttributeCollectionFeature) env.getFactory().findByPrimaryKey(\n IBOAttributeCollectionFeature.BONAME, accountNumber);\n isAccountValid = true;\n BusinessValidatorBean accountValidator = new BusinessValidatorBean();\n if (accountValidator.validateAccountClosed(accValues, env)) {\n isAccountValid = false;\n errorMessage = accountValidator.getErrorMessage().getLocalisedMessage();\n }\n else if (accountValidator.validateAccountStopped(accValues, env)) {\n isAccountValid = false;\n errorMessage = accountValidator.getErrorMessage().getLocalisedMessage();\n }\n\n }\n catch (FinderException exception) {\n errorMessage = \"Invalid Main Account\";\n }\n catch (BankFusionException exception) {\n errorMessage = \"Invalid Main Account\";\n }\n\n return isAccountValid;\n }", "public void validateEnterDiningInformation(MessageContext messageContext){\r\n\t\tif (StringUtils.hasText(creditCardNumber)){\r\n\t\t\tif (creditCardNumber.length() != 16){\r\n\t\t\t\tmessageContext.addMessage(new MessageBuilder().error()\r\n\t\t\t\t\t\t.source(\"creditCardNumber\")\r\n\t\t\t\t\t\t.code(\"error.invalidFormat.DiningForm.creditCardNumber\").build());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void addAccount() {\n\t\t\n\t\ttry {\n\t\t\tlog.log(Level.INFO, \"Please enter name\");\n String custName = scan.next();\n validate.checkName(custName);\n \t\tlog.log(Level.INFO, \"Select Account Type: \\n 1 for Savings \\n 2 for Current \\n 3 for FD \\n 4 for DEMAT\");\n\t\t\tint bankAccType = Integer.parseInt(scan.next());\n\t\t\tvalidate.checkAccType(bankAccType);\n\t\t\tlog.log(Level.INFO, \"Please Enter your Aadar Card Number\");\n\t\t\tString aadarNumber = scan.next();\n\t\t\tlog.log(Level.INFO, \"Please Enter Phone Number: \");\n\t\t\tString custMobileNo = scan.next();\n\t\t\tvalidate.checkPhoneNum(custMobileNo);\n\t\t\tlog.log(Level.INFO, \"Please Enter Customer Email Id: \");\n\t\t\tString custEmail = scan.next();\n\t\t\tvalidate.checkEmail(custEmail);\n\t\t\tbankop.add(accountNumber, custName, bankAccType, custMobileNo, custEmail, aadarNumber);\n\t\t\taccountNumber();\n\t\t\n\t\t} catch (AccountDetailsException message) {\n\t\t\tlog.log(Level.INFO, message.getMessage()); \n }\n\n\t}", "@Test\r\n\tpublic void view3_current_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Columns\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t//Removing Column data from another table.\r\n\t\tdata_of_table1 = helper.modify_cols_data_of_table(col_of_table1, data_of_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table1, data_of_table1 );\r\n\t}", "@Test\r\n\tpublic void view3_COEs_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\t\t//Table 3 - Data .\r\n\t\tList<WebElement> data_of_table3 = driver.findElements(view3_COEs_table_data_val);\r\n\t\t//Table 3 - Columns\r\n\t\tList<WebElement> col_of_table3 = driver.findElements(By.xpath(view3_curr_agent_stats_col));\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> updated_col_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t\r\n\t\t//Adding Column data from another table.\r\n\t\tdata_of_table3 = helper.modify_cols_data_of_table(col_of_table1, data_of_table3, updated_col_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table3, data_of_table3 );\r\n\t}", "abstract void fiscalCodeValidity();", "public boolean verifyAccountNumber(String expectedAccNo, ExtentTest extentedReport) {\n\t\tboolean isOk = false;\n\t\tString actualAccNo = txtAccNumber.getAttribute(\"value\").trim();\n\t\tLog.message(\"Actual Acc No: '\" + actualAccNo + \"'\", extentedReport);\n\t\tLog.message(\"Expected Acc No: '\" + expectedAccNo + \"'\", extentedReport);\n\n\t\tif (actualAccNo.equals(expectedAccNo)) {\n\t\t\tisOk = true;\n\t\t} else {\n\t\t\tLog.message(\"The actual account number '\" + actualAccNo + \"' does not match the expected '\" + expectedAccNo\n\t\t\t\t\t+ \"'\", extentedReport);\n\t\t}\n\n\t\treturn isOk;\n\t}", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "public void setAccountNo( String accountNo ) {\r\n this.accountNo = accountNo;\r\n }", "@Test\r\n\tpublic void testSenderAccountNumberPattern() {\r\n\t\tAccountTransferRequest accountTransferRequest = new AccountTransferRequest();\r\n\t\taccountTransferRequest.setUsername(VALID_USERNAME);\r\n\t\taccountTransferRequest.setPassword(VALID_PASSWORD);\r\n\t\taccountTransferRequest.setSenderAccount(\"&*546abc\");\r\n\t\taccountTransferRequest.setReceiverAccount(VALID_RECEIVER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setTransferAmount(400.0);\t\t\r\n\t\ttry {\r\n\t\t\ttransferValidationUnit.validate(accountTransferRequest);\r\n\t\t\tAssert.fail(\"Exception_Expected\");\r\n\t\t} catch (ValidationException exception) {\r\n\t\t\tAssert.assertNotNull(exception);\r\n\t\t\tAssert.assertEquals(\"Invalid_Sender_And_Receiver_AccountNumber\", exception.getMessage());\r\n\r\n\t\t}\r\n\t}", "@Test(groups ={Slingshot,Regression})\n\tpublic void EditViewLessthan15AcctsErrorValidation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify whether proper error message is displayed in view when continuing with out enabling the accounts check box\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMvManageView\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t\t.clicktestacct();\n\t\t/*.ClickManageUserLink()\n\t\t.ManageViews()\n\t\t.VerifyEditviewname(userProfile)\n\t\t.EditViewNameErrorValidation(userProfile); \t \t\t\t\t\t\t \t \t\t\n\t}*/\n\t}", "@Test\r\n\tpublic void testValidationSuccess() {\r\n\t\tAccountTransferRequest accountTransferRequest = new AccountTransferRequest();\r\n\t\taccountTransferRequest.setUsername(VALID_USERNAME);\r\n\t\taccountTransferRequest.setPassword(VALID_PASSWORD);\r\n\t\taccountTransferRequest.setSenderAccount(VALID_SENDER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setReceiverAccount(VALID_RECEIVER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setTransferAmount(400.0);\t\t\r\n\t\ttry {\r\n\t\t\ttransferValidationUnit.validate(accountTransferRequest);\r\n\t\t} catch (ValidationException e) {\r\n\t\t\tAssert.fail(\"Found_Exception\");\r\n\t\t}\r\n\t}", "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "public void validate(DataRecord value) {\n\r\n\t}", "public void checkBankAccount(String accountNumber, String sortCode, ExtentTest extentedReport) {\n\t\tWaitUtils.waitForElementPresent(driver, txtAccNumber, \" Account number textbox is not found\");\n\t\ttxtAccNumber.clear();\n\t\ttxtAccNumber.sendKeys(accountNumber);\n\t\tLog.message(\"Account number entered : \" + accountNumber, extentedReport);\n\n\t\ttxtAccSortCode.clear();\n\t\ttxtAccSortCode.sendKeys(sortCode);\n\t\tLog.message(\"Sort code entered : \" + sortCode, extentedReport);\n\n\t\tWaitUtils.waitForElementPresent(driver, btnCheckAccount, \"Check account button is not found\");\n\t\tbtnCheckAccount.click();\n\t\tWaitUtils.waitForSpinner(driver);\n\t}", "private boolean validate(){\n\n String MobilePattern = \"[0-9]{10}\";\n String name = String.valueOf(userName.getText());\n String number = String.valueOf(userNumber.getText());\n\n\n if(name.length() > 25){\n Toast.makeText(getApplicationContext(), \"pls enter less the 25 characher in user name\",\n Toast.LENGTH_SHORT).show();\n return true;\n }\n\n\n\n else if(name.length() == 0 || number.length() == 0 ){\n Toast.makeText(getApplicationContext(), \"pls fill the empty fields\",\n Toast.LENGTH_SHORT).show();\n return false;\n }\n\n\n\n else if(number.matches(MobilePattern))\n {\n\n return true;\n }\n else if(!number.matches(MobilePattern))\n {\n Toast.makeText(getApplicationContext(), \"Please enter valid 10\" +\n \"digit phone number\", Toast.LENGTH_SHORT).show();\n\n\n return false;\n }\n\n return false;\n\n }", "@org.junit.Test\r\n public void testPositiveScenario() {\n boolean result = Validation.validateSAPhoneNumber(\"+27712612199\");// function should return true\r\n assertEquals(true, result);\r\n\r\n }", "public void loanAmount_Validation() {\n\t\thelper.assertString(usrLoanAmount_AftrLogin(), payOffOffer.usrLoanAmount_BfrLogin());\n\t\tSystem.out.print(\"The loan amount is: \" + usrLoanAmount_AftrLogin());\n\n\t}", "public void setAccountNo(int number){\n\t\taccountNo = number;\n\t}", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "void validateMobileNumber(String stringToBeValidated,String name);", "public void setAccountNo (String AccountNo);", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "private boolean validateCard() {\n Card card = new Card(\n editTextCreditCardNumber.getText().toString(),\n selectedMonth,\n selectedYear,\n editTextCCV.getText().toString()\n );\n boolean validation = card.validateCard();\n if (validation) {\n return true;\n } else if (!card.validateNumber()) {\n Toast.makeText(getActivity(), getResources().getString(R.string.creditCardErrorNumber), Toast.LENGTH_SHORT).show();\n return false;\n } else if (!card.validateExpiryDate()) {\n Toast.makeText(getActivity(), getResources().getString(R.string.creditCardErrorExpiryDate), Toast.LENGTH_SHORT).show();\n return false;\n } else if (!card.validateCVC()) {\n Toast.makeText(getActivity(), getResources().getString(R.string.creditCardErrorCCV), Toast.LENGTH_SHORT).show();\n return false;\n } else {\n Toast.makeText(getActivity(), getResources().getString(R.string.creditCardError), Toast.LENGTH_SHORT).show();\n return false;\n }\n }", "@Test\r\n\tpublic void testSenderAccountNumberLength() {\r\n\t\tAccountTransferRequest accountTransferRequest = new AccountTransferRequest();\r\n\t\taccountTransferRequest.setUsername(VALID_USERNAME);\r\n\t\taccountTransferRequest.setPassword(VALID_PASSWORD);\r\n\t\taccountTransferRequest.setSenderAccount(\"1234567\");\r\n\t\taccountTransferRequest.setReceiverAccount(VALID_RECEIVER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setTransferAmount(400.0);\t\t\r\n\t\ttry {\r\n\t\t\ttransferValidationUnit.validate(accountTransferRequest);\r\n\t\t\tAssert.fail(\"Exception_Expected\");\r\n\t\t} catch (ValidationException exception) {\r\n\t\t\tAssert.assertNotNull(exception);\r\n\t\t\tAssert.assertEquals(\"Invalid_Sender_And_Receiver_AccountNumber\", exception.getMessage());\r\n\r\n\t\t}\r\n\t}", "public PaymentRequestPage validateNEFTFieldErrorMessages() {\r\n\r\n\t\treportStep(\"About to validate the NEFT field error validation - \", \"INFO\");\r\n\r\n\t\tvalidateTheElementPresence(nameOfBankAccountHolderName);\r\n\t\tvalidateTheElementPresence(pleaseEnterValidACHolderName);\r\n\t\tvalidateTheElementPresence(bank_Name);\r\n\t\tvalidateTheElementPresence(pleaseEnterValidBankName);\r\n\t\tvalidateTheElementPresence(bank_BranchName);\r\n\r\n\t\tscrollFromDownToUpinApp();\r\n\r\n\t\tvalidateTheElementPresence(pleaseEnterBranchNameOr4DigitBranchCode);\r\n\t\tvalidateTheElementPresence(bank_AccountNumber);\r\n\t\tscrollFromDownToUpinApp();\t\t\r\n\t\tvalidateTheElementPresence(pleaseEnterTheBankAccountNum);\r\n\t\tscrollFromDownToUpinApp();\t\t\r\n\t\tvalidateTheElementPresence(ifscCodeForBank);\r\n\t\tvalidateTheElementPresence(pleaseEnterTheIFSC);\r\n\r\n\t\treturn this;\r\n\r\n\t}", "public void validate() {}", "private String creditCardValidate(CardPayment payment) {\r\n \tString validate = null;\r\n \t\r\n \tString cardType = payment.getCreditCardType();\r\n \t\r\n \tif(cardType.equals(\"MASTERCARD\") || cardType.equals(\"VISA\")) {\r\n \t\tif(payment.getCreditCardNumber().matches(\"[0-9]+\") && payment.getCreditCardNumber().length() != 16) {\r\n \t\t\treturn \"Credit Card Number is invalid\";\r\n \t\t} else if(String.valueOf(payment.getCreditcardcvv()).length() != 3) {\r\n \t\t\treturn \"Credit Card CVV is invalid\";\r\n \t\t}\r\n \t} else if(cardType.equals(\"AMEX\")) {\r\n \t\tif(payment.getCreditCardNumber().matches(\"[0-9]+\") && payment.getCreditCardNumber().length() != 15) {\r\n \t\t\treturn \"Credit Card Number is invalid\";\r\n \t\t} else if(String.valueOf(payment.getCreditcardcvv()).length() != 4) {\r\n \t\t\treturn \"Credit Card CVV is invalid\";\r\n \t\t}\r\n \t} else {\r\n \t\tvalidate = \"Invalid card type\";\r\n \t}\r\n \t\r\n \treturn validate;\r\n }", "public String getAccountNo();", "public account(int acc,int Id,String Atype,double bal ){\n this.accNo = acc;\n this.id = Id;\n this.atype = Atype;\n this.abal = bal;\n }", "private boolean validateInput(){\n Window owner=root.getScene().getWindow();\n inputFileds.addAll(txtfn,txtln,txtsurname,txtDOB,txtResidence,txtMobile,txtID,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().isEmpty()){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n inputFileds.removeAll(txtDOB,txtMobile,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().length()>30){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Sorry the text you entered can not be greater that 30 characters\",\"Text too Long\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n if(username.getText().length()>20 || username.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Username has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid input\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n if(pass.getText().isEmpty()){\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n if(pass.getText().length()>20 || pass.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Password has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n SimpleDateFormat yearFormat = new SimpleDateFormat(\"yyyy\");\n try {\n date = dateFormat.parse(txtDOB.getText());\n Calendar cal=Calendar.getInstance();\n int year=Integer.parseInt(yearFormat.format(date));\n if (year <= 1900 || year>cal.get(Calendar.YEAR)) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n String initialEntry=txtDOB.getText();\n String parsedValue=dateFormat.format(date);\n if(!initialEntry.equals(parsedValue)){\n Dialog.showMessageDialog(owner, \"Note your Date of Birth has been corrected\", \"Date Corrected\",DialogIcon.INFORMATION);\n }\n txtDOB.setText(dateFormat.format(date));\n } catch (ParseException ex) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n try {\n int mobile=Integer.parseInt(txtMobile.getText());\n } catch (NumberFormatException e) {\n Dialog.showMessageDialog(owner, \"Invalid Mobile Number\", \"Invalid data\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n if(txtMobile.getText().length() != 10){\n Dialog.showMessageDialog(owner, \"Sorry your Mobile Number is invalid\", \"Invalid input\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n String sql=\"select Username,Password from users where Username=?\";\n try(PreparedStatement prstmt=con.prepareStatement(sql)) {\n prstmt.setString(1, username.getText());\n ResultSet rs=prstmt.executeQuery();\n if(rs.next()){\n Dialog.showMessageDialog(owner, \"Sorry Username already exists\\n Please change to different Username\", \"Username Exists\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n rs.close();\n } catch (SQLException e) {\n System.err.println(e);\n }\n return true;\n }", "UserPayment validate(String cardHolderName,String cardType,String securityCode,String paymentType);", "public void setAccountNo(String accountNo) {\n this.accountNo = accountNo;\n }", "private String verifyAccount(String number){\n\t\t\n\t\tif(databaseAccess.verifyAccountNumber(number) == true){\n\t\t\t\n\t\t\tthis.examinedAccount = databaseAccess.getAccountByNumber(number);\n\t\t\t\n\t\t\treturn \"ok\";\n\t\t}\n\t\t\n\t\treturn Languages.getMessages().get(chosenLanguage).get(\"wrongCard\");\n\t}", "void validate(N ndcRequest, ErrorsType errorsType);", "@Test\n\tpublic void testCase1()\n\t{\n\t\tint numberOfCases=3;\n\t\t\n\t\t//checking number of case is positive or not\n\t\tboolean valid=BillEstimation.numberOfCaseValidation(numberOfCases);\n\t\tassertTrue(valid);\n\t}", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "private void validateFields(){\n String email = edtEmail.getText().toString().trim();\n String number=edtPhone.getText().toString().trim();\n String cc=txtCountryCode.getText().toString();//edtcc.getText().toString().trim();\n String phoneNo=cc+number;\n // Check for a valid email address.\n\n\n if (TextUtils.isEmpty(email)) {\n mActivity.showSnackbar(getString(R.string.error_empty_email), Toast.LENGTH_SHORT);\n return;\n\n } else if (!Validation.isValidEmail(email)) {\n mActivity.showSnackbar(getString(R.string.error_title_invalid_email), Toast.LENGTH_SHORT);\n return;\n\n }\n\n if(TextUtils.isEmpty(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_empty_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n if(!Validation.isValidMobile(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_title_invalid_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n\n if(selectedCurrency==null){\n //mActivity.showSnackbar(getString(R.string.str_select_currency), Toast.LENGTH_SHORT);\n Snackbar.make(getView(),\"Currency data not found!\",Snackbar.LENGTH_LONG)\n .setAction(\"Try again\", new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n getAllCurrency();\n }\n }).show();\n return;\n }\n try {\n JsonObject object = new JsonObject();\n object.addProperty(KEY_EMAIL, email);\n object.addProperty(KEY_PHONE,phoneNo);\n object.addProperty(KEY_CURRENCY,selectedCurrency.getId().toString());\n updateUser(object,token);\n }catch (Exception e){\n\n }\n\n }", "@Test\r\n\tpublic void testReceiverAccountNumberEmpty() {\r\n\t\tAccountTransferRequest accountTransferRequest = new AccountTransferRequest();\r\n\t\taccountTransferRequest.setUsername(VALID_USERNAME);\r\n\t\taccountTransferRequest.setPassword(VALID_PASSWORD);\r\n\t\taccountTransferRequest.setSenderAccount(VALID_SENDER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setReceiverAccount(\"\");\r\n\t\taccountTransferRequest.setTransferAmount(400.0);\t\t\r\n\t\ttry {\r\n\t\t\ttransferValidationUnit.validate(accountTransferRequest);\r\n\t\t\tAssert.fail(\"Exception_Expected\");\r\n\t\t} catch (ValidationException exception) {\r\n\t\t\tAssert.assertNotNull(exception);\r\n\t\t\tAssert.assertEquals(\"Receiver_Account_Cannot_Be_Null_Or_Empty\", exception.getMessage());\r\n\r\n\t\t}\r\n\t}", "public void validateRpd3s12()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "public void validate_the_Package_Status_in_Customer_Account_Summary_of_Customer_Tab(String PackageStatus)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Package Status\").replaceAll(\"M_InnerText\", PackageStatus), \"Package Status - \"+PackageStatus, false);\n\t}", "@Test\n\tpublic void testCase2()\n\t{\n\t\tint numberOfCases=-1;\n\t\t\n\t\t//checking number of case is positive or not\n\t\tboolean valid=BillEstimation.numberOfCaseValidation(numberOfCases);\n\t\tassertFalse(valid);\n\t\t\n\t}", "public PaymentRequestPage paymentRequestPaymentAvailabilityValidation(String cashbackType,String cashbackValue,String rewardsValue) {\r\n\r\n\t\tString actual = \"\";\r\n\r\n\t\treportStep(\"About to validate the Cashback and Rewards Payment avilablity section in the payment Request page \", \"INFO\");\r\n\r\n\t\tswitch (cashbackType) {\r\n\r\n\t\tcase \"Only_Cashback\":\r\n\r\n\t\t\tvalidateTheElementPresence(cashbackAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, cashbackValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"Only_Rewards\":\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, rewardsValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase \"BothCashback_Rewards\":\r\n\r\n\t\t\tfloat cashbackAmount = Float.parseFloat(cashbackValue);\r\n\t\t\tfloat rewardsAmount = Float.parseFloat(rewardsValue);\r\n\t\t\tfloat totalAmount = cashbackAmount + rewardsAmount ;\r\n\r\n\t\t\tString strTotalAmount = Float.toString(totalAmount) + \"0\";\r\n\t\t\tString strOnlyCashbackAmount = Float.toString(cashbackAmount) + \"0\";\r\n\t\t\tString strOnlyRewardsAmount = Float.toString(rewardsAmount) + \"0\";\r\n\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\t\t\tvalidateTheElementPresence(cashbackText);\r\n\t\t\tvalidateTheElementPresence(rewardsText);\r\n\r\n\t\t\t//validate total cashback amount\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strTotalAmount);\r\n\r\n\t\t\t//validate only cashback amount\r\n\t\t\tactual = getText(cashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyCashbackAmount);\r\n\r\n\r\n\t\t\t//validate only rewards amount\r\n\t\t\tactual = getText(rewardsAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyRewardsAmount);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\r\n\t}", "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validateTxns(final Transaxtion txnList[]) throws TaskFailedException {\n\t\tif (txnList.length < 2)\n\t\t\treturn false;\n\t\tdouble dbAmt = 0;\n\t\tdouble crAmt = 0;\n\t\ttry {\n\t\t\tfor (final Transaxtion element : txnList) {\n\t\t\t\tfinal Transaxtion txn = element;\n\t\t\t\tif (!validateGLCode(txn))\n\t\t\t\t\treturn false;\n\t\t\t\tdbAmt += Double.parseDouble(txn.getDrAmount());\n\t\t\t\tcrAmt += Double.parseDouble(txn.getCrAmount());\n\t\t\t}\n\t\t} finally {\n\t\t\tRequiredValidator.clearEmployeeMap();\n\t\t}\n\t\tdbAmt = ExilPrecision.convertToDouble(dbAmt, 2);\n\t\tcrAmt = ExilPrecision.convertToDouble(crAmt, 2);\n\t\tif (LOGGER.isInfoEnabled())\n\t\t\tLOGGER.info(\"Total Checking.....Debit total is :\" + dbAmt + \" Credit total is :\" + crAmt);\n\t\tif (dbAmt != crAmt)\n\t\t\tthrow new TaskFailedException(\"Total debit and credit not matching. Total debit amount is: \" + dbAmt\n\t\t\t\t\t+ \" Total credit amount is :\" + crAmt);\n\t\t// return false;\n\t\treturn true;\n\t}", "private void checkInvalidInformation(EditPlanDirectToManaged editPlanPage) throws Exception {\n //\n Reporter.log(\"Verifying Error Messages on Edit Plan Page\", true);\n editPlanPage.invalidEditPlanUpdate();\n softAssert.assertTrue(editPlanPage.verifyEditPlanErrorMessage());\n\n //Re-Enter correct details\n editPlanPage.updateAnnualHouseHoldincome(Constants.DEFAULT_ANNUAL_HOUSEHOLD_INCOME);\n editPlanPage.updateRetirementAge(Constants.DEFAULT_RETIREMENT_AGE + \"\");\n }", "private void validateDetails() {\n\n clearErrors();\n Utils.hide_keyboard(getActivity());\n\n boolean valid = true;\n\n String cvv = cvvTv.getText().toString();\n String expiryDate = cardExpiryTv.getText().toString();\n String cardNo = cardNoTv.getText().toString();\n\n if (cvv.length() < 3) {\n valid = false;\n cvvTil.setError(\"Enter a valid cvv\");\n }\n\n if (expiryDate.length() != 5) {\n cardExpiryTil.setError(\"Enter a valid expiry date\");\n valid = false;\n }\n\n String cardNoStripped = cardNo.replaceAll(\"\\\\s\", \"\");\n\n if (cardNoStripped.length() < 12 ) {\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n else {\n try {\n Long parsed = Long.parseLong(cardNoStripped);\n }\n catch (Exception e) {\n e.printStackTrace();\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n }\n\n if (valid) {\n\n if (saveCardSwitch.isChecked()) {\n int cardLen = cardNoStripped.length();\n cardFirst6 = cardNoStripped.substring(0, 6);\n cardLast4 = cardNoStripped.substring(cardLen - 4, cardLen);\n shouldISaveThisCard = true;\n presenter.savePotentialCardDets(cardFirst6, cardLast4);\n }\n\n //make request\n PayloadBuilder builder = new PayloadBuilder();\n builder.setAmount(thetellerInitializer.getAmount() + \"\")\n .setNarration(thetellerInitializer.getNarration())\n .setCardno(cardNoStripped)\n .set3dUrl(thetellerInitializer.get3dUrl())\n .setEmail(thetellerInitializer.getEmail())\n .setCurrency(thetellerInitializer.getCurrency())\n .setMerchant_id(thetellerInitializer.getMerchant_id())\n .setCvv(cvv).setFirstname(thetellerInitializer.getfName())\n .setLastname(thetellerInitializer.getlName())\n .setIP(Utils.getDeviceImei(getActivity()))\n .setTxRef(thetellerInitializer.getTxRef())\n .setExpiryyear(expiryDate.substring(3,5))\n .setExpirymonth(expiryDate.substring(0,2))\n .setMeta(thetellerInitializer.getMeta())\n .setApiUser(thetellerInitializer.getApiUser())\n .setApiKey(thetellerInitializer.getApiKey())\n .setDevice_fingerprint(Utils.getDeviceImei(getActivity()))\n .setCardType(cardType);\n\n if (thetellerInitializer.getPayment_plan() != null) {\n builder.setPaymentPlan(thetellerInitializer.getPayment_plan());\n }\n\n body = builder.createPayload();\n\n presenter.chargeCard(body, thetellerConstants.API_KEY);\n }\n }", "private boolean validateVisa() {\r\n\t\tString creditCardNumber = getCreditCardNumber();\r\n\t\t// checking the card number length\r\n\t\tif (creditCardNumber.length() != 13 && creditCardNumber.length() != 16 && creditCardNumber.length() != 19) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// checking the validity of the credit card number\r\n\t\tif (creditCardNumber.charAt(0) != '4') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Given(\"^valid fields and making a GET request to account_ID then it should return a (\\\\d+) and a body of customer ID details$\")\n\tpublic void valid_fields_and_making_a_GET_request_to_account_ID_then_it_should_return_a_and_a_body_of_customer_ID_details(int StatusCode) throws Throwable {\n\t\tGetId.GET_account_id_ValidFieldsProvided();\n\t\ttry{}catch(Exception e){}\n\t}", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "public ErrorMessage verifyCode(String code, Integer year, Long exception);", "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "@Test\n public void test10020ATS001ValidationofDatefieldsinPayHistory() throws Exception {\n driver.get(\"http://Clarity\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_UserNameTextBox\")).clear();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_UserNameTextBox\")).sendKeys(\"02.08.09\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_PasswordTextBox\")).clear();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_PasswordTextBox\")).sendKeys(\"password\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_LoginButton\")).click();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_btnLogin\")).click();\n //driver.findElement(By.linkText(\"Select\")).click();\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*How much is my pension[\\\\s\\\\S][\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).clear();\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).sendKeys(\"02/10/20\");\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*Start date is later than end date\\\\.[\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).clear();\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).sendKeys(\"25/07/2017\");\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).clear();\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate\")).clear();\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate\")).sendKeys(\"02/10/2\");\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).sendKeys(\"02/10/2\");\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton\")).click();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton']\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*End Date is not recognized as a valid date\\\\.[\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate']\")).clear();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate']\")).sendKeys(\"21221\\\"\\\"\\\"\");\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).clear();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).sendKeys(\"wewe\\\"\\\"\\\"\");\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton']\")).click();\n Thread.sleep(1000);\n //try {\n //assertTrue(driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDateTypeValidator\")).getText().matches(\"^exact:[\\\\s\\\\S]*$\"));\n //} catch (Error e) {\n // verificationErrors.append(e.toString());\n //}\n // ERROR: Caught exception [Error: locator strategy either id or name must be specified explicitly.]\n driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_LoginStatus\")).click();\n }", "public void SetCreditCarddetails(String ccnumber, String ccname, String ccmonth, String ccyear, String ccseccode){\r\n\t\tString countrygroup_ccdetails= \"UK,PresselAustria\";\r\n\t\tString CCnum = getValue(ccnumber);\r\n\t\tString CCName = getValue(ccname);\r\n\t\tString CCMonth = getValue(ccmonth);\r\n\t\tString CCYear = getValue(ccyear);\r\n\t\tString CCSecCode = getValue(ccseccode);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+CCnum+\", \"+CCName+\", \"+CCMonth+\", \"+CCYear+\", \"+CCSecCode);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The CreditCard details should be entered\");\r\n\t\ttry{\r\n\t\t\tif(!(countrygroup_ccdetails).contains(countries.get(countrycount))){\r\n\t\t\t\tswitchframe(\"TokenizationPage\");\r\n\t\t\t\tsleep(2000);\r\n\t\t\t\tsendKeys(locator_split(\"txtCCnumber\"), CCnum);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCname\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCname\"), CCName);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCMonth\"), CCMonth);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCYear\"), CCYear);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCcode\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCcode\"), CCSecCode);\t\t\t\t\t\t\r\n\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The CreditCard details are entered\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The new CreditCard details are applicable to this \" +country);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- The CreditCard details are not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"One of the element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCnumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCname\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCMonth\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCYear\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCcode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" are not found\");\r\n\r\n\t\t}\r\n\t}", "@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyfiftyAcctsviewValidatation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify whether proper error message is diplayed when accounts added more than 50 on clicking the confirm button\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMvManageView\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ManageViews()\n\t\t.FiftyAcctsViewnameErrorValidation(userProfile); \t \t\t\t\t\t\t \t \t\t\t \t \t \t\t\t\t\t\t \t \t\t\n\t}", "public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "@Test\n\tpublic void testValidate()\n\t{\n\t\tSystem.out.println(\"validate\");\n\t\tUserTypeCode userTypeCode = new UserTypeCode();\n\t\tuserTypeCode.setCode(\"Test\");\n\t\tuserTypeCode.setDescription(\"Test\");\n\n\t\tValidationModel validateModel = new ValidationModel(userTypeCode);\n\t\tvalidateModel.setConsumeFieldsOnly(true);\n\n\t\tValidationResult result = ValidationUtil.validate(validateModel);\n\t\tSystem.out.println(\"Any Valid consume: \" + result.toString());\n\t\tif (result.valid() == false) {\n\t\t\tAssert.fail(\"Failed validation when it was expected to pass.\");\n\t\t}\n\t\tSystem.out.println(\"---------------------------\");\n\n\t\tvalidateModel = new ValidationModel(userTypeCode);\n\t\tresult = ValidationUtil.validate(validateModel);\n\t\tSystem.out.println(\"Faild: \" + result.toString());\n\t}", "public static Sale validateSale(TextField billno, LocalDate startdate, ComboBox customername, TextField nextdate, String onekgQty, String twokgQty, String fourkgQty, String fivekgQty, String sixkgQty, String ninekgQty, String onekgAmt, String twokgAmt, String fourkgAmt, String fivekgAmt, String sixkgAmt, String ninekgAmt, TextField amount) {\r\n Sale sale = new Sale();\r\n try {\r\n if (billno.getText().isEmpty() || startdate == null || customername.getValue() == null || nextdate.getText().isEmpty() || amount.getText().isEmpty()) {\r\n new PopUp(\"Error\", \"Field is Empty\").alert();\r\n } else {\r\n sale = new Sale();\r\n Date ndd = new SimpleDateFormat(\"dd-MM-yyyy\").parse(nextdate.getText());\r\n java.sql.Date nd = new java.sql.Date(ndd.getTime());\r\n sale.setBillno(Integer.valueOf(billno.getText()));\r\n sale.setStartdate(java.sql.Date.valueOf(startdate));\r\n sale.setShopname(customername.getValue().toString());\r\n sale.setNextdate(nd);\r\n if (onekgQty == null) {\r\n onekgQty = \"0\";\r\n }\r\n if (twokgQty == null) {\r\n twokgQty = \"0\";\r\n }\r\n if (fourkgQty == null) {\r\n fourkgQty = \"0\";\r\n }\r\n if (fivekgQty == null) {\r\n fivekgQty = \"0\";\r\n }\r\n if (sixkgQty == null) {\r\n sixkgQty = \"0\";\r\n }\r\n if (ninekgQty == null) {\r\n ninekgQty = \"0\";\r\n }\r\n sale.setOnekgqty(Integer.valueOf(onekgQty));\r\n sale.setTwokgqty(Integer.valueOf(twokgQty));\r\n sale.setFourkgqty(Integer.valueOf(fourkgQty));\r\n sale.setFivekgqty(Integer.valueOf(fivekgQty));\r\n sale.setSixkgqty(Integer.valueOf(sixkgQty));\r\n sale.setNinekgqty(Integer.valueOf(ninekgQty));\r\n if (onekgAmt == null) {\r\n onekgAmt = \"0.00\";\r\n }\r\n if (twokgAmt == null) {\r\n twokgAmt = \"0.00\";\r\n }\r\n if (fourkgAmt == null) {\r\n fourkgAmt = \"0.00\";\r\n }\r\n if (fivekgAmt == null) {\r\n fivekgAmt = \"0.00\";\r\n }\r\n if (sixkgAmt == null) {\r\n sixkgAmt = \"0.00\";\r\n }\r\n if (ninekgAmt == null) {\r\n ninekgAmt = \"0.00\";\r\n }\r\n sale.setOnekgamount(BigDecimal.valueOf(Double.valueOf(onekgAmt)));\r\n sale.setTwokgamount(BigDecimal.valueOf(Double.valueOf(twokgAmt)));\r\n sale.setFourkgamount(BigDecimal.valueOf(Double.valueOf(fourkgAmt)));\r\n sale.setFivekgamount(BigDecimal.valueOf(Double.valueOf(fivekgAmt)));\r\n sale.setSixkgamount(BigDecimal.valueOf(Double.valueOf(sixkgAmt)));\r\n sale.setNinekgamount(BigDecimal.valueOf(Double.valueOf(ninekgAmt)));\r\n sale.setAmount(BigDecimal.valueOf(Double.valueOf(amount.getText())));\r\n\r\n }\r\n } catch (ParseException error) {\r\n error.printStackTrace();\r\n }\r\n return sale;\r\n }", "void validate();", "void validate();", "public void validate_the_Package_Name_in_Customer_Account_Summary_of_Customer_Tab(String PackageName)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Package Name\").replaceAll(\"M_InnerText\", PackageName), \"Package Name - \"+PackageName, false);\n\t}", "private void check1(){\n \n\t\tif (firstDigit != 4){\n valid = false;\n errorCode = 1;\n }\n\t}", "public void validateRpd15s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "@Given(\"^valid fields and making a GET request to account_ID_info then it should return a (\\\\d+) and a body of customer info details$\")\n\tpublic void valid_fields_and_making_a_GET_request_to_account_ID_info_then_it_should_return_a_and_a_body_of_customer_info_details(int StatusCode) throws Throwable {\n\t\tGetInfo.GET_account_id_info_ValidFieldsProvided();\n\t try{}catch(Exception e){}\n\t}", "public void validateCreditNumber(FacesContext ctx, UIComponent component,\r\n\t\t\tObject value) throws ValidatorException {\n\t\tCreditCardType ccType = (CreditCardType)creditCardTypeInput.getValue();\r\n\t\tBoolean useCC = customer.getUseCreditCard();\r\n if (useCC != null && useCC && ccType != null) {\r\n\t\t\t// Check credit card number\r\n\t\t\tint length;\r\n\t\t\tif (ccType == CreditCardType.CARD_A) {\r\n\t\t\t\tlength = 4;\r\n\t\t\t} else {\r\n\t\t\t\tlength = 5;\r\n\t\t\t}\r\n String ccNumber = (String)value;\r\n\t\t\tif (ccNumber != null && !ccNumber.matches(\"\\\\d{\" + length + \"}\")) {\r\n FacesMessage msg = GuiUtil.getFacesMessage(\r\n ctx, FacesMessage.SEVERITY_ERROR, \"validateCreditCardNumber.NUMBER\", length);\r\n\t\t\t\tthrow new ValidatorException(msg);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void interestRate_Validation() {\n\t\thelper.assertString(interestRate_AftrLogin(), payOffOffer.interestRate_BfrLogin());\n\t\tSystem.out.print(\"The Interest Rate is: \" + interestRate_AftrLogin());\n\t}", "private void batchValidate() {\n lblIdError.setText(CustomValidator.validateLong(fieldId));\n lblNameError.setText(CustomValidator.validateString(fieldName));\n lblAgeError.setText(CustomValidator.validateInt(fieldAge));\n lblWageError.setText(CustomValidator.validateDouble(fieldWage));\n lblActiveError.setText(CustomValidator.validateBoolean(fieldActive));\n }", "private void validateUpdateCustomers(List<CustomersInputDTO> customers, String formatDate) {\n // inner validate\n if (customers == null || customers.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(ConstantsCustomers.CUSTOMERS, Constants.RIQUIRED_CODE));\n }\n // validate common\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n List<Map<String, Object>> customParams = new ArrayList<>();\n customers.forEach(cus -> {\n Map<String, Object> customField = new HashMap<>();\n customField.put(\"rowId\", cus.getCustomerId());\n customField.putAll(buildParamsValidateCustomersInput(cus, jsonBuilder));\n customParams.add(customField);\n });\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n customParams, formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n List<Map<String, Object>> listValidate = CustomersCommonUtil.validateCommon(validateJson, restOperationUtils,\n token, tenantName);\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public boolean validDeclineCodeAndAmount() {\n\t\tint amount, declineCode;\n\t\ttry {\n\t\t\tamount = Integer.parseInt(txtApprovalAmount.getText());\n\t\t\tdeclineCode = Integer.parseInt(txtDeclineCode.getText());\n\t\t\tif (declineCode < 0 || declineCode > Integer.parseInt(Initializer.getBaseVariables().bitfield39UpperLimit)\n\t\t\t\t\t|| txtDeclineCode.getText().length() > Initializer.getBitfieldData().bitfieldLength\n\t\t\t\t\t\t\t.get(Initializer.getBaseConstants().nameOfbitfield39)) {\n\t\t\t\tlogger.error(\"Entered decline code is invalid. Valid range is 0 - \"\n\t\t\t\t\t\t+ Initializer.getBaseVariables().bitfield39UpperLimit);\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Entered decline code is invalid. Valid range is 0 - \"\n\t\t\t\t\t\t+ Initializer.getBaseVariables().bitfield39UpperLimit);\n\t\t\t\treturn false;\n\t\t\t} else if (txtApprovalAmount.getText().length() > Initializer.getBitfieldData().bitfieldLength\n\t\t\t\t\t.get(Initializer.getBaseConstants().nameOfbitfield4)) {\n\t\t\t\tlogger.error(\"Entered amount is invalid.\");\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Entered amount is invalid.\");\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\tlogger.error(\"Only valid range of numbers should be entered for decline code and Amount\");\n\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\"Only valid range of numbers should be entered for decline code and Amount\");\n\t\t\treturn false;\n\t\t}\n\t}", "public void validateRpd13s9()\n {\n // This guideline cannot be automatically tested.\n }", "@Override\r\n\tpublic CreditCardType validate(String ccNumber) \r\n\t\t\tthrows NullPointerException, IllegalArgumentException \r\n\t{\t\r\n\t\tSharedUtil.checkIfNulls(\"Null credit card number\", ccNumber);\r\n\t\tccNumber = SharedStringUtil.trimOrNull(ccNumber);\r\n\t\tccNumber = ccNumber.replaceAll(\"[ -]\", \"\");\r\n\t\t\r\n \tif (ccNumber.matches(pattern))\r\n \t{\r\n \t\treturn this;\r\n \t}\r\n \t\t\r\n \tthrow new IllegalArgumentException(\"Invalid Credit Card Type \" + ccNumber);\r\n\t\t\r\n\t}", "@Test\n public void testValidateDuplicateAccountsDifferentAccount() {\n // Same account\n Long accountId = 123l;\n BankAccount bankAccountRequest = new BankAccountImpl();\n bankAccountRequest.setAccountId(accountId);\n Locale locale = Locale.getDefault();\n ErrorMessageResponse errorMessageResponse = new ErrorMessageResponse();\n List<BankAccount> bankAccountList = new ArrayList<>();\n\n // ACCOUNT HELD BY DIFFERENT CUSTOMER\n BankAccount bankAccount = new BankAccountImpl();\n bankAccount.setAccountId(accountId);\n bankAccount.setActivatedDate(new Date());\n bankAccountList.add(bankAccount);\n\n // Older activation means it will not be first in the list\n bankAccount = new BankAccountImpl();\n bankAccount.setAccountId(12345l);\n bankAccount.setActivatedDate(new Date(new Date().getTime() - 1000));\n bankAccountList.add(bankAccount);\n\n BankHelper\n .validateDuplicateAccounts(bankAccountRequest, locale, errorMessageResponse, bankAccountList, account);\n assertTrue(errorMessageResponse.hasErrors());\n }" ]
[ "0.6781862", "0.66707194", "0.64093554", "0.6367719", "0.6123507", "0.6088029", "0.60660833", "0.59787095", "0.59024054", "0.59024054", "0.58645934", "0.57487184", "0.5739208", "0.57379836", "0.5733053", "0.5730071", "0.57260114", "0.5704133", "0.5677036", "0.5675466", "0.56577176", "0.56540686", "0.565143", "0.56410146", "0.56307214", "0.5602903", "0.559239", "0.5577773", "0.5575661", "0.5573106", "0.5572", "0.5561957", "0.556135", "0.555423", "0.5544116", "0.55322355", "0.55204165", "0.55104566", "0.54990244", "0.5491765", "0.54891175", "0.5481912", "0.5481325", "0.5472321", "0.5462712", "0.5450403", "0.54503775", "0.54463077", "0.54418397", "0.5436803", "0.54334205", "0.5429881", "0.54278", "0.5427304", "0.5411508", "0.5405718", "0.5399683", "0.53982025", "0.5390832", "0.5390751", "0.5372057", "0.5371835", "0.5371765", "0.5371104", "0.53705335", "0.53694147", "0.53644586", "0.53643507", "0.5362245", "0.5359564", "0.53477544", "0.53464615", "0.5345316", "0.53402954", "0.53392434", "0.5334068", "0.5332158", "0.5331415", "0.5326113", "0.5322018", "0.5316354", "0.53137094", "0.5313155", "0.53047746", "0.5303399", "0.53010225", "0.53010225", "0.52996045", "0.5299556", "0.528448", "0.5284235", "0.5280887", "0.52804637", "0.5279682", "0.5276432", "0.52721006", "0.5266427", "0.52655715", "0.5261801", "0.5254239" ]
0.72829735
0
Validation Functions Description : To validate the Account Status in Customer Account Summary of Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:25 Oct 2016 Modified By:Rajan Parameter:AccountStatus
public void validate_the_Account_Status_in_Customer_Account_Summary_of_Customer_Tab(String AccountStatus)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll("M_Header", "Landline Account Summary").replaceAll("M_Category", "Account Status").replaceAll("M_InnerText", AccountStatus), "Account Status - "+AccountStatus, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Package_Status_in_Customer_Account_Summary_of_Customer_Tab(String PackageStatus)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Package Status\").replaceAll(\"M_InnerText\", PackageStatus), \"Package Status - \"+PackageStatus, false);\n\t}", "boolean validateAccount(String Account) {\n\t\treturn true;\n\n\t}", "public void validate_the_Account_Number_in_Customer_Account_Summary_of_Customer_Tab(String AccountNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Account Number\").replaceAll(\"M_InnerText\", AccountNumber), \"Account Number - \"+AccountNumber, false);\n\t\tReport.fnReportPageBreak(\"Customer Account Summary\", driver);\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "public void validateoLPNStatus(String strLPNStatus){ \t\t\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"StatisticsTab\"), \"StatisticsTab\");\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"oLPNsTab\"), \"oLPNsTab\");\n\t\tif(libManhattanCommonFunctions.verifyElementPresent(\"//span[@id='dataForm:dataLstTbl:_colhdr_id1']\", \"XPATH\")){\n\t\t\ttry{\n\t\t\t\tString actualLPNStatus = libManhattanCommonFunctions.getElementByProperty(\"//span[@id='dataForm:dataLstTbl:_colhdr_id1']\", \"XPATH\").getText();\n\n\t\t\t\tif(actualLPNStatus.trim().equals(strLPNStatus))\n\t\t\t\t{\n\t\t\t\t\treport.updateTestLog(\"oLPN Status verification\", \"Actual oLPn status : \"+actualLPNStatus+ \" is verified\", Status.PASS);\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\treport.updateTestLog(\"oLPN Status verification\", \"Expected oLPN status :\"+strLPNStatus+\" || Actual oLPN status : \"+actualLPNStatus, Status.FAIL);\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\treport.updateTestLog(\"Element\", \"Element Not Found\", Status.FAIL);\n\t\t\t}\n\t\t}else{\n\t\t\treport.updateTestLog(\"oLPN Status\", \"oLPN is not created\", Status.FAIL);\n\t\t}\n\n\t}", "boolean isValidStatus();", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderStatus getStatus();", "io.opencannabis.schema.commerce.CommercialOrder.OrderStatus getStatus();", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "public boolean isAccountValid(String accountNumber, BankFusionEnvironment env) {\n boolean isAccountValid = false;\n errorMessage = CommonConstants.EMPTY_STRING;\n try {\n IBOAttributeCollectionFeature accValues = (IBOAttributeCollectionFeature) env.getFactory().findByPrimaryKey(\n IBOAttributeCollectionFeature.BONAME, accountNumber);\n isAccountValid = true;\n BusinessValidatorBean accountValidator = new BusinessValidatorBean();\n if (accountValidator.validateAccountClosed(accValues, env)) {\n isAccountValid = false;\n errorMessage = accountValidator.getErrorMessage().getLocalisedMessage();\n }\n else if (accountValidator.validateAccountStopped(accValues, env)) {\n isAccountValid = false;\n errorMessage = accountValidator.getErrorMessage().getLocalisedMessage();\n }\n\n }\n catch (FinderException exception) {\n errorMessage = \"Invalid Main Account\";\n }\n catch (BankFusionException exception) {\n errorMessage = \"Invalid Main Account\";\n }\n\n return isAccountValid;\n }", "public void validateUIStatus() {\n\n boolean timeZoneCheck = false, timeFormatCheck = false, fetchTimeCheck = false, statusPathCheck = false;\n\n if (!timeZone.getText().isEmpty()) {\n timeZoneCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Time zone should not be Empty.\\n\");\n }\n if (!statusPath.getText().isEmpty()) {\n statusPathCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Status File should not be empty.\\n\");\n }\n if (!fetchTime.getText().isEmpty()) {\n fetchTimeCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". UI Refresh Time should not be empty.\\n\");\n }\n if (!timeFormat.getText().isEmpty()) {\n timeFormatCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". UI Date & Time format should not be Empty.\\n\");\n }\n\n if (timeFormatCheck == true && timeZoneCheck == true && fetchTimeCheck == true && statusPathCheck == true) {\n uiStatusCheck = true;\n } else {\n\n uiStatusCheck = false;\n timeZoneCheck = false;\n timeFormatCheck = false;\n fetchTimeCheck = false;\n statusPathCheck = false;\n }\n }", "@Test\r\n\tpublic void view3_todays_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"CML Service Level\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table2 = driver.findElements(view3_todays_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table2 = driver.findElements(By.xpath(view3_today_data_table));\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table2, data_of_table2 );\r\n\t}", "@Test\r\n\tpublic void view3_current_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Columns\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t//Removing Column data from another table.\r\n\t\tdata_of_table1 = helper.modify_cols_data_of_table(col_of_table1, data_of_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table1, data_of_table1 );\r\n\t}", "private boolean validate(Map<String,String> requestMap){\r\n\t\tboolean result = false;\r\n\t\tString zip = requestMap.get(PublicAPIConstant.ZIP);\r\n\t\tString soStatus = requestMap.get(PublicAPIConstant.SO_STATUS);\r\n\t\tList<String> soStatusList = new ArrayList<String>();\r\n\r\n\t\tif (null != soStatus) {\r\n\t\t\tStringTokenizer strTok = new StringTokenizer(\r\n\t\t\t\t\tsoStatus,\r\n\t\t\t\t\tPublicAPIConstant.SEPARATOR, false);\r\n\t\t\tint noOfStatuses = strTok.countTokens();\r\n\t\t\tfor (int i = 1; i <= noOfStatuses; i++) {\r\n\t\t\t\tsoStatusList.add(new String(strTok\r\n\t\t\t\t\t\t.nextToken()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tInteger pageSize = Integer.parseInt(requestMap.get(\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET));\r\n\t\t\r\n\t\tif(null!=zip&&zip.length() != 5){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.ZIP);\r\n\t\t\treturn result;\t\r\n\t\t}\r\n\t\tList<Integer> pageSizeSetValues = Arrays.asList(\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_10,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_20,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_50,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_100,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_200,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_500);\t\t\r\n\t\tif(!pageSizeSetValues.contains(pageSize)){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET);\r\n\t\t\treturn result;\t\r\n\t\t}\t\r\n\t\t\r\n\t\tList<String> soStatusValues = Arrays.asList(\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_POSTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_ACCEPTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_ACTIVE,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_CLOSED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_COMPLETED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_DRAFTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_PROBLEM,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_EXPIRED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_PENDINGCANCEL\r\n\t\t);\t\t\r\n\t\tif(!soStatusValues.containsAll(soStatusList)){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.SO_STATUS_SET);\r\n\t\t\treturn result;\t\r\n\t\t}\t\r\n\t\tresult = true;\r\n\t\treturn result;\r\n\t}", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public PaymentRequestPage paymentRequestPaymentAvailabilityValidation(String cashbackType,String cashbackValue,String rewardsValue) {\r\n\r\n\t\tString actual = \"\";\r\n\r\n\t\treportStep(\"About to validate the Cashback and Rewards Payment avilablity section in the payment Request page \", \"INFO\");\r\n\r\n\t\tswitch (cashbackType) {\r\n\r\n\t\tcase \"Only_Cashback\":\r\n\r\n\t\t\tvalidateTheElementPresence(cashbackAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, cashbackValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"Only_Rewards\":\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, rewardsValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase \"BothCashback_Rewards\":\r\n\r\n\t\t\tfloat cashbackAmount = Float.parseFloat(cashbackValue);\r\n\t\t\tfloat rewardsAmount = Float.parseFloat(rewardsValue);\r\n\t\t\tfloat totalAmount = cashbackAmount + rewardsAmount ;\r\n\r\n\t\t\tString strTotalAmount = Float.toString(totalAmount) + \"0\";\r\n\t\t\tString strOnlyCashbackAmount = Float.toString(cashbackAmount) + \"0\";\r\n\t\t\tString strOnlyRewardsAmount = Float.toString(rewardsAmount) + \"0\";\r\n\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\t\t\tvalidateTheElementPresence(cashbackText);\r\n\t\t\tvalidateTheElementPresence(rewardsText);\r\n\r\n\t\t\t//validate total cashback amount\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strTotalAmount);\r\n\r\n\t\t\t//validate only cashback amount\r\n\t\t\tactual = getText(cashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyCashbackAmount);\r\n\r\n\r\n\t\t\t//validate only rewards amount\r\n\t\t\tactual = getText(rewardsAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyRewardsAmount);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\r\n\t}", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "void validate(N ndcRequest, ErrorsType errorsType);", "private void validateData() {\n }", "void validateTransactionForPremiumWorksheet(Record inputRecord, Connection conn);", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "@Test(groups ={Slingshot,Regression})\n\tpublic void EditViewLessthan15AcctsErrorValidation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify whether proper error message is displayed in view when continuing with out enabling the accounts check box\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMvManageView\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t\t.clicktestacct();\n\t\t/*.ClickManageUserLink()\n\t\t.ManageViews()\n\t\t.VerifyEditviewname(userProfile)\n\t\t.EditViewNameErrorValidation(userProfile); \t \t\t\t\t\t\t \t \t\t\n\t}*/\n\t}", "public void validate() {}", "@Test\r\n\tpublic void view3_COEs_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\t\t//Table 3 - Data .\r\n\t\tList<WebElement> data_of_table3 = driver.findElements(view3_COEs_table_data_val);\r\n\t\t//Table 3 - Columns\r\n\t\tList<WebElement> col_of_table3 = driver.findElements(By.xpath(view3_curr_agent_stats_col));\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> updated_col_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t\r\n\t\t//Adding Column data from another table.\r\n\t\tdata_of_table3 = helper.modify_cols_data_of_table(col_of_table1, data_of_table3, updated_col_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table3, data_of_table3 );\r\n\t}", "ValidationResponse validate();", "public void validateTaskStatus(String strTaskStatus){\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"StatisticsTab\"), \"StatisticsTab\");\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"TasksTab\"), \"TasksTab\");\n\t\tif(libManhattanCommonFunctions.verifyElementPresent(\"//span[@id='dataForm:tskLstTbl:_colhdr_id1']\", \"XPATH\")){\n\t\t\tString actualTaskStatus = libManhattanCommonFunctions.getElementByProperty(\"//span[@id='dataForm:tskLstTbl:_colhdr_id1']\", \"XPATH\").getText();\n\t\t\ttry{\n\t\t\t\tif(actualTaskStatus.trim().equals(strTaskStatus))\n\t\t\t\t{\n\t\t\t\t\treport.updateTestLog(\"Task Status verification\", \"Actual task status : \"+actualTaskStatus+ \" is verified\", Status.PASS);\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\treport.updateTestLog(\"Task Status verification\", \"Expected task status :\"+strTaskStatus+\" || Actual task status : \"+actualTaskStatus, Status.FAIL);\n\t\t\t\t}\n\n\t\t\t}catch(Exception e){\n\t\t\t\treport.updateTestLog(\"Element\", \"Element Not Found\", Status.FAIL);\n\t\t\t}\n\t\t}else{\n\t\t\treport.updateTestLog(\"Task Status\", \"Task is not created\", Status.FAIL);\n\t\t}\n\n\t}", "public boolean validateAccountNumber() {\n\t\tif (!this.setAccountNumber(this.account))\n\t\t\treturn false;\n\t\treturn this.getAccountNumber().length() > 0 && this.getAccountNumber().length() <= 11;\n\t}", "private void validateListOfStatus( ActionMapping pMapping, HttpServletRequest pRequest )\n {\n setQCClosedDefectStatus( getQCClosedDefectStatus().trim() );\n if ( getQCClosedDefectStatus().length() == 0 )\n {\n addError( \"QCClosedDefectStatus\", new ActionError( \"project_creation.QC.testmanager.error.closedDefects\" ) );\n }\n setQCCoveredReqStatus( getQCCoveredReqStatus().trim() );\n if ( getQCCoveredReqStatus().length() == 0 )\n {\n addError( \"QCCoveredReqStatus\", new ActionError( \"project_creation.QC.testmanager.error.coveredReq\" ) );\n }\n setQCOkRunStatus( getQCOkRunStatus().trim() );\n if ( getQCOkRunStatus().length() == 0 )\n {\n addError( \"QCOkRunStatus\", new ActionError( \"project_creation.QC.testmanager.error.okRun\" ) );\n }\n setQCOpenedReqStatus( getQCOpenedReqStatus().trim() );\n if ( getQCOpenedReqStatus().length() == 0 )\n {\n addError( \"QCOpenedReqStatus\", new ActionError( \"project_creation.QC.testmanager.error.openedReq\" ) );\n }\n setQCPassedStepStatus( getQCPassedStepStatus().trim() );\n if ( getQCPassedStepStatus().length() == 0 )\n {\n addError( \"QCPassedStepStatus\", new ActionError( \"project_creation.QC.testmanager.error.passedStep\" ) );\n }\n setQCToValidateReqStatus( getQCToValidateReqStatus().trim() );\n if ( getQCToValidateReqStatus().length() == 0 )\n {\n addError( \"QCToValidateReqStatus\", new ActionError( \"project_creation.QC.testmanager.error.toValidateReq\" ) );\n }\n }", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "@Test(groups ={Slingshot,Regression})\n\tpublic void ValidateAcctCheckbox() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify whether proper error message is displayed when continuing with out enabling the accounts check box\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMvManageView\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ManageViews()\t \t\t\t\t\t \t \t\t\t\t \t \t\t\n\t\t.ValidateCheckboxerror(userProfile);\t \t \t\t\n\t}", "@Test\n public void test10020ATS001ValidationofDatefieldsinPayHistory() throws Exception {\n driver.get(\"http://Clarity\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_UserNameTextBox\")).clear();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_UserNameTextBox\")).sendKeys(\"02.08.09\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_PasswordTextBox\")).clear();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_PasswordTextBox\")).sendKeys(\"password\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_LoginButton\")).click();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_btnLogin\")).click();\n //driver.findElement(By.linkText(\"Select\")).click();\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*How much is my pension[\\\\s\\\\S][\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).clear();\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).sendKeys(\"02/10/20\");\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*Start date is later than end date\\\\.[\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).clear();\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).sendKeys(\"25/07/2017\");\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).clear();\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate\")).clear();\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate\")).sendKeys(\"02/10/2\");\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).sendKeys(\"02/10/2\");\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton\")).click();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton']\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*End Date is not recognized as a valid date\\\\.[\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate']\")).clear();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate']\")).sendKeys(\"21221\\\"\\\"\\\"\");\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).clear();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).sendKeys(\"wewe\\\"\\\"\\\"\");\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton']\")).click();\n Thread.sleep(1000);\n //try {\n //assertTrue(driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDateTypeValidator\")).getText().matches(\"^exact:[\\\\s\\\\S]*$\"));\n //} catch (Error e) {\n // verificationErrors.append(e.toString());\n //}\n // ERROR: Caught exception [Error: locator strategy either id or name must be specified explicitly.]\n driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_LoginStatus\")).click();\n }", "@PostMapping(\"/validate\")\r\n\tpublic ValidateOrderResponse validate(@RequestBody ValidateOrderRequest validateOrderRequest) {\n\t\tString updatedGSXML = validateOrderRequest.getInputDoc().replaceAll(\"xmlns=\\\\\\\"\\\\\\\"\", \"\");\r\n\r\n\t\tBiztalk1 gsxml = XmlObjectUtil.getGSXMLObjFromXML(updatedGSXML);\r\n\r\n\t\tValidateOrderResponse validateOrderResponse = new ValidateOrderResponse();\r\n\r\n\t\t// logic to validate gsxml starts here\r\n\r\n\t\t// logic to validate gsxml ends here\r\n\t\t\r\n\t\tif(isValidCustomer(gsxml))\r\n\t\t{\r\n\t\t\tvalidateOrderResponse.setOutputDoc(XmlObjectUtil.getXMLStringFromGSXMLObj(gsxml));\r\n\t\t\tvalidateOrderResponse.setStatusCode(\"200\");\r\n\t\t\tvalidateOrderResponse.setStatusDesc(\"Order validated successfuly\");\r\n\t\t\treturn validateOrderResponse;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t\r\n\t\t\t validateOrderResponse.setStatusDesc(\"Customer Not Found\");\r\n\t\t\t validateOrderResponse.setStatusCode(\"511\");\r\n\t\t\t return validateOrderResponse;\r\n\t\t}\r\n\t}", "@Test\r\n\tpublic void testValidationSuccess() {\r\n\t\tAccountTransferRequest accountTransferRequest = new AccountTransferRequest();\r\n\t\taccountTransferRequest.setUsername(VALID_USERNAME);\r\n\t\taccountTransferRequest.setPassword(VALID_PASSWORD);\r\n\t\taccountTransferRequest.setSenderAccount(VALID_SENDER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setReceiverAccount(VALID_RECEIVER_ACCOUNT_NUMBER);\r\n\t\taccountTransferRequest.setTransferAmount(400.0);\t\t\r\n\t\ttry {\r\n\t\t\ttransferValidationUnit.validate(accountTransferRequest);\r\n\t\t} catch (ValidationException e) {\r\n\t\t\tAssert.fail(\"Found_Exception\");\r\n\t\t}\r\n\t}", "public List<Message> verifyTransaction(Transaction t) {\n LOG.debug(\"verifyTransaction() started\");\n\n // List of error messages for the current transaction\n List<Message> errors = new ArrayList();\n\n // Check the chart of accounts code\n if (t.getChart() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_CHART_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the account\n if (t.getAccount() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_ACCOUNT_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the object type\n if (t.getObjectType() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_OBJECT_TYPE_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the balance type\n if (t.getBalanceType() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_BALANCE_TYPE_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the fiscal year\n if (t.getOption() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_UNIV_FISCAL_YR_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the debit/credit code (only if we have a valid balance type code)\n if (t.getTransactionDebitCreditCode() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_DEDIT_CREDIT_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n else {\n if (t.getBalanceType() != null) {\n if (t.getBalanceType().isFinancialOffsetGenerationIndicator()) {\n if ((!OLEConstants.GL_DEBIT_CODE.equals(t.getTransactionDebitCreditCode())) && (!OLEConstants.GL_CREDIT_CODE.equals(t.getTransactionDebitCreditCode()))) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_DEDIT_CREDIT_CODE_MUST_BE) + \" '\" + OLEConstants.GL_DEBIT_CODE + \" or \" + OLEConstants.GL_CREDIT_CODE + kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_FOR_BALANCE_TYPE), Message.TYPE_FATAL));\n }\n }\n else {\n if (!OLEConstants.GL_BUDGET_CODE.equals(t.getTransactionDebitCreditCode())) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_DEDIT_CREDIT_CODE_MUST_BE) + OLEConstants.GL_BUDGET_CODE + kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_FOR_BALANCE_TYPE), Message.TYPE_FATAL));\n }\n }\n }\n }\n\n // KULGL-58 Make sure all GL entry primary key fields are not null\n if ((t.getSubAccountNumber() == null) || (t.getSubAccountNumber().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_SUB_ACCOUNT_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialObjectCode() == null) || (t.getFinancialObjectCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_OBJECT_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialSubObjectCode() == null) || (t.getFinancialSubObjectCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_SUB_OBJECT_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getUniversityFiscalPeriodCode() == null) || (t.getUniversityFiscalPeriodCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_FISCAL_PERIOD_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialDocumentTypeCode() == null) || (t.getFinancialDocumentTypeCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_DOCUMENT_TYPE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialSystemOriginationCode() == null) || (t.getFinancialSystemOriginationCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_ORIGIN_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getDocumentNumber() == null) || (t.getDocumentNumber().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_DOCUMENT_NUMBER_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n \n // Don't need to check SequenceNumber because it sets in PosterServiceImpl, so commented out\n// if (t.getTransactionLedgerEntrySequenceNumber() == null) {\n// errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_SEQUENCE_NUMBER_NOT_BE_NULL), Message.TYPE_FATAL));\n// }\n \n if (t.getBalanceType() != null && t.getBalanceType().isFinBalanceTypeEncumIndicator() && !t.getObjectType().isFundBalanceIndicator()){\n if (t.getTransactionEncumbranceUpdateCode().trim().equals(GeneralLedgerConstants.EMPTY_CODE)){\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_ENCUMBRANCE_UPDATE_CODE_CANNOT_BE_BLANK_FOR_BALANCE_TYPE) + \" \" + t.getFinancialBalanceTypeCode(), Message.TYPE_FATAL));\n }\n }\n\n // The encumbrance update code can only be space, N, R or D. Nothing else\n if ((StringUtils.isNotBlank(t.getTransactionEncumbranceUpdateCode())) && (!\" \".equals(t.getTransactionEncumbranceUpdateCode())) && (!OLEConstants.ENCUMB_UPDT_NO_ENCUMBRANCE_CD.equals(t.getTransactionEncumbranceUpdateCode())) && (!OLEConstants.ENCUMB_UPDT_REFERENCE_DOCUMENT_CD.equals(t.getTransactionEncumbranceUpdateCode())) && (!OLEConstants.ENCUMB_UPDT_DOCUMENT_CD.equals(t.getTransactionEncumbranceUpdateCode()))) {\n errors.add(new Message(\"Invalid Encumbrance Update Code (\" + t.getTransactionEncumbranceUpdateCode() + \")\", Message.TYPE_FATAL));\n }\n\n \n\n return errors;\n }", "private void validateUpdateCustomers(List<CustomersInputDTO> customers, String formatDate) {\n // inner validate\n if (customers == null || customers.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(ConstantsCustomers.CUSTOMERS, Constants.RIQUIRED_CODE));\n }\n // validate common\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n List<Map<String, Object>> customParams = new ArrayList<>();\n customers.forEach(cus -> {\n Map<String, Object> customField = new HashMap<>();\n customField.put(\"rowId\", cus.getCustomerId());\n customField.putAll(buildParamsValidateCustomersInput(cus, jsonBuilder));\n customParams.add(customField);\n });\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n customParams, formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n List<Map<String, Object>> listValidate = CustomersCommonUtil.validateCommon(validateJson, restOperationUtils,\n token, tenantName);\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public String validates() {\n this.sr = this.m_oCompany.getServiceRecords();\n if(this.sr.validatesService(this.m_oService)){\n return String.format(m_oService.toString());\n }\n return String.format(\"Invalid service.\");\n }", "private void formatData(AccountVO acct, Row r) {\n\t\tint cellCnt = 0;\n\t\tString name = StringUtil.checkVal(acct.getRep().getFirstName()) + \" \" + StringUtil.checkVal(acct.getRep().getLastName());\n\t\tcreateStringCell(r, name, cellCnt++);\n\t\tcreateStringCell(r, acct.getRep().getTerritoryId(), cellCnt++);\n\t\tcreateStringCell(r, acct.getRep().getSampleAccountNo(), cellCnt++);\n\t\tcreateStringCell(r, acct.getAccountName(), cellCnt++);\n\t\tcreateStringCell(r, acct.getAccountNo(), cellCnt++);\n\t\tcreateStringCell(r, acct.getPhysicians().size(), cellCnt++);\n\t\tcreateStringCell(r, acct.getUnitCount(), cellCnt++);\n\n\t\t//iterated the transactions and classify by status\n\t\tint pending = 0, approved = 0, complete = 0, denied = 0;\n\t\tfor (TransactionVO v : acct.getTransactions()) {\n\t\t\tswitch (v.getStatus()) {\n\t\t\t\tcase PENDING:\n\t\t\t\t\t++pending;\n\t\t\t\t\tbreak;\n\t\t\t\tcase APPROVED:\n\t\t\t\t\t++approved;\n\t\t\t\t\tbreak;\n\t\t\t\tcase COMPLETE:\n\t\t\t\t\t++complete;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DECLINED:\n\t\t\t\t\t++denied;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tStringBuilder sts = new StringBuilder(100);\n\t\tif (pending > 0) sts.append(pending).append(\" Pending<br/>\\r\");\n\t\tif (approved > 0) sts.append(approved).append(\" Approved<br/>\\r\");\n\t\tif (complete > 0) sts.append(complete).append(\" Completed<br/>\\r\");\n\t\tif (denied > 0) sts.append(denied).append(\" Denied\");\n\t\tcreateStringCell(r, sts.toString(), cellCnt++);\n\n\t\tcreateStringCell(r, acct.getAccountPhoneNumber(), cellCnt++);\n\t\tcreateStringCell(r, acct.getAccountAddress(), cellCnt++);\n\t\tcreateStringCell(r, acct.getAccountAddress2(), cellCnt++);\n\t\tcreateStringCell(r, acct.getAccountCity(), cellCnt++);\n\t\tcreateStringCell(r, acct.getAccountState(), cellCnt++);\n\t\tcreateStringCell(r, acct.getAccountZipCode(), cellCnt++);\n\t\tcreateStringCell(r, acct.getAccountCountry(), cellCnt++);\n\t}", "public void validateUserListTable() throws Exception {\n\t\tlog.info(\"Started ----- Validate for UserListTable -----\");\n\t\tAddUser.getText();\n\t\tFirstNameText.getText();\n\t\tLastNameText.getText();\n\t\tUserNameText.getText();\n\t\tCustomerText.getText();\n\t\tRoleText.getText();\n\t\tEmailText.getText();\n\t\tCellPhoneText.getText();\n\t\tLockedText.getText();\n\n\t\tString actualadduser = AddUser.getText();\n\t\tString expectedadduser = \"Add User\";\n\t\tString actualfirstname = FirstNameText.getText();\n\t\tString expectedfirstname = \"First Name\";\n\t\tString actuallastname = LastNameText.getText();\n\t\tString expectedlastname = \"Last Name\";\n\t\tString actualusername = UserNameText.getText();\n\t\tString expectedusername = \"User Name\";\n\t\tString actualcustomer = CustomerText.getText();\n\t\tString expectedcustomer = \"Customer\";\n\t\tString actualroletext = RoleText.getText();\n\t\tString expectedroletext = \"Role\";\n\t\tString actualemail = EmailText.getText();\n\t\tString expectedemail = \"E-mail\";\n\t\tString actualcellphone = CellPhoneText.getText();\n\t\tString expectedcellphone = \"Cell Phone\";\n\t\tString actuallocked = LockedText.getText();\n\t\tString expectedlocked = \"Locked\";\n\n\t\tAssert.assertEquals(actualadduser, expectedadduser);\n\t\tAssert.assertEquals(actualfirstname, expectedfirstname);\n\t\tAssert.assertEquals(actuallastname, expectedlastname);\n\t\tAssert.assertEquals(actualusername, expectedusername);\n\t\tAssert.assertEquals(actualcustomer, expectedcustomer);\n\t\tAssert.assertEquals(actualroletext, expectedroletext);\n\t\tAssert.assertEquals(actualemail, expectedemail);\n\t\tAssert.assertEquals(actualcellphone, expectedcellphone);\n\t\tAssert.assertEquals(actuallocked, expectedlocked);\n\n\t\tSystem.out.println(\"Both Actual and Expected texts are equal:\" + actualadduser);\n\t\tSystem.out.println(\"Both Actual and Expected texts are equal :\" + actualfirstname);\n\t\tSystem.out.println(\"Both Actual and Expected texts are equal :\" + actuallastname);\n\t\tSystem.out.println(\"Both Actual and Expected texts are equal :\" + actualusername);\n\t\tSystem.out.println(\"Both Actual and Expected texts are equal :\" + actualcustomer);\n\t\tSystem.out.println(\"Both Actual and Expected texts are equal :\" + actualroletext);\n\t\tSystem.out.println(\"Both Actual and Expected texts are equal :\" + actualemail);\n\t\tSystem.out.println(\"Both Actual and Expected texts are equal :\" + actualcellphone);\n\t\tSystem.out.println(\"Both Actual and Expected texts are equal :\" + actuallocked);\n\t\tlog.info(\"Ended ----- Validate for UserListTable -----\");\n\t}", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "abstract void fiscalCodeValidity();", "private boolean validateData() {\n if (!mCommon.validateData()) return false;\n\n Core core = new Core(this);\n\n // Due Date is required\n if (TextUtils.isEmpty(getRecurringTransaction().getDueDateString())) {\n core.alert(R.string.due_date_required);\n return false;\n }\n\n if (TextUtils.isEmpty(mCommon.viewHolder.dateTextView.getText().toString())) {\n core.alert(R.string.error_next_occurrence_not_populate);\n\n return false;\n }\n\n // Payments Left must have a value\n if (getRecurringTransaction().getPaymentsLeft() == null) {\n core.alert(R.string.payments_left_required);\n return false;\n }\n return true;\n }", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public fbStatusPostingValidation() {\n\t\tsuper();\t\n\t}", "private void batchValidate() {\n lblIdError.setText(CustomValidator.validateLong(fieldId));\n lblNameError.setText(CustomValidator.validateString(fieldName));\n lblAgeError.setText(CustomValidator.validateInt(fieldAge));\n lblWageError.setText(CustomValidator.validateDouble(fieldWage));\n lblActiveError.setText(CustomValidator.validateBoolean(fieldActive));\n }", "private boolean isFormValid(AdminAddEditUserDTO dto)\r\n\t{\n\t\tSOWError error;\r\n\t\tList<IError> errors = new ArrayList<IError>();\t\t\r\n\t\t\r\n\t\t// First Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getFirstName()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_First_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_First_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\t// Last Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getLastName()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Last_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Last_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\t\r\n\t\t// User Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getUsername()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_User_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\telse\r\n\t\t{\t\r\n\t\t\t//User Name Length Check\r\n\t\t\tif((dto.getUsername().length() < 8) || (dto.getUsername().length() >30)){\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"),getTheResourceBundle().getString(\"Admin_User_Name_Length_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString jobRole = getParameter(\"jobRole\");\r\n\t\tif(\"-1\".equals(jobRole))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Job_Role\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Job_Role_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Handle Primary Email\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getEmail()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Email\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isEmailValid(dto.getEmail()) == false)\r\n\t\t\t{\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_PrimaryEmail\"),\r\n\t\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Pattern_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if(dto.getEmail().equals(dto.getEmailConfirm()) == false)\r\n\t\t\t{\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_PrimaryEmail\"),\r\n\t\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Confirm_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Check for existing username, only in Add mode\r\n\t\tString mode = (String)getSession().getAttribute(\"addEditUserMode\");\r\n\t\tif(mode != null)\r\n\t\t{\r\n\t\t\tif(mode.equals(\"add\"))\r\n\t\t\t{\r\n\t\t\t\tif(manageUsersDelegate.getAdminUser(dto.getUsername()) != null || manageUsersDelegate.getBuyerUser(dto.getUsername()) != null)\r\n\t\t\t\t{\r\n\t\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"), getTheResourceBundle().getString(\"Admin_Existing_User_Validation_Msg1\")+\" \" + dto.getUsername() +\" \" +getTheResourceBundle().getString(\"Admin_Existing_User_Validation_Msg2\"), OrderConstants.FM_ERROR);\r\n\t\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// If we have errors, put them in request.\r\n\t\tif(errors.size() > 0)\r\n\t\t{\r\n\t\t\tsetAttribute(\"errors\", errors);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tgetSession().removeAttribute(\"addEditUserMode\");\r\n\t\t\tgetSession().removeAttribute(\"originalUsername\");\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "private void checkInvalidInformation(EditPlanDirectToManaged editPlanPage) throws Exception {\n //\n Reporter.log(\"Verifying Error Messages on Edit Plan Page\", true);\n editPlanPage.invalidEditPlanUpdate();\n softAssert.assertTrue(editPlanPage.verifyEditPlanErrorMessage());\n\n //Re-Enter correct details\n editPlanPage.updateAnnualHouseHoldincome(Constants.DEFAULT_ANNUAL_HOUSEHOLD_INCOME);\n editPlanPage.updateRetirementAge(Constants.DEFAULT_RETIREMENT_AGE + \"\");\n }", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "@Test\n\tpublic void testValidate()\n\t{\n\t\tSystem.out.println(\"validate\");\n\t\tUserTypeCode userTypeCode = new UserTypeCode();\n\t\tuserTypeCode.setCode(\"Test\");\n\t\tuserTypeCode.setDescription(\"Test\");\n\n\t\tValidationModel validateModel = new ValidationModel(userTypeCode);\n\t\tvalidateModel.setConsumeFieldsOnly(true);\n\n\t\tValidationResult result = ValidationUtil.validate(validateModel);\n\t\tSystem.out.println(\"Any Valid consume: \" + result.toString());\n\t\tif (result.valid() == false) {\n\t\t\tAssert.fail(\"Failed validation when it was expected to pass.\");\n\t\t}\n\t\tSystem.out.println(\"---------------------------\");\n\n\t\tvalidateModel = new ValidationModel(userTypeCode);\n\t\tresult = ValidationUtil.validate(validateModel);\n\t\tSystem.out.println(\"Faild: \" + result.toString());\n\t}", "private int completionCheck() {\n if (nameTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(1);\n return -1;\n }\n if (addressTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(2);\n return -1;\n }\n if (postCodeTB.getText().trim().isEmpty()){\n AlertMessage.addCustomerError(3);\n return -1;\n }\n if (countryCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(4);\n return -1;\n }\n if (stateProvinceCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(5);\n return -1;\n }\n if (phone.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(6);\n return -1;\n }\n return 1;\n }", "@Test (groups = {\"smokeTest\"})\n public void checkTheStatusOfItem() {\n purchases.switchTab(\"Incoming Products\");\n List<WebElement> statusValues = $$(byXpath(\"//td[@class='o_data_cell o_readonly_modifier']\"));\n int totalNumOfStatusValues = statusValues.size();\n //System.out.println(\"The total number of status values: \" + totalNumOfStatusValues);\n int counter =0;\n for (WebElement statusValue : statusValues) {\n String statusText=statusValue.getText();\n counter++;\n Assert.assertTrue((statusText.equals(\"Available\")||statusText.equals(\"Waiting Availability\")) && (!statusText.isEmpty()), \"The status of an item is not displayed.\");\n }\n //System.out.println(\"The number of status values found by counter: \" + counter);\n Assert.assertEquals(totalNumOfStatusValues, counter, \"The total number of status values doesn't match with counter.\");\n\n\n }", "@Override\n public Boolean validate() throws EwpException {\n List<String> message = new ArrayList<String>();\n Map<EnumsForExceptions.ErrorDataType, String[]> dicError = new HashMap<EnumsForExceptions.ErrorDataType, String[]>();\n if (this.name == null) {\n message.add(AppMessage.NAME_REQUIRED);\n dicError.put(EnumsForExceptions.ErrorDataType.REQUIRED, new String[]{\"Name\"});\n }\n\n if (this.tenantStatus <= 0) {\n message.add(AppMessage.TENANT_STATUS_REQUIRED);\n dicError.put(EnumsForExceptions.ErrorDataType.REQUIRED, new String[]{\"Status\"});\n }\n if (message.isEmpty()) {\n return true;\n } else {\n throw new EwpException(new EwpException(\"Validation Exception in TENANT\"), EnumsForExceptions.ErrorType.VALIDATION_ERROR, message, EnumsForExceptions.ErrorModule.DATA_SERVICE, dicError, 0);\n }\n }", "public boolean isValid() {\n\t\tString status = getField(Types.STATUS);\n\t\tif(status == null) return false;\n\t\treturn StringUtil.equalsIgnoreCase(status,\"A\") && !loc.isNull();\n\t}", "void validate();", "void validate();", "private void updateAccountStatus() {\n\r\n }", "private boolean validateTxns(final Transaxtion txnList[]) throws TaskFailedException {\n\t\tif (txnList.length < 2)\n\t\t\treturn false;\n\t\tdouble dbAmt = 0;\n\t\tdouble crAmt = 0;\n\t\ttry {\n\t\t\tfor (final Transaxtion element : txnList) {\n\t\t\t\tfinal Transaxtion txn = element;\n\t\t\t\tif (!validateGLCode(txn))\n\t\t\t\t\treturn false;\n\t\t\t\tdbAmt += Double.parseDouble(txn.getDrAmount());\n\t\t\t\tcrAmt += Double.parseDouble(txn.getCrAmount());\n\t\t\t}\n\t\t} finally {\n\t\t\tRequiredValidator.clearEmployeeMap();\n\t\t}\n\t\tdbAmt = ExilPrecision.convertToDouble(dbAmt, 2);\n\t\tcrAmt = ExilPrecision.convertToDouble(crAmt, 2);\n\t\tif (LOGGER.isInfoEnabled())\n\t\t\tLOGGER.info(\"Total Checking.....Debit total is :\" + dbAmt + \" Credit total is :\" + crAmt);\n\t\tif (dbAmt != crAmt)\n\t\t\tthrow new TaskFailedException(\"Total debit and credit not matching. Total debit amount is: \" + dbAmt\n\t\t\t\t\t+ \" Total credit amount is :\" + crAmt);\n\t\t// return false;\n\t\treturn true;\n\t}", "@Given(\"^valid fields and making a GET request to account_ID then it should return a (\\\\d+) and a body of customer ID details$\")\n\tpublic void valid_fields_and_making_a_GET_request_to_account_ID_then_it_should_return_a_and_a_body_of_customer_ID_details(int StatusCode) throws Throwable {\n\t\tGetId.GET_account_id_ValidFieldsProvided();\n\t\ttry{}catch(Exception e){}\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "ch.crif_online.www.webservices.crifsoapservice.v1_00.ComplianceCheckResult getComplianceCheckResult();", "@Override\n\tpublic void validate() {\n\t\tif(name==null||name.trim().equals(\"\")){\n\t\t\taddActionError(\"用户必须填写!\");\n\t\t}\n\t\t\n\t\tList l=new ArrayList();\n\t\tl=userService.QueryByTabId(\"Xxuser\", \"id\", id);\n\t\t//判断是否修改\n\t\tif(l.size()!=0){\n\t\t\t\n\t\t\tfor(int i=0;i<l.size();i++){\n\t\t\t\tXxuser xxuser=new Xxuser();\n\t\t\t\txxuser=(Xxuser)l.get(i);\n\t\t\t\tif(xxuser.getName().equals(name.trim())){\n\t\t\t\t\tSystem.out.println(\"mei gai\");\n\t\t\t\t}else{\n\t\t\t\t\tList n=new ArrayList();\n\t\t\t\t\tn=userService.QueryByTab(\"Xxuser\", \"name\", name);\n\t\t\t\t\tif(n.size()!=0){\n\t\t\t\t\t\taddActionError(\"该用户已经存在!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\n\t\t\t\n\t\t}\n\t}", "public void validate(DataRecord value) {\n\r\n\t}", "protected void validate(String operationType) throws Exception\r\n\t{\r\n\t\tsuper.validate(operationType);\r\n\r\n\t\tMPSString id_validator = new MPSString();\r\n\t\tid_validator.validate(operationType, id, \"\\\"id\\\"\");\r\n\t\t\r\n\t\tMPSBoolean secure_access_only_validator = new MPSBoolean();\r\n\t\tsecure_access_only_validator.validate(operationType, secure_access_only, \"\\\"secure_access_only\\\"\");\r\n\t\t\r\n\t\tMPSString svm_ns_comm_validator = new MPSString();\r\n\t\tsvm_ns_comm_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);\r\n\t\tsvm_ns_comm_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tsvm_ns_comm_validator.validate(operationType, svm_ns_comm, \"\\\"svm_ns_comm\\\"\");\r\n\t\t\r\n\t\tMPSString ns_br_interface_validator = new MPSString();\r\n\t\tns_br_interface_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);\r\n\t\tns_br_interface_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tns_br_interface_validator.validate(operationType, ns_br_interface, \"\\\"ns_br_interface\\\"\");\r\n\t\t\r\n\t\tMPSBoolean vm_auto_poweron_validator = new MPSBoolean();\r\n\t\tvm_auto_poweron_validator.validate(operationType, vm_auto_poweron, \"\\\"vm_auto_poweron\\\"\");\r\n\t\t\r\n\t\tMPSString ns_br_interface_2_validator = new MPSString();\r\n\t\tns_br_interface_2_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);\r\n\t\tns_br_interface_2_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tns_br_interface_2_validator.validate(operationType, ns_br_interface_2, \"\\\"ns_br_interface_2\\\"\");\r\n\t\t\r\n\t\tMPSInt init_status_validator = new MPSInt();\r\n\t\tinit_status_validator.validate(operationType, init_status, \"\\\"init_status\\\"\");\r\n\t\t\r\n\t}", "@Override\n\tpublic void validate() {\n\t\t if(pname==null||pname.toString().equals(\"\")){\n\t\t\t addActionError(\"父项节点名称必填!\");\n\t\t }\n\t\t if(cname==null||cname.toString().equals(\"\")){\n\t\t\t addActionError(\"子项节点名称必填!\");\n\t\t }\n\t\t if(caction==null||caction.toString().equals(\"\")){\n\t\t\t addActionError(\"子项节点动作必填!\");\n\t\t }\n\t\t \n\t\t List l=new ArrayList();\n\t\t\tl=userService.QueryByTabId(\"Resfun\", \"resfunid\", resfunid);\n\t\t\t//判断是否修改\n\t\t\tif(l.size()!=0){\n\t\t\t\t\n\t\t\t\tfor(int i=0;i<l.size();i++){\n\t\t\t\t\tResfun rf=new Resfun();\n\t\t\t\t\trf=(Resfun)l.get(i);\n\t\t\t\t\tif(rf.getCaction().equals(caction.trim())&&rf.getCname().equals(cname)&&rf.getPname().equals(pname)){\n\t\t\t\t\t\tSystem.out.println(\"mei gai\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tList n=new ArrayList();\n\t\t\t\t\t\tn=userService.QueryByPcac(\"Resfun\", \"pname\", pname, \"cname\", cname, \"caction\", caction);\n\t\t\t\t\t\tif(n.size()!=0){\n\t\t\t\t\t\t\taddActionError(\"该记录已经存在!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t \n\t\t \n\t\t \n\t\t \n\t}", "@Given(\"^valid fields and making a GET request to account_ID_billing then it should return a (\\\\d+) and a body of customer billing details$\")\n\tpublic void valid_fields_and_making_a_GET_request_to_account_ID_billing_then_it_should_return_a_and_a_body_of_customer_billing_details(int StatusCode) throws Throwable {\n\t\tGetBilling.GET_account_id_billing_ValidFieldsProvided();\n\t try{}catch(Exception e){}\n\t}", "public Iterator<String> validate() {\r\n\t\tValidityReport vr = ONT_MODEL.validate();\r\n\t\t\r\n\t\tCollection<String> reports = new ArrayList<String>();\r\n\t\t\r\n\t\tfor(Iterator riter = vr.getReports(); riter.hasNext();)\r\n\t\t{\r\n\t\t\tValidityReport.Report r = (ValidityReport.Report)riter.next();\r\n\t\t\tString msg =\"\";\r\n\t\t\tif(r.isError())\r\n\t\t\t\tmsg += \"[ERROR]\";\r\n\t\t\telse\r\n\t\t\t\tmsg += \"[WARNING]\";\r\n\t\t\tmsg+=\"[\"+r.getType()+\"]\";\r\n\t\t\tmsg+=r.getDescription();\r\n\t\t\treports.add(msg);\r\n\t\t}\r\n\t\t\r\n\t\treturn reports.iterator();\r\n\t}", "private boolean accountChecks(Account account){\n // ie. if the account has to be personal for the round-up service to apply\n account.getName(); // check personal\n return true;\n }", "@Given(\"^valid fields and making a GET request to account_ID_info then it should return a (\\\\d+) and a body of customer info details$\")\n\tpublic void valid_fields_and_making_a_GET_request_to_account_ID_info_then_it_should_return_a_and_a_body_of_customer_info_details(int StatusCode) throws Throwable {\n\t\tGetInfo.GET_account_id_info_ValidFieldsProvided();\n\t try{}catch(Exception e){}\n\t}", "public boolean checkAccountStatus(String myAppName) {\n\t\tLog.info(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='adminTable2 ']\"));\n\t\tLog.info(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Inactive\") && myAccountField.getText().contains(strDate)) {\n\t\t\tLog.info(\"current account status for app\" + myAppName + \"is inactive\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tLog.info(\"current account status for app\" + myAppName + \"is active\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "private static void checkStatus() {\n\r\n\t\tDate date = new Date();\r\n\t\tSystem.out.println(\"Checking at :\"+date.toString());\r\n\t\tString response = \"\";\r\n\t\ttry {\r\n\t\t\tresponse = sendGET(GET_URL_COVAXIN);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t//System.out.println(response.toString());\r\n\t\tArrayList<Map> res = formatResponse(response);\r\n\r\n\t\tres = checkAvailability(res);\r\n\t\tif(res.size()>0)\r\n\t\t\tnotifyUser(res);\r\n\t\t//System.out.println(emp.toString());\r\n\t}", "public void validate_the_Marketing_preferences_in_Contact_Details_of_Customer_Tab(String type,String i)throws Exception {\n\t\t\t\n\t\t\tboolean checked= false;\n\t\t\tboolean status= false;\n\t\t\ttry {\n\t\t\t\tchecked = VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Marketing preferences\").replaceAll(\"M_InnerText\", type), \"Marketing preferences on \"+type);\n\t\t\t\t\n\t\t\t\tif(i.equalsIgnoreCase(\"1\"))\n\t\t\t\t\tstatus=true;\n\t\t\t\telse\n\t\t\t\t\tstatus=false;\n\t\t\t} catch (NullPointerException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tfinally\n\t\t\t{\n\t\t\tif(checked==status)\n\t\t\t\tReport.fnReportPass(\"Marketing preferences - \"+type+\" : Checked status = \"+status+\"\tDisplay Status\"+checked, driver);\n\t\t\t\telse\n\t\t\t\tReport.fnReportFail(\"Marketing preferences - \"+type+\" : Checked status = \"+status+\"\tDisplay Status\"+checked, driver);\n\t\t\t\n\t\t\t}\n\t}", "@Test\n\tpublic void testCase1()\n\t{\n\t\tint numberOfCases=3;\n\t\t\n\t\t//checking number of case is positive or not\n\t\tboolean valid=BillEstimation.numberOfCaseValidation(numberOfCases);\n\t\tassertTrue(valid);\n\t}", "public void ValidationData() {\n try {\n ConnectionClass connectionClass = new ConnectionClass();\n connect = connectionClass.CONN();\n if (connect == null) {\n ConnectionResult = \"Check your Internet Connection\";\n } else {\n String query = \"Select No from machinestatustest where Line='\" + Line + \"' and Station = '\" + Station + \"'\";\n Statement stmt = connect.createStatement();\n ResultSet rs = stmt.executeQuery(query);\n if (rs.next()) {\n Validation = rs.getString(\"No\");\n }\n ConnectionResult = \"Successfull\";\n connect.close();\n }\n } catch (Exception ex) {\n ConnectionResult = ex.getMessage();\n }\n }", "public void validate(Object obj, Errors err) {\n\t\tUserLogin userLogin=(UserLogin)obj;\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"fName\", \"fName.emptyOrSpace\");\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"lName\", \"lName.emptyOrSpace\");\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"mailId\", \"mailId.emptyOrSpace\");\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"pass\", \"password.emptyOrSpace\");\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"mob\", \"mob.emptyOrSpace\");\r\n\t\t\r\n\t\t//Business rule related Validation \r\n\t\tif(userLogin.getfName()!=null && userLogin.getfName().trim().length()>0) {\r\n\t\t\tif(userLogin.getfName().trim().length()>20)\r\n\t\t\t\terr.rejectValue(\"fName\", \"fName.length.exceeds\");\r\n\t\t}\r\n\t\t\r\n\t\tif(userLogin.getlName()!=null && userLogin.getlName().trim().length()>0) {\r\n\t\t\tif(userLogin.getlName().trim().length()>10)\r\n\t\t\t\terr.rejectValue(\"lName\", \"lName.length.exceeds\");\r\n\t\t}\r\n\t\t\r\n\t\tif(userLogin.getMob()!=null && userLogin.getMob().trim().length()>0) {\r\n\t\t\tif(userLogin.getMob().trim().length()!=10)\r\n\t\t\t\terr.rejectValue(\"mob\", \"mob.length.exceeds\");\r\n\t\t}\r\n\t\t\r\n\t\tif(userLogin.getMailId()!=null && userLogin.getMailId().trim().length()>0) {\r\n\t\t\tif(userLogin.getMailId().trim().length()>=20 ) {\r\n\t\t\t\terr.rejectValue(\"mailId\", \"mailId.length.exceeds\");\r\n\t\t\t}else if(!userLogin.getMailId().contains(\"@\")) {\r\n\t\t\t\terr.rejectValue(\"mailId\", \"mailId.format.first.rule\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(userLogin.getPass()!=null && userLogin.getPass().trim().length()>0) {\r\n\t\t\tif(userLogin.getPass().trim().length()>=10 ) {\r\n\t\t\t\terr.rejectValue(\"pass\", \"pass.length.exceeds\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t//DB validations\r\n\t\tif(!registerService.validateUser(userLogin)) {\r\n\t\t\terr.rejectValue(\"mailId\", \"mailId.alreadyRegistered\");\r\n\t\t}\r\n\t\t\r\n\t}", "protected void validate(String operationType) throws Exception\r\n\t{\r\n\t\tsuper.validate(operationType);\r\n\r\n\t\tMPSString id_validator = new MPSString();\r\n\t\tid_validator.setConstraintIsReq(MPSConstants.DELETE_CONSTRAINT, true);\r\n\t\tid_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);\r\n\t\tid_validator.validate(operationType, id, \"\\\"id\\\"\");\r\n\t\t\r\n\t\tMPSInt adapter_id_validator = new MPSInt();\r\n\t\tadapter_id_validator.validate(operationType, adapter_id, \"\\\"adapter_id\\\"\");\r\n\t\t\r\n\t\tMPSInt pdcount_validator = new MPSInt();\r\n\t\tpdcount_validator.validate(operationType, pdcount, \"\\\"pdcount\\\"\");\r\n\t\t\r\n\t\tMPSInt ldcount_validator = new MPSInt();\r\n\t\tldcount_validator.validate(operationType, ldcount, \"\\\"ldcount\\\"\");\r\n\t\t\r\n\t}", "@Test(priority=66)\t\n\tpublic void campaign_user_with_valid_filter_for_user_status() throws URISyntaxException, ClientProtocolException, IOException, ParseException{\n\t\ttest = extent.startTest(\"campaign_user_with_valid_filter_for_user_status\", \"To validate whether user is able to get campaign and its users through campaign/user api with valid filter for user_status\");\n\t\ttest.assignCategory(\"CFA GET /campaign/user API\");\n\t\tString[] status = {Constants.ComponentStatus.ACTIVE};\n\t\t\tfor(String user_status: status){\n\t\t\tList<NameValuePair> list = new ArrayList<NameValuePair>();\n\t\t\tlist.add(new BasicNameValuePair(\"filter\", \"user_status%3d\"+user_status));\n\t\t\tCloseableHttpResponse response = HelperClass.make_get_request(\"/v2/campaign/user\", access_token, list);\n\t\t\tAssert.assertTrue(!(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 401), \"Invalid status code is displayed. \"+ \"Returned Status: \"+response.getStatusLine().getStatusCode()+\" \"+response.getStatusLine().getReasonPhrase());\n\t\t\ttest.log(LogStatus.INFO, \"Execute campaign/user api method with valid filter for user_status\");\n\t\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));\n\t\t\tString line = \"\";\n\t\t\twhile ((line = rd.readLine()) != null) {\n\t\t\t // Convert response to JSON object\t\n\t\t\t JSONParser parser = new JSONParser();\n\t\t\t JSONObject json = (JSONObject) parser.parse(line);\n\t\t\t JSONArray array = (JSONArray)json.get(\"data\");\n\t\t\t // Check whether campaign list returns at least 1 record when valid user_status is passed for filter\n\t\t\t for(int i=0; i<array.size(); i++){\n\t\t\t\t // Get the campaign from the campaign list\n\t\t\t\t JSONObject campaign = (JSONObject)array.get(i);\n\t\t\t\t JSONArray users_data = (JSONArray) campaign.get(\"users\");\n\t\t\t\t Boolean user_exist = false;\n\t\t\t\t for(int j=0; j<users_data.size(); j++){\n\t\t\t\t\t JSONObject user = (JSONObject)users_data.get(j);\n\t\t\t\t\t String user_status_val = user.get(\"user_status\").toString();\n\t\t\t\t\t if(user_status_val.equals(user_status))\n\t\t\t\t\t\t user_exist = true;\n\t\t\t\t }\n\t\t\t\t switch (i) {\n\t\t\t\t case 0:\n\t\t\t\t\tif(user_exist == true) \n\t\t\t\t\t\ttest.log(LogStatus.PASS, \"Passed user_status (\"+user_status+\") in filter exists in campaign/user response.\");\n\t\t \t\t\tbreak;\n\t\t\t\t }\n\t\t\t\t Assert.assertTrue(user_exist, \"Passed user_status in filter does not exist in campaign/user response.\");\n\t\t\t }\n\t\t\t} \n\t\t}\n\t}", "public void addAccount() {\n\t\t\n\t\ttry {\n\t\t\tlog.log(Level.INFO, \"Please enter name\");\n String custName = scan.next();\n validate.checkName(custName);\n \t\tlog.log(Level.INFO, \"Select Account Type: \\n 1 for Savings \\n 2 for Current \\n 3 for FD \\n 4 for DEMAT\");\n\t\t\tint bankAccType = Integer.parseInt(scan.next());\n\t\t\tvalidate.checkAccType(bankAccType);\n\t\t\tlog.log(Level.INFO, \"Please Enter your Aadar Card Number\");\n\t\t\tString aadarNumber = scan.next();\n\t\t\tlog.log(Level.INFO, \"Please Enter Phone Number: \");\n\t\t\tString custMobileNo = scan.next();\n\t\t\tvalidate.checkPhoneNum(custMobileNo);\n\t\t\tlog.log(Level.INFO, \"Please Enter Customer Email Id: \");\n\t\t\tString custEmail = scan.next();\n\t\t\tvalidate.checkEmail(custEmail);\n\t\t\tbankop.add(accountNumber, custName, bankAccType, custMobileNo, custEmail, aadarNumber);\n\t\t\taccountNumber();\n\t\t\n\t\t} catch (AccountDetailsException message) {\n\t\t\tlog.log(Level.INFO, message.getMessage()); \n }\n\n\t}", "public account(int acc,int Id,String Atype,double bal ){\n this.accNo = acc;\n this.id = Id;\n this.atype = Atype;\n this.abal = bal;\n }", "@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyfiftyAcctsviewValidatation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify whether proper error message is diplayed when accounts added more than 50 on clicking the confirm button\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMvManageView\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ManageViews()\n\t\t.FiftyAcctsViewnameErrorValidation(userProfile); \t \t\t\t\t\t\t \t \t\t\t \t \t \t\t\t\t\t\t \t \t\t\n\t}", "@Override\n public void verifyDB_SIB_BID_Reg_Referral_Status(List<String> status, String table) {\n\n String condition;\n if (table.equals(\"purchase\")) {\n table = \"purchase_referral\";\n condition = \"create_date > sysdate -.01\";\n }\n else if (table.equals(\"registration\")) {\n table = \"registration_referral\";\n condition = \"customer_id =\" + this.getCustomerIDFromDB(authenticationParameters.getUsername());\n }\n else { //search_referral\n table = \"search_referral\";\n condition = \"search_id =\" + this.getSearchIDFromDB(authenticationParameters.getUsername());\n }\n\n String sql = \"select distinct referral_type, referrer_id, link_id, \" +\n \"version_id, keyword_id, match_type_id \" +\n \" from \" + table + \" where referral_type='\" + status.get(0) + \"'\" +\n \" and \" + condition;\n\n System.out.println(sql);\n Map<String, Object> sqlRowSet = jdbcTemplate.queryForMap(sql);\n\n System.out.println(\"Expected params in DB\" + status.toString());\n System.out.println(\"Actual param in DB\" + sqlRowSet.values().toString());\n assertThat(status.toString())\n .as(\"Transaction data stored in db\")\n .contains(sqlRowSet.values().toString());\n\n //check create date\n sql = \"select create_date \" +\n \" from \" + table + \" where \" + condition +\n \" and referral_type='\" + status.get(0) + \"'\" +\n \" and rownum <= 1\";\n\n\n sqlRowSet = jdbcTemplate.queryForMap(sql);\n DateFormat formatterDate = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date current_date = new Date();\n Date dateDB = (Date) sqlRowSet.get(\"CREATE_DATE\");\n assertThat(dateDB.toString())\n .as(\"Transaction data(CREATE_DATE) stored in db\")\n .contains(formatterDate.format(current_date));\n }", "private void validateFields(){\n String email = edtEmail.getText().toString().trim();\n String number=edtPhone.getText().toString().trim();\n String cc=txtCountryCode.getText().toString();//edtcc.getText().toString().trim();\n String phoneNo=cc+number;\n // Check for a valid email address.\n\n\n if (TextUtils.isEmpty(email)) {\n mActivity.showSnackbar(getString(R.string.error_empty_email), Toast.LENGTH_SHORT);\n return;\n\n } else if (!Validation.isValidEmail(email)) {\n mActivity.showSnackbar(getString(R.string.error_title_invalid_email), Toast.LENGTH_SHORT);\n return;\n\n }\n\n if(TextUtils.isEmpty(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_empty_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n if(!Validation.isValidMobile(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_title_invalid_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n\n if(selectedCurrency==null){\n //mActivity.showSnackbar(getString(R.string.str_select_currency), Toast.LENGTH_SHORT);\n Snackbar.make(getView(),\"Currency data not found!\",Snackbar.LENGTH_LONG)\n .setAction(\"Try again\", new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n getAllCurrency();\n }\n }).show();\n return;\n }\n try {\n JsonObject object = new JsonObject();\n object.addProperty(KEY_EMAIL, email);\n object.addProperty(KEY_PHONE,phoneNo);\n object.addProperty(KEY_CURRENCY,selectedCurrency.getId().toString());\n updateUser(object,token);\n }catch (Exception e){\n\n }\n\n }", "@Test\n public void testValidateDuplicateAccounts() {\n // Same account\n Long accountId = 123l;\n BankAccount bankAccountRequest = new BankAccountImpl();\n bankAccountRequest.setAccountId(accountId);\n Locale locale = Locale.getDefault();\n ErrorMessageResponse errorMessageResponse = new ErrorMessageResponse();\n List<BankAccount> bankAccountList = new ArrayList<>();\n // EMPTY LIST no duplicate accounts held\n BankHelper\n .validateDuplicateAccounts(bankAccountRequest, locale, errorMessageResponse, bankAccountList, account);\n assertFalse(errorMessageResponse.hasErrors());\n\n // ACCOUNT ONLY HELD BY CUSTOMER\n BankAccount bankAccount = new BankAccountImpl();\n bankAccount.setAccountId(accountId);\n bankAccount.setActivatedDate(new Date(new Date().getTime() - 1000));\n bankAccountList.add(bankAccount);\n\n bankAccount = new BankAccountImpl();\n bankAccount.setAccountId(accountId);\n bankAccount.setActivatedDate(new Date());\n bankAccountList.add(bankAccount);\n\n BankHelper\n .validateDuplicateAccounts(bankAccountRequest, locale, errorMessageResponse, bankAccountList, account);\n assertFalse(errorMessageResponse.hasErrors());\n\n }", "@Test\n\tpublic void testCase2()\n\t{\n\t\tint numberOfCases=-1;\n\t\t\n\t\t//checking number of case is positive or not\n\t\tboolean valid=BillEstimation.numberOfCaseValidation(numberOfCases);\n\t\tassertFalse(valid);\n\t\t\n\t}", "UserPayment validate(String cardHolderName,String cardType,String securityCode,String paymentType);", "@Test(enabled=true, priority =1)\r\n\tpublic void view3_validate_table_data() {\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_curr_data) , \"Test_View3\" , \"view3_curr_data\" );\t\r\n\t\thelper.validate_table_columns( view3_curr_data_table , driver , \"\" , \"Test_View3\" , \"view3_curr_data_table\" );\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_today_data) , \"Test_View3\" , \"view3_today_data\" );\r\n\t\thelper.validate_table_columns( view3_today_data_table , driver , \"\" , \"Test_View3\" , \"view3_today_data_table\" );\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_curr_agent_stats_tbl) , \"Test_View3\" , \"view3_curr_agent_stats_tbl\" );\r\n\t\thelper.validate_table_columns( view3_curr_agent_stats_col , driver , \"\" , \"Test_View3\" , \"view3_curr_agent_stats_col\" );\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_agent_details) , \"Test_View3\" , \"view3_agent_details\" );\t\r\n\t\thelper.validate_table_columns( view3_Agent_table_data_start , driver , view3_Agent_table_data_end , \"Test_View3\" , \"view3_Agent_table_data\" );\r\n\t}", "@Then(\"user validates status code {string}\")\r\n\tpublic void user_validates_status_code(String arg1) throws Throwable {\n\t\tAssert.assertTrue(StripeCustomer.response.getStatusCode()==Integer.parseInt(arg1));\r\n\t}", "private JSONObject updateHeaderStatus(Connection con, String clientId, String orgId,\n String roleId, String userId, BudgetAdjustment objAdjustment, String appstatus,\n String comments, Date currentDate, VariablesSecureApp vars,\n NextRoleByRuleVO paramNextApproval, String Lang, String documentType) {\n String adjustMentId = null, pendingapproval = null, reserveRoleId = \"\";\n JSONObject return_obj = new JSONObject();\n Boolean isDirectApproval = false, reserve = false;\n String alertRuleId = \"\", alertWindow = AlertWindow.BudgetAdjustment;\n User objUser = OBDal.getInstance().get(User.class, vars.getUser());\n User objCreater = objAdjustment.getCreatedBy();\n NextRoleByRuleVO nextApproval = paramNextApproval;\n try {\n OBContext.setAdminMode();\n // NextRoleByRuleVO nextApproval = NextRoleByRule.getNextRole(con, clientId, orgId,\n // roleId,userId, Resource.PURCHASE_REQUISITION, 0.00);\n\n String BudgetAdjustementid = objAdjustment.getId();\n JSONObject tableData = new JSONObject();\n tableData.put(\"headerColumn\", ApprovalTables.Budget_Adjustment_HEADER_COLUMN);\n tableData.put(\"tableName\", ApprovalTables.Budget_Adjustment_Table);\n tableData.put(\"headerId\", objAdjustment.getId());\n tableData.put(\"roleId\", roleId);\n EutNextRole nextRole = null;\n boolean isBackwardDelegation = false;\n HashMap<String, String> role = null;\n String qu_next_role_id = \"\";\n String delegatedFromRole = null;\n String delegatedToRole = null;\n JSONObject fromUserandRoleJson = new JSONObject();\n String fromUser = userId;\n String fromRole = roleId;\n boolean isDummyRole = false;\n isDirectApproval = Utility.isDirectApproval(tableData);\n\n // find the submitted role org/branch details\n Role submittedRoleObj = null;\n String submittedRoleOrgId = null;\n\n if (objAdjustment.getNextRole() != null) {\n if (objAdjustment.getEfinSubmittedRole() != null\n && objAdjustment.getEfinSubmittedRole().getEutReg() != null) {\n submittedRoleOrgId = objAdjustment.getEfinSubmittedRole().getEutReg().getId();\n } else {\n submittedRoleOrgId = orgId;\n }\n } else if (objAdjustment.getNextRole() == null) {\n submittedRoleObj = OBContext.getOBContext().getRole();\n if (submittedRoleObj != null && submittedRoleObj.getEutReg() != null) {\n submittedRoleOrgId = submittedRoleObj.getEutReg().getId();\n } else {\n submittedRoleOrgId = orgId;\n }\n }\n\n // get alert rule id\n OBQuery<AlertRule> queryAlertRule = OBDal.getInstance().createQuery(AlertRule.class,\n \"as e where e.client.id='\" + clientId + \"' and e.efinProcesstype='\" + alertWindow + \"'\");\n if (queryAlertRule.list().size() > 0) {\n AlertRule objRule = queryAlertRule.list().get(0);\n alertRuleId = objRule.getId();\n }\n\n /**\n * fetching from roleId and userId based on delegated user / forwarder/ direct approver\n **/\n if (objAdjustment.getNextRole() != null) {\n fromUserandRoleJson = forwardDao.getFromuserAndFromRoleWhileApprove(\n objAdjustment.getNextRole(), userId, roleId, clientId, submittedRoleOrgId,\n Resource.BUDGET_ENTRY_RULE, isDummyRole, isDirectApproval);\n if (fromUserandRoleJson != null && fromUserandRoleJson.length() > 0) {\n if (fromUserandRoleJson.has(\"fromUser\"))\n fromUser = fromUserandRoleJson.getString(\"fromUser\");\n if (fromUserandRoleJson.has(\"fromRole\"))\n fromRole = fromUserandRoleJson.getString(\"fromRole\");\n if (fromUserandRoleJson.has(\"isDirectApproval\"))\n isDirectApproval = fromUserandRoleJson.getBoolean(\"isDirectApproval\");\n }\n\n } else {\n fromUser = userId;\n fromRole = roleId;\n }\n\n if ((objAdjustment.getNextRole() == null)) {\n // nextApproval = NextRoleByRule.getNextRole(con, clientId, orgId, roleId, userId,\n // documentType, 0.00);\n nextApproval = NextRoleByRule.getLineManagerBasedNextRole(\n OBDal.getInstance().getConnection(), clientId, submittedRoleOrgId, fromRole, fromUser,\n Resource.BUDGET_ADJUSTMENT_RULE, BigDecimal.ZERO, fromUser, false,\n objAdjustment.getDocumentStatus());\n // check reserve role\n reserveRoleId = roleId;\n // reserve = UtilityDAO.getReserveFundsRole(documentType, roleId, orgId,\n // BudgetAdjustementid);\n } else {\n if (isDirectApproval) {\n // nextApproval = NextRoleByRule.getNextRole(con, clientId, orgId, roleId, userId,\n // documentType, 0.00);\n nextApproval = NextRoleByRule.getLineManagerBasedNextRole(\n OBDal.getInstance().getConnection(), clientId, submittedRoleOrgId, fromRole, fromUser,\n Resource.BUDGET_ADJUSTMENT_RULE, BigDecimal.ZERO, fromUser, false,\n objAdjustment.getDocumentStatus());\n reserveRoleId = roleId;\n /*\n * reserve = UtilityDAO.getReserveFundsRole(documentType, roleId, orgId,\n * BudgetAdjustementid);\n */\n if (nextApproval != null && nextApproval.hasApproval()) {\n nextRole = OBDal.getInstance().get(EutNextRole.class, nextApproval.getNextRoleId());\n if (nextRole.getEutNextRoleLineList().size() > 0) {\n for (EutNextRoleLine objNextRoleLine : nextRole.getEutNextRoleLineList()) {\n OBQuery<UserRoles> userRole = OBDal.getInstance().createQuery(UserRoles.class,\n \"role.id='\" + objNextRoleLine.getRole().getId() + \"'\");\n role = NextRoleByRule.getbackwardDelegatedFromAndToRoles(\n OBDal.getInstance().getConnection(), clientId, orgId,\n userRole.list().get(0).getUserContact().getId(), documentType, \"\");\n delegatedFromRole = role.get(\"FromUserRoleId\");\n delegatedToRole = role.get(\"ToUserRoleId\");\n isBackwardDelegation = NextRoleByRule.isBackwardDelegation(\n OBDal.getInstance().getConnection(), clientId, orgId, delegatedFromRole,\n delegatedToRole, fromUser, documentType, 0.00);\n if (isBackwardDelegation)\n break;\n }\n }\n }\n if (isBackwardDelegation) {\n nextApproval = NextRoleByRule.getNextRole(OBDal.getInstance().getConnection(), clientId,\n submittedRoleOrgId, delegatedFromRole, userId, documentType, 0.00);\n reserveRoleId = delegatedFromRole;\n // reserve = UtilityDAO.getReserveFundsRole(documentType, delegatedFromRole, orgId,\n // BudgetAdjustementid);\n }\n } else {\n role = NextRoleByRule.getDelegatedFromAndToRoles(OBDal.getInstance().getConnection(),\n clientId, submittedRoleOrgId, fromUser, documentType, qu_next_role_id);\n\n delegatedFromRole = role.get(\"FromUserRoleId\");\n delegatedToRole = role.get(\"ToUserRoleId\");\n\n if (delegatedFromRole != null && delegatedToRole != null)\n nextApproval = NextRoleByRule.getDelegatedNextRole(OBDal.getInstance().getConnection(),\n clientId, submittedRoleOrgId, delegatedFromRole, delegatedToRole, fromUser,\n documentType, 0.00);\n reserveRoleId = delegatedFromRole;\n /*\n * reserve = UtilityDAO.getReserveFundsRole(documentType, delegatedFromRole, orgId,\n * BudgetAdjustementid);\n */\n }\n }\n if (nextApproval != null && nextApproval.getErrorMsg() != null\n && nextApproval.getErrorMsg().equals(\"NoManagerAssociatedWithRole\")) {\n return_obj.put(\"count\", 3);\n } else if (nextApproval != null && nextApproval.hasApproval()) {\n // get old nextrole line user and role list\n HashMap<String, String> alertReceiversMap = forwardDao\n .getNextRoleLineList(objAdjustment.getNextRole(), Resource.BUDGET_ADJUSTMENT_RULE);\n ArrayList<String> includeRecipient = new ArrayList<String>();\n nextRole = OBDal.getInstance().get(EutNextRole.class, nextApproval.getNextRoleId());\n objAdjustment.setUpdated(new java.util.Date());\n objAdjustment.setUpdatedBy(OBContext.getOBContext().getUser());\n objAdjustment.setDocumentStatus(\"EFIN_IP\");\n objAdjustment.setNextRole(nextRole);\n nextRole = OBDal.getInstance().get(EutNextRole.class, nextApproval.getNextRoleId());\n // get alert recipient\n OBQuery<AlertRecipient> receipientQuery = OBDal.getInstance()\n .createQuery(AlertRecipient.class, \"as e where e.alertRule.id='\" + alertRuleId + \"'\");\n\n forwardDao.getAlertForForwardedUser(objAdjustment.getId(), alertWindow, alertRuleId,\n objUser, clientId, Constants.APPROVE, objAdjustment.getDocno(), Lang, vars.getRole(),\n objAdjustment.getEUTForward(), Resource.BUDGET_ADJUSTMENT_RULE, alertReceiversMap);\n\n // set alerts for next roles\n if (nextRole.getEutNextRoleLineList().size() > 0) {\n // delete alert for approval alerts\n // OBQuery<Alert> alertQuery = OBDal.getInstance().createQuery(Alert.class,\n // \"as e where e.referenceSearchKey='\" + objAdjustment.getId()\n // + \"' and e.alertStatus='NEW'\");\n // if (alertQuery.list().size() > 0) {\n // for (Alert objAlert : alertQuery.list()) {\n // objAlert.setAlertStatus(\"SOLVED\");\n // }\n // }\n String Description = sa.elm.ob.finance.properties.Resource.getProperty(\"finance.ba.wfa\",\n Lang) + \" \" + objCreater.getName();\n for (EutNextRoleLine objNextRoleLine : nextRole.getEutNextRoleLineList()) {\n AlertUtility.alertInsertionRole(objAdjustment.getId(), objAdjustment.getDocno(),\n objNextRoleLine.getRole().getId(), \"\", objAdjustment.getClient().getId(),\n Description, \"NEW\", alertWindow, \"finance.ba.wfa\", Constants.GENERIC_TEMPLATE);\n // get user name for delegated user to insert on approval history.\n OBQuery<EutDocappDelegateln> delegationln = OBDal.getInstance().createQuery(\n EutDocappDelegateln.class,\n \" as e left join e.eUTDocappDelegate as hd where hd.role.id ='\"\n + objNextRoleLine.getRole().getId() + \"' and hd.fromDate <='\" + currentDate\n + \"' and hd.date >='\" + currentDate + \"' and e.documentType='EUT_119'\");\n if (delegationln != null && delegationln.list().size() > 0) {\n\n AlertUtility.alertInsertionRole(objAdjustment.getId(), objAdjustment.getDocno(),\n delegationln.list().get(0).getRole().getId(),\n delegationln.list().get(0).getUserContact().getId(),\n objAdjustment.getClient().getId(), Description, \"NEW\", alertWindow,\n \"finance.Budget.wfa\", Constants.GENERIC_TEMPLATE);\n\n includeRecipient.add(delegationln.list().get(0).getRole().getId());\n if (pendingapproval != null)\n pendingapproval += \"/\" + delegationln.list().get(0).getUserContact().getName();\n else\n pendingapproval = String.format(Constants.sWAITINGFOR_S_APPROVAL,\n delegationln.list().get(0).getUserContact().getName());\n }\n // add next role recipient\n includeRecipient.add(objNextRoleLine.getRole().getId());\n }\n }\n // existing Recipient\n if (receipientQuery.list().size() > 0) {\n for (AlertRecipient objAlertReceipient : receipientQuery.list()) {\n includeRecipient.add(objAlertReceipient.getRole().getId());\n OBDal.getInstance().remove(objAlertReceipient);\n }\n }\n // avoid duplicate recipient\n HashSet<String> incluedSet = new HashSet<String>(includeRecipient);\n Iterator<String> iterator = incluedSet.iterator();\n while (iterator.hasNext()) {\n AlertUtility.insertAlertRecipient(iterator.next(), null, clientId, alertWindow);\n }\n objAdjustment.setAction(\"AP\");\n if (pendingapproval == null)\n pendingapproval = nextApproval.getStatus();\n\n log.debug(\n \"doc sts:\" + objAdjustment.getDocumentStatus() + \"action:\" + objAdjustment.getAction());\n return_obj.put(\"count\", 1);\n // count = 1;\n // Waiting For Approval flow\n\n } else {\n OBContext.setAdminMode(true);\n\n // get old nextrole line user and role list\n HashMap<String, String> alertReceiversMap = forwardDao\n .getNextRoleLineList(objAdjustment.getNextRole(), Resource.BUDGET_ADJUSTMENT_RULE);\n\n ArrayList<String> includeRecipient = new ArrayList<String>();\n // nextRole = OBDal.getInstance().get(EutNextRole.class, nextApproval.getNextRoleId());\n\n objAdjustment.setUpdated(new java.util.Date());\n objAdjustment.setUpdatedBy(OBContext.getOBContext().getUser());\n objAdjustment.setDocumentStatus(\"EFIN_AP\");\n Role objCreatedRole = null;\n User objCreatedUser = OBDal.getInstance().get(User.class,\n objAdjustment.getCreatedBy().getId());\n if (objCreatedUser.getADUserRolesList().size() > 0) {\n objCreatedRole = objCreatedUser.getADUserRolesList().get(0).getRole();\n }\n /*\n * OBQuery<Alert> alertQuery = OBDal.getInstance().createQuery(Alert.class,\n * \"as e where e.referenceSearchKey='\" + objAdjustment.getId() +\n * \"' and e.alertStatus='NEW'\"); if (alertQuery.list().size() > 0) { for (Alert objAlert :\n * alertQuery.list()) { objAlert.setAlertStatus(\"SOLVED\"); } }\n */\n // get alert recipient\n OBQuery<AlertRecipient> receipientQuery = OBDal.getInstance()\n .createQuery(AlertRecipient.class, \"as e where e.alertRule.id='\" + alertRuleId + \"'\");\n\n forwardDao.getAlertForForwardedUser(objAdjustment.getId(), alertWindow, alertRuleId,\n objUser, clientId, Constants.APPROVE, objAdjustment.getDocno(), Lang, vars.getRole(),\n objAdjustment.getEUTForward(), Resource.BUDGET_ADJUSTMENT_RULE, alertReceiversMap);\n\n // check and insert recipient\n if (receipientQuery.list().size() > 0) {\n for (AlertRecipient objAlertReceipient : receipientQuery.list()) {\n includeRecipient.add(objAlertReceipient.getRole().getId());\n OBDal.getInstance().remove(objAlertReceipient);\n }\n }\n includeRecipient.add(objCreatedRole.getId());\n // avoid duplicate recipient\n HashSet<String> incluedSet = new HashSet<String>(includeRecipient);\n Iterator<String> iterator = incluedSet.iterator();\n while (iterator.hasNext()) {\n AlertUtility.insertAlertRecipient(iterator.next(), null, clientId, alertWindow);\n } // set alert for requester\n String Description = sa.elm.ob.finance.properties.Resource\n .getProperty(\"finance.ba.approved\", Lang) + \" \" + objUser.getName();\n AlertUtility.alertInsertionRole(objAdjustment.getId(), objAdjustment.getDocno(),\n objAdjustment.getRole().getId(), objAdjustment.getCreatedBy().getId(),\n objAdjustment.getClient().getId(), Description, \"NEW\", alertWindow,\n \"finance.ba.approved\", Constants.GENERIC_TEMPLATE);\n objAdjustment.setNextRole(null);\n objAdjustment.setAction(\"PD\");\n return_obj.put(\"count\", 2);\n // count = 2;\n // Final Approval Flow\n }\n\n OBDal.getInstance().save(objAdjustment);\n adjustMentId = objAdjustment.getId();\n if (!StringUtils.isEmpty(adjustMentId)) {\n\n if (return_obj.getInt(\"count\") != 3) {\n JSONObject historyData = new JSONObject();\n historyData.put(\"ClientId\", clientId);\n historyData.put(\"OrgId\", orgId);\n historyData.put(\"RoleId\", roleId);\n historyData.put(\"UserId\", userId);\n historyData.put(\"HeaderId\", adjustMentId);\n historyData.put(\"Comments\", comments);\n historyData.put(\"Status\", appstatus);\n historyData.put(\"NextApprover\", pendingapproval);\n historyData.put(\"HistoryTable\", ApprovalTables.Budget_Adjustment_HISTORY);\n historyData.put(\"HeaderColumn\", ApprovalTables.Budget_Adjustment_HEADER_COLUMN);\n historyData.put(\"ActionColumn\", ApprovalTables.Budget_Adjustment_DOCACTION_COLUMN);\n\n Utility.InsertApprovalHistory(historyData);\n }\n\n }\n // OBDal.getInstance().flush();\n // check reserve role\n reserve = UtilityDAO.getReserveFundsRole(documentType, fromRole, orgId, BudgetAdjustementid,\n BigDecimal.ZERO);\n return_obj.put(\"reserve\", reserve);\n // delete the unused nextroles in eut_next_role table.\n DocumentRuleDAO.deleteUnusedNextRoles(OBDal.getInstance().getConnection(), documentType);\n\n // after approved by forwarded user removing the forward and rmi id\n if (objAdjustment.getEUTForward() != null) {\n forwardDao.setForwardStatusAsDraft(objAdjustment.getEUTForward());\n objAdjustment.setEUTForward(null);\n }\n if (objAdjustment.getEUTReqmoreinfo() != null) {\n forwardDao.setForwardStatusAsDraft(objAdjustment.getEUTReqmoreinfo());\n objAdjustment.setEUTReqmoreinfo(null);\n objAdjustment.setREQMoreInfo(\"N\");\n }\n OBDal.getInstance().save(objAdjustment);\n } catch (Exception e) {\n log.error(\"Exception in updateHeaderStatus in IssueRequest: \", e);\n OBDal.getInstance().rollbackAndClose();\n try {\n return_obj.put(\"count\", 0);\n return_obj.put(\"reserve\", false);\n } catch (JSONException e1) {\n\n }\n return return_obj;\n } finally {\n OBContext.restorePreviousMode();\n }\n return return_obj;\n }", "@Then(\"^Validate the fields present in the result page$\") // Move to UserStep Definition\r\n\tpublic void attribute_validation(){\r\n\t\tenduser.attri_field();\r\n\t}", "@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyStdSpecificacctsPrepopulatedUserdetails() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify the confirmation page of Add new user is getting displayed with prepopulated user details\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMVTestDatas\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ClickAddNewUserLink()\n\t\t.AddUserRadioButton()\n\t\t.StandardUser_Creation()\n\t\t.VerifySpecificAccountsViewNames(userProfile);\t \t \t\t \t \t\t \t \t \t \t\t \t \t\t \t \t\t \t \t\t\n\t}", "boolean isSetAccountNumber();", "@Override\n public void validate(ValidationContext vc) {\n Map<String,Property> beanProps = vc.getProperties(vc.getProperty().getBase());\n \n validateKode(vc, (String)beanProps.get(\"idKurikulum\").getValue(), (Boolean)vc.getValidatorArg(\"tambahBaru\")); \n validateDeskripsi(vc, (String)beanProps.get(\"deskripsi\").getValue()); \n }", "public PaymentRequestPage validateNEFTFieldErrorMessages() {\r\n\r\n\t\treportStep(\"About to validate the NEFT field error validation - \", \"INFO\");\r\n\r\n\t\tvalidateTheElementPresence(nameOfBankAccountHolderName);\r\n\t\tvalidateTheElementPresence(pleaseEnterValidACHolderName);\r\n\t\tvalidateTheElementPresence(bank_Name);\r\n\t\tvalidateTheElementPresence(pleaseEnterValidBankName);\r\n\t\tvalidateTheElementPresence(bank_BranchName);\r\n\r\n\t\tscrollFromDownToUpinApp();\r\n\r\n\t\tvalidateTheElementPresence(pleaseEnterBranchNameOr4DigitBranchCode);\r\n\t\tvalidateTheElementPresence(bank_AccountNumber);\r\n\t\tscrollFromDownToUpinApp();\t\t\r\n\t\tvalidateTheElementPresence(pleaseEnterTheBankAccountNum);\r\n\t\tscrollFromDownToUpinApp();\t\t\r\n\t\tvalidateTheElementPresence(ifscCodeForBank);\r\n\t\tvalidateTheElementPresence(pleaseEnterTheIFSC);\r\n\r\n\t\treturn this;\r\n\r\n\t}", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public String getStatus()\r\n {\n return (\"1\".equals(getField(\"ApprovalStatus\")) && \"100\".equals(getField(\"HostRespCode\")) ? \"Approved\" : \"Declined\");\r\n }" ]
[ "0.64161015", "0.6404621", "0.6176711", "0.617232", "0.6039781", "0.59864193", "0.59230363", "0.57980394", "0.5696221", "0.5696221", "0.56773365", "0.5669984", "0.5659512", "0.56432", "0.56286734", "0.56250185", "0.55979437", "0.55900556", "0.5575675", "0.5575675", "0.55618066", "0.55584526", "0.55487144", "0.5531849", "0.55104536", "0.5509927", "0.55075836", "0.5499118", "0.5483403", "0.54757506", "0.5473311", "0.5470875", "0.5468412", "0.5461448", "0.5455117", "0.5454931", "0.54400784", "0.5417724", "0.54036117", "0.54002994", "0.53932333", "0.5390688", "0.53896976", "0.53795", "0.53705484", "0.5361348", "0.5360012", "0.53360933", "0.5335766", "0.5334149", "0.5323963", "0.531375", "0.5306745", "0.5306361", "0.5303982", "0.5296709", "0.5288015", "0.5283208", "0.5283208", "0.5282181", "0.52809924", "0.5275366", "0.5274147", "0.525831", "0.52463347", "0.52461", "0.52431184", "0.5241298", "0.52387565", "0.5234867", "0.5230905", "0.52282006", "0.5225666", "0.52219564", "0.5215797", "0.5213091", "0.5208607", "0.5205458", "0.51899886", "0.5188894", "0.5186751", "0.51803285", "0.51751673", "0.51724255", "0.5168141", "0.5154415", "0.5149834", "0.5148354", "0.5146983", "0.5143101", "0.51416653", "0.5131357", "0.51298225", "0.5117921", "0.5114989", "0.511394", "0.5113109", "0.5108041", "0.5106111", "0.510318" ]
0.72459763
0
Validation Functions Description : To validate the Phone Number in Customer Account Summary of Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:05 Oct 2016 Modified By:Raja Parameter:PhoneNumber
public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll("M_Header", "Landline Account Summary").replaceAll("M_Category", "Phone Number").replaceAll("M_InnerText", PhoneNumber), "Phone Number - "+PhoneNumber, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean validatePhoneNumber(String phoneNo) {\n if (phoneNo.matches(\"\\\\d{10}\")) return true;\n //validating phone number with -, . or spaces\n else if(phoneNo.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) return true;\n //validating phone number with extension length from 3 to 5\n else if(phoneNo.matches(\"\\\\d{3}-\\\\d{3}-\\\\d{4}\\\\s(x|(ext))\\\\d{3,5}\")) return true;\n //validating phone number where area code is in braces ()\n else if(phoneNo.matches(\"\\\\(\\\\d{3}\\\\)-\\\\d{3}-\\\\d{4}\")) return true;\n //return false if nothing matches the input\n else return false;\n\n }", "void validateMobileNumber(String stringToBeValidated,String name);", "protected void validateMobileNumber(){\n /*\n Checking For Mobile number\n The Accepted Types Are +00 000000000 ; +00 0000000000 ;+000 0000000000; 0 0000000000 ; 00 0000000000\n */\n Boolean mobileNumber = Pattern.matches(\"^[0]?([+][0-9]{2,3})?[-][6-9]+[0-9]{9}\",getMobileNumber());\n System.out.println(mobileNumberResult(mobileNumber));\n }", "private boolean validate(){\n\n String MobilePattern = \"[0-9]{10}\";\n String name = String.valueOf(userName.getText());\n String number = String.valueOf(userNumber.getText());\n\n\n if(name.length() > 25){\n Toast.makeText(getApplicationContext(), \"pls enter less the 25 characher in user name\",\n Toast.LENGTH_SHORT).show();\n return true;\n }\n\n\n\n else if(name.length() == 0 || number.length() == 0 ){\n Toast.makeText(getApplicationContext(), \"pls fill the empty fields\",\n Toast.LENGTH_SHORT).show();\n return false;\n }\n\n\n\n else if(number.matches(MobilePattern))\n {\n\n return true;\n }\n else if(!number.matches(MobilePattern))\n {\n Toast.makeText(getApplicationContext(), \"Please enter valid 10\" +\n \"digit phone number\", Toast.LENGTH_SHORT).show();\n\n\n return false;\n }\n\n return false;\n\n }", "@RequestMapping(value = \"/user/validate\")\n @Service\n public @ResponseBody ValidateResult validatePhoneNumberAPI(@RequestParam(value = \"phoneNumber\", required = true) String phoneNumber) {\n \tValidateResult result = new ValidateResult();\n \t\n \tresult.setResult(phoneNumber.substring(0, Math.min(phoneNumber.length(), 10)));\n \t\n \treturn result;\n }", "@Override\n public boolean isValid(PhoneNumber phoneNumber) {\n String number = phoneNumber.getNumber();\n return isPhoneNumber(number) && number.startsWith(\"+380\") && number.length() == 13;\n }", "public boolean Validate() \r\n {\n return phoneNumber.matcher(getText()).matches();\r\n }", "private boolean validatePhone(String phone) {\n if (phone.matches(\"\\\\d{10}\")) {\n return true;\n } //validating phone number with -, . or spaces\n else if (phone.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) {\n return true;\n } //validating phone number where area code is in braces ()\n else if (phone.matches(\"\\\\(\\\\d{3}\\\\)-\\\\d{3}-\\\\d{4}\")) {\n return true;\n } //return false if nothing matches the input\n else {\n return false;\n }\n }", "private boolean isPhoneValid(String phoneno) {\n return phoneno.length() > 9;\n }", "public static boolean checkPhoneNumber (String phoneNumber) throws UserRegistrationException{\n check = Pattern.compile(\"^[0-9]{1,3} [0-9]{10}$\").matcher(phoneNumber).matches();\n if (check) {\n return true;\n } else {\n throw new UserRegistrationException(\"Enter a valid Phone number\");\n }\n }", "private boolean isValidNumber() {\n String mobileNumber = ((EditText) findViewById(\n R.id.account_mobile_number_edit_text)).getText().toString();\n\n return PhoneNumberUtils.isValidMobileNumber(PhoneNumberUtils.formatMobileNumber(mobileNumber));\n }", "private boolean CheckPhoneNumber() {\n\t\tString phoneNumber = Phone_textBox.getText();\n\n\t\t// if field is empty\n\t\tif (phoneNumber.equals(\"\")) {\n\t\t\tif (!Phone_textBox.getStyleClass().contains(\"error\"))\n\t\t\t\tPhone_textBox.getStyleClass().add(\"error\");\n\t\t\tPhoneNote.setText(\"* Enter Number\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// if field contains a character that is not a digit\n\t\tif (!phoneNumber.matches(\"([0-9])+\")) {\n\t\t\tif (!Phone_textBox.getStyleClass().contains(\"error\"))\n\t\t\t\tPhone_textBox.getStyleClass().add(\"error\");\n\t\t\tPhoneNote.setText(\"* Worng Format(?)\");\n\t\t\tTooltip.install(PhoneNote, new Tooltip(\"Phone Number can only contain digits\"));\n\t\t\treturn false;\n\t\t}\n\n\t\t// if field contains more or less than 10 digits\n\t\tif (phoneNumber.length() != 10) {\n\t\t\tif (!Phone_textBox.getStyleClass().contains(\"error\"))\n\t\t\t\tPhone_textBox.getStyleClass().add(\"error\");\n\t\t\tPhoneNote.setText(\"* Worng Format(?)\");\n\t\t\tTooltip.install(PhoneNote, new Tooltip(\"Phone Number must be 10 digits long\"));\n\t\t\treturn false;\n\t\t}\n\n\t\tPhone_textBox.getStyleClass().remove(\"error\");\n\t\tPhoneNote.setText(\"*\");\n\t\tTooltip.uninstall(PhoneNote, new Tooltip(\"Phone Number can only contain digits\"));\n\t\tTooltip.uninstall(PhoneNote, new Tooltip(\"Phone Number must be 10 digits long\"));\n\t\treturn true;\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public boolean validatePhoneNumber(String input){\n\t\tif (input.matches(\"\\\\d{10}\")) return true;\n\t\t//validating phone number with -, . or spaces\n\t\telse if(input.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) return true;\n\t\t//validating phone number with extension length from 3 to 5\n\t\telse if(input.matches(\"\\\\d{3}-\\\\d{3}-\\\\d{4}\\\\s(x|(ext))\\\\d{3,5}\")) return true;\n\t\t//validating phone number where area code is in braces ()\n\t\telse if(input.matches(\"\\\\(\\\\d{3}\\\\)-\\\\d{3}-\\\\d{4}\")) return true;\n\t\t//return false if nothing matches the input\n\t\telse return false;\n\t}", "private boolean isValidPhoneNumber(String phoneNumber) {\r\n System.out.println(\"Inside a valid phone number and number is\" + phoneNumber);\r\n return Pattern.matches(phoneNumberRegex, phoneNumber);\r\n }", "public static boolean isValidPhoneNumber(String number) {\n\n if(number.length()==10 && isValidNumber(number)){\n System.out.print(\"Is \" + number + \" a valid phone number : \");\n return true;\n }\n\n else{\n System.out.print(\"Is \" + number + \" a valid phone number : \");\n return false;\n }\n \n }", "public final boolean checkPhoneNum() {\n EditText editText = (EditText) _$_findCachedViewById(R.id.etPhoneNum);\n Intrinsics.checkExpressionValueIsNotNull(editText, \"etPhoneNum\");\n CharSequence text = editText.getText();\n if (text == null || text.length() == 0) {\n showMsg(\"请输入手机号\");\n return false;\n }\n EditText editText2 = (EditText) _$_findCachedViewById(R.id.etPhoneNum);\n Intrinsics.checkExpressionValueIsNotNull(editText2, \"etPhoneNum\");\n if (editText2.getText().length() == 11) {\n return true;\n }\n showMsg(\"请输入正确的手机号\");\n return false;\n }", "private boolean isPhoneNumberValid(String phoneNumber){\n boolean isValid = false;\n\n String expression = \"^\\\\(?(\\\\d{3})\\\\)?[- ]?(\\\\d{3})[- ]?(\\\\d{4})$\";\n CharSequence inputStr = phoneNumber;\n Pattern pattern = Pattern.compile(expression);\n Matcher matcher = pattern.matcher(inputStr);\n if(matcher.matches()){\n isValid = true;\n }\n return isValid;\n }", "@Test\n public void invalidCaleeNumber(){\n PhoneCall call = new PhoneCall(\"503-449-7833\", \"ABCD\", \"01/01/2020\", \"1:00 am\", \"01/01/2020\", \"1:00 am\");\n assertThat(call.getCallee(), not(nullValue()));\n }", "static boolean isValidPhoneNumber(String phoneNumber) {\n return phoneNumber != null && Pattern.matches(\"\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d\\\\d\", phoneNumber);\n }", "@GET(\"numbervalidation\")\n Call<ResponseBody> numbervalidation(@Query(\"mobile_number\") String mobile_number, @Query(\"country_code\") String country_code, @Query(\"user_type\") String user_type, @Query(\"language\") String language, @Query(\"forgotpassword\") String forgotpassword);", "private boolean is_phonenumber(String nr)\n\t{\n\t\t// if the string is not null, length is between 0 and 16, starts with \"00\" and all the characters in the sttring are numbers\n\t\t// then it's valid\n\t\tif(nr != null && nr.length() > 0 && nr.length() < 16 && nr.substring(0, 2).equals(\"00\") && valid_numbers(nr))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "void telephoneValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"+391111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"1111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"111 1111111\");\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data\n person.setTelephone(\"AAA\");\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }", "abstract void telephoneValidity();", "public boolean isValidPhone(TextInputLayout tiPhone, EditText etPhone) {\n String phone = etPhone.getText().toString().trim();\n boolean result = false;\n\n if (phone.length() == 0)\n tiPhone.setError(c.getString(R.string.required));\n else if (phone.length() != PHONE_SIZE)\n tiPhone.setError(c.getString(R.string.specificLength, Integer.toString(PHONE_SIZE)));\n else if (!phone.matches(\"\\\\d{10}\"))\n tiPhone.setError(c.getString(R.string.onlyNumbers));\n else {\n result = true;\n tiPhone.setError(null);\n }\n return result;\n }", "@org.junit.Test\r\n public void testPositiveScenario() {\n boolean result = Validation.validateSAPhoneNumber(\"+27712612199\");// function should return true\r\n assertEquals(true, result);\r\n\r\n }", "public static boolean validate(String mobileNo) {\n//\t\tif(mobileNo.length() > 10)\n//\t\t\tmobileNo = mobileNo.substring(mobileNo.length()-10);\n\n\t\tpattern = Pattern.compile(MOBILE_PATTERN);\n\t\tmatcher = pattern.matcher(mobileNo);\n\t\treturn matcher.matches();\n \n\t}", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "@Test(priority=1)\n\tpublic void checkFirstNameAndLastNameFieldValiditywithNumbers(){\n\t\tsignup.clearAllFields();\n\t\tsignup.enterId(\"[email protected]\");\n\t\tsignup.enterFirstName(\"12345\");\n\t\tsignup.enterLastName(\"56386\");\n\t\tsignup.clickSubmit();\n\t\tList<String> errors = signup.getErrors();\n\t\t// given page accepts numbers into the firstname and lastname fields\n\t\tAssert.assertFalse(TestHelper.isStringPresent(errors, \"Please enter your last name.\"));\n\t\tAssert.assertFalse(TestHelper.isStringPresent(errors, \"Please enter your first name.\"));\n\t}", "@Override\n public void verifyHasPhone() {\n }", "@Test\n public void contactNumber_WhenValid_ShouldReturnTrue(){\n RegexTest valid = new RegexTest();\n boolean result = valid.contactNumber( \"91 1234567890\");\n Assert.assertEquals(true,result);\n }", "public boolean validateAccountNumber() {\n\t\tif (!this.setAccountNumber(this.account))\n\t\t\treturn false;\n\t\treturn this.getAccountNumber().length() > 0 && this.getAccountNumber().length() <= 11;\n\t}", "private void verifyPhoneNumber() {\n showSnackbar(\"Verifying Phone Number\");\n\n //Remove Social Sign-ins\n// disableViews(mBinding.imageButtonFacebook, mBinding.imageButtonGoogle);\n //Remove Login Button\n disableViews(mBinding.buttonLogin);\n\n mPhoneNumber = getTextFromTextInputLayout(mBinding.textPhoneNumber);\n PhoneAuthOptions authOptions = PhoneAuthOptions.newBuilder(mFirebaseAuth)\n .setPhoneNumber(getString(R.string.country_code) + mPhoneNumber)\n .setTimeout(60L, TimeUnit.SECONDS).setActivity(this).setCallbacks(mCallBacks).build();\n\n PhoneAuthProvider.verifyPhoneNumber(authOptions);\n }", "public boolean validatePhoneNumber(String phoneNumber) {\n\t\t// TODO: your work\n\t\tif (phoneNumber.length() != 10) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!phoneNumber.startsWith(\"0\")) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\tInteger.parseInt(phoneNumber);\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "private boolean validateInputInfo(){\n\n //Get user input\n String firstName = newContactFirstName.getText().toString();\n String lastName = newContactLastName.getText().toString();\n String email = newContactEmailAddress.getText().toString();\n String phone = newContactPhoneNumber.getText().toString();\n\n //Check to make sure no boxes were left empty\n if(firstName.isEmpty() || lastName.isEmpty() || email.isEmpty() || phone.isEmpty()){\n Toast.makeText(this, \"You must fill all fields before continuing!\", Toast.LENGTH_LONG).show();\n return false;\n }\n //Check to see if phone number is valid\n else if(!(phone.length() >= 10)){\n Toast.makeText(this, \"Make sure to input a valid 10 digit phone number!\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n return true;\n }", "public static String validatePhoneInput(Context context, TextInputEditText editText) {\n // store input\n String rawPhone = editText.getText().toString().trim();\n\n if (TextUtils.isEmpty(rawPhone)) {\n editText.setError(context.getResources().getString(R.string.editor_edt_empty_input));\n return null;\n }\n\n if (!Patterns.PHONE.matcher(rawPhone).matches()) {\n editText.setError(context.getResources().getString(R.string.editor_edt_invalid_input));\n return null;\n }\n\n return rawPhone;\n }", "@And(\"^Enter user phone and confirmation code$\")\t\t\t\t\t\n public void Enter_user_phone_and_confirmation_code() throws Throwable \t\t\t\t\t\t\t\n { \t\t\n \tdriver.findElement(By.id(\"phoneNumberId\")).sendKeys(\"01116844320\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvPhoneNext']/content/span\")).click();\n driver.findElement(By.id(\"code\")).sendKeys(\"172978\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvVerifyNext']/content/span\")).click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\t\t\n }", "public void validate_the_Telephone_Mobile_in_Contact_Details_of_Customer_Tab(String TelephoneMobile)throws Exception {\n\t\tReport.fnReportPageBreak(\"Telephone Details\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneMobile.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Mobile\").replaceAll(\"M_InnerText\", TelephoneMobile), \"Telephone - Mobile - \"+TelephoneMobile, false);\n\t}", "public boolean phoneValidate(final String phone) {\n\n\t\ttry {\n\t\t\tif (empHomePhone.equals(employeeHomePhone.getText().toString()))\n\t\t\t\treturn true;\n\t\t\tint pNumber = Integer.parseInt(phone);\n\t\t\tif ((pNumber < Integer.MAX_VALUE) && (pNumber > 999999))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\n\t\t} catch (NumberFormatException e) {\n\t\t\tLog.e(\"Phone length is null\", \"Please fill the phone field\");\n\t\t\tToast.makeText(this, \"Phone Field is Empty\", Toast.LENGTH_SHORT)\n\t\t\t\t\t.show();\n\t\t\treturn false;\n\t\t}\n\n\t}", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "private boolean validatePhone(String phone_value) {\n \tboolean result;\n \t\n \tif (phone_value == null)\n \t{\n \t\tresult = false;\n \t}\n \telse\n \t{\n \t\tif ( phone_value.equals(\"\") )\n \t\t\tresult = true;\n \t\telse\n \t\t\tresult = android.util.Patterns.PHONE.matcher(phone_value).matches();\n \t}\n \t\n \treturn result;\n }", "public long getPhoneNumber() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t// getter method initialized\t\t\t\t \r\n Scanner scanner = new Scanner(System.in);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t// Initialize the scanner to get input from User\r\n System.out.print(\"Enter Phone Number : \");\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // This will print the argument at the end of the line\r\n phoneNumber = scanner.nextLong();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Read long input from the User\r\n String inputPhoneNumber = Long.toString(phoneNumber);\t\t\t\t\t\t\t\t\t\t // convert Long to string.\r\n Pattern pattern = Pattern.compile(\"\\\\d{10}\");\t\t\t\t\t\t\t\t\t\t\t // The Pattern class represents a compiled regular expression.\r\n Matcher matcher = pattern.matcher(inputPhoneNumber );\t\t\t\t\t\t\t\t\t\t\t\t\t // The resulting Pattern object is used to obtain a Matcher instance.\r\n if (matcher.matches());\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // if loop ..to check input from the User\r\n else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// else loop started\r\n System.out.println(\"Invalid Phone Number - Please enter the Phone number again\");}\t\t \t// This will print the argument at the end of the line\t\r\n return phoneNumber;}", "private static boolean isContactNumberValid(String contactNumber) {\n return contactNumber.matches(\"\\\\d{10}\");\n }", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "public String checkPhone() {\n String phone = \"\"; // Create phone\n boolean isOK = true; // Condition loop\n\n while (isOK) {\n phone = checkEmpty(\"Phone\"); // Call method to check input of phone\n String phoneRegex = \"\\\\d{10,11}\"; // Pattern for phone number\n boolean isContinue = true; // Condition loop\n\n while (isContinue) {\n // If pattern not match, the print out error\n if (!Pattern.matches(phoneRegex, phone)) {\n System.out.println(\"Phone number must be 10 or 11 number!\");\n System.out.print(\"Try anthor phone: \");\n phone = checkEmpty(\"Phone\");\n } else {\n isContinue = false;\n }\n }\n\n boolean isExist = false; // Check exist phone\n for (Account acc : accounts) {\n if (phone.equals(acc.getPhone())) {\n // Check phone if exist print out error\n System.out.println(\"This phone has already existed!\");\n System.out.print(\"Try another phone: \");\n isExist = true;\n }\n }\n\n // If phone not exist then return phone\n if (!isExist) {\n return phone;\n }\n }\n return phone; // Return phone\n }", "public static boolean validatePhone(String number) {\n if (number.length() == 8) {\n for (int i = 0; i < number.length(); i++) {\n if (!Character.isDigit(number.charAt(i))) {\n return false;\n }\n } return true;\n } return false;\n }", "private boolean isInputValid() {\r\n \r\n String errorMessage = \"\";\r\n \r\n // Email regex provided by emailregex.com using the RFC5322 standard\r\n String emailPatternString = \"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\r\n \r\n // Phone number regex provided by Ravi Thapliyal on Stack Overflow:\r\n // http://stackoverflow.com/questions/16699007/regular-expression-to-match-standard-10-digit-phone-number\r\n String phoneNumString = \"^(\\\\+\\\\d{1,2}\\\\s)?\\\\(?\\\\d{3}\\\\)?[\\\\s.-]?\\\\d{3}[\\\\s.-]?\\\\d{4}$\";\r\n \r\n Pattern emailPattern = Pattern.compile(emailPatternString, Pattern.CASE_INSENSITIVE);\r\n Matcher emailMatcher;\r\n \r\n Pattern phoneNumPattern = Pattern.compile(phoneNumString);\r\n Matcher phoneNumMatcher;\r\n \r\n // Validation for no length or over database size limit\r\n if ((custFirstNameTextField.getText() == null || custFirstNameTextField.getText().length() == 0) || (custFirstNameTextField.getText().length() > 25)) {\r\n errorMessage += \"First name has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custLastNameTextField.getText() == null || custLastNameTextField.getText().length() == 0) || (custLastNameTextField.getText().length() > 25)) {\r\n errorMessage += \"Last name has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custAddressTextField.getText() == null || custAddressTextField.getText().length() == 0) || (custAddressTextField.getText().length() > 75)) {\r\n errorMessage += \"Address has to be between 1 and 75 characters.\\n\";\r\n }\r\n \r\n if ((custCityTextField.getText() == null || custCityTextField.getText().length() == 0) || (custCityTextField.getText().length() > 50)) {\r\n errorMessage += \"City has to be between 1 and 50 characters.\\n\";\r\n }\r\n \r\n if ((custProvinceTextField.getText() == null || custProvinceTextField.getText().length() == 0) || (custProvinceTextField.getText().length() > 2)) {\r\n errorMessage += \"Province has to be a two-letter abbreviation.\\n\";\r\n }\r\n \r\n if ((custPostalCodeTextField.getText() == null || custPostalCodeTextField.getText().length() == 0) || (custPostalCodeTextField.getText().length() > 7)) {\r\n errorMessage += \"Postal Code has to be between 1 and 7 characters.\\n\";\r\n }\r\n \r\n if ((custCountryTextField.getText() == null || custCountryTextField.getText().length() == 0) || (custCountryTextField.getText().length() > 25)) {\r\n errorMessage += \"Country has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custHomePhoneTextField.getText() == null || custHomePhoneTextField.getText().length() == 0) || (custHomePhoneTextField.getText().length() > 20)) {\r\n errorMessage += \"Phone number has to be between 1 and 20 characters long.\\n\";\r\n } else {\r\n phoneNumMatcher = phoneNumPattern.matcher(custHomePhoneTextField.getText());\r\n if (!phoneNumMatcher.matches()) {\r\n errorMessage += \"Phone number not in the correct format: (111) 111-1111.\\n\";\r\n }\r\n }\r\n \r\n if ((custBusinessPhoneTextField.getText() == null || custBusinessPhoneTextField.getText().length() == 0) || (custBusinessPhoneTextField.getText().length() > 20)) {\r\n errorMessage += \"Phone number has to be between 1 and 20 characters long.\\n\";\r\n } else {\r\n phoneNumMatcher = phoneNumPattern.matcher(custBusinessPhoneTextField.getText());\r\n if (!phoneNumMatcher.matches()) {\r\n errorMessage += \"Phone number not in the correct format: (111) 111-1111.\\n\";\r\n }\r\n }\r\n \r\n if ((custEmailTextField.getText() == null || custEmailTextField.getText().length() == 0) || (custEmailTextField.getText().length() > 50)) {\r\n errorMessage += \"Email has to be between 1 and 50 characters.\\n\";\r\n } else {\r\n emailMatcher = emailPattern.matcher(custEmailTextField.getText());\r\n if (!emailMatcher.matches()) {\r\n errorMessage += \"Email format is not correct. Should be in the format [email protected].\\n\"; \r\n } \r\n }\r\n \r\n if (errorMessage.length() > 0) {\r\n Alert alert = new Alert(AlertType.ERROR, errorMessage, ButtonType.OK);\r\n alert.setTitle(\"Input Error\");\r\n alert.setHeaderText(\"Please correct invalid fields\");\r\n alert.showAndWait();\r\n \r\n return false;\r\n }\r\n \r\n return true;\r\n }", "private void validateFields(){\n String email = edtEmail.getText().toString().trim();\n String number=edtPhone.getText().toString().trim();\n String cc=txtCountryCode.getText().toString();//edtcc.getText().toString().trim();\n String phoneNo=cc+number;\n // Check for a valid email address.\n\n\n if (TextUtils.isEmpty(email)) {\n mActivity.showSnackbar(getString(R.string.error_empty_email), Toast.LENGTH_SHORT);\n return;\n\n } else if (!Validation.isValidEmail(email)) {\n mActivity.showSnackbar(getString(R.string.error_title_invalid_email), Toast.LENGTH_SHORT);\n return;\n\n }\n\n if(TextUtils.isEmpty(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_empty_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n if(!Validation.isValidMobile(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_title_invalid_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n\n if(selectedCurrency==null){\n //mActivity.showSnackbar(getString(R.string.str_select_currency), Toast.LENGTH_SHORT);\n Snackbar.make(getView(),\"Currency data not found!\",Snackbar.LENGTH_LONG)\n .setAction(\"Try again\", new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n getAllCurrency();\n }\n }).show();\n return;\n }\n try {\n JsonObject object = new JsonObject();\n object.addProperty(KEY_EMAIL, email);\n object.addProperty(KEY_PHONE,phoneNo);\n object.addProperty(KEY_CURRENCY,selectedCurrency.getId().toString());\n updateUser(object,token);\n }catch (Exception e){\n\n }\n\n }", "public static boolean validateMobile(String phone){\n int k=0;\n k=phone.length();\n if(k==10){\n return true;\n }\n return false;\n }", "private void txtphnoFocusLost(java.awt.event.FocusEvent evt) {\n String ph=txtphno.getText();\n char[]ch=ph.toCharArray();\n int j=0;\n if(ph.length()!=10)\n {\n JOptionPane.showMessageDialog(this, \"You Entered Wrong phone number\");\n }\n \n for(int i=0; i<ph.length(); i++)\n {\n if(ch[i]<48 || ch[i]>57)\n {\n j++;\n }\n }\n \n if(j!=0)\n {\n JOptionPane.showMessageDialog(this, \"Only Numerical Values should be Entered\");\n\n }\n }", "private boolean isPhoneValid(String phone){\n try{\n Long.parseLong(phone.replace(\"-\", \"\").replace(\"(\", \"\")\n .replace(\")\", \"\"));\n return true;\n } catch (Exception e){\n return false;\n }\n }", "public static boolean checkValidInputPhone(String inputPhoneNumber) {\n if (inputPhoneNumber == null) {\n return false;\n }\n Pattern pattern = Pattern.compile(\"^([0-9]){9,10}$\");\n Matcher matcher = pattern.matcher(inputPhoneNumber);\n return matcher.matches();\n }", "boolean hasPhoneNumber();", "private boolean validate() {\n if(edtMobileNumber.getText().toString().length() <= 0){\n edtMobileNumber.setFocusable(true);\n edtMobileNumber.setError(Constants.ERR_MSG_MOBILE);\n return false;\n }else if(edtFirstName.getText().toString().length() <= 0){\n edtFirstName.setFocusable(true);\n edtFirstName.setError(Constants.ERR_MSG_FIRST_NAME);\n return false;\n }else if(edtLastName.getText().toString().length() <= 0){\n edtLastName.setFocusable(true);\n edtLastName.setError(Constants.ERR_MSG_LAST_NAME);\n return false;\n }else if(edtDateOfBirth.getText().toString().length() <= 0){\n edtDateOfBirth.setFocusable(true);\n edtDateOfBirth.setError(Constants.ERR_MSG_DATE_OF_BIRTH);\n return false;\n }else if(edtEnterPin.getText().toString().length() <= 0){\n edtEnterPin.setFocusable(true);\n edtEnterPin.setError(Constants.ERR_MSG_PIN);\n return false;\n }else if(edtConfirmPin.getText().toString().length() <= 0){\n edtConfirmPin.setFocusable(true);\n edtConfirmPin.setError(Constants.ERR_MSG_CONFIRM_PIN);\n return false;\n }else if(spnStatus.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_STATUS, Toast.LENGTH_SHORT).show();\n return false;\n }else if(spnBloodGroup.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_BLOOD_GROUP, Toast.LENGTH_SHORT).show();\n return false;\n }else if(rgGender.getCheckedRadioButtonId() == -1){\n Toast.makeText(context,Constants.ERR_MSG_GENDER,Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public void validate_the_Account_Number_in_Customer_Account_Summary_of_Customer_Tab(String AccountNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Account Number\").replaceAll(\"M_InnerText\", AccountNumber), \"Account Number - \"+AccountNumber, false);\n\t\tReport.fnReportPageBreak(\"Customer Account Summary\", driver);\n\t}", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "private void validateDetails() {\n\n clearErrors();\n Utils.hide_keyboard(getActivity());\n\n boolean valid = true;\n\n String cvv = cvvTv.getText().toString();\n String expiryDate = cardExpiryTv.getText().toString();\n String cardNo = cardNoTv.getText().toString();\n\n if (cvv.length() < 3) {\n valid = false;\n cvvTil.setError(\"Enter a valid cvv\");\n }\n\n if (expiryDate.length() != 5) {\n cardExpiryTil.setError(\"Enter a valid expiry date\");\n valid = false;\n }\n\n String cardNoStripped = cardNo.replaceAll(\"\\\\s\", \"\");\n\n if (cardNoStripped.length() < 12 ) {\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n else {\n try {\n Long parsed = Long.parseLong(cardNoStripped);\n }\n catch (Exception e) {\n e.printStackTrace();\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n }\n\n if (valid) {\n\n if (saveCardSwitch.isChecked()) {\n int cardLen = cardNoStripped.length();\n cardFirst6 = cardNoStripped.substring(0, 6);\n cardLast4 = cardNoStripped.substring(cardLen - 4, cardLen);\n shouldISaveThisCard = true;\n presenter.savePotentialCardDets(cardFirst6, cardLast4);\n }\n\n //make request\n PayloadBuilder builder = new PayloadBuilder();\n builder.setAmount(thetellerInitializer.getAmount() + \"\")\n .setNarration(thetellerInitializer.getNarration())\n .setCardno(cardNoStripped)\n .set3dUrl(thetellerInitializer.get3dUrl())\n .setEmail(thetellerInitializer.getEmail())\n .setCurrency(thetellerInitializer.getCurrency())\n .setMerchant_id(thetellerInitializer.getMerchant_id())\n .setCvv(cvv).setFirstname(thetellerInitializer.getfName())\n .setLastname(thetellerInitializer.getlName())\n .setIP(Utils.getDeviceImei(getActivity()))\n .setTxRef(thetellerInitializer.getTxRef())\n .setExpiryyear(expiryDate.substring(3,5))\n .setExpirymonth(expiryDate.substring(0,2))\n .setMeta(thetellerInitializer.getMeta())\n .setApiUser(thetellerInitializer.getApiUser())\n .setApiKey(thetellerInitializer.getApiKey())\n .setDevice_fingerprint(Utils.getDeviceImei(getActivity()))\n .setCardType(cardType);\n\n if (thetellerInitializer.getPayment_plan() != null) {\n builder.setPaymentPlan(thetellerInitializer.getPayment_plan());\n }\n\n body = builder.createPayload();\n\n presenter.chargeCard(body, thetellerConstants.API_KEY);\n }\n }", "private boolean isPhoneValid(String phone) {\n return !phone.contains(\" \");\r\n }", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "@Test\n\t\tvoid givenEmail_CheckForValidationForMobile_RetrunTrue() {\n\t\t\tboolean result = ValidateUserDetails.validateMobile(\"98 9808229348\");\n\t\t\tAssertions.assertTrue(result);\n\t\t}", "@Test\n public void testIsValidPhonenumber() {\n System.out.println(\"isValidPhonenumber\");\n String phonenumber = \"gd566666666666666666666666666666666666666\";\n boolean expResult = false;\n boolean result = ValidVariables.isValidPhonenumber(phonenumber);\n assertEquals(expResult, result);\n }", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "@Override\r\n\tpublic CreditCardType validate(String ccNumber) \r\n\t\t\tthrows NullPointerException, IllegalArgumentException \r\n\t{\t\r\n\t\tSharedUtil.checkIfNulls(\"Null credit card number\", ccNumber);\r\n\t\tccNumber = SharedStringUtil.trimOrNull(ccNumber);\r\n\t\tccNumber = ccNumber.replaceAll(\"[ -]\", \"\");\r\n\t\t\r\n \tif (ccNumber.matches(pattern))\r\n \t{\r\n \t\treturn this;\r\n \t}\r\n \t\t\r\n \tthrow new IllegalArgumentException(\"Invalid Credit Card Type \" + ccNumber);\r\n\t\t\r\n\t}", "public static boolean checkPhoneNumber(String phone){\n String regex = \"\\\\d{9}\"; \n if (phone.matches(regex))\n return true;\n else\n return false;\n }", "private boolean isPhoneValid(String password) {\n return password.length() == 10;\r\n }", "private boolean validateForm() {\n Boolean validFlag = true;\n String email = emailTxt.getText().toString().trim();\n String name = nameTxt.getText().toString().trim();\n String phone = phoneTxt.getText().toString().trim();\n String password = passwordTxt.getText().toString();\n String confirPassWord = confirmPasswordTxt.getText().toString();\n\n Pattern emailP = Pattern.compile(\"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\", Pattern.CASE_INSENSITIVE);\n Matcher emailM = emailP.matcher(email);\n boolean emailB = emailM.find();\n\n if (TextUtils.isEmpty(email) || email.equals(\"\") || !emailB) {\n emailTxt.setError(\"Email bị để trống hoặc không dúng định dạng.\");\n validFlag = false;\n } else {\n emailTxt.setError(null);\n }\n\n if (TextUtils.isEmpty(password) || password.length() < 6) {\n passwordTxt.setError(\"Mật khẩu phải 6 ký tự trở lên\");\n validFlag = false;\n } else {\n passwordTxt.setError(null);\n }\n\n Pattern phoneP = Pattern.compile(\"[0-9]{8,15}$\");\n Matcher phoneM = phoneP.matcher(phone);\n boolean phoneB = phoneM.find();\n\n if (TextUtils.isEmpty(phone) || phone.length() < 8 || phone.length() > 15 || !phoneB) {\n phoneTxt.setError(\"Số điện thoại bị để trống hoặc không đúng định dạng\");\n validFlag = false;\n } else {\n phoneTxt.setError(null);\n }\n if (confirPassWord.length() < 6 || !confirPassWord.equals(password)) {\n confirmPasswordTxt.setError(\"Xác nhận mật khẩu không đúng\");\n validFlag = false;\n } else {\n confirmPasswordTxt.setError(null);\n }\n\n Pattern p = Pattern.compile(\"[0-9]\", Pattern.CASE_INSENSITIVE);\n Matcher m = p.matcher(name);\n boolean b = m.find();\n if (b) {\n nameTxt.setError(\"Tên tồn tại ký tự đặc biệt\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n if (TextUtils.isEmpty(name)) {\n nameTxt.setError(\"Không được để trống tên.\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n\n return validFlag;\n }", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "@Test\n\t\tvoid WithoutSpace_CheckForValidationForMobile_RetrunFalse() {\n\t\t\tboolean result = ValidateUserDetails.validateMobile(\"919874563214\");\n\t\t\tAssertions.assertFalse(result);\n\t\t}", "public void SetCheckoutRegistrationPhonecode_number(String phoneno){\r\n\r\n\t\tString Phoneno = getValue(phoneno);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Registration Phone code and number should be entered as , \"+Phoneno);\r\n\t\ttry{\r\n\r\n\r\n\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonenumber\"),Phoneno);\r\n\t\t\tSystem.out.println(\"Registration Phone code and number is entered as , \"+Phoneno);\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Registration Phone code and number is entered as , \"+Phoneno);\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Registration Phone number is not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"checkoutregistrationPhonenumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" / \"+elementProperties.getProperty(\"checkoutregistrationPhonenumber\").toString().replace(\"By.\", \" \")+\r\n\t\t\t\t\t\" not found\");\r\n\t\t}\r\n\r\n\t}", "private boolean isValidMobileNumber(String number) {\n return Patterns.PHONE.matcher(number).matches() && (number.length() > 10);\n }", "public String validarTelefono(String tel) {\n int lon = tel.length();\n if (lon == 9) {\n if (isNumeric(tel)) {\n return tel;\n } else {\n return \"\";\n }\n } else if (lon == 8) {\n return \"0\" + tel;\n } else if (lon == 7) {\n return \"07\" + tel;\n } else if (lon == 6) {\n return \"072\" + tel;\n } else {\n return \"\";\n }\n }", "public static boolean isValidPhoneNo(String userInput) {\n return Pattern.matches(Constants.PHONENO_VALIDATION, userInput);\n }", "public void SetCheckoutRegistrationPhonecode_number(String code, String phoneno){\r\n\t\tString Code = getValue(code);\r\n\t\tString Phoneno = getValue(phoneno);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:- \"+Code+\" , \"+Phoneno);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Registration Phone code and Phone number should be entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\ttry{\r\n\t\t\tif((countrygroup_phoneNo).contains(countries.get(countrycount))){\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonenumber\"),Phoneno);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonecode\"),Code);\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonenumber\"),Phoneno);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tSystem.out.println(\"Registration Phone code and number is entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Registration Phone code and number is entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Registration Phone code and number is not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtcheckoutregistrationPhonecode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" / \"+elementProperties.getProperty(\"txtcheckoutregistrationPhonenumber\").toString().replace(\"By.\", \" \")+\r\n\t\t\t\t\t\" not found\");\r\n\t\t}\r\n\r\n\t}", "@ApiModelProperty(value = \"Collection of information that identifies a phone number, as defined by telecom services.\")\n\n@Pattern(regexp=\"\\\\+[0-9]{1,3}-[0-9()+\\\\-]{1,30}\") \n public String getPhoneNumber() {\n return phoneNumber;\n }", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public void validate_the_Telephone_Home_in_Contact_Details_of_Customer_Tab(String TelephoneHome)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneHome.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Home\").replaceAll(\"M_InnerText\", TelephoneHome), \"Telephone - Home - \"+TelephoneHome, false);\n\t}", "private boolean isValidMobile(String phone) {\n if (!Pattern.matches(\"[a-zA-Z]+\", phone)) {\n return phone.length() == 10;\n }\n return false;\n }", "public boolean isValid(){\n Email.setErrorEnabled(false);\n Email.setError(\"\");\n Fname.setErrorEnabled(false);\n Fname.setError(\"\");\n Lname.setErrorEnabled(false);\n Lname.setError(\"\");\n Pass.setErrorEnabled(false);\n Pass.setError(\"\");\n Mobileno.setErrorEnabled(false);\n Mobileno.setError(\"\");\n Cpass.setErrorEnabled(false);\n Cpass.setError(\"\");\n area.setErrorEnabled(false);\n area.setError(\"\");\n Houseno.setErrorEnabled(false);\n Houseno.setError(\"\");\n Pincode.setErrorEnabled(false);\n Pincode.setError(\"\");\n\n boolean isValid=false,isValidname=false,isValidhouseno=false,isValidlname=false,isValidemail=false,isValidpassword=false,isValidconfpassword=false,isValidmobilenum=false,isValidarea=false,isValidpincode=false;\n if(TextUtils.isEmpty(fname)){\n Fname.setErrorEnabled(true);\n Fname.setError(\"Enter First Name\");\n }else{\n isValidname=true;\n }\n if(TextUtils.isEmpty(lname)){\n Lname.setErrorEnabled(true);\n Lname.setError(\"Enter Last Name\");\n }else{\n isValidlname=true;\n }\n if(TextUtils.isEmpty(emailid)){\n Email.setErrorEnabled(true);\n Email.setError(\"Email Address is required\");\n }else {\n if (emailid.matches(emailpattern)) {\n isValidemail = true;\n } else {\n Email.setErrorEnabled(true);\n Email.setError(\"Enter a Valid Email Address\");\n }\n }\n if(TextUtils.isEmpty(password)){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Enter Password\");\n }else {\n if (password.length()<8){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Weak Password\");\n }else {\n isValidpassword = true;\n }\n }\n if(TextUtils.isEmpty(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Enter Password Again\");\n }else{\n if (!password.equals(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Password Dosent Match\");\n }else{\n isValidconfpassword=true;\n }\n }\n if(TextUtils.isEmpty(mobile)){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Enter Phone Number\");\n }else{\n if (mobile.length()<10){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Invalid Mobile Number\");\n } else {\n isValidmobilenum = true;\n }\n }\n if(TextUtils.isEmpty(Area)){\n area.setErrorEnabled(true);\n area.setError(\"Area is Required\");\n }else{\n isValidarea=true;\n }\n if(TextUtils.isEmpty(pincode)){\n Pincode.setErrorEnabled(true);\n Pincode.setError(\"Please Enter Pincode\");\n }else{\n isValidpincode=true;\n }\n if(TextUtils.isEmpty(house)){\n Houseno.setErrorEnabled(true);\n Houseno.setError(\"House field cant be empty\");\n }else{\n isValidhouseno=true;\n }\n isValid=(isValidarea && isValidpincode && isValidconfpassword && isValidpassword && isValidemail && isValidname &&isValidmobilenum && isValidhouseno && isValidlname)? true:false;\n return isValid;\n\n }", "public boolean isCorrectPhoneNumberFormat( String number ){\n try {\n // Test for '('\n StringTokenizer tokenizer = new StringTokenizer( number, \"()-\", true );\n String token1 = tokenizer.nextToken();\n if ( token1.compareTo(\"(\") != 0 ) return false;\n \n // Test for three digit area code\n String token2 = tokenizer.nextToken();\n if ( token2.length() != 3 ) return false;\n int areacode = Integer.parseInt(token2);\n \n // Test for ')'\n String token3 = tokenizer.nextToken();\n if ( token3.compareTo(\")\") != 0 ) return false;\n \n // Test for three digit number\n String token4 = tokenizer.nextToken();\n if ( token4.length() != 3 ) return false;\n int threedigits = Integer.parseInt(token4);\n \n // Test for '-'\n String token5 = tokenizer.nextToken();\n if ( token5.compareTo(\"-\") != 0 ) return false;\n \n // Test for four digit number\n String token6 = tokenizer.nextToken();\n if ( token6.length() != 4 ) return false;\n int fourdigits = Integer.parseInt(token6);\n \n } catch ( Exception e ){\n return false;\n }\n return true;\n }", "private void validateData() {\n }", "private boolean checkPhoneNum() {\n\t\tphoneNum = et_phone.getText().toString().trim();\r\n\t\tif(isMobileNO(phoneNum)){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "protected boolean isNumberValid(@NotNull ConversationContext context, @NotNull Number input) {\n/* 30 */ return true;\n/* */ }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "private boolean validate(String name, String phone, String email, String description) {\n if (name.equals(null) || name.equals(\"\") || !isValidMobile(phone) || !isValidMail(email) || description.equals(null) || description.equals(\"\")) {\n\n if (name.equals(null) || name.equals(\"\")) {\n nameText.setError(\"Enter a valid Name\");\n } else {\n nameText.setError(null);\n }\n if (!isValidMobile(phone)) {\n phoneNumber.setError(\"Enter a valid Mobile Number\");\n } else {\n phoneNumber.setError(null);\n }\n if (!isValidMail(email)) {\n emailText.setError(\"Enter a valid Email ID\");\n } else {\n emailText.setError(null);\n }\n if (description.equals(null) || description.equals(\"\")) {\n descriptionText.setError(\"Add few lines about you\");\n } else {\n descriptionText.setError(null);\n }\n return false;\n } else\n return true;\n }", "private void check1(){\n \n\t\tif (firstDigit != 4){\n valid = false;\n errorCode = 1;\n }\n\t}", "public void validateEnterDiningInformation(MessageContext messageContext){\r\n\t\tif (StringUtils.hasText(creditCardNumber)){\r\n\t\t\tif (creditCardNumber.length() != 16){\r\n\t\t\t\tmessageContext.addMessage(new MessageBuilder().error()\r\n\t\t\t\t\t\t.source(\"creditCardNumber\")\r\n\t\t\t\t\t\t.code(\"error.invalidFormat.DiningForm.creditCardNumber\").build());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void validateCreditNumber(FacesContext ctx, UIComponent component,\r\n\t\t\tObject value) throws ValidatorException {\n\t\tCreditCardType ccType = (CreditCardType)creditCardTypeInput.getValue();\r\n\t\tBoolean useCC = customer.getUseCreditCard();\r\n if (useCC != null && useCC && ccType != null) {\r\n\t\t\t// Check credit card number\r\n\t\t\tint length;\r\n\t\t\tif (ccType == CreditCardType.CARD_A) {\r\n\t\t\t\tlength = 4;\r\n\t\t\t} else {\r\n\t\t\t\tlength = 5;\r\n\t\t\t}\r\n String ccNumber = (String)value;\r\n\t\t\tif (ccNumber != null && !ccNumber.matches(\"\\\\d{\" + length + \"}\")) {\r\n FacesMessage msg = GuiUtil.getFacesMessage(\r\n ctx, FacesMessage.SEVERITY_ERROR, \"validateCreditCardNumber.NUMBER\", length);\r\n\t\t\t\tthrow new ValidatorException(msg);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean validateNumber() {\r\n\t\tif (creditCardNumber == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// Just to check that the given number is in numerical form\r\n\t\t@SuppressWarnings(\"unused\")\r\n\t\tlong intForm;\r\n\t\ttry {\r\n\t\t\tintForm = Long.parseUnsignedLong(creditCardNumber);\r\n\t\t} catch (NumberFormatException nfe) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tswitch (creditCardName) {\r\n\t\tcase CreditCardData.VISA: {\r\n\r\n\t\t\treturn validateVisa();\r\n\t\t}\r\n\t\tcase CreditCardData.MASTERCARD: {\r\n\r\n\t\t\treturn validateMasterCard();\r\n\t\t}\r\n\t\tcase CreditCardData.AMERICAN_EXPRESS: {\r\n\r\n\t\t\treturn validateAmericanExpress();\r\n\t\t}\r\n\t\tdefault: {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t}\r\n\t}", "private static String validateNumber(String number) {\r\n\r\n\t\t/*Checking if the number is null, or if its length is not equals to 16\r\n\t\t * or if the first two digits are not between 51 and 55.\r\n\t\t * If one of the following is not respected, an Illegal Argument\r\n\t\t * Exception with an appropriate message will be thrown.\r\n\t \t */\r\n\t\ttry{\r\n\t\t\tif (number == null \r\n\t\t\t\t\t|| number.length() != 16 \r\n\t\t\t\t\t|| Integer.parseInt(number.substring(0, 2)) < 51\r\n\t\t\t\t\t|| Integer.parseInt(number.substring(0, 2)) > 55)\r\n\t\t\tthrow new IllegalArgumentException(\"The Master card given does not respect the validation.\");\r\n\t\t}catch(NumberFormatException npe){\r\n\t\t\tthrow new IllegalArgumentException(\"The Master card given does not respect the validation.\");\r\n\t\t} \r\n\t\treturn number;\r\n\t}", "public void checkInputCompany(TextField phoneNo, TextField zip, TextField name, KeyEvent event) {\n if (event.getSource() == phoneNo) {\n redFieldNumber(phoneNo, event);\n } else if (event.getSource() == zip) {\n redFieldCPRNoAndZip(zip, event);\n } else if (event.getSource() == name) {\n checkIfRedName(name, event);\n }\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "public boolean isPhoneValid(String phone) {\n return phone.length() < 11;\n }", "public void validateRpd13s10()\n {\n // This guideline cannot be automatically tested.\n }" ]
[ "0.7054158", "0.6963889", "0.6936419", "0.69360226", "0.67336196", "0.6724876", "0.67086476", "0.65895987", "0.6499997", "0.64548683", "0.63844645", "0.63796407", "0.6359037", "0.6356545", "0.633753", "0.6317979", "0.63172275", "0.6286273", "0.6258973", "0.6232366", "0.62276226", "0.6210268", "0.6193991", "0.61861646", "0.6180037", "0.61789274", "0.61096156", "0.61087996", "0.6101214", "0.60773987", "0.60695314", "0.6058988", "0.6051334", "0.6048257", "0.60290825", "0.60069865", "0.59831923", "0.5980543", "0.5978375", "0.59749484", "0.5937444", "0.5923937", "0.59235597", "0.5916581", "0.5914271", "0.590371", "0.5901162", "0.58952355", "0.58900553", "0.588902", "0.5888792", "0.5888056", "0.58804053", "0.58661526", "0.58639616", "0.5859829", "0.58588123", "0.5835574", "0.58316", "0.5828447", "0.58118623", "0.58105284", "0.57948303", "0.5794356", "0.5783763", "0.5768982", "0.57661426", "0.5763169", "0.57631284", "0.5759422", "0.57581955", "0.5752434", "0.57505655", "0.57482207", "0.5736944", "0.5731841", "0.5729296", "0.5726511", "0.5691785", "0.56816447", "0.568155", "0.5678219", "0.5670227", "0.5663054", "0.5660522", "0.56591755", "0.56498504", "0.564652", "0.56416595", "0.5635678", "0.563361", "0.563076", "0.5629078", "0.5618022", "0.560369", "0.5594002", "0.55928594", "0.5592792", "0.5592269", "0.55908585" ]
0.71314687
0
Validation Functions Description : To validate the Package Name in Customer Account Summary of Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:05 Oct 2016 Modified By:Raja Parameter:PackageName
public void validate_the_Package_Name_in_Customer_Account_Summary_of_Customer_Tab(String PackageName)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll("M_Header", "Landline Account Summary").replaceAll("M_Category", "Package Name").replaceAll("M_InnerText", PackageName), "Package Name - "+PackageName, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Package_Status_in_Customer_Account_Summary_of_Customer_Tab(String PackageStatus)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Package Status\").replaceAll(\"M_InnerText\", PackageStatus), \"Package Status - \"+PackageStatus, false);\n\t}", "public boolean validatePackage() {\n\t\treturn this.validateID() && this.validateFirstName() && this.validateLastName()\n\t\t\t\t&& this.validateBank() && this.validateBSB() && this.validateAccountNumber();\n\t}", "private int doValidateCheck()\n {\n if (Math.min(txtArtifactID.getText().trim().length(),\n txtGroupID.getText().trim().length()) == 0)\n {\n return 1;\n }\n if (txtPackage.getText().trim().length() > 0)\n {\n boolean matches = txtPackage.getText().matches(\"[a-zA-Z0-9\\\\.]*\"); //NOI18N\n if (!matches) {\n return 2;\n } else {\n if (txtPackage.getText().startsWith(\".\") || txtPackage.getText().endsWith(\".\"))\n {\n return 2;\n }\n }\n }\n return 0;\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public boolean validateEmployeePackage() {\n\t\treturn this.validateID() && this.validateFirstName() && this.validateLastName();\n\t}", "public void validate_the_Account_Number_in_Customer_Account_Summary_of_Customer_Tab(String AccountNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Account Number\").replaceAll(\"M_InnerText\", AccountNumber), \"Account Number - \"+AccountNumber, false);\n\t\tReport.fnReportPageBreak(\"Customer Account Summary\", driver);\n\t}", "@Override\r\n\tpublic boolean isValid(String code, ConstraintValidatorContext theConstaint) {\r\n \r\n titles = customerService.getTitles();\r\n \r\n for(String i : titles)\r\n {\r\n \tSystem.out.println(i);\r\n }\r\n //descriptions = ec.getDescriptions();\r\n for(String i : titles)\r\n {\r\n\t result = code.equals(i);\r\n\t\tif(code != null)\t\t\r\n\t\t\tresult = code.equals(i);\r\n\t\telse\r\n\t\t\tresult = true;\r\n\t\tif(result == true)\r\n\t\t\tbreak;\r\n }\r\n\t\treturn result;\r\n\t}", "public int validatePackageResult() {\n\t\tif (this.validatePackage())\n\t\t\treturn EmployeeConnection.VALID;\n\t\tif (!this.validateID())\n\t\t\treturn EmployeeConnection.INVALID_ID;\n\t\tif (!this.validateFirstName())\n\t\t\treturn EmployeeConnection.INVALID_FIRST_NAME;\n\t\tif (!this.validateLastName())\n\t\t\treturn EmployeeConnection.INVALID_LAST_NAME;\n\t\tif (!this.validateBank())\n\t\t\treturn EmployeeConnection.INVALID_BANK;\n\t\tif (!this.validateBSB())\n\t\t\treturn EmployeeConnection.INVALID_BSB_NUMBER;\n\t\tif (!this.validateAccountNumber())\n\t\t\treturn EmployeeConnection.INVALID_ACCOUNT_NUMBER;\n\t\treturn EmployeeConnection.INVALID_UNKNOWN;\n\t}", "public void monthlyPayment_Validation() {\n\t\thelper.assertString(monthlyPayment_AftrLogin(), payOffOffer.monthlyPayment_BfrLogin());\n\t\tSystem.out.print(\"The Monthly Payment is: \" + monthlyPayment_AftrLogin());\n\t}", "public String validate() {\n\t\tString msg=\"\";\n\t\t// for name..\n\t\tif(name==null||name.equals(\"\"))\n\t\t{\n\t\t\tmsg=\"Task name should not be blank or null\";\n\t\t}\n\t\tif(name.split(\" \").length>1)\n\t\t{\n\t\t\tmsg=\"multiple words are not allowed\";\n\t\t}\n\t\telse\n\t\t{\n\t\t for(int i=0;i<name.length();i++)\n\t\t {\n\t\t\t char c=name.charAt(i);\n\t\t\t\tif(!(Character.isDigit(c)||Character.isLetter(c)))\n\t\t\t\t{\n\t\t\t\t\tmsg=\"special characters are not allowed\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t }\n\t\t}\n\t\t\t\n\t\t\n\t\t\t// for Description...\n\t\t\tif(desc==null||desc.equals(\"\"))\n\t\t\t{\n\t\t\t\tmsg=\"Task descrshould not be blank or null\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t // for tag...\n\t\t\t \n\t\t\t if(tag==null||tag.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tmsg=\"Task tags not be blank or null\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t // for date { imp here}\n\t\t\t if(tarik!=null)\n\t\t\t {\n\t\t\t SimpleDateFormat sdf=new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\t sdf.setLenient(false); // very imp here..\n\t\t\t try {\n\t\t\t\tDate d=sdf.parse(tarik);\n\t\t\t} catch (ParseException e) {\n\t\t\t\t\n\t\t\t//\tmsg=\"date should be correct foramat\";\n\t\t\t\tmsg=e.getMessage();\n\t\t\t}\n\t\t\t }\n\t\t\t// for prority..\n\t\t\t if(prio<1&&prio>10)\n\t\t\t {\n\t\t\t\t msg=\"prority range is 1 to 10 oly pa\";\n\t\t\t }\n\t\t\t\t\n\t\t\t\tif(msg.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\treturn Constant.SUCCESS;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\treturn msg;\n\t}", "@Override\n\tprotected void validators() {\n\t\tString nsrmc = getDj_nsrxx().getNsrmc();\n\n\t\tif (ValidateUtils.isNullOrEmpty(nsrmc)) {\n\t\t\tthis.setSystemMessage(\"纳税人名称不能为空\", true, null);\n\t\t}\n\n\t}", "boolean validateAccount(String Account) {\n\t\treturn true;\n\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public void VerifyCustomeralsoViewedTitle(String Exptext){\r\n\t\tString[] ExpText = getValue(Exptext).split(\",\", 2);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Title with \"+ExpText+\" should be present in SKU Page\");\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyTextfromList(locator_split(\"txtCustomeralsoOrdered\"), ExpText[1], Integer.valueOf(ExpText[0]))){\r\n\t\t\t\tSystem.out.println(ExpText[1]+\" is present\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- \"+ExpText[1]+\" is present in SKU Page\");\r\n\t\t\t} else{ \r\n\t\t\t\tthrow new Error(\"Actual Text: \"+ExpText[1]+\" is not present in SKU Page\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(NoSuchElementException e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- \"+elementProperties.getProperty(\"txtCustomeralsoOrdered\").toString() +\" is not Present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCustomeralsoOrdered\").toString()\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\t\tcatch(Error Er){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Actual Text: \"+ExpText[1]+\" is not present in SKU Page\");\r\n\t\t\tthrow new Error(\"Expected text - '\"+ExpText[1]+\" and Actual Text : \"+getText(locator_split(\"txtCustomeralsoOrdered\"))+\" is not equal\");\r\n\t\t}\r\n\t}", "private void validateData() {\n }", "public void VerifyCustomeralsoOrderedtitle(String Exptext){\r\n\t\tString[] ExpText = getValue(Exptext).split(\",\", 2);\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Title with \"+ExpText[1]+\" should be present in SKU Page\");\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyTextfromList(locator_split(\"txtCustomeralsoOrdered\"), ExpText[1], Integer.valueOf(ExpText[0]))){\r\n\t\t\t\tSystem.out.println(ExpText[1]+\" is present\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- \"+ExpText[1]+\" is present in SKU Page\");\r\n\t\t\t} else{ \r\n\t\t\t\tthrow new Error(\"Actual Text: \"+ExpText[1]+\" is not present in SKU Page\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(NoSuchElementException e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- \"+elementProperties.getProperty(\"txtCustomeralsoOrdered\").toString() +\" is not Present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCustomeralsoOrdered\").toString()\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\t\tcatch(Error Er){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Actual Text: \"+ExpText[1]+\" is not present in SKU Page\");\r\n\t\t\tthrow new Error(\"Expected text - '\"+ExpText[1]+\" and Actual Text : \"+getText(locator_split(\"txtCustomeralsoOrdered\"))+\" is not equal\");\r\n\t\t}\r\n\t}", "public String validates() {\n this.sr = this.m_oCompany.getServiceRecords();\n if(this.sr.validatesService(this.m_oService)){\n return String.format(m_oService.toString());\n }\n return String.format(\"Invalid service.\");\n }", "private boolean isInputValid() {\n String errorMessage = \"\";\n\n if (ServiceName.getText() == null || ServiceName.getText().length() == 0) {\n errorMessage += \"No valid name!\\n\";\n }\n if (Serviceemail.getText() == null || Serviceemail.getText().length() == 0) {\n Pattern p = Pattern.compile(\"[_A-Za-z0-9][A-Za-z0-9._]*?@[_A-Za-z0-9]+([.][_A-Za-z]+)+\");\n Matcher m = p.matcher(Serviceemail.getText());\n if (m.find() && m.group().equals(Serviceemail.getText())) {\n errorMessage += \"No valid Mail Forment!\\n\";\n }\n }\n if (servicedescrip.getText() == null || servicedescrip.getText().length() == 0) {\n errorMessage += \"No valid description !\\n\";\n }\n if (f == null && s.getImage() == null) {\n errorMessage += \"No valid photo ( please upload a photo !)\\n\";\n }\n if (Serviceprice.getText() == null || Serviceprice.getText().length() == 0) {\n errorMessage += \"No valid prix !\\n\";\n } else {\n // try to parse the postal code into an int.\n try {\n Float.parseFloat(Serviceprice.getText());\n } catch (NumberFormatException e) {\n errorMessage += \"No valid prix (must be a Float)!\\n\";\n }\n }\n if ( !Weekly.isSelected() && !Daily.isSelected() && !Monthly.isSelected()) {\n errorMessage += \"No valid Etat ( select an item !)\\n\";\n }\n if (Servicesatet.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid etat ( select an item !)\\n\";\n }\n if (ServiceCity.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid City ( select an item !)\\n\";\n }\n if (servicetype.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid Type ( select an item !)\\n\";\n }\n if (errorMessage.length() == 0) {\n return true;\n } else {\n // Show the error message.\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Invalid Fields\");\n alert.setHeaderText(\"Please correct invalid fields\");\n alert.setContentText(errorMessage);\n alert.showAndWait();\n return false;\n }\n }", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "private boolean validateInput(){\n Window owner=root.getScene().getWindow();\n inputFileds.addAll(txtfn,txtln,txtsurname,txtDOB,txtResidence,txtMobile,txtID,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().isEmpty()){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n inputFileds.removeAll(txtDOB,txtMobile,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().length()>30){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Sorry the text you entered can not be greater that 30 characters\",\"Text too Long\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n if(username.getText().length()>20 || username.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Username has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid input\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n if(pass.getText().isEmpty()){\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n if(pass.getText().length()>20 || pass.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Password has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n SimpleDateFormat yearFormat = new SimpleDateFormat(\"yyyy\");\n try {\n date = dateFormat.parse(txtDOB.getText());\n Calendar cal=Calendar.getInstance();\n int year=Integer.parseInt(yearFormat.format(date));\n if (year <= 1900 || year>cal.get(Calendar.YEAR)) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n String initialEntry=txtDOB.getText();\n String parsedValue=dateFormat.format(date);\n if(!initialEntry.equals(parsedValue)){\n Dialog.showMessageDialog(owner, \"Note your Date of Birth has been corrected\", \"Date Corrected\",DialogIcon.INFORMATION);\n }\n txtDOB.setText(dateFormat.format(date));\n } catch (ParseException ex) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n try {\n int mobile=Integer.parseInt(txtMobile.getText());\n } catch (NumberFormatException e) {\n Dialog.showMessageDialog(owner, \"Invalid Mobile Number\", \"Invalid data\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n if(txtMobile.getText().length() != 10){\n Dialog.showMessageDialog(owner, \"Sorry your Mobile Number is invalid\", \"Invalid input\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n String sql=\"select Username,Password from users where Username=?\";\n try(PreparedStatement prstmt=con.prepareStatement(sql)) {\n prstmt.setString(1, username.getText());\n ResultSet rs=prstmt.executeQuery();\n if(rs.next()){\n Dialog.showMessageDialog(owner, \"Sorry Username already exists\\n Please change to different Username\", \"Username Exists\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n rs.close();\n } catch (SQLException e) {\n System.err.println(e);\n }\n return true;\n }", "private boolean checkInfo()\n {\n boolean flag = true;\n if(gName.isEmpty())\n {\n groupName.setError(\"Invalid name\");\n flag = false;\n }\n if(gId.isEmpty())\n {\n groupId.setError(\"Invalid id\");\n flag = false;\n }\n if(gAddress.isEmpty())\n {\n groupAddress.setError(\"Invalid address\");\n flag = false;\n }\n\n for(char c : gName.toCharArray()){\n if(Character.isDigit(c)){\n groupName.setError(\"Invalid Name\");\n flag = false;\n groupName.requestFocus();\n }\n }\n\n if(groupType.isEmpty())\n {\n flag = false;\n rPublic.setError(\"Choose one option\");\n }\n\n if(time.isEmpty())\n time = \"not set\";\n\n if(groupDescription.getText().toString().length()<20||groupDescription.getText().toString().length()>200)\n groupDescription.setError(\"Invalid description\");\n\n return flag;\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "@Test(groups ={Slingshot,Regression})\n\tpublic void verifyTitleField() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify the Title Field validations and its appropriate error message\"); \t \t \t \n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMVTestDataspl\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ClickAddNewUserLink()\n\t\t.AddUserRadioButton()\n\t\t.StandardUserCreation()\n\t\t.ValidateAddnewUserTitleField(userProfile);\t\t\t\t \t \t\t\t\t\t\t\n\t}", "@And(\"^user enters \\\"([^\\\"]*)\\\" as Company Name$\")\n\tpublic void user_enters_as_Company_Name(String arg1) throws Throwable {\n\t\ttry {\n\t\t SeleniumOperations.setText(\"//input[@name='name']\",arg1);\n\t\t HTMLReportGenerator.StepDetails(\"pass\", \"user enters CompanyName\", \"Expected:User should able to enter CompanyName,Actual:User enters CompanyName successfully \");\n\t\t \n\t\t// String op1=\"Expected:User should able to enter Company name:\"+arg1+\",Actual:User entered Company name Successfully,Exception:NA\";\n\t \t//System.out.println(op1);\n\t\t}\n\t\tcatch(Exception ex)\n\t\t{\n\t\t\t HTMLReportGenerator.StepDetails(\"Fail\", \"user enters CompanyName\", \"Expected:User should able to enter CompanyName,Actual:Fail to enters CompanyName\");\n\t\t\t// String op1=\"Expected:User should able to enter Company name:\"+arg1+\",Actual:Fail to enter Company name ,Exception:NA\"+ex.getMessage();\n\t\t //\tSystem.out.println(op1);\n\t\t \n\t\t}\n\t}", "public void validateRpd3s12()\n {\n // This guideline cannot be automatically tested.\n }", "private void validationNom(String nameGroup) throws FormValidationException {\n\t\tif (nameGroup != null && nameGroup.length() < 3) {\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"Le nom d'utilisateur doit contenir au moins 3 caractères.\");\n\t\t\tthrow new FormValidationException(\n\t\t\t\t\t\"Le nom d'utilisateur doit contenir au moins 3 caractères.\");\n\t\t}\n\n\t\t// TODO checker si le nom exist pas ds la bdd\n\t\t// else if (){\n\t\t//\n\t\t// }\n\t}", "public void validateRpd14s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "protected void validateFirstName(){\n Boolean firstName = Pattern.matches(\"[A-Z][a-z]{2,}\",getFirstName());\n System.out.println(nameResult(firstName));\n }", "public void Apr_Validation() {\n\t\thelper.assertString(Apr_AftrLogin(), payOffOffer.Apr_BfrLogin());\n\t\tSystem.out.print(\"The APR is: \" + Apr_AftrLogin());\n\n\t}", "private void validateApiProductInfo(APIProduct product) throws APIManagementException {\n String apiName = product.getId().getName();\n if (apiName == null) {\n handleException(\"API Name is required.\");\n } else if (containsIllegals(apiName)) {\n handleException(\"API Name contains one or more illegal characters \" +\n \"( \" + APIConstants.REGEX_ILLEGAL_CHARACTERS_FOR_API_METADATA + \" )\");\n }\n //version is not a mandatory field for now\n if (!hasValidLength(apiName, APIConstants.MAX_LENGTH_API_NAME)\n || !hasValidLength(product.getId().getVersion(), APIConstants.MAX_LENGTH_VERSION)\n || !hasValidLength(product.getId().getProviderName(), APIConstants.MAX_LENGTH_PROVIDER)\n || !hasValidLength(product.getContext(), APIConstants.MAX_LENGTH_CONTEXT)) {\n throw new APIManagementException(\"Character length exceeds the allowable limit\",\n ExceptionCodes.LENGTH_EXCEEDS);\n }\n }", "@Override\r\n\tpublic void validate(Product p) throws CustomBadRequestException {\r\n\t\tif(p.getName() == null || p.getName().equals(\"\") || p.getBarcode() == null || p.getBarcode().equals(\"\") || p.getMeasure_unit() == null ||\r\n\t\t\t\tp.getMeasure_unit().equals(\"\") || p.getQuantity() == null || p.getQuantity().equals(\"\")|| p.getBrand() == null || p.getBrand().equals(\"\")){\r\n\t\t\tthrow new CustomBadRequestException(\"Incomplete Information about the product\");\r\n\t\t}\r\n\r\n\t\tString eanCode = p.getBarcode();\r\n\t\tString ValidChars = \"0123456789\";\r\n\t\tchar digit;\r\n\t\tfor (int i = 0; i < eanCode.length(); i++) { \r\n\t\t\tdigit = eanCode.charAt(i); \r\n\t\t\tif (ValidChars.indexOf(digit) == -1) {\r\n\t\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Add five 0 if the code has only 8 digits\r\n\t\tif (eanCode.length() == 8 ) {\r\n\t\t\teanCode = \"00000\" + eanCode;\r\n\t\t}\r\n\t\t// Check for 13 digits otherwise\r\n\t\telse if (eanCode.length() != 13) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\t// Get the check number\r\n\t\tint originalCheck = Integer.parseInt(eanCode.substring(eanCode.length() - 1));\r\n\t\teanCode = eanCode.substring(0, eanCode.length() - 1);\r\n\r\n\t\t// Add even numbers together\r\n\t\tint even = Integer.parseInt((eanCode.substring(1, 2))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(3, 4))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(5, 6))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(7, 8))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(9, 10))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(11, 12))) ;\r\n\t\t// Multiply this result by 3\r\n\t\teven *= 3;\r\n\r\n\t\t// Add odd numbers together\r\n\t\tint odd = Integer.parseInt((eanCode.substring(0, 1))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(2, 3))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(4, 5))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(6, 7))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(8, 9))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(10, 11))) ;\r\n\r\n\t\t// Add two totals together\r\n\t\tint total = even + odd;\r\n\r\n\t\t// Calculate the checksum\r\n\t\t// Divide total by 10 and store the remainder\r\n\t\tint checksum = total % 10;\r\n\t\t// If result is not 0 then take away 10\r\n\t\tif (checksum != 0) {\r\n\t\t\tchecksum = 10 - checksum;\r\n\t\t}\r\n\r\n\t\t// Return the result\r\n\t\tif (checksum != originalCheck) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\tif(Float.parseFloat(p.getQuantity()) <= 0){\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Quantity\");\r\n\t\t}\r\n\r\n\r\n\t}", "public void setCustomerName(String name) // this method set the customer name and do validation for customer name\r\n {\r\n if(hitNcounter!=3) // validation for customer name for 3 times, hitNcounter variable count how many times cutomer entered wrone customer name\r\n {\r\n int length=name.length();\r\n \r\n \r\n if(20 <= length) // condition for checking customer name length\r\n {\r\n JOptionPane.showMessageDialog(null,\"Please enter Name between 1 to 20 characters\");\r\n b=false;\r\n hitNcounter++;\r\n }\r\n else if(name.isEmpty()) // condition for checking customer name is empty or not\r\n {\r\n JOptionPane.showMessageDialog(null, \"Please enter Name\");\r\n b=false;\r\n hitNcounter++;\r\n } \r\n else // condition for correct customer name\r\n {\r\n counter++;\r\n if(counterN>=0)\r\n {\r\n \r\n custName=name; // set customer name into custName variable\r\n this.customerName[counterN]=name; // store all customer name in customerName array\r\n \r\n b=true;//set the value of name into itemName array \r\n counterN++; // counterN count the number of customer name entered \r\n }\r\n \r\n }\r\n \r\n }\r\n else\r\n {\r\n JOptionPane.showMessageDialog(null,\"Sorry, You cannot use this service as you have entered wrong data 3 times\");\r\n // if customer enter 3 time wrong data the application is closed\r\n System.exit(0);\r\n }\r\n }", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "public boolean validation(){\n String Venuename= venuename.getText().toString();\n String Address= address.getText().toString();\n String Details= details.getText().toString();\n String Venueimage= venueimage.getText().toString();\n if(Venuename.isEmpty()){\n venuename.setError(\"Please enter the item name\");\n venuename.requestFocus();\n return false;\n }\n if(Address.isEmpty()){\n address.setError(\"Please enter the item name\");\n address.requestFocus();\n return false;\n }\n if(Details.isEmpty()){\n details.setError(\"Please enter the item name\");\n details.requestFocus();\n return false;\n }\n if(Venueimage.isEmpty()){\n venueimage.setError(\"Please Select the image first\");\n return false;\n }\n\n\n return true;\n }", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean validate() {\n\n String plate = _licensePlate.getText().toString();\n\n if(plate.isEmpty() || plate.length() < 8)\n return false;\n\n else if(plate.charAt(2) == '-' || plate.charAt(5) == '-') {\n\n if (Character.isUpperCase(plate.charAt(0)) && Character.isUpperCase(plate.charAt(1))) { // first case\n if (Character.isDigit(plate.charAt(3)) && Character.isDigit(plate.charAt(4))\n && Character.isDigit(plate.charAt(6)) && Character.isDigit(plate.charAt(7)))\n return true;\n }\n\n else if(Character.isUpperCase(plate.charAt(3)) && Character.isUpperCase(plate.charAt(4))) { // second case\n if (Character.isDigit(plate.charAt(0)) && Character.isDigit(plate.charAt(1))\n && Character.isDigit(plate.charAt(6)) && Character.isDigit(plate.charAt(7)))\n return true;\n }\n\n else if(Character.isUpperCase(plate.charAt(6)) && Character.isUpperCase(plate.charAt(7))) { // third case\n if (Character.isDigit(plate.charAt(0)) && Character.isDigit(plate.charAt(1))\n && Character.isDigit(plate.charAt(3)) && Character.isDigit(plate.charAt(4)))\n return true;\n }\n\n else\n return false;\n\n }\n\n return false;\n }", "public void validateRpd3s14()\n {\n // This guideline cannot be automatically tested.\n }", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "@Test\r\n\tpublic void view3_current_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Columns\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t//Removing Column data from another table.\r\n\t\tdata_of_table1 = helper.modify_cols_data_of_table(col_of_table1, data_of_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table1, data_of_table1 );\r\n\t}", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void mpanNameErrorMsgValidation(){\t\t\t \n\tReport.createTestLogHeader(\"Anonymous Submit meter read\", \"Verify the functionality of Supply field and its appropriate error messages\");\n\tSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"SAPSMRGasUserforsingleMeter\");\n\tnew SubmitMeterReadAction()\n\t.openSMRpage(\"Electricity\")\n\t.ValidatempanErrormsg(smrProfile);\t\t\t\n}", "static public boolean VerifiedPackageName(CompileProduct $CProduct, String $PackageName, String CCodeName, int $PackagePos) {\n\t\tint Index; if((Index = CCodeName.lastIndexOf('/')) == -1) Index = 0;\n\t\tString PName = CCodeName.substring(0, Index);\n\t\t\n\t\t// Ensure Package name is well-formed\n\t\tif(($PackageName != null) && PName.equals($PackageName.replaceAll(\"~>\", \"/\")))\n\t\t\treturn true;\n\t\t\n\t\t$CProduct.reportError(\n\t\t\tString.format(\n\t\t\t\t\"Invalid package name '%s' in the code file '%s' <Util_File:37>.\",\n\t\t\t\t$PackageName, CCodeName\n\t\t\t),\n\t\t\tnull, $PackagePos\n\t\t);\n\t\treturn false;\n\t}", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "@Test\r\n\tpublic void view3_COEs_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\t\t//Table 3 - Data .\r\n\t\tList<WebElement> data_of_table3 = driver.findElements(view3_COEs_table_data_val);\r\n\t\t//Table 3 - Columns\r\n\t\tList<WebElement> col_of_table3 = driver.findElements(By.xpath(view3_curr_agent_stats_col));\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> updated_col_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t\r\n\t\t//Adding Column data from another table.\r\n\t\tdata_of_table3 = helper.modify_cols_data_of_table(col_of_table1, data_of_table3, updated_col_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table3, data_of_table3 );\r\n\t}", "@Test\r\n\tpublic void view3_todays_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"CML Service Level\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table2 = driver.findElements(view3_todays_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table2 = driver.findElements(By.xpath(view3_today_data_table));\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table2, data_of_table2 );\r\n\t}", "@Test\n\t\tpublic static void givenFirstName_WhenProper_ShouldReturnTrue() {\n\t\t\tboolean result= ValidateUserDetails.validateFirstName(\"Priyanka\");\n\t\t\tAssertions.assertTrue(result);\n\n\t\t}", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "public boolean validateBankPackage() {\n\t\treturn this.validateBank() && this.validateBSB() && this.validateAccountNumber();\n\t}", "private boolean Validate() {\n EditText titleText = findViewById(R.id.register_movie_title_txt);\n EditText yearText = findViewById(R.id.register_movie_year_txt);\n EditText ratingText = findViewById(R.id.register_movie_rating_txt);\n\n\n boolean is_filled_required_fields = false;\n is_filled_required_fields = titleText.getText().toString().length() > 0\n && yearText.getText().toString().length() > 0\n && ratingText.getText().toString().length() > 0;\n\n if (!is_filled_required_fields) {\n Snackbar mySnackbar = Snackbar.make(findViewById(R.id.activity_register_base_layout), \"Please fill required fields\", BaseTransientBottomBar.LENGTH_SHORT);\n mySnackbar.show();\n }\n return is_filled_required_fields;\n }", "public void validateRpd11s3()\n {\n // This guideline cannot be automatically tested.\n }", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "private boolean validatePuchase() {\n if (TextUtils.isEmpty(editextPurchaseSupplierName.getText().toString())) {\n editextPurchaseSupplierName.setError(getString(R.string.supplier_name));\n editextPurchaseSupplierName.requestFocus();\n return false;\n }\n\n if (TextUtils.isEmpty(edittextPurchaseAmount.getText().toString())) {\n if (flowpurchaseReceivedOrPaid == 2) {\n edittextPurchaseAmount.setError(getString(R.string.menu_purchasePaid));\n edittextPurchaseAmount.requestFocus();\n\n } else {\n edittextPurchaseAmount.setError(getString(R.string.purchase_amount));\n edittextPurchaseAmount.requestFocus();\n }\n return false;\n }\n\n if (TextUtils.isEmpty(edittextPurchasePurpose.getText().toString())) {\n edittextPurchasePurpose.setError(getString(R.string.remark_bill_number));\n edittextPurchasePurpose.requestFocus();\n return false;\n }\n\n\n return true;\n }", "boolean validateFirstName(String First_name) {\n\t\treturn true;\n\n\t}", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate() {}", "public void validateRpd7s3()\n {\n // This guideline cannot be automatically tested.\n }", "private PackageValidator() {}", "public void validateRpd13s6()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validate() {\n if (category.equals(\"n/a\")) {\n AppUtils.displayToast(mContext, \"Please select category!!!\");\n return false;\n } else if (category.equals(AppUtils.CREATE_CATEGORY) && mCustomCategory.getText().toString().length() == 0) {\n AppUtils.displayToast(mContext, \"Please enter custom category name!!!\");\n return false;\n } else if (mTaskTile.getText().toString().length() == 0) {\n AppUtils.displayToast(mContext, \"Please enter task Title!!!\");\n return false;\n } else if (dueDate == 0) {\n AppUtils.displayToast(mContext, \"Please enter due date!!\");\n return false;\n } else if (mTaskContent.getText().toString().length() == 0) {\n AppUtils.displayToast(mContext, \"Please enter task content!!!\");\n return false;\n } else\n return true;\n\n\n }", "private void checkValidation() {\n String getInstituteName = NameofInstitute.getText().toString();\n String getDegreename = SpinnerDegree.getSelectedItem().toString();\n\n\n // Check if all strings are null or not\n if (getInstituteName.equals(\"\") || getInstituteName.length() == 0 || getDegreename.equals(\"\") || getDegreename.length() == 0)\n new CustomToast().Show_Toast(getActivity(), getView(),\"All fields are required.\");\n // Else do signup or do your stuff\n else {\n //Toast.makeText(getActivity(), \"All Ok till Now\", Toast.LENGTH_SHORT).show();\n AddQualifications(getDegreename,getInstituteName);\n }\n\n }", "public void VerifyShopinsightTitle(String Exptext){\r\n\t\tString countryy=\"Germany\";\r\n\t\tString ExpectedTitle[] = getValue(Exptext).split(\",\",2);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Shopping insight title should be present\");\r\n\t\ttry{\r\n\t\t\tif(countryy.contains(countries.get(countrycount))){\r\n\t\t\t\tif(getAndVerifyTextfromList(locator_split(\"txtShoppinginSightDesc\"), ExpectedTitle[1],1)){\r\n\t\t\t\t\tSystem.out.println(ExpectedTitle[1]+\" is present\");\r\n\t\t\t\t\tReporter.log(\"PASS_MESSAGE:- \"+ExpectedTitle[1]+\" is present in Shopping insight box\");\r\n\t\t\t\t} else{ \r\n\t\t\t\t\tthrow new Error(ExpectedTitle[1]+\" is not present\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(getAndVerifyTextfromList(locator_split(\"txtTitle\"), ExpectedTitle[1],Integer.valueOf(ExpectedTitle[0]))){\r\n\t\t\t\t\tSystem.out.println(ExpectedTitle[1]+\" is present\");\r\n\t\t\t\t\tReporter.log(\"PASS_MESSAGE:- \"+ExpectedTitle[1]+\" is present in Shopping insight box\");\r\n\t\t\t\t} else{ \r\n\t\t\t\t\tthrow new Error(ExpectedTitle[1]+\" is not present\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(NoSuchElementException e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- \"+elementProperties.getProperty(\"txtTitle\")+\" / \"+elementProperties.getProperty(\"txtShoppinginSightDesc\")+\" is not Present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtShoppinginSightDesc\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\t\tcatch(Error Er){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Expected text - '\"+ExpectedTitle[1]+\" is not present in Shopping insight box\");\r\n\t\t\tthrow new Error(\"Expected text - '\"+ExpectedTitle[1]+\" is not present\");\r\n\t\t}\r\n\t}", "@Test(groups ={Slingshot,Regression})\n\tpublic void EditViewLessthan15AcctsErrorValidation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify whether proper error message is displayed in view when continuing with out enabling the accounts check box\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMvManageView\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t\t.clicktestacct();\n\t\t/*.ClickManageUserLink()\n\t\t.ManageViews()\n\t\t.VerifyEditviewname(userProfile)\n\t\t.EditViewNameErrorValidation(userProfile); \t \t\t\t\t\t\t \t \t\t\n\t}*/\n\t}", "public List<String> validate (PostPurchaseOrderRequest postPurchaseOrderRequest) {\n\n List<String> errorList = new ArrayList<>();\n\n errorList.addAll(commonPurchaseOrderValidator.validateLineItems(postPurchaseOrderRequest.getPurchaseOrder().getLineItems(),\n postPurchaseOrderRequest.getPurchaseOrder().getStatus()));\n\n\n return errorList;\n }", "public void validateRpd15s1()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validateData() {\n if (!mCommon.validateData()) return false;\n\n Core core = new Core(this);\n\n // Due Date is required\n if (TextUtils.isEmpty(getRecurringTransaction().getDueDateString())) {\n core.alert(R.string.due_date_required);\n return false;\n }\n\n if (TextUtils.isEmpty(mCommon.viewHolder.dateTextView.getText().toString())) {\n core.alert(R.string.error_next_occurrence_not_populate);\n\n return false;\n }\n\n // Payments Left must have a value\n if (getRecurringTransaction().getPaymentsLeft() == null) {\n core.alert(R.string.payments_left_required);\n return false;\n }\n return true;\n }", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "abstract void fiscalCodeValidity();", "@Test(enabled=true, priority =1)\r\n\tpublic void view3_validate_table_data() {\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_curr_data) , \"Test_View3\" , \"view3_curr_data\" );\t\r\n\t\thelper.validate_table_columns( view3_curr_data_table , driver , \"\" , \"Test_View3\" , \"view3_curr_data_table\" );\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_today_data) , \"Test_View3\" , \"view3_today_data\" );\r\n\t\thelper.validate_table_columns( view3_today_data_table , driver , \"\" , \"Test_View3\" , \"view3_today_data_table\" );\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_curr_agent_stats_tbl) , \"Test_View3\" , \"view3_curr_agent_stats_tbl\" );\r\n\t\thelper.validate_table_columns( view3_curr_agent_stats_col , driver , \"\" , \"Test_View3\" , \"view3_curr_agent_stats_col\" );\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_agent_details) , \"Test_View3\" , \"view3_agent_details\" );\t\r\n\t\thelper.validate_table_columns( view3_Agent_table_data_start , driver , view3_Agent_table_data_end , \"Test_View3\" , \"view3_Agent_table_data\" );\r\n\t}", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validateRpd3s7()\n {\n // This guideline cannot be automatically tested.\n }", "public static void main(String[] args){\n\tValidateUser first =(String Fname) -> {\n\t\tif(Pattern.matches(\"[A-Z]{1}[a-z]{2,}\",Fname))\n\t\t\tSystem.out.println(\"First Name Validate\");\n\t\t\telse \n\t\t\tSystem.out.println(\"Invalid Name, Try again\");\n\t}; \n\t//Lambda expression for Validate User Last Name\n\tValidateUser last =(String Lname) -> {\n\t\tif(Pattern.matches(\"[A-Z]{1}[a-z]{2,}\",Lname))\n\t\t\tSystem.out.println(\"Last Name Validate\");\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Invalid Last Name, Try again\");\n\t};\n\t//Lambda expression for Validate User Email\n\tValidateUser Email =(String email) -> {\n\t\tif(Pattern.matches(\"^[\\\\w-\\\\+]+(\\\\.[\\\\w]+)*@[\\\\w-]+(\\\\.[\\\\w]+)*(\\\\.[a-z]{2,})$\",email))\n\t\t\tSystem.out.println(\"email Validate\");\n\t\telse\n\t\t\tSystem.out.println(\"Invalid Email, Try again\");\n\t};\n\t//Lambda expression for Validate User Phone Number\n\tValidateUser Num =(String Number) -> {\n\t\tif(Pattern.matches(\"^[0-9]{2}[\\\\s][0-9]{10}\",Number))\n\t\t\tSystem.out.println(\"Phone Number Validate\");\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Invalid Number, Try Again\");\n\t};\n\t//Lambda expression for Validate User Password\n\tValidateUser Password =(String pass) -> {\n\t\tif(Pattern.matches(\"(?=.*[$#@!%^&*])(?=.*[0-9])(?=.*[A-Z]).{8,20}$\",pass))\n\t\t\tSystem.out.println(\"Password Validate\");\n\t\t\telse\n\t\t\tSystem.out.println(\"Invalid Password Try Again\");\n\t};\n\t\n\tfirst.CheckUser(\"Raghav\");\n\tlast.CheckUser(\"Shettay\");\n\tEmail.CheckUser(\"[email protected]\");\n\tNum.CheckUser(\"91 8998564522\");\n\tPassword.CheckUser(\"Abcd@321\");\n\t\n\t\n\t\n\t//Checking all Email's Sample Separately\n\tArrayList<String> emails = new ArrayList<String>();\n\t//Valid Email's\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\t\n\t//Invalid Email's\n\temails.add(\"[email protected]\");\n\temails.add(\"abc123@%*.com\");\n\t\n\tString regex=\"^[\\\\w-\\\\+]+(\\\\.[\\\\w]+)*@[\\\\w-]+(\\\\.[\\\\w]+)*(\\\\.[a-z]{2,})$\";\n\t\n\tPattern pattern = Pattern.compile(regex);\n\t\n\tfor(String mail : emails) {\n\t\tMatcher matcher = pattern.matcher(mail);\n\t System.out.println(mail +\" : \"+ matcher.matches());\n\t}\n \n}", "public TestResult validate(License license, ValidationParameters validationParameters);", "private void validation() {\n Pattern pattern = validationfilterStringData();\n if (pattern.matcher(txtDrug.getText().trim()).matches() && pattern.matcher(txtGenericName.getText().trim()).matches()) {\n try {\n TblTreatmentadvise treatmentadvise = new TblTreatmentadvise();\n treatmentadvise.setDrugname(txtDrug.getText());\n treatmentadvise.setGenericname(txtGenericName.getText());\n treatmentadvise.setTiming(cmbDosestiming.getSelectedItem().toString());\n cmbtiming.setSelectedItem(cmbDosestiming);\n treatmentadvise.setDoses(loadcomboDoses());\n treatmentadvise.setDuration(loadcomboDuration());\n PatientService.saveEntity(treatmentadvise);\n JOptionPane.showMessageDialog(this, \"SAVE SUCCESSFULLY\");\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(this, \"STARTUP THE DATABASE CONNECTION\");\n }\n } else {\n JOptionPane.showMessageDialog(this, \"WRONG DATA ENTERED.\");\n }\n }", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "public void VerifyCouponfieldsinCheckout(){\r\n\t\tString countriess1 = \"Denmark,France,PresselSwitzerland,Norway,Spain,BernardFrance,,BernardBelgium,PresselAustria,UK,PresselGermany\";\r\n\t\tString countriess2 = \"Germany,Spain\";\r\n\t\tString countriess3 = \"Netherland,Italy\";\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Cupon Input txt box and Apply button should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(countriess1.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput2inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput3inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"3 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"3 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess2.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"1 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"1 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess3.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput2inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"2 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"2 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"incorret country is entered in method for -\"+countries.get(countrycount));\r\n\t\t\t\tthrow new Exception();\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Incorrect country is entered in method for -\"+countries.get(countrycount)+\" or\"\r\n\t\t\t\t\t+ \" Element not found\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"imgShiptoStoreinCartinCheckout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\t\tcatch(Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Number of cupons is not matching for country or Apply button not present for-\"+countries.get(countrycount));\r\n\t\t\tthrow new Error(\"Number of cupons is not matching for country or Apply button not present for-\"+countries.get(countrycount));\r\n\t\t}\r\n\r\n\t}", "@Test\n\t\tpublic void givenFirstLetterSmall_CheckForValidation_ReturnFalse() {\n\t\t\tboolean result = ValidateUserDetails.validateFirstName(\"priya\");\n\t\t\tAssertions.assertFalse(result);\n\t\t}", "public static Sale validateSale(TextField billno, LocalDate startdate, ComboBox customername, TextField nextdate, String onekgQty, String twokgQty, String fourkgQty, String fivekgQty, String sixkgQty, String ninekgQty, String onekgAmt, String twokgAmt, String fourkgAmt, String fivekgAmt, String sixkgAmt, String ninekgAmt, TextField amount) {\r\n Sale sale = new Sale();\r\n try {\r\n if (billno.getText().isEmpty() || startdate == null || customername.getValue() == null || nextdate.getText().isEmpty() || amount.getText().isEmpty()) {\r\n new PopUp(\"Error\", \"Field is Empty\").alert();\r\n } else {\r\n sale = new Sale();\r\n Date ndd = new SimpleDateFormat(\"dd-MM-yyyy\").parse(nextdate.getText());\r\n java.sql.Date nd = new java.sql.Date(ndd.getTime());\r\n sale.setBillno(Integer.valueOf(billno.getText()));\r\n sale.setStartdate(java.sql.Date.valueOf(startdate));\r\n sale.setShopname(customername.getValue().toString());\r\n sale.setNextdate(nd);\r\n if (onekgQty == null) {\r\n onekgQty = \"0\";\r\n }\r\n if (twokgQty == null) {\r\n twokgQty = \"0\";\r\n }\r\n if (fourkgQty == null) {\r\n fourkgQty = \"0\";\r\n }\r\n if (fivekgQty == null) {\r\n fivekgQty = \"0\";\r\n }\r\n if (sixkgQty == null) {\r\n sixkgQty = \"0\";\r\n }\r\n if (ninekgQty == null) {\r\n ninekgQty = \"0\";\r\n }\r\n sale.setOnekgqty(Integer.valueOf(onekgQty));\r\n sale.setTwokgqty(Integer.valueOf(twokgQty));\r\n sale.setFourkgqty(Integer.valueOf(fourkgQty));\r\n sale.setFivekgqty(Integer.valueOf(fivekgQty));\r\n sale.setSixkgqty(Integer.valueOf(sixkgQty));\r\n sale.setNinekgqty(Integer.valueOf(ninekgQty));\r\n if (onekgAmt == null) {\r\n onekgAmt = \"0.00\";\r\n }\r\n if (twokgAmt == null) {\r\n twokgAmt = \"0.00\";\r\n }\r\n if (fourkgAmt == null) {\r\n fourkgAmt = \"0.00\";\r\n }\r\n if (fivekgAmt == null) {\r\n fivekgAmt = \"0.00\";\r\n }\r\n if (sixkgAmt == null) {\r\n sixkgAmt = \"0.00\";\r\n }\r\n if (ninekgAmt == null) {\r\n ninekgAmt = \"0.00\";\r\n }\r\n sale.setOnekgamount(BigDecimal.valueOf(Double.valueOf(onekgAmt)));\r\n sale.setTwokgamount(BigDecimal.valueOf(Double.valueOf(twokgAmt)));\r\n sale.setFourkgamount(BigDecimal.valueOf(Double.valueOf(fourkgAmt)));\r\n sale.setFivekgamount(BigDecimal.valueOf(Double.valueOf(fivekgAmt)));\r\n sale.setSixkgamount(BigDecimal.valueOf(Double.valueOf(sixkgAmt)));\r\n sale.setNinekgamount(BigDecimal.valueOf(Double.valueOf(ninekgAmt)));\r\n sale.setAmount(BigDecimal.valueOf(Double.valueOf(amount.getText())));\r\n\r\n }\r\n } catch (ParseException error) {\r\n error.printStackTrace();\r\n }\r\n return sale;\r\n }", "private boolean validate(String name, String phone, String email, String description) {\n if (name.equals(null) || name.equals(\"\") || !isValidMobile(phone) || !isValidMail(email) || description.equals(null) || description.equals(\"\")) {\n\n if (name.equals(null) || name.equals(\"\")) {\n nameText.setError(\"Enter a valid Name\");\n } else {\n nameText.setError(null);\n }\n if (!isValidMobile(phone)) {\n phoneNumber.setError(\"Enter a valid Mobile Number\");\n } else {\n phoneNumber.setError(null);\n }\n if (!isValidMail(email)) {\n emailText.setError(\"Enter a valid Email ID\");\n } else {\n emailText.setError(null);\n }\n if (description.equals(null) || description.equals(\"\")) {\n descriptionText.setError(\"Add few lines about you\");\n } else {\n descriptionText.setError(null);\n }\n return false;\n } else\n return true;\n }", "public void validateRpd15s7()\n {\n // This guideline cannot be automatically tested.\n }", "@Test\r\n\tpublic void testNameValid() {\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"JANE\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"John\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"Mary\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\" Kurisu\"));\r\n\t\tassertTrue(Activity5Query.isNameCorrect(\"Bond \"));\r\n\t}", "public void validateRpd22s3()\n {\n // This guideline cannot be automatically tested.\n }", "public String getTextVehicleGroupNameValidationMessage() {\r\n\t\tString str = safeGetText(addVehiclesHeader.replace(\"Add Vehicle\", \"Please Input Vehicle Group Name\"), SHORTWAIT);\r\n\t\treturn str;\r\n\t}", "public String checkDepartment(String departmentName);", "public void ValidateProductDetails(String Productname,String Productcount,Reporting report)\n\t{\n\t\tString ActProductName=ProductName.getText();\n\t\t report.extentReportPass(\"Cart Page is displayed\");\n\t\tAssert.assertTrue(ActProductName.contains(Productname), \"Product detail is wrong\");\n\t\t\n\t\tString ActProductCount =ProductCount.getText();\n\t\tAssert.assertEquals(ActProductCount, Productcount);\n\t}", "@PostMapping(\"/validate\")\r\n\tpublic ValidateOrderResponse validate(@RequestBody ValidateOrderRequest validateOrderRequest) {\n\t\tString updatedGSXML = validateOrderRequest.getInputDoc().replaceAll(\"xmlns=\\\\\\\"\\\\\\\"\", \"\");\r\n\r\n\t\tBiztalk1 gsxml = XmlObjectUtil.getGSXMLObjFromXML(updatedGSXML);\r\n\r\n\t\tValidateOrderResponse validateOrderResponse = new ValidateOrderResponse();\r\n\r\n\t\t// logic to validate gsxml starts here\r\n\r\n\t\t// logic to validate gsxml ends here\r\n\t\t\r\n\t\tif(isValidCustomer(gsxml))\r\n\t\t{\r\n\t\t\tvalidateOrderResponse.setOutputDoc(XmlObjectUtil.getXMLStringFromGSXMLObj(gsxml));\r\n\t\t\tvalidateOrderResponse.setStatusCode(\"200\");\r\n\t\t\tvalidateOrderResponse.setStatusDesc(\"Order validated successfuly\");\r\n\t\t\treturn validateOrderResponse;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t\r\n\t\t\t validateOrderResponse.setStatusDesc(\"Customer Not Found\");\r\n\t\t\t validateOrderResponse.setStatusCode(\"511\");\r\n\t\t\t return validateOrderResponse;\r\n\t\t}\r\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public void validateRpd13s2()\n {\n // This guideline cannot be automatically tested.\n }", "public int validateEmployeePackageResult() {\n\t\tif (this.validateEmployeePackage())\n\t\t\treturn EmployeeConnection.VALID;\n\t\tif (!this.validateID())\n\t\t\treturn EmployeeConnection.INVALID_ID;\n\t\tif (!this.validateFirstName())\n\t\t\treturn EmployeeConnection.INVALID_FIRST_NAME;\n\t\tif (!this.validateLastName())\n\t\t\treturn EmployeeConnection.INVALID_LAST_NAME;\n\t\treturn EmployeeConnection.INVALID_UNKNOWN;\n\t}", "public void validateRpd11s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "@Test\n public void test10020ATS001ValidationofDatefieldsinPayHistory() throws Exception {\n driver.get(\"http://Clarity\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_UserNameTextBox\")).clear();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_UserNameTextBox\")).sendKeys(\"02.08.09\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_PasswordTextBox\")).clear();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_PasswordTextBox\")).sendKeys(\"password\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_LoginButton\")).click();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_btnLogin\")).click();\n //driver.findElement(By.linkText(\"Select\")).click();\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*How much is my pension[\\\\s\\\\S][\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).clear();\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).sendKeys(\"02/10/20\");\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*Start date is later than end date\\\\.[\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).clear();\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).sendKeys(\"25/07/2017\");\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).clear();\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate\")).clear();\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate\")).sendKeys(\"02/10/2\");\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).sendKeys(\"02/10/2\");\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton\")).click();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton']\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*End Date is not recognized as a valid date\\\\.[\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate']\")).clear();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate']\")).sendKeys(\"21221\\\"\\\"\\\"\");\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).clear();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).sendKeys(\"wewe\\\"\\\"\\\"\");\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton']\")).click();\n Thread.sleep(1000);\n //try {\n //assertTrue(driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDateTypeValidator\")).getText().matches(\"^exact:[\\\\s\\\\S]*$\"));\n //} catch (Error e) {\n // verificationErrors.append(e.toString());\n //}\n // ERROR: Caught exception [Error: locator strategy either id or name must be specified explicitly.]\n driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_LoginStatus\")).click();\n }", "@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyfiftyAcctsviewValidatation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify whether proper error message is diplayed when accounts added more than 50 on clicking the confirm button\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMvManageView\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ManageViews()\n\t\t.FiftyAcctsViewnameErrorValidation(userProfile); \t \t\t\t\t\t\t \t \t\t\t \t \t \t\t\t\t\t\t \t \t\t\n\t}", "public String getAddVehicleGroupValidationMessage() {\r\n String str = safeGetText(addVehiclesHeader.replace(\"Add Vehicle\", \"Please Input Valid Group Name\"), SHORTWAIT);\r\n\t\t return str;\r\n\t}", "public int validateBankPackageResult() {\n\t\tif (this.validateBankPackage())\n\t\t\treturn EmployeeConnection.VALID;\n\t\tif (!this.validateBank())\n\t\t\treturn EmployeeConnection.INVALID_BANK;\n\t\tif (!this.validateBSB())\n\t\t\treturn EmployeeConnection.INVALID_BSB_NUMBER;\n\t\tif (!this.validateAccountNumber())\n\t\t\treturn EmployeeConnection.INVALID_ACCOUNT_NUMBER;\n\t\treturn EmployeeConnection.INVALID_UNKNOWN;\n\t}" ]
[ "0.6436408", "0.6274032", "0.62738496", "0.5970418", "0.58943284", "0.5877221", "0.58475006", "0.58475006", "0.572069", "0.56963664", "0.56630856", "0.56581634", "0.562349", "0.55488956", "0.5545444", "0.55401987", "0.55197865", "0.5504966", "0.5489954", "0.54814297", "0.5479623", "0.54698557", "0.54424417", "0.5439001", "0.5429142", "0.54210424", "0.54147094", "0.54137874", "0.54134023", "0.5402238", "0.5397947", "0.5382682", "0.5371529", "0.53347725", "0.5323197", "0.53181416", "0.53144264", "0.5307618", "0.52836514", "0.5279776", "0.52783126", "0.5276284", "0.52749676", "0.52710515", "0.526179", "0.5256474", "0.52555835", "0.52414197", "0.5225455", "0.5218285", "0.5214957", "0.52089924", "0.52086425", "0.520783", "0.52022165", "0.5198854", "0.51977825", "0.5195083", "0.51926416", "0.51895225", "0.5186867", "0.5182575", "0.518177", "0.5180125", "0.51782376", "0.51766306", "0.5159849", "0.5154057", "0.515185", "0.5146076", "0.5135434", "0.5129697", "0.5128101", "0.5125854", "0.5124537", "0.512323", "0.5117447", "0.51159155", "0.5109857", "0.5109172", "0.5102621", "0.5100116", "0.5094496", "0.50939345", "0.5083785", "0.5083766", "0.50837094", "0.5080172", "0.50794876", "0.50777996", "0.5074023", "0.50626904", "0.5061705", "0.5061569", "0.5059726", "0.505884", "0.5053615", "0.5052249", "0.5043622", "0.5042164" ]
0.7576915
0
Validation Functions Description : To validate the Package Status in Customer Account Summary of Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:05 Oct 2016 Modified By:Raja Parameter:PackageStatus
public void validate_the_Package_Status_in_Customer_Account_Summary_of_Customer_Tab(String PackageStatus)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll("M_Header", "Landline Account Summary").replaceAll("M_Category", "Package Status").replaceAll("M_InnerText", PackageStatus), "Package Status - "+PackageStatus, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean validatePackage() {\n\t\treturn this.validateID() && this.validateFirstName() && this.validateLastName()\n\t\t\t\t&& this.validateBank() && this.validateBSB() && this.validateAccountNumber();\n\t}", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "private int doValidateCheck()\n {\n if (Math.min(txtArtifactID.getText().trim().length(),\n txtGroupID.getText().trim().length()) == 0)\n {\n return 1;\n }\n if (txtPackage.getText().trim().length() > 0)\n {\n boolean matches = txtPackage.getText().matches(\"[a-zA-Z0-9\\\\.]*\"); //NOI18N\n if (!matches) {\n return 2;\n } else {\n if (txtPackage.getText().startsWith(\".\") || txtPackage.getText().endsWith(\".\"))\n {\n return 2;\n }\n }\n }\n return 0;\n }", "public void validate_the_Package_Name_in_Customer_Account_Summary_of_Customer_Tab(String PackageName)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Package Name\").replaceAll(\"M_InnerText\", PackageName), \"Package Name - \"+PackageName, false);\n\t}", "public int validatePackageResult() {\n\t\tif (this.validatePackage())\n\t\t\treturn EmployeeConnection.VALID;\n\t\tif (!this.validateID())\n\t\t\treturn EmployeeConnection.INVALID_ID;\n\t\tif (!this.validateFirstName())\n\t\t\treturn EmployeeConnection.INVALID_FIRST_NAME;\n\t\tif (!this.validateLastName())\n\t\t\treturn EmployeeConnection.INVALID_LAST_NAME;\n\t\tif (!this.validateBank())\n\t\t\treturn EmployeeConnection.INVALID_BANK;\n\t\tif (!this.validateBSB())\n\t\t\treturn EmployeeConnection.INVALID_BSB_NUMBER;\n\t\tif (!this.validateAccountNumber())\n\t\t\treturn EmployeeConnection.INVALID_ACCOUNT_NUMBER;\n\t\treturn EmployeeConnection.INVALID_UNKNOWN;\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validateoLPNStatus(String strLPNStatus){ \t\t\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"StatisticsTab\"), \"StatisticsTab\");\n\t\tlibManhattanCommonFunctions.clickAnyElement(getPageElement(\"oLPNsTab\"), \"oLPNsTab\");\n\t\tif(libManhattanCommonFunctions.verifyElementPresent(\"//span[@id='dataForm:dataLstTbl:_colhdr_id1']\", \"XPATH\")){\n\t\t\ttry{\n\t\t\t\tString actualLPNStatus = libManhattanCommonFunctions.getElementByProperty(\"//span[@id='dataForm:dataLstTbl:_colhdr_id1']\", \"XPATH\").getText();\n\n\t\t\t\tif(actualLPNStatus.trim().equals(strLPNStatus))\n\t\t\t\t{\n\t\t\t\t\treport.updateTestLog(\"oLPN Status verification\", \"Actual oLPn status : \"+actualLPNStatus+ \" is verified\", Status.PASS);\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\treport.updateTestLog(\"oLPN Status verification\", \"Expected oLPN status :\"+strLPNStatus+\" || Actual oLPN status : \"+actualLPNStatus, Status.FAIL);\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\treport.updateTestLog(\"Element\", \"Element Not Found\", Status.FAIL);\n\t\t\t}\n\t\t}else{\n\t\t\treport.updateTestLog(\"oLPN Status\", \"oLPN is not created\", Status.FAIL);\n\t\t}\n\n\t}", "private boolean validate(Map<String,String> requestMap){\r\n\t\tboolean result = false;\r\n\t\tString zip = requestMap.get(PublicAPIConstant.ZIP);\r\n\t\tString soStatus = requestMap.get(PublicAPIConstant.SO_STATUS);\r\n\t\tList<String> soStatusList = new ArrayList<String>();\r\n\r\n\t\tif (null != soStatus) {\r\n\t\t\tStringTokenizer strTok = new StringTokenizer(\r\n\t\t\t\t\tsoStatus,\r\n\t\t\t\t\tPublicAPIConstant.SEPARATOR, false);\r\n\t\t\tint noOfStatuses = strTok.countTokens();\r\n\t\t\tfor (int i = 1; i <= noOfStatuses; i++) {\r\n\t\t\t\tsoStatusList.add(new String(strTok\r\n\t\t\t\t\t\t.nextToken()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tInteger pageSize = Integer.parseInt(requestMap.get(\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET));\r\n\t\t\r\n\t\tif(null!=zip&&zip.length() != 5){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.ZIP);\r\n\t\t\treturn result;\t\r\n\t\t}\r\n\t\tList<Integer> pageSizeSetValues = Arrays.asList(\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_10,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_20,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_50,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_100,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_200,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_500);\t\t\r\n\t\tif(!pageSizeSetValues.contains(pageSize)){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET);\r\n\t\t\treturn result;\t\r\n\t\t}\t\r\n\t\t\r\n\t\tList<String> soStatusValues = Arrays.asList(\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_POSTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_ACCEPTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_ACTIVE,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_CLOSED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_COMPLETED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_DRAFTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_PROBLEM,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_EXPIRED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_PENDINGCANCEL\r\n\t\t);\t\t\r\n\t\tif(!soStatusValues.containsAll(soStatusList)){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.SO_STATUS_SET);\r\n\t\t\treturn result;\t\r\n\t\t}\t\r\n\t\tresult = true;\r\n\t\treturn result;\r\n\t}", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "private void validateData() {\n }", "public void validate_the_Account_Status_in_Customer_Account_Summary_of_Customer_Tab(String AccountStatus)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Account Status\").replaceAll(\"M_InnerText\", AccountStatus), \"Account Status - \"+AccountStatus, false);\n\t}", "public boolean validateEmployeePackage() {\n\t\treturn this.validateID() && this.validateFirstName() && this.validateLastName();\n\t}", "public int validateBankPackageResult() {\n\t\tif (this.validateBankPackage())\n\t\t\treturn EmployeeConnection.VALID;\n\t\tif (!this.validateBank())\n\t\t\treturn EmployeeConnection.INVALID_BANK;\n\t\tif (!this.validateBSB())\n\t\t\treturn EmployeeConnection.INVALID_BSB_NUMBER;\n\t\tif (!this.validateAccountNumber())\n\t\t\treturn EmployeeConnection.INVALID_ACCOUNT_NUMBER;\n\t\treturn EmployeeConnection.INVALID_UNKNOWN;\n\t}", "@PostMapping(\"/validate\")\r\n\tpublic ValidateOrderResponse validate(@RequestBody ValidateOrderRequest validateOrderRequest) {\n\t\tString updatedGSXML = validateOrderRequest.getInputDoc().replaceAll(\"xmlns=\\\\\\\"\\\\\\\"\", \"\");\r\n\r\n\t\tBiztalk1 gsxml = XmlObjectUtil.getGSXMLObjFromXML(updatedGSXML);\r\n\r\n\t\tValidateOrderResponse validateOrderResponse = new ValidateOrderResponse();\r\n\r\n\t\t// logic to validate gsxml starts here\r\n\r\n\t\t// logic to validate gsxml ends here\r\n\t\t\r\n\t\tif(isValidCustomer(gsxml))\r\n\t\t{\r\n\t\t\tvalidateOrderResponse.setOutputDoc(XmlObjectUtil.getXMLStringFromGSXMLObj(gsxml));\r\n\t\t\tvalidateOrderResponse.setStatusCode(\"200\");\r\n\t\t\tvalidateOrderResponse.setStatusDesc(\"Order validated successfuly\");\r\n\t\t\treturn validateOrderResponse;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t\r\n\t\t\t validateOrderResponse.setStatusDesc(\"Customer Not Found\");\r\n\t\t\t validateOrderResponse.setStatusCode(\"511\");\r\n\t\t\t return validateOrderResponse;\r\n\t\t}\r\n\t}", "@Test\r\n\tpublic void view3_todays_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"CML Service Level\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table2 = driver.findElements(view3_todays_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table2 = driver.findElements(By.xpath(view3_today_data_table));\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table2, data_of_table2 );\r\n\t}", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "public void validate() {}", "@Test\r\n\tpublic void view3_current_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Columns\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t//Removing Column data from another table.\r\n\t\tdata_of_table1 = helper.modify_cols_data_of_table(col_of_table1, data_of_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table1, data_of_table1 );\r\n\t}", "ValidationResponse validate();", "public boolean validateBankPackage() {\n\t\treturn this.validateBank() && this.validateBSB() && this.validateAccountNumber();\n\t}", "protected void validate(String operationType) throws Exception\r\n\t{\r\n\t\tsuper.validate(operationType);\r\n\r\n\t\tMPSString id_validator = new MPSString();\r\n\t\tid_validator.validate(operationType, id, \"\\\"id\\\"\");\r\n\t\t\r\n\t\tMPSBoolean secure_access_only_validator = new MPSBoolean();\r\n\t\tsecure_access_only_validator.validate(operationType, secure_access_only, \"\\\"secure_access_only\\\"\");\r\n\t\t\r\n\t\tMPSString svm_ns_comm_validator = new MPSString();\r\n\t\tsvm_ns_comm_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);\r\n\t\tsvm_ns_comm_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tsvm_ns_comm_validator.validate(operationType, svm_ns_comm, \"\\\"svm_ns_comm\\\"\");\r\n\t\t\r\n\t\tMPSString ns_br_interface_validator = new MPSString();\r\n\t\tns_br_interface_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);\r\n\t\tns_br_interface_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tns_br_interface_validator.validate(operationType, ns_br_interface, \"\\\"ns_br_interface\\\"\");\r\n\t\t\r\n\t\tMPSBoolean vm_auto_poweron_validator = new MPSBoolean();\r\n\t\tvm_auto_poweron_validator.validate(operationType, vm_auto_poweron, \"\\\"vm_auto_poweron\\\"\");\r\n\t\t\r\n\t\tMPSString ns_br_interface_2_validator = new MPSString();\r\n\t\tns_br_interface_2_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);\r\n\t\tns_br_interface_2_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tns_br_interface_2_validator.validate(operationType, ns_br_interface_2, \"\\\"ns_br_interface_2\\\"\");\r\n\t\t\r\n\t\tMPSInt init_status_validator = new MPSInt();\r\n\t\tinit_status_validator.validate(operationType, init_status, \"\\\"init_status\\\"\");\r\n\t\t\r\n\t}", "public void monthlyPayment_Validation() {\n\t\thelper.assertString(monthlyPayment_AftrLogin(), payOffOffer.monthlyPayment_BfrLogin());\n\t\tSystem.out.print(\"The Monthly Payment is: \" + monthlyPayment_AftrLogin());\n\t}", "private boolean validateData() {\n if (!mCommon.validateData()) return false;\n\n Core core = new Core(this);\n\n // Due Date is required\n if (TextUtils.isEmpty(getRecurringTransaction().getDueDateString())) {\n core.alert(R.string.due_date_required);\n return false;\n }\n\n if (TextUtils.isEmpty(mCommon.viewHolder.dateTextView.getText().toString())) {\n core.alert(R.string.error_next_occurrence_not_populate);\n\n return false;\n }\n\n // Payments Left must have a value\n if (getRecurringTransaction().getPaymentsLeft() == null) {\n core.alert(R.string.payments_left_required);\n return false;\n }\n return true;\n }", "@Test\r\n\tpublic void view3_COEs_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\t\t//Table 3 - Data .\r\n\t\tList<WebElement> data_of_table3 = driver.findElements(view3_COEs_table_data_val);\r\n\t\t//Table 3 - Columns\r\n\t\tList<WebElement> col_of_table3 = driver.findElements(By.xpath(view3_curr_agent_stats_col));\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> updated_col_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t\r\n\t\t//Adding Column data from another table.\r\n\t\tdata_of_table3 = helper.modify_cols_data_of_table(col_of_table1, data_of_table3, updated_col_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table3, data_of_table3 );\r\n\t}", "abstract void fiscalCodeValidity();", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "protected void validate(String operationType) throws Exception\r\n\t{\r\n\t\tsuper.validate(operationType);\r\n\r\n\t\tMPSString id_validator = new MPSString();\r\n\t\tid_validator.setConstraintIsReq(MPSConstants.DELETE_CONSTRAINT, true);\r\n\t\tid_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);\r\n\t\tid_validator.validate(operationType, id, \"\\\"id\\\"\");\r\n\t\t\r\n\t\tMPSInt adapter_id_validator = new MPSInt();\r\n\t\tadapter_id_validator.validate(operationType, adapter_id, \"\\\"adapter_id\\\"\");\r\n\t\t\r\n\t\tMPSInt pdcount_validator = new MPSInt();\r\n\t\tpdcount_validator.validate(operationType, pdcount, \"\\\"pdcount\\\"\");\r\n\t\t\r\n\t\tMPSInt ldcount_validator = new MPSInt();\r\n\t\tldcount_validator.validate(operationType, ldcount, \"\\\"ldcount\\\"\");\r\n\t\t\r\n\t}", "void validateTransactionForPremiumWorksheet(Record inputRecord, Connection conn);", "public void validateUIStatus() {\n\n boolean timeZoneCheck = false, timeFormatCheck = false, fetchTimeCheck = false, statusPathCheck = false;\n\n if (!timeZone.getText().isEmpty()) {\n timeZoneCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Time zone should not be Empty.\\n\");\n }\n if (!statusPath.getText().isEmpty()) {\n statusPathCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Status File should not be empty.\\n\");\n }\n if (!fetchTime.getText().isEmpty()) {\n fetchTimeCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". UI Refresh Time should not be empty.\\n\");\n }\n if (!timeFormat.getText().isEmpty()) {\n timeFormatCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". UI Date & Time format should not be Empty.\\n\");\n }\n\n if (timeFormatCheck == true && timeZoneCheck == true && fetchTimeCheck == true && statusPathCheck == true) {\n uiStatusCheck = true;\n } else {\n\n uiStatusCheck = false;\n timeZoneCheck = false;\n timeFormatCheck = false;\n fetchTimeCheck = false;\n statusPathCheck = false;\n }\n }", "private IStatus getPackageStatus(String packName) {\r\n\t\tStatusInfo status= new StatusInfo();\r\n\t\tif (packName.length() > 0) {\r\n\t\t\tIStatus val= validatePackageName(packName);\r\n\t\t\tif (val.getSeverity() == IStatus.ERROR) {\r\n\t\t\t\tstatus.setError(Messages.format(NewWizardMessages.NewPackageWizardPage_error_InvalidPackageName, val.getMessage()));\r\n\t\t\t\treturn status;\r\n\t\t\t} else if (val.getSeverity() == IStatus.WARNING) {\r\n\t\t\t\tstatus.setWarning(Messages.format(NewWizardMessages.NewPackageWizardPage_warning_DiscouragedPackageName, val.getMessage()));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tstatus.setError(NewWizardMessages.NewPackageWizardPage_error_EnterName);\r\n\t\t\treturn status;\r\n\t\t}\r\n\r\n\t\t// removed below logic\r\n\t\t\r\n\t\treturn status;\r\n\t}", "public void validateRpd3s12()\n {\n // This guideline cannot be automatically tested.\n }", "private void validt() {\n\t\t// -\n\t\tnmfkpinds.setPgmInd99(false);\n\t\tstateVariable.setZmsage(blanks(78));\n\t\tfor (int idxCntdo = 1; idxCntdo <= 1; idxCntdo++) {\n\t\t\tproductMaster.retrieve(stateVariable.getXwabcd());\n\t\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t\t// BR00005 Product not found on Product_Master\n\t\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\t\tmsgObjIdx = setMsgObj(\"OEM0003\", \"XWABCD\", msgObjIdx, messages);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// - If addition, pull the price from file:\n\t\t\tif (nmfkpinds.funKey06()) {\n\t\t\t\tstateVariable.setXwpric(stateVariable.getXwanpr());\n\t\t\t}\n\t\t\t// -\n\t\t\tstoreMaster.retrieve(stateVariable.getXwaacs());\n\t\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t\t// BR00006 Store not found on Store_Master\n\t\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\t\tmsgObjIdx = setMsgObj(\"OES0369\", \"XWAACS\", msgObjIdx, messages);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tstockBalances.retrieve(stateVariable.getXwabcd(), stateVariable.getXwaacs());\n\t\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t\t// BR00007 Store not found on Stock_Balances or CONDET.Contract_Qty >\n\t\t\t// BR Onhand_Quantity\n\t\t\tif (nmfkpinds.pgmInd99() || (stateVariable.getXwa5qt() > stateVariable.getXwbhqt())) {\n\t\t\t\tmsgObjIdx = setMsgObj(\"OES0370\", \"XWAACS\", msgObjIdx, messages);\n\t\t\t\tnmfkpinds.setPgmInd99(true);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// - Transaction Type:\n\t\t\ttransactionTypeDescription.retrieve(stateVariable.getXwricd());\n\t\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t\t// BR00008 Trn_Hst_Trn_Type not found on Transaction_type_description\n\t\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\t\tstateVariable.setXwtdsc(all(\"-\", 20));\n\t\t\t\tmsgObjIdx = setMsgObj(\"OES0371\", \"XWRICD\", msgObjIdx, messages);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// - Unit of measure:\n\t\t\t// BR00009 U_M = 'EAC'\n\t\t\tif (equal(\"EAC\", stateVariable.getXwa2cd())) {\n\t\t\t\tstateVariable.setUmdes(replaceStr(stateVariable.getUmdes(), 1, 11, um[1]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnmfkpinds.setPgmInd99(true);\n\t\t\t\tmsgObjIdx = setMsgObj(\"OES0372\", \"XWA2CD\", msgObjIdx, messages);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "void validate();", "void validate();", "public int validateEmployeePackageResult() {\n\t\tif (this.validateEmployeePackage())\n\t\t\treturn EmployeeConnection.VALID;\n\t\tif (!this.validateID())\n\t\t\treturn EmployeeConnection.INVALID_ID;\n\t\tif (!this.validateFirstName())\n\t\t\treturn EmployeeConnection.INVALID_FIRST_NAME;\n\t\tif (!this.validateLastName())\n\t\t\treturn EmployeeConnection.INVALID_LAST_NAME;\n\t\treturn EmployeeConnection.INVALID_UNKNOWN;\n\t}", "public List<Message> verifyTransaction(Transaction t) {\n LOG.debug(\"verifyTransaction() started\");\n\n // List of error messages for the current transaction\n List<Message> errors = new ArrayList();\n\n // Check the chart of accounts code\n if (t.getChart() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_CHART_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the account\n if (t.getAccount() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_ACCOUNT_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the object type\n if (t.getObjectType() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_OBJECT_TYPE_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the balance type\n if (t.getBalanceType() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_BALANCE_TYPE_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the fiscal year\n if (t.getOption() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_UNIV_FISCAL_YR_NOT_FOUND), Message.TYPE_FATAL));\n }\n\n // Check the debit/credit code (only if we have a valid balance type code)\n if (t.getTransactionDebitCreditCode() == null) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_DEDIT_CREDIT_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n else {\n if (t.getBalanceType() != null) {\n if (t.getBalanceType().isFinancialOffsetGenerationIndicator()) {\n if ((!OLEConstants.GL_DEBIT_CODE.equals(t.getTransactionDebitCreditCode())) && (!OLEConstants.GL_CREDIT_CODE.equals(t.getTransactionDebitCreditCode()))) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_DEDIT_CREDIT_CODE_MUST_BE) + \" '\" + OLEConstants.GL_DEBIT_CODE + \" or \" + OLEConstants.GL_CREDIT_CODE + kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_FOR_BALANCE_TYPE), Message.TYPE_FATAL));\n }\n }\n else {\n if (!OLEConstants.GL_BUDGET_CODE.equals(t.getTransactionDebitCreditCode())) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_DEDIT_CREDIT_CODE_MUST_BE) + OLEConstants.GL_BUDGET_CODE + kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.MSG_FOR_BALANCE_TYPE), Message.TYPE_FATAL));\n }\n }\n }\n }\n\n // KULGL-58 Make sure all GL entry primary key fields are not null\n if ((t.getSubAccountNumber() == null) || (t.getSubAccountNumber().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_SUB_ACCOUNT_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialObjectCode() == null) || (t.getFinancialObjectCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_OBJECT_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialSubObjectCode() == null) || (t.getFinancialSubObjectCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_SUB_OBJECT_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getUniversityFiscalPeriodCode() == null) || (t.getUniversityFiscalPeriodCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_FISCAL_PERIOD_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialDocumentTypeCode() == null) || (t.getFinancialDocumentTypeCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_DOCUMENT_TYPE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getFinancialSystemOriginationCode() == null) || (t.getFinancialSystemOriginationCode().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_ORIGIN_CODE_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n if ((t.getDocumentNumber() == null) || (t.getDocumentNumber().trim().length() == 0)) {\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_DOCUMENT_NUMBER_NOT_BE_NULL), Message.TYPE_FATAL));\n }\n \n // Don't need to check SequenceNumber because it sets in PosterServiceImpl, so commented out\n// if (t.getTransactionLedgerEntrySequenceNumber() == null) {\n// errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_SEQUENCE_NUMBER_NOT_BE_NULL), Message.TYPE_FATAL));\n// }\n \n if (t.getBalanceType() != null && t.getBalanceType().isFinBalanceTypeEncumIndicator() && !t.getObjectType().isFundBalanceIndicator()){\n if (t.getTransactionEncumbranceUpdateCode().trim().equals(GeneralLedgerConstants.EMPTY_CODE)){\n errors.add(new Message(kualiConfigurationService.getPropertyValueAsString(OLEKeyConstants.ERROR_ENCUMBRANCE_UPDATE_CODE_CANNOT_BE_BLANK_FOR_BALANCE_TYPE) + \" \" + t.getFinancialBalanceTypeCode(), Message.TYPE_FATAL));\n }\n }\n\n // The encumbrance update code can only be space, N, R or D. Nothing else\n if ((StringUtils.isNotBlank(t.getTransactionEncumbranceUpdateCode())) && (!\" \".equals(t.getTransactionEncumbranceUpdateCode())) && (!OLEConstants.ENCUMB_UPDT_NO_ENCUMBRANCE_CD.equals(t.getTransactionEncumbranceUpdateCode())) && (!OLEConstants.ENCUMB_UPDT_REFERENCE_DOCUMENT_CD.equals(t.getTransactionEncumbranceUpdateCode())) && (!OLEConstants.ENCUMB_UPDT_DOCUMENT_CD.equals(t.getTransactionEncumbranceUpdateCode()))) {\n errors.add(new Message(\"Invalid Encumbrance Update Code (\" + t.getTransactionEncumbranceUpdateCode() + \")\", Message.TYPE_FATAL));\n }\n\n \n\n return errors;\n }", "public String validates() {\n this.sr = this.m_oCompany.getServiceRecords();\n if(this.sr.validatesService(this.m_oService)){\n return String.format(m_oService.toString());\n }\n return String.format(\"Invalid service.\");\n }", "public boolean processRequirementSummary() throws NbaBaseException {\n\t\tboolean success = false;\n\t\tNbaVpmsAdaptor vpmsProxy = null; //SPR3362\n\t\ttry {\n\t\t\tNbaOinkDataAccess oinkData = new NbaOinkDataAccess(txLifeReqResult); //ACN009\n\t\t\toinkData.setAcdbSource(new NbaAcdb(), nbaTxLife);\n\t\t\toinkData.setLobSource(work.getNbaLob());\n\t\t\tif(getLogger().isDebugEnabled()) { //SPR3290\n\t\t\t getLogger().logDebug(\"########### Testing Requirment Summary ###########\");\n\t\t\t getLogger().logDebug(\"########### PartyId: \" + partyID);\n\t\t\t}//SPR3290\n\t\t\tvpmsProxy = new NbaVpmsAdaptor(oinkData, NbaVpmsAdaptor.ACREQUIREMENTSUMMARY); //SPR3362\n\t\t\tvpmsProxy.setVpmsEntryPoint(NbaVpmsAdaptor.EP_GET_CALCXMLOBJECTS);\n\t\t\tMap deOink = new HashMap();\n\t\t\t//\t\t\t######## DEOINK\n\t\t\tdeOink.put(NbaVpmsConstants.A_PROCESS_ID, NbaUtils.getBusinessProcessId(getUser())); //SPR2639\n\t\t\tdeOinkContractFieldsForRequirement(deOink);\n\t\t\tdeOinkXMLResultFields(deOink);\n deOinkSubstanceUsage(oinkData, deOink, partyID); //AXAL3.7.07\n\t\t\tdeOinkLabTestResults(deOink);\n\t\t\tObject[] args = getKeys();\n\t\t\tNbaOinkRequest oinkRequest = new NbaOinkRequest();\n\t\t\toinkRequest.setRequirementIdFilter(reqId);\n\t\t\toinkRequest.setArgs(args);\n\t\t\tvpmsProxy.setANbaOinkRequest(oinkRequest);\n\t\t\tvpmsProxy.setSkipAttributesMap(deOink);\n\t\t\tVpmsComputeResult vcr = vpmsProxy.getResults();\n\t\t\tNbaVpmsResultsData vpmsResultsData = new NbaVpmsResultsData(vcr);\n\t\t\tArrayList results = vpmsResultsData.getResultsData();\n\t\t\tresults = vpmsResultsData.getResultsData();\n\t\t\t//Resulting string will be the zeroth element.\n\t\t\tif (results == null) {\n\t\t\t\t//SPR3362 code deleted\n\t\t\t\tthrow new NbaVpmsException(NbaVpmsException.VPMS_NO_RESULTS + NbaVpmsAdaptor.ACREQUIREMENTSUMMARY); //SPR2652\n\t\t\t} //SPR2652\n\t\t\tvpmsResult = (String) results.get(0);\n\t\t\tNbaVpmsModelResult vpmsOutput = new NbaVpmsModelResult(vpmsResult);\n\t\t\tVpmsModelResult vpmModelResult = vpmsOutput.getVpmsModelResult();\n\t\t\tupdateDefaultValues(vpmModelResult.getDefaultValues());\n\t\t\tupdateSummaryValues(vpmModelResult.getSummaryValues());\n\t\t\tsuccess = true;\n\t\t\t// SPR2652 Code Deleted\n\t\t\t//SPR3362 code deleted\n\t\t} catch (RemoteException re) {\n\t\t\tthrow new NbaBaseException(\"Remote Exception occured in processRequirementSummary\", re);\n\t\t// SPR2652 Code Deleted\n\t\t//begin SPR3362\n\t\t} finally {\n\t\t if(vpmsProxy != null){\n\t\t try {\n vpmsProxy.remove();\n } catch (RemoteException e) {\n getLogger().logError(NbaBaseException.VPMS_REMOVAL_FAILED);\n }\n\t\t }\n\t\t//end SPR3362\n\t\t}\n\t\treturn success;\n\t}", "private static Boolean validateForm() {\n\t\t\tBoolean valid = true;\n\t\t\tSystem.out.println(\"Index: \"+portfolio.findByCode(pCode.getText()));\n\t\t\tif(pCode.getText().equals(\"\")) {\n\t\t\t\tmsgCode.setText(\"Project code is required\");\n\t\t\t\tvalid = false;\n\t\t\t} else if(portfolio.findByCode(pCode.getText()) >= 0) {\n\t\t\t\tmsgCode.setText(\"Project already exists!\");\n\t\t\t\tvalid = false;\n\t\t\t} else {\n\t\t\t\tmsgCode.setText(\"\");\n\t\t\t}\n\t\t\t\n\t\t\tif(pName.getText().equals(\"\")) {\n\t\t\t\tmsgName.setText(\"Project Name is required!\");\n\t\t\t\tvalid = false;\n\t\t\t} else {\n\t\t\t\tmsgName.setText(\"\");\n\t\t\t}\n\t\t\t\n\t\t\tif(pClient.getText().equals(\"\")) {\n\t\t\t\tmsgClient.setText(\"Client is required!\");\n\t\t\t\tvalid = false;\n\t\t\t} else {\n\t\t\t\tmsgClient.setText(\"\");\n\t\t\t}\n\t\t\t\n\t\t\tif(pSDate.getText().equals(\"\")) {\n\t\t\t\tmsgSDate.setText(DATE_FORMAT + \" Start Date is required\");\n\t\t\t\tvalid = false;\n\t\t\t} else {\n\t\t\t\tmsgSDate.setText(DATE_FORMAT);\n\t\t\t}\n\t\t\t\n\t\t\tswitch(pType) {\n\t\t\tcase \"o\":\n\t\t\t\tif(pDeadline.getText().equals(\"\")) {\n\t\t\t\t\tmsgDeadline.setText(DATE_FORMAT + \" Deadline is required!\");\n\t\t\t\t\tvalid = false;\n\t\t\t\t} else {\n\t\t\t\t\tmsgDeadline.setText(DATE_FORMAT);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tDouble b = Double.parseDouble(pBudget.getText());\n\t\t\t\t\tif(b<0) {\n\t\t\t\t\t\tmsgBudget.setText(\"Must be a positive value\");\n\t\t\t\t\t\tvalid=false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmsgBudget.setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tmsgBudget.setText(\"Invalid number!\");\n\t\t\t\t\tvalid = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tint c = Integer.parseInt(pCompletion.getText());\n\t\t\t\t\tif(c<0 || c>100) {\n\t\t\t\t\t\tmsgCompletion.setText(\"Value must be between 0 and 100\");\n\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmsgCompletion.setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tmsgCompletion.setText(\"Invalid number!\");\n\t\t\t\t\tvalid = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"f\":\n\t\t\t\tif(pEndDate.getText().equals(\"\")) {\n\t\t\t\t\tmsgEndDate.setText(DATE_FORMAT + \" End date is required!\");\n\t\t\t\t\tvalid = false;\n\t\t\t\t} else {\n\t\t\t\t\tmsgEndDate.setText(DATE_FORMAT);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tDouble b = Double.parseDouble(pTotalCost.getText());\n\t\t\t\t\tif(b<0){\n\t\t\t\t\t\tmsgTotalCost.setText(\"Must be a positive number\");\n\t\t\t\t\t\tvalid=false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmsgTotalCost.setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tmsgTotalCost.setText(\"Invalid number!\");\n\t\t\t\t\tvalid = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn valid;\n\t\t}", "boolean isValidStatus();", "public void ValidationData() {\n try {\n ConnectionClass connectionClass = new ConnectionClass();\n connect = connectionClass.CONN();\n if (connect == null) {\n ConnectionResult = \"Check your Internet Connection\";\n } else {\n String query = \"Select No from machinestatustest where Line='\" + Line + \"' and Station = '\" + Station + \"'\";\n Statement stmt = connect.createStatement();\n ResultSet rs = stmt.executeQuery(query);\n if (rs.next()) {\n Validation = rs.getString(\"No\");\n }\n ConnectionResult = \"Successfull\";\n connect.close();\n }\n } catch (Exception ex) {\n ConnectionResult = ex.getMessage();\n }\n }", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validateRpd14s1()\n {\n // This guideline cannot be automatically tested.\n }", "@Test(enabled=true, priority =1)\r\n\tpublic void view3_validate_table_data() {\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_curr_data) , \"Test_View3\" , \"view3_curr_data\" );\t\r\n\t\thelper.validate_table_columns( view3_curr_data_table , driver , \"\" , \"Test_View3\" , \"view3_curr_data_table\" );\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_today_data) , \"Test_View3\" , \"view3_today_data\" );\r\n\t\thelper.validate_table_columns( view3_today_data_table , driver , \"\" , \"Test_View3\" , \"view3_today_data_table\" );\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_curr_agent_stats_tbl) , \"Test_View3\" , \"view3_curr_agent_stats_tbl\" );\r\n\t\thelper.validate_table_columns( view3_curr_agent_stats_col , driver , \"\" , \"Test_View3\" , \"view3_curr_agent_stats_col\" );\r\n\r\n\t\thelper.validate_table_names( driver.findElement(view3_agent_details) , \"Test_View3\" , \"view3_agent_details\" );\t\r\n\t\thelper.validate_table_columns( view3_Agent_table_data_start , driver , view3_Agent_table_data_end , \"Test_View3\" , \"view3_Agent_table_data\" );\r\n\t}", "public Iterator<String> validate() {\r\n\t\tValidityReport vr = ONT_MODEL.validate();\r\n\t\t\r\n\t\tCollection<String> reports = new ArrayList<String>();\r\n\t\t\r\n\t\tfor(Iterator riter = vr.getReports(); riter.hasNext();)\r\n\t\t{\r\n\t\t\tValidityReport.Report r = (ValidityReport.Report)riter.next();\r\n\t\t\tString msg =\"\";\r\n\t\t\tif(r.isError())\r\n\t\t\t\tmsg += \"[ERROR]\";\r\n\t\t\telse\r\n\t\t\t\tmsg += \"[WARNING]\";\r\n\t\t\tmsg+=\"[\"+r.getType()+\"]\";\r\n\t\t\tmsg+=r.getDescription();\r\n\t\t\treports.add(msg);\r\n\t\t}\r\n\t\t\r\n\t\treturn reports.iterator();\r\n\t}", "void validate(N ndcRequest, ErrorsType errorsType);", "@Override\n\tpublic void validate() {\n\t\t if(pname==null||pname.toString().equals(\"\")){\n\t\t\t addActionError(\"父项节点名称必填!\");\n\t\t }\n\t\t if(cname==null||cname.toString().equals(\"\")){\n\t\t\t addActionError(\"子项节点名称必填!\");\n\t\t }\n\t\t if(caction==null||caction.toString().equals(\"\")){\n\t\t\t addActionError(\"子项节点动作必填!\");\n\t\t }\n\t\t \n\t\t List l=new ArrayList();\n\t\t\tl=userService.QueryByTabId(\"Resfun\", \"resfunid\", resfunid);\n\t\t\t//判断是否修改\n\t\t\tif(l.size()!=0){\n\t\t\t\t\n\t\t\t\tfor(int i=0;i<l.size();i++){\n\t\t\t\t\tResfun rf=new Resfun();\n\t\t\t\t\trf=(Resfun)l.get(i);\n\t\t\t\t\tif(rf.getCaction().equals(caction.trim())&&rf.getCname().equals(cname)&&rf.getPname().equals(pname)){\n\t\t\t\t\t\tSystem.out.println(\"mei gai\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tList n=new ArrayList();\n\t\t\t\t\t\tn=userService.QueryByPcac(\"Resfun\", \"pname\", pname, \"cname\", cname, \"caction\", caction);\n\t\t\t\t\t\tif(n.size()!=0){\n\t\t\t\t\t\t\taddActionError(\"该记录已经存在!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t \n\t\t \n\t\t \n\t\t \n\t}", "public Boolean validEntries() {\n String orderNumber = orderNo.getText();\n String planTime = plannedTime.getText();\n String realTime = actualTime.getText();\n String worker = workerSelected();\n String productType = productTypeSelected();\n Boolean validData = false;\n if (orderNumber.equals(\"\")) {\n warning.setText(emptyOrderNum);\n } else if (!Validation.isValidOrderNumber(orderNumber)) {\n warning.setText(invalidOrderNum);\n } else if (worker.equals(\"\")) {\n warning.setText(workerNotSelected);\n } else if (productType.equals(\"\")) {\n warning.setText(productTypeNotSelected);\n } else if (planTime.equals(\"\")) {\n warning.setText(emptyPlannedTime);\n } else if (!Validation.isValidPlannedTime(planTime)) {\n warning.setText(invalidPlannedTime);\n } else if (!actualTime.getText().isEmpty() && !Validation.isValidActualTime(realTime)) {\n warning.setText(invalidActualTime);\n } else if (comboStatus.getSelectionModel().isEmpty()) {\n warning.setText(emptyStatus);\n } else validData = true;\n return validData;\n }", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "public void validateRpd11s7()\n {\n // This guideline cannot be automatically tested.\n }", "@Override\r\n\tpublic void validate(Product p) throws CustomBadRequestException {\r\n\t\tif(p.getName() == null || p.getName().equals(\"\") || p.getBarcode() == null || p.getBarcode().equals(\"\") || p.getMeasure_unit() == null ||\r\n\t\t\t\tp.getMeasure_unit().equals(\"\") || p.getQuantity() == null || p.getQuantity().equals(\"\")|| p.getBrand() == null || p.getBrand().equals(\"\")){\r\n\t\t\tthrow new CustomBadRequestException(\"Incomplete Information about the product\");\r\n\t\t}\r\n\r\n\t\tString eanCode = p.getBarcode();\r\n\t\tString ValidChars = \"0123456789\";\r\n\t\tchar digit;\r\n\t\tfor (int i = 0; i < eanCode.length(); i++) { \r\n\t\t\tdigit = eanCode.charAt(i); \r\n\t\t\tif (ValidChars.indexOf(digit) == -1) {\r\n\t\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Add five 0 if the code has only 8 digits\r\n\t\tif (eanCode.length() == 8 ) {\r\n\t\t\teanCode = \"00000\" + eanCode;\r\n\t\t}\r\n\t\t// Check for 13 digits otherwise\r\n\t\telse if (eanCode.length() != 13) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\t// Get the check number\r\n\t\tint originalCheck = Integer.parseInt(eanCode.substring(eanCode.length() - 1));\r\n\t\teanCode = eanCode.substring(0, eanCode.length() - 1);\r\n\r\n\t\t// Add even numbers together\r\n\t\tint even = Integer.parseInt((eanCode.substring(1, 2))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(3, 4))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(5, 6))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(7, 8))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(9, 10))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(11, 12))) ;\r\n\t\t// Multiply this result by 3\r\n\t\teven *= 3;\r\n\r\n\t\t// Add odd numbers together\r\n\t\tint odd = Integer.parseInt((eanCode.substring(0, 1))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(2, 3))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(4, 5))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(6, 7))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(8, 9))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(10, 11))) ;\r\n\r\n\t\t// Add two totals together\r\n\t\tint total = even + odd;\r\n\r\n\t\t// Calculate the checksum\r\n\t\t// Divide total by 10 and store the remainder\r\n\t\tint checksum = total % 10;\r\n\t\t// If result is not 0 then take away 10\r\n\t\tif (checksum != 0) {\r\n\t\t\tchecksum = 10 - checksum;\r\n\t\t}\r\n\r\n\t\t// Return the result\r\n\t\tif (checksum != originalCheck) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\tif(Float.parseFloat(p.getQuantity()) <= 0){\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Quantity\");\r\n\t\t}\r\n\r\n\r\n\t}", "public List<String> validate (PostPurchaseOrderRequest postPurchaseOrderRequest) {\n\n List<String> errorList = new ArrayList<>();\n\n errorList.addAll(commonPurchaseOrderValidator.validateLineItems(postPurchaseOrderRequest.getPurchaseOrder().getLineItems(),\n postPurchaseOrderRequest.getPurchaseOrder().getStatus()));\n\n\n return errorList;\n }", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "ch.crif_online.www.webservices.crifsoapservice.v1_00.ComplianceCheckResult getComplianceCheckResult();", "@Test\n public void test10020ATS001ValidationofDatefieldsinPayHistory() throws Exception {\n driver.get(\"http://Clarity\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_UserNameTextBox\")).clear();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_UserNameTextBox\")).sendKeys(\"02.08.09\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_PasswordTextBox\")).clear();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_PasswordTextBox\")).sendKeys(\"password\");\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_LoginButton\")).click();\n driver.findElement(By.id(\"ctl00_ContentPlaceHolder_btnLogin\")).click();\n //driver.findElement(By.linkText(\"Select\")).click();\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*How much is my pension[\\\\s\\\\S][\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).clear();\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).sendKeys(\"02/10/20\");\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*Start date is later than end date\\\\.[\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).clear();\n driver.findElement(By.id(\"ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate\")).sendKeys(\"25/07/2017\");\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).clear();\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate\")).clear();\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate\")).sendKeys(\"02/10/2\");\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).sendKeys(\"02/10/2\");\n //driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton\")).click();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton']\")).click();\n Thread.sleep(1000);\n // Warning: verifyTextPresent may require manual changes\n try {\n assertTrue(driver.findElement(By.cssSelector(\"BODY\")).getText().matches(\"^[\\\\s\\\\S]*End Date is not recognized as a valid date\\\\.[\\\\s\\\\S]*$\"));\n } catch (Error e) {\n verificationErrors.append(e.toString());\n }\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='navigation']/li[3]/span/a\")).click();\n driver.findElement(By.linkText(\"How much is my pension?\")).click();\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate']\")).clear();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDate']\")).sendKeys(\"21221\\\"\\\"\\\"\");\n Thread.sleep(1000);\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).clear();\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_EndDate']\")).sendKeys(\"wewe\\\"\\\"\\\"\");\n driver.findElement(By.xpath(\".//*[@id='ctl01_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_goButton']\")).click();\n Thread.sleep(1000);\n //try {\n //assertTrue(driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_ContentPlaceHolder_StartDateTypeValidator\")).getText().matches(\"^exact:[\\\\s\\\\S]*$\"));\n //} catch (Error e) {\n // verificationErrors.append(e.toString());\n //}\n // ERROR: Caught exception [Error: locator strategy either id or name must be specified explicitly.]\n driver.findElement(By.id(\"ctl00_ctl00_BaseContentPlaceHolder_LoginStatus\")).click();\n }", "public PaymentRequestPage paymentRequestPaymentAvailabilityValidation(String cashbackType,String cashbackValue,String rewardsValue) {\r\n\r\n\t\tString actual = \"\";\r\n\r\n\t\treportStep(\"About to validate the Cashback and Rewards Payment avilablity section in the payment Request page \", \"INFO\");\r\n\r\n\t\tswitch (cashbackType) {\r\n\r\n\t\tcase \"Only_Cashback\":\r\n\r\n\t\t\tvalidateTheElementPresence(cashbackAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, cashbackValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"Only_Rewards\":\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, rewardsValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase \"BothCashback_Rewards\":\r\n\r\n\t\t\tfloat cashbackAmount = Float.parseFloat(cashbackValue);\r\n\t\t\tfloat rewardsAmount = Float.parseFloat(rewardsValue);\r\n\t\t\tfloat totalAmount = cashbackAmount + rewardsAmount ;\r\n\r\n\t\t\tString strTotalAmount = Float.toString(totalAmount) + \"0\";\r\n\t\t\tString strOnlyCashbackAmount = Float.toString(cashbackAmount) + \"0\";\r\n\t\t\tString strOnlyRewardsAmount = Float.toString(rewardsAmount) + \"0\";\r\n\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\t\t\tvalidateTheElementPresence(cashbackText);\r\n\t\t\tvalidateTheElementPresence(rewardsText);\r\n\r\n\t\t\t//validate total cashback amount\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strTotalAmount);\r\n\r\n\t\t\t//validate only cashback amount\r\n\t\t\tactual = getText(cashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyCashbackAmount);\r\n\r\n\r\n\t\t\t//validate only rewards amount\r\n\t\t\tactual = getText(rewardsAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyRewardsAmount);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\r\n\t}", "private void validateListOfStatus( ActionMapping pMapping, HttpServletRequest pRequest )\n {\n setQCClosedDefectStatus( getQCClosedDefectStatus().trim() );\n if ( getQCClosedDefectStatus().length() == 0 )\n {\n addError( \"QCClosedDefectStatus\", new ActionError( \"project_creation.QC.testmanager.error.closedDefects\" ) );\n }\n setQCCoveredReqStatus( getQCCoveredReqStatus().trim() );\n if ( getQCCoveredReqStatus().length() == 0 )\n {\n addError( \"QCCoveredReqStatus\", new ActionError( \"project_creation.QC.testmanager.error.coveredReq\" ) );\n }\n setQCOkRunStatus( getQCOkRunStatus().trim() );\n if ( getQCOkRunStatus().length() == 0 )\n {\n addError( \"QCOkRunStatus\", new ActionError( \"project_creation.QC.testmanager.error.okRun\" ) );\n }\n setQCOpenedReqStatus( getQCOpenedReqStatus().trim() );\n if ( getQCOpenedReqStatus().length() == 0 )\n {\n addError( \"QCOpenedReqStatus\", new ActionError( \"project_creation.QC.testmanager.error.openedReq\" ) );\n }\n setQCPassedStepStatus( getQCPassedStepStatus().trim() );\n if ( getQCPassedStepStatus().length() == 0 )\n {\n addError( \"QCPassedStepStatus\", new ActionError( \"project_creation.QC.testmanager.error.passedStep\" ) );\n }\n setQCToValidateReqStatus( getQCToValidateReqStatus().trim() );\n if ( getQCToValidateReqStatus().length() == 0 )\n {\n addError( \"QCToValidateReqStatus\", new ActionError( \"project_creation.QC.testmanager.error.toValidateReq\" ) );\n }\n }", "private static JsonNode validate (Request req, Response res) {\n FeedVersion version = requestFeedVersion(req, \"manage\");\n\n // FIXME: Update for sql-loader validation process?\n return null;\n// return version.retrieveValidationResult(true);\n }", "private boolean isInputValid() {\n String errorMessage = \"\";\n\n if (ServiceName.getText() == null || ServiceName.getText().length() == 0) {\n errorMessage += \"No valid name!\\n\";\n }\n if (Serviceemail.getText() == null || Serviceemail.getText().length() == 0) {\n Pattern p = Pattern.compile(\"[_A-Za-z0-9][A-Za-z0-9._]*?@[_A-Za-z0-9]+([.][_A-Za-z]+)+\");\n Matcher m = p.matcher(Serviceemail.getText());\n if (m.find() && m.group().equals(Serviceemail.getText())) {\n errorMessage += \"No valid Mail Forment!\\n\";\n }\n }\n if (servicedescrip.getText() == null || servicedescrip.getText().length() == 0) {\n errorMessage += \"No valid description !\\n\";\n }\n if (f == null && s.getImage() == null) {\n errorMessage += \"No valid photo ( please upload a photo !)\\n\";\n }\n if (Serviceprice.getText() == null || Serviceprice.getText().length() == 0) {\n errorMessage += \"No valid prix !\\n\";\n } else {\n // try to parse the postal code into an int.\n try {\n Float.parseFloat(Serviceprice.getText());\n } catch (NumberFormatException e) {\n errorMessage += \"No valid prix (must be a Float)!\\n\";\n }\n }\n if ( !Weekly.isSelected() && !Daily.isSelected() && !Monthly.isSelected()) {\n errorMessage += \"No valid Etat ( select an item !)\\n\";\n }\n if (Servicesatet.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid etat ( select an item !)\\n\";\n }\n if (ServiceCity.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid City ( select an item !)\\n\";\n }\n if (servicetype.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid Type ( select an item !)\\n\";\n }\n if (errorMessage.length() == 0) {\n return true;\n } else {\n // Show the error message.\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Invalid Fields\");\n alert.setHeaderText(\"Please correct invalid fields\");\n alert.setContentText(errorMessage);\n alert.showAndWait();\n return false;\n }\n }", "public void validateRpd11s6()\n {\n // This guideline cannot be automatically tested.\n }", "public TestResult validate(License license, ValidationParameters validationParameters);", "@Test\n public void test12() throws Exception {\n SyncHL7Validator validator = Util.createValidator(profiles, constraints, null, valueSets);\n ClassLoader classLoader = getClass().getClassLoader();\n File message12 = new File(classLoader.getResource(message12FileName).getFile());\n String messageString = FileUtils.readFileToString(message12);\n Report report = validator.check(messageString, \"ORU_R01\");\n\n Set<String> keys = report.getEntries().keySet();\n int errors = 0;\n int alerts = 0;\n for (String key : keys) {\n List<Entry> entries = report.getEntries().get(key);\n if (entries != null && entries.size() > 0) {\n System.out.println(\"*** \" + key + \" ***\");\n for (Entry entry : entries) {\n switch (entry.getClassification()) {\n case \"Error\":\n Util.printEntry(entry);\n errors++;\n break;\n case \"Alert\":\n Util.printEntry(entry);\n alerts++;\n break;\n }\n }\n }\n }\n assertEquals(1, errors);\n assertEquals(0, alerts);\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderStatus getStatus();", "io.opencannabis.schema.commerce.CommercialOrder.OrderStatus getStatus();", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void checkData2019() {\n\n }", "@Override\n public Boolean validate() throws EwpException {\n List<String> message = new ArrayList<String>();\n Map<EnumsForExceptions.ErrorDataType, String[]> dicError = new HashMap<EnumsForExceptions.ErrorDataType, String[]>();\n if (this.name == null) {\n message.add(AppMessage.NAME_REQUIRED);\n dicError.put(EnumsForExceptions.ErrorDataType.REQUIRED, new String[]{\"Name\"});\n }\n\n if (this.tenantStatus <= 0) {\n message.add(AppMessage.TENANT_STATUS_REQUIRED);\n dicError.put(EnumsForExceptions.ErrorDataType.REQUIRED, new String[]{\"Status\"});\n }\n if (message.isEmpty()) {\n return true;\n } else {\n throw new EwpException(new EwpException(\"Validation Exception in TENANT\"), EnumsForExceptions.ErrorType.VALIDATION_ERROR, message, EnumsForExceptions.ErrorModule.DATA_SERVICE, dicError, 0);\n }\n }", "@Test\n public void bookHotelTestError2() throws BookHotelFault, DatatypeConfigurationException{ \n BookHotelInputType input = CreateBookHotelInputType(\"booking_Hotel_1\", \"Tick Joachim\", \"00000000\", 0, 9);\n try {\n assertTrue(bookHotel(input));\n } catch (BookHotelFault e) {\n assertEquals(\"Month must be between 1 and 12\",e.getMessage());\n } \n }", "private boolean checkInfo()\n {\n boolean flag = true;\n if(gName.isEmpty())\n {\n groupName.setError(\"Invalid name\");\n flag = false;\n }\n if(gId.isEmpty())\n {\n groupId.setError(\"Invalid id\");\n flag = false;\n }\n if(gAddress.isEmpty())\n {\n groupAddress.setError(\"Invalid address\");\n flag = false;\n }\n\n for(char c : gName.toCharArray()){\n if(Character.isDigit(c)){\n groupName.setError(\"Invalid Name\");\n flag = false;\n groupName.requestFocus();\n }\n }\n\n if(groupType.isEmpty())\n {\n flag = false;\n rPublic.setError(\"Choose one option\");\n }\n\n if(time.isEmpty())\n time = \"not set\";\n\n if(groupDescription.getText().toString().length()<20||groupDescription.getText().toString().length()>200)\n groupDescription.setError(\"Invalid description\");\n\n return flag;\n }", "public void validateRpd3s14()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s6()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean isValidPart() {\n boolean result = false;\n boolean isComplete = !partPrice.getText().equals(\"\")\n && !partName.getText().equals(\"\")\n && !inventoryCount.getText().equals(\"\")\n && !partId.getText().equals(\"\")\n && !maximumInventory.getText().equals(\"\")\n && !minimumInventory.getText().equals(\"\")\n && !variableTextField.getText().equals(\"\");\n boolean isValidPrice = isDoubleValid(partPrice);\n boolean isValidName = isCSVTextValid(partName);\n boolean isValidId = isIntegerValid(partId);\n boolean isValidMax = isIntegerValid(maximumInventory);\n boolean isValidMin = isIntegerValid(minimumInventory);\n boolean isMinLessThanMax = false;\n if (isComplete)\n isMinLessThanMax = Integer.parseInt(maximumInventory.getText()) > Integer.parseInt(minimumInventory.getText());\n\n if (!isComplete) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Missing Information\");\n errorMessage.setHeaderText(\"You didn't enter required information!\");\n errorMessage.setContentText(\"All fields are required! Your part has not been saved. Press \\\"OK\\\" and try again.\");\n errorMessage.show();\n } else if (!isMinLessThanMax) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Invalid Entry\");\n errorMessage.setHeaderText(\"Min must be less than Max!\");\n errorMessage.setContentText(\"Re-enter your data! Your part has not been saved.Press \\\"OK\\\" and try again.\");\n errorMessage.show();\n } else if (!isValidPrice) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Price is not valid\");\n errorMessage.setHeaderText(\"The value you entered for price is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered does\" +\n \" not include more than one decimal point (.), does not contain any letters, and does not \" +\n \"have more than two digits after the decimal. \");\n errorMessage.show();\n } else if (!isValidName) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Invalid Name\");\n errorMessage.setHeaderText(\"The value you entered for name is not valid.\");\n errorMessage.setContentText(\"Please ensure that the text you enter does not\" +\n \" include any quotation marks,\" +\n \"(\\\"), or commas (,).\");\n errorMessage.show();\n } else if (!isValidId) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect ID\");\n errorMessage.setHeaderText(\"The value you entered for ID is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else if (!isValidMax) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect Max Inventory\");\n errorMessage.setHeaderText(\"The value you entered for Max is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else if (!isValidMin) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect Min Inventory\");\n errorMessage.setHeaderText(\"The value you entered for Min is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else {\n result = true;\n }\n\n return result;\n }", "public void validateSchedular() {\n boolean startDateCheck = false, cronTimeCheck = false, dateFormatCheck = false;\n /*\n Schedular Properties\n */\n\n System.out.println(\"Date: \" + startDate.getValue());\n if (startDate.getValue() != null) {\n System.out.println(\"Date: \" + startDate.getValue());\n startDateCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Start Date should not be empty.\\n\");\n }\n\n if (!cronTime.getText().isEmpty()) {\n cronTimeCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Cron Time should not be empty.\\n\");\n }\n// if (!dateFormat.getText().isEmpty()) {\n// dateFormatCheck = true;\n// } else {\n// execptionData.append((++exceptionCount) + \". Date Format should not be empty.\\n\");\n// }\n\n if (startDateCheck == true && cronTimeCheck == true) {\n schedularCheck = true;\n } else {\n schedularCheck = false;\n startDateCheck = false;\n cronTimeCheck = false;\n dateFormatCheck = false;\n }\n\n }", "public void validateRequestToBuyPage(){\r\n\t\tsearchByShowMeAll();\r\n\t\tclickCheckboxAndRenewBuyButton();\r\n\t\tverifyRequestToBuyPage();\r\n\t}", "private boolean tableDataValid()\r\n {\r\n // if there are any form level validations that should go there\r\n int rowTotal = tblProtoCorresp.getRowCount();\r\n int colTotal = tblProtoCorresp.getColumnCount();\r\n for (int rowIndex = 0; rowIndex < rowTotal ; rowIndex++)\r\n {\r\n for (int colIndex = 0; colIndex < colTotal; colIndex++)\r\n {\r\n TableColumn column = codeTableColumnModel.getColumn(colIndex) ;\r\n\r\n ColumnBean columnBean = (ColumnBean)column.getIdentifier() ;\r\n\r\n if (columnBean.getColumnEditable()\r\n && !columnBean.getColumnCanBeNull())\r\n {\r\n if ( tblProtoCorresp.getValueAt(rowIndex,colIndex) != null)\r\n {\r\n if (tblProtoCorresp.getValueAt(rowIndex,colIndex).equals(\"\")\r\n || tblProtoCorresp.getValueAt(rowIndex,colIndex).toString().trim().equals(\"\") )\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n else\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n }\r\n return true ;\r\n }", "private int completionCheck() {\n if (nameTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(1);\n return -1;\n }\n if (addressTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(2);\n return -1;\n }\n if (postCodeTB.getText().trim().isEmpty()){\n AlertMessage.addCustomerError(3);\n return -1;\n }\n if (countryCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(4);\n return -1;\n }\n if (stateProvinceCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(5);\n return -1;\n }\n if (phone.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(6);\n return -1;\n }\n return 1;\n }", "public void validateRpd22s7()\n {\n // This guideline cannot be automatically tested.\n }", "@Override\r\n\tpublic void validate() {\n\t\t\r\n\t}", "public void validate_the_Account_Number_in_Customer_Account_Summary_of_Customer_Tab(String AccountNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Account Number\").replaceAll(\"M_InnerText\", AccountNumber), \"Account Number - \"+AccountNumber, false);\n\t\tReport.fnReportPageBreak(\"Customer Account Summary\", driver);\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "@Test\n public void test13() throws Exception {\n SyncHL7Validator validator = Util.createValidator(profiles, constraints, null, valueSets);\n ClassLoader classLoader = getClass().getClassLoader();\n File message13 = new File(classLoader.getResource(message13FileName).getFile());\n String messageString = FileUtils.readFileToString(message13);\n Report report = validator.check(messageString, \"ORU_R01\");\n\n Set<String> keys = report.getEntries().keySet();\n int errors = 0;\n int alerts = 0;\n for (String key : keys) {\n List<Entry> entries = report.getEntries().get(key);\n if (entries != null && entries.size() > 0) {\n System.out.println(\"*** \" + key + \" ***\");\n for (Entry entry : entries) {\n switch (entry.getClassification()) {\n case \"Error\":\n Util.printEntry(entry);\n errors++;\n break;\n case \"Alert\":\n Util.printEntry(entry);\n alerts++;\n break;\n }\n }\n }\n }\n assertEquals(1, errors);\n assertEquals(0, alerts);\n }", "@Override\n\tpublic void validate()\n\t{\n\n\t}", "@Test\n\tpublic void testValidate()\n\t{\n\t\tSystem.out.println(\"validate\");\n\t\tUserTypeCode userTypeCode = new UserTypeCode();\n\t\tuserTypeCode.setCode(\"Test\");\n\t\tuserTypeCode.setDescription(\"Test\");\n\n\t\tValidationModel validateModel = new ValidationModel(userTypeCode);\n\t\tvalidateModel.setConsumeFieldsOnly(true);\n\n\t\tValidationResult result = ValidationUtil.validate(validateModel);\n\t\tSystem.out.println(\"Any Valid consume: \" + result.toString());\n\t\tif (result.valid() == false) {\n\t\t\tAssert.fail(\"Failed validation when it was expected to pass.\");\n\t\t}\n\t\tSystem.out.println(\"---------------------------\");\n\n\t\tvalidateModel = new ValidationModel(userTypeCode);\n\t\tresult = ValidationUtil.validate(validateModel);\n\t\tSystem.out.println(\"Faild: \" + result.toString());\n\t}", "public void validateRpd22s6()\n {\n // This guideline cannot be automatically tested.\n }", "public void VerifyCouponfieldsinCheckout(){\r\n\t\tString countriess1 = \"Denmark,France,PresselSwitzerland,Norway,Spain,BernardFrance,,BernardBelgium,PresselAustria,UK,PresselGermany\";\r\n\t\tString countriess2 = \"Germany,Spain\";\r\n\t\tString countriess3 = \"Netherland,Italy\";\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Cupon Input txt box and Apply button should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(countriess1.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput2inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput3inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"3 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"3 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess2.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"1 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"1 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess3.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput2inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"2 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"2 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"incorret country is entered in method for -\"+countries.get(countrycount));\r\n\t\t\t\tthrow new Exception();\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Incorrect country is entered in method for -\"+countries.get(countrycount)+\" or\"\r\n\t\t\t\t\t+ \" Element not found\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"imgShiptoStoreinCartinCheckout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\t\tcatch(Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Number of cupons is not matching for country or Apply button not present for-\"+countries.get(countrycount));\r\n\t\t\tthrow new Error(\"Number of cupons is not matching for country or Apply button not present for-\"+countries.get(countrycount));\r\n\t\t}\r\n\r\n\t}", "@Test(groups ={Slingshot,Regression})\n\tpublic void EditViewLessthan15AcctsErrorValidation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify whether proper error message is displayed in view when continuing with out enabling the accounts check box\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMvManageView\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t\t.clicktestacct();\n\t\t/*.ClickManageUserLink()\n\t\t.ManageViews()\n\t\t.VerifyEditviewname(userProfile)\n\t\t.EditViewNameErrorValidation(userProfile); \t \t\t\t\t\t\t \t \t\t\n\t}*/\n\t}", "public void validateRpd8s12()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd11s3()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd3s7()\n {\n // This guideline cannot be automatically tested.\n }", "@Test (groups = {\"smokeTest\"})\n public void checkTheStatusOfItem() {\n purchases.switchTab(\"Incoming Products\");\n List<WebElement> statusValues = $$(byXpath(\"//td[@class='o_data_cell o_readonly_modifier']\"));\n int totalNumOfStatusValues = statusValues.size();\n //System.out.println(\"The total number of status values: \" + totalNumOfStatusValues);\n int counter =0;\n for (WebElement statusValue : statusValues) {\n String statusText=statusValue.getText();\n counter++;\n Assert.assertTrue((statusText.equals(\"Available\")||statusText.equals(\"Waiting Availability\")) && (!statusText.isEmpty()), \"The status of an item is not displayed.\");\n }\n //System.out.println(\"The number of status values found by counter: \" + counter);\n Assert.assertEquals(totalNumOfStatusValues, counter, \"The total number of status values doesn't match with counter.\");\n\n\n }", "private void batchValidate() {\n lblIdError.setText(CustomValidator.validateLong(fieldId));\n lblNameError.setText(CustomValidator.validateString(fieldName));\n lblAgeError.setText(CustomValidator.validateInt(fieldAge));\n lblWageError.setText(CustomValidator.validateDouble(fieldWage));\n lblActiveError.setText(CustomValidator.validateBoolean(fieldActive));\n }", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "private boolean validateTxns(final Transaxtion txnList[]) throws TaskFailedException {\n\t\tif (txnList.length < 2)\n\t\t\treturn false;\n\t\tdouble dbAmt = 0;\n\t\tdouble crAmt = 0;\n\t\ttry {\n\t\t\tfor (final Transaxtion element : txnList) {\n\t\t\t\tfinal Transaxtion txn = element;\n\t\t\t\tif (!validateGLCode(txn))\n\t\t\t\t\treturn false;\n\t\t\t\tdbAmt += Double.parseDouble(txn.getDrAmount());\n\t\t\t\tcrAmt += Double.parseDouble(txn.getCrAmount());\n\t\t\t}\n\t\t} finally {\n\t\t\tRequiredValidator.clearEmployeeMap();\n\t\t}\n\t\tdbAmt = ExilPrecision.convertToDouble(dbAmt, 2);\n\t\tcrAmt = ExilPrecision.convertToDouble(crAmt, 2);\n\t\tif (LOGGER.isInfoEnabled())\n\t\t\tLOGGER.info(\"Total Checking.....Debit total is :\" + dbAmt + \" Credit total is :\" + crAmt);\n\t\tif (dbAmt != crAmt)\n\t\t\tthrow new TaskFailedException(\"Total debit and credit not matching. Total debit amount is: \" + dbAmt\n\t\t\t\t\t+ \" Total credit amount is :\" + crAmt);\n\t\t// return false;\n\t\treturn true;\n\t}" ]
[ "0.6458406", "0.637449", "0.61803514", "0.61654055", "0.6129052", "0.6113582", "0.5992474", "0.59876764", "0.5983158", "0.59662277", "0.59662277", "0.58490837", "0.58363444", "0.5823224", "0.58171827", "0.5805748", "0.57840073", "0.5773203", "0.57539487", "0.5737957", "0.57018495", "0.5684954", "0.56782746", "0.56781834", "0.5661244", "0.5602304", "0.5601274", "0.55982125", "0.55898714", "0.55691147", "0.55667835", "0.5564449", "0.55578107", "0.55482507", "0.55318177", "0.55219084", "0.550075", "0.550075", "0.54961556", "0.54941064", "0.5480699", "0.5473409", "0.5459124", "0.5458611", "0.5452343", "0.5449765", "0.5449725", "0.54349065", "0.5418511", "0.54137135", "0.5409617", "0.5409292", "0.5404334", "0.53901064", "0.5384712", "0.53786427", "0.53764534", "0.53736454", "0.53598636", "0.5358492", "0.535758", "0.5356061", "0.5349406", "0.53462857", "0.5345284", "0.53410184", "0.5340315", "0.5340315", "0.5336163", "0.53355014", "0.53243315", "0.53208184", "0.5312529", "0.5306646", "0.5300856", "0.5294827", "0.5287366", "0.5285347", "0.5284462", "0.5275519", "0.527106", "0.5269798", "0.52694666", "0.5254347", "0.52503794", "0.52495867", "0.52476364", "0.5242559", "0.5237257", "0.5235766", "0.5225069", "0.5221209", "0.52205974", "0.52185255", "0.52043325", "0.51887316", "0.5177785", "0.517768", "0.5169585", "0.5169209" ]
0.73317015
0
Validation Functions Description : To validate the Address Line 1 of Correspondence Address in Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:05 Oct 2016 Modified By:Raja Parameter:AddressLine1
public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception { Report.fnReportPageBreak("Correspondence Address", driver); VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll("M_Header", "Correspondence Address").replaceAll("M_Category", "Address Line 1").replaceAll("M_InnerText", AddressLine1), "Address Line 1 of Correspondence Address - "+AddressLine1, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_2_of_Correspondence_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Correspondence Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Installation Address - \"+AddressLine2, false);\n\t}", "public boolean isAddressLine1Valid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtAddressLine1.getText().trim().length() > 0)\n\t\t\t\treturn true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtAddressLine1.getText().trim().length() > 0) {\n\t\t\t\treturn true;\n\t\t}\n\t\ttxtAddressLine1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"AddressLine1: This field is required.\"));\n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "private void validateLine1304(Errors errors) {\n }", "abstract void addressValidity();", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "public boolean isAddressLine2Valid() throws BusinessRuleException {\n\t\treturn true;\n\t}", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "public void setAddressline1(String addressline1) {\n this.addressline1 = addressline1;\n }", "public void setAddressLine1(String addressLine1) {\n this.addressLine1 = addressLine1;\n }", "public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Billing Address - \"+Country, false);\n\t}", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Installation Address - \"+Country, false);\n\t}", "public Address validate(Client client, String address) throws BytomException {\n\t\t\tMap<String, Object> req = new HashMap<String, Object>();\n\t\t\treq.put(\"address\", address);\n\t\t\treturn client.request(\"validate-address\", req, Address.class);\n\t\t}", "public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Installation Address - \"+Postcode, false);\n\t}", "public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Billing Address - \"+Postcode, false);\n\t}", "public abstract String getAddressLine1();", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "public boolean validateContactAddress(String contactId, List<String> result)\n {\n return true;\n }", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }", "public void validate(DataRecord value) {\n\r\n\t}", "private void validateData() {\n }", "public void validate_the_Email_Address_1_of_Security_in_Customer_Tab(String EmailAddress1)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 1\").replaceAll(\"M_InnerText\", EmailAddress1), \"Email Address 1 - \"+EmailAddress1, false);\n\t}", "public void validateAdress(String adress) {\r\n\t\tthis.isAdressValid = model.isValidAdress(adress);\r\n\r\n\t\tif (this.isAdressValid) {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: green;\");\r\n\t\t\tcheckButtonUnlock();\r\n\t\t} else {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: red;\");\r\n\t\t\tlockButton();\r\n\t\t}\r\n\t}", "public void validate_the_Town_City_of_Correspondence_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Correspondence Address - \"+TownCity, false);\n\t}", "public abstract String getAddressLine2();", "public String getAddressLine1() {\n return addressLine1;\n }", "public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tif(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity, false))\n\t\t{\n\t\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity);\n\t\t}\n\t\t\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public static Address addAddress() {\r\n\r\n\t\tSystem.out.println(\"Please enter the building number of the supplier:\");\r\n\r\n\t\tint bldNum = Validation.intValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the supplier's street name:\");\r\n\t\tString bldStreet = Validation.stringNoIntsValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the town the supplier is in:\");\r\n\t\tString bldTown = Validation.stringNoIntsValidation();\t\t\r\n\r\n\t\tSystem.out.println(\"Please enter the postcode for the supplier:\");\r\n\t\tString bldPCode = Validation.stringValidation();\r\n\r\n\t\tSystem.out.println(\"Please enter the country the supplier is in:\");\r\n\t\tString bldCountry = Validation.stringNoIntsValidation();\r\n\r\n\t\tAddress newAddress = new Address(bldNum, bldStreet, bldTown, bldPCode, bldCountry);\r\n\r\n\t\treturn newAddress;\r\n\r\n\t}", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "public String getAddressline1() {\n return addressline1;\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validate() {}", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Installation Address - \"+TownCity);\n\t\t\t\n\t\t\t\n\t\t\n\t}", "public void validateRpd14s1()\n {\n // This guideline cannot be automatically tested.\n }", "@Test( dataProvider=\"AddressValidationTestData\", groups ={\"BillingAddressValidations\"})\r\n\r\n\tpublic static void AddNewBillingAddress(String[] BillingAddressDetailsInArray){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tAssert.assertEquals( launchAndValidateDifferentBillingAddresses(BillingAddressDetailsInArray) ,true) ;\t\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\t\t\r\n\t}", "public void testSetLine1_EmptyString() {\r\n try {\r\n address.setLine1(\" \");\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "private Map<String,String> getValidatedAddressInfo(Map<String,String> params) throws ClientProtocolException, IOException \n\t{\n\t\t// Create unique form parameters\n\t\tList<NameValuePair> uniqueParams = new ArrayList<NameValuePair>();\n\t\tuniqueParams.add(new BasicNameValuePair(\"__LASTFOCUS\", \"\"));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__VIEWSTATE\", params.get(\"ViewState\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__EVENTVALIDATION\", params.get(\"EventValidation\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetNumber\", params.get(\"StreetNumber\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetName\", params.get(\"StreetName\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"EnterButton\", \"Enter\"));\n\t\t\n\t\t//get the HTML from the FCPS boundary locator web site\n\t\tString responseHtml = getFCPSBoundaryLocatorHTML(uniqueParams);\n\t\t\n\t\tif(responseHtml == null || responseHtml.isEmpty() || responseHtml.startsWith(\"Error\"))\n\t\t{\n\t\t\tMap<String, String> errMap = new HashMap<String,String>();\n\t\t\terrMap.put(\"Error\", \"Failed Post\");\n\t\t\treturn errMap;\n\t\t}\n\t\telse\t //scrape the HTML to obtain the validated address map\n\t\t\treturn scrapeValidatedAddressHTML(responseHtml.toString());\n\t}", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "void validate();", "void validate();", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "public boolean isAddressValid(String address) {\n\t\tString pattern = \"(^\\\\d+(w|e|s|n)\\\\d+\\\\s\\\\w+\\\\s\\\\w+\\\\.)\";\n\t\tboolean isMatch = Pattern.matches(pattern, address);\n return isMatch;\n }", "private static boolean validateAddress(String address) {\n return !address.isEmpty();\n }", "public abstract void setAddressLine1(String sValue);", "public void setAddressLine2(String addressLine2) {\n this.addressLine2 = addressLine2;\n }", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public static Boolean validateInput(String str) {\n String[] lines = str.split(\"\\n\");\r\n // System.out.println(\"lines array:\"+lines.length);\r\n Boolean validate = true;\r\n String[] lineParameters;\r\n int countFor =0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n\r\n if (lineParameters.length != 5) {\r\n validate = false;\r\n break;\r\n }\r\n }\r\n countFor++;\r\n \r\n\r\n }\r\n return validate;\r\n }", "public void setAddressline2(String addressline2) {\n this.addressline2 = addressline2;\n }", "void addressValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n }", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public boolean isPhone1Valid() throws BusinessRuleException {\n\t\tif (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtPhone1.getText().trim().length() > 0)\n\t\t\treturn true;\n\t\ttxtPhone1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"Phone: This field is required.\"));\n\t}", "@Test\n public void testCreateLabelInvoiceBarcode_AddressValidation_Failure()\n {\n \t\n \ttry {\n \t\t\n \t\tlogger.info(\"Testing creation of label, invoice and barcode for failure scenario .\");\n \t\tString fileName = \"./com/cts/ptms/carrier/yrc/resources/InputData_Standard_AddressValidation_Failure.xml\";\n\t \tURL url = getClass().getClassLoader().getResource(fileName);\n\t\t\tshipmentRequest.setFileName(url.getFile());\n \t\tshipmentRequest.setCarrier(\"YRC\");\n\t \tshipmentRequest.setGenLabel(true);\n\t \tshipmentResponse = yrcSoapClient.createShipmentRequest(shipmentRequest);\n\t \tlogger.info(\"Status:\"+shipmentResponse );\n\t \t\n\t \tassertEquals(\"ERROR\", shipmentResponse.getStatus());\n\t\t\t\n \t} \n\t\tcatch(Exception e)\n\t\t{\n\t\t\tassertEquals(\"Failure\", \"Failure\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Exception occured\"+e.getMessage());\n\t\t}\n \t\n }", "public void testSetLine1_NullString() {\r\n try {\r\n address.setLine1(null);\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "public static boolean validFlightData(String airline[], int rowNo,\r\n\t\t\tString airlineName) throws Exception {\r\n\t\tboolean isValid = true;\r\n\t\tif (airline[0].length() != 5) {\r\n\t\t\tisValid = false;\r\n\t\t}\r\n\t\tif (airline[1].length() != 3 || airline[2].length() != 3) {\r\n\t\t\tisValid = false;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tDateParser.parseDate(airline[3]);\r\n\t\t} catch (ParseException e) {\r\n\t\t\tisValid = false;\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tDouble.parseDouble(airline[5]);\r\n\t\t\tDouble.parseDouble(airline[6]);\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\tisValid = false;\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tif (!(airline[7].contains(GenericConstants.YES_OPTION) || airline[7]\r\n\t\t\t\t.contains(GenericConstants.NO_OPTION))) {\r\n\t\t\tisValid = false;\r\n\t\t}\r\n\t\tif (!(airline[8].contains(CSVReaderConstants.BUSINESS) || airline[8]\r\n\t\t\t\t.contains(CSVReaderConstants.ECONOMIC))) {\r\n\t\t\tisValid = false;\r\n\t\t}\r\n\t\tif (!isValid) {\r\n\t\t\tthrow new Exception(ConsoleMessages.INVAILD_FLIGHT_DETAILS + rowNo\r\n\t\t\t\t\t+ \" in \" + airlineName);\r\n\t\t}\r\n\t\treturn isValid;\r\n\t}", "public abstract FieldReport validate(int fieldSequence, Object fieldValue);", "public void validateRpd13s2()\n {\n // This guideline cannot be automatically tested.\n }", "public void setAddressLine1(String value) {\n setAttributeInternal(ADDRESSLINE1, value);\n }", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "private static boolean validate(String line){\n\t\tString[] lineArray = line.split(\" \");\n\t\t\n\t\tif(lineArray.length != 3) return false; //skip lines in incorrect format\n\t\t\n\t\t//http://stackoverflow.com/questions/25873636/regex-pattern-for-exactly-hhmmss-time-string\n\t\tif(!lineArray[0].matches(\"(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)\")) return false;\n\n\t\tif(!lineArray[2].equals(\"Start\") && !lineArray[2].equals(\"End\")) return false;\n\t\t\n\t\treturn true;\n\t}", "public abstract void setAddressLine2(String sValue);", "public void validate_the_Account_Number_in_Customer_Account_Summary_of_Customer_Tab(String AccountNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Account Number\").replaceAll(\"M_InnerText\", AccountNumber), \"Account Number - \"+AccountNumber, false);\n\t\tReport.fnReportPageBreak(\"Customer Account Summary\", driver);\n\t}", "@SuppressWarnings(\"unused\")\n\t@Test(groups = {\"All\", \"Regression\"})\n\t@AdditionalInfo(module = \"OpenEVV\")\n\tpublic void TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid() throws InterruptedException, java.text.ParseException, IOException, ParseException, ConfigurationException, SQLException\n\t{\n\n\t\t// logger = extent.startTest(\"TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid\");\n\n\t\tlogger.log(LogStatus.INFO, \"To validate valid TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid\");\n\n\t\tJSONArray jsonarray=GenerateUniqueParam.XrefParams(globalVariables.xref_json);\n\t\tJSONObject jsonobject = (JSONObject) jsonarray.get(0);\n\t\tjsonobject.put(\"EmployeeQualifier\", CommonMethods.generateRandomNumberOfFixLength(7));\n\t\tjsonobject.put(\"ClientIDQualifier\", CommonMethods.generateRandomNumberOfFixLength(7));\n\n\n\t\tString bodyAsString = CommonMethods.capturePostResponse(jsonarray, CommonMethods.propertyfileReader(globalVariables.openevv_xref_url));\n\t\tCommonMethods.verifyjsonassertFailcase(bodyAsString, globalVariables.ClientidQualifierFormatError);\n\t\tCommonMethods.verifyjsonassertFailcase(bodyAsString, globalVariables.EmployeeidQualifierFormatError);\n\n\n\t}", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "public com.apatar.cdyne.ws.demographix.SummaryInformation getLocationInformationByAddress(java.lang.String addressLine1, java.lang.String city, java.lang.String stateAbbrev, java.lang.String zipCode, java.lang.String licenseKey) throws java.rmi.RemoteException;", "public void validateRpd13s13()\n {\n // This guideline cannot be automatically tested.\n }", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "public String getAddressLine2() {\n return addressLine2;\n }", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "public Address line1(String line1) {\n this.line1 = line1;\n return this;\n }", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "@Test(enabled = true)\n @UsingDataSet({\"datasets/base_data.xls\", \"datasets/data.xls\"})\n public void testEditAddressCase2() throws Exception {\n final String addrCode = \"30011400002\";\n final Address address = this.addressRepository.getAddressByAddressCode(addrCode);\n final ServiceResult<AddressDto> result = this.addressService.editAddress(address);\n\n Assert.assertNull(result);\n }", "public void validateRpd1s2()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }" ]
[ "0.76585853", "0.7654049", "0.740368", "0.73610985", "0.7334959", "0.69374985", "0.6487551", "0.6414949", "0.6368884", "0.62371856", "0.62317806", "0.6231429", "0.62195706", "0.6162492", "0.61612785", "0.61566246", "0.612351", "0.61111206", "0.60741615", "0.6038106", "0.6026943", "0.6021425", "0.59823287", "0.5970852", "0.5954607", "0.59505486", "0.5942143", "0.5940058", "0.5914404", "0.5905942", "0.59045845", "0.5815097", "0.57866764", "0.5769782", "0.5761013", "0.5757804", "0.5735369", "0.573184", "0.5715684", "0.5711784", "0.5705862", "0.56647515", "0.56550556", "0.56547475", "0.5643895", "0.5642944", "0.56237584", "0.5621147", "0.5606237", "0.5603502", "0.55858654", "0.55845135", "0.5580907", "0.5577784", "0.5565946", "0.5543216", "0.5535063", "0.553059", "0.5524338", "0.5524338", "0.55230355", "0.5518927", "0.551364", "0.5504153", "0.5504153", "0.5496576", "0.5491419", "0.54911834", "0.54900783", "0.5487444", "0.54817194", "0.5476941", "0.5476774", "0.5471772", "0.5454832", "0.5453577", "0.54527974", "0.5448587", "0.54484564", "0.5402379", "0.5384932", "0.53683895", "0.53664464", "0.5356675", "0.53480846", "0.53310126", "0.5325061", "0.53193855", "0.53177214", "0.5314776", "0.53121316", "0.53034705", "0.53019655", "0.5289784", "0.52880895", "0.52868557", "0.5280738", "0.5279297", "0.52759904", "0.5272138" ]
0.78528976
0
Validation Functions Description : To validate the Address Line 2 of Correspondence Address in Customer Tab Coded by :Rajan Created Data:21 Oct 2016 Last Modified Date: Modified By: Parameter:
public void validate_the_Address_Line_2_of_Correspondence_Address_in_Customer_Tab(String AddressLine2)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll("M_Header", "Correspondence Address").replaceAll("M_Category", "Address Line 2").replaceAll("M_InnerText", AddressLine2), "Address Line 2 of Correspondence Address - "+AddressLine2, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Installation Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "public boolean isAddressLine1Valid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtAddressLine1.getText().trim().length() > 0)\n\t\t\t\treturn true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtAddressLine1.getText().trim().length() > 0) {\n\t\t\t\treturn true;\n\t\t}\n\t\ttxtAddressLine1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"AddressLine1: This field is required.\"));\n\t}", "public boolean isAddressLine2Valid() throws BusinessRuleException {\n\t\treturn true;\n\t}", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "abstract void addressValidity();", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Installation Address - \"+Postcode, false);\n\t}", "public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Billing Address - \"+Postcode, false);\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "public void setAddressline2(String addressline2) {\n this.addressline2 = addressline2;\n }", "public abstract String getAddressLine2();", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "public void setAddressLine2(String addressLine2) {\n this.addressLine2 = addressLine2;\n }", "public abstract String getAddressLine1();", "public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Billing Address - \"+Country, false);\n\t}", "public Address validate(Client client, String address) throws BytomException {\n\t\t\tMap<String, Object> req = new HashMap<String, Object>();\n\t\t\treq.put(\"address\", address);\n\t\t\treturn client.request(\"validate-address\", req, Address.class);\n\t\t}", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "private void validateLine1304(Errors errors) {\n }", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }", "public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Installation Address - \"+Country, false);\n\t}", "public void validate_the_Town_City_of_Correspondence_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Correspondence Address - \"+TownCity, false);\n\t}", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public boolean validateContactAddress(String contactId, List<String> result)\n {\n return true;\n }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public void setAddressline1(String addressline1) {\n this.addressline1 = addressline1;\n }", "public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tif(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity, false))\n\t\t{\n\t\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity);\n\t\t}\n\t\t\n\t}", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "public static Address addAddress() {\r\n\r\n\t\tSystem.out.println(\"Please enter the building number of the supplier:\");\r\n\r\n\t\tint bldNum = Validation.intValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the supplier's street name:\");\r\n\t\tString bldStreet = Validation.stringNoIntsValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the town the supplier is in:\");\r\n\t\tString bldTown = Validation.stringNoIntsValidation();\t\t\r\n\r\n\t\tSystem.out.println(\"Please enter the postcode for the supplier:\");\r\n\t\tString bldPCode = Validation.stringValidation();\r\n\r\n\t\tSystem.out.println(\"Please enter the country the supplier is in:\");\r\n\t\tString bldCountry = Validation.stringNoIntsValidation();\r\n\r\n\t\tAddress newAddress = new Address(bldNum, bldStreet, bldTown, bldPCode, bldCountry);\r\n\r\n\t\treturn newAddress;\r\n\r\n\t}", "public void setAddressLine1(String addressLine1) {\n this.addressLine1 = addressLine1;\n }", "public void validate(DataRecord value) {\n\r\n\t}", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "public String getAddressLine2() {\n return addressLine2;\n }", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Installation Address - \"+TownCity);\n\t\t\t\n\t\t\t\n\t\t\n\t}", "private void validateData() {\n }", "public void validate_the_Email_Address_2_of_Security_in_Customer_Tab(String EmailAddress2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 2\").replaceAll(\"M_InnerText\", EmailAddress2), \"Email Address 2 - \"+EmailAddress2, false);\n\t}", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "private Map<String,String> getValidatedAddressInfo(Map<String,String> params) throws ClientProtocolException, IOException \n\t{\n\t\t// Create unique form parameters\n\t\tList<NameValuePair> uniqueParams = new ArrayList<NameValuePair>();\n\t\tuniqueParams.add(new BasicNameValuePair(\"__LASTFOCUS\", \"\"));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__VIEWSTATE\", params.get(\"ViewState\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__EVENTVALIDATION\", params.get(\"EventValidation\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetNumber\", params.get(\"StreetNumber\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetName\", params.get(\"StreetName\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"EnterButton\", \"Enter\"));\n\t\t\n\t\t//get the HTML from the FCPS boundary locator web site\n\t\tString responseHtml = getFCPSBoundaryLocatorHTML(uniqueParams);\n\t\t\n\t\tif(responseHtml == null || responseHtml.isEmpty() || responseHtml.startsWith(\"Error\"))\n\t\t{\n\t\t\tMap<String, String> errMap = new HashMap<String,String>();\n\t\t\terrMap.put(\"Error\", \"Failed Post\");\n\t\t\treturn errMap;\n\t\t}\n\t\telse\t //scrape the HTML to obtain the validated address map\n\t\t\treturn scrapeValidatedAddressHTML(responseHtml.toString());\n\t}", "public abstract void setAddressLine2(String sValue);", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate_the_Email_Address_1_of_Security_in_Customer_Tab(String EmailAddress1)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 1\").replaceAll(\"M_InnerText\", EmailAddress1), \"Email Address 1 - \"+EmailAddress1, false);\n\t}", "public void validateAdress(String adress) {\r\n\t\tthis.isAdressValid = model.isValidAdress(adress);\r\n\r\n\t\tif (this.isAdressValid) {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: green;\");\r\n\t\t\tcheckButtonUnlock();\r\n\t\t} else {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: red;\");\r\n\t\t\tlockButton();\r\n\t\t}\r\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public String getAddressline2() {\n return addressline2;\n }", "public String getAddressLine1() {\n return addressLine1;\n }", "@Test(enabled = true)\n @UsingDataSet({\"datasets/base_data.xls\", \"datasets/data.xls\"})\n public void testEditAddressCase2() throws Exception {\n final String addrCode = \"30011400002\";\n final Address address = this.addressRepository.getAddressByAddressCode(addrCode);\n final ServiceResult<AddressDto> result = this.addressService.editAddress(address);\n\n Assert.assertNull(result);\n }", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public abstract void setAddressLine1(String sValue);", "public void validateRpd13s2()\n {\n // This guideline cannot be automatically tested.\n }", "@Test( dataProvider=\"AddressValidationTestData\", groups ={\"BillingAddressValidations\"})\r\n\r\n\tpublic static void AddNewBillingAddress(String[] BillingAddressDetailsInArray){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tAssert.assertEquals( launchAndValidateDifferentBillingAddresses(BillingAddressDetailsInArray) ,true) ;\t\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\t\t\r\n\t}", "void addressValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n }", "public com.apatar.cdyne.ws.demographix.SummaryInformation getLocationInformationByAddress(java.lang.String addressLine1, java.lang.String city, java.lang.String stateAbbrev, java.lang.String zipCode, java.lang.String licenseKey) throws java.rmi.RemoteException;", "@Test\n public void testCreateLabelInvoiceBarcode_AddressValidation_Failure()\n {\n \t\n \ttry {\n \t\t\n \t\tlogger.info(\"Testing creation of label, invoice and barcode for failure scenario .\");\n \t\tString fileName = \"./com/cts/ptms/carrier/yrc/resources/InputData_Standard_AddressValidation_Failure.xml\";\n\t \tURL url = getClass().getClassLoader().getResource(fileName);\n\t\t\tshipmentRequest.setFileName(url.getFile());\n \t\tshipmentRequest.setCarrier(\"YRC\");\n\t \tshipmentRequest.setGenLabel(true);\n\t \tshipmentResponse = yrcSoapClient.createShipmentRequest(shipmentRequest);\n\t \tlogger.info(\"Status:\"+shipmentResponse );\n\t \t\n\t \tassertEquals(\"ERROR\", shipmentResponse.getStatus());\n\t\t\t\n \t} \n\t\tcatch(Exception e)\n\t\t{\n\t\t\tassertEquals(\"Failure\", \"Failure\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Exception occured\"+e.getMessage());\n\t\t}\n \t\n }", "public String getAddressline1() {\n return addressline1;\n }", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "public void testSetLine2_EmptyString() {\r\n try {\r\n address.setLine2(\" \");\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "private void validateUpdateCustomers(List<CustomersInputDTO> customers, String formatDate) {\n // inner validate\n if (customers == null || customers.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(ConstantsCustomers.CUSTOMERS, Constants.RIQUIRED_CODE));\n }\n // validate common\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n List<Map<String, Object>> customParams = new ArrayList<>();\n customers.forEach(cus -> {\n Map<String, Object> customField = new HashMap<>();\n customField.put(\"rowId\", cus.getCustomerId());\n customField.putAll(buildParamsValidateCustomersInput(cus, jsonBuilder));\n customParams.add(customField);\n });\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n customParams, formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n List<Map<String, Object>> listValidate = CustomersCommonUtil.validateCommon(validateJson, restOperationUtils,\n token, tenantName);\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "EntityAddInfo validateAddrAndSaveEntity(Record inputRecord, boolean shouldSaveActivityHist);", "private static boolean validateAddress(String address) {\n return !address.isEmpty();\n }", "public void validateRpd1s2()\n {\n // This guideline cannot be automatically tested.\n }", "void validate();", "void validate();", "public void validate() {}", "public com.apatar.cdyne.ws.demographix.PlaceInfo getPlaceIDbyAddress(java.lang.String addressLine1, java.lang.String city, java.lang.String stateAbbrev, java.lang.String zipCode, java.lang.String licenseKey) throws java.rmi.RemoteException;", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }", "public PersonInfo addPerson(PersonInfo p) {\n\t\tlog.info(\"Enter First Name\");\n\t\tString fname = obj.next();\n\t\tlog.info(\"Enter Last Name\");\n\t\tString lname = obj.next();\n\t\tlog.info(\"Enter Address\");\n\t\tString address = obj.next();\n\t\tlog.info(\"Enter City\");\n\t\tString city = obj.next();\n\t\tlog.info(\"Enter State\");\n\t\tString state = obj.next();\n\t\tlog.info(\"Enter the six digit Zip Code\");\n\t\tString zipCode = obj.next();\n\t\tString pattern3 = \"^[1-9]{1}[0-9]{5}$\";\n\t\tPattern zip_pattern = Pattern.compile(pattern3);\n\t\tMatcher m3 = zip_pattern.matcher(zipCode);\n\t\tif (m3.matches() == false) {\n\t\t\tlog.info(\"zip code not in format enter again\");\n\t\t\tzipCode = obj.next();\n\t\t}\n\t\tlog.info(\"Enter the ten digit Phone Number\");\n\t\tString phoneNo = obj.next();\n\t\tString pattern1 = \"^[1-9]{1}[0-9]{9}$\";\n\t\tPattern mobile_pattern = Pattern.compile(pattern1);\n\t\tMatcher m1 = mobile_pattern.matcher(phoneNo);\n\t\tif (m1.matches() == false) {\n\t\t\tlog.info(\"phone number not in format enter again\");\n\t\t\tphoneNo = obj.next();\n\t\t}\n\t\tlog.info(\"Enter Email\");\n\t\tString email = obj.next();\n\t\tString pattern2 = \"^[a-zA-Z0-9]+((\\\\.[0-9]+)|(\\\\+[0-9]+)|(\\\\-[0-9]+)|([0-9]))*@*+[a-zA-Z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\";\n\t\tPattern email_sample = Pattern.compile(pattern2);\n\t\tMatcher m2 = email_sample.matcher(email);\n\t\tif (m2.matches() == false) {\n\t\t\tlog.info(\"email not in format enter again\");\n\t\t\temail = obj.next();\n\t\t}\n\t\tp = new PersonInfo(fname, lname, address, city, state, zipCode, phoneNo, email);\n\t\treturn p;\n\t}", "public void validateRpd14s1()\n {\n // This guideline cannot be automatically tested.\n }", "private static JSONObject validateStreet(String street, String city, String state, String zip) throws Exception {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n//\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n//\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n//\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n//\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\n\t\treturn addrKeyFormat;\n\t}", "public void enterAddress2() throws IOException {\n\t\tLoginSignupCompanyPage sp = new LoginSignupCompanyPage(driver);\n\t\tlog.info(\"Verifying the Address2 is available or not\");\n\t\tAssert.assertTrue(enterAddress2.isDisplayed());\n\t\tenterAddress2.sendKeys(BasePage.getCellData(xlsxName, sheetName, 15, 0));\n\n\t}", "public void setAddressLine2(String value) {\n setAttributeInternal(ADDRESSLINE2, value);\n }", "public void validateRpd22s2()\n {\n // This guideline cannot be automatically tested.\n }", "public static Boolean validateInput(String str) {\n String[] lines = str.split(\"\\n\");\r\n // System.out.println(\"lines array:\"+lines.length);\r\n Boolean validate = true;\r\n String[] lineParameters;\r\n int countFor =0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n\r\n if (lineParameters.length != 5) {\r\n validate = false;\r\n break;\r\n }\r\n }\r\n countFor++;\r\n \r\n\r\n }\r\n return validate;\r\n }", "@SuppressWarnings(\"unused\")\n\t@Test(groups = {\"All\", \"Regression\"})\n\t@AdditionalInfo(module = \"OpenEVV\")\n\tpublic void TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid() throws InterruptedException, java.text.ParseException, IOException, ParseException, ConfigurationException, SQLException\n\t{\n\n\t\t// logger = extent.startTest(\"TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid\");\n\n\t\tlogger.log(LogStatus.INFO, \"To validate valid TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid\");\n\n\t\tJSONArray jsonarray=GenerateUniqueParam.XrefParams(globalVariables.xref_json);\n\t\tJSONObject jsonobject = (JSONObject) jsonarray.get(0);\n\t\tjsonobject.put(\"EmployeeQualifier\", CommonMethods.generateRandomNumberOfFixLength(7));\n\t\tjsonobject.put(\"ClientIDQualifier\", CommonMethods.generateRandomNumberOfFixLength(7));\n\n\n\t\tString bodyAsString = CommonMethods.capturePostResponse(jsonarray, CommonMethods.propertyfileReader(globalVariables.openevv_xref_url));\n\t\tCommonMethods.verifyjsonassertFailcase(bodyAsString, globalVariables.ClientidQualifierFormatError);\n\t\tCommonMethods.verifyjsonassertFailcase(bodyAsString, globalVariables.EmployeeidQualifierFormatError);\n\n\n\t}", "public void testSetLine1_EmptyString() {\r\n try {\r\n address.setLine1(\" \");\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "public void createBillingAddress() throws Exception{\n\t\t\n\t\ttype(firstNameTextBox,\"bob\");\n\t\ttype(lastNameTextBox,\"test\");\n\t\ttype(addressLine1TextBox,\"2716 Ocean Park Blvd Suite 1030\");\n\t\ttype(addressLine2TextBox,\"test house\");\n\t\ttype(cityTextBox,\"Santa Monica\");\n\t\ttype(zipcodeTextBox,\"90405\");\n\t\tselect(stateSelectBox,8);\n\t\ttype(phoneTextField,\"6666654686\");\n\t\ttype(companyTextField,\"test company\");\n\t\n\t}", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public Address line2(String line2) {\n this.line2 = line2;\n return this;\n }", "public boolean isAddressValid(String address) {\n\t\tString pattern = \"(^\\\\d+(w|e|s|n)\\\\d+\\\\s\\\\w+\\\\s\\\\w+\\\\.)\";\n\t\tboolean isMatch = Pattern.matches(pattern, address);\n return isMatch;\n }", "public void testSetLine1_NullString() {\r\n try {\r\n address.setLine1(null);\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }" ]
[ "0.7688279", "0.7595675", "0.7550558", "0.73389506", "0.7307285", "0.6581247", "0.6540677", "0.6405884", "0.6391163", "0.63361454", "0.62977064", "0.6249407", "0.61462164", "0.6084987", "0.6069155", "0.60674775", "0.6046833", "0.60307986", "0.5990946", "0.5981377", "0.5967077", "0.5958467", "0.5942608", "0.5930248", "0.5907688", "0.5907338", "0.5901961", "0.5891761", "0.58799124", "0.58571863", "0.585132", "0.5838962", "0.5830629", "0.58125937", "0.57946795", "0.5786268", "0.5768678", "0.5753397", "0.5736638", "0.5715377", "0.57142913", "0.56860316", "0.56738836", "0.56665355", "0.56618094", "0.5656563", "0.5639894", "0.56388295", "0.56292987", "0.562166", "0.561664", "0.56100017", "0.5609666", "0.5609666", "0.56090873", "0.55794245", "0.5563303", "0.5534421", "0.5515723", "0.55106306", "0.550412", "0.5492377", "0.5458553", "0.5449616", "0.5443891", "0.5433949", "0.54305065", "0.5428659", "0.54237515", "0.5405629", "0.53975916", "0.5378348", "0.53780764", "0.53718156", "0.5371599", "0.5367576", "0.53421664", "0.53371793", "0.53237367", "0.53237367", "0.5319722", "0.5317242", "0.5316451", "0.5315572", "0.53079796", "0.5305965", "0.5301715", "0.52978516", "0.5292621", "0.5288016", "0.52691877", "0.5264306", "0.5250057", "0.524942", "0.5223566", "0.52217996", "0.52192056", "0.5214184", "0.5212167", "0.52116454" ]
0.76617146
1
Validation Functions Description : To validate the Town/City of Correspondence Address in Customer Tab Coded by :Rajan Created Data:21 Oct 2016 Last Modified Date: Modified By: Parameter:
public void validate_the_Town_City_of_Correspondence_Address_in_Customer_Tab(String TownCity)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll("M_Header", "Correspondence Address").replaceAll("M_Category", "Town/City").replaceAll("M_InnerText", TownCity), "Town/City of Correspondence Address - "+TownCity, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tif(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity, false))\n\t\t{\n\t\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity);\n\t\t}\n\t\t\n\t}", "public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Installation Address - \"+TownCity);\n\t\t\t\n\t\t\t\n\t\t\n\t}", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "abstract void addressValidity();", "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Billing Address - \"+Country, false);\n\t}", "public void validate_the_Address_Line_2_of_Correspondence_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Correspondence Address - \"+AddressLine2, false);\n\t}", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Billing Address - \"+Postcode, false);\n\t}", "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Installation Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Installation Address - \"+Country, false);\n\t}", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "private static JSONObject validateStreet(String street, String city, String state, String zip) throws Exception {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n//\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n//\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n//\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n//\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\n\t\treturn addrKeyFormat;\n\t}", "public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Installation Address - \"+Postcode, false);\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "@Test\n\tpublic void requestDataForCustomer12212_checkAddressCity_expectBeverlyHills() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "private void validateData() {\n }", "public Address validate(Client client, String address) throws BytomException {\n\t\t\tMap<String, Object> req = new HashMap<String, Object>();\n\t\t\treq.put(\"address\", address);\n\t\t\treturn client.request(\"validate-address\", req, Address.class);\n\t\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "private Map<String,String> getValidatedAddressInfo(Map<String,String> params) throws ClientProtocolException, IOException \n\t{\n\t\t// Create unique form parameters\n\t\tList<NameValuePair> uniqueParams = new ArrayList<NameValuePair>();\n\t\tuniqueParams.add(new BasicNameValuePair(\"__LASTFOCUS\", \"\"));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__VIEWSTATE\", params.get(\"ViewState\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__EVENTVALIDATION\", params.get(\"EventValidation\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetNumber\", params.get(\"StreetNumber\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetName\", params.get(\"StreetName\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"EnterButton\", \"Enter\"));\n\t\t\n\t\t//get the HTML from the FCPS boundary locator web site\n\t\tString responseHtml = getFCPSBoundaryLocatorHTML(uniqueParams);\n\t\t\n\t\tif(responseHtml == null || responseHtml.isEmpty() || responseHtml.startsWith(\"Error\"))\n\t\t{\n\t\t\tMap<String, String> errMap = new HashMap<String,String>();\n\t\t\terrMap.put(\"Error\", \"Failed Post\");\n\t\t\treturn errMap;\n\t\t}\n\t\telse\t //scrape the HTML to obtain the validated address map\n\t\t\treturn scrapeValidatedAddressHTML(responseHtml.toString());\n\t}", "public boolean validateContactAddress(String contactId, List<String> result)\n {\n return true;\n }", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "private void validateUpdateCustomers(List<CustomersInputDTO> customers, String formatDate) {\n // inner validate\n if (customers == null || customers.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(ConstantsCustomers.CUSTOMERS, Constants.RIQUIRED_CODE));\n }\n // validate common\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n List<Map<String, Object>> customParams = new ArrayList<>();\n customers.forEach(cus -> {\n Map<String, Object> customField = new HashMap<>();\n customField.put(\"rowId\", cus.getCustomerId());\n customField.putAll(buildParamsValidateCustomersInput(cus, jsonBuilder));\n customParams.add(customField);\n });\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n customParams, formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n List<Map<String, Object>> listValidate = CustomersCommonUtil.validateCommon(validateJson, restOperationUtils,\n token, tenantName);\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "void addressValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n }", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "@Test\n public void testIncorrectPostalCode(){\n UserRegisterKYC tooLong = new UserRegisterKYC(\"hello\",validId3,\"30/03/1995\",\"7385483\");\n int requestResponse = tooLong.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC tooShort = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"48532\");\n requestResponse = tooShort.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC startWith74 = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"746532\");\n requestResponse = startWith74.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC startWithMoreThan82 = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"967532\");\n requestResponse = startWithMoreThan82.sendRegisterRequest();\n assertEquals(400,requestResponse);\n }", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "public static Address addAddress() {\r\n\r\n\t\tSystem.out.println(\"Please enter the building number of the supplier:\");\r\n\r\n\t\tint bldNum = Validation.intValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the supplier's street name:\");\r\n\t\tString bldStreet = Validation.stringNoIntsValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the town the supplier is in:\");\r\n\t\tString bldTown = Validation.stringNoIntsValidation();\t\t\r\n\r\n\t\tSystem.out.println(\"Please enter the postcode for the supplier:\");\r\n\t\tString bldPCode = Validation.stringValidation();\r\n\r\n\t\tSystem.out.println(\"Please enter the country the supplier is in:\");\r\n\t\tString bldCountry = Validation.stringNoIntsValidation();\r\n\r\n\t\tAddress newAddress = new Address(bldNum, bldStreet, bldTown, bldPCode, bldCountry);\r\n\r\n\t\treturn newAddress;\r\n\r\n\t}", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "public boolean validData(String[] data) {\n\t\tboolean validData = true;\n\t\tint year, quarter, month;\n\t\ttry {\n\t\t\tyear = Integer.valueOf(data[0]);\n\t\t\tquarter = Integer.valueOf(data[1]);\n\t\t\tmonth = Integer.valueOf(data[2]);\n\t\t\tint CRSArrTime = Integer.valueOf(data[40]);\n\t\t\tint CRSDepTime = Integer.valueOf(data[29]);\n\t\t\tint timeZone = timeToMinute(Integer.valueOf(data[40])) - timeToMinute(Integer.valueOf(data[29])) - Integer.valueOf(data[50]);\n\t\t\tint origin_AirportID = Integer.valueOf(data[11]);\n\t\t\tint dest_AirportID = Integer.valueOf(data[20]);\n\t\t\tint origin_AirportSeqID = Integer.valueOf(data[12]);\n\t\t\tint dest_AirportSeqID = Integer.valueOf(data[21]);\n\t\t\tint origin_CityMarketID = Integer.valueOf(data[13]);\n\t\t\tint dest_CityMarketID = Integer.valueOf(data[22]);\n\t\t\tint origin_StateFips = Integer.valueOf(data[17]);\n\t\t\tint dest_StateFips = Integer.valueOf(data[26]);\n\t\t\tint origin_wac = Integer.valueOf(data[19]);\n\t\t\tint dest_wac = Integer.valueOf(data[28]);\n\t\t\tint cancelled = Integer.valueOf(data[47]);\n\t\t\tString origin = data[14];\n\t\t\tString dest = data[23];\n\t\t\tString origin_cityname = data[15];\n\t\t\tString dest_cityname = data[24];\n\t\t\tString origin_state = data[18];\n\t\t\tString dest_state = data[27];\n\t\t\tString origin_state_abr = data[16];\n\t\t\tString dest_state_abr = data[25];\n\t\t\t\n\t\t\tif ((CRSArrTime != 0 && CRSDepTime != 0) &&\n\t\t\t\t(timeZone%60 == 0) &&\t\n\t\t\t\t(origin_AirportID >0 && dest_AirportID > 0 && origin_AirportSeqID > 0 && dest_AirportSeqID > 0 \n\t\t\t\t\t\t&& origin_CityMarketID > 0 && dest_CityMarketID > 0 && origin_StateFips > 0 && dest_StateFips > 0 \n\t\t\t\t\t\t&& origin_wac > 0 && dest_wac > 0)\t&&\n\t\t\t\t(!origin.isEmpty() && !dest.isEmpty() && !origin_cityname.isEmpty() && !dest_cityname.isEmpty()\n\t\t\t\t\t\t&& !origin_state.isEmpty() && !dest_state.isEmpty() && !origin_state_abr.isEmpty() && !dest_state_abr.isEmpty())) {\n\t\t\t\t\n\t\t\t\t// for flights which are not cancelled\n\t\t\t\tif (cancelled != 1) {\n\t\t\t\t\tif (((timeToMinute(Integer.valueOf(data[41])) - timeToMinute(Integer.valueOf(data[30])) - Integer.valueOf(data[51]) - timeZone)/60)%24 == 0) {\n\t\t\t\t\t\tif (Float.valueOf(data[42]) > 0) {\n\t\t\t\t\t\t\tif (Float.valueOf(data[42]).equals(Float.valueOf(data[43])))\n\t\t\t\t\t\t\t\tvalidData = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Float.valueOf(data[42]) < 0) {\n\t\t\t\t\t\t\tif (Float.valueOf(data[43]) == 0)\n\t\t\t\t\t\t\t\tvalidData = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Float.valueOf(data[43]) >= 15) {\n\t\t\t\t\t\t\tif (Float.valueOf(data[44]) == 1)\n\t\t\t\t\t\t\t\tvalidData = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// fill map\n\t\tif ((year == 2015) && (quarter == 1) && (month == 1)) {\n\t\t\ttry {\n\t\t\t\tString carrier = data[8];\n\t\t\t\tfloat price = Float.valueOf(data[109]);\n\t\t\t\t\n\t\t\t\tif (map_t.containsKey(carrier)) {\n\t\t\t\t\tArrayList<Float> list = map_t.get(carrier);\n\t\t\t\t\tlist.add(price);\n\t\t\t\t\tmap_t.put(carrier, list);\n\t\t\t\t} else {\n\t\t\t\t\tArrayList<Float> list = new ArrayList<Float>();\n\t\t\t\t\tlist.add(price);\n\t\t\t\t\tmap_t.put(carrier, list);\n\t\t\t\t}\t\t\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t}\n\t\t}\t\t\t\n\t\treturn validData;\n\t}", "private static boolean validateAddress(String address) {\n return !address.isEmpty();\n }", "public static Customer validateCustomer(TextField shopname, TextField shopcontact, TextField streetadd, ComboBox area, TextField city, TextField zip) {\r\n Customer customer = new Customer();\r\n customer = null;\r\n\r\n if (shopname.getText().isEmpty() || shopcontact.getText().isEmpty() || streetadd.getText().isEmpty()\r\n || city.getText().isEmpty()\r\n || zip.getText().isEmpty() || area.getValue() == null) {\r\n new PopUp(\"Name Error\", \"Field is Empty\").alert();\r\n } else if (!shopcontact.getText().matches(\"\\\\d{10}\")) {\r\n new PopUp(\"Name Error\", \"Contact must be 10 Digit\").alert();\r\n } else if (!zip.getText().matches(\"\\\\d{6}\")) {\r\n new PopUp(\"Error\", \"Zip Code must be 6 Digit\").alert();\r\n } else {\r\n customer.setShopName(shopname.getText());\r\n customer.setShopCont(Long.valueOf(shopcontact.getText()));\r\n customer.setStreetAdd(streetadd.getText());\r\n customer.setArea(area.getValue().toString());\r\n customer.setCity(city.getText());\r\n customer.setZipcode(Integer.valueOf(zip.getText()));\r\n }\r\n\r\n return customer;\r\n }", "@Test( dataProvider=\"AddressValidationTestData\", groups ={\"BillingAddressValidations\"})\r\n\r\n\tpublic static void AddNewBillingAddress(String[] BillingAddressDetailsInArray){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tAssert.assertEquals( launchAndValidateDifferentBillingAddresses(BillingAddressDetailsInArray) ,true) ;\t\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\t\t\r\n\t}", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "@Test(priority = 5)\n\tpublic void verify_Weather_Data_Appears_OnSearching_By_City_StateCodeAndCountryCode() {\n\t\tWeatherAPI.getWeatherInfo(ReadWrite.getProperty(\"Noida_City_State_Country\"),\n\t\t\t\tConfigFileReader.getProperty(\"appid\"), 200);\n\n\t}", "public boolean isAddressLine1Valid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtAddressLine1.getText().trim().length() > 0)\n\t\t\t\treturn true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtAddressLine1.getText().trim().length() > 0) {\n\t\t\t\treturn true;\n\t\t}\n\t\ttxtAddressLine1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"AddressLine1: This field is required.\"));\n\t}", "public Customer(String firstName, String lastName, String emailAddress, String street, String houseNumber, String postalCode, String town, String country, boolean isOwner) throws InvalidEmailException {\n _firstName = firstName;\n _lastName = lastName;\n _emailAddress = new EmailType(emailAddress);\n _address = new AddressType(street, houseNumber, postalCode, town, country); //added adress in Constructor\n _orders = new ArrayList<Order>();\n _isOwner = isOwner;\n _spaces = new ArrayList<Space>();\n\n }", "public static void AddAddress(int selectAddress) throws Exception {\n\t\tWebElement element = null;\n\t\tConstant.UnitNo = Generic.ReadFromExcel(\"UnitNo\", \"LoginDetails\", selectAddress);\n\t\tConstant.StreetName = Generic.ReadFromExcel(\"StreetName\", \"LoginDetails\", selectAddress);\n\t\tConstant.Province = Generic.ReadFromExcel(\"Province\", \"LoginDetails\", selectAddress);\n\t\tConstant.City = Generic.ReadFromExcel(\"City\", \"LoginDetails\", selectAddress);\n\t\tConstant.Barangay = Generic.ReadFromExcel(\"Barangay\", \"LoginDetails\", selectAddress);\n\t\tConstant.ZipCode = Generic.ReadFromExcel(\"ZipCode\", \"LoginDetails\", selectAddress);\n\t\ttry {\n\t\t\tThread.sleep(5000);\n\t\t\tsendKeys(\"CreateAccount\", \"UnitNo\", Constant.UnitNo);\n\t\t\tsendKeys(\"CreateAccount\", \"StreetNo\", Constant.StreetName);\n\t\t\tclick(\"CreateAccount\", \"Province\");\n\t\t\tThread.sleep(1000);\n\t\t\tsendKeys(\"CreateAccount\", \"EnterProvince\", Constant.Province);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.Province + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\n\t\t\t//// *[@content-desc=\"METRO MANILA, List Choice Label\"]\n\n\t\t\tThread.sleep(2000);\n\n\t\t\t// TODO BUG on-going fix\n\t\t\t// <Remarks> uncomment this after fix </Remarks>\n//\t\t\tclick(\"CreateAccount\", \"City\");\n//\t\t\tThread.sleep(1000);\n\n\t\t\tsendKeys(\"CreateAccount\", \"EnterCity\", Constant.City);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.City + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\n\t\t\tThread.sleep(2000);\n\n\t\t\t// TODO BUG on-going fix\n\t\t\t// <Remarks> uncomment this after fix </Remarks>\n//\t\t\tclick(\"CreateAccount\", \"Barangay\");\n//\t\t\tThread.sleep(1000);\n\n\t\t\tsendKeys(\"CreateAccount\", \"EnterBarangay\", Constant.Barangay);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.Barangay + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\t\t\tThread.sleep(1000);\n\t\t\tControl.takeScreenshot();\n\t\t\tscrollToText(\"This Address\"); // Add This Address || Save This Address\n\t\t\tThread.sleep(2000);\n\t\t\tclick(\"CreateAccount\", \"ZipCode\");\n\t\t\tsendKeys(\"CreateAccount\", \"ZipCode\", Constant.ZipCode);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "public void validateAdress(String adress) {\r\n\t\tthis.isAdressValid = model.isValidAdress(adress);\r\n\r\n\t\tif (this.isAdressValid) {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: green;\");\r\n\t\t\tcheckButtonUnlock();\r\n\t\t} else {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: red;\");\r\n\t\t\tlockButton();\r\n\t\t}\r\n\t}", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "@Test\n\tpublic void validateCountry() {\n\t\tRequestSpecification requestSpecification = new base().getRequestSpecification();\n\t\tgiven().get(Endpoint.GET_COUNTRY).then().statusCode(200).\n\t\tand().contentType(ContentType.JSON).\n\t\tand().body(\"name\", hasItem(\"India\")).\n\t\tand().body(\"find { d -> d.name == 'India' }.borders\", hasItem(\"CHN\"));\n\n\t}", "public void doPost(HttpServletRequest request,HttpServletResponse response)\r\n\t{\r\n\t\t String region=request.getParameter(\"6\");\r\n\t\t String username=request.getParameter(\"8\");\r\n\t\t region=rs.change(region);\r\n\t\t print.pl(\"region1;\"+region);\r\n\t\t us.controlRegion(region,username,\"Customer\",\"customer_region\",\"customer_username\");\r\n\t\t String fname=request.getParameter(\"3\");\r\n\t\t fname=rs.change(fname);\r\n\t\t String lname=request.getParameter(\"4\");\r\n\t\t lname=rs.change(lname);\r\n\t\t String s1=request.getParameter(\"Cemail-first\");\r\n\t\t s1=rs.change(s1);\r\n\t\t String s2=request.getParameter(\"Cemail-second\");\r\n\t\t s2=rs.change(s2);\r\n\t\t String email=s1+\"@\"+s2;\r\n\t\t String phone=request.getParameter(\"5\");\r\n\t\t phone=rs.change(phone);\r\n\t\t String address=request.getParameter(\"7\");\r\n\t\t address=rs.change(address);\r\n\t\t if(!fname.isEmpty()&&us.judge(fname,username,5,\"Customer\",\"customer_username\").equals(\"untrue\"))\r\n\t\t {\r\n\t\t\t \r\n\t\t\t hd.updateInfor(\"Customer\",\"customer_firstname\",fname,\"customer_username\",username); \r\n\t\t }\r\n\t\t if(!lname.isEmpty()&&us.judge(lname,username,6,\"Customer\",\"customer_username\").equals(\"untrue\"))\r\n\t\t {\r\n\t\t\t hd.updateInfor(\"Customer\",\"customer_lastname\",lname,\"customer_username\",username);\r\n\t\t }\r\n\t\t if((!s1.isEmpty())&&(!s2.isEmpty())&&us.judge(email,username,7,\"Customer\",\"customer_username\").equals(\"untrue\"))\r\n\t\t {\r\n\t\t hd.updateInfor(\"Customer\",\"customer_email\",email,\"customer_username\",username);\r\n\t\t }\r\n\t\t if(!phone.isEmpty()&&us.judge(phone,username,8,\"Customer\",\"customer_username\").equals(\"untrue\"))\r\n\t\t {\r\n\t\t hd.updateInfor(\"Customer\",\"customer_phone\",phone,\"customer_username\",username);\r\n\t\t }\r\n\t\t if(!address.isEmpty()&&us.judge(address,username,10,\"Customer\",\"customer_username\").equals(\"untrue\"))\r\n\t\t {\r\n\t\t hd.updateInfor(\"Customer\",\"customer_address\",address,\"customer_username\",username);\r\n\t\t }\r\n\t\t doGet(request,response);\r\n\t\t \r\n\t}", "private boolean isInfoValidate(){\n if(mEmailAddress.getText() == null || mEmailAddress.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_email_address);\n return false;\n }\n\n if(!mEmailAddress.getText().toString().contains(\"@\")){\n errorText = getString(R.string.register_warning_valid_email_address);\n return false;\n }\n\n// if(mRegionSpinner.getSelectedItemPosition() == Constant.NON_SELECT){\n// errorText = getString(R.string.register_warning_select_region);\n// return false;\n// }\n\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.HONG_KONG)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.HONGKONG_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n//\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.CHINA)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.CHINA_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n\n if(mPassword.getText() == null || mPassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_password);\n return false;\n }\n\n if(mRetypePassword.getText() == null || mRetypePassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_retype_password);\n return false;\n }\n\n if(!mPassword.getText().toString().equals(mRetypePassword.getText().toString())){\n errorText = getString(R.string.register_warning_not_the_same);\n return false;\n }\n\n if(!Utility.judgeContainsStr( mPassword.getText().toString())){\n errorText = getString(R.string.register_warning_contains_character);\n return false;\n }\n\n// if(!mPolicyCheckBox.isChecked()){\n// errorText = getString(R.string.register_warning_check_agreement);\n// return false;\n// }\n\n return true;\n }", "private void validate() throws FlightCreationException {\n validateNotNull(\"number\", number);\n validateNotNull(\"company name\", companyName);\n validateNotNull(\"aircraft\", aircraft);\n validateNotNull(\"pilot\", pilot);\n validateNotNull(\"origin\", origin);\n validateNotNull(\"destination\", destination);\n validateNotNull(\"departure time\", scheduledDepartureTime);\n\n if (scheduledDepartureTime.isPast()) {\n throw new FlightCreationException(\"The departure time cannot be in the past\");\n }\n\n if (origin.equals(destination)) {\n throw new FlightCreationException(\"The origin and destination cannot be the same\");\n }\n }", "public PersonInfo addPerson(PersonInfo p) {\n\t\tlog.info(\"Enter First Name\");\n\t\tString fname = obj.next();\n\t\tlog.info(\"Enter Last Name\");\n\t\tString lname = obj.next();\n\t\tlog.info(\"Enter Address\");\n\t\tString address = obj.next();\n\t\tlog.info(\"Enter City\");\n\t\tString city = obj.next();\n\t\tlog.info(\"Enter State\");\n\t\tString state = obj.next();\n\t\tlog.info(\"Enter the six digit Zip Code\");\n\t\tString zipCode = obj.next();\n\t\tString pattern3 = \"^[1-9]{1}[0-9]{5}$\";\n\t\tPattern zip_pattern = Pattern.compile(pattern3);\n\t\tMatcher m3 = zip_pattern.matcher(zipCode);\n\t\tif (m3.matches() == false) {\n\t\t\tlog.info(\"zip code not in format enter again\");\n\t\t\tzipCode = obj.next();\n\t\t}\n\t\tlog.info(\"Enter the ten digit Phone Number\");\n\t\tString phoneNo = obj.next();\n\t\tString pattern1 = \"^[1-9]{1}[0-9]{9}$\";\n\t\tPattern mobile_pattern = Pattern.compile(pattern1);\n\t\tMatcher m1 = mobile_pattern.matcher(phoneNo);\n\t\tif (m1.matches() == false) {\n\t\t\tlog.info(\"phone number not in format enter again\");\n\t\t\tphoneNo = obj.next();\n\t\t}\n\t\tlog.info(\"Enter Email\");\n\t\tString email = obj.next();\n\t\tString pattern2 = \"^[a-zA-Z0-9]+((\\\\.[0-9]+)|(\\\\+[0-9]+)|(\\\\-[0-9]+)|([0-9]))*@*+[a-zA-Z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\";\n\t\tPattern email_sample = Pattern.compile(pattern2);\n\t\tMatcher m2 = email_sample.matcher(email);\n\t\tif (m2.matches() == false) {\n\t\t\tlog.info(\"email not in format enter again\");\n\t\t\temail = obj.next();\n\t\t}\n\t\tp = new PersonInfo(fname, lname, address, city, state, zipCode, phoneNo, email);\n\t\treturn p;\n\t}", "public com.apatar.cdyne.ws.demographix.SummaryInformation getLocationInformationByAddress(java.lang.String addressLine1, java.lang.String city, java.lang.String stateAbbrev, java.lang.String zipCode, java.lang.String licenseKey) throws java.rmi.RemoteException;", "public void validate(DataRecord value) {\n\r\n\t}", "@Test\n public void execute_addressParameter() throws ParseException {\n //No user input\n execute_parameterPredicate_test(0, \" \", \"addr\", true, false, Collections.emptyList());\n //Single keyword, ignore case, people found.\n execute_parameterPredicate_test(3, \"ave\", \"addr\", true, false, Arrays.asList(ALICE, BENSON, ELLE));\n //Single keyword, case sensitive, people found.\n execute_parameterPredicate_test(2, \"Ave\", \"addr\", false, false, Arrays.asList(ALICE, BENSON));\n //Multiple keywords, ignore case, or condition, multiple people found\n execute_parameterPredicate_test(2, \"jurong Clementi\", \"addr\", true, false, Arrays.asList(ALICE, BENSON));\n //Multiple keywords, ignore case, and condition, no one found\n execute_parameterPredicate_test(0, \"jurong Clementi\", \"addr\", true, true, Collections.emptyList());\n //Multiple keywords, case sensitive, or condition, multiple people found\n execute_parameterPredicate_test(1, \"jurong Clementi\", \"addr\", false, false, Arrays.asList(BENSON));\n //Multiple keywords, case sensitive, and condition, no one found\n execute_parameterPredicate_test(0, \"jurong Clementi\", \"addr\", false, true, Collections.emptyList());\n }", "@Test(priority = 1, dataProvider = \"wrongcityinput\", dataProviderClass = TestDataProvider.class)\n\tpublic void correctCityValidation(String fromCity, String toCity) throws InterruptedException {\n\t\tlogger = extent.startTest(\"City Validaton\");\n\t\tlog.info(\"Starting wrong City Input validation\");\n\t\tHomePageFlow.cityInput(fromCity, toCity);\n\t\thome.isMessageDisplayed();\n\t\tCommonUtility.clickElement(YatraFlightBookingLocators.getLocators(\"loc.inputbox.goingTo\"));\n\t\tCommonUtility.isDisplayed(YatraFlightBookingLocators.getLocators(\"loc.selectDepartCity.txt\"));\n\n\t\tCommonUtility.clickAndSendText(YatraFlightBookingLocators.getLocators(\"loc.inputbox.goingTo\"), 2, \"BLR\");\n\t\tCommonUtility.action();\n\t}", "@Test\n public void iPAddressGeolocateStreetAddressTest() throws Exception {\n String value = null;\n GeolocateStreetAddressResponse response = api.iPAddressGeolocateStreetAddress(value);\n\n // TODO: test validations\n }", "public static void validation() {\n\t\tif ((!textFieldName.getText().isEmpty()) && (!textField_FirstName.getText().isEmpty())\n\t\t\t\t&& (!textField_Town.getText().isEmpty()) && (!textField_Town.getText().isEmpty())) {\n\n\t\t\tif ((isValidEmailAddress(textField_Email.getText()) == true)) {\n\t\t\t\ttextField_Email.setBackground(Color.white);\n\t\t\t\tif ((force(textField_Mtp.getText()) > 82)) {\n\t\t\t\t\ttextField_Mtp.setBackground(Color.white);\n\t\t\t\t\tactionGiveServeur();\n\n\t\t\t\t} else {\n\t\t\t\t\tshowMessageDialog(null, \"Votre mot de passe est trop faible\");\n\t\t\t\t\ttextField_Mtp.setText(\"Mot de passe trop simple : changer le \");\n\t\t\t\t\ttextField_Mtp.setBackground(Color.RED);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextField_Email.setText(\"Email invalide\");\n\t\t\t\ttextField_Email.setBackground(Color.RED);\n\t\t\t\tshowMessageDialog(null, \"Email est invalide\");\n\t\t\t}\n\t\t} else {\n\n\t\t\tshowMessageDialog(null, \"Certain champs sont vide !\");\n\t\t}\n\t}", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "public static Address createInvalidAddressFixture() {\n Map<String, Object> objectMap = new HashMap<String, Object>();\n objectMap.put(\"name\", \"Undefault New Wu\");\n objectMap.put(\"street1\", \"Clayton St.\");\n objectMap.put(\"street_no\", \"215215\");\n objectMap.put(\"street2\", null);\n objectMap.put(\"city\", \"San Francisco\");\n objectMap.put(\"state\", \"CA\");\n objectMap.put(\"zip\", \"94117\");\n objectMap.put(\"country\", \"US\");\n objectMap.put(\"phone\", \"+1 555 341 9393\");\n objectMap.put(\"email\", \"[email protected]\");\n objectMap.put(\"is_residential\", false);\n objectMap.put(\"metadata\", \"Customer ID 123456\");\n objectMap.put(\"validate\", true);\n\n try {\n return Address.create(objectMap);\n } catch (ShippoException e) {\n e.printStackTrace();\n }\n return null;\n }", "void validate(N ndcRequest, ErrorsType errorsType);", "@Override\r\n\tpublic void insert(Address obj) {\r\n\t\tValidationReturn validation = validator.insert(obj);\r\n\t\t\r\n\t\tif (!validation.getStatus().equals(200)) {\r\n\t\t\tthrow new DBException(validation.toString());\r\n\t\t}\r\n\t\t\r\n\t\tDAOJDBC DAOJDBCModel = new DAOJDBC();\r\n\t\t\r\n\t\tString collumsToInsert = \"street, district, number\";\r\n\t\tString valuesToInsert = \"'\" + obj.getStreet() + \"','\" + obj.getDistrict() + \"',\" + obj.getNumber();\r\n\t\t\r\n\t\tif (!obj.getNote().isEmpty()) {\r\n\t\t\tcollumsToInsert += \", note\";\r\n\t\t\tvaluesToInsert += (\",'\" + obj.getNote() + \"'\");\r\n\t\t}\r\n\t\t\r\n\t\tDAOJDBCModel.singleCall(\"INSERT INTO address (\" + collumsToInsert + \") VALUES (\" + valuesToInsert + \");\");\r\n\t}", "public boolean isValidAddress(TextInputLayout tiAddress, EditText etAddress) {\n return (validAddress(tiAddress, etAddress) != null);\n }", "private static boolean isValidateRecord(Map<String, Object> m)\n throws Exception{\n float crsArrTime = (float) m.get(\"CRS_ARR_TIME\");\n float crsDeptTime = (float) m.get(\"CRS_DEP_TIME\");\n float crsElapsedTime = (float) m.get(\"CRS_ELAPSED_TIME\");\n float actElapsedTime = (float) m.get(\"ACTUAL_ELAPSED_TIME\");\n float arrDelay = (float) m.get(\"ARR_DELAY\");\n float arrDelayMin = (float) m.get(\"ARR_DELAY_NEW\");\n float timeZone = crsArrTime - crsDeptTime - crsElapsedTime;\n float cancelledCheck = timeZone - actElapsedTime;\n float timeModulo = timeZone % 60;\n\n // CRSArrTime and CRSDepTime should not be zero\n // timeZone = CRSArrTime - CRSDepTime - CRSElapsedTime and timeZone % 60 should be 0\n if (crsArrTime == 0 || crsDeptTime == 0 || timeModulo != 0) return false;\n\n // AirportID, AirportSeqID, CityMarketID, StateFips, Wac should be larger than 0\n if ((float) m.get(\"ORIGIN_AIRPORT_ID\") <= 0) return false;\n if ((float) m.get(\"ORIGIN_AIRPORT_SEQ_ID\") <= 0) return false;\n if ((float) m.get(\"ORIGIN_CITY_MARKET_ID\") <= 0) return false;\n if ((float) m.get(\"ORIGIN_STATE_FIPS\") <= 0) return false;\n if ((float) m.get(\"ORIGIN_WAC\") <= 0) return false;\n\n if ((float) m.get(\"DEST_AIRPORT_ID\") <= 0) return false;\n if ((float) m.get(\"DEST_AIRPORT_SEQ_ID\") <= 0) return false;\n if ((float) m.get(\"DEST_CITY_MARKET_ID\") <= 0) return false;\n if ((float) m.get(\"DEST_STATE_FIPS\") <= 0) return false;\n if ((float) m.get(\"DEST_WAC\") <= 0) return false;\n\n // Origin, Destination, CityName, State, StateName should not be empty\n if (m.get(\"ORIGIN\").toString().equals(\"\")) return false;\n if (m.get(\"ORIGIN_CITY_NAME\").toString().equals(\"\")) return false;\n if (m.get(\"ORIGIN_STATE_ABR\").toString().equals(\"\")) return false;\n if (m.get(\"ORIGIN_STATE_NM\").toString().equals(\"\")) return false;\n if (m.get(\"DEST\").toString().equals(\"\")) return false;\n if (m.get(\"DEST_CITY_NAME\").toString().equals(\"\")) return false;\n if (m.get(\"DEST_STATE_ABR\").toString().equals(\"\")) return false;\n if (m.get(\"DEST_STATE_NM\").toString().equals(\"\")) return false;\n\n // For flights that are not Cancelled: ArrTime - DepTime - ActualElapsedTime - timeZone should be zero\n if ((boolean)m.get(\"CANCELLED\") && cancelledCheck != 0) return false;\n\n // if ArrDelay > 0 then ArrDelay should equal to ArrDelayMinutes if ArrDelay < 0 then ArrDelayMinutes should be zero\n // if ArrDelayMinutes >= 15 then ArrDel15 should be true\n if (arrDelay > 0 && arrDelay != arrDelayMin) return false;\n if (arrDelay < 0 && arrDelayMin != 0) return false;\n if (arrDelayMin >= 15 && !(boolean)m.get(\"ARR_DEL15\")) return false;\n\n return true;\n }", "public void createBillingAddress() throws Exception{\n\t\t\n\t\ttype(firstNameTextBox,\"bob\");\n\t\ttype(lastNameTextBox,\"test\");\n\t\ttype(addressLine1TextBox,\"2716 Ocean Park Blvd Suite 1030\");\n\t\ttype(addressLine2TextBox,\"test house\");\n\t\ttype(cityTextBox,\"Santa Monica\");\n\t\ttype(zipcodeTextBox,\"90405\");\n\t\tselect(stateSelectBox,8);\n\t\ttype(phoneTextField,\"6666654686\");\n\t\ttype(companyTextField,\"test company\");\n\t\n\t}", "private boolean validateInputs(String iStart, String iEnd, String country, String type) {\n \thideErrors();\n \tint validStart;\n \tint validEnd;\n boolean valid = true;\n// \t//will not occur due to UI interface\n// if (isComboBoxEmpty(type)) {\n// \tvalid = false;\n// \tT3_type_error_Text.setVisible(true);\n// }\n if (isComboBoxEmpty(country)) {\n \tvalid = false;\n \tT3_country_error_Text.setVisible(true);\n }\n \t//checking if start year and end year are set\n if (isComboBoxEmpty(iStart)){\n //start is empty\n T3_start_year_error_Text.setVisible(true);\n valid = false;\n }\n if (isComboBoxEmpty(iEnd)){\n //end is empty\n T3_end_year_error_Text.setVisible(true);\n valid = false;\n }\n \tif (valid){\n //if years are not empty and valid perform further testing\n \t\t//fetch valid data range\n \tPair<String,String> validRange = DatasetHandler.getValidRange(type, country);\n \tvalidStart = Integer.parseInt(validRange.getKey());\n \tvalidEnd = Integer.parseInt(validRange.getValue());\n //check year range validity\n \t\tint start = Integer.parseInt(iStart);\n \t\tint end = Integer.parseInt(iEnd);\n \tif (start>=end) {\n \t\tT3_range_error_Text.setText(\"Start year should be < end year\");\n \t\tT3_range_error_Text.setVisible(true);\n \t\tvalid=false;\n \t}\n// \t//will not occur due to UI interface\n// \telse if (start<validStart) {\n// \t\tT3_range_error_Text.setText(\"Start year should be >= \" + Integer.toString(validStart));\n// \t\tT3_range_error_Text.setVisible(true);\n// \t\tvalid=false;\n// \t}else if (end>validEnd) {\n// \t\tT3_range_error_Text.setText(\"End year should be <= \" + Integer.toString(validEnd));\n// \t\tT3_range_error_Text.setVisible(true);\n// \t\tvalid=false;\n// \t}\n \t}\n// \t//will not occur due to UI interface\n// \tif(isComboBoxEmpty(type)) {\n// \t\t//if type is not set\n// T3_type_error_Text.setVisible(true);\n// \t}\n \t\n if(isComboBoxEmpty(country)) {\n //if country is not set\n T3_country_error_Text.setVisible(true);\n }\n \treturn valid;\n }", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "@Test(enabled = true)\n @UsingDataSet({\"datasets/base_data.xls\", \"datasets/data.xls\"})\n public void testEditAddressCase2() throws Exception {\n final String addrCode = \"30011400002\";\n final Address address = this.addressRepository.getAddressByAddressCode(addrCode);\n final ServiceResult<AddressDto> result = this.addressService.editAddress(address);\n\n Assert.assertNull(result);\n }", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate(Object obj, Errors errors) {\n\t\t\n\t\tBooking booking = (Booking) obj;\n\t\t\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(errors, \"aptNo\", \"error.invalid.aptNo\", \"Apartment Number Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"street\", \"error.invalid.street\", \"Street Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"city\", \"error.invalid.city\", \"City Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"state\", \"error.invalid.state\", \"State Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"zipCode\", \"error.invalid.zipCode\", \"Zipcode Required\");\n \n\t}", "static void validateRatSightingDetails(String locationType, String zipCode, String address, String city, String borough, String latitude, String longitude) throws InvalidRatSightingException {\n ArrayList<InvalidRatSightingException.InvalidRatSightingReason> reasons = new ArrayList<>();\n\n if (!RatSighting.validateLocationType(locationType)) {\n reasons.add(InvalidRatSightingException.InvalidRatSightingReason.BAD_LOCATION_TYPE);\n }\n\n if (!RatSighting.validateZipCode(zipCode)) {\n reasons.add(InvalidRatSightingException.InvalidRatSightingReason.BAD_ZIP_CODE);\n }\n\n if (!RatSighting.validateAddress(address)) {\n reasons.add(InvalidRatSightingException.InvalidRatSightingReason.BAD_ADDRESS);\n }\n\n if (!RatSighting.validateCity(city)) {\n reasons.add(InvalidRatSightingException.InvalidRatSightingReason.BAD_CITY);\n }\n\n if (!RatSighting.validateBorough(borough)) {\n reasons.add(InvalidRatSightingException.InvalidRatSightingReason.BAD_BOROUGH);\n }\n\n if (!RatSighting.validateLatitude(latitude)) {\n reasons.add(InvalidRatSightingException.InvalidRatSightingReason.BAD_LATITUDE);\n }\n\n if (!RatSighting.validateLongitude(longitude)) {\n reasons.add(InvalidRatSightingException.InvalidRatSightingReason.BAD_LONGITUDE);\n }\n\n if (!reasons.isEmpty()) {\n throw new InvalidRatSightingException(reasons);\n }\n }", "private void onClickCreateAddressButton() {\n // Validate\n if (!formValidated()) {\n } else {\n\n ContentValues values = new ContentValues();\n values.put(\"address_form[id]\", \"\");\n values.put(\"address_form[first_name]\", name.getText().toString());\n values.put(\"address_form[last_name]\", family.getText().toString());\n values.put(\"address_form[address1]\", address.getText().toString());\n values.put(\"address_form[address2]\", postal_code.getText().toString());\n values.put(\"address_form[region]\", region_Id);\n values.put(\"address_form[city]\", city_Id);\n if (post_id != UNKNOWN_POSTAL_CODE) {\n values.put(\"address_form[postcode]\", post_id);\n } else {\n values.put(\"address_form[postcode]\", \"\");\n }\n values.put(\"address_form[phone]\", cellphone.getText().toString());\n values.put(\"address_form[is_default_shipping]\", 1);\n values.put(\"address_form[is_default_billing]\", 1);\n\n values.put(\"address_form[gender]\", gender_lable);\n\n\n triggerCreateAddress(createAddressUrl, values);\n }\n }", "void validate(T regData, Errors errors);", "void validate();", "void validate();", "private void ValidateEditTextFields() {\n\tfor (int i = 0; i < etArray.length; i++) {\n\t if (etArray[i].getText().toString().trim().length() <= 0) {\n\t\tvalidCustomer = false;\n\t\tetArray[i].setError(\"Blank Field\");\n\t }\n\t}\n\n\tif (etPhoneNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etPhoneNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (etEmergencyNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etEmergencyNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (calendarDob == null) {\n\t validCustomer = false;\n\t}\n }", "public String changeContactDetails(final EmployeeAddressDTO employeeAddressDTO) throws ApplicationCustomException;", "public abstract boolean verifyIdAnswers(String firstName, String lastName, String address, String city, String state, String zip, String ssn, String yob);", "@Test\r\n\tpublic void view3_todays_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"CML Service Level\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table2 = driver.findElements(view3_todays_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table2 = driver.findElements(By.xpath(view3_today_data_table));\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table2, data_of_table2 );\r\n\t}", "public boolean isCityValid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtCity.getText().trim().length() > 0)\n\t\t return true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtCity.getText().trim().length() > 0) {\n\t\t\treturn true;\n\t\t}\n\t\ttxtCity.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"Town / City: This field is required.\"));\n\t}", "public Address(String street, String city, String zipCode, String country)\n {\n //reference the object classes constructors\n this.street = street;\n this.city = city;\n this.zipCode = zipCode;\n this.country = country;\n }", "private void fillCity() {\n \n if(postalCodeTF.getText().length() == 4){\n City city = memberConnection.getCity(postalCodeTF.getText());\n cityTF.setText(city.getCity().replaceAll(\"_\", \" \"));\n municipalTF.setText(city.getMunicipal().replaceAll(\"_\", \" \"));\n }\n }", "private int completionCheck() {\n if (nameTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(1);\n return -1;\n }\n if (addressTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(2);\n return -1;\n }\n if (postCodeTB.getText().trim().isEmpty()){\n AlertMessage.addCustomerError(3);\n return -1;\n }\n if (countryCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(4);\n return -1;\n }\n if (stateProvinceCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(5);\n return -1;\n }\n if (phone.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(6);\n return -1;\n }\n return 1;\n }", "public void validate() {}" ]
[ "0.70732737", "0.6847529", "0.6467154", "0.63994783", "0.6377919", "0.6373702", "0.6362843", "0.6349245", "0.63432646", "0.62863284", "0.62831837", "0.6263508", "0.62421155", "0.62162167", "0.62088937", "0.6187014", "0.6180656", "0.6174545", "0.6144367", "0.6141071", "0.61188734", "0.609257", "0.6081541", "0.6080235", "0.60726184", "0.6072339", "0.6070583", "0.60324997", "0.5992685", "0.59270155", "0.5913431", "0.5862759", "0.5862481", "0.57535636", "0.57429427", "0.5686865", "0.5680227", "0.5678019", "0.5666606", "0.56375015", "0.5636938", "0.5627192", "0.5623865", "0.5603968", "0.5600087", "0.55633765", "0.554731", "0.5523729", "0.5517082", "0.5496191", "0.548204", "0.5472456", "0.54703027", "0.54551274", "0.5451947", "0.5450533", "0.5411307", "0.53888464", "0.5386361", "0.53733957", "0.5370583", "0.53662676", "0.5365613", "0.53620607", "0.53593916", "0.53576607", "0.53572613", "0.53552985", "0.535192", "0.5344782", "0.5334546", "0.533359", "0.5326714", "0.5318033", "0.5311528", "0.53079545", "0.530686", "0.5302538", "0.5298785", "0.529584", "0.52896714", "0.5287056", "0.5282482", "0.5269497", "0.5269497", "0.5261282", "0.5250625", "0.5250013", "0.5248586", "0.5241856", "0.5241856", "0.5241501", "0.5230708", "0.52302593", "0.5227147", "0.5226929", "0.5222883", "0.5221314", "0.52193093", "0.5216479" ]
0.70610285
1
Validation Functions Description : To validate the Address Line 2 of Correspondence Address in Customer Tab Coded by :Rajan Created Data:21 Oct 2016 Last Modified Date: Modified By: Parameter:
public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll("M_Header", "Correspondence Address").replaceAll("M_Category", "Country").replaceAll("M_InnerText", Country), "Country of Correspondence Address - "+Country, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_2_of_Correspondence_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Correspondence Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Installation Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "public boolean isAddressLine1Valid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtAddressLine1.getText().trim().length() > 0)\n\t\t\t\treturn true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtAddressLine1.getText().trim().length() > 0) {\n\t\t\t\treturn true;\n\t\t}\n\t\ttxtAddressLine1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"AddressLine1: This field is required.\"));\n\t}", "public boolean isAddressLine2Valid() throws BusinessRuleException {\n\t\treturn true;\n\t}", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "abstract void addressValidity();", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Installation Address - \"+Postcode, false);\n\t}", "public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Billing Address - \"+Postcode, false);\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "public void setAddressline2(String addressline2) {\n this.addressline2 = addressline2;\n }", "public abstract String getAddressLine2();", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "public void setAddressLine2(String addressLine2) {\n this.addressLine2 = addressLine2;\n }", "public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Billing Address - \"+Country, false);\n\t}", "public abstract String getAddressLine1();", "public Address validate(Client client, String address) throws BytomException {\n\t\t\tMap<String, Object> req = new HashMap<String, Object>();\n\t\t\treq.put(\"address\", address);\n\t\t\treturn client.request(\"validate-address\", req, Address.class);\n\t\t}", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "private void validateLine1304(Errors errors) {\n }", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }", "public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Installation Address - \"+Country, false);\n\t}", "public void validate_the_Town_City_of_Correspondence_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Correspondence Address - \"+TownCity, false);\n\t}", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public boolean validateContactAddress(String contactId, List<String> result)\n {\n return true;\n }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public void setAddressline1(String addressline1) {\n this.addressline1 = addressline1;\n }", "public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tif(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity, false))\n\t\t{\n\t\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity);\n\t\t}\n\t\t\n\t}", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "public static Address addAddress() {\r\n\r\n\t\tSystem.out.println(\"Please enter the building number of the supplier:\");\r\n\r\n\t\tint bldNum = Validation.intValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the supplier's street name:\");\r\n\t\tString bldStreet = Validation.stringNoIntsValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the town the supplier is in:\");\r\n\t\tString bldTown = Validation.stringNoIntsValidation();\t\t\r\n\r\n\t\tSystem.out.println(\"Please enter the postcode for the supplier:\");\r\n\t\tString bldPCode = Validation.stringValidation();\r\n\r\n\t\tSystem.out.println(\"Please enter the country the supplier is in:\");\r\n\t\tString bldCountry = Validation.stringNoIntsValidation();\r\n\r\n\t\tAddress newAddress = new Address(bldNum, bldStreet, bldTown, bldPCode, bldCountry);\r\n\r\n\t\treturn newAddress;\r\n\r\n\t}", "public void setAddressLine1(String addressLine1) {\n this.addressLine1 = addressLine1;\n }", "public void validate(DataRecord value) {\n\r\n\t}", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "public String getAddressLine2() {\n return addressLine2;\n }", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Installation Address - \"+TownCity);\n\t\t\t\n\t\t\t\n\t\t\n\t}", "public void validate_the_Email_Address_2_of_Security_in_Customer_Tab(String EmailAddress2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 2\").replaceAll(\"M_InnerText\", EmailAddress2), \"Email Address 2 - \"+EmailAddress2, false);\n\t}", "private void validateData() {\n }", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "private Map<String,String> getValidatedAddressInfo(Map<String,String> params) throws ClientProtocolException, IOException \n\t{\n\t\t// Create unique form parameters\n\t\tList<NameValuePair> uniqueParams = new ArrayList<NameValuePair>();\n\t\tuniqueParams.add(new BasicNameValuePair(\"__LASTFOCUS\", \"\"));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__VIEWSTATE\", params.get(\"ViewState\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__EVENTVALIDATION\", params.get(\"EventValidation\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetNumber\", params.get(\"StreetNumber\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetName\", params.get(\"StreetName\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"EnterButton\", \"Enter\"));\n\t\t\n\t\t//get the HTML from the FCPS boundary locator web site\n\t\tString responseHtml = getFCPSBoundaryLocatorHTML(uniqueParams);\n\t\t\n\t\tif(responseHtml == null || responseHtml.isEmpty() || responseHtml.startsWith(\"Error\"))\n\t\t{\n\t\t\tMap<String, String> errMap = new HashMap<String,String>();\n\t\t\terrMap.put(\"Error\", \"Failed Post\");\n\t\t\treturn errMap;\n\t\t}\n\t\telse\t //scrape the HTML to obtain the validated address map\n\t\t\treturn scrapeValidatedAddressHTML(responseHtml.toString());\n\t}", "public abstract void setAddressLine2(String sValue);", "public void validate_the_Email_Address_1_of_Security_in_Customer_Tab(String EmailAddress1)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 1\").replaceAll(\"M_InnerText\", EmailAddress1), \"Email Address 1 - \"+EmailAddress1, false);\n\t}", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validateAdress(String adress) {\r\n\t\tthis.isAdressValid = model.isValidAdress(adress);\r\n\r\n\t\tif (this.isAdressValid) {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: green;\");\r\n\t\t\tcheckButtonUnlock();\r\n\t\t} else {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: red;\");\r\n\t\t\tlockButton();\r\n\t\t}\r\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public String getAddressline2() {\n return addressline2;\n }", "public String getAddressLine1() {\n return addressLine1;\n }", "@Test(enabled = true)\n @UsingDataSet({\"datasets/base_data.xls\", \"datasets/data.xls\"})\n public void testEditAddressCase2() throws Exception {\n final String addrCode = \"30011400002\";\n final Address address = this.addressRepository.getAddressByAddressCode(addrCode);\n final ServiceResult<AddressDto> result = this.addressService.editAddress(address);\n\n Assert.assertNull(result);\n }", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public abstract void setAddressLine1(String sValue);", "public void validateRpd13s2()\n {\n // This guideline cannot be automatically tested.\n }", "@Test( dataProvider=\"AddressValidationTestData\", groups ={\"BillingAddressValidations\"})\r\n\r\n\tpublic static void AddNewBillingAddress(String[] BillingAddressDetailsInArray){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tAssert.assertEquals( launchAndValidateDifferentBillingAddresses(BillingAddressDetailsInArray) ,true) ;\t\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\t\t\r\n\t}", "void addressValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n }", "public com.apatar.cdyne.ws.demographix.SummaryInformation getLocationInformationByAddress(java.lang.String addressLine1, java.lang.String city, java.lang.String stateAbbrev, java.lang.String zipCode, java.lang.String licenseKey) throws java.rmi.RemoteException;", "@Test\n public void testCreateLabelInvoiceBarcode_AddressValidation_Failure()\n {\n \t\n \ttry {\n \t\t\n \t\tlogger.info(\"Testing creation of label, invoice and barcode for failure scenario .\");\n \t\tString fileName = \"./com/cts/ptms/carrier/yrc/resources/InputData_Standard_AddressValidation_Failure.xml\";\n\t \tURL url = getClass().getClassLoader().getResource(fileName);\n\t\t\tshipmentRequest.setFileName(url.getFile());\n \t\tshipmentRequest.setCarrier(\"YRC\");\n\t \tshipmentRequest.setGenLabel(true);\n\t \tshipmentResponse = yrcSoapClient.createShipmentRequest(shipmentRequest);\n\t \tlogger.info(\"Status:\"+shipmentResponse );\n\t \t\n\t \tassertEquals(\"ERROR\", shipmentResponse.getStatus());\n\t\t\t\n \t} \n\t\tcatch(Exception e)\n\t\t{\n\t\t\tassertEquals(\"Failure\", \"Failure\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Exception occured\"+e.getMessage());\n\t\t}\n \t\n }", "public String getAddressline1() {\n return addressline1;\n }", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "public void testSetLine2_EmptyString() {\r\n try {\r\n address.setLine2(\" \");\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "private void validateUpdateCustomers(List<CustomersInputDTO> customers, String formatDate) {\n // inner validate\n if (customers == null || customers.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(ConstantsCustomers.CUSTOMERS, Constants.RIQUIRED_CODE));\n }\n // validate common\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n List<Map<String, Object>> customParams = new ArrayList<>();\n customers.forEach(cus -> {\n Map<String, Object> customField = new HashMap<>();\n customField.put(\"rowId\", cus.getCustomerId());\n customField.putAll(buildParamsValidateCustomersInput(cus, jsonBuilder));\n customParams.add(customField);\n });\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n customParams, formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n List<Map<String, Object>> listValidate = CustomersCommonUtil.validateCommon(validateJson, restOperationUtils,\n token, tenantName);\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "EntityAddInfo validateAddrAndSaveEntity(Record inputRecord, boolean shouldSaveActivityHist);", "private static boolean validateAddress(String address) {\n return !address.isEmpty();\n }", "public void validateRpd1s2()\n {\n // This guideline cannot be automatically tested.\n }", "void validate();", "void validate();", "public com.apatar.cdyne.ws.demographix.PlaceInfo getPlaceIDbyAddress(java.lang.String addressLine1, java.lang.String city, java.lang.String stateAbbrev, java.lang.String zipCode, java.lang.String licenseKey) throws java.rmi.RemoteException;", "public void validate() {}", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }", "public PersonInfo addPerson(PersonInfo p) {\n\t\tlog.info(\"Enter First Name\");\n\t\tString fname = obj.next();\n\t\tlog.info(\"Enter Last Name\");\n\t\tString lname = obj.next();\n\t\tlog.info(\"Enter Address\");\n\t\tString address = obj.next();\n\t\tlog.info(\"Enter City\");\n\t\tString city = obj.next();\n\t\tlog.info(\"Enter State\");\n\t\tString state = obj.next();\n\t\tlog.info(\"Enter the six digit Zip Code\");\n\t\tString zipCode = obj.next();\n\t\tString pattern3 = \"^[1-9]{1}[0-9]{5}$\";\n\t\tPattern zip_pattern = Pattern.compile(pattern3);\n\t\tMatcher m3 = zip_pattern.matcher(zipCode);\n\t\tif (m3.matches() == false) {\n\t\t\tlog.info(\"zip code not in format enter again\");\n\t\t\tzipCode = obj.next();\n\t\t}\n\t\tlog.info(\"Enter the ten digit Phone Number\");\n\t\tString phoneNo = obj.next();\n\t\tString pattern1 = \"^[1-9]{1}[0-9]{9}$\";\n\t\tPattern mobile_pattern = Pattern.compile(pattern1);\n\t\tMatcher m1 = mobile_pattern.matcher(phoneNo);\n\t\tif (m1.matches() == false) {\n\t\t\tlog.info(\"phone number not in format enter again\");\n\t\t\tphoneNo = obj.next();\n\t\t}\n\t\tlog.info(\"Enter Email\");\n\t\tString email = obj.next();\n\t\tString pattern2 = \"^[a-zA-Z0-9]+((\\\\.[0-9]+)|(\\\\+[0-9]+)|(\\\\-[0-9]+)|([0-9]))*@*+[a-zA-Z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\";\n\t\tPattern email_sample = Pattern.compile(pattern2);\n\t\tMatcher m2 = email_sample.matcher(email);\n\t\tif (m2.matches() == false) {\n\t\t\tlog.info(\"email not in format enter again\");\n\t\t\temail = obj.next();\n\t\t}\n\t\tp = new PersonInfo(fname, lname, address, city, state, zipCode, phoneNo, email);\n\t\treturn p;\n\t}", "public void validateRpd14s1()\n {\n // This guideline cannot be automatically tested.\n }", "private static JSONObject validateStreet(String street, String city, String state, String zip) throws Exception {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n//\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n//\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n//\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n//\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\n\t\treturn addrKeyFormat;\n\t}", "public void enterAddress2() throws IOException {\n\t\tLoginSignupCompanyPage sp = new LoginSignupCompanyPage(driver);\n\t\tlog.info(\"Verifying the Address2 is available or not\");\n\t\tAssert.assertTrue(enterAddress2.isDisplayed());\n\t\tenterAddress2.sendKeys(BasePage.getCellData(xlsxName, sheetName, 15, 0));\n\n\t}", "public void setAddressLine2(String value) {\n setAttributeInternal(ADDRESSLINE2, value);\n }", "public void validateRpd22s2()\n {\n // This guideline cannot be automatically tested.\n }", "public static Boolean validateInput(String str) {\n String[] lines = str.split(\"\\n\");\r\n // System.out.println(\"lines array:\"+lines.length);\r\n Boolean validate = true;\r\n String[] lineParameters;\r\n int countFor =0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n\r\n if (lineParameters.length != 5) {\r\n validate = false;\r\n break;\r\n }\r\n }\r\n countFor++;\r\n \r\n\r\n }\r\n return validate;\r\n }", "@SuppressWarnings(\"unused\")\n\t@Test(groups = {\"All\", \"Regression\"})\n\t@AdditionalInfo(module = \"OpenEVV\")\n\tpublic void TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid() throws InterruptedException, java.text.ParseException, IOException, ParseException, ConfigurationException, SQLException\n\t{\n\n\t\t// logger = extent.startTest(\"TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid\");\n\n\t\tlogger.log(LogStatus.INFO, \"To validate valid TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid\");\n\n\t\tJSONArray jsonarray=GenerateUniqueParam.XrefParams(globalVariables.xref_json);\n\t\tJSONObject jsonobject = (JSONObject) jsonarray.get(0);\n\t\tjsonobject.put(\"EmployeeQualifier\", CommonMethods.generateRandomNumberOfFixLength(7));\n\t\tjsonobject.put(\"ClientIDQualifier\", CommonMethods.generateRandomNumberOfFixLength(7));\n\n\n\t\tString bodyAsString = CommonMethods.capturePostResponse(jsonarray, CommonMethods.propertyfileReader(globalVariables.openevv_xref_url));\n\t\tCommonMethods.verifyjsonassertFailcase(bodyAsString, globalVariables.ClientidQualifierFormatError);\n\t\tCommonMethods.verifyjsonassertFailcase(bodyAsString, globalVariables.EmployeeidQualifierFormatError);\n\n\n\t}", "public void testSetLine1_EmptyString() {\r\n try {\r\n address.setLine1(\" \");\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "public void createBillingAddress() throws Exception{\n\t\t\n\t\ttype(firstNameTextBox,\"bob\");\n\t\ttype(lastNameTextBox,\"test\");\n\t\ttype(addressLine1TextBox,\"2716 Ocean Park Blvd Suite 1030\");\n\t\ttype(addressLine2TextBox,\"test house\");\n\t\ttype(cityTextBox,\"Santa Monica\");\n\t\ttype(zipcodeTextBox,\"90405\");\n\t\tselect(stateSelectBox,8);\n\t\ttype(phoneTextField,\"6666654686\");\n\t\ttype(companyTextField,\"test company\");\n\t\n\t}", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean isAddressValid(String address) {\n\t\tString pattern = \"(^\\\\d+(w|e|s|n)\\\\d+\\\\s\\\\w+\\\\s\\\\w+\\\\.)\";\n\t\tboolean isMatch = Pattern.matches(pattern, address);\n return isMatch;\n }", "public Address line2(String line2) {\n this.line2 = line2;\n return this;\n }", "public void testSetLine1_NullString() {\r\n try {\r\n address.setLine1(null);\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }" ]
[ "0.76890624", "0.7662226", "0.7596344", "0.75512373", "0.7339816", "0.73082936", "0.6583049", "0.65418494", "0.6408043", "0.63922745", "0.63344413", "0.62998426", "0.6251626", "0.61483896", "0.60863423", "0.6068538", "0.6048174", "0.60305333", "0.59899616", "0.5981268", "0.59671426", "0.5959834", "0.5942718", "0.5930256", "0.5909488", "0.5907903", "0.59041953", "0.58942735", "0.58790106", "0.5856198", "0.58533394", "0.5840851", "0.58326805", "0.58114517", "0.5796412", "0.57875055", "0.57688046", "0.57554674", "0.5737205", "0.5716921", "0.57145756", "0.5685413", "0.56748205", "0.5666305", "0.56631416", "0.5658438", "0.5639634", "0.56392205", "0.5632044", "0.562333", "0.561697", "0.56101364", "0.5608892", "0.5608835", "0.5608835", "0.55805343", "0.5562918", "0.5534063", "0.5515771", "0.55116093", "0.5504082", "0.5493101", "0.54591554", "0.5449347", "0.5446054", "0.54349387", "0.543173", "0.5429853", "0.5423672", "0.5408975", "0.5397347", "0.5377867", "0.53772277", "0.5372309", "0.5371289", "0.5367279", "0.5345619", "0.5337215", "0.53231966", "0.53231966", "0.53193563", "0.53192675", "0.531709", "0.53149635", "0.5307344", "0.53053993", "0.5300772", "0.5298041", "0.52943724", "0.52891386", "0.526881", "0.52647674", "0.52499974", "0.52488", "0.52235657", "0.52233267", "0.52193725", "0.5214845", "0.5213374", "0.5211409" ]
0.60709906
15
Validation Functions Description : To validate the Postcode of Correspondence Address in Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:02 Dec 2016 Modified By:Rajan Parameter:Postcode
public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll("M_Header", "Correspondence Address").replaceAll("M_Category", "Postcode").replaceAll("M_InnerText", Postcode), "Postcode of Correspondence Address - "+Postcode, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Billing Address - \"+Postcode, false);\n\t}", "public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Installation Address - \"+Postcode, false);\n\t}", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "public String CheckPostCode (HashMap<String, ?> InputObj) throws NoSuchElementException {\n\t\tString outRetVal = \"-1\";\n\t\t\n\t\tString inCountryCode = InputObj.get(\"CountryCode\").toString();\n\t\tString inPostCode = InputObj.get(\"PostCode\").toString();\n\t\t\n\t\tCustSiteEditorObj Obj = new CustSiteEditorObj(webdriver);\n\t\t\n\t\tWebElement TxtCountryCode = Obj.getTxtCountryCode();\n\t\tif (!TxtCountryCode.getAttribute(\"value\").equals(inCountryCode)) {\n\t\t\tTxtCountryCode.clear();\n\t\t\tTxtCountryCode.sendKeys(inCountryCode);\n\t\t\tWebElement TxtPostCode = Obj.getTxtPostCode();\n\t\t\tTxtPostCode.click();\n\t\t}\n\t\t\n\t\tboolean isCountryCodeMsgExist = SeleniumUtil.isWebElementExist(webdriver, Obj.getLblCountryCodeMessageLocator(), 1);\n\t\tif (isCountryCodeMsgExist) {\n\t\t\tWebElement LblCountryCodeMessage = Obj.getLblCountryCodeMessage();\n\t\t\tboolean isVisible = LblCountryCodeMessage.isDisplayed();\n\t\t\tif (isVisible) {\n\t\t\t\tCommUtil.logger.info(\" > Msg: \"+LblCountryCodeMessage.getText());\n\t\t\t\tif (CommUtil.isMatchByReg(LblCountryCodeMessage.getText(), \"Only 2 characters\")) {\n\t\t\t\t\toutRetVal = \"1\";\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t} else {\n\t\t\t\t\tCommUtil.logger.info(\" > Unhandled message.\");\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tWebElement TxtPostCode = Obj.getTxtPostCode();\n\t\tif (!TxtPostCode.getAttribute(\"value\").equals(inPostCode)) {\n\t\t\tTxtPostCode.clear();\n\t\t\tTxtPostCode.sendKeys(inPostCode);\n\t\t\tTxtCountryCode = Obj.getTxtCountryCode();\n\t\t\tTxtCountryCode.click();\n\t\t}\t\n\t\t\n\t\tboolean isPostCodeMsgExist = SeleniumUtil.isWebElementExist(webdriver, Obj.getLblPostCodeMessageLocator(), 1);\n\t\tif (isPostCodeMsgExist) {\n\t\t\tWebElement LblPostCodeMessage = Obj.getLblPostCodeMessage();\n\t\t\tboolean isVisible = LblPostCodeMessage.isDisplayed();\n\t\t\tif (isVisible) {\n\t\t\t\tCommUtil.logger.info(\" > Msg: \"+LblPostCodeMessage.getText());\n\t\t\t\tif (CommUtil.isMatchByReg(LblPostCodeMessage.getText(), \"Only 5 digits\")) {\n\t\t\t\t\toutRetVal = \"2\";\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t} else if (CommUtil.isMatchByReg(LblPostCodeMessage.getText(), \"Only alpha numeric dash space\")) {\n\t\t\t\t\toutRetVal = \"3\";\n\t\t\t\t\treturn outRetVal;\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tCommUtil.logger.info(\" > Unhandled message.\");\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\toutRetVal = \"0\";\n\t\treturn outRetVal;\n\t\t\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "@Test\n public void testIncorrectPostalCode(){\n UserRegisterKYC tooLong = new UserRegisterKYC(\"hello\",validId3,\"30/03/1995\",\"7385483\");\n int requestResponse = tooLong.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC tooShort = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"48532\");\n requestResponse = tooShort.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC startWith74 = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"746532\");\n requestResponse = startWith74.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC startWithMoreThan82 = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"967532\");\n requestResponse = startWithMoreThan82.sendRegisterRequest();\n assertEquals(400,requestResponse);\n }", "abstract void addressValidity();", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Billing Address - \"+Country, false);\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "public ErrorMessage verifyCode(String code, Integer year, Long exception);", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Installation Address - \"+AddressLine2, false);\n\t}", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "public void validate_the_Address_Line_2_of_Correspondence_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Correspondence Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Installation Address - \"+Country, false);\n\t}", "public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tif(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity, false))\n\t\t{\n\t\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity);\n\t\t}\n\t\t\n\t}", "@Test\n public void postalCodeTest() {\n // TODO: test postalCode\n }", "public boolean validate() {\n\n String plate = _licensePlate.getText().toString();\n\n if(plate.isEmpty() || plate.length() < 8)\n return false;\n\n else if(plate.charAt(2) == '-' || plate.charAt(5) == '-') {\n\n if (Character.isUpperCase(plate.charAt(0)) && Character.isUpperCase(plate.charAt(1))) { // first case\n if (Character.isDigit(plate.charAt(3)) && Character.isDigit(plate.charAt(4))\n && Character.isDigit(plate.charAt(6)) && Character.isDigit(plate.charAt(7)))\n return true;\n }\n\n else if(Character.isUpperCase(plate.charAt(3)) && Character.isUpperCase(plate.charAt(4))) { // second case\n if (Character.isDigit(plate.charAt(0)) && Character.isDigit(plate.charAt(1))\n && Character.isDigit(plate.charAt(6)) && Character.isDigit(plate.charAt(7)))\n return true;\n }\n\n else if(Character.isUpperCase(plate.charAt(6)) && Character.isUpperCase(plate.charAt(7))) { // third case\n if (Character.isDigit(plate.charAt(0)) && Character.isDigit(plate.charAt(1))\n && Character.isDigit(plate.charAt(3)) && Character.isDigit(plate.charAt(4)))\n return true;\n }\n\n else\n return false;\n\n }\n\n return false;\n }", "public void zipCodeFieldTest() {\r\n\t\tif(Step.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\", 10)) {\r\n\t\t\t\r\n\t\t\t//Verifies the zip code field populates with the user's zip code\r\n\t\t\tString zipInputBoxTextContent = \r\n\t\t\t\t\tStep.Extract.getContentUsingJS(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Field\");\r\n\t\t\tif(zipInputBoxTextContent.isEmpty()) {\r\n\t\t\t\tStep.Failed(\"Zip Code Field is empty\");\r\n\t\t\t} else {\r\n\t\t\t\tStep.Passed(\"Zip Code Field populated with user's location\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Verifies special characters aren't accepted\r\n\t\t\tStep.Wait.forSeconds(1);\r\n\t\t\tStep.Action.typeText(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\", \"!@#$%\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote Button\");\r\n\t\t\tStep.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeInValidInputLocator,\r\n\t\t\t\t\t\"Zip Code Field shows invalid input\", 10);\r\n\t\t\t\r\n\t\t\t//Veriies invalid zip codes aren't accepted\r\n\t\t\tStep.Action.typeText(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip code Input field\", \"00000\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote button\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote button\");\r\n\t\t\tStep.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeInValidInputLocator,\r\n\t\t\t\t\t\"Zip Code Field shows invalid input\", 10);\r\n\t\t\t\r\n\t\t\t//Verifies that only 5 digits are accepted\r\n\t\t\tStep.Action.typeText(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\", \"1234567\");\r\n\t\t\tzipInputBoxTextContent = Step.Extract.getContentUsingJS(QuoteForm_ComponentObject.zipCodeFieldLocator,\r\n\t\t\t\t\t\"Zip code text box\");\r\n\t\t\tif(zipInputBoxTextContent.length() > 5) {\r\n\t\t\t\tStep.Failed(\"Zip Code Input Field contains more than 5 digits\");\r\n\t\t\t} else {\r\n\t\t\t\tStep.Passed(\"Zip Code Input Field does not accept more than 5 digits\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Verifies user cannot submit a blank zip code\r\n\t\t\tStep.Action.clear(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote Button\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote Button\");\r\n\t\t\tStep.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeInValidInputLocator,\r\n\t\t\t\t\t\"Zip Code Input Field shows invalid input\", 10);\r\n\t\t\t\r\n\t\t\t//Verifies that a valid input is accepted\r\n\t\t\tStep.Action.typeText(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\", \"48146\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote Button\");\r\n\t\t\tStep.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeValidInputLocator,\r\n\t\t\t\t\t\"Zip Code Field displays as valid input\", 10);\r\n\t\t}\r\n\t}", "private void validateData() {\n }", "private static JSONObject validateStreet(String street, String city, String state, String zip) throws Exception {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n//\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n//\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n//\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n//\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\n\t\treturn addrKeyFormat;\n\t}", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private Map<String,String> getValidatedAddressInfo(Map<String,String> params) throws ClientProtocolException, IOException \n\t{\n\t\t// Create unique form parameters\n\t\tList<NameValuePair> uniqueParams = new ArrayList<NameValuePair>();\n\t\tuniqueParams.add(new BasicNameValuePair(\"__LASTFOCUS\", \"\"));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__VIEWSTATE\", params.get(\"ViewState\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__EVENTVALIDATION\", params.get(\"EventValidation\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetNumber\", params.get(\"StreetNumber\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetName\", params.get(\"StreetName\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"EnterButton\", \"Enter\"));\n\t\t\n\t\t//get the HTML from the FCPS boundary locator web site\n\t\tString responseHtml = getFCPSBoundaryLocatorHTML(uniqueParams);\n\t\t\n\t\tif(responseHtml == null || responseHtml.isEmpty() || responseHtml.startsWith(\"Error\"))\n\t\t{\n\t\t\tMap<String, String> errMap = new HashMap<String,String>();\n\t\t\terrMap.put(\"Error\", \"Failed Post\");\n\t\t\treturn errMap;\n\t\t}\n\t\telse\t //scrape the HTML to obtain the validated address map\n\t\t\treturn scrapeValidatedAddressHTML(responseHtml.toString());\n\t}", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "abstract void fiscalCodeValidity();", "public void validate_the_Town_City_of_Correspondence_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Correspondence Address - \"+TownCity, false);\n\t}", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "@Override\r\n\tpublic void validate(Product p) throws CustomBadRequestException {\r\n\t\tif(p.getName() == null || p.getName().equals(\"\") || p.getBarcode() == null || p.getBarcode().equals(\"\") || p.getMeasure_unit() == null ||\r\n\t\t\t\tp.getMeasure_unit().equals(\"\") || p.getQuantity() == null || p.getQuantity().equals(\"\")|| p.getBrand() == null || p.getBrand().equals(\"\")){\r\n\t\t\tthrow new CustomBadRequestException(\"Incomplete Information about the product\");\r\n\t\t}\r\n\r\n\t\tString eanCode = p.getBarcode();\r\n\t\tString ValidChars = \"0123456789\";\r\n\t\tchar digit;\r\n\t\tfor (int i = 0; i < eanCode.length(); i++) { \r\n\t\t\tdigit = eanCode.charAt(i); \r\n\t\t\tif (ValidChars.indexOf(digit) == -1) {\r\n\t\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Add five 0 if the code has only 8 digits\r\n\t\tif (eanCode.length() == 8 ) {\r\n\t\t\teanCode = \"00000\" + eanCode;\r\n\t\t}\r\n\t\t// Check for 13 digits otherwise\r\n\t\telse if (eanCode.length() != 13) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\t// Get the check number\r\n\t\tint originalCheck = Integer.parseInt(eanCode.substring(eanCode.length() - 1));\r\n\t\teanCode = eanCode.substring(0, eanCode.length() - 1);\r\n\r\n\t\t// Add even numbers together\r\n\t\tint even = Integer.parseInt((eanCode.substring(1, 2))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(3, 4))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(5, 6))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(7, 8))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(9, 10))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(11, 12))) ;\r\n\t\t// Multiply this result by 3\r\n\t\teven *= 3;\r\n\r\n\t\t// Add odd numbers together\r\n\t\tint odd = Integer.parseInt((eanCode.substring(0, 1))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(2, 3))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(4, 5))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(6, 7))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(8, 9))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(10, 11))) ;\r\n\r\n\t\t// Add two totals together\r\n\t\tint total = even + odd;\r\n\r\n\t\t// Calculate the checksum\r\n\t\t// Divide total by 10 and store the remainder\r\n\t\tint checksum = total % 10;\r\n\t\t// If result is not 0 then take away 10\r\n\t\tif (checksum != 0) {\r\n\t\t\tchecksum = 10 - checksum;\r\n\t\t}\r\n\r\n\t\t// Return the result\r\n\t\tif (checksum != originalCheck) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\tif(Float.parseFloat(p.getQuantity()) <= 0){\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Quantity\");\r\n\t\t}\r\n\r\n\r\n\t}", "void validateMobileNumber(String stringToBeValidated,String name);", "private static boolean validatePhoneNumber(String phoneNo) {\n if (phoneNo.matches(\"\\\\d{10}\")) return true;\n //validating phone number with -, . or spaces\n else if(phoneNo.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) return true;\n //validating phone number with extension length from 3 to 5\n else if(phoneNo.matches(\"\\\\d{3}-\\\\d{3}-\\\\d{4}\\\\s(x|(ext))\\\\d{3,5}\")) return true;\n //validating phone number where area code is in braces ()\n else if(phoneNo.matches(\"\\\\(\\\\d{3}\\\\)-\\\\d{3}-\\\\d{4}\")) return true;\n //return false if nothing matches the input\n else return false;\n\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "public boolean isZipCodeValid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtZipCode.getText().trim().length() > 0)\n\t\t return true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtZipCode.getText().trim().length() > 0) {\n\t\t\treturn true;\n\t\t}\n\t\ttxtZipCode.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"Zip / Postal Code: This field is required.\"));\n\t}", "public Boolean validateTransCode(String noteCode, Long staffId, String transType) throws Exception;", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "@Test\r\n public void getPostalCodeTest()\r\n {\r\n Assert.assertEquals(stub.getPostalCode(), POSTALCODE);\r\n }", "public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Installation Address - \"+TownCity);\n\t\t\t\n\t\t\t\n\t\t\n\t}", "public boolean validatePin( String pin );", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "public boolean isValid(){\n Email.setErrorEnabled(false);\n Email.setError(\"\");\n Fname.setErrorEnabled(false);\n Fname.setError(\"\");\n Lname.setErrorEnabled(false);\n Lname.setError(\"\");\n Pass.setErrorEnabled(false);\n Pass.setError(\"\");\n Mobileno.setErrorEnabled(false);\n Mobileno.setError(\"\");\n Cpass.setErrorEnabled(false);\n Cpass.setError(\"\");\n area.setErrorEnabled(false);\n area.setError(\"\");\n Houseno.setErrorEnabled(false);\n Houseno.setError(\"\");\n Pincode.setErrorEnabled(false);\n Pincode.setError(\"\");\n\n boolean isValid=false,isValidname=false,isValidhouseno=false,isValidlname=false,isValidemail=false,isValidpassword=false,isValidconfpassword=false,isValidmobilenum=false,isValidarea=false,isValidpincode=false;\n if(TextUtils.isEmpty(fname)){\n Fname.setErrorEnabled(true);\n Fname.setError(\"Enter First Name\");\n }else{\n isValidname=true;\n }\n if(TextUtils.isEmpty(lname)){\n Lname.setErrorEnabled(true);\n Lname.setError(\"Enter Last Name\");\n }else{\n isValidlname=true;\n }\n if(TextUtils.isEmpty(emailid)){\n Email.setErrorEnabled(true);\n Email.setError(\"Email Address is required\");\n }else {\n if (emailid.matches(emailpattern)) {\n isValidemail = true;\n } else {\n Email.setErrorEnabled(true);\n Email.setError(\"Enter a Valid Email Address\");\n }\n }\n if(TextUtils.isEmpty(password)){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Enter Password\");\n }else {\n if (password.length()<8){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Weak Password\");\n }else {\n isValidpassword = true;\n }\n }\n if(TextUtils.isEmpty(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Enter Password Again\");\n }else{\n if (!password.equals(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Password Dosent Match\");\n }else{\n isValidconfpassword=true;\n }\n }\n if(TextUtils.isEmpty(mobile)){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Enter Phone Number\");\n }else{\n if (mobile.length()<10){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Invalid Mobile Number\");\n } else {\n isValidmobilenum = true;\n }\n }\n if(TextUtils.isEmpty(Area)){\n area.setErrorEnabled(true);\n area.setError(\"Area is Required\");\n }else{\n isValidarea=true;\n }\n if(TextUtils.isEmpty(pincode)){\n Pincode.setErrorEnabled(true);\n Pincode.setError(\"Please Enter Pincode\");\n }else{\n isValidpincode=true;\n }\n if(TextUtils.isEmpty(house)){\n Houseno.setErrorEnabled(true);\n Houseno.setError(\"House field cant be empty\");\n }else{\n isValidhouseno=true;\n }\n isValid=(isValidarea && isValidpincode && isValidconfpassword && isValidpassword && isValidemail && isValidname &&isValidmobilenum && isValidhouseno && isValidlname)? true:false;\n return isValid;\n\n }", "private boolean validZip(String zipCode) {\n\t\tString regex = \"^[0-9]{5}(?:-[0-9]{4})?$\";\n\t\t \n\t\tPattern pattern = Pattern.compile(regex);\n\t\t \n\t\tMatcher matcher = pattern.matcher(zipCode);\n\n\t\treturn matcher.matches();\n\t}", "private boolean isInfoValidate(){\n if(mEmailAddress.getText() == null || mEmailAddress.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_email_address);\n return false;\n }\n\n if(!mEmailAddress.getText().toString().contains(\"@\")){\n errorText = getString(R.string.register_warning_valid_email_address);\n return false;\n }\n\n// if(mRegionSpinner.getSelectedItemPosition() == Constant.NON_SELECT){\n// errorText = getString(R.string.register_warning_select_region);\n// return false;\n// }\n\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.HONG_KONG)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.HONGKONG_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n//\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.CHINA)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.CHINA_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n\n if(mPassword.getText() == null || mPassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_password);\n return false;\n }\n\n if(mRetypePassword.getText() == null || mRetypePassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_retype_password);\n return false;\n }\n\n if(!mPassword.getText().toString().equals(mRetypePassword.getText().toString())){\n errorText = getString(R.string.register_warning_not_the_same);\n return false;\n }\n\n if(!Utility.judgeContainsStr( mPassword.getText().toString())){\n errorText = getString(R.string.register_warning_contains_character);\n return false;\n }\n\n// if(!mPolicyCheckBox.isChecked()){\n// errorText = getString(R.string.register_warning_check_agreement);\n// return false;\n// }\n\n return true;\n }", "public boolean checkStAddAptNumZip(String streetAddress, String aptNumber, String zip){\n if( !this.streetAddress.toLowerCase().equals(streetAddress)){\n return false;\n }else if (!this.aptNumber.toLowerCase().equals(aptNumber)){\n return false;\n }else if (!this.zip.toLowerCase().equals(zip)){\n return false;\n }else{\n return true;\n }\n }", "public void SetCheckoutRegistrationPhonecode_number(String code, String phoneno){\r\n\t\tString Code = getValue(code);\r\n\t\tString Phoneno = getValue(phoneno);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:- \"+Code+\" , \"+Phoneno);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Registration Phone code and Phone number should be entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\ttry{\r\n\t\t\tif((countrygroup_phoneNo).contains(countries.get(countrycount))){\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonenumber\"),Phoneno);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonecode\"),Code);\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonenumber\"),Phoneno);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tSystem.out.println(\"Registration Phone code and number is entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Registration Phone code and number is entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Registration Phone code and number is not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtcheckoutregistrationPhonecode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" / \"+elementProperties.getProperty(\"txtcheckoutregistrationPhonenumber\").toString().replace(\"By.\", \" \")+\r\n\t\t\t\t\t\" not found\");\r\n\t\t}\r\n\r\n\t}", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "private boolean validate() {\n if(edtMobileNumber.getText().toString().length() <= 0){\n edtMobileNumber.setFocusable(true);\n edtMobileNumber.setError(Constants.ERR_MSG_MOBILE);\n return false;\n }else if(edtFirstName.getText().toString().length() <= 0){\n edtFirstName.setFocusable(true);\n edtFirstName.setError(Constants.ERR_MSG_FIRST_NAME);\n return false;\n }else if(edtLastName.getText().toString().length() <= 0){\n edtLastName.setFocusable(true);\n edtLastName.setError(Constants.ERR_MSG_LAST_NAME);\n return false;\n }else if(edtDateOfBirth.getText().toString().length() <= 0){\n edtDateOfBirth.setFocusable(true);\n edtDateOfBirth.setError(Constants.ERR_MSG_DATE_OF_BIRTH);\n return false;\n }else if(edtEnterPin.getText().toString().length() <= 0){\n edtEnterPin.setFocusable(true);\n edtEnterPin.setError(Constants.ERR_MSG_PIN);\n return false;\n }else if(edtConfirmPin.getText().toString().length() <= 0){\n edtConfirmPin.setFocusable(true);\n edtConfirmPin.setError(Constants.ERR_MSG_CONFIRM_PIN);\n return false;\n }else if(spnStatus.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_STATUS, Toast.LENGTH_SHORT).show();\n return false;\n }else if(spnBloodGroup.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_BLOOD_GROUP, Toast.LENGTH_SHORT).show();\n return false;\n }else if(rgGender.getCheckedRadioButtonId() == -1){\n Toast.makeText(context,Constants.ERR_MSG_GENDER,Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "private static boolean validateAddress(String address) {\n return !address.isEmpty();\n }", "public boolean validateContactAddress(String contactId, List<String> result)\n {\n return true;\n }", "@And(\"^Enter user phone and confirmation code$\")\t\t\t\t\t\n public void Enter_user_phone_and_confirmation_code() throws Throwable \t\t\t\t\t\t\t\n { \t\t\n \tdriver.findElement(By.id(\"phoneNumberId\")).sendKeys(\"01116844320\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvPhoneNext']/content/span\")).click();\n driver.findElement(By.id(\"code\")).sendKeys(\"172978\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvVerifyNext']/content/span\")).click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\t\t\n }", "@Override\r\n\tpublic boolean isValid(String code, ConstraintValidatorContext theConstaint) {\r\n \r\n titles = customerService.getTitles();\r\n \r\n for(String i : titles)\r\n {\r\n \tSystem.out.println(i);\r\n }\r\n //descriptions = ec.getDescriptions();\r\n for(String i : titles)\r\n {\r\n\t result = code.equals(i);\r\n\t\tif(code != null)\t\t\r\n\t\t\tresult = code.equals(i);\r\n\t\telse\r\n\t\t\tresult = true;\r\n\t\tif(result == true)\r\n\t\t\tbreak;\r\n }\r\n\t\treturn result;\r\n\t}", "public void validate(DataRecord value) {\n\r\n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "private boolean validFormInputs() {\n String email = etEmail.getText().toString();\n String password = etPassword.getText().toString();\n String institutionName = etInstitutionName.getText().toString();\n String addressFirst = etInstitutionAddressFirst.getText().toString();\n String addressSecond = etInstitutionAddressSecond.getText().toString();\n String CIF = etCIF.getText().toString();\n\n String[] allInputs = {email, password, institutionName, addressFirst, addressSecond, CIF};\n for (String currentInput : allInputs) {\n if (currentInput.matches(\"/s+\")) // Regex pt cazul cand stringul e gol sau contine doar spatii\n return false; // formular invalid - toate inputurile trebuie sa fie completate\n }\n String[] stringsAddressFirst = addressFirst.split(\",\");\n String[] stringsAddressSecond = addressSecond.split(\",\");\n if (stringsAddressFirst.length != 4 ||\n stringsAddressSecond.length != 3)\n return false;\n\n //<editor-fold desc=\"Checking if NUMBER and APARTMENT are numbers\">\n try {\n Integer.parseInt(stringsAddressSecond[0]);\n Integer.parseInt(stringsAddressSecond[2]);\n return true; // parsed successfully without throwing any parsing exception from string to int\n }catch (Exception e) {\n Log.v(LOG_TAG, \"Error on converting input to number : \" + e);\n return false; // parsed unsuccessfully - given strings can not be converted to int\n }\n //</editor-fold>\n }", "public Address validate(Client client, String address) throws BytomException {\n\t\t\tMap<String, Object> req = new HashMap<String, Object>();\n\t\t\treq.put(\"address\", address);\n\t\t\treturn client.request(\"validate-address\", req, Address.class);\n\t\t}", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "private String getAnomizedPostcode() {\r\n\tString postcode = (String) record.get(\"postcode\");\r\n\tif (postcode != null && postcode.length() > 0) {\r\n\t postcode = postcode.substring(0, 1);\r\n\t}\r\n\treturn postcode;\r\n }", "@Test( dataProvider=\"AddressValidationTestData\", groups ={\"BillingAddressValidations\"})\r\n\r\n\tpublic static void AddNewBillingAddress(String[] BillingAddressDetailsInArray){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tAssert.assertEquals( launchAndValidateDifferentBillingAddresses(BillingAddressDetailsInArray) ,true) ;\t\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\t\t\r\n\t}", "public static Address addAddress() {\r\n\r\n\t\tSystem.out.println(\"Please enter the building number of the supplier:\");\r\n\r\n\t\tint bldNum = Validation.intValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the supplier's street name:\");\r\n\t\tString bldStreet = Validation.stringNoIntsValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the town the supplier is in:\");\r\n\t\tString bldTown = Validation.stringNoIntsValidation();\t\t\r\n\r\n\t\tSystem.out.println(\"Please enter the postcode for the supplier:\");\r\n\t\tString bldPCode = Validation.stringValidation();\r\n\r\n\t\tSystem.out.println(\"Please enter the country the supplier is in:\");\r\n\t\tString bldCountry = Validation.stringNoIntsValidation();\r\n\r\n\t\tAddress newAddress = new Address(bldNum, bldStreet, bldTown, bldPCode, bldCountry);\r\n\r\n\t\treturn newAddress;\r\n\r\n\t}", "@Test\n public void testCreateLabelInvoiceBarcode_AddressValidation_Failure()\n {\n \t\n \ttry {\n \t\t\n \t\tlogger.info(\"Testing creation of label, invoice and barcode for failure scenario .\");\n \t\tString fileName = \"./com/cts/ptms/carrier/yrc/resources/InputData_Standard_AddressValidation_Failure.xml\";\n\t \tURL url = getClass().getClassLoader().getResource(fileName);\n\t\t\tshipmentRequest.setFileName(url.getFile());\n \t\tshipmentRequest.setCarrier(\"YRC\");\n\t \tshipmentRequest.setGenLabel(true);\n\t \tshipmentResponse = yrcSoapClient.createShipmentRequest(shipmentRequest);\n\t \tlogger.info(\"Status:\"+shipmentResponse );\n\t \t\n\t \tassertEquals(\"ERROR\", shipmentResponse.getStatus());\n\t\t\t\n \t} \n\t\tcatch(Exception e)\n\t\t{\n\t\t\tassertEquals(\"Failure\", \"Failure\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Exception occured\"+e.getMessage());\n\t\t}\n \t\n }", "@Override\n public void afterTextChanged(Editable s) {\n if (s.length() == 0)\n edtCodeNumber5.requestFocus();\n else {\n if (strMobileNumber == null || strMobileNumber.equals(\"\")) return;\n //checkValidationCodeInputs();\n\n confirmYourCode();\n }\n\n }", "private boolean validate(Map<String,String> requestMap){\r\n\t\tboolean result = false;\r\n\t\tString zip = requestMap.get(PublicAPIConstant.ZIP);\r\n\t\tString soStatus = requestMap.get(PublicAPIConstant.SO_STATUS);\r\n\t\tList<String> soStatusList = new ArrayList<String>();\r\n\r\n\t\tif (null != soStatus) {\r\n\t\t\tStringTokenizer strTok = new StringTokenizer(\r\n\t\t\t\t\tsoStatus,\r\n\t\t\t\t\tPublicAPIConstant.SEPARATOR, false);\r\n\t\t\tint noOfStatuses = strTok.countTokens();\r\n\t\t\tfor (int i = 1; i <= noOfStatuses; i++) {\r\n\t\t\t\tsoStatusList.add(new String(strTok\r\n\t\t\t\t\t\t.nextToken()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tInteger pageSize = Integer.parseInt(requestMap.get(\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET));\r\n\t\t\r\n\t\tif(null!=zip&&zip.length() != 5){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.ZIP);\r\n\t\t\treturn result;\t\r\n\t\t}\r\n\t\tList<Integer> pageSizeSetValues = Arrays.asList(\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_10,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_20,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_50,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_100,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_200,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_500);\t\t\r\n\t\tif(!pageSizeSetValues.contains(pageSize)){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET);\r\n\t\t\treturn result;\t\r\n\t\t}\t\r\n\t\t\r\n\t\tList<String> soStatusValues = Arrays.asList(\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_POSTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_ACCEPTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_ACTIVE,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_CLOSED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_COMPLETED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_DRAFTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_PROBLEM,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_EXPIRED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_PENDINGCANCEL\r\n\t\t);\t\t\r\n\t\tif(!soStatusValues.containsAll(soStatusList)){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.SO_STATUS_SET);\r\n\t\t\treturn result;\t\r\n\t\t}\t\r\n\t\tresult = true;\r\n\t\treturn result;\r\n\t}", "public void mo38839a(BrandsValidation brandsValidation) {\n }", "private boolean validate(){\n\n String MobilePattern = \"[0-9]{10}\";\n String name = String.valueOf(userName.getText());\n String number = String.valueOf(userNumber.getText());\n\n\n if(name.length() > 25){\n Toast.makeText(getApplicationContext(), \"pls enter less the 25 characher in user name\",\n Toast.LENGTH_SHORT).show();\n return true;\n }\n\n\n\n else if(name.length() == 0 || number.length() == 0 ){\n Toast.makeText(getApplicationContext(), \"pls fill the empty fields\",\n Toast.LENGTH_SHORT).show();\n return false;\n }\n\n\n\n else if(number.matches(MobilePattern))\n {\n\n return true;\n }\n else if(!number.matches(MobilePattern))\n {\n Toast.makeText(getApplicationContext(), \"Please enter valid 10\" +\n \"digit phone number\", Toast.LENGTH_SHORT).show();\n\n\n return false;\n }\n\n return false;\n\n }", "private static boolean validateZipCode(String zipCode) {\n try {\n if (zipCode.length() >= 5) {\n return Integer.parseInt(zipCode) > 0;\n }\n } catch (Exception ignored) {\n }\n\n return false;\n }", "public static boolean isValidPostalCode(String test) {\n return test.matches(POSTAL_CODE_VALIDATION_REGEX);\n }", "void validate();", "void validate();", "public void setAddressPostalCode(String addressPostalCode) {\n this.addressPostalCode = addressPostalCode;\n }", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s9()\n {\n // This guideline cannot be automatically tested.\n }", "@Override\n public boolean isValid(PhoneNumber phoneNumber) {\n String number = phoneNumber.getNumber();\n return isPhoneNumber(number) && number.startsWith(\"+380\") && number.length() == 13;\n }", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean isAddressLine1Valid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtAddressLine1.getText().trim().length() > 0)\n\t\t\t\treturn true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtAddressLine1.getText().trim().length() > 0) {\n\t\t\t\treturn true;\n\t\t}\n\t\ttxtAddressLine1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"AddressLine1: This field is required.\"));\n\t}", "public boolean deliveryEstimationCheck(Map<String,String> dataMap) throws Exception\r\n\t{\t\r\n\t\tList<String> listOfPincode = new ArrayList<String>();\r\n\t\tString pincode = dataMap.get(\"Pincode\");\r\n\t\tString changePincode = dataMap.get(\"ChangePincode\");\r\n\t\tString product = dataMap.get(\"Product\");\r\n\t\tString message=null;\r\n\t\tlistOfPincode.add(pincode);\r\n\t\tlistOfPincode.add(changePincode);\r\n\t\t\r\n\t\tfor(int i=0;i<listOfPincode.size();i++)\r\n\t\t{\r\n\t\t\tString code = listOfPincode.get(i);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(code==null||code.length()!=6||code.matches(\"[0-9]+\") == false)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"The pincode selected should be 6 digit or not a numberic. Currently set as \"+code+\". ReEnter a valid pincode\");\r\n\t\t\t\tBaseClass.skipTestExecution(\"The pincode selected should be 6 digit. Currently set as \"+code+\". ReEnter a valid pincode\");\r\n\t\t\t}\t\t\t\r\n\t\t\t\tmessage = enterPincode(code);\r\n\t\t\t\t//System.out.println(message.split(\"?\")[1]);\r\n\t\t\t\tif(message.contains(\"Not available for delivery, please change your pincode\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tif(changePincode==null||changePincode.equalsIgnoreCase(\"na\")||changePincode.equalsIgnoreCase(\"\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(message);\r\n\t\t\t\t\t\tBaseClass.skipTestExecution(\"The product: \"+product+\" selected cannot be delivered to the select location: \"+code);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tproductPageIndia.clickWebElement(productPageIndia.ChangePin);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println(message);\r\n\t\tstartTest.log(LogStatus.INFO, message,\"Successfull\");\r\n\t\tstartTest.log(LogStatus.INFO, \"User has insert the pincode successfull and gets the estimation date \"+pincode,\"Successfull\");\r\n\t\treturn true;\r\n\t\t\r\n\t\t\r\n\t}", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "private void validateTransactionCode(ATMSparrowMessage atmSparrowMessage, BankFusionEnvironment env) {\n boolean result = isTransactionSupported(atmSparrowMessage.getMessageType() + atmSparrowMessage.getTransactionType(), env);\n if (result) {\n atmSparrowMessage.setAuthorisedFlag(ATMConstants.AUTHORIZED_MESSAGE_FLAG);\n // String ubTransCode =\n // atmHelper.getBankTransactionCode(atmSparrowMessage.getMessageType()\n // + atmSparrowMessage.getTransactionType(), env);\n // //UBTransaction type mapped or not?\n // try {\n // IBOMisTransactionCodes misTransactionCodes =\n // (IBOMisTransactionCodes)env.getFactory().findByPrimaryKey(IBOMisTransactionCodes.BONAME,\n // ubTransCode);\n // } catch (FinderException bfe) {\n // Object[] field = new Object[] { ubTransCode };\n // atmSparrowMessage.setAuthorisedFlag(ATMConstants.NOTAUTHORIZED_MESSAGE_FLAG);\n // if\n // (atmSparrowMessage.getForcePost().equals(ATMConstants.FORCEPOST_0))\n // {\n // populateErrorDetails (ATMConstants.NOTAUTHORIZED_MESSAGE_FLAG,\n // ATMConstants.WARNING, 7508, BankFusionMessages.ERROR_LEVEL,\n // atmSparrowMessage, field, env);\n // } else if\n // (atmSparrowMessage.getForcePost().equals(ATMConstants.FORCEPOST_1)\n // ||\n // atmSparrowMessage.getForcePost().equals(ATMConstants.FORCEPOST_2)\n // ||\n // atmSparrowMessage.getForcePost().equals(ATMConstants.FORCEPOST_3)\n // ||\n // atmSparrowMessage.getForcePost().equals(ATMConstants.FORCEPOST_7))\n // {\n // populateErrorDetails (ATMConstants.AUTHORIZED_MESSAGE_FLAG,\n // ATMConstants.CRITICAL, 7508, BankFusionMessages.ERROR_LEVEL,\n // atmSparrowMessage, field, env);\n // if (controlDetails != null) {\n // ubTransCode = controlDetails.getAtmTransactionType();\n // }\n // }\n // }\n }\n else {\n atmSparrowMessage.setAuthorisedFlag(ATMConstants.NOTAUTHORIZED_MESSAGE_FLAG);\n /*\n * String errorMessage = BankFusionMessages.getFormattedMessage(BankFusionMessages\n * .ERROR_LEVEL, 7506, env, new Object[] { atmSparrowMessage .getMessageType() +\n * atmSparrowMessage.getTransactionType() });\n */\n String errorMessage = BankFusionMessages.getInstance().getFormattedEventMessage(40407506,\n new Object[] { atmSparrowMessage.getMessageType() + atmSparrowMessage.getTransactionType() },\n BankFusionThreadLocal.getUserSession().getUserLocale());\n String errorStatus = null;\n if (atmSparrowMessage.getForcePost().equals(ATMConstants.FORCEPOST_0)\n || atmSparrowMessage.getForcePost().equals(ATMConstants.FORCEPOST_6)) {\n errorStatus = ATMConstants.WARNING;\n logger.warn(errorMessage);\n }\n else {\n errorStatus = ATMConstants.CRITICAL;\n logger.error(errorMessage);\n }\n atmSparrowMessage.setErrorCode(errorStatus);\n atmSparrowMessage.setErrorDescription(errorMessage);\n }\n }", "public PersonInfo addPerson(PersonInfo p) {\n\t\tlog.info(\"Enter First Name\");\n\t\tString fname = obj.next();\n\t\tlog.info(\"Enter Last Name\");\n\t\tString lname = obj.next();\n\t\tlog.info(\"Enter Address\");\n\t\tString address = obj.next();\n\t\tlog.info(\"Enter City\");\n\t\tString city = obj.next();\n\t\tlog.info(\"Enter State\");\n\t\tString state = obj.next();\n\t\tlog.info(\"Enter the six digit Zip Code\");\n\t\tString zipCode = obj.next();\n\t\tString pattern3 = \"^[1-9]{1}[0-9]{5}$\";\n\t\tPattern zip_pattern = Pattern.compile(pattern3);\n\t\tMatcher m3 = zip_pattern.matcher(zipCode);\n\t\tif (m3.matches() == false) {\n\t\t\tlog.info(\"zip code not in format enter again\");\n\t\t\tzipCode = obj.next();\n\t\t}\n\t\tlog.info(\"Enter the ten digit Phone Number\");\n\t\tString phoneNo = obj.next();\n\t\tString pattern1 = \"^[1-9]{1}[0-9]{9}$\";\n\t\tPattern mobile_pattern = Pattern.compile(pattern1);\n\t\tMatcher m1 = mobile_pattern.matcher(phoneNo);\n\t\tif (m1.matches() == false) {\n\t\t\tlog.info(\"phone number not in format enter again\");\n\t\t\tphoneNo = obj.next();\n\t\t}\n\t\tlog.info(\"Enter Email\");\n\t\tString email = obj.next();\n\t\tString pattern2 = \"^[a-zA-Z0-9]+((\\\\.[0-9]+)|(\\\\+[0-9]+)|(\\\\-[0-9]+)|([0-9]))*@*+[a-zA-Z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\";\n\t\tPattern email_sample = Pattern.compile(pattern2);\n\t\tMatcher m2 = email_sample.matcher(email);\n\t\tif (m2.matches() == false) {\n\t\t\tlog.info(\"email not in format enter again\");\n\t\t\temail = obj.next();\n\t\t}\n\t\tp = new PersonInfo(fname, lname, address, city, state, zipCode, phoneNo, email);\n\t\treturn p;\n\t}", "public void testAddressPostalCodeConstant() {\n assertEquals(\"ADDRESS_POSTAL_CODE is incorrect\", UserConstants.ADDRESS_POSTAL_CODE, \"address-postal-code\");\n }", "public void validate() {}", "private void validateLine1304(Errors errors) {\n }", "public void SetCreditCarddetails(String ccnumber, String ccname, String ccmonth, String ccyear, String ccseccode){\r\n\t\tString countrygroup_ccdetails= \"UK,PresselAustria\";\r\n\t\tString CCnum = getValue(ccnumber);\r\n\t\tString CCName = getValue(ccname);\r\n\t\tString CCMonth = getValue(ccmonth);\r\n\t\tString CCYear = getValue(ccyear);\r\n\t\tString CCSecCode = getValue(ccseccode);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+CCnum+\", \"+CCName+\", \"+CCMonth+\", \"+CCYear+\", \"+CCSecCode);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The CreditCard details should be entered\");\r\n\t\ttry{\r\n\t\t\tif(!(countrygroup_ccdetails).contains(countries.get(countrycount))){\r\n\t\t\t\tswitchframe(\"TokenizationPage\");\r\n\t\t\t\tsleep(2000);\r\n\t\t\t\tsendKeys(locator_split(\"txtCCnumber\"), CCnum);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCname\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCname\"), CCName);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCMonth\"), CCMonth);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCYear\"), CCYear);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCcode\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCcode\"), CCSecCode);\t\t\t\t\t\t\r\n\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The CreditCard details are entered\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The new CreditCard details are applicable to this \" +country);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- The CreditCard details are not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"One of the element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCnumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCname\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCMonth\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCYear\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCcode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" are not found\");\r\n\r\n\t\t}\r\n\t}", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }" ]
[ "0.76019514", "0.7474495", "0.65453726", "0.6300054", "0.62165284", "0.61722505", "0.6160468", "0.6121566", "0.6076514", "0.60607785", "0.60008705", "0.59894735", "0.59591407", "0.59560484", "0.5922312", "0.590946", "0.5904543", "0.5897539", "0.5896262", "0.5873896", "0.58607405", "0.58267075", "0.5797087", "0.5771594", "0.57559043", "0.5746335", "0.5738515", "0.5707282", "0.57028794", "0.5696418", "0.56898713", "0.56845945", "0.5684368", "0.56470555", "0.56440276", "0.5618706", "0.5617582", "0.56129783", "0.55892676", "0.5564222", "0.5549354", "0.55447096", "0.55420846", "0.55358213", "0.5534015", "0.5529239", "0.5525769", "0.55237335", "0.5514776", "0.5510743", "0.5509864", "0.5498396", "0.54970187", "0.54894114", "0.54875666", "0.54759324", "0.54688835", "0.5462571", "0.54494053", "0.5418645", "0.5414392", "0.5412016", "0.5404022", "0.5400188", "0.5396553", "0.53865117", "0.5385874", "0.5367238", "0.53555757", "0.5350653", "0.534689", "0.5330953", "0.5319219", "0.5315695", "0.5313662", "0.5312351", "0.5311198", "0.5305398", "0.53006697", "0.52998734", "0.52987784", "0.52951694", "0.52951694", "0.52928025", "0.52900106", "0.5288951", "0.5287817", "0.527949", "0.52768725", "0.5267307", "0.5266496", "0.52623427", "0.52623427", "0.525741", "0.5253785", "0.5241798", "0.5237071", "0.52284616", "0.5226023", "0.5225168" ]
0.76480854
0
Validation Functions Description : To validate the Address Line 1 of Billing Address in Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:02 Dec 2016 Modified By:Rajan Parameter:AddressLine1
public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception { Report.fnReportPageBreak("Billing Address", driver); System.out.println(AddressLine1); VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll("M_Header", "Billing Address").replaceAll("M_Category", "Address Line 1").replaceAll("M_InnerText", AddressLine1), "Address Line 1 of Billing Address - "+AddressLine1, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Installation Address - \"+AddressLine2, false);\n\t}", "public boolean isAddressLine1Valid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtAddressLine1.getText().trim().length() > 0)\n\t\t\t\treturn true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtAddressLine1.getText().trim().length() > 0) {\n\t\t\t\treturn true;\n\t\t}\n\t\ttxtAddressLine1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"AddressLine1: This field is required.\"));\n\t}", "public void validate_the_Address_Line_2_of_Correspondence_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Correspondence Address - \"+AddressLine2, false);\n\t}", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Billing Address - \"+Postcode, false);\n\t}", "public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Billing Address - \"+Country, false);\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "abstract void addressValidity();", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Installation Address - \"+Postcode, false);\n\t}", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "public boolean isAddressLine2Valid() throws BusinessRuleException {\n\t\treturn true;\n\t}", "private void validateLine1304(Errors errors) {\n }", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Installation Address - \"+Country, false);\n\t}", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public void createBillingAddress() throws Exception{\n\t\t\n\t\ttype(firstNameTextBox,\"bob\");\n\t\ttype(lastNameTextBox,\"test\");\n\t\ttype(addressLine1TextBox,\"2716 Ocean Park Blvd Suite 1030\");\n\t\ttype(addressLine2TextBox,\"test house\");\n\t\ttype(cityTextBox,\"Santa Monica\");\n\t\ttype(zipcodeTextBox,\"90405\");\n\t\tselect(stateSelectBox,8);\n\t\ttype(phoneTextField,\"6666654686\");\n\t\ttype(companyTextField,\"test company\");\n\t\n\t}", "@Test( dataProvider=\"AddressValidationTestData\", groups ={\"BillingAddressValidations\"})\r\n\r\n\tpublic static void AddNewBillingAddress(String[] BillingAddressDetailsInArray){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tAssert.assertEquals( launchAndValidateDifferentBillingAddresses(BillingAddressDetailsInArray) ,true) ;\t\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\t\t\r\n\t}", "public void setAddressline1(String addressline1) {\n this.addressline1 = addressline1;\n }", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "public void setAddressLine1(String addressLine1) {\n this.addressLine1 = addressLine1;\n }", "public void validate(DataRecord value) {\n\r\n\t}", "public abstract String getAddressLine1();", "public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tif(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity, false))\n\t\t{\n\t\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity);\n\t\t}\n\t\t\n\t}", "public static Address addAddress() {\r\n\r\n\t\tSystem.out.println(\"Please enter the building number of the supplier:\");\r\n\r\n\t\tint bldNum = Validation.intValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the supplier's street name:\");\r\n\t\tString bldStreet = Validation.stringNoIntsValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the town the supplier is in:\");\r\n\t\tString bldTown = Validation.stringNoIntsValidation();\t\t\r\n\r\n\t\tSystem.out.println(\"Please enter the postcode for the supplier:\");\r\n\t\tString bldPCode = Validation.stringValidation();\r\n\r\n\t\tSystem.out.println(\"Please enter the country the supplier is in:\");\r\n\t\tString bldCountry = Validation.stringNoIntsValidation();\r\n\r\n\t\tAddress newAddress = new Address(bldNum, bldStreet, bldTown, bldPCode, bldCountry);\r\n\r\n\t\treturn newAddress;\r\n\r\n\t}", "private void validateData() {\n }", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }", "public Address validate(Client client, String address) throws BytomException {\n\t\t\tMap<String, Object> req = new HashMap<String, Object>();\n\t\t\treq.put(\"address\", address);\n\t\t\treturn client.request(\"validate-address\", req, Address.class);\n\t\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "public boolean validateContactAddress(String contactId, List<String> result)\n {\n return true;\n }", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "@Test\n public void testCreateLabelInvoiceBarcode_AddressValidation_Failure()\n {\n \t\n \ttry {\n \t\t\n \t\tlogger.info(\"Testing creation of label, invoice and barcode for failure scenario .\");\n \t\tString fileName = \"./com/cts/ptms/carrier/yrc/resources/InputData_Standard_AddressValidation_Failure.xml\";\n\t \tURL url = getClass().getClassLoader().getResource(fileName);\n\t\t\tshipmentRequest.setFileName(url.getFile());\n \t\tshipmentRequest.setCarrier(\"YRC\");\n\t \tshipmentRequest.setGenLabel(true);\n\t \tshipmentResponse = yrcSoapClient.createShipmentRequest(shipmentRequest);\n\t \tlogger.info(\"Status:\"+shipmentResponse );\n\t \t\n\t \tassertEquals(\"ERROR\", shipmentResponse.getStatus());\n\t\t\t\n \t} \n\t\tcatch(Exception e)\n\t\t{\n\t\t\tassertEquals(\"Failure\", \"Failure\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Exception occured\"+e.getMessage());\n\t\t}\n \t\n }", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public void validateRpd14s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate() {}", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "public abstract String getAddressLine2();", "public void validateAdress(String adress) {\r\n\t\tthis.isAdressValid = model.isValidAdress(adress);\r\n\r\n\t\tif (this.isAdressValid) {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: green;\");\r\n\t\t\tcheckButtonUnlock();\r\n\t\t} else {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: red;\");\r\n\t\t\tlockButton();\r\n\t\t}\r\n\t}", "public void validate_the_Email_Address_1_of_Security_in_Customer_Tab(String EmailAddress1)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 1\").replaceAll(\"M_InnerText\", EmailAddress1), \"Email Address 1 - \"+EmailAddress1, false);\n\t}", "public String getAddressLine1() {\n return addressLine1;\n }", "public void validate(Object obj, Errors errors) {\n\t\t\n\t\tBooking booking = (Booking) obj;\n\t\t\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(errors, \"aptNo\", \"error.invalid.aptNo\", \"Apartment Number Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"street\", \"error.invalid.street\", \"Street Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"city\", \"error.invalid.city\", \"City Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"state\", \"error.invalid.state\", \"State Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"zipCode\", \"error.invalid.zipCode\", \"Zipcode Required\");\n \n\t}", "void validate();", "void validate();", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private static boolean validateAddress(String address) {\n return !address.isEmpty();\n }", "public String getAddressline1() {\n return addressline1;\n }", "public boolean isPhone1Valid() throws BusinessRuleException {\n\t\tif (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtPhone1.getText().trim().length() > 0)\n\t\t\treturn true;\n\t\ttxtPhone1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"Phone: This field is required.\"));\n\t}", "public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Installation Address - \"+TownCity);\n\t\t\t\n\t\t\t\n\t\t\n\t}", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "private Map<String,String> getValidatedAddressInfo(Map<String,String> params) throws ClientProtocolException, IOException \n\t{\n\t\t// Create unique form parameters\n\t\tList<NameValuePair> uniqueParams = new ArrayList<NameValuePair>();\n\t\tuniqueParams.add(new BasicNameValuePair(\"__LASTFOCUS\", \"\"));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__VIEWSTATE\", params.get(\"ViewState\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__EVENTVALIDATION\", params.get(\"EventValidation\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetNumber\", params.get(\"StreetNumber\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetName\", params.get(\"StreetName\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"EnterButton\", \"Enter\"));\n\t\t\n\t\t//get the HTML from the FCPS boundary locator web site\n\t\tString responseHtml = getFCPSBoundaryLocatorHTML(uniqueParams);\n\t\t\n\t\tif(responseHtml == null || responseHtml.isEmpty() || responseHtml.startsWith(\"Error\"))\n\t\t{\n\t\t\tMap<String, String> errMap = new HashMap<String,String>();\n\t\t\terrMap.put(\"Error\", \"Failed Post\");\n\t\t\treturn errMap;\n\t\t}\n\t\telse\t //scrape the HTML to obtain the validated address map\n\t\t\treturn scrapeValidatedAddressHTML(responseHtml.toString());\n\t}", "public abstract FieldReport validate(int fieldSequence, Object fieldValue);", "public void validateRpd13s2()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate_the_Town_City_of_Correspondence_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Correspondence Address - \"+TownCity, false);\n\t}", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "public abstract void setAddressLine1(String sValue);", "public void validate_the_Account_Number_in_Customer_Account_Summary_of_Customer_Tab(String AccountNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Account Number\").replaceAll(\"M_InnerText\", AccountNumber), \"Account Number - \"+AccountNumber, false);\n\t\tReport.fnReportPageBreak(\"Customer Account Summary\", driver);\n\t}", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public void testSetLine1_EmptyString() {\r\n try {\r\n address.setLine1(\" \");\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "public static Boolean validateInput(String str) {\n String[] lines = str.split(\"\\n\");\r\n // System.out.println(\"lines array:\"+lines.length);\r\n Boolean validate = true;\r\n String[] lineParameters;\r\n int countFor =0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n\r\n if (lineParameters.length != 5) {\r\n validate = false;\r\n break;\r\n }\r\n }\r\n countFor++;\r\n \r\n\r\n }\r\n return validate;\r\n }", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validateRequiredFields(StringBuffer b){\n boolean result = true;\n\n if (!TextFieldHelper.isNumericFieldValid(this.goalValue, \" Цель: \", b) ||\n !TextFieldHelper.isNumericFieldValid(this.startWeightValue, \" Исходный вес: \", b) ||\n !TextFieldHelper.isNumericFieldValid(this.heightValue, \" Рост: \", b) ||\n !CalendarHelper.isFieldValid(startProgramDateValue, \" Старт программы: \", b) ||\n !new ComboBoxFieldHelper<Client>().isFieldValid(clientFIOValue, \" Клиент: \", b))\n {\n result = false;\n }\n\n return result;\n }", "public PaymentRequestPage paymentRequestPaymentAvailabilityValidation(String cashbackType,String cashbackValue,String rewardsValue) {\r\n\r\n\t\tString actual = \"\";\r\n\r\n\t\treportStep(\"About to validate the Cashback and Rewards Payment avilablity section in the payment Request page \", \"INFO\");\r\n\r\n\t\tswitch (cashbackType) {\r\n\r\n\t\tcase \"Only_Cashback\":\r\n\r\n\t\t\tvalidateTheElementPresence(cashbackAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, cashbackValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"Only_Rewards\":\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, rewardsValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase \"BothCashback_Rewards\":\r\n\r\n\t\t\tfloat cashbackAmount = Float.parseFloat(cashbackValue);\r\n\t\t\tfloat rewardsAmount = Float.parseFloat(rewardsValue);\r\n\t\t\tfloat totalAmount = cashbackAmount + rewardsAmount ;\r\n\r\n\t\t\tString strTotalAmount = Float.toString(totalAmount) + \"0\";\r\n\t\t\tString strOnlyCashbackAmount = Float.toString(cashbackAmount) + \"0\";\r\n\t\t\tString strOnlyRewardsAmount = Float.toString(rewardsAmount) + \"0\";\r\n\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\t\t\tvalidateTheElementPresence(cashbackText);\r\n\t\t\tvalidateTheElementPresence(rewardsText);\r\n\r\n\t\t\t//validate total cashback amount\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strTotalAmount);\r\n\r\n\t\t\t//validate only cashback amount\r\n\t\t\tactual = getText(cashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyCashbackAmount);\r\n\r\n\r\n\t\t\t//validate only rewards amount\r\n\t\t\tactual = getText(rewardsAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyRewardsAmount);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\r\n\t}", "void addressValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n }", "public void validateRpd18s1()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean isAddressValid(String address) {\n\t\tString pattern = \"(^\\\\d+(w|e|s|n)\\\\d+\\\\s\\\\w+\\\\s\\\\w+\\\\.)\";\n\t\tboolean isMatch = Pattern.matches(pattern, address);\n return isMatch;\n }", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "public static void fillUpAddAddress() throws Exception {\n\t\tString fName = Generic.ReadRandomCellData(\"Names\");\n\t\tString lName = Generic.ReadRandomCellData(\"Names\");\n\n\t\tString email = Generic.ReadFromExcel(\"Email\", \"LoginDetails\", 1);\n\t\tString mobileNum = Generic.ReadFromExcel(\"GCashNum\", \"LoginDetails\", 1);\n\t\ttry {\n\n\t\t\tsendKeys(\"CreateAccount\", \"FirstName\", fName);\n\n\t\t\tclickByLocation(\"42,783,1038,954\");\n\t\t\tenterTextByKeyCodeEvent(lName);\n\n//\t\t\tsendKeys(\"CreateAccount\", \"UnitNo\", Generic.ReadFromExcel(\"UnitNo\", \"LoginDetails\", 1));\n//\t\t\tsendKeys(\"CreateAccount\", \"StreetNo\", Generic.ReadFromExcel(\"StreetName\", \"LoginDetails\", 1));\n\t\t\tAddAddress(1);\n\t\t\tThread.sleep(2000);\n\t\t\tsendKeys(\"CreateAccount\", \"Email\", email);\n\t\t\tThread.sleep(2000);\n\t\t\tsendKeys(\"CreateAccount\", \"MobileNumber\", mobileNum);\n\t\t\tControl.takeScreenshot();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void validateRpd13s13()\n {\n // This guideline cannot be automatically tested.\n }", "public List<String> validate (PostPurchaseOrderRequest postPurchaseOrderRequest) {\n\n List<String> errorList = new ArrayList<>();\n\n errorList.addAll(commonPurchaseOrderValidator.validateLineItems(postPurchaseOrderRequest.getPurchaseOrder().getLineItems(),\n postPurchaseOrderRequest.getPurchaseOrder().getStatus()));\n\n\n return errorList;\n }", "@Test\n public void fieldAddressBlock() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n FieldAddressBlock field = (FieldAddressBlock) builder.insertField(FieldType.FIELD_ADDRESS_BLOCK, true);\n\n Assert.assertEquals(\" ADDRESSBLOCK \", field.getFieldCode());\n\n // Setting this to \"2\" will include all countries and regions,\n // unless it is the one specified in the ExcludedCountryOrRegionName property.\n field.setIncludeCountryOrRegionName(\"2\");\n field.setFormatAddressOnCountryOrRegion(true);\n field.setExcludedCountryOrRegionName(\"United States\");\n field.setNameAndAddressFormat(\"<Title> <Forename> <Surname> <Address Line 1> <Region> <Postcode> <Country>\");\n\n // By default, this property will contain the language ID of the first character of the document.\n // We can set a different culture for the field to format the result with like this.\n field.setLanguageId(\"1033\");\n\n Assert.assertEquals(\n \" ADDRESSBLOCK \\\\c 2 \\\\d \\\\e \\\"United States\\\" \\\\f \\\"<Title> <Forename> <Surname> <Address Line 1> <Region> <Postcode> <Country>\\\" \\\\l 1033\",\n field.getFieldCode());\n //ExEnd\n\n doc = DocumentHelper.saveOpen(doc);\n field = (FieldAddressBlock) doc.getRange().getFields().get(0);\n\n TestUtil.verifyField(FieldType.FIELD_ADDRESS_BLOCK,\n \" ADDRESSBLOCK \\\\c 2 \\\\d \\\\e \\\"United States\\\" \\\\f \\\"<Title> <Forename> <Surname> <Address Line 1> <Region> <Postcode> <Country>\\\" \\\\l 1033\",\n \"«AddressBlock»\", field);\n Assert.assertEquals(\"2\", field.getIncludeCountryOrRegionName());\n Assert.assertEquals(true, field.getFormatAddressOnCountryOrRegion());\n Assert.assertEquals(\"United States\", field.getExcludedCountryOrRegionName());\n Assert.assertEquals(\"<Title> <Forename> <Surname> <Address Line 1> <Region> <Postcode> <Country>\",\n field.getNameAndAddressFormat());\n Assert.assertEquals(\"1033\", field.getLanguageId());\n }", "private void check1(){\n \n\t\tif (firstDigit != 4){\n valid = false;\n errorCode = 1;\n }\n\t}", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "@Test(priority=1)\n\tpublic void checkFirstNameAndLastNameFieldValiditywithNumbers(){\n\t\tsignup.clearAllFields();\n\t\tsignup.enterId(\"[email protected]\");\n\t\tsignup.enterFirstName(\"12345\");\n\t\tsignup.enterLastName(\"56386\");\n\t\tsignup.clickSubmit();\n\t\tList<String> errors = signup.getErrors();\n\t\t// given page accepts numbers into the firstname and lastname fields\n\t\tAssert.assertFalse(TestHelper.isStringPresent(errors, \"Please enter your last name.\"));\n\t\tAssert.assertFalse(TestHelper.isStringPresent(errors, \"Please enter your first name.\"));\n\t}", "public void validateRpd13s9()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd1s2()\n {\n // This guideline cannot be automatically tested.\n }", "public void testSetLine1_NullString() {\r\n try {\r\n address.setLine1(null);\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }" ]
[ "0.7468707", "0.7417955", "0.73893154", "0.7079923", "0.6945474", "0.69114065", "0.66016084", "0.64202625", "0.63357496", "0.63060653", "0.62619543", "0.6237074", "0.6211625", "0.6205131", "0.6190378", "0.6184966", "0.6158813", "0.61446655", "0.61356753", "0.61096287", "0.6107822", "0.60912466", "0.6077732", "0.60581124", "0.60497814", "0.6012951", "0.5982491", "0.59642136", "0.5914526", "0.59060264", "0.5892168", "0.58685863", "0.583365", "0.5831316", "0.5823014", "0.58074623", "0.58073527", "0.580591", "0.5781408", "0.5766847", "0.57580566", "0.574737", "0.5739421", "0.5739421", "0.5724146", "0.5704115", "0.56861293", "0.56707764", "0.5664213", "0.5658823", "0.5656581", "0.5647043", "0.56463695", "0.5637915", "0.5631147", "0.5623334", "0.56119454", "0.5599618", "0.5588778", "0.5579593", "0.5570453", "0.5570453", "0.5557614", "0.5532264", "0.55300546", "0.55290025", "0.55229473", "0.5514484", "0.5512388", "0.5509983", "0.55065507", "0.54968894", "0.54966736", "0.54957664", "0.5472566", "0.54693604", "0.5447969", "0.5445531", "0.54451436", "0.5442653", "0.5427605", "0.5413743", "0.54069495", "0.5406831", "0.54043007", "0.5395406", "0.5381994", "0.5372455", "0.5357275", "0.53561443", "0.5354426", "0.53497905", "0.53495926", "0.53309953", "0.53273857", "0.5313372", "0.53108025", "0.53100854", "0.53055185", "0.53024083" ]
0.7740487
0
Validation Functions Description : To validate the Address Line 2 of Billing Address in Customer Tab Coded by :Rajan Created Data:21 Oct 2016 Last Modified Date: Modified By: Parameter:
public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll("M_Header", "Billing Address").replaceAll("M_Category", "Address Line 2").replaceAll("M_InnerText", AddressLine2), "Address Line 2 of Billing Address - "+AddressLine2, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Installation Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Address_Line_2_of_Correspondence_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Correspondence Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "public boolean isAddressLine1Valid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtAddressLine1.getText().trim().length() > 0)\n\t\t\t\treturn true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtAddressLine1.getText().trim().length() > 0) {\n\t\t\t\treturn true;\n\t\t}\n\t\ttxtAddressLine1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"AddressLine1: This field is required.\"));\n\t}", "public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Billing Address - \"+Postcode, false);\n\t}", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "public boolean isAddressLine2Valid() throws BusinessRuleException {\n\t\treturn true;\n\t}", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Billing Address - \"+Country, false);\n\t}", "public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Installation Address - \"+Postcode, false);\n\t}", "abstract void addressValidity();", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "public void createBillingAddress() throws Exception{\n\t\t\n\t\ttype(firstNameTextBox,\"bob\");\n\t\ttype(lastNameTextBox,\"test\");\n\t\ttype(addressLine1TextBox,\"2716 Ocean Park Blvd Suite 1030\");\n\t\ttype(addressLine2TextBox,\"test house\");\n\t\ttype(cityTextBox,\"Santa Monica\");\n\t\ttype(zipcodeTextBox,\"90405\");\n\t\tselect(stateSelectBox,8);\n\t\ttype(phoneTextField,\"6666654686\");\n\t\ttype(companyTextField,\"test company\");\n\t\n\t}", "public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tif(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity, false))\n\t\t{\n\t\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity);\n\t\t}\n\t\t\n\t}", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Installation Address - \"+Country, false);\n\t}", "public static Address addAddress() {\r\n\r\n\t\tSystem.out.println(\"Please enter the building number of the supplier:\");\r\n\r\n\t\tint bldNum = Validation.intValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the supplier's street name:\");\r\n\t\tString bldStreet = Validation.stringNoIntsValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the town the supplier is in:\");\r\n\t\tString bldTown = Validation.stringNoIntsValidation();\t\t\r\n\r\n\t\tSystem.out.println(\"Please enter the postcode for the supplier:\");\r\n\t\tString bldPCode = Validation.stringValidation();\r\n\r\n\t\tSystem.out.println(\"Please enter the country the supplier is in:\");\r\n\t\tString bldCountry = Validation.stringNoIntsValidation();\r\n\r\n\t\tAddress newAddress = new Address(bldNum, bldStreet, bldTown, bldPCode, bldCountry);\r\n\r\n\t\treturn newAddress;\r\n\r\n\t}", "@Test( dataProvider=\"AddressValidationTestData\", groups ={\"BillingAddressValidations\"})\r\n\r\n\tpublic static void AddNewBillingAddress(String[] BillingAddressDetailsInArray){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tAssert.assertEquals( launchAndValidateDifferentBillingAddresses(BillingAddressDetailsInArray) ,true) ;\t\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\t\t\r\n\t}", "public abstract String getAddressLine2();", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }", "public abstract String getAddressLine1();", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "private void validateLine1304(Errors errors) {\n }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public void validate(DataRecord value) {\n\r\n\t}", "public void setAddressline2(String addressline2) {\n this.addressline2 = addressline2;\n }", "public Address validate(Client client, String address) throws BytomException {\n\t\t\tMap<String, Object> req = new HashMap<String, Object>();\n\t\t\treq.put(\"address\", address);\n\t\t\treturn client.request(\"validate-address\", req, Address.class);\n\t\t}", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "@Test\n public void testCreateLabelInvoiceBarcode_AddressValidation_Failure()\n {\n \t\n \ttry {\n \t\t\n \t\tlogger.info(\"Testing creation of label, invoice and barcode for failure scenario .\");\n \t\tString fileName = \"./com/cts/ptms/carrier/yrc/resources/InputData_Standard_AddressValidation_Failure.xml\";\n\t \tURL url = getClass().getClassLoader().getResource(fileName);\n\t\t\tshipmentRequest.setFileName(url.getFile());\n \t\tshipmentRequest.setCarrier(\"YRC\");\n\t \tshipmentRequest.setGenLabel(true);\n\t \tshipmentResponse = yrcSoapClient.createShipmentRequest(shipmentRequest);\n\t \tlogger.info(\"Status:\"+shipmentResponse );\n\t \t\n\t \tassertEquals(\"ERROR\", shipmentResponse.getStatus());\n\t\t\t\n \t} \n\t\tcatch(Exception e)\n\t\t{\n\t\t\tassertEquals(\"Failure\", \"Failure\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Exception occured\"+e.getMessage());\n\t\t}\n \t\n }", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "public boolean validateContactAddress(String contactId, List<String> result)\n {\n return true;\n }", "private void validateData() {\n }", "public void setAddressLine2(String addressLine2) {\n this.addressLine2 = addressLine2;\n }", "public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Installation Address - \"+TownCity);\n\t\t\t\n\t\t\t\n\t\t\n\t}", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validate_the_Town_City_of_Correspondence_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Correspondence Address - \"+TownCity, false);\n\t}", "public void setAddressline1(String addressline1) {\n this.addressline1 = addressline1;\n }", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "private Map<String,String> getValidatedAddressInfo(Map<String,String> params) throws ClientProtocolException, IOException \n\t{\n\t\t// Create unique form parameters\n\t\tList<NameValuePair> uniqueParams = new ArrayList<NameValuePair>();\n\t\tuniqueParams.add(new BasicNameValuePair(\"__LASTFOCUS\", \"\"));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__VIEWSTATE\", params.get(\"ViewState\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__EVENTVALIDATION\", params.get(\"EventValidation\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetNumber\", params.get(\"StreetNumber\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetName\", params.get(\"StreetName\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"EnterButton\", \"Enter\"));\n\t\t\n\t\t//get the HTML from the FCPS boundary locator web site\n\t\tString responseHtml = getFCPSBoundaryLocatorHTML(uniqueParams);\n\t\t\n\t\tif(responseHtml == null || responseHtml.isEmpty() || responseHtml.startsWith(\"Error\"))\n\t\t{\n\t\t\tMap<String, String> errMap = new HashMap<String,String>();\n\t\t\terrMap.put(\"Error\", \"Failed Post\");\n\t\t\treturn errMap;\n\t\t}\n\t\telse\t //scrape the HTML to obtain the validated address map\n\t\t\treturn scrapeValidatedAddressHTML(responseHtml.toString());\n\t}", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "public void validateRpd13s2()\n {\n // This guideline cannot be automatically tested.\n }", "public void setAddressLine1(String addressLine1) {\n this.addressLine1 = addressLine1;\n }", "public String getAddressLine2() {\n return addressLine2;\n }", "public abstract void setAddressLine2(String sValue);", "public void validate_the_Email_Address_1_of_Security_in_Customer_Tab(String EmailAddress1)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 1\").replaceAll(\"M_InnerText\", EmailAddress1), \"Email Address 1 - \"+EmailAddress1, false);\n\t}", "public void validate_the_Email_Address_2_of_Security_in_Customer_Tab(String EmailAddress2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 2\").replaceAll(\"M_InnerText\", EmailAddress2), \"Email Address 2 - \"+EmailAddress2, false);\n\t}", "private static JSONObject validateStreet(String street, String city, String state, String zip) throws Exception {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n//\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n//\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n//\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n//\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\n\t\treturn addrKeyFormat;\n\t}", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "public void validate(Object obj, Errors errors) {\n\t\t\n\t\tBooking booking = (Booking) obj;\n\t\t\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(errors, \"aptNo\", \"error.invalid.aptNo\", \"Apartment Number Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"street\", \"error.invalid.street\", \"Street Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"city\", \"error.invalid.city\", \"City Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"state\", \"error.invalid.state\", \"State Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"zipCode\", \"error.invalid.zipCode\", \"Zipcode Required\");\n \n\t}", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "@Test(enabled = true)\n @UsingDataSet({\"datasets/base_data.xls\", \"datasets/data.xls\"})\n public void testEditAddressCase2() throws Exception {\n final String addrCode = \"30011400002\";\n final Address address = this.addressRepository.getAddressByAddressCode(addrCode);\n final ServiceResult<AddressDto> result = this.addressService.editAddress(address);\n\n Assert.assertNull(result);\n }", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "public void validateAdress(String adress) {\r\n\t\tthis.isAdressValid = model.isValidAdress(adress);\r\n\r\n\t\tif (this.isAdressValid) {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: green;\");\r\n\t\t\tcheckButtonUnlock();\r\n\t\t} else {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: red;\");\r\n\t\t\tlockButton();\r\n\t\t}\r\n\t}", "public String getAddressLine1() {\n return addressLine1;\n }", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd14s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate() {}", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "public abstract void setAddressLine1(String sValue);", "public void validateRpd22s2()\n {\n // This guideline cannot be automatically tested.\n }", "private void validateDetails() {\n\n clearErrors();\n Utils.hide_keyboard(getActivity());\n\n boolean valid = true;\n\n String cvv = cvvTv.getText().toString();\n String expiryDate = cardExpiryTv.getText().toString();\n String cardNo = cardNoTv.getText().toString();\n\n if (cvv.length() < 3) {\n valid = false;\n cvvTil.setError(\"Enter a valid cvv\");\n }\n\n if (expiryDate.length() != 5) {\n cardExpiryTil.setError(\"Enter a valid expiry date\");\n valid = false;\n }\n\n String cardNoStripped = cardNo.replaceAll(\"\\\\s\", \"\");\n\n if (cardNoStripped.length() < 12 ) {\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n else {\n try {\n Long parsed = Long.parseLong(cardNoStripped);\n }\n catch (Exception e) {\n e.printStackTrace();\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n }\n\n if (valid) {\n\n if (saveCardSwitch.isChecked()) {\n int cardLen = cardNoStripped.length();\n cardFirst6 = cardNoStripped.substring(0, 6);\n cardLast4 = cardNoStripped.substring(cardLen - 4, cardLen);\n shouldISaveThisCard = true;\n presenter.savePotentialCardDets(cardFirst6, cardLast4);\n }\n\n //make request\n PayloadBuilder builder = new PayloadBuilder();\n builder.setAmount(thetellerInitializer.getAmount() + \"\")\n .setNarration(thetellerInitializer.getNarration())\n .setCardno(cardNoStripped)\n .set3dUrl(thetellerInitializer.get3dUrl())\n .setEmail(thetellerInitializer.getEmail())\n .setCurrency(thetellerInitializer.getCurrency())\n .setMerchant_id(thetellerInitializer.getMerchant_id())\n .setCvv(cvv).setFirstname(thetellerInitializer.getfName())\n .setLastname(thetellerInitializer.getlName())\n .setIP(Utils.getDeviceImei(getActivity()))\n .setTxRef(thetellerInitializer.getTxRef())\n .setExpiryyear(expiryDate.substring(3,5))\n .setExpirymonth(expiryDate.substring(0,2))\n .setMeta(thetellerInitializer.getMeta())\n .setApiUser(thetellerInitializer.getApiUser())\n .setApiKey(thetellerInitializer.getApiKey())\n .setDevice_fingerprint(Utils.getDeviceImei(getActivity()))\n .setCardType(cardType);\n\n if (thetellerInitializer.getPayment_plan() != null) {\n builder.setPaymentPlan(thetellerInitializer.getPayment_plan());\n }\n\n body = builder.createPayload();\n\n presenter.chargeCard(body, thetellerConstants.API_KEY);\n }\n }", "private static boolean validateAddress(String address) {\n return !address.isEmpty();\n }", "void addressValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n }", "public String getAddressline2() {\n return addressline2;\n }", "void validate();", "void validate();", "public String getAddressline1() {\n return addressline1;\n }", "@Test\n public void testIncorrectPostalCode(){\n UserRegisterKYC tooLong = new UserRegisterKYC(\"hello\",validId3,\"30/03/1995\",\"7385483\");\n int requestResponse = tooLong.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC tooShort = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"48532\");\n requestResponse = tooShort.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC startWith74 = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"746532\");\n requestResponse = startWith74.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC startWithMoreThan82 = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"967532\");\n requestResponse = startWithMoreThan82.sendRegisterRequest();\n assertEquals(400,requestResponse);\n }", "private void validateUpdateCustomers(List<CustomersInputDTO> customers, String formatDate) {\n // inner validate\n if (customers == null || customers.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(ConstantsCustomers.CUSTOMERS, Constants.RIQUIRED_CODE));\n }\n // validate common\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n List<Map<String, Object>> customParams = new ArrayList<>();\n customers.forEach(cus -> {\n Map<String, Object> customField = new HashMap<>();\n customField.put(\"rowId\", cus.getCustomerId());\n customField.putAll(buildParamsValidateCustomersInput(cus, jsonBuilder));\n customParams.add(customField);\n });\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n customParams, formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n List<Map<String, Object>> listValidate = CustomersCommonUtil.validateCommon(validateJson, restOperationUtils,\n token, tenantName);\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd1s2()\n {\n // This guideline cannot be automatically tested.\n }", "private Address parseAddress(javax.swing.JTextField tx){\n \t\n \tString in = tx.getText().trim();\n \t\n \tString[] arr = in.split(\" \");\n \tif(arr.length < 3){\n \t\treturn null;\n \t}\n \t\n \tint num;\n \tString zip;\n \tString name;\n \ttry{\n \t\tnum = Integer.parseInt(arr[0]);\n \tzip = arr[arr.length - 1];\n \tname = \"\";\n \tfor(int i = 1; i < arr.length -1; i++){\n \t\tif(arr[i].length() != 0){\n \t\t\tname += \" \"+arr[i];\n \t\t}\n \t}\n \n \t}catch(Exception ex){\n \t\treturn null;\n \t}\n \t\n \treturn new Address(num, name.substring(1), zip);\n }", "public abstract FieldReport validate(int fieldSequence, Object fieldValue);", "public boolean isPhone1Valid() throws BusinessRuleException {\n\t\tif (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtPhone1.getText().trim().length() > 0)\n\t\t\treturn true;\n\t\ttxtPhone1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"Phone: This field is required.\"));\n\t}", "public static void fillUpAddAddress() throws Exception {\n\t\tString fName = Generic.ReadRandomCellData(\"Names\");\n\t\tString lName = Generic.ReadRandomCellData(\"Names\");\n\n\t\tString email = Generic.ReadFromExcel(\"Email\", \"LoginDetails\", 1);\n\t\tString mobileNum = Generic.ReadFromExcel(\"GCashNum\", \"LoginDetails\", 1);\n\t\ttry {\n\n\t\t\tsendKeys(\"CreateAccount\", \"FirstName\", fName);\n\n\t\t\tclickByLocation(\"42,783,1038,954\");\n\t\t\tenterTextByKeyCodeEvent(lName);\n\n//\t\t\tsendKeys(\"CreateAccount\", \"UnitNo\", Generic.ReadFromExcel(\"UnitNo\", \"LoginDetails\", 1));\n//\t\t\tsendKeys(\"CreateAccount\", \"StreetNo\", Generic.ReadFromExcel(\"StreetName\", \"LoginDetails\", 1));\n\t\t\tAddAddress(1);\n\t\t\tThread.sleep(2000);\n\t\t\tsendKeys(\"CreateAccount\", \"Email\", email);\n\t\t\tThread.sleep(2000);\n\t\t\tsendKeys(\"CreateAccount\", \"MobileNumber\", mobileNum);\n\t\t\tControl.takeScreenshot();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public PersonInfo addPerson(PersonInfo p) {\n\t\tlog.info(\"Enter First Name\");\n\t\tString fname = obj.next();\n\t\tlog.info(\"Enter Last Name\");\n\t\tString lname = obj.next();\n\t\tlog.info(\"Enter Address\");\n\t\tString address = obj.next();\n\t\tlog.info(\"Enter City\");\n\t\tString city = obj.next();\n\t\tlog.info(\"Enter State\");\n\t\tString state = obj.next();\n\t\tlog.info(\"Enter the six digit Zip Code\");\n\t\tString zipCode = obj.next();\n\t\tString pattern3 = \"^[1-9]{1}[0-9]{5}$\";\n\t\tPattern zip_pattern = Pattern.compile(pattern3);\n\t\tMatcher m3 = zip_pattern.matcher(zipCode);\n\t\tif (m3.matches() == false) {\n\t\t\tlog.info(\"zip code not in format enter again\");\n\t\t\tzipCode = obj.next();\n\t\t}\n\t\tlog.info(\"Enter the ten digit Phone Number\");\n\t\tString phoneNo = obj.next();\n\t\tString pattern1 = \"^[1-9]{1}[0-9]{9}$\";\n\t\tPattern mobile_pattern = Pattern.compile(pattern1);\n\t\tMatcher m1 = mobile_pattern.matcher(phoneNo);\n\t\tif (m1.matches() == false) {\n\t\t\tlog.info(\"phone number not in format enter again\");\n\t\t\tphoneNo = obj.next();\n\t\t}\n\t\tlog.info(\"Enter Email\");\n\t\tString email = obj.next();\n\t\tString pattern2 = \"^[a-zA-Z0-9]+((\\\\.[0-9]+)|(\\\\+[0-9]+)|(\\\\-[0-9]+)|([0-9]))*@*+[a-zA-Z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\";\n\t\tPattern email_sample = Pattern.compile(pattern2);\n\t\tMatcher m2 = email_sample.matcher(email);\n\t\tif (m2.matches() == false) {\n\t\t\tlog.info(\"email not in format enter again\");\n\t\t\temail = obj.next();\n\t\t}\n\t\tp = new PersonInfo(fname, lname, address, city, state, zipCode, phoneNo, email);\n\t\treturn p;\n\t}", "public void validate_the_Account_Number_in_Customer_Account_Summary_of_Customer_Tab(String AccountNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Account Number\").replaceAll(\"M_InnerText\", AccountNumber), \"Account Number - \"+AccountNumber, false);\n\t\tReport.fnReportPageBreak(\"Customer Account Summary\", driver);\n\t}", "public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }", "@Override\r\n\tpublic void validate(Product p) throws CustomBadRequestException {\r\n\t\tif(p.getName() == null || p.getName().equals(\"\") || p.getBarcode() == null || p.getBarcode().equals(\"\") || p.getMeasure_unit() == null ||\r\n\t\t\t\tp.getMeasure_unit().equals(\"\") || p.getQuantity() == null || p.getQuantity().equals(\"\")|| p.getBrand() == null || p.getBrand().equals(\"\")){\r\n\t\t\tthrow new CustomBadRequestException(\"Incomplete Information about the product\");\r\n\t\t}\r\n\r\n\t\tString eanCode = p.getBarcode();\r\n\t\tString ValidChars = \"0123456789\";\r\n\t\tchar digit;\r\n\t\tfor (int i = 0; i < eanCode.length(); i++) { \r\n\t\t\tdigit = eanCode.charAt(i); \r\n\t\t\tif (ValidChars.indexOf(digit) == -1) {\r\n\t\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Add five 0 if the code has only 8 digits\r\n\t\tif (eanCode.length() == 8 ) {\r\n\t\t\teanCode = \"00000\" + eanCode;\r\n\t\t}\r\n\t\t// Check for 13 digits otherwise\r\n\t\telse if (eanCode.length() != 13) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\t// Get the check number\r\n\t\tint originalCheck = Integer.parseInt(eanCode.substring(eanCode.length() - 1));\r\n\t\teanCode = eanCode.substring(0, eanCode.length() - 1);\r\n\r\n\t\t// Add even numbers together\r\n\t\tint even = Integer.parseInt((eanCode.substring(1, 2))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(3, 4))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(5, 6))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(7, 8))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(9, 10))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(11, 12))) ;\r\n\t\t// Multiply this result by 3\r\n\t\teven *= 3;\r\n\r\n\t\t// Add odd numbers together\r\n\t\tint odd = Integer.parseInt((eanCode.substring(0, 1))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(2, 3))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(4, 5))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(6, 7))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(8, 9))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(10, 11))) ;\r\n\r\n\t\t// Add two totals together\r\n\t\tint total = even + odd;\r\n\r\n\t\t// Calculate the checksum\r\n\t\t// Divide total by 10 and store the remainder\r\n\t\tint checksum = total % 10;\r\n\t\t// If result is not 0 then take away 10\r\n\t\tif (checksum != 0) {\r\n\t\t\tchecksum = 10 - checksum;\r\n\t\t}\r\n\r\n\t\t// Return the result\r\n\t\tif (checksum != originalCheck) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\tif(Float.parseFloat(p.getQuantity()) <= 0){\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Quantity\");\r\n\t\t}\r\n\r\n\r\n\t}" ]
[ "0.7464341", "0.731365", "0.718706", "0.715571", "0.71127313", "0.6640326", "0.6549203", "0.65002716", "0.6491332", "0.6379296", "0.6322137", "0.63066906", "0.62973416", "0.6288055", "0.6234272", "0.6152935", "0.61276346", "0.6102648", "0.6075113", "0.6064243", "0.60352594", "0.59888923", "0.59809536", "0.59801555", "0.597323", "0.597297", "0.59725547", "0.5964632", "0.5951102", "0.59029293", "0.5855175", "0.5849081", "0.58384216", "0.58144295", "0.5786585", "0.5786585", "0.5782368", "0.5762174", "0.57387453", "0.57325363", "0.57243454", "0.57215506", "0.5713724", "0.5708279", "0.5699338", "0.5681907", "0.5668886", "0.5666625", "0.5657782", "0.5635515", "0.5618316", "0.5599609", "0.5588606", "0.55624795", "0.5562446", "0.5552774", "0.5534676", "0.5517224", "0.5511701", "0.5510629", "0.5509743", "0.55065304", "0.5505128", "0.55026734", "0.5498621", "0.5497508", "0.54906034", "0.5486656", "0.54785615", "0.54781365", "0.5448619", "0.5442007", "0.5440431", "0.5435637", "0.54317915", "0.5410695", "0.53964245", "0.5395276", "0.53951997", "0.5393846", "0.53921884", "0.5385687", "0.5379816", "0.5379688", "0.5379688", "0.5351569", "0.53458476", "0.5316452", "0.5315449", "0.5311631", "0.53080606", "0.53048027", "0.5299106", "0.5286815", "0.5281848", "0.52672964", "0.52649707", "0.52602714", "0.52586955", "0.52542645" ]
0.7678693
0
Validation Functions Description : To validate the Town/City of Billing Address in Customer Tab Coded by :Rajan Created Data:21 Oct 2016 Last Modified Date: Modified By: Parameter:
public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception { if(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll("M_Header", "Billing Address").replaceAll("M_Category", "Town/City").replaceAll("M_InnerText", TownCity), "Town/City of Billing Address - "+TownCity, false)) { VerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll("M_Header", "Billing Address").replaceAll("M_Category", "Town/City").replaceAll("M_InnerText", TownCity), "Town/City of Billing Address - "+TownCity); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Installation Address - \"+TownCity);\n\t\t\t\n\t\t\t\n\t\t\n\t}", "public void validate_the_Town_City_of_Correspondence_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Correspondence Address - \"+TownCity, false);\n\t}", "public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Billing Address - \"+Country, false);\n\t}", "public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Billing Address - \"+Postcode, false);\n\t}", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Installation Address - \"+Country, false);\n\t}", "public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Installation Address - \"+Postcode, false);\n\t}", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "abstract void addressValidity();", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "private static JSONObject validateStreet(String street, String city, String state, String zip) throws Exception {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n//\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n//\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n//\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n//\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\n\t\treturn addrKeyFormat;\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void createBillingAddress() throws Exception{\n\t\t\n\t\ttype(firstNameTextBox,\"bob\");\n\t\ttype(lastNameTextBox,\"test\");\n\t\ttype(addressLine1TextBox,\"2716 Ocean Park Blvd Suite 1030\");\n\t\ttype(addressLine2TextBox,\"test house\");\n\t\ttype(cityTextBox,\"Santa Monica\");\n\t\ttype(zipcodeTextBox,\"90405\");\n\t\tselect(stateSelectBox,8);\n\t\ttype(phoneTextField,\"6666654686\");\n\t\ttype(companyTextField,\"test company\");\n\t\n\t}", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Installation Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public void validate_the_Address_Line_2_of_Correspondence_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Correspondence Address - \"+AddressLine2, false);\n\t}", "@Test\n\tpublic void requestDataForCustomer12212_checkAddressCity_expectBeverlyHills() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "@Test( dataProvider=\"AddressValidationTestData\", groups ={\"BillingAddressValidations\"})\r\n\r\n\tpublic static void AddNewBillingAddress(String[] BillingAddressDetailsInArray){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tAssert.assertEquals( launchAndValidateDifferentBillingAddresses(BillingAddressDetailsInArray) ,true) ;\t\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\t\t\r\n\t}", "@Test\n public void testIncorrectPostalCode(){\n UserRegisterKYC tooLong = new UserRegisterKYC(\"hello\",validId3,\"30/03/1995\",\"7385483\");\n int requestResponse = tooLong.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC tooShort = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"48532\");\n requestResponse = tooShort.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC startWith74 = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"746532\");\n requestResponse = startWith74.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC startWithMoreThan82 = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"967532\");\n requestResponse = startWithMoreThan82.sendRegisterRequest();\n assertEquals(400,requestResponse);\n }", "private void validateData() {\n }", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "public void validate(Object obj, Errors errors) {\n\t\t\n\t\tBooking booking = (Booking) obj;\n\t\t\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(errors, \"aptNo\", \"error.invalid.aptNo\", \"Apartment Number Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"street\", \"error.invalid.street\", \"Street Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"city\", \"error.invalid.city\", \"City Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"state\", \"error.invalid.state\", \"State Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"zipCode\", \"error.invalid.zipCode\", \"Zipcode Required\");\n \n\t}", "public static Customer validateCustomer(TextField shopname, TextField shopcontact, TextField streetadd, ComboBox area, TextField city, TextField zip) {\r\n Customer customer = new Customer();\r\n customer = null;\r\n\r\n if (shopname.getText().isEmpty() || shopcontact.getText().isEmpty() || streetadd.getText().isEmpty()\r\n || city.getText().isEmpty()\r\n || zip.getText().isEmpty() || area.getValue() == null) {\r\n new PopUp(\"Name Error\", \"Field is Empty\").alert();\r\n } else if (!shopcontact.getText().matches(\"\\\\d{10}\")) {\r\n new PopUp(\"Name Error\", \"Contact must be 10 Digit\").alert();\r\n } else if (!zip.getText().matches(\"\\\\d{6}\")) {\r\n new PopUp(\"Error\", \"Zip Code must be 6 Digit\").alert();\r\n } else {\r\n customer.setShopName(shopname.getText());\r\n customer.setShopCont(Long.valueOf(shopcontact.getText()));\r\n customer.setStreetAdd(streetadd.getText());\r\n customer.setArea(area.getValue().toString());\r\n customer.setCity(city.getText());\r\n customer.setZipcode(Integer.valueOf(zip.getText()));\r\n }\r\n\r\n return customer;\r\n }", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "public static Address addAddress() {\r\n\r\n\t\tSystem.out.println(\"Please enter the building number of the supplier:\");\r\n\r\n\t\tint bldNum = Validation.intValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the supplier's street name:\");\r\n\t\tString bldStreet = Validation.stringNoIntsValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the town the supplier is in:\");\r\n\t\tString bldTown = Validation.stringNoIntsValidation();\t\t\r\n\r\n\t\tSystem.out.println(\"Please enter the postcode for the supplier:\");\r\n\t\tString bldPCode = Validation.stringValidation();\r\n\r\n\t\tSystem.out.println(\"Please enter the country the supplier is in:\");\r\n\t\tString bldCountry = Validation.stringNoIntsValidation();\r\n\r\n\t\tAddress newAddress = new Address(bldNum, bldStreet, bldTown, bldPCode, bldCountry);\r\n\r\n\t\treturn newAddress;\r\n\r\n\t}", "public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "public boolean isAddressLine1Valid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtAddressLine1.getText().trim().length() > 0)\n\t\t\t\treturn true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtAddressLine1.getText().trim().length() > 0) {\n\t\t\t\treturn true;\n\t\t}\n\t\ttxtAddressLine1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"AddressLine1: This field is required.\"));\n\t}", "@Test\n\tpublic void validateCountry() {\n\t\tRequestSpecification requestSpecification = new base().getRequestSpecification();\n\t\tgiven().get(Endpoint.GET_COUNTRY).then().statusCode(200).\n\t\tand().contentType(ContentType.JSON).\n\t\tand().body(\"name\", hasItem(\"India\")).\n\t\tand().body(\"find { d -> d.name == 'India' }.borders\", hasItem(\"CHN\"));\n\n\t}", "private void validateUpdateCustomers(List<CustomersInputDTO> customers, String formatDate) {\n // inner validate\n if (customers == null || customers.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(ConstantsCustomers.CUSTOMERS, Constants.RIQUIRED_CODE));\n }\n // validate common\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n List<Map<String, Object>> customParams = new ArrayList<>();\n customers.forEach(cus -> {\n Map<String, Object> customField = new HashMap<>();\n customField.put(\"rowId\", cus.getCustomerId());\n customField.putAll(buildParamsValidateCustomersInput(cus, jsonBuilder));\n customParams.add(customField);\n });\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n customParams, formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n List<Map<String, Object>> listValidate = CustomersCommonUtil.validateCommon(validateJson, restOperationUtils,\n token, tenantName);\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private Map<String,String> getValidatedAddressInfo(Map<String,String> params) throws ClientProtocolException, IOException \n\t{\n\t\t// Create unique form parameters\n\t\tList<NameValuePair> uniqueParams = new ArrayList<NameValuePair>();\n\t\tuniqueParams.add(new BasicNameValuePair(\"__LASTFOCUS\", \"\"));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__VIEWSTATE\", params.get(\"ViewState\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__EVENTVALIDATION\", params.get(\"EventValidation\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetNumber\", params.get(\"StreetNumber\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetName\", params.get(\"StreetName\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"EnterButton\", \"Enter\"));\n\t\t\n\t\t//get the HTML from the FCPS boundary locator web site\n\t\tString responseHtml = getFCPSBoundaryLocatorHTML(uniqueParams);\n\t\t\n\t\tif(responseHtml == null || responseHtml.isEmpty() || responseHtml.startsWith(\"Error\"))\n\t\t{\n\t\t\tMap<String, String> errMap = new HashMap<String,String>();\n\t\t\terrMap.put(\"Error\", \"Failed Post\");\n\t\t\treturn errMap;\n\t\t}\n\t\telse\t //scrape the HTML to obtain the validated address map\n\t\t\treturn scrapeValidatedAddressHTML(responseHtml.toString());\n\t}", "public boolean validateContactAddress(String contactId, List<String> result)\n {\n return true;\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "private void validateDetails() {\n\n clearErrors();\n Utils.hide_keyboard(getActivity());\n\n boolean valid = true;\n\n String cvv = cvvTv.getText().toString();\n String expiryDate = cardExpiryTv.getText().toString();\n String cardNo = cardNoTv.getText().toString();\n\n if (cvv.length() < 3) {\n valid = false;\n cvvTil.setError(\"Enter a valid cvv\");\n }\n\n if (expiryDate.length() != 5) {\n cardExpiryTil.setError(\"Enter a valid expiry date\");\n valid = false;\n }\n\n String cardNoStripped = cardNo.replaceAll(\"\\\\s\", \"\");\n\n if (cardNoStripped.length() < 12 ) {\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n else {\n try {\n Long parsed = Long.parseLong(cardNoStripped);\n }\n catch (Exception e) {\n e.printStackTrace();\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n }\n\n if (valid) {\n\n if (saveCardSwitch.isChecked()) {\n int cardLen = cardNoStripped.length();\n cardFirst6 = cardNoStripped.substring(0, 6);\n cardLast4 = cardNoStripped.substring(cardLen - 4, cardLen);\n shouldISaveThisCard = true;\n presenter.savePotentialCardDets(cardFirst6, cardLast4);\n }\n\n //make request\n PayloadBuilder builder = new PayloadBuilder();\n builder.setAmount(thetellerInitializer.getAmount() + \"\")\n .setNarration(thetellerInitializer.getNarration())\n .setCardno(cardNoStripped)\n .set3dUrl(thetellerInitializer.get3dUrl())\n .setEmail(thetellerInitializer.getEmail())\n .setCurrency(thetellerInitializer.getCurrency())\n .setMerchant_id(thetellerInitializer.getMerchant_id())\n .setCvv(cvv).setFirstname(thetellerInitializer.getfName())\n .setLastname(thetellerInitializer.getlName())\n .setIP(Utils.getDeviceImei(getActivity()))\n .setTxRef(thetellerInitializer.getTxRef())\n .setExpiryyear(expiryDate.substring(3,5))\n .setExpirymonth(expiryDate.substring(0,2))\n .setMeta(thetellerInitializer.getMeta())\n .setApiUser(thetellerInitializer.getApiUser())\n .setApiKey(thetellerInitializer.getApiKey())\n .setDevice_fingerprint(Utils.getDeviceImei(getActivity()))\n .setCardType(cardType);\n\n if (thetellerInitializer.getPayment_plan() != null) {\n builder.setPaymentPlan(thetellerInitializer.getPayment_plan());\n }\n\n body = builder.createPayload();\n\n presenter.chargeCard(body, thetellerConstants.API_KEY);\n }\n }", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public Customer(String firstName, String lastName, String emailAddress, String street, String houseNumber, String postalCode, String town, String country, boolean isOwner) throws InvalidEmailException {\n _firstName = firstName;\n _lastName = lastName;\n _emailAddress = new EmailType(emailAddress);\n _address = new AddressType(street, houseNumber, postalCode, town, country); //added adress in Constructor\n _orders = new ArrayList<Order>();\n _isOwner = isOwner;\n _spaces = new ArrayList<Space>();\n\n }", "void addressValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n }", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "public boolean validData(String[] data) {\n\t\tboolean validData = true;\n\t\tint year, quarter, month;\n\t\ttry {\n\t\t\tyear = Integer.valueOf(data[0]);\n\t\t\tquarter = Integer.valueOf(data[1]);\n\t\t\tmonth = Integer.valueOf(data[2]);\n\t\t\tint CRSArrTime = Integer.valueOf(data[40]);\n\t\t\tint CRSDepTime = Integer.valueOf(data[29]);\n\t\t\tint timeZone = timeToMinute(Integer.valueOf(data[40])) - timeToMinute(Integer.valueOf(data[29])) - Integer.valueOf(data[50]);\n\t\t\tint origin_AirportID = Integer.valueOf(data[11]);\n\t\t\tint dest_AirportID = Integer.valueOf(data[20]);\n\t\t\tint origin_AirportSeqID = Integer.valueOf(data[12]);\n\t\t\tint dest_AirportSeqID = Integer.valueOf(data[21]);\n\t\t\tint origin_CityMarketID = Integer.valueOf(data[13]);\n\t\t\tint dest_CityMarketID = Integer.valueOf(data[22]);\n\t\t\tint origin_StateFips = Integer.valueOf(data[17]);\n\t\t\tint dest_StateFips = Integer.valueOf(data[26]);\n\t\t\tint origin_wac = Integer.valueOf(data[19]);\n\t\t\tint dest_wac = Integer.valueOf(data[28]);\n\t\t\tint cancelled = Integer.valueOf(data[47]);\n\t\t\tString origin = data[14];\n\t\t\tString dest = data[23];\n\t\t\tString origin_cityname = data[15];\n\t\t\tString dest_cityname = data[24];\n\t\t\tString origin_state = data[18];\n\t\t\tString dest_state = data[27];\n\t\t\tString origin_state_abr = data[16];\n\t\t\tString dest_state_abr = data[25];\n\t\t\t\n\t\t\tif ((CRSArrTime != 0 && CRSDepTime != 0) &&\n\t\t\t\t(timeZone%60 == 0) &&\t\n\t\t\t\t(origin_AirportID >0 && dest_AirportID > 0 && origin_AirportSeqID > 0 && dest_AirportSeqID > 0 \n\t\t\t\t\t\t&& origin_CityMarketID > 0 && dest_CityMarketID > 0 && origin_StateFips > 0 && dest_StateFips > 0 \n\t\t\t\t\t\t&& origin_wac > 0 && dest_wac > 0)\t&&\n\t\t\t\t(!origin.isEmpty() && !dest.isEmpty() && !origin_cityname.isEmpty() && !dest_cityname.isEmpty()\n\t\t\t\t\t\t&& !origin_state.isEmpty() && !dest_state.isEmpty() && !origin_state_abr.isEmpty() && !dest_state_abr.isEmpty())) {\n\t\t\t\t\n\t\t\t\t// for flights which are not cancelled\n\t\t\t\tif (cancelled != 1) {\n\t\t\t\t\tif (((timeToMinute(Integer.valueOf(data[41])) - timeToMinute(Integer.valueOf(data[30])) - Integer.valueOf(data[51]) - timeZone)/60)%24 == 0) {\n\t\t\t\t\t\tif (Float.valueOf(data[42]) > 0) {\n\t\t\t\t\t\t\tif (Float.valueOf(data[42]).equals(Float.valueOf(data[43])))\n\t\t\t\t\t\t\t\tvalidData = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Float.valueOf(data[42]) < 0) {\n\t\t\t\t\t\t\tif (Float.valueOf(data[43]) == 0)\n\t\t\t\t\t\t\t\tvalidData = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Float.valueOf(data[43]) >= 15) {\n\t\t\t\t\t\t\tif (Float.valueOf(data[44]) == 1)\n\t\t\t\t\t\t\t\tvalidData = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// fill map\n\t\tif ((year == 2015) && (quarter == 1) && (month == 1)) {\n\t\t\ttry {\n\t\t\t\tString carrier = data[8];\n\t\t\t\tfloat price = Float.valueOf(data[109]);\n\t\t\t\t\n\t\t\t\tif (map_t.containsKey(carrier)) {\n\t\t\t\t\tArrayList<Float> list = map_t.get(carrier);\n\t\t\t\t\tlist.add(price);\n\t\t\t\t\tmap_t.put(carrier, list);\n\t\t\t\t} else {\n\t\t\t\t\tArrayList<Float> list = new ArrayList<Float>();\n\t\t\t\t\tlist.add(price);\n\t\t\t\t\tmap_t.put(carrier, list);\n\t\t\t\t}\t\t\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t}\n\t\t}\t\t\t\n\t\treturn validData;\n\t}", "private void fillCity() {\n \n if(postalCodeTF.getText().length() == 4){\n City city = memberConnection.getCity(postalCodeTF.getText());\n cityTF.setText(city.getCity().replaceAll(\"_\", \" \"));\n municipalTF.setText(city.getMunicipal().replaceAll(\"_\", \" \"));\n }\n }", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public static void AddAddress(int selectAddress) throws Exception {\n\t\tWebElement element = null;\n\t\tConstant.UnitNo = Generic.ReadFromExcel(\"UnitNo\", \"LoginDetails\", selectAddress);\n\t\tConstant.StreetName = Generic.ReadFromExcel(\"StreetName\", \"LoginDetails\", selectAddress);\n\t\tConstant.Province = Generic.ReadFromExcel(\"Province\", \"LoginDetails\", selectAddress);\n\t\tConstant.City = Generic.ReadFromExcel(\"City\", \"LoginDetails\", selectAddress);\n\t\tConstant.Barangay = Generic.ReadFromExcel(\"Barangay\", \"LoginDetails\", selectAddress);\n\t\tConstant.ZipCode = Generic.ReadFromExcel(\"ZipCode\", \"LoginDetails\", selectAddress);\n\t\ttry {\n\t\t\tThread.sleep(5000);\n\t\t\tsendKeys(\"CreateAccount\", \"UnitNo\", Constant.UnitNo);\n\t\t\tsendKeys(\"CreateAccount\", \"StreetNo\", Constant.StreetName);\n\t\t\tclick(\"CreateAccount\", \"Province\");\n\t\t\tThread.sleep(1000);\n\t\t\tsendKeys(\"CreateAccount\", \"EnterProvince\", Constant.Province);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.Province + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\n\t\t\t//// *[@content-desc=\"METRO MANILA, List Choice Label\"]\n\n\t\t\tThread.sleep(2000);\n\n\t\t\t// TODO BUG on-going fix\n\t\t\t// <Remarks> uncomment this after fix </Remarks>\n//\t\t\tclick(\"CreateAccount\", \"City\");\n//\t\t\tThread.sleep(1000);\n\n\t\t\tsendKeys(\"CreateAccount\", \"EnterCity\", Constant.City);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.City + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\n\t\t\tThread.sleep(2000);\n\n\t\t\t// TODO BUG on-going fix\n\t\t\t// <Remarks> uncomment this after fix </Remarks>\n//\t\t\tclick(\"CreateAccount\", \"Barangay\");\n//\t\t\tThread.sleep(1000);\n\n\t\t\tsendKeys(\"CreateAccount\", \"EnterBarangay\", Constant.Barangay);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.Barangay + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\t\t\tThread.sleep(1000);\n\t\t\tControl.takeScreenshot();\n\t\t\tscrollToText(\"This Address\"); // Add This Address || Save This Address\n\t\t\tThread.sleep(2000);\n\t\t\tclick(\"CreateAccount\", \"ZipCode\");\n\t\t\tsendKeys(\"CreateAccount\", \"ZipCode\", Constant.ZipCode);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void validate(DataRecord value) {\n\r\n\t}", "public Address validate(Client client, String address) throws BytomException {\n\t\t\tMap<String, Object> req = new HashMap<String, Object>();\n\t\t\treq.put(\"address\", address);\n\t\t\treturn client.request(\"validate-address\", req, Address.class);\n\t\t}", "private void validateFields(){\n String email = edtEmail.getText().toString().trim();\n String number=edtPhone.getText().toString().trim();\n String cc=txtCountryCode.getText().toString();//edtcc.getText().toString().trim();\n String phoneNo=cc+number;\n // Check for a valid email address.\n\n\n if (TextUtils.isEmpty(email)) {\n mActivity.showSnackbar(getString(R.string.error_empty_email), Toast.LENGTH_SHORT);\n return;\n\n } else if (!Validation.isValidEmail(email)) {\n mActivity.showSnackbar(getString(R.string.error_title_invalid_email), Toast.LENGTH_SHORT);\n return;\n\n }\n\n if(TextUtils.isEmpty(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_empty_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n if(!Validation.isValidMobile(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_title_invalid_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n\n if(selectedCurrency==null){\n //mActivity.showSnackbar(getString(R.string.str_select_currency), Toast.LENGTH_SHORT);\n Snackbar.make(getView(),\"Currency data not found!\",Snackbar.LENGTH_LONG)\n .setAction(\"Try again\", new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n getAllCurrency();\n }\n }).show();\n return;\n }\n try {\n JsonObject object = new JsonObject();\n object.addProperty(KEY_EMAIL, email);\n object.addProperty(KEY_PHONE,phoneNo);\n object.addProperty(KEY_CURRENCY,selectedCurrency.getId().toString());\n updateUser(object,token);\n }catch (Exception e){\n\n }\n\n }", "@Test\n\tpublic void validateAll() {\n\n\t\tgiven()\n\t\t.when()\n\t\t.get(\"https://restcountries.eu/rest/v2/all\")\n\t\t.then()\n\t\t.and().body(\"name\", hasItem(\"India\"))\n\t\t.and().body(\"find { d -> d.name == 'India' }.borders\", hasItem(\"CHN\"));\n\n\t\tString name = returnValueByKeys(\"India\", \"name\");\n\t\tString capital = returnValueByKeys(\"India\", \"capital\");\n\t\tString region = returnValueByKeys(\"India\", \"region\");\n\t\tString population = returnValueByKeys(\"India\", \"population\");\n\t\tList borders = returnValuesByKeys(\"India\", \"borders\");\n\n\t\tSystem.out.println(name + \" \" + capital + \" \" + region + \" \" + population);\n\t\tfor (Object border : borders) {\n\t\t\tSystem.out.print(border + \" \");\n\t\t}\n\n\t}", "private boolean isInfoValidate(){\n if(mEmailAddress.getText() == null || mEmailAddress.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_email_address);\n return false;\n }\n\n if(!mEmailAddress.getText().toString().contains(\"@\")){\n errorText = getString(R.string.register_warning_valid_email_address);\n return false;\n }\n\n// if(mRegionSpinner.getSelectedItemPosition() == Constant.NON_SELECT){\n// errorText = getString(R.string.register_warning_select_region);\n// return false;\n// }\n\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.HONG_KONG)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.HONGKONG_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n//\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.CHINA)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.CHINA_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n\n if(mPassword.getText() == null || mPassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_password);\n return false;\n }\n\n if(mRetypePassword.getText() == null || mRetypePassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_retype_password);\n return false;\n }\n\n if(!mPassword.getText().toString().equals(mRetypePassword.getText().toString())){\n errorText = getString(R.string.register_warning_not_the_same);\n return false;\n }\n\n if(!Utility.judgeContainsStr( mPassword.getText().toString())){\n errorText = getString(R.string.register_warning_contains_character);\n return false;\n }\n\n// if(!mPolicyCheckBox.isChecked()){\n// errorText = getString(R.string.register_warning_check_agreement);\n// return false;\n// }\n\n return true;\n }", "public void doPost(HttpServletRequest request,HttpServletResponse response)\r\n\t{\r\n\t\t String region=request.getParameter(\"6\");\r\n\t\t String username=request.getParameter(\"8\");\r\n\t\t region=rs.change(region);\r\n\t\t print.pl(\"region1;\"+region);\r\n\t\t us.controlRegion(region,username,\"Customer\",\"customer_region\",\"customer_username\");\r\n\t\t String fname=request.getParameter(\"3\");\r\n\t\t fname=rs.change(fname);\r\n\t\t String lname=request.getParameter(\"4\");\r\n\t\t lname=rs.change(lname);\r\n\t\t String s1=request.getParameter(\"Cemail-first\");\r\n\t\t s1=rs.change(s1);\r\n\t\t String s2=request.getParameter(\"Cemail-second\");\r\n\t\t s2=rs.change(s2);\r\n\t\t String email=s1+\"@\"+s2;\r\n\t\t String phone=request.getParameter(\"5\");\r\n\t\t phone=rs.change(phone);\r\n\t\t String address=request.getParameter(\"7\");\r\n\t\t address=rs.change(address);\r\n\t\t if(!fname.isEmpty()&&us.judge(fname,username,5,\"Customer\",\"customer_username\").equals(\"untrue\"))\r\n\t\t {\r\n\t\t\t \r\n\t\t\t hd.updateInfor(\"Customer\",\"customer_firstname\",fname,\"customer_username\",username); \r\n\t\t }\r\n\t\t if(!lname.isEmpty()&&us.judge(lname,username,6,\"Customer\",\"customer_username\").equals(\"untrue\"))\r\n\t\t {\r\n\t\t\t hd.updateInfor(\"Customer\",\"customer_lastname\",lname,\"customer_username\",username);\r\n\t\t }\r\n\t\t if((!s1.isEmpty())&&(!s2.isEmpty())&&us.judge(email,username,7,\"Customer\",\"customer_username\").equals(\"untrue\"))\r\n\t\t {\r\n\t\t hd.updateInfor(\"Customer\",\"customer_email\",email,\"customer_username\",username);\r\n\t\t }\r\n\t\t if(!phone.isEmpty()&&us.judge(phone,username,8,\"Customer\",\"customer_username\").equals(\"untrue\"))\r\n\t\t {\r\n\t\t hd.updateInfor(\"Customer\",\"customer_phone\",phone,\"customer_username\",username);\r\n\t\t }\r\n\t\t if(!address.isEmpty()&&us.judge(address,username,10,\"Customer\",\"customer_username\").equals(\"untrue\"))\r\n\t\t {\r\n\t\t hd.updateInfor(\"Customer\",\"customer_address\",address,\"customer_username\",username);\r\n\t\t }\r\n\t\t doGet(request,response);\r\n\t\t \r\n\t}", "private static boolean validateAddress(String address) {\n return !address.isEmpty();\n }", "public boolean isCityValid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtCity.getText().trim().length() > 0)\n\t\t return true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtCity.getText().trim().length() > 0) {\n\t\t\treturn true;\n\t\t}\n\t\ttxtCity.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"Town / City: This field is required.\"));\n\t}", "public static void validation() {\n\t\tif ((!textFieldName.getText().isEmpty()) && (!textField_FirstName.getText().isEmpty())\n\t\t\t\t&& (!textField_Town.getText().isEmpty()) && (!textField_Town.getText().isEmpty())) {\n\n\t\t\tif ((isValidEmailAddress(textField_Email.getText()) == true)) {\n\t\t\t\ttextField_Email.setBackground(Color.white);\n\t\t\t\tif ((force(textField_Mtp.getText()) > 82)) {\n\t\t\t\t\ttextField_Mtp.setBackground(Color.white);\n\t\t\t\t\tactionGiveServeur();\n\n\t\t\t\t} else {\n\t\t\t\t\tshowMessageDialog(null, \"Votre mot de passe est trop faible\");\n\t\t\t\t\ttextField_Mtp.setText(\"Mot de passe trop simple : changer le \");\n\t\t\t\t\ttextField_Mtp.setBackground(Color.RED);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextField_Email.setText(\"Email invalide\");\n\t\t\t\ttextField_Email.setBackground(Color.RED);\n\t\t\t\tshowMessageDialog(null, \"Email est invalide\");\n\t\t\t}\n\t\t} else {\n\n\t\t\tshowMessageDialog(null, \"Certain champs sont vide !\");\n\t\t}\n\t}", "public void mo38839a(BrandsValidation brandsValidation) {\n }", "private void validate() throws FlightCreationException {\n validateNotNull(\"number\", number);\n validateNotNull(\"company name\", companyName);\n validateNotNull(\"aircraft\", aircraft);\n validateNotNull(\"pilot\", pilot);\n validateNotNull(\"origin\", origin);\n validateNotNull(\"destination\", destination);\n validateNotNull(\"departure time\", scheduledDepartureTime);\n\n if (scheduledDepartureTime.isPast()) {\n throw new FlightCreationException(\"The departure time cannot be in the past\");\n }\n\n if (origin.equals(destination)) {\n throw new FlightCreationException(\"The origin and destination cannot be the same\");\n }\n }", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "private void onClickCreateAddressButton() {\n // Validate\n if (!formValidated()) {\n } else {\n\n ContentValues values = new ContentValues();\n values.put(\"address_form[id]\", \"\");\n values.put(\"address_form[first_name]\", name.getText().toString());\n values.put(\"address_form[last_name]\", family.getText().toString());\n values.put(\"address_form[address1]\", address.getText().toString());\n values.put(\"address_form[address2]\", postal_code.getText().toString());\n values.put(\"address_form[region]\", region_Id);\n values.put(\"address_form[city]\", city_Id);\n if (post_id != UNKNOWN_POSTAL_CODE) {\n values.put(\"address_form[postcode]\", post_id);\n } else {\n values.put(\"address_form[postcode]\", \"\");\n }\n values.put(\"address_form[phone]\", cellphone.getText().toString());\n values.put(\"address_form[is_default_shipping]\", 1);\n values.put(\"address_form[is_default_billing]\", 1);\n\n values.put(\"address_form[gender]\", gender_lable);\n\n\n triggerCreateAddress(createAddressUrl, values);\n }\n }", "@Test(priority = 5)\n\tpublic void verify_Weather_Data_Appears_OnSearching_By_City_StateCodeAndCountryCode() {\n\t\tWeatherAPI.getWeatherInfo(ReadWrite.getProperty(\"Noida_City_State_Country\"),\n\t\t\t\tConfigFileReader.getProperty(\"appid\"), 200);\n\n\t}", "@SuppressWarnings ({\"ThrowableInstanceNeverThrown\"})\r\n\tprivate void validate(@NotNull Building building) throws FlexPayExceptionContainer {\r\n\r\n\t\tFlexPayExceptionContainer container = new FlexPayExceptionContainer();\r\n\r\n\t\tif (building.getBuildingses().isEmpty()) {\r\n\t\t\tcontainer.addException(new FlexPayException(\"No address\", \"ab.error.building.no_number\"));\r\n\t\t}\r\n\r\n\t\tif (building.getDistrict() == null) {\r\n\t\t\tcontainer.addException(new FlexPayException(\"No district\", \"ab.error.building.no_district\"));\r\n\t\t}\r\n\r\n\t\tif (building.isNotNew()) {\r\n\t\t\tBuilding old = readFull(stub(building));\r\n\t\t\tsessionUtils.evict(old);\r\n\t\t\tif (!old.getDistrictStub().equals(building.getDistrictStub())) {\r\n\t\t\t\tcontainer.addException(new FlexPayException(\"District changed\", \"error.ab.building.district_changed\"));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// check that building has only one address on any streets\r\n\t\tdo {\r\n\t\t\tSet<Stub<Street>> streetStubs = set();\r\n\t\t\tfor (BuildingAddress address : building.getBuildingses()) {\r\n\t\t\t\tif (streetStubs.contains(address.getStreetStub())) {\r\n\t\t\t\t\tcontainer.addException(new FlexPayException(\"Two street address\", \"ab.error.building.street_address_duplicate\"));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tstreetStubs.add(address.getStreetStub());\r\n\t\t\t}\r\n\t\t} while (false);\r\n\r\n\t\t// check no other buildings has the same address\r\n\t\tfor (BuildingAddress address : building.getBuildingses()) {\r\n\t\t\tString number = address.getNumber();\r\n\t\t\tif (number == null) {\r\n\t\t\t\tlog.warn(\"Incorrect building address. Address number is null. Address: {}\", address);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tList<BuildingAddress> candidates = buildingsDaoExt.findBuildings(address.getStreetStub().getId(), number);\r\n\t\t\tcandidates = filter(candidates, address.getBuildingAttributes());\r\n\t\t\tif (!candidates.isEmpty() && (candidates.size() > 1 || !candidates.get(0).equals(address))) {\r\n\t\t\t\tString addressStr = \"\";\r\n\t\t\t\ttry {\r\n\t\t\t\t\taddressStr = addressService.getBuildingsAddress(stub(candidates.get(0)), null);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// do nothing\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcontainer.addException(new FlexPayException(\"Address already exists\", \"ab.error.building.address_already_exists\", addressStr));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (container.isNotEmpty()) {\r\n\t\t\tthrow container;\r\n\t\t}\r\n\t}", "public void validate() {}", "private boolean validateInputs(String iStart, String iEnd, String country, String type) {\n \thideErrors();\n \tint validStart;\n \tint validEnd;\n boolean valid = true;\n// \t//will not occur due to UI interface\n// if (isComboBoxEmpty(type)) {\n// \tvalid = false;\n// \tT3_type_error_Text.setVisible(true);\n// }\n if (isComboBoxEmpty(country)) {\n \tvalid = false;\n \tT3_country_error_Text.setVisible(true);\n }\n \t//checking if start year and end year are set\n if (isComboBoxEmpty(iStart)){\n //start is empty\n T3_start_year_error_Text.setVisible(true);\n valid = false;\n }\n if (isComboBoxEmpty(iEnd)){\n //end is empty\n T3_end_year_error_Text.setVisible(true);\n valid = false;\n }\n \tif (valid){\n //if years are not empty and valid perform further testing\n \t\t//fetch valid data range\n \tPair<String,String> validRange = DatasetHandler.getValidRange(type, country);\n \tvalidStart = Integer.parseInt(validRange.getKey());\n \tvalidEnd = Integer.parseInt(validRange.getValue());\n //check year range validity\n \t\tint start = Integer.parseInt(iStart);\n \t\tint end = Integer.parseInt(iEnd);\n \tif (start>=end) {\n \t\tT3_range_error_Text.setText(\"Start year should be < end year\");\n \t\tT3_range_error_Text.setVisible(true);\n \t\tvalid=false;\n \t}\n// \t//will not occur due to UI interface\n// \telse if (start<validStart) {\n// \t\tT3_range_error_Text.setText(\"Start year should be >= \" + Integer.toString(validStart));\n// \t\tT3_range_error_Text.setVisible(true);\n// \t\tvalid=false;\n// \t}else if (end>validEnd) {\n// \t\tT3_range_error_Text.setText(\"End year should be <= \" + Integer.toString(validEnd));\n// \t\tT3_range_error_Text.setVisible(true);\n// \t\tvalid=false;\n// \t}\n \t}\n// \t//will not occur due to UI interface\n// \tif(isComboBoxEmpty(type)) {\n// \t\t//if type is not set\n// T3_type_error_Text.setVisible(true);\n// \t}\n \t\n if(isComboBoxEmpty(country)) {\n //if country is not set\n T3_country_error_Text.setVisible(true);\n }\n \treturn valid;\n }", "void validate();", "void validate();", "public void SetCreditCarddetails(String ccnumber, String ccname, String ccmonth, String ccyear, String ccseccode){\r\n\t\tString countrygroup_ccdetails= \"UK,PresselAustria\";\r\n\t\tString CCnum = getValue(ccnumber);\r\n\t\tString CCName = getValue(ccname);\r\n\t\tString CCMonth = getValue(ccmonth);\r\n\t\tString CCYear = getValue(ccyear);\r\n\t\tString CCSecCode = getValue(ccseccode);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+CCnum+\", \"+CCName+\", \"+CCMonth+\", \"+CCYear+\", \"+CCSecCode);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The CreditCard details should be entered\");\r\n\t\ttry{\r\n\t\t\tif(!(countrygroup_ccdetails).contains(countries.get(countrycount))){\r\n\t\t\t\tswitchframe(\"TokenizationPage\");\r\n\t\t\t\tsleep(2000);\r\n\t\t\t\tsendKeys(locator_split(\"txtCCnumber\"), CCnum);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCname\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCname\"), CCName);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCMonth\"), CCMonth);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCYear\"), CCYear);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCcode\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCcode\"), CCSecCode);\t\t\t\t\t\t\r\n\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The CreditCard details are entered\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The new CreditCard details are applicable to this \" +country);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- The CreditCard details are not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"One of the element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCnumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCname\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCMonth\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCYear\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCcode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" are not found\");\r\n\r\n\t\t}\r\n\t}", "@Test\n public void iPAddressGeolocateStreetAddressTest() throws Exception {\n String value = null;\n GeolocateStreetAddressResponse response = api.iPAddressGeolocateStreetAddress(value);\n\n // TODO: test validations\n }", "private void ValidateEditTextFields() {\n\tfor (int i = 0; i < etArray.length; i++) {\n\t if (etArray[i].getText().toString().trim().length() <= 0) {\n\t\tvalidCustomer = false;\n\t\tetArray[i].setError(\"Blank Field\");\n\t }\n\t}\n\n\tif (etPhoneNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etPhoneNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (etEmergencyNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etEmergencyNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (calendarDob == null) {\n\t validCustomer = false;\n\t}\n }", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "void validate(N ndcRequest, ErrorsType errorsType);", "private int completionCheck() {\n if (nameTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(1);\n return -1;\n }\n if (addressTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(2);\n return -1;\n }\n if (postCodeTB.getText().trim().isEmpty()){\n AlertMessage.addCustomerError(3);\n return -1;\n }\n if (countryCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(4);\n return -1;\n }\n if (stateProvinceCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(5);\n return -1;\n }\n if (phone.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(6);\n return -1;\n }\n return 1;\n }", "private boolean validateObjectForDB() {\n\t\tboolean l_ret = true;\n\t\tif (m_country_name.equals(\"\")) {\n\t\t\tm_error_string = \"Unable to add the country. Country name is required.\";\n\t\t\tl_ret = false;\n\t\t}\n\t\treturn (l_ret);\n\t}", "void validate(T regData, Errors errors);", "@RequestMapping(value = \"/addBillingAddress\", method = RequestMethod.POST)\r\n @ResponseBody\r\n public String addBillingAddress(\r\n \t\t@RequestParam(\"fullName\") String fullName, \r\n \t\t@RequestParam(\"landMark\") String landMark, \r\n \t\t@RequestParam(\"mobileNumber\") String mobileNumber,\r\n \t\t@RequestParam(\"city\") String city,\r\n \t\t@RequestParam(\"type\") String type)\r\n {\r\n OrderItem orderItem = simpleWorksDashboardManager.addBillingAddress(fullName, landMark, mobileNumber, city, type);\r\n return \"{\\\"status\\\": true}\";\r\n }", "public static Address createInvalidAddressFixture() {\n Map<String, Object> objectMap = new HashMap<String, Object>();\n objectMap.put(\"name\", \"Undefault New Wu\");\n objectMap.put(\"street1\", \"Clayton St.\");\n objectMap.put(\"street_no\", \"215215\");\n objectMap.put(\"street2\", null);\n objectMap.put(\"city\", \"San Francisco\");\n objectMap.put(\"state\", \"CA\");\n objectMap.put(\"zip\", \"94117\");\n objectMap.put(\"country\", \"US\");\n objectMap.put(\"phone\", \"+1 555 341 9393\");\n objectMap.put(\"email\", \"[email protected]\");\n objectMap.put(\"is_residential\", false);\n objectMap.put(\"metadata\", \"Customer ID 123456\");\n objectMap.put(\"validate\", true);\n\n try {\n return Address.create(objectMap);\n } catch (ShippoException e) {\n e.printStackTrace();\n }\n return null;\n }", "private String validarEntradas()\n { \n return Utilitarios.validarEntradas(campoNomeAC, campoEnderecoAC, campoBairroAC, campoCidadeAC, campoUfAC, campoCepAC, campoTelefoneAC, campoEmailAC);\n }", "public void validate_the_Account_Number_in_Customer_Account_Summary_of_Customer_Tab(String AccountNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Account Number\").replaceAll(\"M_InnerText\", AccountNumber), \"Account Number - \"+AccountNumber, false);\n\t\tReport.fnReportPageBreak(\"Customer Account Summary\", driver);\n\t}", "@Test\n public void testCreateLabelInvoiceBarcode_AddressValidation_Failure()\n {\n \t\n \ttry {\n \t\t\n \t\tlogger.info(\"Testing creation of label, invoice and barcode for failure scenario .\");\n \t\tString fileName = \"./com/cts/ptms/carrier/yrc/resources/InputData_Standard_AddressValidation_Failure.xml\";\n\t \tURL url = getClass().getClassLoader().getResource(fileName);\n\t\t\tshipmentRequest.setFileName(url.getFile());\n \t\tshipmentRequest.setCarrier(\"YRC\");\n\t \tshipmentRequest.setGenLabel(true);\n\t \tshipmentResponse = yrcSoapClient.createShipmentRequest(shipmentRequest);\n\t \tlogger.info(\"Status:\"+shipmentResponse );\n\t \t\n\t \tassertEquals(\"ERROR\", shipmentResponse.getStatus());\n\t\t\t\n \t} \n\t\tcatch(Exception e)\n\t\t{\n\t\t\tassertEquals(\"Failure\", \"Failure\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Exception occured\"+e.getMessage());\n\t\t}\n \t\n }", "boolean validateAccount(String Account) {\n\t\treturn true;\n\n\t}", "public PersonInfo addPerson(PersonInfo p) {\n\t\tlog.info(\"Enter First Name\");\n\t\tString fname = obj.next();\n\t\tlog.info(\"Enter Last Name\");\n\t\tString lname = obj.next();\n\t\tlog.info(\"Enter Address\");\n\t\tString address = obj.next();\n\t\tlog.info(\"Enter City\");\n\t\tString city = obj.next();\n\t\tlog.info(\"Enter State\");\n\t\tString state = obj.next();\n\t\tlog.info(\"Enter the six digit Zip Code\");\n\t\tString zipCode = obj.next();\n\t\tString pattern3 = \"^[1-9]{1}[0-9]{5}$\";\n\t\tPattern zip_pattern = Pattern.compile(pattern3);\n\t\tMatcher m3 = zip_pattern.matcher(zipCode);\n\t\tif (m3.matches() == false) {\n\t\t\tlog.info(\"zip code not in format enter again\");\n\t\t\tzipCode = obj.next();\n\t\t}\n\t\tlog.info(\"Enter the ten digit Phone Number\");\n\t\tString phoneNo = obj.next();\n\t\tString pattern1 = \"^[1-9]{1}[0-9]{9}$\";\n\t\tPattern mobile_pattern = Pattern.compile(pattern1);\n\t\tMatcher m1 = mobile_pattern.matcher(phoneNo);\n\t\tif (m1.matches() == false) {\n\t\t\tlog.info(\"phone number not in format enter again\");\n\t\t\tphoneNo = obj.next();\n\t\t}\n\t\tlog.info(\"Enter Email\");\n\t\tString email = obj.next();\n\t\tString pattern2 = \"^[a-zA-Z0-9]+((\\\\.[0-9]+)|(\\\\+[0-9]+)|(\\\\-[0-9]+)|([0-9]))*@*+[a-zA-Z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\";\n\t\tPattern email_sample = Pattern.compile(pattern2);\n\t\tMatcher m2 = email_sample.matcher(email);\n\t\tif (m2.matches() == false) {\n\t\t\tlog.info(\"email not in format enter again\");\n\t\t\temail = obj.next();\n\t\t}\n\t\tp = new PersonInfo(fname, lname, address, city, state, zipCode, phoneNo, email);\n\t\treturn p;\n\t}", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}" ]
[ "0.67349726", "0.67109287", "0.66337943", "0.6616716", "0.6460389", "0.64523256", "0.64117247", "0.63889146", "0.63617057", "0.6351759", "0.6341175", "0.6322249", "0.6293465", "0.6275753", "0.6248613", "0.6245235", "0.62131107", "0.61928326", "0.61899674", "0.6186633", "0.61774075", "0.6096922", "0.6085404", "0.6079711", "0.6079006", "0.5992208", "0.59892845", "0.59865916", "0.59784853", "0.596171", "0.5905805", "0.58913094", "0.58365864", "0.5828916", "0.5825278", "0.5812495", "0.57969433", "0.57809854", "0.57528543", "0.57242703", "0.5693599", "0.569236", "0.56842285", "0.5673426", "0.56512", "0.5639488", "0.56066275", "0.55976725", "0.55829775", "0.5582581", "0.55777085", "0.5552983", "0.5547134", "0.55397767", "0.55321753", "0.5521214", "0.5521214", "0.5511819", "0.54814804", "0.5459486", "0.5458173", "0.54534", "0.5452007", "0.5448868", "0.5448384", "0.5428091", "0.5427694", "0.54274255", "0.5421814", "0.54128945", "0.541267", "0.54057765", "0.5401247", "0.53955656", "0.5392486", "0.5383929", "0.5363892", "0.53532755", "0.5345379", "0.53431034", "0.5343025", "0.5333599", "0.5327529", "0.5327529", "0.5322929", "0.53213835", "0.5314855", "0.53089213", "0.53029895", "0.52971226", "0.5292146", "0.52817136", "0.5279617", "0.5276774", "0.5273471", "0.5260938", "0.52597445", "0.52492136", "0.52486897", "0.5248266" ]
0.7156989
0
Validation Functions Description : To validate the Address Line 2 of Correspondence Address in Customer Tab Coded by :Rajan Created Data:21 Oct 2016 Last Modified Date: Modified By: Parameter:
public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll("M_Header", "Billing Address").replaceAll("M_Category", "Country").replaceAll("M_InnerText", Country), "Country of Billing Address - "+Country, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_2_of_Correspondence_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Correspondence Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Installation Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "public boolean isAddressLine1Valid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtAddressLine1.getText().trim().length() > 0)\n\t\t\t\treturn true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtAddressLine1.getText().trim().length() > 0) {\n\t\t\t\treturn true;\n\t\t}\n\t\ttxtAddressLine1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"AddressLine1: This field is required.\"));\n\t}", "public boolean isAddressLine2Valid() throws BusinessRuleException {\n\t\treturn true;\n\t}", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "abstract void addressValidity();", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Installation Address - \"+Postcode, false);\n\t}", "public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Billing Address - \"+Postcode, false);\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "public void setAddressline2(String addressline2) {\n this.addressline2 = addressline2;\n }", "public abstract String getAddressLine2();", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "public void setAddressLine2(String addressLine2) {\n this.addressLine2 = addressLine2;\n }", "public abstract String getAddressLine1();", "public Address validate(Client client, String address) throws BytomException {\n\t\t\tMap<String, Object> req = new HashMap<String, Object>();\n\t\t\treq.put(\"address\", address);\n\t\t\treturn client.request(\"validate-address\", req, Address.class);\n\t\t}", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "private void validateLine1304(Errors errors) {\n }", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }", "public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Installation Address - \"+Country, false);\n\t}", "public void validate_the_Town_City_of_Correspondence_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Correspondence Address - \"+TownCity, false);\n\t}", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public boolean validateContactAddress(String contactId, List<String> result)\n {\n return true;\n }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public void setAddressline1(String addressline1) {\n this.addressline1 = addressline1;\n }", "public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tif(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity, false))\n\t\t{\n\t\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity);\n\t\t}\n\t\t\n\t}", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "public static Address addAddress() {\r\n\r\n\t\tSystem.out.println(\"Please enter the building number of the supplier:\");\r\n\r\n\t\tint bldNum = Validation.intValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the supplier's street name:\");\r\n\t\tString bldStreet = Validation.stringNoIntsValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the town the supplier is in:\");\r\n\t\tString bldTown = Validation.stringNoIntsValidation();\t\t\r\n\r\n\t\tSystem.out.println(\"Please enter the postcode for the supplier:\");\r\n\t\tString bldPCode = Validation.stringValidation();\r\n\r\n\t\tSystem.out.println(\"Please enter the country the supplier is in:\");\r\n\t\tString bldCountry = Validation.stringNoIntsValidation();\r\n\r\n\t\tAddress newAddress = new Address(bldNum, bldStreet, bldTown, bldPCode, bldCountry);\r\n\r\n\t\treturn newAddress;\r\n\r\n\t}", "public void setAddressLine1(String addressLine1) {\n this.addressLine1 = addressLine1;\n }", "public void validate(DataRecord value) {\n\r\n\t}", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "public String getAddressLine2() {\n return addressLine2;\n }", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Installation Address - \"+TownCity);\n\t\t\t\n\t\t\t\n\t\t\n\t}", "private void validateData() {\n }", "public void validate_the_Email_Address_2_of_Security_in_Customer_Tab(String EmailAddress2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 2\").replaceAll(\"M_InnerText\", EmailAddress2), \"Email Address 2 - \"+EmailAddress2, false);\n\t}", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "private Map<String,String> getValidatedAddressInfo(Map<String,String> params) throws ClientProtocolException, IOException \n\t{\n\t\t// Create unique form parameters\n\t\tList<NameValuePair> uniqueParams = new ArrayList<NameValuePair>();\n\t\tuniqueParams.add(new BasicNameValuePair(\"__LASTFOCUS\", \"\"));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__VIEWSTATE\", params.get(\"ViewState\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__EVENTVALIDATION\", params.get(\"EventValidation\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetNumber\", params.get(\"StreetNumber\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetName\", params.get(\"StreetName\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"EnterButton\", \"Enter\"));\n\t\t\n\t\t//get the HTML from the FCPS boundary locator web site\n\t\tString responseHtml = getFCPSBoundaryLocatorHTML(uniqueParams);\n\t\t\n\t\tif(responseHtml == null || responseHtml.isEmpty() || responseHtml.startsWith(\"Error\"))\n\t\t{\n\t\t\tMap<String, String> errMap = new HashMap<String,String>();\n\t\t\terrMap.put(\"Error\", \"Failed Post\");\n\t\t\treturn errMap;\n\t\t}\n\t\telse\t //scrape the HTML to obtain the validated address map\n\t\t\treturn scrapeValidatedAddressHTML(responseHtml.toString());\n\t}", "public abstract void setAddressLine2(String sValue);", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validate_the_Email_Address_1_of_Security_in_Customer_Tab(String EmailAddress1)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 1\").replaceAll(\"M_InnerText\", EmailAddress1), \"Email Address 1 - \"+EmailAddress1, false);\n\t}", "public void validateAdress(String adress) {\r\n\t\tthis.isAdressValid = model.isValidAdress(adress);\r\n\r\n\t\tif (this.isAdressValid) {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: green;\");\r\n\t\t\tcheckButtonUnlock();\r\n\t\t} else {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: red;\");\r\n\t\t\tlockButton();\r\n\t\t}\r\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public String getAddressline2() {\n return addressline2;\n }", "public String getAddressLine1() {\n return addressLine1;\n }", "@Test(enabled = true)\n @UsingDataSet({\"datasets/base_data.xls\", \"datasets/data.xls\"})\n public void testEditAddressCase2() throws Exception {\n final String addrCode = \"30011400002\";\n final Address address = this.addressRepository.getAddressByAddressCode(addrCode);\n final ServiceResult<AddressDto> result = this.addressService.editAddress(address);\n\n Assert.assertNull(result);\n }", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public abstract void setAddressLine1(String sValue);", "public void validateRpd13s2()\n {\n // This guideline cannot be automatically tested.\n }", "@Test( dataProvider=\"AddressValidationTestData\", groups ={\"BillingAddressValidations\"})\r\n\r\n\tpublic static void AddNewBillingAddress(String[] BillingAddressDetailsInArray){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tAssert.assertEquals( launchAndValidateDifferentBillingAddresses(BillingAddressDetailsInArray) ,true) ;\t\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\t\t\r\n\t}", "void addressValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n }", "public com.apatar.cdyne.ws.demographix.SummaryInformation getLocationInformationByAddress(java.lang.String addressLine1, java.lang.String city, java.lang.String stateAbbrev, java.lang.String zipCode, java.lang.String licenseKey) throws java.rmi.RemoteException;", "@Test\n public void testCreateLabelInvoiceBarcode_AddressValidation_Failure()\n {\n \t\n \ttry {\n \t\t\n \t\tlogger.info(\"Testing creation of label, invoice and barcode for failure scenario .\");\n \t\tString fileName = \"./com/cts/ptms/carrier/yrc/resources/InputData_Standard_AddressValidation_Failure.xml\";\n\t \tURL url = getClass().getClassLoader().getResource(fileName);\n\t\t\tshipmentRequest.setFileName(url.getFile());\n \t\tshipmentRequest.setCarrier(\"YRC\");\n\t \tshipmentRequest.setGenLabel(true);\n\t \tshipmentResponse = yrcSoapClient.createShipmentRequest(shipmentRequest);\n\t \tlogger.info(\"Status:\"+shipmentResponse );\n\t \t\n\t \tassertEquals(\"ERROR\", shipmentResponse.getStatus());\n\t\t\t\n \t} \n\t\tcatch(Exception e)\n\t\t{\n\t\t\tassertEquals(\"Failure\", \"Failure\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Exception occured\"+e.getMessage());\n\t\t}\n \t\n }", "public String getAddressline1() {\n return addressline1;\n }", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "public void testSetLine2_EmptyString() {\r\n try {\r\n address.setLine2(\" \");\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "private void validateUpdateCustomers(List<CustomersInputDTO> customers, String formatDate) {\n // inner validate\n if (customers == null || customers.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(ConstantsCustomers.CUSTOMERS, Constants.RIQUIRED_CODE));\n }\n // validate common\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n List<Map<String, Object>> customParams = new ArrayList<>();\n customers.forEach(cus -> {\n Map<String, Object> customField = new HashMap<>();\n customField.put(\"rowId\", cus.getCustomerId());\n customField.putAll(buildParamsValidateCustomersInput(cus, jsonBuilder));\n customParams.add(customField);\n });\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n customParams, formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n List<Map<String, Object>> listValidate = CustomersCommonUtil.validateCommon(validateJson, restOperationUtils,\n token, tenantName);\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "EntityAddInfo validateAddrAndSaveEntity(Record inputRecord, boolean shouldSaveActivityHist);", "private static boolean validateAddress(String address) {\n return !address.isEmpty();\n }", "public void validateRpd1s2()\n {\n // This guideline cannot be automatically tested.\n }", "void validate();", "void validate();", "public void validate() {}", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "public com.apatar.cdyne.ws.demographix.PlaceInfo getPlaceIDbyAddress(java.lang.String addressLine1, java.lang.String city, java.lang.String stateAbbrev, java.lang.String zipCode, java.lang.String licenseKey) throws java.rmi.RemoteException;", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }", "public PersonInfo addPerson(PersonInfo p) {\n\t\tlog.info(\"Enter First Name\");\n\t\tString fname = obj.next();\n\t\tlog.info(\"Enter Last Name\");\n\t\tString lname = obj.next();\n\t\tlog.info(\"Enter Address\");\n\t\tString address = obj.next();\n\t\tlog.info(\"Enter City\");\n\t\tString city = obj.next();\n\t\tlog.info(\"Enter State\");\n\t\tString state = obj.next();\n\t\tlog.info(\"Enter the six digit Zip Code\");\n\t\tString zipCode = obj.next();\n\t\tString pattern3 = \"^[1-9]{1}[0-9]{5}$\";\n\t\tPattern zip_pattern = Pattern.compile(pattern3);\n\t\tMatcher m3 = zip_pattern.matcher(zipCode);\n\t\tif (m3.matches() == false) {\n\t\t\tlog.info(\"zip code not in format enter again\");\n\t\t\tzipCode = obj.next();\n\t\t}\n\t\tlog.info(\"Enter the ten digit Phone Number\");\n\t\tString phoneNo = obj.next();\n\t\tString pattern1 = \"^[1-9]{1}[0-9]{9}$\";\n\t\tPattern mobile_pattern = Pattern.compile(pattern1);\n\t\tMatcher m1 = mobile_pattern.matcher(phoneNo);\n\t\tif (m1.matches() == false) {\n\t\t\tlog.info(\"phone number not in format enter again\");\n\t\t\tphoneNo = obj.next();\n\t\t}\n\t\tlog.info(\"Enter Email\");\n\t\tString email = obj.next();\n\t\tString pattern2 = \"^[a-zA-Z0-9]+((\\\\.[0-9]+)|(\\\\+[0-9]+)|(\\\\-[0-9]+)|([0-9]))*@*+[a-zA-Z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\";\n\t\tPattern email_sample = Pattern.compile(pattern2);\n\t\tMatcher m2 = email_sample.matcher(email);\n\t\tif (m2.matches() == false) {\n\t\t\tlog.info(\"email not in format enter again\");\n\t\t\temail = obj.next();\n\t\t}\n\t\tp = new PersonInfo(fname, lname, address, city, state, zipCode, phoneNo, email);\n\t\treturn p;\n\t}", "public void validateRpd14s1()\n {\n // This guideline cannot be automatically tested.\n }", "private static JSONObject validateStreet(String street, String city, String state, String zip) throws Exception {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n//\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n//\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n//\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n//\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\n\t\treturn addrKeyFormat;\n\t}", "public void enterAddress2() throws IOException {\n\t\tLoginSignupCompanyPage sp = new LoginSignupCompanyPage(driver);\n\t\tlog.info(\"Verifying the Address2 is available or not\");\n\t\tAssert.assertTrue(enterAddress2.isDisplayed());\n\t\tenterAddress2.sendKeys(BasePage.getCellData(xlsxName, sheetName, 15, 0));\n\n\t}", "public void setAddressLine2(String value) {\n setAttributeInternal(ADDRESSLINE2, value);\n }", "public void validateRpd22s2()\n {\n // This guideline cannot be automatically tested.\n }", "public static Boolean validateInput(String str) {\n String[] lines = str.split(\"\\n\");\r\n // System.out.println(\"lines array:\"+lines.length);\r\n Boolean validate = true;\r\n String[] lineParameters;\r\n int countFor =0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n\r\n if (lineParameters.length != 5) {\r\n validate = false;\r\n break;\r\n }\r\n }\r\n countFor++;\r\n \r\n\r\n }\r\n return validate;\r\n }", "@SuppressWarnings(\"unused\")\n\t@Test(groups = {\"All\", \"Regression\"})\n\t@AdditionalInfo(module = \"OpenEVV\")\n\tpublic void TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid() throws InterruptedException, java.text.ParseException, IOException, ParseException, ConfigurationException, SQLException\n\t{\n\n\t\t// logger = extent.startTest(\"TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid\");\n\n\t\tlogger.log(LogStatus.INFO, \"To validate valid TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid\");\n\n\t\tJSONArray jsonarray=GenerateUniqueParam.XrefParams(globalVariables.xref_json);\n\t\tJSONObject jsonobject = (JSONObject) jsonarray.get(0);\n\t\tjsonobject.put(\"EmployeeQualifier\", CommonMethods.generateRandomNumberOfFixLength(7));\n\t\tjsonobject.put(\"ClientIDQualifier\", CommonMethods.generateRandomNumberOfFixLength(7));\n\n\n\t\tString bodyAsString = CommonMethods.capturePostResponse(jsonarray, CommonMethods.propertyfileReader(globalVariables.openevv_xref_url));\n\t\tCommonMethods.verifyjsonassertFailcase(bodyAsString, globalVariables.ClientidQualifierFormatError);\n\t\tCommonMethods.verifyjsonassertFailcase(bodyAsString, globalVariables.EmployeeidQualifierFormatError);\n\n\n\t}", "public void testSetLine1_EmptyString() {\r\n try {\r\n address.setLine1(\" \");\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "public void createBillingAddress() throws Exception{\n\t\t\n\t\ttype(firstNameTextBox,\"bob\");\n\t\ttype(lastNameTextBox,\"test\");\n\t\ttype(addressLine1TextBox,\"2716 Ocean Park Blvd Suite 1030\");\n\t\ttype(addressLine2TextBox,\"test house\");\n\t\ttype(cityTextBox,\"Santa Monica\");\n\t\ttype(zipcodeTextBox,\"90405\");\n\t\tselect(stateSelectBox,8);\n\t\ttype(phoneTextField,\"6666654686\");\n\t\ttype(companyTextField,\"test company\");\n\t\n\t}", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public Address line2(String line2) {\n this.line2 = line2;\n return this;\n }", "public boolean isAddressValid(String address) {\n\t\tString pattern = \"(^\\\\d+(w|e|s|n)\\\\d+\\\\s\\\\w+\\\\s\\\\w+\\\\.)\";\n\t\tboolean isMatch = Pattern.matches(pattern, address);\n return isMatch;\n }", "public void testSetLine1_NullString() {\r\n try {\r\n address.setLine1(null);\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }" ]
[ "0.76864827", "0.7659875", "0.7594216", "0.7548866", "0.7337662", "0.7305628", "0.6580359", "0.65395033", "0.64060223", "0.6390108", "0.63359535", "0.6296607", "0.6249532", "0.61460656", "0.60857475", "0.60686636", "0.60668683", "0.60459197", "0.60330266", "0.59919834", "0.59785587", "0.59649694", "0.59588397", "0.59438765", "0.5927212", "0.59057677", "0.5900841", "0.58921224", "0.5880437", "0.5858493", "0.5850527", "0.58389205", "0.582986", "0.58130264", "0.57945484", "0.57883954", "0.5766191", "0.57528704", "0.5737532", "0.571462", "0.5711612", "0.56868255", "0.5672954", "0.5663774", "0.56623465", "0.5656271", "0.56417084", "0.5638858", "0.5629842", "0.5622437", "0.561417", "0.5612049", "0.5612049", "0.5610414", "0.56094444", "0.55789644", "0.5564806", "0.55318695", "0.55132025", "0.5509186", "0.55060995", "0.5493806", "0.54563177", "0.5450374", "0.5444419", "0.5433465", "0.5428938", "0.54282784", "0.5421402", "0.54059136", "0.5395793", "0.5380777", "0.53784317", "0.53729635", "0.537111", "0.5367334", "0.5341728", "0.5338512", "0.5326027", "0.5326027", "0.53218263", "0.5316325", "0.531603", "0.5315524", "0.5309956", "0.5307427", "0.53013", "0.52990484", "0.5293175", "0.52863646", "0.52660197", "0.52652836", "0.5251337", "0.52503383", "0.5222017", "0.52206993", "0.5220324", "0.5211545", "0.5211429", "0.52099997" ]
0.59070057
25
Validation Functions Description : To validate the Postcode of Billing Address in Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:05 Oct 2016 Modified By:Raja Parameter:Postcode
public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll("M_Header", "Billing Address").replaceAll("M_Category", "Postcode").replaceAll("M_InnerText", Postcode), "Postcode of Billing Address - "+Postcode, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Installation Address - \"+Postcode, false);\n\t}", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "public String CheckPostCode (HashMap<String, ?> InputObj) throws NoSuchElementException {\n\t\tString outRetVal = \"-1\";\n\t\t\n\t\tString inCountryCode = InputObj.get(\"CountryCode\").toString();\n\t\tString inPostCode = InputObj.get(\"PostCode\").toString();\n\t\t\n\t\tCustSiteEditorObj Obj = new CustSiteEditorObj(webdriver);\n\t\t\n\t\tWebElement TxtCountryCode = Obj.getTxtCountryCode();\n\t\tif (!TxtCountryCode.getAttribute(\"value\").equals(inCountryCode)) {\n\t\t\tTxtCountryCode.clear();\n\t\t\tTxtCountryCode.sendKeys(inCountryCode);\n\t\t\tWebElement TxtPostCode = Obj.getTxtPostCode();\n\t\t\tTxtPostCode.click();\n\t\t}\n\t\t\n\t\tboolean isCountryCodeMsgExist = SeleniumUtil.isWebElementExist(webdriver, Obj.getLblCountryCodeMessageLocator(), 1);\n\t\tif (isCountryCodeMsgExist) {\n\t\t\tWebElement LblCountryCodeMessage = Obj.getLblCountryCodeMessage();\n\t\t\tboolean isVisible = LblCountryCodeMessage.isDisplayed();\n\t\t\tif (isVisible) {\n\t\t\t\tCommUtil.logger.info(\" > Msg: \"+LblCountryCodeMessage.getText());\n\t\t\t\tif (CommUtil.isMatchByReg(LblCountryCodeMessage.getText(), \"Only 2 characters\")) {\n\t\t\t\t\toutRetVal = \"1\";\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t} else {\n\t\t\t\t\tCommUtil.logger.info(\" > Unhandled message.\");\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tWebElement TxtPostCode = Obj.getTxtPostCode();\n\t\tif (!TxtPostCode.getAttribute(\"value\").equals(inPostCode)) {\n\t\t\tTxtPostCode.clear();\n\t\t\tTxtPostCode.sendKeys(inPostCode);\n\t\t\tTxtCountryCode = Obj.getTxtCountryCode();\n\t\t\tTxtCountryCode.click();\n\t\t}\t\n\t\t\n\t\tboolean isPostCodeMsgExist = SeleniumUtil.isWebElementExist(webdriver, Obj.getLblPostCodeMessageLocator(), 1);\n\t\tif (isPostCodeMsgExist) {\n\t\t\tWebElement LblPostCodeMessage = Obj.getLblPostCodeMessage();\n\t\t\tboolean isVisible = LblPostCodeMessage.isDisplayed();\n\t\t\tif (isVisible) {\n\t\t\t\tCommUtil.logger.info(\" > Msg: \"+LblPostCodeMessage.getText());\n\t\t\t\tif (CommUtil.isMatchByReg(LblPostCodeMessage.getText(), \"Only 5 digits\")) {\n\t\t\t\t\toutRetVal = \"2\";\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t} else if (CommUtil.isMatchByReg(LblPostCodeMessage.getText(), \"Only alpha numeric dash space\")) {\n\t\t\t\t\toutRetVal = \"3\";\n\t\t\t\t\treturn outRetVal;\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tCommUtil.logger.info(\" > Unhandled message.\");\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\toutRetVal = \"0\";\n\t\treturn outRetVal;\n\t\t\n\t}", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "@Test\n public void testIncorrectPostalCode(){\n UserRegisterKYC tooLong = new UserRegisterKYC(\"hello\",validId3,\"30/03/1995\",\"7385483\");\n int requestResponse = tooLong.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC tooShort = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"48532\");\n requestResponse = tooShort.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC startWith74 = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"746532\");\n requestResponse = startWith74.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC startWithMoreThan82 = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"967532\");\n requestResponse = startWithMoreThan82.sendRegisterRequest();\n assertEquals(400,requestResponse);\n }", "public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Billing Address - \"+Country, false);\n\t}", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "public void zipCodeFieldTest() {\r\n\t\tif(Step.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\", 10)) {\r\n\t\t\t\r\n\t\t\t//Verifies the zip code field populates with the user's zip code\r\n\t\t\tString zipInputBoxTextContent = \r\n\t\t\t\t\tStep.Extract.getContentUsingJS(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Field\");\r\n\t\t\tif(zipInputBoxTextContent.isEmpty()) {\r\n\t\t\t\tStep.Failed(\"Zip Code Field is empty\");\r\n\t\t\t} else {\r\n\t\t\t\tStep.Passed(\"Zip Code Field populated with user's location\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Verifies special characters aren't accepted\r\n\t\t\tStep.Wait.forSeconds(1);\r\n\t\t\tStep.Action.typeText(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\", \"!@#$%\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote Button\");\r\n\t\t\tStep.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeInValidInputLocator,\r\n\t\t\t\t\t\"Zip Code Field shows invalid input\", 10);\r\n\t\t\t\r\n\t\t\t//Veriies invalid zip codes aren't accepted\r\n\t\t\tStep.Action.typeText(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip code Input field\", \"00000\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote button\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote button\");\r\n\t\t\tStep.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeInValidInputLocator,\r\n\t\t\t\t\t\"Zip Code Field shows invalid input\", 10);\r\n\t\t\t\r\n\t\t\t//Verifies that only 5 digits are accepted\r\n\t\t\tStep.Action.typeText(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\", \"1234567\");\r\n\t\t\tzipInputBoxTextContent = Step.Extract.getContentUsingJS(QuoteForm_ComponentObject.zipCodeFieldLocator,\r\n\t\t\t\t\t\"Zip code text box\");\r\n\t\t\tif(zipInputBoxTextContent.length() > 5) {\r\n\t\t\t\tStep.Failed(\"Zip Code Input Field contains more than 5 digits\");\r\n\t\t\t} else {\r\n\t\t\t\tStep.Passed(\"Zip Code Input Field does not accept more than 5 digits\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Verifies user cannot submit a blank zip code\r\n\t\t\tStep.Action.clear(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote Button\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote Button\");\r\n\t\t\tStep.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeInValidInputLocator,\r\n\t\t\t\t\t\"Zip Code Input Field shows invalid input\", 10);\r\n\t\t\t\r\n\t\t\t//Verifies that a valid input is accepted\r\n\t\t\tStep.Action.typeText(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\", \"48146\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote Button\");\r\n\t\t\tStep.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeValidInputLocator,\r\n\t\t\t\t\t\"Zip Code Field displays as valid input\", 10);\r\n\t\t}\r\n\t}", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "abstract void addressValidity();", "@Test\n public void postalCodeTest() {\n // TODO: test postalCode\n }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "@Test\r\n public void getPostalCodeTest()\r\n {\r\n Assert.assertEquals(stub.getPostalCode(), POSTALCODE);\r\n }", "public ErrorMessage verifyCode(String code, Integer year, Long exception);", "public boolean isZipCodeValid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtZipCode.getText().trim().length() > 0)\n\t\t return true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtZipCode.getText().trim().length() > 0) {\n\t\t\treturn true;\n\t\t}\n\t\ttxtZipCode.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"Zip / Postal Code: This field is required.\"));\n\t}", "public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tif(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity, false))\n\t\t{\n\t\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity);\n\t\t}\n\t\t\n\t}", "@Override\r\n\tpublic void validate(Product p) throws CustomBadRequestException {\r\n\t\tif(p.getName() == null || p.getName().equals(\"\") || p.getBarcode() == null || p.getBarcode().equals(\"\") || p.getMeasure_unit() == null ||\r\n\t\t\t\tp.getMeasure_unit().equals(\"\") || p.getQuantity() == null || p.getQuantity().equals(\"\")|| p.getBrand() == null || p.getBrand().equals(\"\")){\r\n\t\t\tthrow new CustomBadRequestException(\"Incomplete Information about the product\");\r\n\t\t}\r\n\r\n\t\tString eanCode = p.getBarcode();\r\n\t\tString ValidChars = \"0123456789\";\r\n\t\tchar digit;\r\n\t\tfor (int i = 0; i < eanCode.length(); i++) { \r\n\t\t\tdigit = eanCode.charAt(i); \r\n\t\t\tif (ValidChars.indexOf(digit) == -1) {\r\n\t\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Add five 0 if the code has only 8 digits\r\n\t\tif (eanCode.length() == 8 ) {\r\n\t\t\teanCode = \"00000\" + eanCode;\r\n\t\t}\r\n\t\t// Check for 13 digits otherwise\r\n\t\telse if (eanCode.length() != 13) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\t// Get the check number\r\n\t\tint originalCheck = Integer.parseInt(eanCode.substring(eanCode.length() - 1));\r\n\t\teanCode = eanCode.substring(0, eanCode.length() - 1);\r\n\r\n\t\t// Add even numbers together\r\n\t\tint even = Integer.parseInt((eanCode.substring(1, 2))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(3, 4))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(5, 6))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(7, 8))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(9, 10))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(11, 12))) ;\r\n\t\t// Multiply this result by 3\r\n\t\teven *= 3;\r\n\r\n\t\t// Add odd numbers together\r\n\t\tint odd = Integer.parseInt((eanCode.substring(0, 1))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(2, 3))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(4, 5))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(6, 7))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(8, 9))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(10, 11))) ;\r\n\r\n\t\t// Add two totals together\r\n\t\tint total = even + odd;\r\n\r\n\t\t// Calculate the checksum\r\n\t\t// Divide total by 10 and store the remainder\r\n\t\tint checksum = total % 10;\r\n\t\t// If result is not 0 then take away 10\r\n\t\tif (checksum != 0) {\r\n\t\t\tchecksum = 10 - checksum;\r\n\t\t}\r\n\r\n\t\t// Return the result\r\n\t\tif (checksum != originalCheck) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\tif(Float.parseFloat(p.getQuantity()) <= 0){\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Quantity\");\r\n\t\t}\r\n\r\n\r\n\t}", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Installation Address - \"+Country, false);\n\t}", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public boolean validate() {\n\n String plate = _licensePlate.getText().toString();\n\n if(plate.isEmpty() || plate.length() < 8)\n return false;\n\n else if(plate.charAt(2) == '-' || plate.charAt(5) == '-') {\n\n if (Character.isUpperCase(plate.charAt(0)) && Character.isUpperCase(plate.charAt(1))) { // first case\n if (Character.isDigit(plate.charAt(3)) && Character.isDigit(plate.charAt(4))\n && Character.isDigit(plate.charAt(6)) && Character.isDigit(plate.charAt(7)))\n return true;\n }\n\n else if(Character.isUpperCase(plate.charAt(3)) && Character.isUpperCase(plate.charAt(4))) { // second case\n if (Character.isDigit(plate.charAt(0)) && Character.isDigit(plate.charAt(1))\n && Character.isDigit(plate.charAt(6)) && Character.isDigit(plate.charAt(7)))\n return true;\n }\n\n else if(Character.isUpperCase(plate.charAt(6)) && Character.isUpperCase(plate.charAt(7))) { // third case\n if (Character.isDigit(plate.charAt(0)) && Character.isDigit(plate.charAt(1))\n && Character.isDigit(plate.charAt(3)) && Character.isDigit(plate.charAt(4)))\n return true;\n }\n\n else\n return false;\n\n }\n\n return false;\n }", "private static JSONObject validateStreet(String street, String city, String state, String zip) throws Exception {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n//\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n//\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n//\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n//\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\n\t\treturn addrKeyFormat;\n\t}", "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "abstract void fiscalCodeValidity();", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "void validateMobileNumber(String stringToBeValidated,String name);", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "private void validateData() {\n }", "public boolean validatePin( String pin );", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private static boolean validatePhoneNumber(String phoneNo) {\n if (phoneNo.matches(\"\\\\d{10}\")) return true;\n //validating phone number with -, . or spaces\n else if(phoneNo.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) return true;\n //validating phone number with extension length from 3 to 5\n else if(phoneNo.matches(\"\\\\d{3}-\\\\d{3}-\\\\d{4}\\\\s(x|(ext))\\\\d{3,5}\")) return true;\n //validating phone number where area code is in braces ()\n else if(phoneNo.matches(\"\\\\(\\\\d{3}\\\\)-\\\\d{3}-\\\\d{4}\")) return true;\n //return false if nothing matches the input\n else return false;\n\n }", "public void mo38839a(BrandsValidation brandsValidation) {\n }", "public void createBillingAddress() throws Exception{\n\t\t\n\t\ttype(firstNameTextBox,\"bob\");\n\t\ttype(lastNameTextBox,\"test\");\n\t\ttype(addressLine1TextBox,\"2716 Ocean Park Blvd Suite 1030\");\n\t\ttype(addressLine2TextBox,\"test house\");\n\t\ttype(cityTextBox,\"Santa Monica\");\n\t\ttype(zipcodeTextBox,\"90405\");\n\t\tselect(stateSelectBox,8);\n\t\ttype(phoneTextField,\"6666654686\");\n\t\ttype(companyTextField,\"test company\");\n\t\n\t}", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }", "@Test( dataProvider=\"AddressValidationTestData\", groups ={\"BillingAddressValidations\"})\r\n\r\n\tpublic static void AddNewBillingAddress(String[] BillingAddressDetailsInArray){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tAssert.assertEquals( launchAndValidateDifferentBillingAddresses(BillingAddressDetailsInArray) ,true) ;\t\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\t\t\r\n\t}", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Installation Address - \"+AddressLine2, false);\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public static boolean isValidPostalCode(String test) {\n return test.matches(POSTAL_CODE_VALIDATION_REGEX);\n }", "@And(\"^Enter user phone and confirmation code$\")\t\t\t\t\t\n public void Enter_user_phone_and_confirmation_code() throws Throwable \t\t\t\t\t\t\t\n { \t\t\n \tdriver.findElement(By.id(\"phoneNumberId\")).sendKeys(\"01116844320\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvPhoneNext']/content/span\")).click();\n driver.findElement(By.id(\"code\")).sendKeys(\"172978\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvVerifyNext']/content/span\")).click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\t\t\n }", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validZip(String zipCode) {\n\t\tString regex = \"^[0-9]{5}(?:-[0-9]{4})?$\";\n\t\t \n\t\tPattern pattern = Pattern.compile(regex);\n\t\t \n\t\tMatcher matcher = pattern.matcher(zipCode);\n\n\t\treturn matcher.matches();\n\t}", "public boolean isValid(){\n Email.setErrorEnabled(false);\n Email.setError(\"\");\n Fname.setErrorEnabled(false);\n Fname.setError(\"\");\n Lname.setErrorEnabled(false);\n Lname.setError(\"\");\n Pass.setErrorEnabled(false);\n Pass.setError(\"\");\n Mobileno.setErrorEnabled(false);\n Mobileno.setError(\"\");\n Cpass.setErrorEnabled(false);\n Cpass.setError(\"\");\n area.setErrorEnabled(false);\n area.setError(\"\");\n Houseno.setErrorEnabled(false);\n Houseno.setError(\"\");\n Pincode.setErrorEnabled(false);\n Pincode.setError(\"\");\n\n boolean isValid=false,isValidname=false,isValidhouseno=false,isValidlname=false,isValidemail=false,isValidpassword=false,isValidconfpassword=false,isValidmobilenum=false,isValidarea=false,isValidpincode=false;\n if(TextUtils.isEmpty(fname)){\n Fname.setErrorEnabled(true);\n Fname.setError(\"Enter First Name\");\n }else{\n isValidname=true;\n }\n if(TextUtils.isEmpty(lname)){\n Lname.setErrorEnabled(true);\n Lname.setError(\"Enter Last Name\");\n }else{\n isValidlname=true;\n }\n if(TextUtils.isEmpty(emailid)){\n Email.setErrorEnabled(true);\n Email.setError(\"Email Address is required\");\n }else {\n if (emailid.matches(emailpattern)) {\n isValidemail = true;\n } else {\n Email.setErrorEnabled(true);\n Email.setError(\"Enter a Valid Email Address\");\n }\n }\n if(TextUtils.isEmpty(password)){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Enter Password\");\n }else {\n if (password.length()<8){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Weak Password\");\n }else {\n isValidpassword = true;\n }\n }\n if(TextUtils.isEmpty(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Enter Password Again\");\n }else{\n if (!password.equals(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Password Dosent Match\");\n }else{\n isValidconfpassword=true;\n }\n }\n if(TextUtils.isEmpty(mobile)){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Enter Phone Number\");\n }else{\n if (mobile.length()<10){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Invalid Mobile Number\");\n } else {\n isValidmobilenum = true;\n }\n }\n if(TextUtils.isEmpty(Area)){\n area.setErrorEnabled(true);\n area.setError(\"Area is Required\");\n }else{\n isValidarea=true;\n }\n if(TextUtils.isEmpty(pincode)){\n Pincode.setErrorEnabled(true);\n Pincode.setError(\"Please Enter Pincode\");\n }else{\n isValidpincode=true;\n }\n if(TextUtils.isEmpty(house)){\n Houseno.setErrorEnabled(true);\n Houseno.setError(\"House field cant be empty\");\n }else{\n isValidhouseno=true;\n }\n isValid=(isValidarea && isValidpincode && isValidconfpassword && isValidpassword && isValidemail && isValidname &&isValidmobilenum && isValidhouseno && isValidlname)? true:false;\n return isValid;\n\n }", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "private Map<String,String> getValidatedAddressInfo(Map<String,String> params) throws ClientProtocolException, IOException \n\t{\n\t\t// Create unique form parameters\n\t\tList<NameValuePair> uniqueParams = new ArrayList<NameValuePair>();\n\t\tuniqueParams.add(new BasicNameValuePair(\"__LASTFOCUS\", \"\"));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__VIEWSTATE\", params.get(\"ViewState\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__EVENTVALIDATION\", params.get(\"EventValidation\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetNumber\", params.get(\"StreetNumber\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetName\", params.get(\"StreetName\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"EnterButton\", \"Enter\"));\n\t\t\n\t\t//get the HTML from the FCPS boundary locator web site\n\t\tString responseHtml = getFCPSBoundaryLocatorHTML(uniqueParams);\n\t\t\n\t\tif(responseHtml == null || responseHtml.isEmpty() || responseHtml.startsWith(\"Error\"))\n\t\t{\n\t\t\tMap<String, String> errMap = new HashMap<String,String>();\n\t\t\terrMap.put(\"Error\", \"Failed Post\");\n\t\t\treturn errMap;\n\t\t}\n\t\telse\t //scrape the HTML to obtain the validated address map\n\t\t\treturn scrapeValidatedAddressHTML(responseHtml.toString());\n\t}", "@Given(\"^valid fields and making a GET request to account_ID_billing then it should return a (\\\\d+) and a body of customer billing details$\")\n\tpublic void valid_fields_and_making_a_GET_request_to_account_ID_billing_then_it_should_return_a_and_a_body_of_customer_billing_details(int StatusCode) throws Throwable {\n\t\tGetBilling.GET_account_id_billing_ValidFieldsProvided();\n\t try{}catch(Exception e){}\n\t}", "public void validateRpd13s9()\n {\n // This guideline cannot be automatically tested.\n }", "@Test\n public void testCreateLabelInvoiceBarcode_AddressValidation_Failure()\n {\n \t\n \ttry {\n \t\t\n \t\tlogger.info(\"Testing creation of label, invoice and barcode for failure scenario .\");\n \t\tString fileName = \"./com/cts/ptms/carrier/yrc/resources/InputData_Standard_AddressValidation_Failure.xml\";\n\t \tURL url = getClass().getClassLoader().getResource(fileName);\n\t\t\tshipmentRequest.setFileName(url.getFile());\n \t\tshipmentRequest.setCarrier(\"YRC\");\n\t \tshipmentRequest.setGenLabel(true);\n\t \tshipmentResponse = yrcSoapClient.createShipmentRequest(shipmentRequest);\n\t \tlogger.info(\"Status:\"+shipmentResponse );\n\t \t\n\t \tassertEquals(\"ERROR\", shipmentResponse.getStatus());\n\t\t\t\n \t} \n\t\tcatch(Exception e)\n\t\t{\n\t\t\tassertEquals(\"Failure\", \"Failure\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Exception occured\"+e.getMessage());\n\t\t}\n \t\n }", "public void SetCheckoutRegistrationPhonecode_number(String code, String phoneno){\r\n\t\tString Code = getValue(code);\r\n\t\tString Phoneno = getValue(phoneno);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:- \"+Code+\" , \"+Phoneno);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Registration Phone code and Phone number should be entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\ttry{\r\n\t\t\tif((countrygroup_phoneNo).contains(countries.get(countrycount))){\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonenumber\"),Phoneno);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonecode\"),Code);\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonenumber\"),Phoneno);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tSystem.out.println(\"Registration Phone code and number is entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Registration Phone code and number is entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Registration Phone code and number is not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtcheckoutregistrationPhonecode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" / \"+elementProperties.getProperty(\"txtcheckoutregistrationPhonenumber\").toString().replace(\"By.\", \" \")+\r\n\t\t\t\t\t\" not found\");\r\n\t\t}\r\n\r\n\t}", "private boolean validate() {\n if(edtMobileNumber.getText().toString().length() <= 0){\n edtMobileNumber.setFocusable(true);\n edtMobileNumber.setError(Constants.ERR_MSG_MOBILE);\n return false;\n }else if(edtFirstName.getText().toString().length() <= 0){\n edtFirstName.setFocusable(true);\n edtFirstName.setError(Constants.ERR_MSG_FIRST_NAME);\n return false;\n }else if(edtLastName.getText().toString().length() <= 0){\n edtLastName.setFocusable(true);\n edtLastName.setError(Constants.ERR_MSG_LAST_NAME);\n return false;\n }else if(edtDateOfBirth.getText().toString().length() <= 0){\n edtDateOfBirth.setFocusable(true);\n edtDateOfBirth.setError(Constants.ERR_MSG_DATE_OF_BIRTH);\n return false;\n }else if(edtEnterPin.getText().toString().length() <= 0){\n edtEnterPin.setFocusable(true);\n edtEnterPin.setError(Constants.ERR_MSG_PIN);\n return false;\n }else if(edtConfirmPin.getText().toString().length() <= 0){\n edtConfirmPin.setFocusable(true);\n edtConfirmPin.setError(Constants.ERR_MSG_CONFIRM_PIN);\n return false;\n }else if(spnStatus.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_STATUS, Toast.LENGTH_SHORT).show();\n return false;\n }else if(spnBloodGroup.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_BLOOD_GROUP, Toast.LENGTH_SHORT).show();\n return false;\n }else if(rgGender.getCheckedRadioButtonId() == -1){\n Toast.makeText(context,Constants.ERR_MSG_GENDER,Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean isInfoValidate(){\n if(mEmailAddress.getText() == null || mEmailAddress.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_email_address);\n return false;\n }\n\n if(!mEmailAddress.getText().toString().contains(\"@\")){\n errorText = getString(R.string.register_warning_valid_email_address);\n return false;\n }\n\n// if(mRegionSpinner.getSelectedItemPosition() == Constant.NON_SELECT){\n// errorText = getString(R.string.register_warning_select_region);\n// return false;\n// }\n\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.HONG_KONG)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.HONGKONG_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n//\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.CHINA)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.CHINA_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n\n if(mPassword.getText() == null || mPassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_password);\n return false;\n }\n\n if(mRetypePassword.getText() == null || mRetypePassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_retype_password);\n return false;\n }\n\n if(!mPassword.getText().toString().equals(mRetypePassword.getText().toString())){\n errorText = getString(R.string.register_warning_not_the_same);\n return false;\n }\n\n if(!Utility.judgeContainsStr( mPassword.getText().toString())){\n errorText = getString(R.string.register_warning_contains_character);\n return false;\n }\n\n// if(!mPolicyCheckBox.isChecked()){\n// errorText = getString(R.string.register_warning_check_agreement);\n// return false;\n// }\n\n return true;\n }", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public String getJP_BankDataCustomerCode2();", "public void validate(DataRecord value) {\n\r\n\t}", "private boolean validate(){\n\n String MobilePattern = \"[0-9]{10}\";\n String name = String.valueOf(userName.getText());\n String number = String.valueOf(userNumber.getText());\n\n\n if(name.length() > 25){\n Toast.makeText(getApplicationContext(), \"pls enter less the 25 characher in user name\",\n Toast.LENGTH_SHORT).show();\n return true;\n }\n\n\n\n else if(name.length() == 0 || number.length() == 0 ){\n Toast.makeText(getApplicationContext(), \"pls fill the empty fields\",\n Toast.LENGTH_SHORT).show();\n return false;\n }\n\n\n\n else if(number.matches(MobilePattern))\n {\n\n return true;\n }\n else if(!number.matches(MobilePattern))\n {\n Toast.makeText(getApplicationContext(), \"Please enter valid 10\" +\n \"digit phone number\", Toast.LENGTH_SHORT).show();\n\n\n return false;\n }\n\n return false;\n\n }", "public PaymentRequestPage paymentRequestPaymentAvailabilityValidation(String cashbackType,String cashbackValue,String rewardsValue) {\r\n\r\n\t\tString actual = \"\";\r\n\r\n\t\treportStep(\"About to validate the Cashback and Rewards Payment avilablity section in the payment Request page \", \"INFO\");\r\n\r\n\t\tswitch (cashbackType) {\r\n\r\n\t\tcase \"Only_Cashback\":\r\n\r\n\t\t\tvalidateTheElementPresence(cashbackAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, cashbackValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"Only_Rewards\":\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, rewardsValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase \"BothCashback_Rewards\":\r\n\r\n\t\t\tfloat cashbackAmount = Float.parseFloat(cashbackValue);\r\n\t\t\tfloat rewardsAmount = Float.parseFloat(rewardsValue);\r\n\t\t\tfloat totalAmount = cashbackAmount + rewardsAmount ;\r\n\r\n\t\t\tString strTotalAmount = Float.toString(totalAmount) + \"0\";\r\n\t\t\tString strOnlyCashbackAmount = Float.toString(cashbackAmount) + \"0\";\r\n\t\t\tString strOnlyRewardsAmount = Float.toString(rewardsAmount) + \"0\";\r\n\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\t\t\tvalidateTheElementPresence(cashbackText);\r\n\t\t\tvalidateTheElementPresence(rewardsText);\r\n\r\n\t\t\t//validate total cashback amount\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strTotalAmount);\r\n\r\n\t\t\t//validate only cashback amount\r\n\t\t\tactual = getText(cashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyCashbackAmount);\r\n\r\n\r\n\t\t\t//validate only rewards amount\r\n\t\t\tactual = getText(rewardsAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyRewardsAmount);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\r\n\t}", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "private void validateDetails() {\n\n clearErrors();\n Utils.hide_keyboard(getActivity());\n\n boolean valid = true;\n\n String cvv = cvvTv.getText().toString();\n String expiryDate = cardExpiryTv.getText().toString();\n String cardNo = cardNoTv.getText().toString();\n\n if (cvv.length() < 3) {\n valid = false;\n cvvTil.setError(\"Enter a valid cvv\");\n }\n\n if (expiryDate.length() != 5) {\n cardExpiryTil.setError(\"Enter a valid expiry date\");\n valid = false;\n }\n\n String cardNoStripped = cardNo.replaceAll(\"\\\\s\", \"\");\n\n if (cardNoStripped.length() < 12 ) {\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n else {\n try {\n Long parsed = Long.parseLong(cardNoStripped);\n }\n catch (Exception e) {\n e.printStackTrace();\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n }\n\n if (valid) {\n\n if (saveCardSwitch.isChecked()) {\n int cardLen = cardNoStripped.length();\n cardFirst6 = cardNoStripped.substring(0, 6);\n cardLast4 = cardNoStripped.substring(cardLen - 4, cardLen);\n shouldISaveThisCard = true;\n presenter.savePotentialCardDets(cardFirst6, cardLast4);\n }\n\n //make request\n PayloadBuilder builder = new PayloadBuilder();\n builder.setAmount(thetellerInitializer.getAmount() + \"\")\n .setNarration(thetellerInitializer.getNarration())\n .setCardno(cardNoStripped)\n .set3dUrl(thetellerInitializer.get3dUrl())\n .setEmail(thetellerInitializer.getEmail())\n .setCurrency(thetellerInitializer.getCurrency())\n .setMerchant_id(thetellerInitializer.getMerchant_id())\n .setCvv(cvv).setFirstname(thetellerInitializer.getfName())\n .setLastname(thetellerInitializer.getlName())\n .setIP(Utils.getDeviceImei(getActivity()))\n .setTxRef(thetellerInitializer.getTxRef())\n .setExpiryyear(expiryDate.substring(3,5))\n .setExpirymonth(expiryDate.substring(0,2))\n .setMeta(thetellerInitializer.getMeta())\n .setApiUser(thetellerInitializer.getApiUser())\n .setApiKey(thetellerInitializer.getApiKey())\n .setDevice_fingerprint(Utils.getDeviceImei(getActivity()))\n .setCardType(cardType);\n\n if (thetellerInitializer.getPayment_plan() != null) {\n builder.setPaymentPlan(thetellerInitializer.getPayment_plan());\n }\n\n body = builder.createPayload();\n\n presenter.chargeCard(body, thetellerConstants.API_KEY);\n }\n }", "public void setAddressPostalCode(String addressPostalCode) {\n this.addressPostalCode = addressPostalCode;\n }", "public void testAddressPostalCodeConstant() {\n assertEquals(\"ADDRESS_POSTAL_CODE is incorrect\", UserConstants.ADDRESS_POSTAL_CODE, \"address-postal-code\");\n }", "private String getAnomizedPostcode() {\r\n\tString postcode = (String) record.get(\"postcode\");\r\n\tif (postcode != null && postcode.length() > 0) {\r\n\t postcode = postcode.substring(0, 1);\r\n\t}\r\n\treturn postcode;\r\n }", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Installation Address - \"+TownCity);\n\t\t\t\n\t\t\t\n\t\t\n\t}", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "@Test(priority=1)\n\tpublic void checkFirstNameAndLastNameFieldValiditywithNumbers(){\n\t\tsignup.clearAllFields();\n\t\tsignup.enterId(\"[email protected]\");\n\t\tsignup.enterFirstName(\"12345\");\n\t\tsignup.enterLastName(\"56386\");\n\t\tsignup.clickSubmit();\n\t\tList<String> errors = signup.getErrors();\n\t\t// given page accepts numbers into the firstname and lastname fields\n\t\tAssert.assertFalse(TestHelper.isStringPresent(errors, \"Please enter your last name.\"));\n\t\tAssert.assertFalse(TestHelper.isStringPresent(errors, \"Please enter your first name.\"));\n\t}", "public void validateRpd3s12()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean checkStAddAptNumZip(String streetAddress, String aptNumber, String zip){\n if( !this.streetAddress.toLowerCase().equals(streetAddress)){\n return false;\n }else if (!this.aptNumber.toLowerCase().equals(aptNumber)){\n return false;\n }else if (!this.zip.toLowerCase().equals(zip)){\n return false;\n }else{\n return true;\n }\n }", "public void validateRpd13s2()\n {\n // This guideline cannot be automatically tested.\n }", "public void SetCreditCarddetails(String ccnumber, String ccname, String ccmonth, String ccyear, String ccseccode){\r\n\t\tString countrygroup_ccdetails= \"UK,PresselAustria\";\r\n\t\tString CCnum = getValue(ccnumber);\r\n\t\tString CCName = getValue(ccname);\r\n\t\tString CCMonth = getValue(ccmonth);\r\n\t\tString CCYear = getValue(ccyear);\r\n\t\tString CCSecCode = getValue(ccseccode);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+CCnum+\", \"+CCName+\", \"+CCMonth+\", \"+CCYear+\", \"+CCSecCode);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The CreditCard details should be entered\");\r\n\t\ttry{\r\n\t\t\tif(!(countrygroup_ccdetails).contains(countries.get(countrycount))){\r\n\t\t\t\tswitchframe(\"TokenizationPage\");\r\n\t\t\t\tsleep(2000);\r\n\t\t\t\tsendKeys(locator_split(\"txtCCnumber\"), CCnum);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCname\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCname\"), CCName);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCMonth\"), CCMonth);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCYear\"), CCYear);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCcode\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCcode\"), CCSecCode);\t\t\t\t\t\t\r\n\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The CreditCard details are entered\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The new CreditCard details are applicable to this \" +country);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- The CreditCard details are not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"One of the element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCnumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCname\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCMonth\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCYear\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCcode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" are not found\");\r\n\r\n\t\t}\r\n\t}", "void validate();", "void validate();", "public boolean validate()\n {\n EditText walletName = findViewById(R.id.walletName);\n String walletNameString = walletName.getText().toString();\n\n EditText walletBalance = findViewById(R.id.walletBalance);\n String walletBalanceString = walletBalance.getText().toString();\n\n if (TextUtils.isEmpty(walletNameString))\n {\n walletName.setError(\"This field cannot be empty\");\n\n return false;\n }\n else if (TextUtils.isEmpty(walletBalanceString))\n {\n walletBalance.setError(\"This field cannot be empty\");\n\n return false;\n }\n else\n {\n return true;\n }\n }", "public void validateRpd22s9()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validatePuchase() {\n if (TextUtils.isEmpty(editextPurchaseSupplierName.getText().toString())) {\n editextPurchaseSupplierName.setError(getString(R.string.supplier_name));\n editextPurchaseSupplierName.requestFocus();\n return false;\n }\n\n if (TextUtils.isEmpty(edittextPurchaseAmount.getText().toString())) {\n if (flowpurchaseReceivedOrPaid == 2) {\n edittextPurchaseAmount.setError(getString(R.string.menu_purchasePaid));\n edittextPurchaseAmount.requestFocus();\n\n } else {\n edittextPurchaseAmount.setError(getString(R.string.purchase_amount));\n edittextPurchaseAmount.requestFocus();\n }\n return false;\n }\n\n if (TextUtils.isEmpty(edittextPurchasePurpose.getText().toString())) {\n edittextPurchasePurpose.setError(getString(R.string.remark_bill_number));\n edittextPurchasePurpose.requestFocus();\n return false;\n }\n\n\n return true;\n }", "public void validate() {}", "@org.junit.Test\r\n public void testPositiveScenario() {\n boolean result = Validation.validateSAPhoneNumber(\"+27712612199\");// function should return true\r\n assertEquals(true, result);\r\n\r\n }", "public Boolean validateTransCode(String noteCode, Long staffId, String transType) throws Exception;", "@Override\n\tpublic ABNResponseBean validateAbn(String abn) {\n\t\treturn null;\n\t}", "public boolean isAddressLine1Valid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtAddressLine1.getText().trim().length() > 0)\n\t\t\t\treturn true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtAddressLine1.getText().trim().length() > 0) {\n\t\t\t\treturn true;\n\t\t}\n\t\ttxtAddressLine1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"AddressLine1: This field is required.\"));\n\t}", "public List<String> validate (PostPurchaseOrderRequest postPurchaseOrderRequest) {\n\n List<String> errorList = new ArrayList<>();\n\n errorList.addAll(commonPurchaseOrderValidator.validateLineItems(postPurchaseOrderRequest.getPurchaseOrder().getLineItems(),\n postPurchaseOrderRequest.getPurchaseOrder().getStatus()));\n\n\n return errorList;\n }", "private static boolean validateZipCode(String zipCode) {\n try {\n if (zipCode.length() >= 5) {\n return Integer.parseInt(zipCode) > 0;\n }\n } catch (Exception ignored) {\n }\n\n return false;\n }", "public boolean isPincodeValid(String pincode){\n Pattern p = Pattern.compile(\"\\\\d{6}\\\\b\");\n Matcher m = p.matcher(pincode);\n return (m.find() && m.group().equals(pincode));\n }", "@Override\n public boolean isValid(PhoneNumber phoneNumber) {\n String number = phoneNumber.getNumber();\n return isPhoneNumber(number) && number.startsWith(\"+380\") && number.length() == 13;\n }", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "public void setPostalCode(String postalCode) {\n this.postalCode = postalCode;\n }" ]
[ "0.7419711", "0.7314422", "0.64220816", "0.6267578", "0.6237442", "0.6214926", "0.6153505", "0.6116289", "0.6113819", "0.6097372", "0.60135514", "0.6003382", "0.59881675", "0.5981641", "0.5924763", "0.59230113", "0.58903706", "0.5874403", "0.5856168", "0.58456314", "0.5835744", "0.5808315", "0.58054304", "0.57457554", "0.5745512", "0.573602", "0.5730075", "0.5688928", "0.56888294", "0.56872493", "0.56866986", "0.5674181", "0.56699693", "0.5661798", "0.56604695", "0.56521225", "0.5640477", "0.56241536", "0.56170076", "0.56010526", "0.5589986", "0.5564609", "0.5552878", "0.5547831", "0.5544956", "0.552874", "0.55252624", "0.5510169", "0.5498092", "0.54978484", "0.5496643", "0.5484697", "0.5484199", "0.54613495", "0.545606", "0.54492813", "0.54477805", "0.5447594", "0.54422396", "0.5436571", "0.543451", "0.54210246", "0.54113424", "0.54008734", "0.53973854", "0.5396886", "0.53830236", "0.5377562", "0.53761107", "0.5375991", "0.5367643", "0.53653985", "0.53647226", "0.5361937", "0.53613824", "0.53583443", "0.5356306", "0.5352871", "0.5352871", "0.5352612", "0.535256", "0.53372055", "0.53334713", "0.53203225", "0.5319787", "0.5319787", "0.5315695", "0.5314673", "0.5313271", "0.5312783", "0.5310268", "0.53038347", "0.52938354", "0.5293556", "0.5292735", "0.5291596", "0.5291254", "0.52893883", "0.5289358", "0.5284979" ]
0.77905667
0
Validation Functions Description : To validate the Address Line 1 of Installation Address in Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:05 Oct 2016 Modified By:Raja Parameter:AddressLine1
public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception { Report.fnReportPageBreak("Instalation Address", driver); VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll("M_Header", "Installation Address").replaceAll("M_Category", "Address Line 1").replaceAll("M_InnerText", AddressLine1), "Address Line 1 of Installation Address - "+AddressLine1, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Installation Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_2_of_Correspondence_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Correspondence Address - \"+AddressLine2, false);\n\t}", "public boolean isAddressLine1Valid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtAddressLine1.getText().trim().length() > 0)\n\t\t\t\treturn true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtAddressLine1.getText().trim().length() > 0) {\n\t\t\t\treturn true;\n\t\t}\n\t\ttxtAddressLine1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"AddressLine1: This field is required.\"));\n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Installation Address - \"+Postcode, false);\n\t}", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Installation Address - \"+Country, false);\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "private void validateLine1304(Errors errors) {\n }", "abstract void addressValidity();", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "public boolean isAddressLine2Valid() throws BusinessRuleException {\n\t\treturn true;\n\t}", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Installation Address - \"+TownCity);\n\t\t\t\n\t\t\t\n\t\t\n\t}", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Billing Address - \"+Country, false);\n\t}", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Billing Address - \"+Postcode, false);\n\t}", "public void setAddressline1(String addressline1) {\n this.addressline1 = addressline1;\n }", "public void setAddressLine1(String addressLine1) {\n this.addressLine1 = addressLine1;\n }", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "private void validateData() {\n }", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd14s1()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "public abstract String getAddressLine1();", "public static Address addAddress() {\r\n\r\n\t\tSystem.out.println(\"Please enter the building number of the supplier:\");\r\n\r\n\t\tint bldNum = Validation.intValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the supplier's street name:\");\r\n\t\tString bldStreet = Validation.stringNoIntsValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the town the supplier is in:\");\r\n\t\tString bldTown = Validation.stringNoIntsValidation();\t\t\r\n\r\n\t\tSystem.out.println(\"Please enter the postcode for the supplier:\");\r\n\t\tString bldPCode = Validation.stringValidation();\r\n\r\n\t\tSystem.out.println(\"Please enter the country the supplier is in:\");\r\n\t\tString bldCountry = Validation.stringNoIntsValidation();\r\n\r\n\t\tAddress newAddress = new Address(bldNum, bldStreet, bldTown, bldPCode, bldCountry);\r\n\r\n\t\treturn newAddress;\r\n\r\n\t}", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "public Address validate(Client client, String address) throws BytomException {\n\t\t\tMap<String, Object> req = new HashMap<String, Object>();\n\t\t\treq.put(\"address\", address);\n\t\t\treturn client.request(\"validate-address\", req, Address.class);\n\t\t}", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tif(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity, false))\n\t\t{\n\t\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity);\n\t\t}\n\t\t\n\t}", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public void validate_the_Email_Address_1_of_Security_in_Customer_Tab(String EmailAddress1)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 1\").replaceAll(\"M_InnerText\", EmailAddress1), \"Email Address 1 - \"+EmailAddress1, false);\n\t}", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "public void validate() {}", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "public void validate(DataRecord value) {\n\r\n\t}", "public void validateRpd13s6()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s2()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate_the_Town_City_of_Correspondence_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Correspondence Address - \"+TownCity, false);\n\t}", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "public static Boolean validateInput(String str) {\n String[] lines = str.split(\"\\n\");\r\n // System.out.println(\"lines array:\"+lines.length);\r\n Boolean validate = true;\r\n String[] lineParameters;\r\n int countFor =0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n\r\n if (lineParameters.length != 5) {\r\n validate = false;\r\n break;\r\n }\r\n }\r\n countFor++;\r\n \r\n\r\n }\r\n return validate;\r\n }", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "@Test\n public void testCreateLabelInvoiceBarcode_AddressValidation_Failure()\n {\n \t\n \ttry {\n \t\t\n \t\tlogger.info(\"Testing creation of label, invoice and barcode for failure scenario .\");\n \t\tString fileName = \"./com/cts/ptms/carrier/yrc/resources/InputData_Standard_AddressValidation_Failure.xml\";\n\t \tURL url = getClass().getClassLoader().getResource(fileName);\n\t\t\tshipmentRequest.setFileName(url.getFile());\n \t\tshipmentRequest.setCarrier(\"YRC\");\n\t \tshipmentRequest.setGenLabel(true);\n\t \tshipmentResponse = yrcSoapClient.createShipmentRequest(shipmentRequest);\n\t \tlogger.info(\"Status:\"+shipmentResponse );\n\t \t\n\t \tassertEquals(\"ERROR\", shipmentResponse.getStatus());\n\t\t\t\n \t} \n\t\tcatch(Exception e)\n\t\t{\n\t\t\tassertEquals(\"Failure\", \"Failure\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Exception occured\"+e.getMessage());\n\t\t}\n \t\n }", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public boolean validateContactAddress(String contactId, List<String> result)\n {\n return true;\n }", "public abstract String getAddressLine2();", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }", "public void validateRpd13s13()\n {\n // This guideline cannot be automatically tested.\n }", "@Test( dataProvider=\"AddressValidationTestData\", groups ={\"BillingAddressValidations\"})\r\n\r\n\tpublic static void AddNewBillingAddress(String[] BillingAddressDetailsInArray){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tAssert.assertEquals( launchAndValidateDifferentBillingAddresses(BillingAddressDetailsInArray) ,true) ;\t\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\t\t\r\n\t}", "public String getAddressLine1() {\n return addressLine1;\n }", "void validate();", "void validate();", "public void validateAdress(String adress) {\r\n\t\tthis.isAdressValid = model.isValidAdress(adress);\r\n\r\n\t\tif (this.isAdressValid) {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: green;\");\r\n\t\t\tcheckButtonUnlock();\r\n\t\t} else {\r\n\t\t\tview.adress.setStyle(\"-fx-text-inner-color: red;\");\r\n\t\t\tlockButton();\r\n\t\t}\r\n\t}", "public abstract void setAddressLine1(String sValue);", "public void validateRpd11s7()\n {\n // This guideline cannot be automatically tested.\n }", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validateRpd22s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s9()\n {\n // This guideline cannot be automatically tested.\n }", "private static boolean validateAddress(String address) {\n return !address.isEmpty();\n }", "public static boolean validFlightData(String airline[], int rowNo,\r\n\t\t\tString airlineName) throws Exception {\r\n\t\tboolean isValid = true;\r\n\t\tif (airline[0].length() != 5) {\r\n\t\t\tisValid = false;\r\n\t\t}\r\n\t\tif (airline[1].length() != 3 || airline[2].length() != 3) {\r\n\t\t\tisValid = false;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tDateParser.parseDate(airline[3]);\r\n\t\t} catch (ParseException e) {\r\n\t\t\tisValid = false;\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tDouble.parseDouble(airline[5]);\r\n\t\t\tDouble.parseDouble(airline[6]);\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\tisValid = false;\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tif (!(airline[7].contains(GenericConstants.YES_OPTION) || airline[7]\r\n\t\t\t\t.contains(GenericConstants.NO_OPTION))) {\r\n\t\t\tisValid = false;\r\n\t\t}\r\n\t\tif (!(airline[8].contains(CSVReaderConstants.BUSINESS) || airline[8]\r\n\t\t\t\t.contains(CSVReaderConstants.ECONOMIC))) {\r\n\t\t\tisValid = false;\r\n\t\t}\r\n\t\tif (!isValid) {\r\n\t\t\tthrow new Exception(ConsoleMessages.INVAILD_FLIGHT_DETAILS + rowNo\r\n\t\t\t\t\t+ \" in \" + airlineName);\r\n\t\t}\r\n\t\treturn isValid;\r\n\t}", "public void testSetLine1_EmptyString() {\r\n try {\r\n address.setLine1(\" \");\r\n fail(\"IAE expected\");\r\n } catch (IllegalArgumentException e) {\r\n //good\r\n }\r\n }", "public boolean isPhone1Valid() throws BusinessRuleException {\n\t\tif (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtPhone1.getText().trim().length() > 0)\n\t\t\treturn true;\n\t\ttxtPhone1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"Phone: This field is required.\"));\n\t}", "private void setupRequiredValidation() {\n requiredMafExpressions.put(FIELD_HUGO_SYMBOL, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_HUGO_SYMBOL, \"may not be blank\");\r\n requiredMafExpressions.put(FIELD_ENTREZ_GENE_ID, Pattern.compile(\"\\\\d+\")); // number\r\n requiredFieldDescriptions.put(FIELD_ENTREZ_GENE_ID, \"must be an integer number\");\r\n requiredMafExpressions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_TUMOR_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_TUMOR_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_VALIDATION_STATUS, Pattern.compile(\"Valid|Wildtype|Unknown|\\\\S?\"));\r\n requiredFieldDescriptions.put(FIELD_VALIDATION_STATUS, \"must be Valid, Wildtype, Unknown, or blank\");\r\n requiredMafExpressions.put(FIELD_CHROMOSOME, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_CHROMOSOME, \"must be one of: X, Y, M, 1-22, or full name of unassigned fragment\");\r\n setupMafSpecificChecks();\r\n }", "public void validate_the_Telephone_Home_in_Contact_Details_of_Customer_Tab(String TelephoneHome)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneHome.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Home\").replaceAll(\"M_InnerText\", TelephoneHome), \"Telephone - Home - \"+TelephoneHome, false);\n\t}", "public static void fillUpAddAddress() throws Exception {\n\t\tString fName = Generic.ReadRandomCellData(\"Names\");\n\t\tString lName = Generic.ReadRandomCellData(\"Names\");\n\n\t\tString email = Generic.ReadFromExcel(\"Email\", \"LoginDetails\", 1);\n\t\tString mobileNum = Generic.ReadFromExcel(\"GCashNum\", \"LoginDetails\", 1);\n\t\ttry {\n\n\t\t\tsendKeys(\"CreateAccount\", \"FirstName\", fName);\n\n\t\t\tclickByLocation(\"42,783,1038,954\");\n\t\t\tenterTextByKeyCodeEvent(lName);\n\n//\t\t\tsendKeys(\"CreateAccount\", \"UnitNo\", Generic.ReadFromExcel(\"UnitNo\", \"LoginDetails\", 1));\n//\t\t\tsendKeys(\"CreateAccount\", \"StreetNo\", Generic.ReadFromExcel(\"StreetName\", \"LoginDetails\", 1));\n\t\t\tAddAddress(1);\n\t\t\tThread.sleep(2000);\n\t\t\tsendKeys(\"CreateAccount\", \"Email\", email);\n\t\t\tThread.sleep(2000);\n\t\t\tsendKeys(\"CreateAccount\", \"MobileNumber\", mobileNum);\n\t\t\tControl.takeScreenshot();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public String getAddressline1() {\n return addressline1;\n }", "public void validateRpd8s22()\n {\n // Duplicate of 8s14\n }", "public void validateRpd18s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd11s6()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "public boolean isAddressValid(String address) {\n\t\tString pattern = \"(^\\\\d+(w|e|s|n)\\\\d+\\\\s\\\\w+\\\\s\\\\w+\\\\.)\";\n\t\tboolean isMatch = Pattern.matches(pattern, address);\n return isMatch;\n }", "public void validateRpd22s6()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd1s2()\n {\n // This guideline cannot be automatically tested.\n }", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public void validateRpd13s8()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean validation(){\n String Venuename= venuename.getText().toString();\n String Address= address.getText().toString();\n String Details= details.getText().toString();\n String Venueimage= venueimage.getText().toString();\n if(Venuename.isEmpty()){\n venuename.setError(\"Please enter the item name\");\n venuename.requestFocus();\n return false;\n }\n if(Address.isEmpty()){\n address.setError(\"Please enter the item name\");\n address.requestFocus();\n return false;\n }\n if(Details.isEmpty()){\n details.setError(\"Please enter the item name\");\n details.requestFocus();\n return false;\n }\n if(Venueimage.isEmpty()){\n venueimage.setError(\"Please Select the image first\");\n return false;\n }\n\n\n return true;\n }", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "public abstract void setAddressLine2(String sValue);", "public void setAddressLine2(String addressLine2) {\n this.addressLine2 = addressLine2;\n }", "public void validateRpd15s1()\n {\n // This guideline cannot be automatically tested.\n }" ]
[ "0.7517788", "0.74458754", "0.74110067", "0.71712834", "0.70094085", "0.67597985", "0.6446647", "0.6385509", "0.6382363", "0.6376284", "0.63397133", "0.63295907", "0.62300444", "0.6194087", "0.6166352", "0.6130925", "0.6100362", "0.60959786", "0.6083061", "0.6009989", "0.5995486", "0.5989553", "0.59890133", "0.5985747", "0.59802485", "0.5888126", "0.58830523", "0.58532697", "0.58223367", "0.58206797", "0.5793627", "0.57802385", "0.5766205", "0.5757223", "0.5755981", "0.5747386", "0.5743596", "0.5703994", "0.5698244", "0.56799763", "0.5668429", "0.5663607", "0.56571126", "0.5651527", "0.5636191", "0.5628776", "0.5624823", "0.5609", "0.559682", "0.5583737", "0.5582148", "0.5572135", "0.5568576", "0.5563099", "0.5550744", "0.55494964", "0.55476505", "0.554623", "0.5541519", "0.55389607", "0.5538623", "0.55336106", "0.5528489", "0.5528489", "0.5522971", "0.5522144", "0.55162907", "0.5506552", "0.5502682", "0.54824406", "0.54761165", "0.54761165", "0.5470206", "0.5468205", "0.546191", "0.54550254", "0.5437849", "0.5436109", "0.5432336", "0.5431947", "0.5427116", "0.5424447", "0.54189134", "0.54095405", "0.5396533", "0.53948426", "0.53933054", "0.53830606", "0.538247", "0.53695583", "0.536627", "0.5365467", "0.53621817", "0.5360697", "0.53549623", "0.5353751", "0.5342319", "0.5339006", "0.53360045", "0.5323961" ]
0.7864731
0
Validation Functions Description : To validate the Address Line 2 of Installation Address in Customer Tab Coded by :Rajan Created Data:21 Oct 2016 Last Modified Date: Modified By: Parameter:
public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll("M_Header", "Installation Address").replaceAll("M_Category", "Address Line 2").replaceAll("M_InnerText", AddressLine2), "Address Line 2 of Installation Address - "+AddressLine2, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_2_of_Correspondence_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Correspondence Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Installation Address - \"+Postcode, false);\n\t}", "public boolean isAddressLine1Valid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtAddressLine1.getText().trim().length() > 0)\n\t\t\t\treturn true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtAddressLine1.getText().trim().length() > 0) {\n\t\t\t\treturn true;\n\t\t}\n\t\ttxtAddressLine1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"AddressLine1: This field is required.\"));\n\t}", "public boolean isAddressLine2Valid() throws BusinessRuleException {\n\t\treturn true;\n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Installation Address - \"+Country, false);\n\t}", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Installation Address - \"+TownCity);\n\t\t\t\n\t\t\t\n\t\t\n\t}", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "abstract void addressValidity();", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Billing Address - \"+Postcode, false);\n\t}", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "private void validateLine1304(Errors errors) {\n }", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Billing Address - \"+Country, false);\n\t}", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public static Address addAddress() {\r\n\r\n\t\tSystem.out.println(\"Please enter the building number of the supplier:\");\r\n\r\n\t\tint bldNum = Validation.intValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the supplier's street name:\");\r\n\t\tString bldStreet = Validation.stringNoIntsValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the town the supplier is in:\");\r\n\t\tString bldTown = Validation.stringNoIntsValidation();\t\t\r\n\r\n\t\tSystem.out.println(\"Please enter the postcode for the supplier:\");\r\n\t\tString bldPCode = Validation.stringValidation();\r\n\r\n\t\tSystem.out.println(\"Please enter the country the supplier is in:\");\r\n\t\tString bldCountry = Validation.stringNoIntsValidation();\r\n\r\n\t\tAddress newAddress = new Address(bldNum, bldStreet, bldTown, bldPCode, bldCountry);\r\n\r\n\t\treturn newAddress;\r\n\r\n\t}", "public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tif(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity, false))\n\t\t{\n\t\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity);\n\t\t}\n\t\t\n\t}", "private void validateData() {\n }", "public abstract String getAddressLine2();", "public void setAddressline2(String addressline2) {\n this.addressline2 = addressline2;\n }", "public void setAddressLine2(String addressLine2) {\n this.addressLine2 = addressLine2;\n }", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validateRpd13s2()\n {\n // This guideline cannot be automatically tested.\n }", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public abstract String getAddressLine1();", "public void validate_the_Town_City_of_Correspondence_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Correspondence Address - \"+TownCity, false);\n\t}", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "public void validateRpd14s1()\n {\n // This guideline cannot be automatically tested.\n }", "@Test\n public void testCreateLabelInvoiceBarcode_AddressValidation_Failure()\n {\n \t\n \ttry {\n \t\t\n \t\tlogger.info(\"Testing creation of label, invoice and barcode for failure scenario .\");\n \t\tString fileName = \"./com/cts/ptms/carrier/yrc/resources/InputData_Standard_AddressValidation_Failure.xml\";\n\t \tURL url = getClass().getClassLoader().getResource(fileName);\n\t\t\tshipmentRequest.setFileName(url.getFile());\n \t\tshipmentRequest.setCarrier(\"YRC\");\n\t \tshipmentRequest.setGenLabel(true);\n\t \tshipmentResponse = yrcSoapClient.createShipmentRequest(shipmentRequest);\n\t \tlogger.info(\"Status:\"+shipmentResponse );\n\t \t\n\t \tassertEquals(\"ERROR\", shipmentResponse.getStatus());\n\t\t\t\n \t} \n\t\tcatch(Exception e)\n\t\t{\n\t\t\tassertEquals(\"Failure\", \"Failure\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Exception occured\"+e.getMessage());\n\t\t}\n \t\n }", "public Address validate(Client client, String address) throws BytomException {\n\t\t\tMap<String, Object> req = new HashMap<String, Object>();\n\t\t\treq.put(\"address\", address);\n\t\t\treturn client.request(\"validate-address\", req, Address.class);\n\t\t}", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "public abstract void setAddressLine2(String sValue);", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }", "public void validateRpd8s22()\n {\n // Duplicate of 8s14\n }", "public void setAddressline1(String addressline1) {\n this.addressline1 = addressline1;\n }", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate_the_Email_Address_1_of_Security_in_Customer_Tab(String EmailAddress1)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 1\").replaceAll(\"M_InnerText\", EmailAddress1), \"Email Address 1 - \"+EmailAddress1, false);\n\t}", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public void setAddressLine1(String addressLine1) {\n this.addressLine1 = addressLine1;\n }", "public void validate(DataRecord value) {\n\r\n\t}", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validate_the_Email_Address_2_of_Security_in_Customer_Tab(String EmailAddress2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 2\").replaceAll(\"M_InnerText\", EmailAddress2), \"Email Address 2 - \"+EmailAddress2, false);\n\t}", "public boolean validateContactAddress(String contactId, List<String> result)\n {\n return true;\n }", "@Override\r\n\tpublic void validate(Product p) throws CustomBadRequestException {\r\n\t\tif(p.getName() == null || p.getName().equals(\"\") || p.getBarcode() == null || p.getBarcode().equals(\"\") || p.getMeasure_unit() == null ||\r\n\t\t\t\tp.getMeasure_unit().equals(\"\") || p.getQuantity() == null || p.getQuantity().equals(\"\")|| p.getBrand() == null || p.getBrand().equals(\"\")){\r\n\t\t\tthrow new CustomBadRequestException(\"Incomplete Information about the product\");\r\n\t\t}\r\n\r\n\t\tString eanCode = p.getBarcode();\r\n\t\tString ValidChars = \"0123456789\";\r\n\t\tchar digit;\r\n\t\tfor (int i = 0; i < eanCode.length(); i++) { \r\n\t\t\tdigit = eanCode.charAt(i); \r\n\t\t\tif (ValidChars.indexOf(digit) == -1) {\r\n\t\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Add five 0 if the code has only 8 digits\r\n\t\tif (eanCode.length() == 8 ) {\r\n\t\t\teanCode = \"00000\" + eanCode;\r\n\t\t}\r\n\t\t// Check for 13 digits otherwise\r\n\t\telse if (eanCode.length() != 13) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\t// Get the check number\r\n\t\tint originalCheck = Integer.parseInt(eanCode.substring(eanCode.length() - 1));\r\n\t\teanCode = eanCode.substring(0, eanCode.length() - 1);\r\n\r\n\t\t// Add even numbers together\r\n\t\tint even = Integer.parseInt((eanCode.substring(1, 2))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(3, 4))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(5, 6))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(7, 8))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(9, 10))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(11, 12))) ;\r\n\t\t// Multiply this result by 3\r\n\t\teven *= 3;\r\n\r\n\t\t// Add odd numbers together\r\n\t\tint odd = Integer.parseInt((eanCode.substring(0, 1))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(2, 3))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(4, 5))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(6, 7))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(8, 9))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(10, 11))) ;\r\n\r\n\t\t// Add two totals together\r\n\t\tint total = even + odd;\r\n\r\n\t\t// Calculate the checksum\r\n\t\t// Divide total by 10 and store the remainder\r\n\t\tint checksum = total % 10;\r\n\t\t// If result is not 0 then take away 10\r\n\t\tif (checksum != 0) {\r\n\t\t\tchecksum = 10 - checksum;\r\n\t\t}\r\n\r\n\t\t// Return the result\r\n\t\tif (checksum != originalCheck) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\tif(Float.parseFloat(p.getQuantity()) <= 0){\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Quantity\");\r\n\t\t}\r\n\r\n\r\n\t}", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "public void validateRpd1s2()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd22s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd22s2()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd7s2()\n {\n // This guideline cannot be automatically tested.\n }", "@Test( dataProvider=\"AddressValidationTestData\", groups ={\"BillingAddressValidations\"})\r\n\r\n\tpublic static void AddNewBillingAddress(String[] BillingAddressDetailsInArray){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tAssert.assertEquals( launchAndValidateDifferentBillingAddresses(BillingAddressDetailsInArray) ,true) ;\t\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\t\t\r\n\t}", "public void validateRpd13s6()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public void validateRpd11s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd22s6()\n {\n // This guideline cannot be automatically tested.\n }", "public abstract void setAddressLine1(String sValue);", "public String getAddressLine2() {\n return addressLine2;\n }", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "public static Boolean validateInput(String str) {\n String[] lines = str.split(\"\\n\");\r\n // System.out.println(\"lines array:\"+lines.length);\r\n Boolean validate = true;\r\n String[] lineParameters;\r\n int countFor =0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n\r\n if (lineParameters.length != 5) {\r\n validate = false;\r\n break;\r\n }\r\n }\r\n countFor++;\r\n \r\n\r\n }\r\n return validate;\r\n }", "public void validateRpd11s6()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate() {}", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "public void validateRpd13s9()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "private Map<String,String> getValidatedAddressInfo(Map<String,String> params) throws ClientProtocolException, IOException \n\t{\n\t\t// Create unique form parameters\n\t\tList<NameValuePair> uniqueParams = new ArrayList<NameValuePair>();\n\t\tuniqueParams.add(new BasicNameValuePair(\"__LASTFOCUS\", \"\"));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__VIEWSTATE\", params.get(\"ViewState\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__EVENTVALIDATION\", params.get(\"EventValidation\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetNumber\", params.get(\"StreetNumber\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetName\", params.get(\"StreetName\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"EnterButton\", \"Enter\"));\n\t\t\n\t\t//get the HTML from the FCPS boundary locator web site\n\t\tString responseHtml = getFCPSBoundaryLocatorHTML(uniqueParams);\n\t\t\n\t\tif(responseHtml == null || responseHtml.isEmpty() || responseHtml.startsWith(\"Error\"))\n\t\t{\n\t\t\tMap<String, String> errMap = new HashMap<String,String>();\n\t\t\terrMap.put(\"Error\", \"Failed Post\");\n\t\t\treturn errMap;\n\t\t}\n\t\telse\t //scrape the HTML to obtain the validated address map\n\t\t\treturn scrapeValidatedAddressHTML(responseHtml.toString());\n\t}", "public com.apatar.cdyne.ws.demographix.SummaryInformation getLocationInformationByAddress(java.lang.String addressLine1, java.lang.String city, java.lang.String stateAbbrev, java.lang.String zipCode, java.lang.String licenseKey) throws java.rmi.RemoteException;", "public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }", "public static void fillUpAddAddress() throws Exception {\n\t\tString fName = Generic.ReadRandomCellData(\"Names\");\n\t\tString lName = Generic.ReadRandomCellData(\"Names\");\n\n\t\tString email = Generic.ReadFromExcel(\"Email\", \"LoginDetails\", 1);\n\t\tString mobileNum = Generic.ReadFromExcel(\"GCashNum\", \"LoginDetails\", 1);\n\t\ttry {\n\n\t\t\tsendKeys(\"CreateAccount\", \"FirstName\", fName);\n\n\t\t\tclickByLocation(\"42,783,1038,954\");\n\t\t\tenterTextByKeyCodeEvent(lName);\n\n//\t\t\tsendKeys(\"CreateAccount\", \"UnitNo\", Generic.ReadFromExcel(\"UnitNo\", \"LoginDetails\", 1));\n//\t\t\tsendKeys(\"CreateAccount\", \"StreetNo\", Generic.ReadFromExcel(\"StreetName\", \"LoginDetails\", 1));\n\t\t\tAddAddress(1);\n\t\t\tThread.sleep(2000);\n\t\t\tsendKeys(\"CreateAccount\", \"Email\", email);\n\t\t\tThread.sleep(2000);\n\t\t\tsendKeys(\"CreateAccount\", \"MobileNumber\", mobileNum);\n\t\t\tControl.takeScreenshot();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "void validate();", "void validate();", "private static boolean validateAddress(String address) {\n return !address.isEmpty();\n }", "public void validateRpd13s13()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRegistration(RegistrationModel register) {\n\t\tif (registerDao.checkAccountNoIfExist(register.getAccount_no(), register.getJai())) {\n\t\t\t// Checks if account if not Existing and not Verified \n\t\t\tif (!registerDao.checkCustomerLinkIfExist(register.getAccount_no())) {\n\t\t\t\t\tgenerateCustomerRecord(register);\n\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// Account already registered.\n\t\t\t\tVerificationModel verify = new VerificationModel();\n\t\t\t\tverify.setAccount_no(register.getAccount_no());\n\t\t\t\t\n\t\t\t\tTimestamp todayTimeStamp = new Timestamp(System.currentTimeMillis());\n\t\t\t\tTimestamp regTimeStamp = verifyDao.retireveReg_date(verify); \n\t\t\t\tlong diffHours = (regTimeStamp.getTime()-todayTimeStamp.getTime()) / (60 * 60 * 1000);\n\t\t\t\t\n\t\t\t\tif (diffHours>24) {\n\t\t\t\t\tgenerateCustomerRecord(register);\n\t\t\t\t} else {\n\t\t\t\t\t// Account already registered. Please verify your registration\n\t\t\t\t\tsetRegistrationError(\"R02\"); \n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Customer not allowed to access online service of OBS!\n\t\t\tsetRegistrationError(\"R01\"); \n\t\t}\n\t}", "@Test\r\n\tpublic void view3_todays_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"CML Service Level\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table2 = driver.findElements(view3_todays_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table2 = driver.findElements(By.xpath(view3_today_data_table));\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table2, data_of_table2 );\r\n\t}", "public static void AddAddress(int selectAddress) throws Exception {\n\t\tWebElement element = null;\n\t\tConstant.UnitNo = Generic.ReadFromExcel(\"UnitNo\", \"LoginDetails\", selectAddress);\n\t\tConstant.StreetName = Generic.ReadFromExcel(\"StreetName\", \"LoginDetails\", selectAddress);\n\t\tConstant.Province = Generic.ReadFromExcel(\"Province\", \"LoginDetails\", selectAddress);\n\t\tConstant.City = Generic.ReadFromExcel(\"City\", \"LoginDetails\", selectAddress);\n\t\tConstant.Barangay = Generic.ReadFromExcel(\"Barangay\", \"LoginDetails\", selectAddress);\n\t\tConstant.ZipCode = Generic.ReadFromExcel(\"ZipCode\", \"LoginDetails\", selectAddress);\n\t\ttry {\n\t\t\tThread.sleep(5000);\n\t\t\tsendKeys(\"CreateAccount\", \"UnitNo\", Constant.UnitNo);\n\t\t\tsendKeys(\"CreateAccount\", \"StreetNo\", Constant.StreetName);\n\t\t\tclick(\"CreateAccount\", \"Province\");\n\t\t\tThread.sleep(1000);\n\t\t\tsendKeys(\"CreateAccount\", \"EnterProvince\", Constant.Province);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.Province + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\n\t\t\t//// *[@content-desc=\"METRO MANILA, List Choice Label\"]\n\n\t\t\tThread.sleep(2000);\n\n\t\t\t// TODO BUG on-going fix\n\t\t\t// <Remarks> uncomment this after fix </Remarks>\n//\t\t\tclick(\"CreateAccount\", \"City\");\n//\t\t\tThread.sleep(1000);\n\n\t\t\tsendKeys(\"CreateAccount\", \"EnterCity\", Constant.City);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.City + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\n\t\t\tThread.sleep(2000);\n\n\t\t\t// TODO BUG on-going fix\n\t\t\t// <Remarks> uncomment this after fix </Remarks>\n//\t\t\tclick(\"CreateAccount\", \"Barangay\");\n//\t\t\tThread.sleep(1000);\n\n\t\t\tsendKeys(\"CreateAccount\", \"EnterBarangay\", Constant.Barangay);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.Barangay + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\t\t\tThread.sleep(1000);\n\t\t\tControl.takeScreenshot();\n\t\t\tscrollToText(\"This Address\"); // Add This Address || Save This Address\n\t\t\tThread.sleep(2000);\n\t\t\tclick(\"CreateAccount\", \"ZipCode\");\n\t\t\tsendKeys(\"CreateAccount\", \"ZipCode\", Constant.ZipCode);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}" ]
[ "0.7629049", "0.7400743", "0.72215533", "0.7120314", "0.7077697", "0.6601421", "0.64237225", "0.6364352", "0.633471", "0.6304059", "0.6259744", "0.625617", "0.6175701", "0.6170904", "0.6167841", "0.616304", "0.6145704", "0.6122653", "0.60972875", "0.6036235", "0.60040396", "0.59864527", "0.5926416", "0.58982164", "0.58980405", "0.5882237", "0.5875869", "0.5875444", "0.5795517", "0.57779455", "0.57383823", "0.5736385", "0.5722715", "0.56987864", "0.56968296", "0.5692917", "0.567243", "0.56605846", "0.5657289", "0.5649611", "0.56351316", "0.56240785", "0.5619253", "0.5619253", "0.5603085", "0.5598902", "0.5597992", "0.5591275", "0.55811405", "0.55727196", "0.555933", "0.5554033", "0.55536675", "0.55415666", "0.55412", "0.55407345", "0.5520186", "0.551616", "0.5508489", "0.55077755", "0.55014414", "0.5500053", "0.549032", "0.54858994", "0.5472146", "0.54659444", "0.5462666", "0.54608464", "0.54564595", "0.54535675", "0.545014", "0.54453725", "0.5444902", "0.5442257", "0.5441658", "0.54337347", "0.5426584", "0.54069996", "0.5401203", "0.53998053", "0.53961164", "0.539364", "0.5393227", "0.53818846", "0.5361818", "0.53511107", "0.5346944", "0.53349036", "0.53336453", "0.5326311", "0.53108805", "0.5303844", "0.52992433", "0.52991265", "0.52991265", "0.5297112", "0.52958417", "0.52881545", "0.5287738", "0.5286589" ]
0.778315
0
Validation Functions Description : To validate the Town/City of Installation Address in Customer Tab Coded by :Rajan Created Data:21 Oct 2016 Last Modified Date: Modified By: Parameter:
public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception { VerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll("M_Header", "Installation Address").replaceAll("M_Category", "Town/City").replaceAll("M_InnerText", TownCity), "Town/City of Installation Address - "+TownCity); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tif(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity, false))\n\t\t{\n\t\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity);\n\t\t}\n\t\t\n\t}", "public void validate_the_Town_City_of_Correspondence_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Correspondence Address - \"+TownCity, false);\n\t}", "public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Installation Address - \"+Country, false);\n\t}", "public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Installation Address - \"+Postcode, false);\n\t}", "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Installation Address - \"+AddressLine2, false);\n\t}", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Billing Address - \"+Country, false);\n\t}", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Billing Address - \"+Postcode, false);\n\t}", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "abstract void addressValidity();", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public void validate_the_Address_Line_2_of_Correspondence_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Correspondence Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private static JSONObject validateStreet(String street, String city, String state, String zip) throws Exception {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n//\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n//\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n//\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n//\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\n\t\treturn addrKeyFormat;\n\t}", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "@Test\n\tpublic void requestDataForCustomer12212_checkAddressCity_expectBeverlyHills() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "private void validateData() {\n }", "public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "private boolean isInfoValidate(){\n if(mEmailAddress.getText() == null || mEmailAddress.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_email_address);\n return false;\n }\n\n if(!mEmailAddress.getText().toString().contains(\"@\")){\n errorText = getString(R.string.register_warning_valid_email_address);\n return false;\n }\n\n// if(mRegionSpinner.getSelectedItemPosition() == Constant.NON_SELECT){\n// errorText = getString(R.string.register_warning_select_region);\n// return false;\n// }\n\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.HONG_KONG)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.HONGKONG_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n//\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.CHINA)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.CHINA_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n\n if(mPassword.getText() == null || mPassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_password);\n return false;\n }\n\n if(mRetypePassword.getText() == null || mRetypePassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_retype_password);\n return false;\n }\n\n if(!mPassword.getText().toString().equals(mRetypePassword.getText().toString())){\n errorText = getString(R.string.register_warning_not_the_same);\n return false;\n }\n\n if(!Utility.judgeContainsStr( mPassword.getText().toString())){\n errorText = getString(R.string.register_warning_contains_character);\n return false;\n }\n\n// if(!mPolicyCheckBox.isChecked()){\n// errorText = getString(R.string.register_warning_check_agreement);\n// return false;\n// }\n\n return true;\n }", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "public static Address addAddress() {\r\n\r\n\t\tSystem.out.println(\"Please enter the building number of the supplier:\");\r\n\r\n\t\tint bldNum = Validation.intValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the supplier's street name:\");\r\n\t\tString bldStreet = Validation.stringNoIntsValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the town the supplier is in:\");\r\n\t\tString bldTown = Validation.stringNoIntsValidation();\t\t\r\n\r\n\t\tSystem.out.println(\"Please enter the postcode for the supplier:\");\r\n\t\tString bldPCode = Validation.stringValidation();\r\n\r\n\t\tSystem.out.println(\"Please enter the country the supplier is in:\");\r\n\t\tString bldCountry = Validation.stringNoIntsValidation();\r\n\r\n\t\tAddress newAddress = new Address(bldNum, bldStreet, bldTown, bldPCode, bldCountry);\r\n\r\n\t\treturn newAddress;\r\n\r\n\t}", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "public boolean validData(String[] data) {\n\t\tboolean validData = true;\n\t\tint year, quarter, month;\n\t\ttry {\n\t\t\tyear = Integer.valueOf(data[0]);\n\t\t\tquarter = Integer.valueOf(data[1]);\n\t\t\tmonth = Integer.valueOf(data[2]);\n\t\t\tint CRSArrTime = Integer.valueOf(data[40]);\n\t\t\tint CRSDepTime = Integer.valueOf(data[29]);\n\t\t\tint timeZone = timeToMinute(Integer.valueOf(data[40])) - timeToMinute(Integer.valueOf(data[29])) - Integer.valueOf(data[50]);\n\t\t\tint origin_AirportID = Integer.valueOf(data[11]);\n\t\t\tint dest_AirportID = Integer.valueOf(data[20]);\n\t\t\tint origin_AirportSeqID = Integer.valueOf(data[12]);\n\t\t\tint dest_AirportSeqID = Integer.valueOf(data[21]);\n\t\t\tint origin_CityMarketID = Integer.valueOf(data[13]);\n\t\t\tint dest_CityMarketID = Integer.valueOf(data[22]);\n\t\t\tint origin_StateFips = Integer.valueOf(data[17]);\n\t\t\tint dest_StateFips = Integer.valueOf(data[26]);\n\t\t\tint origin_wac = Integer.valueOf(data[19]);\n\t\t\tint dest_wac = Integer.valueOf(data[28]);\n\t\t\tint cancelled = Integer.valueOf(data[47]);\n\t\t\tString origin = data[14];\n\t\t\tString dest = data[23];\n\t\t\tString origin_cityname = data[15];\n\t\t\tString dest_cityname = data[24];\n\t\t\tString origin_state = data[18];\n\t\t\tString dest_state = data[27];\n\t\t\tString origin_state_abr = data[16];\n\t\t\tString dest_state_abr = data[25];\n\t\t\t\n\t\t\tif ((CRSArrTime != 0 && CRSDepTime != 0) &&\n\t\t\t\t(timeZone%60 == 0) &&\t\n\t\t\t\t(origin_AirportID >0 && dest_AirportID > 0 && origin_AirportSeqID > 0 && dest_AirportSeqID > 0 \n\t\t\t\t\t\t&& origin_CityMarketID > 0 && dest_CityMarketID > 0 && origin_StateFips > 0 && dest_StateFips > 0 \n\t\t\t\t\t\t&& origin_wac > 0 && dest_wac > 0)\t&&\n\t\t\t\t(!origin.isEmpty() && !dest.isEmpty() && !origin_cityname.isEmpty() && !dest_cityname.isEmpty()\n\t\t\t\t\t\t&& !origin_state.isEmpty() && !dest_state.isEmpty() && !origin_state_abr.isEmpty() && !dest_state_abr.isEmpty())) {\n\t\t\t\t\n\t\t\t\t// for flights which are not cancelled\n\t\t\t\tif (cancelled != 1) {\n\t\t\t\t\tif (((timeToMinute(Integer.valueOf(data[41])) - timeToMinute(Integer.valueOf(data[30])) - Integer.valueOf(data[51]) - timeZone)/60)%24 == 0) {\n\t\t\t\t\t\tif (Float.valueOf(data[42]) > 0) {\n\t\t\t\t\t\t\tif (Float.valueOf(data[42]).equals(Float.valueOf(data[43])))\n\t\t\t\t\t\t\t\tvalidData = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Float.valueOf(data[42]) < 0) {\n\t\t\t\t\t\t\tif (Float.valueOf(data[43]) == 0)\n\t\t\t\t\t\t\t\tvalidData = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Float.valueOf(data[43]) >= 15) {\n\t\t\t\t\t\t\tif (Float.valueOf(data[44]) == 1)\n\t\t\t\t\t\t\t\tvalidData = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// fill map\n\t\tif ((year == 2015) && (quarter == 1) && (month == 1)) {\n\t\t\ttry {\n\t\t\t\tString carrier = data[8];\n\t\t\t\tfloat price = Float.valueOf(data[109]);\n\t\t\t\t\n\t\t\t\tif (map_t.containsKey(carrier)) {\n\t\t\t\t\tArrayList<Float> list = map_t.get(carrier);\n\t\t\t\t\tlist.add(price);\n\t\t\t\t\tmap_t.put(carrier, list);\n\t\t\t\t} else {\n\t\t\t\t\tArrayList<Float> list = new ArrayList<Float>();\n\t\t\t\t\tlist.add(price);\n\t\t\t\t\tmap_t.put(carrier, list);\n\t\t\t\t}\t\t\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t}\n\t\t}\t\t\t\n\t\treturn validData;\n\t}", "@Test\n public void testIncorrectPostalCode(){\n UserRegisterKYC tooLong = new UserRegisterKYC(\"hello\",validId3,\"30/03/1995\",\"7385483\");\n int requestResponse = tooLong.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC tooShort = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"48532\");\n requestResponse = tooShort.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC startWith74 = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"746532\");\n requestResponse = startWith74.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC startWithMoreThan82 = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"967532\");\n requestResponse = startWithMoreThan82.sendRegisterRequest();\n assertEquals(400,requestResponse);\n }", "public void VerifyCouponfieldsinCheckout(){\r\n\t\tString countriess1 = \"Denmark,France,PresselSwitzerland,Norway,Spain,BernardFrance,,BernardBelgium,PresselAustria,UK,PresselGermany\";\r\n\t\tString countriess2 = \"Germany,Spain\";\r\n\t\tString countriess3 = \"Netherland,Italy\";\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Cupon Input txt box and Apply button should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(countriess1.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput2inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput3inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"3 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"3 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess2.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"1 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"1 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else if(countriess3.contains(countries.get(countrycount))){\r\n\t\t\t\tif(isElementPresent(locator_split(\"txtCouponinput1inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"txtCouponinput2inCheckout\")) &\r\n\t\t\t\t\t\tisElementPresent(locator_split(\"btnCuponApplybuttoninCheckout\"))){\r\n\t\t\t\t\tSystem.out.println(\"2 cupon input box and apply button is present for -\"+countries.get(countrycount));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"2 cupon or apply buttons is not present for -\"+countries.get(countrycount));\r\n\t\t\t\t\tthrow new Error();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"incorret country is entered in method for -\"+countries.get(countrycount));\r\n\t\t\t\tthrow new Exception();\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Incorrect country is entered in method for -\"+countries.get(countrycount)+\" or\"\r\n\t\t\t\t\t+ \" Element not found\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"imgShiptoStoreinCartinCheckout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\t\tcatch(Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Number of cupons is not matching for country or Apply button not present for-\"+countries.get(countrycount));\r\n\t\t\tthrow new Error(\"Number of cupons is not matching for country or Apply button not present for-\"+countries.get(countrycount));\r\n\t\t}\r\n\r\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public static void AddAddress(int selectAddress) throws Exception {\n\t\tWebElement element = null;\n\t\tConstant.UnitNo = Generic.ReadFromExcel(\"UnitNo\", \"LoginDetails\", selectAddress);\n\t\tConstant.StreetName = Generic.ReadFromExcel(\"StreetName\", \"LoginDetails\", selectAddress);\n\t\tConstant.Province = Generic.ReadFromExcel(\"Province\", \"LoginDetails\", selectAddress);\n\t\tConstant.City = Generic.ReadFromExcel(\"City\", \"LoginDetails\", selectAddress);\n\t\tConstant.Barangay = Generic.ReadFromExcel(\"Barangay\", \"LoginDetails\", selectAddress);\n\t\tConstant.ZipCode = Generic.ReadFromExcel(\"ZipCode\", \"LoginDetails\", selectAddress);\n\t\ttry {\n\t\t\tThread.sleep(5000);\n\t\t\tsendKeys(\"CreateAccount\", \"UnitNo\", Constant.UnitNo);\n\t\t\tsendKeys(\"CreateAccount\", \"StreetNo\", Constant.StreetName);\n\t\t\tclick(\"CreateAccount\", \"Province\");\n\t\t\tThread.sleep(1000);\n\t\t\tsendKeys(\"CreateAccount\", \"EnterProvince\", Constant.Province);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.Province + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\n\t\t\t//// *[@content-desc=\"METRO MANILA, List Choice Label\"]\n\n\t\t\tThread.sleep(2000);\n\n\t\t\t// TODO BUG on-going fix\n\t\t\t// <Remarks> uncomment this after fix </Remarks>\n//\t\t\tclick(\"CreateAccount\", \"City\");\n//\t\t\tThread.sleep(1000);\n\n\t\t\tsendKeys(\"CreateAccount\", \"EnterCity\", Constant.City);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.City + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\n\t\t\tThread.sleep(2000);\n\n\t\t\t// TODO BUG on-going fix\n\t\t\t// <Remarks> uncomment this after fix </Remarks>\n//\t\t\tclick(\"CreateAccount\", \"Barangay\");\n//\t\t\tThread.sleep(1000);\n\n\t\t\tsendKeys(\"CreateAccount\", \"EnterBarangay\", Constant.Barangay);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.Barangay + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\t\t\tThread.sleep(1000);\n\t\t\tControl.takeScreenshot();\n\t\t\tscrollToText(\"This Address\"); // Add This Address || Save This Address\n\t\t\tThread.sleep(2000);\n\t\t\tclick(\"CreateAccount\", \"ZipCode\");\n\t\t\tsendKeys(\"CreateAccount\", \"ZipCode\", Constant.ZipCode);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "@Test\r\n\tpublic void view3_todays_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"CML Service Level\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table2 = driver.findElements(view3_todays_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table2 = driver.findElements(By.xpath(view3_today_data_table));\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table2, data_of_table2 );\r\n\t}", "private void checkValidation() {\n String getInstituteName = NameofInstitute.getText().toString();\n String getDegreename = SpinnerDegree.getSelectedItem().toString();\n\n\n // Check if all strings are null or not\n if (getInstituteName.equals(\"\") || getInstituteName.length() == 0 || getDegreename.equals(\"\") || getDegreename.length() == 0)\n new CustomToast().Show_Toast(getActivity(), getView(),\"All fields are required.\");\n // Else do signup or do your stuff\n else {\n //Toast.makeText(getActivity(), \"All Ok till Now\", Toast.LENGTH_SHORT).show();\n AddQualifications(getDegreename,getInstituteName);\n }\n\n }", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "public void validate_the_Telephone_Home_in_Contact_Details_of_Customer_Tab(String TelephoneHome)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneHome.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Home\").replaceAll(\"M_InnerText\", TelephoneHome), \"Telephone - Home - \"+TelephoneHome, false);\n\t}", "public static Customer validateCustomer(TextField shopname, TextField shopcontact, TextField streetadd, ComboBox area, TextField city, TextField zip) {\r\n Customer customer = new Customer();\r\n customer = null;\r\n\r\n if (shopname.getText().isEmpty() || shopcontact.getText().isEmpty() || streetadd.getText().isEmpty()\r\n || city.getText().isEmpty()\r\n || zip.getText().isEmpty() || area.getValue() == null) {\r\n new PopUp(\"Name Error\", \"Field is Empty\").alert();\r\n } else if (!shopcontact.getText().matches(\"\\\\d{10}\")) {\r\n new PopUp(\"Name Error\", \"Contact must be 10 Digit\").alert();\r\n } else if (!zip.getText().matches(\"\\\\d{6}\")) {\r\n new PopUp(\"Error\", \"Zip Code must be 6 Digit\").alert();\r\n } else {\r\n customer.setShopName(shopname.getText());\r\n customer.setShopCont(Long.valueOf(shopcontact.getText()));\r\n customer.setStreetAdd(streetadd.getText());\r\n customer.setArea(area.getValue().toString());\r\n customer.setCity(city.getText());\r\n customer.setZipcode(Integer.valueOf(zip.getText()));\r\n }\r\n\r\n return customer;\r\n }", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "private int completionCheck() {\n if (nameTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(1);\n return -1;\n }\n if (addressTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(2);\n return -1;\n }\n if (postCodeTB.getText().trim().isEmpty()){\n AlertMessage.addCustomerError(3);\n return -1;\n }\n if (countryCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(4);\n return -1;\n }\n if (stateProvinceCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(5);\n return -1;\n }\n if (phone.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(6);\n return -1;\n }\n return 1;\n }", "public static void main(String[] args) {\n Identification identification1 = new IdentificationGermany(\"ABC.203948ASFJH\");\n Identification identification2 = new IdentificationGermany(\"XYA-LKJASD\");\n Identification identification3 = new IdentificationGermany(\"12345678\");\n\n Identification identification4 = new IdentificationNetherlands(\"12345678\");\n Identification identification5 = new IdentificationNetherlands(\"123409\");\n Identification identification6 = new IdentificationNetherlands(\"ASBCLKJS\");\n\n validate(identification1);\n validate(identification2);\n validate(identification3);\n validate(identification4);\n validate(identification5);\n validate(identification6);\n }", "private void validateUpdateCustomers(List<CustomersInputDTO> customers, String formatDate) {\n // inner validate\n if (customers == null || customers.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(ConstantsCustomers.CUSTOMERS, Constants.RIQUIRED_CODE));\n }\n // validate common\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n List<Map<String, Object>> customParams = new ArrayList<>();\n customers.forEach(cus -> {\n Map<String, Object> customField = new HashMap<>();\n customField.put(\"rowId\", cus.getCustomerId());\n customField.putAll(buildParamsValidateCustomersInput(cus, jsonBuilder));\n customParams.add(customField);\n });\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n customParams, formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n List<Map<String, Object>> listValidate = CustomersCommonUtil.validateCommon(validateJson, restOperationUtils,\n token, tenantName);\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public boolean isAddressLine1Valid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtAddressLine1.getText().trim().length() > 0)\n\t\t\t\treturn true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtAddressLine1.getText().trim().length() > 0) {\n\t\t\t\treturn true;\n\t\t}\n\t\ttxtAddressLine1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"AddressLine1: This field is required.\"));\n\t}", "@Test(priority = 5)\n\tpublic void verify_Weather_Data_Appears_OnSearching_By_City_StateCodeAndCountryCode() {\n\t\tWeatherAPI.getWeatherInfo(ReadWrite.getProperty(\"Noida_City_State_Country\"),\n\t\t\t\tConfigFileReader.getProperty(\"appid\"), 200);\n\n\t}", "private String validarEntradas()\n { \n return Utilitarios.validarEntradas(campoNomeAC, campoEnderecoAC, campoBairroAC, campoCidadeAC, campoUfAC, campoCepAC, campoTelefoneAC, campoEmailAC);\n }", "private void validate() throws FlightCreationException {\n validateNotNull(\"number\", number);\n validateNotNull(\"company name\", companyName);\n validateNotNull(\"aircraft\", aircraft);\n validateNotNull(\"pilot\", pilot);\n validateNotNull(\"origin\", origin);\n validateNotNull(\"destination\", destination);\n validateNotNull(\"departure time\", scheduledDepartureTime);\n\n if (scheduledDepartureTime.isPast()) {\n throw new FlightCreationException(\"The departure time cannot be in the past\");\n }\n\n if (origin.equals(destination)) {\n throw new FlightCreationException(\"The origin and destination cannot be the same\");\n }\n }", "private void fillCity() {\n \n if(postalCodeTF.getText().length() == 4){\n City city = memberConnection.getCity(postalCodeTF.getText());\n cityTF.setText(city.getCity().replaceAll(\"_\", \" \"));\n municipalTF.setText(city.getMunicipal().replaceAll(\"_\", \" \"));\n }\n }", "@Test( dataProvider=\"AddressValidationTestData\", groups ={\"BillingAddressValidations\"})\r\n\r\n\tpublic static void AddNewBillingAddress(String[] BillingAddressDetailsInArray){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tAssert.assertEquals( launchAndValidateDifferentBillingAddresses(BillingAddressDetailsInArray) ,true) ;\t\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\t\t\r\n\t}", "public Customer(String firstName, String lastName, String emailAddress, String street, String houseNumber, String postalCode, String town, String country, boolean isOwner) throws InvalidEmailException {\n _firstName = firstName;\n _lastName = lastName;\n _emailAddress = new EmailType(emailAddress);\n _address = new AddressType(street, houseNumber, postalCode, town, country); //added adress in Constructor\n _orders = new ArrayList<Order>();\n _isOwner = isOwner;\n _spaces = new ArrayList<Space>();\n\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public boolean isCityValid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtCity.getText().trim().length() > 0)\n\t\t return true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtCity.getText().trim().length() > 0) {\n\t\t\treturn true;\n\t\t}\n\t\ttxtCity.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"Town / City: This field is required.\"));\n\t}", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "public Address validate(Client client, String address) throws BytomException {\n\t\t\tMap<String, Object> req = new HashMap<String, Object>();\n\t\t\treq.put(\"address\", address);\n\t\t\treturn client.request(\"validate-address\", req, Address.class);\n\t\t}", "abstract void fiscalCodeValidity();", "private static boolean validateAddress(String address) {\n return !address.isEmpty();\n }", "@Test(priority = 1, dataProvider = \"wrongcityinput\", dataProviderClass = TestDataProvider.class)\n\tpublic void correctCityValidation(String fromCity, String toCity) throws InterruptedException {\n\t\tlogger = extent.startTest(\"City Validaton\");\n\t\tlog.info(\"Starting wrong City Input validation\");\n\t\tHomePageFlow.cityInput(fromCity, toCity);\n\t\thome.isMessageDisplayed();\n\t\tCommonUtility.clickElement(YatraFlightBookingLocators.getLocators(\"loc.inputbox.goingTo\"));\n\t\tCommonUtility.isDisplayed(YatraFlightBookingLocators.getLocators(\"loc.selectDepartCity.txt\"));\n\n\t\tCommonUtility.clickAndSendText(YatraFlightBookingLocators.getLocators(\"loc.inputbox.goingTo\"), 2, \"BLR\");\n\t\tCommonUtility.action();\n\t}", "@Test\r\n\tpublic void view3_COEs_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\t\t//Table 3 - Data .\r\n\t\tList<WebElement> data_of_table3 = driver.findElements(view3_COEs_table_data_val);\r\n\t\t//Table 3 - Columns\r\n\t\tList<WebElement> col_of_table3 = driver.findElements(By.xpath(view3_curr_agent_stats_col));\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> updated_col_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t\r\n\t\t//Adding Column data from another table.\r\n\t\tdata_of_table3 = helper.modify_cols_data_of_table(col_of_table1, data_of_table3, updated_col_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table3, data_of_table3 );\r\n\t}", "public void validate() throws CruiseControlException {\n ValidationHelper.assertIsSet(getMailHost(), \"mailhost\", this.getClass());\n ValidationHelper.assertIsSet(getReturnAddress(), \"returnaddress\", this.getClass());\n ValidationHelper.assertFalse(getUsername() != null && getPassword() == null,\n \"'password' is required if 'username' is set for email.\");\n ValidationHelper.assertFalse(getPassword() != null && getUsername() == null,\n \"'username' is required if 'password' is set for email.\");\n \n for (int i = 0; i < alertAddresses.length; i++) {\n try {\n alertAddresses[i].fileFilter = new GlobFilenameFilter(alertAddresses[i].fileRegExpr);\n } catch (MalformedCachePatternException mcpe) {\n ValidationHelper.fail(\"invalid regexp '\" + alertAddresses[i].fileRegExpr + \"'\", mcpe);\n }\n }\n }", "public static void validation() {\n\t\tif ((!textFieldName.getText().isEmpty()) && (!textField_FirstName.getText().isEmpty())\n\t\t\t\t&& (!textField_Town.getText().isEmpty()) && (!textField_Town.getText().isEmpty())) {\n\n\t\t\tif ((isValidEmailAddress(textField_Email.getText()) == true)) {\n\t\t\t\ttextField_Email.setBackground(Color.white);\n\t\t\t\tif ((force(textField_Mtp.getText()) > 82)) {\n\t\t\t\t\ttextField_Mtp.setBackground(Color.white);\n\t\t\t\t\tactionGiveServeur();\n\n\t\t\t\t} else {\n\t\t\t\t\tshowMessageDialog(null, \"Votre mot de passe est trop faible\");\n\t\t\t\t\ttextField_Mtp.setText(\"Mot de passe trop simple : changer le \");\n\t\t\t\t\ttextField_Mtp.setBackground(Color.RED);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextField_Email.setText(\"Email invalide\");\n\t\t\t\ttextField_Email.setBackground(Color.RED);\n\t\t\t\tshowMessageDialog(null, \"Email est invalide\");\n\t\t\t}\n\t\t} else {\n\n\t\t\tshowMessageDialog(null, \"Certain champs sont vide !\");\n\t\t}\n\t}", "public com.apatar.cdyne.ws.demographix.SummaryInformation getLocationInformationByAddress(java.lang.String addressLine1, java.lang.String city, java.lang.String stateAbbrev, java.lang.String zipCode, java.lang.String licenseKey) throws java.rmi.RemoteException;", "public void SetCreditCarddetails(String ccnumber, String ccname, String ccmonth, String ccyear, String ccseccode){\r\n\t\tString countrygroup_ccdetails= \"UK,PresselAustria\";\r\n\t\tString CCnum = getValue(ccnumber);\r\n\t\tString CCName = getValue(ccname);\r\n\t\tString CCMonth = getValue(ccmonth);\r\n\t\tString CCYear = getValue(ccyear);\r\n\t\tString CCSecCode = getValue(ccseccode);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+CCnum+\", \"+CCName+\", \"+CCMonth+\", \"+CCYear+\", \"+CCSecCode);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The CreditCard details should be entered\");\r\n\t\ttry{\r\n\t\t\tif(!(countrygroup_ccdetails).contains(countries.get(countrycount))){\r\n\t\t\t\tswitchframe(\"TokenizationPage\");\r\n\t\t\t\tsleep(2000);\r\n\t\t\t\tsendKeys(locator_split(\"txtCCnumber\"), CCnum);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCname\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCname\"), CCName);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCMonth\"), CCMonth);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCYear\"), CCYear);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCcode\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCcode\"), CCSecCode);\t\t\t\t\t\t\r\n\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The CreditCard details are entered\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The new CreditCard details are applicable to this \" +country);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- The CreditCard details are not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"One of the element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCnumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCname\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCMonth\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCYear\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCcode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" are not found\");\r\n\r\n\t\t}\r\n\t}", "public void validate() {}", "public void ValidationData() {\n try {\n ConnectionClass connectionClass = new ConnectionClass();\n connect = connectionClass.CONN();\n if (connect == null) {\n ConnectionResult = \"Check your Internet Connection\";\n } else {\n String query = \"Select No from machinestatustest where Line='\" + Line + \"' and Station = '\" + Station + \"'\";\n Statement stmt = connect.createStatement();\n ResultSet rs = stmt.executeQuery(query);\n if (rs.next()) {\n Validation = rs.getString(\"No\");\n }\n ConnectionResult = \"Successfull\";\n connect.close();\n }\n } catch (Exception ex) {\n ConnectionResult = ex.getMessage();\n }\n }", "public boolean validateContactAddress(String contactId, List<String> result)\n {\n return true;\n }", "private Map<String,String> getValidatedAddressInfo(Map<String,String> params) throws ClientProtocolException, IOException \n\t{\n\t\t// Create unique form parameters\n\t\tList<NameValuePair> uniqueParams = new ArrayList<NameValuePair>();\n\t\tuniqueParams.add(new BasicNameValuePair(\"__LASTFOCUS\", \"\"));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__VIEWSTATE\", params.get(\"ViewState\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__EVENTVALIDATION\", params.get(\"EventValidation\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetNumber\", params.get(\"StreetNumber\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetName\", params.get(\"StreetName\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"EnterButton\", \"Enter\"));\n\t\t\n\t\t//get the HTML from the FCPS boundary locator web site\n\t\tString responseHtml = getFCPSBoundaryLocatorHTML(uniqueParams);\n\t\t\n\t\tif(responseHtml == null || responseHtml.isEmpty() || responseHtml.startsWith(\"Error\"))\n\t\t{\n\t\t\tMap<String, String> errMap = new HashMap<String,String>();\n\t\t\terrMap.put(\"Error\", \"Failed Post\");\n\t\t\treturn errMap;\n\t\t}\n\t\telse\t //scrape the HTML to obtain the validated address map\n\t\t\treturn scrapeValidatedAddressHTML(responseHtml.toString());\n\t}", "private boolean formComplete(){\r\n return NAME_FIELD.getLength()>0 && ADDRESS_1_FIELD.getLength()>0 &&\r\n CITY_FIELD.getLength()>0 && ZIP_FIELD.getLength()>0 && \r\n COUNTRY_FIELD.getLength()>0 && PHONE_FIELD.getLength()>0; \r\n }", "private boolean validateFields() {\n\t\tList<String> errorMsg = new ArrayList<>();\n\n\t\tif (aliasField.getText().equals(\"\"))\n\t\t\terrorMsg.add(\"Alias cannot be left empty.\\n\");\n\n\t\tif (carComboBox.getValue() == null)\n\t\t\terrorMsg.add(\"A car should be assigned to the trip.\\n\");\n\n\t\tif (routeComboBox.getValue() == null)\n\t\t\terrorMsg.add(\"A route should be assigned to the trip.\\n\");\n\n\t\tfor (StopPoint stopPoint : stopPoints) {\n\t\t\tif (stopPoint.getTime() == null || stopPoint.getTime().equals(\"\"))\n\t\t\t\terrorMsg.add(\"You need to set an arriving time for '\" + stopPoint.toString() + \"'.\\n\");\n\t\t}\n\n\t\tif (endDatePicker.getValue() != null && startDatePicker.getValue() != null)\n\t\t{\n\t\t\tif (startDatePicker.getValue().isBefore(LocalDate.now())) {\n\t\t\t\terrorMsg.add(\"Trip start date should be after current date.\\n\");\n\t\t\t} else if (endDatePicker.getValue().isBefore(startDatePicker.getValue())) {\n\t\t\t\terrorMsg.add(\"Trip end date should be after start date.\\n\");\n\t\t\t} else {\n\t\t\t\tSet<DayOfWeek> recurrence = RecurrenceUtility.parseBitmaskToSet(getRecurrence());\n\t\t\t\tboolean isValidRecurrence = false;\n\t\t\t\tfor (LocalDate now = startDatePicker.getValue(); !now.isAfter(endDatePicker.getValue()); now = now.plusDays(1)) {\n\t\t\t\t\tif (recurrence.contains(now.getDayOfWeek()))\n\t\t\t\t\t\tisValidRecurrence = true;\n\t\t\t\t}\n\t\t\t\tif (!isValidRecurrence) {\n\t\t\t\t\terrorMsg.add(\"No recurrent day exists between trip start date and end date.\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\terrorMsg.add(\"Trip starts date or/and end date is invalid.\\n\");\n\t\t}\n\n\t\t// consistency check\n\t\t// WOF & registration cannot be expired before the end date of recurring trip\n\t\tCar car = carComboBox.getValue();\n\t\tif (endDatePicker.getValue() != null && startDatePicker.getValue() != null && car != null) {\n\t\t\tif (LocalDate.parse(car.getWof()).isBefore(endDatePicker.getValue()) ||\n\t\t\tLocalDate.parse(car.getRegistration()).isBefore(endDatePicker.getValue())) {\n\t\t\t\terrorMsg.add(String.format(\"The expiration date of a recurring trip cannot occur after the expiry date of car's WOF and registration.\\n\" +\n\t\t\t\t\t\t\t\t\"------------------------------------------------\\n\" +\n\t\t\t\t\t\t\t\t\"Details for car [%s]:\\n\" +\n\t\t\t\t\t\t\t\t\" a. WOF expire date is %s.\\n\" +\n\t\t\t\t\t\t\t\t\" b. Registration expire date is %s.\\n\" +\n\t\t\t\t\t\t\t\t\"------------------------------------------------\\n\",\n\t\t\t\t\t\tcar.getPlate(), car.getWof(), car.getRegistration()));\n\t\t\t}\n\t\t}\n\n\t\t// handle and show error message in dialog\n\t\tif (errorMsg.size() != 0) {\n\t\t\tStringBuilder errorString = new StringBuilder(\"Operation failed is caused by: \\n\");\n\t\t\tfor (Integer i = 1; i <= errorMsg.size(); i++) {\n\t\t\t\terrorString.append(i.toString());\n\t\t\t\terrorString.append(\". \");\n\t\t\t\terrorString.append(errorMsg.get(i - 1));\n\t\t\t}\n\t\t\tString headMsg = mode == Mode.ADD_MODE ? \"Failed to add the trip.\" : \"Failed to update the trip.\";\n\t\t\trss.showErrorDialog(headMsg, errorString.toString());\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private static void validateEntity(AdminOffice entity) throws ValidationException {\n\t\t//Validator.validateStringField(\"officeName\", entity.getOfficeName(), 55, true);\n\t\t//Validator.validateStringField(\"phone\", entity.getPhone(), 12, false);\t\t\n\t}", "void addressValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n }", "private boolean validFormInputs() {\n String email = etEmail.getText().toString();\n String password = etPassword.getText().toString();\n String institutionName = etInstitutionName.getText().toString();\n String addressFirst = etInstitutionAddressFirst.getText().toString();\n String addressSecond = etInstitutionAddressSecond.getText().toString();\n String CIF = etCIF.getText().toString();\n\n String[] allInputs = {email, password, institutionName, addressFirst, addressSecond, CIF};\n for (String currentInput : allInputs) {\n if (currentInput.matches(\"/s+\")) // Regex pt cazul cand stringul e gol sau contine doar spatii\n return false; // formular invalid - toate inputurile trebuie sa fie completate\n }\n String[] stringsAddressFirst = addressFirst.split(\",\");\n String[] stringsAddressSecond = addressSecond.split(\",\");\n if (stringsAddressFirst.length != 4 ||\n stringsAddressSecond.length != 3)\n return false;\n\n //<editor-fold desc=\"Checking if NUMBER and APARTMENT are numbers\">\n try {\n Integer.parseInt(stringsAddressSecond[0]);\n Integer.parseInt(stringsAddressSecond[2]);\n return true; // parsed successfully without throwing any parsing exception from string to int\n }catch (Exception e) {\n Log.v(LOG_TAG, \"Error on converting input to number : \" + e);\n return false; // parsed unsuccessfully - given strings can not be converted to int\n }\n //</editor-fold>\n }", "private static boolean validateCity(String city) {\n return !city.isEmpty();\n }", "private boolean validateInputs(String iStart, String iEnd, String country, String type) {\n \thideErrors();\n \tint validStart;\n \tint validEnd;\n boolean valid = true;\n// \t//will not occur due to UI interface\n// if (isComboBoxEmpty(type)) {\n// \tvalid = false;\n// \tT3_type_error_Text.setVisible(true);\n// }\n if (isComboBoxEmpty(country)) {\n \tvalid = false;\n \tT3_country_error_Text.setVisible(true);\n }\n \t//checking if start year and end year are set\n if (isComboBoxEmpty(iStart)){\n //start is empty\n T3_start_year_error_Text.setVisible(true);\n valid = false;\n }\n if (isComboBoxEmpty(iEnd)){\n //end is empty\n T3_end_year_error_Text.setVisible(true);\n valid = false;\n }\n \tif (valid){\n //if years are not empty and valid perform further testing\n \t\t//fetch valid data range\n \tPair<String,String> validRange = DatasetHandler.getValidRange(type, country);\n \tvalidStart = Integer.parseInt(validRange.getKey());\n \tvalidEnd = Integer.parseInt(validRange.getValue());\n //check year range validity\n \t\tint start = Integer.parseInt(iStart);\n \t\tint end = Integer.parseInt(iEnd);\n \tif (start>=end) {\n \t\tT3_range_error_Text.setText(\"Start year should be < end year\");\n \t\tT3_range_error_Text.setVisible(true);\n \t\tvalid=false;\n \t}\n// \t//will not occur due to UI interface\n// \telse if (start<validStart) {\n// \t\tT3_range_error_Text.setText(\"Start year should be >= \" + Integer.toString(validStart));\n// \t\tT3_range_error_Text.setVisible(true);\n// \t\tvalid=false;\n// \t}else if (end>validEnd) {\n// \t\tT3_range_error_Text.setText(\"End year should be <= \" + Integer.toString(validEnd));\n// \t\tT3_range_error_Text.setVisible(true);\n// \t\tvalid=false;\n// \t}\n \t}\n// \t//will not occur due to UI interface\n// \tif(isComboBoxEmpty(type)) {\n// \t\t//if type is not set\n// T3_type_error_Text.setVisible(true);\n// \t}\n \t\n if(isComboBoxEmpty(country)) {\n //if country is not set\n T3_country_error_Text.setVisible(true);\n }\n \treturn valid;\n }", "public void mo38839a(BrandsValidation brandsValidation) {\n }", "public boolean validate() {\n\n String plate = _licensePlate.getText().toString();\n\n if(plate.isEmpty() || plate.length() < 8)\n return false;\n\n else if(plate.charAt(2) == '-' || plate.charAt(5) == '-') {\n\n if (Character.isUpperCase(plate.charAt(0)) && Character.isUpperCase(plate.charAt(1))) { // first case\n if (Character.isDigit(plate.charAt(3)) && Character.isDigit(plate.charAt(4))\n && Character.isDigit(plate.charAt(6)) && Character.isDigit(plate.charAt(7)))\n return true;\n }\n\n else if(Character.isUpperCase(plate.charAt(3)) && Character.isUpperCase(plate.charAt(4))) { // second case\n if (Character.isDigit(plate.charAt(0)) && Character.isDigit(plate.charAt(1))\n && Character.isDigit(plate.charAt(6)) && Character.isDigit(plate.charAt(7)))\n return true;\n }\n\n else if(Character.isUpperCase(plate.charAt(6)) && Character.isUpperCase(plate.charAt(7))) { // third case\n if (Character.isDigit(plate.charAt(0)) && Character.isDigit(plate.charAt(1))\n && Character.isDigit(plate.charAt(3)) && Character.isDigit(plate.charAt(4)))\n return true;\n }\n\n else\n return false;\n\n }\n\n return false;\n }", "void validate(T regData, Errors errors);", "void validate();", "void validate();", "@Test\n\tpublic void validateCountry() {\n\t\tRequestSpecification requestSpecification = new base().getRequestSpecification();\n\t\tgiven().get(Endpoint.GET_COUNTRY).then().statusCode(200).\n\t\tand().contentType(ContentType.JSON).\n\t\tand().body(\"name\", hasItem(\"India\")).\n\t\tand().body(\"find { d -> d.name == 'India' }.borders\", hasItem(\"CHN\"));\n\n\t}", "public boolean validation(){\n String Venuename= venuename.getText().toString();\n String Address= address.getText().toString();\n String Details= details.getText().toString();\n String Venueimage= venueimage.getText().toString();\n if(Venuename.isEmpty()){\n venuename.setError(\"Please enter the item name\");\n venuename.requestFocus();\n return false;\n }\n if(Address.isEmpty()){\n address.setError(\"Please enter the item name\");\n address.requestFocus();\n return false;\n }\n if(Details.isEmpty()){\n details.setError(\"Please enter the item name\");\n details.requestFocus();\n return false;\n }\n if(Venueimage.isEmpty()){\n venueimage.setError(\"Please Select the image first\");\n return false;\n }\n\n\n return true;\n }" ]
[ "0.69791865", "0.683683", "0.66465473", "0.6593583", "0.6558637", "0.65175176", "0.65091276", "0.6223212", "0.62062174", "0.6206127", "0.6204994", "0.61913806", "0.61522245", "0.61362493", "0.61012477", "0.60863006", "0.60624725", "0.60519665", "0.60519326", "0.6049491", "0.60093635", "0.5988578", "0.5958467", "0.5955772", "0.59501326", "0.5949225", "0.58873177", "0.58604", "0.5854953", "0.58433574", "0.5841175", "0.58122355", "0.5780879", "0.5746684", "0.5741422", "0.57064384", "0.5693321", "0.56843686", "0.5632788", "0.5627986", "0.5569553", "0.5548892", "0.5530938", "0.5512484", "0.549938", "0.54936755", "0.5482804", "0.5473789", "0.5466477", "0.54651904", "0.54627806", "0.546168", "0.54578304", "0.5454865", "0.543197", "0.5425234", "0.5419416", "0.5418425", "0.54135185", "0.5393586", "0.53775746", "0.537461", "0.5357277", "0.53550684", "0.5346976", "0.5337827", "0.5332905", "0.533029", "0.5330052", "0.532903", "0.532903", "0.5319809", "0.5316008", "0.53145105", "0.5311657", "0.53087455", "0.5297012", "0.5281138", "0.52806574", "0.52798903", "0.52748865", "0.5269871", "0.5266319", "0.5259303", "0.52563775", "0.5248183", "0.5246082", "0.52418", "0.5241443", "0.523953", "0.5233926", "0.5232819", "0.5232147", "0.52286506", "0.5222767", "0.5217275", "0.5216453", "0.5216453", "0.5201814", "0.5201584" ]
0.7360238
0
Validation Functions Description : To validate the Address Line 2 of Installation Address in Customer Tab Coded by :Rajan Created Data:21 Oct 2016 Last Modified Date: Modified By: Parameter:
public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll("M_Header", "Installation Address").replaceAll("M_Category", "Country").replaceAll("M_InnerText", Country), "Country of Installation Address - "+Country, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Installation Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_2_of_Correspondence_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Correspondence Address - \"+AddressLine2, false);\n\t}", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Installation Address - \"+Postcode, false);\n\t}", "public boolean isAddressLine1Valid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtAddressLine1.getText().trim().length() > 0)\n\t\t\t\treturn true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtAddressLine1.getText().trim().length() > 0) {\n\t\t\t\treturn true;\n\t\t}\n\t\ttxtAddressLine1.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"AddressLine1: This field is required.\"));\n\t}", "public boolean isAddressLine2Valid() throws BusinessRuleException {\n\t\treturn true;\n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Installation Address - \"+TownCity);\n\t\t\t\n\t\t\t\n\t\t\n\t}", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "abstract void addressValidity();", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Billing Address - \"+Postcode, false);\n\t}", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "private void validateLine1304(Errors errors) {\n }", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Billing Address - \"+Country, false);\n\t}", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public static Address addAddress() {\r\n\r\n\t\tSystem.out.println(\"Please enter the building number of the supplier:\");\r\n\r\n\t\tint bldNum = Validation.intValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the supplier's street name:\");\r\n\t\tString bldStreet = Validation.stringNoIntsValidation();\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the town the supplier is in:\");\r\n\t\tString bldTown = Validation.stringNoIntsValidation();\t\t\r\n\r\n\t\tSystem.out.println(\"Please enter the postcode for the supplier:\");\r\n\t\tString bldPCode = Validation.stringValidation();\r\n\r\n\t\tSystem.out.println(\"Please enter the country the supplier is in:\");\r\n\t\tString bldCountry = Validation.stringNoIntsValidation();\r\n\r\n\t\tAddress newAddress = new Address(bldNum, bldStreet, bldTown, bldPCode, bldCountry);\r\n\r\n\t\treturn newAddress;\r\n\r\n\t}", "public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tif(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity, false))\n\t\t{\n\t\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity);\n\t\t}\n\t\t\n\t}", "private void validateData() {\n }", "public abstract String getAddressLine2();", "public void setAddressline2(String addressline2) {\n this.addressline2 = addressline2;\n }", "public void setAddressLine2(String addressLine2) {\n this.addressLine2 = addressLine2;\n }", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validateRpd13s2()\n {\n // This guideline cannot be automatically tested.\n }", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public abstract String getAddressLine1();", "public void validate_the_Town_City_of_Correspondence_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Correspondence Address - \"+TownCity, false);\n\t}", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "public void validateRpd14s1()\n {\n // This guideline cannot be automatically tested.\n }", "@Test\n public void testCreateLabelInvoiceBarcode_AddressValidation_Failure()\n {\n \t\n \ttry {\n \t\t\n \t\tlogger.info(\"Testing creation of label, invoice and barcode for failure scenario .\");\n \t\tString fileName = \"./com/cts/ptms/carrier/yrc/resources/InputData_Standard_AddressValidation_Failure.xml\";\n\t \tURL url = getClass().getClassLoader().getResource(fileName);\n\t\t\tshipmentRequest.setFileName(url.getFile());\n \t\tshipmentRequest.setCarrier(\"YRC\");\n\t \tshipmentRequest.setGenLabel(true);\n\t \tshipmentResponse = yrcSoapClient.createShipmentRequest(shipmentRequest);\n\t \tlogger.info(\"Status:\"+shipmentResponse );\n\t \t\n\t \tassertEquals(\"ERROR\", shipmentResponse.getStatus());\n\t\t\t\n \t} \n\t\tcatch(Exception e)\n\t\t{\n\t\t\tassertEquals(\"Failure\", \"Failure\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Exception occured\"+e.getMessage());\n\t\t}\n \t\n }", "public Address validate(Client client, String address) throws BytomException {\n\t\t\tMap<String, Object> req = new HashMap<String, Object>();\n\t\t\treq.put(\"address\", address);\n\t\t\treturn client.request(\"validate-address\", req, Address.class);\n\t\t}", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "public abstract void setAddressLine2(String sValue);", "public static void captureAddressInformation(){\r\n\t\ttestInfo.log(Status.INFO, \"Capture Address Information\");\r\n\t\tIWanna.selectFromDropdown(\"ddStatus\", red.getCellData(\"TestData\", \"ResStatus\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine1\", red.getCellData(\"TestData\", \"ResLine1\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialLine2\", red.getCellData(\"TestData\", \"ResLine2\", currentRow));\r\n\t\tIWanna.type(\"tbResidentialSuburb\", red.getCellData(\"TestData\", \"ResSuburb\", currentRow));\r\n\t\tIWanna.click(\"btnSearchResidentialSuburb\");\r\n\t\tIWanna.wait(1);\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialSuburb\", 1);\t\r\n\t\tIWanna.type(\"tbResidentialCity\", red.getCellData(\"TestData\", \"ResCity\", currentRow));\r\n\t\tIWanna.click(\"btnResidentialCitySearch\");\r\n\t\tIWanna.selectFromDropdown(\"ddResidentialCity\", 1);\r\n\t\tIWanna.type(\"tbYYatThisAddress\", red.getCellData(\"TestData\", \"PeriodYY\", currentRow));\r\n\t\tIWanna.type(\"tbMMatThisAddress\", red.getCellData(\"TestData\", \"PeriodMM\", currentRow));\r\n\t\t\r\n\t\tString sameAsPostal = red.getCellData(\"TestData\", \"SameAsPostal\", currentRow);\r\n\t\tif (sameAsPostal.equalsIgnoreCase(\"Yes\")){\r\n\t\t\tIWanna.click(\"rbSameAsPostalYes\");\r\n\t\t}\r\n\t\telse if(sameAsPostal.equalsIgnoreCase(\"No\")){\r\n\t\t\tIWanna.type(\"tbPostalLine1\", red.getCellData(\"TestData\", \"PostalLine1\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalLine2\", red.getCellData(\"TestData\", \"PostalLine2\", currentRow));\r\n\t\t\tIWanna.type(\"tbPostalSuburb\", red.getCellData(\"TestData\", \"PostalSuburb\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalSuburb\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalSuburb\", 1);\t\r\n\t\t\tIWanna.type(\"tbPostalCity\", red.getCellData(\"TestData\", \"PostalCity\", currentRow));\r\n\t\t\tIWanna.click(\"btnSearchPostalCity\");\r\n\t\t\tIWanna.selectFromDropdown(\"ddPostalCity\", 1);\r\n\t\t}\r\n\t}", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }", "public void validateRpd8s22()\n {\n // Duplicate of 8s14\n }", "public void setAddressline1(String addressline1) {\n this.addressline1 = addressline1;\n }", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate_the_Email_Address_1_of_Security_in_Customer_Tab(String EmailAddress1)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 1\").replaceAll(\"M_InnerText\", EmailAddress1), \"Email Address 1 - \"+EmailAddress1, false);\n\t}", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public void setAddressLine1(String addressLine1) {\n this.addressLine1 = addressLine1;\n }", "public void validate(DataRecord value) {\n\r\n\t}", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validate_the_Email_Address_2_of_Security_in_Customer_Tab(String EmailAddress2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 2\").replaceAll(\"M_InnerText\", EmailAddress2), \"Email Address 2 - \"+EmailAddress2, false);\n\t}", "public boolean validateContactAddress(String contactId, List<String> result)\n {\n return true;\n }", "@Override\r\n\tpublic void validate(Product p) throws CustomBadRequestException {\r\n\t\tif(p.getName() == null || p.getName().equals(\"\") || p.getBarcode() == null || p.getBarcode().equals(\"\") || p.getMeasure_unit() == null ||\r\n\t\t\t\tp.getMeasure_unit().equals(\"\") || p.getQuantity() == null || p.getQuantity().equals(\"\")|| p.getBrand() == null || p.getBrand().equals(\"\")){\r\n\t\t\tthrow new CustomBadRequestException(\"Incomplete Information about the product\");\r\n\t\t}\r\n\r\n\t\tString eanCode = p.getBarcode();\r\n\t\tString ValidChars = \"0123456789\";\r\n\t\tchar digit;\r\n\t\tfor (int i = 0; i < eanCode.length(); i++) { \r\n\t\t\tdigit = eanCode.charAt(i); \r\n\t\t\tif (ValidChars.indexOf(digit) == -1) {\r\n\t\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Add five 0 if the code has only 8 digits\r\n\t\tif (eanCode.length() == 8 ) {\r\n\t\t\teanCode = \"00000\" + eanCode;\r\n\t\t}\r\n\t\t// Check for 13 digits otherwise\r\n\t\telse if (eanCode.length() != 13) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\t// Get the check number\r\n\t\tint originalCheck = Integer.parseInt(eanCode.substring(eanCode.length() - 1));\r\n\t\teanCode = eanCode.substring(0, eanCode.length() - 1);\r\n\r\n\t\t// Add even numbers together\r\n\t\tint even = Integer.parseInt((eanCode.substring(1, 2))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(3, 4))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(5, 6))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(7, 8))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(9, 10))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(11, 12))) ;\r\n\t\t// Multiply this result by 3\r\n\t\teven *= 3;\r\n\r\n\t\t// Add odd numbers together\r\n\t\tint odd = Integer.parseInt((eanCode.substring(0, 1))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(2, 3))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(4, 5))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(6, 7))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(8, 9))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(10, 11))) ;\r\n\r\n\t\t// Add two totals together\r\n\t\tint total = even + odd;\r\n\r\n\t\t// Calculate the checksum\r\n\t\t// Divide total by 10 and store the remainder\r\n\t\tint checksum = total % 10;\r\n\t\t// If result is not 0 then take away 10\r\n\t\tif (checksum != 0) {\r\n\t\t\tchecksum = 10 - checksum;\r\n\t\t}\r\n\r\n\t\t// Return the result\r\n\t\tif (checksum != originalCheck) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\tif(Float.parseFloat(p.getQuantity()) <= 0){\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Quantity\");\r\n\t\t}\r\n\r\n\r\n\t}", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "public void validateRpd1s2()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd22s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd22s2()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd7s2()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s6()\n {\n // This guideline cannot be automatically tested.\n }", "@Test( dataProvider=\"AddressValidationTestData\", groups ={\"BillingAddressValidations\"})\r\n\r\n\tpublic static void AddNewBillingAddress(String[] BillingAddressDetailsInArray){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tAssert.assertEquals( launchAndValidateDifferentBillingAddresses(BillingAddressDetailsInArray) ,true) ;\t\t\t\t\r\n\t\t\tWaitUtil.waitFor(Driver,\"THREAD_SLEEP\", (long)200);\t\r\n\t\t\tAssert.assertEquals(new FrontEndCommonPage(Driver).logout(),true) ;\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch ( TestException Te)\r\n\t\t{\r\n\t\t\tTestLog.logTestStep(\"Error/Exception : \" + Te.getExceptionName());\r\n\t\t\tTe.printException();\r\n\t\t\tassert(false);\r\n\t\t}\t\t\r\n\t\tcatch (InterruptedException e){\r\n\t\t\t//do nothing\t\t\r\n\t\t}\r\n\t\tcatch ( Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tTestLog.logTestStep(\"Error/Exception \" + e.getMessage());\r\n\t\t\tassert(false) ;\r\n\t\t}\t\t\r\n\t}", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public void validateRpd11s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd22s6()\n {\n // This guideline cannot be automatically tested.\n }", "public abstract void setAddressLine1(String sValue);", "public String getAddressLine2() {\n return addressLine2;\n }", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "public static Boolean validateInput(String str) {\n String[] lines = str.split(\"\\n\");\r\n // System.out.println(\"lines array:\"+lines.length);\r\n Boolean validate = true;\r\n String[] lineParameters;\r\n int countFor =0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n\r\n if (lineParameters.length != 5) {\r\n validate = false;\r\n break;\r\n }\r\n }\r\n countFor++;\r\n \r\n\r\n }\r\n return validate;\r\n }", "public void validateRpd11s6()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate() {}", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "public void validateRpd13s9()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "private Map<String,String> getValidatedAddressInfo(Map<String,String> params) throws ClientProtocolException, IOException \n\t{\n\t\t// Create unique form parameters\n\t\tList<NameValuePair> uniqueParams = new ArrayList<NameValuePair>();\n\t\tuniqueParams.add(new BasicNameValuePair(\"__LASTFOCUS\", \"\"));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__VIEWSTATE\", params.get(\"ViewState\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"__EVENTVALIDATION\", params.get(\"EventValidation\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetNumber\", params.get(\"StreetNumber\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"StreetName\", params.get(\"StreetName\")));\n\t\tuniqueParams.add(new BasicNameValuePair(\"EnterButton\", \"Enter\"));\n\t\t\n\t\t//get the HTML from the FCPS boundary locator web site\n\t\tString responseHtml = getFCPSBoundaryLocatorHTML(uniqueParams);\n\t\t\n\t\tif(responseHtml == null || responseHtml.isEmpty() || responseHtml.startsWith(\"Error\"))\n\t\t{\n\t\t\tMap<String, String> errMap = new HashMap<String,String>();\n\t\t\terrMap.put(\"Error\", \"Failed Post\");\n\t\t\treturn errMap;\n\t\t}\n\t\telse\t //scrape the HTML to obtain the validated address map\n\t\t\treturn scrapeValidatedAddressHTML(responseHtml.toString());\n\t}", "public com.apatar.cdyne.ws.demographix.SummaryInformation getLocationInformationByAddress(java.lang.String addressLine1, java.lang.String city, java.lang.String stateAbbrev, java.lang.String zipCode, java.lang.String licenseKey) throws java.rmi.RemoteException;", "public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }", "public static void fillUpAddAddress() throws Exception {\n\t\tString fName = Generic.ReadRandomCellData(\"Names\");\n\t\tString lName = Generic.ReadRandomCellData(\"Names\");\n\n\t\tString email = Generic.ReadFromExcel(\"Email\", \"LoginDetails\", 1);\n\t\tString mobileNum = Generic.ReadFromExcel(\"GCashNum\", \"LoginDetails\", 1);\n\t\ttry {\n\n\t\t\tsendKeys(\"CreateAccount\", \"FirstName\", fName);\n\n\t\t\tclickByLocation(\"42,783,1038,954\");\n\t\t\tenterTextByKeyCodeEvent(lName);\n\n//\t\t\tsendKeys(\"CreateAccount\", \"UnitNo\", Generic.ReadFromExcel(\"UnitNo\", \"LoginDetails\", 1));\n//\t\t\tsendKeys(\"CreateAccount\", \"StreetNo\", Generic.ReadFromExcel(\"StreetName\", \"LoginDetails\", 1));\n\t\t\tAddAddress(1);\n\t\t\tThread.sleep(2000);\n\t\t\tsendKeys(\"CreateAccount\", \"Email\", email);\n\t\t\tThread.sleep(2000);\n\t\t\tsendKeys(\"CreateAccount\", \"MobileNumber\", mobileNum);\n\t\t\tControl.takeScreenshot();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private static boolean validateAddress(String address) {\n return !address.isEmpty();\n }", "void validate();", "void validate();", "public void validateRpd13s13()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRegistration(RegistrationModel register) {\n\t\tif (registerDao.checkAccountNoIfExist(register.getAccount_no(), register.getJai())) {\n\t\t\t// Checks if account if not Existing and not Verified \n\t\t\tif (!registerDao.checkCustomerLinkIfExist(register.getAccount_no())) {\n\t\t\t\t\tgenerateCustomerRecord(register);\n\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// Account already registered.\n\t\t\t\tVerificationModel verify = new VerificationModel();\n\t\t\t\tverify.setAccount_no(register.getAccount_no());\n\t\t\t\t\n\t\t\t\tTimestamp todayTimeStamp = new Timestamp(System.currentTimeMillis());\n\t\t\t\tTimestamp regTimeStamp = verifyDao.retireveReg_date(verify); \n\t\t\t\tlong diffHours = (regTimeStamp.getTime()-todayTimeStamp.getTime()) / (60 * 60 * 1000);\n\t\t\t\t\n\t\t\t\tif (diffHours>24) {\n\t\t\t\t\tgenerateCustomerRecord(register);\n\t\t\t\t} else {\n\t\t\t\t\t// Account already registered. Please verify your registration\n\t\t\t\t\tsetRegistrationError(\"R02\"); \n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Customer not allowed to access online service of OBS!\n\t\t\tsetRegistrationError(\"R01\"); \n\t\t}\n\t}", "@Test\r\n\tpublic void view3_todays_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"CML Service Level\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table2 = driver.findElements(view3_todays_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table2 = driver.findElements(By.xpath(view3_today_data_table));\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table2, data_of_table2 );\r\n\t}", "public static void AddAddress(int selectAddress) throws Exception {\n\t\tWebElement element = null;\n\t\tConstant.UnitNo = Generic.ReadFromExcel(\"UnitNo\", \"LoginDetails\", selectAddress);\n\t\tConstant.StreetName = Generic.ReadFromExcel(\"StreetName\", \"LoginDetails\", selectAddress);\n\t\tConstant.Province = Generic.ReadFromExcel(\"Province\", \"LoginDetails\", selectAddress);\n\t\tConstant.City = Generic.ReadFromExcel(\"City\", \"LoginDetails\", selectAddress);\n\t\tConstant.Barangay = Generic.ReadFromExcel(\"Barangay\", \"LoginDetails\", selectAddress);\n\t\tConstant.ZipCode = Generic.ReadFromExcel(\"ZipCode\", \"LoginDetails\", selectAddress);\n\t\ttry {\n\t\t\tThread.sleep(5000);\n\t\t\tsendKeys(\"CreateAccount\", \"UnitNo\", Constant.UnitNo);\n\t\t\tsendKeys(\"CreateAccount\", \"StreetNo\", Constant.StreetName);\n\t\t\tclick(\"CreateAccount\", \"Province\");\n\t\t\tThread.sleep(1000);\n\t\t\tsendKeys(\"CreateAccount\", \"EnterProvince\", Constant.Province);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.Province + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\n\t\t\t//// *[@content-desc=\"METRO MANILA, List Choice Label\"]\n\n\t\t\tThread.sleep(2000);\n\n\t\t\t// TODO BUG on-going fix\n\t\t\t// <Remarks> uncomment this after fix </Remarks>\n//\t\t\tclick(\"CreateAccount\", \"City\");\n//\t\t\tThread.sleep(1000);\n\n\t\t\tsendKeys(\"CreateAccount\", \"EnterCity\", Constant.City);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.City + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\n\t\t\tThread.sleep(2000);\n\n\t\t\t// TODO BUG on-going fix\n\t\t\t// <Remarks> uncomment this after fix </Remarks>\n//\t\t\tclick(\"CreateAccount\", \"Barangay\");\n//\t\t\tThread.sleep(1000);\n\n\t\t\tsendKeys(\"CreateAccount\", \"EnterBarangay\", Constant.Barangay);\n\t\t\tThread.sleep(1000);\n\t\t\telement = Constant.driver\n\t\t\t\t\t.findElement(By.xpath(\"//*[@content-desc=\\\"\" + Constant.Barangay + \", List Choice Label\\\"]\"));\n\t\t\telement.click();\n\t\t\tThread.sleep(1000);\n\t\t\tControl.takeScreenshot();\n\t\t\tscrollToText(\"This Address\"); // Add This Address || Save This Address\n\t\t\tThread.sleep(2000);\n\t\t\tclick(\"CreateAccount\", \"ZipCode\");\n\t\t\tsendKeys(\"CreateAccount\", \"ZipCode\", Constant.ZipCode);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}" ]
[ "0.7784341", "0.7629967", "0.7401981", "0.7222829", "0.712143", "0.7078755", "0.66027755", "0.6424623", "0.63649803", "0.6334439", "0.6260111", "0.6254823", "0.61752224", "0.61709315", "0.61684877", "0.6163761", "0.6145595", "0.6124119", "0.6096959", "0.60355276", "0.60054946", "0.5985865", "0.5925577", "0.5898013", "0.58973855", "0.58828616", "0.5876586", "0.5876188", "0.5794745", "0.57778883", "0.5739028", "0.5737168", "0.5721373", "0.5699076", "0.569759", "0.5693727", "0.5671931", "0.5660339", "0.56561774", "0.56497705", "0.56360775", "0.5622996", "0.5618504", "0.5618504", "0.5602679", "0.5598765", "0.5597519", "0.5589907", "0.5580546", "0.55716395", "0.55605906", "0.5553648", "0.5552542", "0.5541411", "0.55410445", "0.55404663", "0.5520718", "0.55155575", "0.5509135", "0.5507383", "0.55014265", "0.5499456", "0.54909575", "0.548515", "0.54720354", "0.5466132", "0.5462537", "0.5459536", "0.5455122", "0.5453043", "0.5449771", "0.5445193", "0.54445004", "0.54414606", "0.5441386", "0.54331326", "0.54265356", "0.5406518", "0.5401032", "0.5399516", "0.5396539", "0.5393522", "0.5393264", "0.5381753", "0.5361589", "0.5349822", "0.5346317", "0.5334536", "0.53334147", "0.53263247", "0.5311657", "0.5303474", "0.52985615", "0.5298483", "0.52980244", "0.52980244", "0.52955776", "0.52875537", "0.5286876", "0.5285945" ]
0.630463
10
Validation Functions Description : To validate the Postcode of Installation Address in Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:05 Oct 2016 Modified By:Raja Parameter:Postcode
public void validate_the_Postcode_of_Installation_Address_in_Customer_Tab(String Postcode)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll("M_Header", "Installation Address").replaceAll("M_Category", "Postcode").replaceAll("M_InnerText", Postcode), "Postcode of Installation Address - "+Postcode, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Billing Address - \"+Postcode, false);\n\t}", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validate_the_Address_Line_1_of_Installation_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Instalation Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_InstallationAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Installation Address - \"+AddressLine1, false);\n\t}", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public void validate_the_Country_of_Installation_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Installation Address - \"+Country, false);\n\t}", "public String CheckPostCode (HashMap<String, ?> InputObj) throws NoSuchElementException {\n\t\tString outRetVal = \"-1\";\n\t\t\n\t\tString inCountryCode = InputObj.get(\"CountryCode\").toString();\n\t\tString inPostCode = InputObj.get(\"PostCode\").toString();\n\t\t\n\t\tCustSiteEditorObj Obj = new CustSiteEditorObj(webdriver);\n\t\t\n\t\tWebElement TxtCountryCode = Obj.getTxtCountryCode();\n\t\tif (!TxtCountryCode.getAttribute(\"value\").equals(inCountryCode)) {\n\t\t\tTxtCountryCode.clear();\n\t\t\tTxtCountryCode.sendKeys(inCountryCode);\n\t\t\tWebElement TxtPostCode = Obj.getTxtPostCode();\n\t\t\tTxtPostCode.click();\n\t\t}\n\t\t\n\t\tboolean isCountryCodeMsgExist = SeleniumUtil.isWebElementExist(webdriver, Obj.getLblCountryCodeMessageLocator(), 1);\n\t\tif (isCountryCodeMsgExist) {\n\t\t\tWebElement LblCountryCodeMessage = Obj.getLblCountryCodeMessage();\n\t\t\tboolean isVisible = LblCountryCodeMessage.isDisplayed();\n\t\t\tif (isVisible) {\n\t\t\t\tCommUtil.logger.info(\" > Msg: \"+LblCountryCodeMessage.getText());\n\t\t\t\tif (CommUtil.isMatchByReg(LblCountryCodeMessage.getText(), \"Only 2 characters\")) {\n\t\t\t\t\toutRetVal = \"1\";\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t} else {\n\t\t\t\t\tCommUtil.logger.info(\" > Unhandled message.\");\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tWebElement TxtPostCode = Obj.getTxtPostCode();\n\t\tif (!TxtPostCode.getAttribute(\"value\").equals(inPostCode)) {\n\t\t\tTxtPostCode.clear();\n\t\t\tTxtPostCode.sendKeys(inPostCode);\n\t\t\tTxtCountryCode = Obj.getTxtCountryCode();\n\t\t\tTxtCountryCode.click();\n\t\t}\t\n\t\t\n\t\tboolean isPostCodeMsgExist = SeleniumUtil.isWebElementExist(webdriver, Obj.getLblPostCodeMessageLocator(), 1);\n\t\tif (isPostCodeMsgExist) {\n\t\t\tWebElement LblPostCodeMessage = Obj.getLblPostCodeMessage();\n\t\t\tboolean isVisible = LblPostCodeMessage.isDisplayed();\n\t\t\tif (isVisible) {\n\t\t\t\tCommUtil.logger.info(\" > Msg: \"+LblPostCodeMessage.getText());\n\t\t\t\tif (CommUtil.isMatchByReg(LblPostCodeMessage.getText(), \"Only 5 digits\")) {\n\t\t\t\t\toutRetVal = \"2\";\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t} else if (CommUtil.isMatchByReg(LblPostCodeMessage.getText(), \"Only alpha numeric dash space\")) {\n\t\t\t\t\toutRetVal = \"3\";\n\t\t\t\t\treturn outRetVal;\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tCommUtil.logger.info(\" > Unhandled message.\");\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\toutRetVal = \"0\";\n\t\treturn outRetVal;\n\t\t\n\t}", "public void validate_the_Address_Line_2_of_Installation_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Installation Address - \"+AddressLine2, false);\n\t}", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "public void zipCodeFieldTest() {\r\n\t\tif(Step.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\", 10)) {\r\n\t\t\t\r\n\t\t\t//Verifies the zip code field populates with the user's zip code\r\n\t\t\tString zipInputBoxTextContent = \r\n\t\t\t\t\tStep.Extract.getContentUsingJS(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Field\");\r\n\t\t\tif(zipInputBoxTextContent.isEmpty()) {\r\n\t\t\t\tStep.Failed(\"Zip Code Field is empty\");\r\n\t\t\t} else {\r\n\t\t\t\tStep.Passed(\"Zip Code Field populated with user's location\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Verifies special characters aren't accepted\r\n\t\t\tStep.Wait.forSeconds(1);\r\n\t\t\tStep.Action.typeText(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\", \"!@#$%\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote Button\");\r\n\t\t\tStep.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeInValidInputLocator,\r\n\t\t\t\t\t\"Zip Code Field shows invalid input\", 10);\r\n\t\t\t\r\n\t\t\t//Veriies invalid zip codes aren't accepted\r\n\t\t\tStep.Action.typeText(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip code Input field\", \"00000\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote button\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote button\");\r\n\t\t\tStep.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeInValidInputLocator,\r\n\t\t\t\t\t\"Zip Code Field shows invalid input\", 10);\r\n\t\t\t\r\n\t\t\t//Verifies that only 5 digits are accepted\r\n\t\t\tStep.Action.typeText(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\", \"1234567\");\r\n\t\t\tzipInputBoxTextContent = Step.Extract.getContentUsingJS(QuoteForm_ComponentObject.zipCodeFieldLocator,\r\n\t\t\t\t\t\"Zip code text box\");\r\n\t\t\tif(zipInputBoxTextContent.length() > 5) {\r\n\t\t\t\tStep.Failed(\"Zip Code Input Field contains more than 5 digits\");\r\n\t\t\t} else {\r\n\t\t\t\tStep.Passed(\"Zip Code Input Field does not accept more than 5 digits\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Verifies user cannot submit a blank zip code\r\n\t\t\tStep.Action.clear(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote Button\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote Button\");\r\n\t\t\tStep.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeInValidInputLocator,\r\n\t\t\t\t\t\"Zip Code Input Field shows invalid input\", 10);\r\n\t\t\t\r\n\t\t\t//Verifies that a valid input is accepted\r\n\t\t\tStep.Action.typeText(QuoteForm_ComponentObject.zipCodeFieldLocator, \"Zip Code Input Field\", \"48146\");\r\n\t\t\tStep.Action.click(QuoteForm_ComponentObject.seeYourQuoteButtonLocator, \"See Your Quote Button\");\r\n\t\t\tStep.Wait.forElementVisible(QuoteForm_ComponentObject.zipCodeValidInputLocator,\r\n\t\t\t\t\t\"Zip Code Field displays as valid input\", 10);\r\n\t\t}\r\n\t}", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "@Override\r\n\tpublic void validate(Product p) throws CustomBadRequestException {\r\n\t\tif(p.getName() == null || p.getName().equals(\"\") || p.getBarcode() == null || p.getBarcode().equals(\"\") || p.getMeasure_unit() == null ||\r\n\t\t\t\tp.getMeasure_unit().equals(\"\") || p.getQuantity() == null || p.getQuantity().equals(\"\")|| p.getBrand() == null || p.getBrand().equals(\"\")){\r\n\t\t\tthrow new CustomBadRequestException(\"Incomplete Information about the product\");\r\n\t\t}\r\n\r\n\t\tString eanCode = p.getBarcode();\r\n\t\tString ValidChars = \"0123456789\";\r\n\t\tchar digit;\r\n\t\tfor (int i = 0; i < eanCode.length(); i++) { \r\n\t\t\tdigit = eanCode.charAt(i); \r\n\t\t\tif (ValidChars.indexOf(digit) == -1) {\r\n\t\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Add five 0 if the code has only 8 digits\r\n\t\tif (eanCode.length() == 8 ) {\r\n\t\t\teanCode = \"00000\" + eanCode;\r\n\t\t}\r\n\t\t// Check for 13 digits otherwise\r\n\t\telse if (eanCode.length() != 13) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\t// Get the check number\r\n\t\tint originalCheck = Integer.parseInt(eanCode.substring(eanCode.length() - 1));\r\n\t\teanCode = eanCode.substring(0, eanCode.length() - 1);\r\n\r\n\t\t// Add even numbers together\r\n\t\tint even = Integer.parseInt((eanCode.substring(1, 2))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(3, 4))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(5, 6))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(7, 8))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(9, 10))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(11, 12))) ;\r\n\t\t// Multiply this result by 3\r\n\t\teven *= 3;\r\n\r\n\t\t// Add odd numbers together\r\n\t\tint odd = Integer.parseInt((eanCode.substring(0, 1))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(2, 3))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(4, 5))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(6, 7))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(8, 9))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(10, 11))) ;\r\n\r\n\t\t// Add two totals together\r\n\t\tint total = even + odd;\r\n\r\n\t\t// Calculate the checksum\r\n\t\t// Divide total by 10 and store the remainder\r\n\t\tint checksum = total % 10;\r\n\t\t// If result is not 0 then take away 10\r\n\t\tif (checksum != 0) {\r\n\t\t\tchecksum = 10 - checksum;\r\n\t\t}\r\n\r\n\t\t// Return the result\r\n\t\tif (checksum != originalCheck) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\tif(Float.parseFloat(p.getQuantity()) <= 0){\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Quantity\");\r\n\t\t}\r\n\r\n\r\n\t}", "public void validate_the_Town_City_of_Installation_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Installation Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Installation Address - \"+TownCity);\n\t\t\t\n\t\t\t\n\t\t\n\t}", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public boolean validate() {\n\n String plate = _licensePlate.getText().toString();\n\n if(plate.isEmpty() || plate.length() < 8)\n return false;\n\n else if(plate.charAt(2) == '-' || plate.charAt(5) == '-') {\n\n if (Character.isUpperCase(plate.charAt(0)) && Character.isUpperCase(plate.charAt(1))) { // first case\n if (Character.isDigit(plate.charAt(3)) && Character.isDigit(plate.charAt(4))\n && Character.isDigit(plate.charAt(6)) && Character.isDigit(plate.charAt(7)))\n return true;\n }\n\n else if(Character.isUpperCase(plate.charAt(3)) && Character.isUpperCase(plate.charAt(4))) { // second case\n if (Character.isDigit(plate.charAt(0)) && Character.isDigit(plate.charAt(1))\n && Character.isDigit(plate.charAt(6)) && Character.isDigit(plate.charAt(7)))\n return true;\n }\n\n else if(Character.isUpperCase(plate.charAt(6)) && Character.isUpperCase(plate.charAt(7))) { // third case\n if (Character.isDigit(plate.charAt(0)) && Character.isDigit(plate.charAt(1))\n && Character.isDigit(plate.charAt(3)) && Character.isDigit(plate.charAt(4)))\n return true;\n }\n\n else\n return false;\n\n }\n\n return false;\n }", "@Test\n public void testIncorrectPostalCode(){\n UserRegisterKYC tooLong = new UserRegisterKYC(\"hello\",validId3,\"30/03/1995\",\"7385483\");\n int requestResponse = tooLong.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC tooShort = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"48532\");\n requestResponse = tooShort.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC startWith74 = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"746532\");\n requestResponse = startWith74.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC startWithMoreThan82 = new UserRegisterKYC(\"hello\", validId3, \"30/03/1995\", \"967532\");\n requestResponse = startWithMoreThan82.sendRegisterRequest();\n assertEquals(400,requestResponse);\n }", "abstract void addressValidity();", "@Override\n\tpublic boolean IsDeliveryaddressValid(String name, String street, String city, String province, String postalcode) {\n\t\t\n\t\tData data = new Data();\n\t\tList<Deliveryaddress> deliveryaddress = data.getDeliveryaddressData();\n\t\t\n\t\tfor(Deliveryaddress d: deliveryaddress) {\n\t\t\tif(name.equals(d.name) && street.equals(d.street) && city.equals(d.city) && province.equals(d.province) && postalcode.equals(d.postalcode)) {\n\t\t\t\treturn true;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "abstract void fiscalCodeValidity();", "public void validate_the_Country_of_Billing_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Billing Address - \"+Country, false);\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public void validate_the_Address_Line_2_of_Billing_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Billing Address - \"+AddressLine2, false);\n\t}", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "public void validate_the_Address_Line_1_of_Billing_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Billing Address\", driver);\n\t\tSystem.out.println(AddressLine1);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Billing Address - \"+AddressLine1, false);\n\t}", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public void validateRpd13s9()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "private void validateData() {\n }", "public boolean isZipCodeValid() throws BusinessRuleException {\n\t\tif ((\"EUR\".equalsIgnoreCase(Version.CURRENT_REGION))) {\n\t\t\tif (txtZipCode.getText().trim().length() > 0)\n\t\t return true;\n\t\t} else if (!addressPanelType.trim().equalsIgnoreCase(SHIPPING_ADDRESS_PANEL) \n\t\t\t\t|| txtZipCode.getText().trim().length() > 0) {\n\t\t\treturn true;\n\t\t}\n\t\ttxtZipCode.requestFocus();\n\t\tthrow new BusinessRuleException(RESOURCE.getString(\"Zip / Postal Code: This field is required.\"));\n\t}", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "public void validateRpd11s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void SetCheckoutRegistrationPhonecode_number(String code, String phoneno){\r\n\t\tString Code = getValue(code);\r\n\t\tString Phoneno = getValue(phoneno);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:- \"+Code+\" , \"+Phoneno);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Registration Phone code and Phone number should be entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\ttry{\r\n\t\t\tif((countrygroup_phoneNo).contains(countries.get(countrycount))){\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonenumber\"),Phoneno);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonecode\"),Code);\r\n\t\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonenumber\"),Phoneno);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tSystem.out.println(\"Registration Phone code and number is entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Registration Phone code and number is entered as '\"+Code+\"' , '\"+Phoneno+\"' \");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Registration Phone code and number is not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtcheckoutregistrationPhonecode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" / \"+elementProperties.getProperty(\"txtcheckoutregistrationPhonenumber\").toString().replace(\"By.\", \" \")+\r\n\t\t\t\t\t\" not found\");\r\n\t\t}\r\n\r\n\t}", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "public ErrorMessage verifyCode(String code, Integer year, Long exception);", "public void validate_the_Town_City_of_Billing_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tif(VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity, false))\n\t\t{\n\t\t\tVerifyElementPresentAndClick(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Billing Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Billing Address - \"+TownCity);\n\t\t}\n\t\t\n\t}", "private boolean isInfoValidate(){\n if(mEmailAddress.getText() == null || mEmailAddress.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_email_address);\n return false;\n }\n\n if(!mEmailAddress.getText().toString().contains(\"@\")){\n errorText = getString(R.string.register_warning_valid_email_address);\n return false;\n }\n\n// if(mRegionSpinner.getSelectedItemPosition() == Constant.NON_SELECT){\n// errorText = getString(R.string.register_warning_select_region);\n// return false;\n// }\n\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.HONG_KONG)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.HONGKONG_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n//\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.CHINA)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.CHINA_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n\n if(mPassword.getText() == null || mPassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_password);\n return false;\n }\n\n if(mRetypePassword.getText() == null || mRetypePassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_retype_password);\n return false;\n }\n\n if(!mPassword.getText().toString().equals(mRetypePassword.getText().toString())){\n errorText = getString(R.string.register_warning_not_the_same);\n return false;\n }\n\n if(!Utility.judgeContainsStr( mPassword.getText().toString())){\n errorText = getString(R.string.register_warning_contains_character);\n return false;\n }\n\n// if(!mPolicyCheckBox.isChecked()){\n// errorText = getString(R.string.register_warning_check_agreement);\n// return false;\n// }\n\n return true;\n }", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "@Test\n public void postalCodeTest() {\n // TODO: test postalCode\n }", "public void validateRpd13s6()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean isAddressValid(String s) {\n for (Property prt : propertyList) { //(String t : propertyAddrLine1s)\n if (prt.getAddrline1().matches(s)) {\n createdProperty = prt;\n return true;\n }\n }\n return false;\n }", "private boolean validZip(String zipCode) {\n\t\tString regex = \"^[0-9]{5}(?:-[0-9]{4})?$\";\n\t\t \n\t\tPattern pattern = Pattern.compile(regex);\n\t\t \n\t\tMatcher matcher = pattern.matcher(zipCode);\n\n\t\treturn matcher.matches();\n\t}", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "public void validateRpd8s22()\n {\n // Duplicate of 8s14\n }", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean validatePin( String pin );", "public void validateRpd22s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd22s9()\n {\n // This guideline cannot be automatically tested.\n }", "@And(\"^Enter user phone and confirmation code$\")\t\t\t\t\t\n public void Enter_user_phone_and_confirmation_code() throws Throwable \t\t\t\t\t\t\t\n { \t\t\n \tdriver.findElement(By.id(\"phoneNumberId\")).sendKeys(\"01116844320\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvPhoneNext']/content/span\")).click();\n driver.findElement(By.id(\"code\")).sendKeys(\"172978\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvVerifyNext']/content/span\")).click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\t\t\n }", "public boolean deliveryEstimationCheck(Map<String,String> dataMap) throws Exception\r\n\t{\t\r\n\t\tList<String> listOfPincode = new ArrayList<String>();\r\n\t\tString pincode = dataMap.get(\"Pincode\");\r\n\t\tString changePincode = dataMap.get(\"ChangePincode\");\r\n\t\tString product = dataMap.get(\"Product\");\r\n\t\tString message=null;\r\n\t\tlistOfPincode.add(pincode);\r\n\t\tlistOfPincode.add(changePincode);\r\n\t\t\r\n\t\tfor(int i=0;i<listOfPincode.size();i++)\r\n\t\t{\r\n\t\t\tString code = listOfPincode.get(i);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(code==null||code.length()!=6||code.matches(\"[0-9]+\") == false)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"The pincode selected should be 6 digit or not a numberic. Currently set as \"+code+\". ReEnter a valid pincode\");\r\n\t\t\t\tBaseClass.skipTestExecution(\"The pincode selected should be 6 digit. Currently set as \"+code+\". ReEnter a valid pincode\");\r\n\t\t\t}\t\t\t\r\n\t\t\t\tmessage = enterPincode(code);\r\n\t\t\t\t//System.out.println(message.split(\"?\")[1]);\r\n\t\t\t\tif(message.contains(\"Not available for delivery, please change your pincode\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tif(changePincode==null||changePincode.equalsIgnoreCase(\"na\")||changePincode.equalsIgnoreCase(\"\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(message);\r\n\t\t\t\t\t\tBaseClass.skipTestExecution(\"The product: \"+product+\" selected cannot be delivered to the select location: \"+code);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tproductPageIndia.clickWebElement(productPageIndia.ChangePin);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println(message);\r\n\t\tstartTest.log(LogStatus.INFO, message,\"Successfull\");\r\n\t\tstartTest.log(LogStatus.INFO, \"User has insert the pincode successfull and gets the estimation date \"+pincode,\"Successfull\");\r\n\t\treturn true;\r\n\t\t\r\n\t\t\r\n\t}", "public void validateRpd13s2()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "public void validateRpd13s8()\n {\n // This guideline cannot be automatically tested.\n }", "public void mo38839a(BrandsValidation brandsValidation) {\n }", "public void validateRpd3s12()\n {\n // This guideline cannot be automatically tested.\n }", "void validateMobileNumber(String stringToBeValidated,String name);", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "boolean validateAll(String... vendorCodes);", "public void testAvailableZipcodesAreValid(int programid, String programName);", "@Test\n public void testIsValidAddress() {\n System.out.println(\"isValidAddress\");\n String address = \"Trion Ierarxon 86, Larissa\";\n boolean expResult = true;\n boolean result = ValidVariables.isValidAddress(address);\n assertEquals(expResult, result);\n }", "public boolean isValid(){\n Email.setErrorEnabled(false);\n Email.setError(\"\");\n Fname.setErrorEnabled(false);\n Fname.setError(\"\");\n Lname.setErrorEnabled(false);\n Lname.setError(\"\");\n Pass.setErrorEnabled(false);\n Pass.setError(\"\");\n Mobileno.setErrorEnabled(false);\n Mobileno.setError(\"\");\n Cpass.setErrorEnabled(false);\n Cpass.setError(\"\");\n area.setErrorEnabled(false);\n area.setError(\"\");\n Houseno.setErrorEnabled(false);\n Houseno.setError(\"\");\n Pincode.setErrorEnabled(false);\n Pincode.setError(\"\");\n\n boolean isValid=false,isValidname=false,isValidhouseno=false,isValidlname=false,isValidemail=false,isValidpassword=false,isValidconfpassword=false,isValidmobilenum=false,isValidarea=false,isValidpincode=false;\n if(TextUtils.isEmpty(fname)){\n Fname.setErrorEnabled(true);\n Fname.setError(\"Enter First Name\");\n }else{\n isValidname=true;\n }\n if(TextUtils.isEmpty(lname)){\n Lname.setErrorEnabled(true);\n Lname.setError(\"Enter Last Name\");\n }else{\n isValidlname=true;\n }\n if(TextUtils.isEmpty(emailid)){\n Email.setErrorEnabled(true);\n Email.setError(\"Email Address is required\");\n }else {\n if (emailid.matches(emailpattern)) {\n isValidemail = true;\n } else {\n Email.setErrorEnabled(true);\n Email.setError(\"Enter a Valid Email Address\");\n }\n }\n if(TextUtils.isEmpty(password)){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Enter Password\");\n }else {\n if (password.length()<8){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Weak Password\");\n }else {\n isValidpassword = true;\n }\n }\n if(TextUtils.isEmpty(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Enter Password Again\");\n }else{\n if (!password.equals(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Password Dosent Match\");\n }else{\n isValidconfpassword=true;\n }\n }\n if(TextUtils.isEmpty(mobile)){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Enter Phone Number\");\n }else{\n if (mobile.length()<10){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Invalid Mobile Number\");\n } else {\n isValidmobilenum = true;\n }\n }\n if(TextUtils.isEmpty(Area)){\n area.setErrorEnabled(true);\n area.setError(\"Area is Required\");\n }else{\n isValidarea=true;\n }\n if(TextUtils.isEmpty(pincode)){\n Pincode.setErrorEnabled(true);\n Pincode.setError(\"Please Enter Pincode\");\n }else{\n isValidpincode=true;\n }\n if(TextUtils.isEmpty(house)){\n Houseno.setErrorEnabled(true);\n Houseno.setError(\"House field cant be empty\");\n }else{\n isValidhouseno=true;\n }\n isValid=(isValidarea && isValidpincode && isValidconfpassword && isValidpassword && isValidemail && isValidname &&isValidmobilenum && isValidhouseno && isValidlname)? true:false;\n return isValid;\n\n }", "public boolean checkStAddAptNumZip(String streetAddress, String aptNumber, String zip){\n if( !this.streetAddress.toLowerCase().equals(streetAddress)){\n return false;\n }else if (!this.aptNumber.toLowerCase().equals(aptNumber)){\n return false;\n }else if (!this.zip.toLowerCase().equals(zip)){\n return false;\n }else{\n return true;\n }\n }", "public void SetCheckoutRegistrationPhonecode_number(String phoneno){\r\n\r\n\t\tString Phoneno = getValue(phoneno);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Registration Phone code and number should be entered as , \"+Phoneno);\r\n\t\ttry{\r\n\r\n\r\n\t\t\tsendKeys(locator_split(\"txtcheckoutregistrationPhonenumber\"),Phoneno);\r\n\t\t\tSystem.out.println(\"Registration Phone code and number is entered as , \"+Phoneno);\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Registration Phone code and number is entered as , \"+Phoneno);\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Registration Phone number is not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"checkoutregistrationPhonenumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" / \"+elementProperties.getProperty(\"checkoutregistrationPhonenumber\").toString().replace(\"By.\", \" \")+\r\n\t\t\t\t\t\" not found\");\r\n\t\t}\r\n\r\n\t}", "private static JSONObject validateStreet(String street, String city, String state, String zip) throws Exception {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n//\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n//\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n//\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n//\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\n\t\treturn addrKeyFormat;\n\t}", "public void validate_the_Address_Line_2_of_Correspondence_Address_in_Customer_Tab(String AddressLine2)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 2\").replaceAll(\"M_InnerText\", AddressLine2), \"Address Line 2 of Correspondence Address - \"+AddressLine2, false);\n\t}", "public void validateRpd9s2()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s13()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd11s9()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validFormInputs() {\n String email = etEmail.getText().toString();\n String password = etPassword.getText().toString();\n String institutionName = etInstitutionName.getText().toString();\n String addressFirst = etInstitutionAddressFirst.getText().toString();\n String addressSecond = etInstitutionAddressSecond.getText().toString();\n String CIF = etCIF.getText().toString();\n\n String[] allInputs = {email, password, institutionName, addressFirst, addressSecond, CIF};\n for (String currentInput : allInputs) {\n if (currentInput.matches(\"/s+\")) // Regex pt cazul cand stringul e gol sau contine doar spatii\n return false; // formular invalid - toate inputurile trebuie sa fie completate\n }\n String[] stringsAddressFirst = addressFirst.split(\",\");\n String[] stringsAddressSecond = addressSecond.split(\",\");\n if (stringsAddressFirst.length != 4 ||\n stringsAddressSecond.length != 3)\n return false;\n\n //<editor-fold desc=\"Checking if NUMBER and APARTMENT are numbers\">\n try {\n Integer.parseInt(stringsAddressSecond[0]);\n Integer.parseInt(stringsAddressSecond[2]);\n return true; // parsed successfully without throwing any parsing exception from string to int\n }catch (Exception e) {\n Log.v(LOG_TAG, \"Error on converting input to number : \" + e);\n return false; // parsed unsuccessfully - given strings can not be converted to int\n }\n //</editor-fold>\n }", "private void validateUPC(KeyEvent evt) {\n\t\t\n\t\tif (UPCTypeSwitch != QRCODE && UPCTypeSwitch != CODE39){\n\t\t\n\t\t\tchar UPCNumbers[] = upcTextField.getText().toCharArray();\n\t\t\t//System.out.println(\"matcher: \" + matcher.group());\n\t\t\t\n\t\t\tboolean InvalidUPC = false;\n\t\t\tfor (int i = 0; i < UPCNumbers.length; i++){\n\t\t\t\t//System.out.println(Character.isDigit(UPCNumbers[i]));\n\t\t\t\t//System.out.println(Character.isDigit(Integer.parseInt(Character.toString(UPCNumbers[i]))));\n\t\t\t\tif (Character.isDigit(UPCNumbers[i]) == false){\n\t\t\t\t\tInvalidUPC = true;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tInvalidUPC = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//System.out.println(\"UPCNumber: \" + jTextField1.getText() + \" | UPCLengthConstraint: \" + UPCLengthConstraint + \" | InvalidUPC: \" + InvalidUPC);\n\t\t\tif (upcTextField.getText().length() != UPCLengthConstraint || InvalidUPC == true){\n\t\t\t\tcheckdigitTextField.setText(\"\");\n\t\t\t\tfileMenuItem1.setEnabled(false);\n\t\t\t\texportButton.setEnabled(false);\n\t\t\t\tupdateButton.setEnabled(false);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfileMenuItem1.setEnabled(true);\n\t\t\t\texportButton.setEnabled(true);\n\t\t\t\tupdateButton.setEnabled(true);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse if (UPCTypeSwitch == QRCODE && qrCodeTextArea.getText().length() > 0){\n\t\t\t\n\t\t\tfileMenuItem1.setEnabled(true);\n\t\t\texportButton.setEnabled(true);\n\t\t\tupdateButton.setEnabled(true);\n\t\t\t\n\t\t}\n\t\telse if (UPCTypeSwitch == QRCODE && qrCodeTextArea.getText().length() == 0){\n\t\t\t\n\t\t\tfileMenuItem1.setEnabled(false);\n\t\t\texportButton.setEnabled(false);\n\t\t\tupdateButton.setEnabled(false);\n\t\t\t\n\t\t}\n\t\telse if (UPCTypeSwitch == CODE39 && upcTextField.getText().length() > 0){\n\t\t\t\n\t\t\tfileMenuItem1.setEnabled(true);\n\t\t\texportButton.setEnabled(true);\n\t\t\tupdateButton.setEnabled(true);\n\t\t\t\n\t\t}\n\t\telse if (UPCTypeSwitch == CODE39 && upcTextField.getText().length() == 0){\n\t\t\t\n\t\t\tfileMenuItem1.setEnabled(true);\n\t\t\texportButton.setEnabled(true);\n\t\t\tupdateButton.setEnabled(true);\n\t\t\t\n\t\t}\n\t}", "public void validateRpd11s6()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean verificarCnpj(String cnpj) {\n return true;\n \n// if (cnpj.length() != 14) {\n// return false;\n// }\n//\n// int soma = 0;\n// int dig = 0;\n//\n// String digitosIniciais = cnpj.substring(0, 12);\n// char[] cnpjCharArray = cnpj.toCharArray();\n//\n// /* Primeira parte da validação */\n// for (int i = 0; i < 4; i++) {\n// if (cnpjCharArray[i] - 48 >= 0 && cnpjCharArray[i] - 48 <= 9) {\n// soma += (cnpjCharArray[i] - 48) * (6 - (i + 1));\n// }\n// }\n//\n// for (int i = 0; i < 8; i++) {\n// if (cnpjCharArray[i + 4] - 48 >= 0 && cnpjCharArray[i + 4] - 48 <= 9) {\n// soma += (cnpjCharArray[i + 4] - 48) * (10 - (i + 1));\n// }\n// }\n//\n// dig = 11 - (soma % 11);\n//\n// digitosIniciais += (dig == 10 || dig == 11) ? \"0\" : Integer.toString(dig);\n//\n// /* Segunda parte da validação */\n// soma = 0;\n//\n// for (int i = 0; i < 5; i++) {\n// if (cnpjCharArray[i] - 48 >= 0 && cnpjCharArray[i] - 48 <= 9) {\n// soma += (cnpjCharArray[i] - 48) * (7 - (i + 1));\n// }\n// }\n//\n// for (int i = 0; i < 8; i++) {\n// soma += (cnpjCharArray[i + 5] - 48) * (10 - (i + 1));\n// }\n//\n// dig = 11 - (soma % 11);\n// digitosIniciais += (dig == 10 || dig == 11) ? \"0\" : Integer.toString(dig);\n\n// return cnpj.equals(digitosIniciais);\n }", "@Test\n public void testCreateLabelInvoiceBarcode_AddressValidation_Failure()\n {\n \t\n \ttry {\n \t\t\n \t\tlogger.info(\"Testing creation of label, invoice and barcode for failure scenario .\");\n \t\tString fileName = \"./com/cts/ptms/carrier/yrc/resources/InputData_Standard_AddressValidation_Failure.xml\";\n\t \tURL url = getClass().getClassLoader().getResource(fileName);\n\t\t\tshipmentRequest.setFileName(url.getFile());\n \t\tshipmentRequest.setCarrier(\"YRC\");\n\t \tshipmentRequest.setGenLabel(true);\n\t \tshipmentResponse = yrcSoapClient.createShipmentRequest(shipmentRequest);\n\t \tlogger.info(\"Status:\"+shipmentResponse );\n\t \t\n\t \tassertEquals(\"ERROR\", shipmentResponse.getStatus());\n\t\t\t\n \t} \n\t\tcatch(Exception e)\n\t\t{\n\t\t\tassertEquals(\"Failure\", \"Failure\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Exception occured\"+e.getMessage());\n\t\t}\n \t\n }", "public void validateRpd7s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void SetCreditCarddetails(String ccnumber, String ccname, String ccmonth, String ccyear, String ccseccode){\r\n\t\tString countrygroup_ccdetails= \"UK,PresselAustria\";\r\n\t\tString CCnum = getValue(ccnumber);\r\n\t\tString CCName = getValue(ccname);\r\n\t\tString CCMonth = getValue(ccmonth);\r\n\t\tString CCYear = getValue(ccyear);\r\n\t\tString CCSecCode = getValue(ccseccode);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+CCnum+\", \"+CCName+\", \"+CCMonth+\", \"+CCYear+\", \"+CCSecCode);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The CreditCard details should be entered\");\r\n\t\ttry{\r\n\t\t\tif(!(countrygroup_ccdetails).contains(countries.get(countrycount))){\r\n\t\t\t\tswitchframe(\"TokenizationPage\");\r\n\t\t\t\tsleep(2000);\r\n\t\t\t\tsendKeys(locator_split(\"txtCCnumber\"), CCnum);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCname\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCname\"), CCName);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCMonth\"), CCMonth);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCYear\"), CCYear);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCcode\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCcode\"), CCSecCode);\t\t\t\t\t\t\r\n\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The CreditCard details are entered\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The new CreditCard details are applicable to this \" +country);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- The CreditCard details are not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"One of the element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCnumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCname\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCMonth\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCYear\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCcode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" are not found\");\r\n\r\n\t\t}\r\n\t}", "public void validateRpd3s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd14s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd22s1()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean isPincodeValid(String pincode){\n Pattern p = Pattern.compile(\"\\\\d{6}\\\\b\");\n Matcher m = p.matcher(pincode);\n return (m.find() && m.group().equals(pincode));\n }", "public void validateRpd13s10()\n {\n // This guideline cannot be automatically tested.\n }", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "public void validateRpd22s6()\n {\n // This guideline cannot be automatically tested.\n }", "@org.junit.Test\r\n public void testPositiveScenario() {\n boolean result = Validation.validateSAPhoneNumber(\"+27712612199\");// function should return true\r\n assertEquals(true, result);\r\n\r\n }", "private static boolean validateZipCode(String zipCode) {\n try {\n if (zipCode.length() >= 5) {\n return Integer.parseInt(zipCode) > 0;\n }\n } catch (Exception ignored) {\n }\n\n return false;\n }", "public Boolean validateTransCode(String noteCode, Long staffId, String transType) throws Exception;", "public void validate_the_Town_City_of_Correspondence_Address_in_Customer_Tab(String TownCity)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Town/City\").replaceAll(\"M_InnerText\", TownCity), \"Town/City of Correspondence Address - \"+TownCity, false);\n\t}", "public boolean zipcodeIsValid() {\n return zipcode.length() == ZIPCODE_LENGTH;\n }", "private boolean validate(){\n\n String MobilePattern = \"[0-9]{10}\";\n String name = String.valueOf(userName.getText());\n String number = String.valueOf(userNumber.getText());\n\n\n if(name.length() > 25){\n Toast.makeText(getApplicationContext(), \"pls enter less the 25 characher in user name\",\n Toast.LENGTH_SHORT).show();\n return true;\n }\n\n\n\n else if(name.length() == 0 || number.length() == 0 ){\n Toast.makeText(getApplicationContext(), \"pls fill the empty fields\",\n Toast.LENGTH_SHORT).show();\n return false;\n }\n\n\n\n else if(number.matches(MobilePattern))\n {\n\n return true;\n }\n else if(!number.matches(MobilePattern))\n {\n Toast.makeText(getApplicationContext(), \"Please enter valid 10\" +\n \"digit phone number\", Toast.LENGTH_SHORT).show();\n\n\n return false;\n }\n\n return false;\n\n }", "private void check1(){\n \n\t\tif (firstDigit != 4){\n valid = false;\n errorCode = 1;\n }\n\t}", "public Address validAddress(TextInputLayout tiAddress, EditText etAddress) {\n String addressString = etAddress.getText().toString().trim();\n Address address = null;\n\n if (addressString.length() == 0)\n tiAddress.setError(c.getString(R.string.required));\n else if (addressString.length() < ADDRESS_MIN_SIZE)\n tiAddress.setError(c.getString(R.string.minLength, Integer.toString(ADDRESS_MIN_SIZE)));\n else if (addressString.length() > ADDRESS_MAX_SIZE)\n tiAddress.setError(c.getString(R.string.maxLength, Integer.toString(ADDRESS_MAX_SIZE)));\n else {\n Geocoder geocoder = new Geocoder(c, Locale.getDefault());\n addressString += \", BC\";\n try {\n List<Address> addressList = geocoder.getFromLocationName(addressString, 1);\n if (addressList == null || addressList.size() == 0)\n tiAddress.setError(c.getString(R.string.invalid));\n else {\n tiAddress.setError(null);\n address = addressList.get(0);\n }\n } catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n tiAddress.setError(c.getString(R.string.checkInternet));\n }\n }\n\n return address;\n }" ]
[ "0.73299146", "0.7195036", "0.6396715", "0.6371468", "0.62513834", "0.617723", "0.6167457", "0.61172134", "0.6086571", "0.6037837", "0.60330313", "0.6019253", "0.60112774", "0.5939636", "0.59395444", "0.5937177", "0.5934537", "0.5919451", "0.5910375", "0.5879219", "0.586022", "0.5847257", "0.58291656", "0.58130467", "0.5805386", "0.57949996", "0.57734233", "0.57398856", "0.5710736", "0.5706357", "0.5706048", "0.5680006", "0.5659936", "0.5658697", "0.5656347", "0.56456786", "0.5645182", "0.56427157", "0.5638141", "0.56362814", "0.5632784", "0.5621302", "0.56042284", "0.55996853", "0.5595551", "0.55922073", "0.55835205", "0.5552031", "0.55494314", "0.55437744", "0.5534004", "0.5533798", "0.5529816", "0.5529803", "0.55258244", "0.551067", "0.5508496", "0.550395", "0.54975015", "0.5496879", "0.5493469", "0.54926074", "0.54900265", "0.54869485", "0.5480848", "0.54761726", "0.5473727", "0.5470528", "0.5470019", "0.54694164", "0.54646647", "0.54628015", "0.5461294", "0.54504603", "0.54420704", "0.5438487", "0.5438388", "0.5435388", "0.5433775", "0.54322904", "0.5428602", "0.5426298", "0.54227626", "0.54104555", "0.53910404", "0.53790426", "0.5377845", "0.5374759", "0.5359192", "0.535824", "0.53553236", "0.53532195", "0.53520703", "0.53440595", "0.53437716", "0.53383857", "0.5334406", "0.53329605", "0.5330463", "0.53304416" ]
0.78083813
0
Validation Functions Description : To validate the Telephone Home in Contact Details of Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:05 Oct 2016 Modified By:Raja Parameter:TelephoneHome
public void validate_the_Telephone_Home_in_Contact_Details_of_Customer_Tab(String TelephoneHome)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneHome.replaceAll("M_Header", "Contact Details").replaceAll("M_Category", "Telephone - Home").replaceAll("M_InnerText", TelephoneHome), "Telephone - Home - "+TelephoneHome, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "private boolean validate(){\n\n String MobilePattern = \"[0-9]{10}\";\n String name = String.valueOf(userName.getText());\n String number = String.valueOf(userNumber.getText());\n\n\n if(name.length() > 25){\n Toast.makeText(getApplicationContext(), \"pls enter less the 25 characher in user name\",\n Toast.LENGTH_SHORT).show();\n return true;\n }\n\n\n\n else if(name.length() == 0 || number.length() == 0 ){\n Toast.makeText(getApplicationContext(), \"pls fill the empty fields\",\n Toast.LENGTH_SHORT).show();\n return false;\n }\n\n\n\n else if(number.matches(MobilePattern))\n {\n\n return true;\n }\n else if(!number.matches(MobilePattern))\n {\n Toast.makeText(getApplicationContext(), \"Please enter valid 10\" +\n \"digit phone number\", Toast.LENGTH_SHORT).show();\n\n\n return false;\n }\n\n return false;\n\n }", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "abstract void telephoneValidity();", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "private boolean validate() {\n if(edtMobileNumber.getText().toString().length() <= 0){\n edtMobileNumber.setFocusable(true);\n edtMobileNumber.setError(Constants.ERR_MSG_MOBILE);\n return false;\n }else if(edtFirstName.getText().toString().length() <= 0){\n edtFirstName.setFocusable(true);\n edtFirstName.setError(Constants.ERR_MSG_FIRST_NAME);\n return false;\n }else if(edtLastName.getText().toString().length() <= 0){\n edtLastName.setFocusable(true);\n edtLastName.setError(Constants.ERR_MSG_LAST_NAME);\n return false;\n }else if(edtDateOfBirth.getText().toString().length() <= 0){\n edtDateOfBirth.setFocusable(true);\n edtDateOfBirth.setError(Constants.ERR_MSG_DATE_OF_BIRTH);\n return false;\n }else if(edtEnterPin.getText().toString().length() <= 0){\n edtEnterPin.setFocusable(true);\n edtEnterPin.setError(Constants.ERR_MSG_PIN);\n return false;\n }else if(edtConfirmPin.getText().toString().length() <= 0){\n edtConfirmPin.setFocusable(true);\n edtConfirmPin.setError(Constants.ERR_MSG_CONFIRM_PIN);\n return false;\n }else if(spnStatus.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_STATUS, Toast.LENGTH_SHORT).show();\n return false;\n }else if(spnBloodGroup.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_BLOOD_GROUP, Toast.LENGTH_SHORT).show();\n return false;\n }else if(rgGender.getCheckedRadioButtonId() == -1){\n Toast.makeText(context,Constants.ERR_MSG_GENDER,Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "public void validate_the_Telephone_Mobile_in_Contact_Details_of_Customer_Tab(String TelephoneMobile)throws Exception {\n\t\tReport.fnReportPageBreak(\"Telephone Details\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneMobile.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Mobile\").replaceAll(\"M_InnerText\", TelephoneMobile), \"Telephone - Mobile - \"+TelephoneMobile, false);\n\t}", "public boolean isValid(){\n Email.setErrorEnabled(false);\n Email.setError(\"\");\n Fname.setErrorEnabled(false);\n Fname.setError(\"\");\n Lname.setErrorEnabled(false);\n Lname.setError(\"\");\n Pass.setErrorEnabled(false);\n Pass.setError(\"\");\n Mobileno.setErrorEnabled(false);\n Mobileno.setError(\"\");\n Cpass.setErrorEnabled(false);\n Cpass.setError(\"\");\n area.setErrorEnabled(false);\n area.setError(\"\");\n Houseno.setErrorEnabled(false);\n Houseno.setError(\"\");\n Pincode.setErrorEnabled(false);\n Pincode.setError(\"\");\n\n boolean isValid=false,isValidname=false,isValidhouseno=false,isValidlname=false,isValidemail=false,isValidpassword=false,isValidconfpassword=false,isValidmobilenum=false,isValidarea=false,isValidpincode=false;\n if(TextUtils.isEmpty(fname)){\n Fname.setErrorEnabled(true);\n Fname.setError(\"Enter First Name\");\n }else{\n isValidname=true;\n }\n if(TextUtils.isEmpty(lname)){\n Lname.setErrorEnabled(true);\n Lname.setError(\"Enter Last Name\");\n }else{\n isValidlname=true;\n }\n if(TextUtils.isEmpty(emailid)){\n Email.setErrorEnabled(true);\n Email.setError(\"Email Address is required\");\n }else {\n if (emailid.matches(emailpattern)) {\n isValidemail = true;\n } else {\n Email.setErrorEnabled(true);\n Email.setError(\"Enter a Valid Email Address\");\n }\n }\n if(TextUtils.isEmpty(password)){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Enter Password\");\n }else {\n if (password.length()<8){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Weak Password\");\n }else {\n isValidpassword = true;\n }\n }\n if(TextUtils.isEmpty(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Enter Password Again\");\n }else{\n if (!password.equals(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Password Dosent Match\");\n }else{\n isValidconfpassword=true;\n }\n }\n if(TextUtils.isEmpty(mobile)){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Enter Phone Number\");\n }else{\n if (mobile.length()<10){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Invalid Mobile Number\");\n } else {\n isValidmobilenum = true;\n }\n }\n if(TextUtils.isEmpty(Area)){\n area.setErrorEnabled(true);\n area.setError(\"Area is Required\");\n }else{\n isValidarea=true;\n }\n if(TextUtils.isEmpty(pincode)){\n Pincode.setErrorEnabled(true);\n Pincode.setError(\"Please Enter Pincode\");\n }else{\n isValidpincode=true;\n }\n if(TextUtils.isEmpty(house)){\n Houseno.setErrorEnabled(true);\n Houseno.setError(\"House field cant be empty\");\n }else{\n isValidhouseno=true;\n }\n isValid=(isValidarea && isValidpincode && isValidconfpassword && isValidpassword && isValidemail && isValidname &&isValidmobilenum && isValidhouseno && isValidlname)? true:false;\n return isValid;\n\n }", "private void validateData() {\n }", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "protected void validateMobileNumber(){\n /*\n Checking For Mobile number\n The Accepted Types Are +00 000000000 ; +00 0000000000 ;+000 0000000000; 0 0000000000 ; 00 0000000000\n */\n Boolean mobileNumber = Pattern.matches(\"^[0]?([+][0-9]{2,3})?[-][6-9]+[0-9]{9}\",getMobileNumber());\n System.out.println(mobileNumberResult(mobileNumber));\n }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "private boolean validateInput(){\n Window owner=root.getScene().getWindow();\n inputFileds.addAll(txtfn,txtln,txtsurname,txtDOB,txtResidence,txtMobile,txtID,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().isEmpty()){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n inputFileds.removeAll(txtDOB,txtMobile,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().length()>30){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Sorry the text you entered can not be greater that 30 characters\",\"Text too Long\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n if(username.getText().length()>20 || username.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Username has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid input\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n if(pass.getText().isEmpty()){\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n if(pass.getText().length()>20 || pass.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Password has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n SimpleDateFormat yearFormat = new SimpleDateFormat(\"yyyy\");\n try {\n date = dateFormat.parse(txtDOB.getText());\n Calendar cal=Calendar.getInstance();\n int year=Integer.parseInt(yearFormat.format(date));\n if (year <= 1900 || year>cal.get(Calendar.YEAR)) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n String initialEntry=txtDOB.getText();\n String parsedValue=dateFormat.format(date);\n if(!initialEntry.equals(parsedValue)){\n Dialog.showMessageDialog(owner, \"Note your Date of Birth has been corrected\", \"Date Corrected\",DialogIcon.INFORMATION);\n }\n txtDOB.setText(dateFormat.format(date));\n } catch (ParseException ex) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n try {\n int mobile=Integer.parseInt(txtMobile.getText());\n } catch (NumberFormatException e) {\n Dialog.showMessageDialog(owner, \"Invalid Mobile Number\", \"Invalid data\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n if(txtMobile.getText().length() != 10){\n Dialog.showMessageDialog(owner, \"Sorry your Mobile Number is invalid\", \"Invalid input\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n String sql=\"select Username,Password from users where Username=?\";\n try(PreparedStatement prstmt=con.prepareStatement(sql)) {\n prstmt.setString(1, username.getText());\n ResultSet rs=prstmt.executeQuery();\n if(rs.next()){\n Dialog.showMessageDialog(owner, \"Sorry Username already exists\\n Please change to different Username\", \"Username Exists\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n rs.close();\n } catch (SQLException e) {\n System.err.println(e);\n }\n return true;\n }", "public void checkvalidate()\n\t{\n\t\tif((fn.getText().toString()).equals(\"\"))\n \t{\n \t\t//text1.setText(\"Name not entered!!\");\n\t\t\tToast.makeText(AddContact.this, \"Name Not Entered\",Toast.LENGTH_SHORT).show();\n \t}\n \telse if((mobno.getText().toString()).equals(\"\"))\n \t{\n \t\t//text1.setText(\"Phone not entered!!\");\n \t\tToast.makeText(AddContact.this, \"Phone No. not Entered\",Toast.LENGTH_SHORT).show();\n \t}\t\n \telse\n \t{\n \t\tname=fn.getText().toString();\n\t\t\tstrln=ln.getText().toString();\n\t\t\t//mname=mn.getText().toString();\n\t\t\tstrmno=mobno.getText().toString();\n\t\t\tstreid=eid.getText().toString();\n\t\t\tstrtag_type=stag.getSelectedItem().toString();\n\t\t\tstrtag=tag.getText().toString();\n\t\t\tmshome=mhome.getText().toString();\n\t\t\tmswork=mwork.getText().toString();\n\t\t\tmsother=moth.getText().toString();\n\t\t\teswork=ework.getText().toString();\n\t\t\tesother=eoth.getText().toString();\n\t\t\tnotes=enotes.getText().toString();\n\t\t\tdata.Insert(name,mname,strln,strmno,mshome,mswork,msother,mscust, streid,eswork,esother,mscust,imagePath,strtag_type,strtag,0,date,time,notes,0);\n\t\t\tToast.makeText(AddContact.this, \"Added Successfully\",Toast.LENGTH_SHORT).show();\n\t\t\tCursor c=data.getData();\n\t\t\twhile(c.moveToNext())\n\t\t\t{\n\t\t\t\tString name1=c.getString(0);\n\t\t\t\tSystem.out.println(\"Name:\"+name1);\n\t\t\t\t\n\t\t\t}\n\t\t\tc.close();\n\t\t\tviewcontacts();\n \t}\n\t\t\n\t}", "private boolean validateForm() {\n Boolean validFlag = true;\n String email = emailTxt.getText().toString().trim();\n String name = nameTxt.getText().toString().trim();\n String phone = phoneTxt.getText().toString().trim();\n String password = passwordTxt.getText().toString();\n String confirPassWord = confirmPasswordTxt.getText().toString();\n\n Pattern emailP = Pattern.compile(\"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\", Pattern.CASE_INSENSITIVE);\n Matcher emailM = emailP.matcher(email);\n boolean emailB = emailM.find();\n\n if (TextUtils.isEmpty(email) || email.equals(\"\") || !emailB) {\n emailTxt.setError(\"Email bị để trống hoặc không dúng định dạng.\");\n validFlag = false;\n } else {\n emailTxt.setError(null);\n }\n\n if (TextUtils.isEmpty(password) || password.length() < 6) {\n passwordTxt.setError(\"Mật khẩu phải 6 ký tự trở lên\");\n validFlag = false;\n } else {\n passwordTxt.setError(null);\n }\n\n Pattern phoneP = Pattern.compile(\"[0-9]{8,15}$\");\n Matcher phoneM = phoneP.matcher(phone);\n boolean phoneB = phoneM.find();\n\n if (TextUtils.isEmpty(phone) || phone.length() < 8 || phone.length() > 15 || !phoneB) {\n phoneTxt.setError(\"Số điện thoại bị để trống hoặc không đúng định dạng\");\n validFlag = false;\n } else {\n phoneTxt.setError(null);\n }\n if (confirPassWord.length() < 6 || !confirPassWord.equals(password)) {\n confirmPasswordTxt.setError(\"Xác nhận mật khẩu không đúng\");\n validFlag = false;\n } else {\n confirmPasswordTxt.setError(null);\n }\n\n Pattern p = Pattern.compile(\"[0-9]\", Pattern.CASE_INSENSITIVE);\n Matcher m = p.matcher(name);\n boolean b = m.find();\n if (b) {\n nameTxt.setError(\"Tên tồn tại ký tự đặc biệt\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n if (TextUtils.isEmpty(name)) {\n nameTxt.setError(\"Không được để trống tên.\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n\n return validFlag;\n }", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "private void validateDetails() {\n\n clearErrors();\n Utils.hide_keyboard(getActivity());\n\n boolean valid = true;\n\n String cvv = cvvTv.getText().toString();\n String expiryDate = cardExpiryTv.getText().toString();\n String cardNo = cardNoTv.getText().toString();\n\n if (cvv.length() < 3) {\n valid = false;\n cvvTil.setError(\"Enter a valid cvv\");\n }\n\n if (expiryDate.length() != 5) {\n cardExpiryTil.setError(\"Enter a valid expiry date\");\n valid = false;\n }\n\n String cardNoStripped = cardNo.replaceAll(\"\\\\s\", \"\");\n\n if (cardNoStripped.length() < 12 ) {\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n else {\n try {\n Long parsed = Long.parseLong(cardNoStripped);\n }\n catch (Exception e) {\n e.printStackTrace();\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n }\n\n if (valid) {\n\n if (saveCardSwitch.isChecked()) {\n int cardLen = cardNoStripped.length();\n cardFirst6 = cardNoStripped.substring(0, 6);\n cardLast4 = cardNoStripped.substring(cardLen - 4, cardLen);\n shouldISaveThisCard = true;\n presenter.savePotentialCardDets(cardFirst6, cardLast4);\n }\n\n //make request\n PayloadBuilder builder = new PayloadBuilder();\n builder.setAmount(thetellerInitializer.getAmount() + \"\")\n .setNarration(thetellerInitializer.getNarration())\n .setCardno(cardNoStripped)\n .set3dUrl(thetellerInitializer.get3dUrl())\n .setEmail(thetellerInitializer.getEmail())\n .setCurrency(thetellerInitializer.getCurrency())\n .setMerchant_id(thetellerInitializer.getMerchant_id())\n .setCvv(cvv).setFirstname(thetellerInitializer.getfName())\n .setLastname(thetellerInitializer.getlName())\n .setIP(Utils.getDeviceImei(getActivity()))\n .setTxRef(thetellerInitializer.getTxRef())\n .setExpiryyear(expiryDate.substring(3,5))\n .setExpirymonth(expiryDate.substring(0,2))\n .setMeta(thetellerInitializer.getMeta())\n .setApiUser(thetellerInitializer.getApiUser())\n .setApiKey(thetellerInitializer.getApiKey())\n .setDevice_fingerprint(Utils.getDeviceImei(getActivity()))\n .setCardType(cardType);\n\n if (thetellerInitializer.getPayment_plan() != null) {\n builder.setPaymentPlan(thetellerInitializer.getPayment_plan());\n }\n\n body = builder.createPayload();\n\n presenter.chargeCard(body, thetellerConstants.API_KEY);\n }\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "void validateMobileNumber(String stringToBeValidated,String name);", "public boolean Validate() \r\n {\n return phoneNumber.matcher(getText()).matches();\r\n }", "public void validateMailAlerts() {\n System.out.println(\"Validating Mail Alerts\");\n boolean mailPasstoCheck = false, mailPassccCheck = false, mailFailtoCheck = false, mailFailccCheck = false;\n\n if (!mailpassto.getText().isEmpty()) {\n\n String[] emailAdd = mailpassto.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailPasstoCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". To Email address for passed test cases should not be empty.\\n\");\n\n }\n if (!mailpasscc.getText().isEmpty()) {\n String[] emailAdd = mailpasscc.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailPassccCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". CC Email address for passed test cases should not be empty.\\n\");\n\n }\n if (!mailfailto.getText().isEmpty()) {\n String[] emailAdd = mailfailto.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailFailtoCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". To Email address for failed test cases should not be empty.\\n\");\n\n }\n if (!mailfailcc.getText().isEmpty()) {\n String[] emailAdd = mailfailcc.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailFailccCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n } else {\n execptionData.append((++exceptionCount) + \".CC Email address for failed test cases should not be empty.\\n\");\n\n }\n\n if (mailPasstoCheck == true && mailPassccCheck == true && mailFailccCheck == true && mailFailtoCheck == true) {\n /*try {\n Properties connectionProperties = new Properties();\n String socketFactory_class = \"javax.net.ssl.SSLSocketFactory\"; //SSL Factory Class\n String mail_smtp_auth = \"true\";\n connectionProperties.put(\"mail.smtp.port\", port);\n connectionProperties.put(\"mail.smtp.socketFactory.port\", socketProperty);\n connectionProperties.put(\"mail.smtp.host\", hostSmtp.getText());\n connectionProperties.put(\"mail.smtp.socketFactory.class\", socketFactory_class);\n connectionProperties.put(\"mail.smtp.auth\", mail_smtp_auth);\n connectionProperties.put(\"mail.smtp.socketFactory.fallback\", \"false\");\n connectionProperties.put(\"mail.smtp.starttls.enable\", \"true\");\n Mail mail = new Mail(\"\");\n mail.createSession(fromMail.getText(), password.getText(), connectionProperties);\n mail.sendEmail(fromMail.getText(), mailpassto.getText(), mailpasscc.getText(), \"Test Mail from FACT\", \"Hi, This is the Test Mail for the FACT Tool\", \"\");\n mail.sendEmail(fromMail.getText(), mailfailto.getText(), mailfailcc.getText(), \"Test Mail from FACT\", \"Hi, This is the Test Mail for the FACT Tool\", \"\");*/\n mailAlertsCheck = true;\n /* } catch (IOException ex) {\n Logger.getLogger(ConfigFile.class.getName()).log(Level.SEVERE, null, ex);\n mailAlertsCheck = false;\n new ExceptionUI(ex);\n } catch (MessagingException ex) {\n Logger.getLogger(ConfigFile.class.getName()).log(Level.SEVERE, null, ex);\n mailAlertsCheck = false;\n new ExceptionUI(ex);\n }*/\n } else {\n mailAlertsCheck = false;\n mailPasstoCheck = false;\n mailPassccCheck = false;\n mailFailtoCheck = false;\n mailFailccCheck = false;\n }\n\n }", "private boolean isInfoValidate(){\n if(mEmailAddress.getText() == null || mEmailAddress.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_email_address);\n return false;\n }\n\n if(!mEmailAddress.getText().toString().contains(\"@\")){\n errorText = getString(R.string.register_warning_valid_email_address);\n return false;\n }\n\n// if(mRegionSpinner.getSelectedItemPosition() == Constant.NON_SELECT){\n// errorText = getString(R.string.register_warning_select_region);\n// return false;\n// }\n\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.HONG_KONG)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.HONGKONG_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n//\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.CHINA)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.CHINA_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n\n if(mPassword.getText() == null || mPassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_password);\n return false;\n }\n\n if(mRetypePassword.getText() == null || mRetypePassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_retype_password);\n return false;\n }\n\n if(!mPassword.getText().toString().equals(mRetypePassword.getText().toString())){\n errorText = getString(R.string.register_warning_not_the_same);\n return false;\n }\n\n if(!Utility.judgeContainsStr( mPassword.getText().toString())){\n errorText = getString(R.string.register_warning_contains_character);\n return false;\n }\n\n// if(!mPolicyCheckBox.isChecked()){\n// errorText = getString(R.string.register_warning_check_agreement);\n// return false;\n// }\n\n return true;\n }", "@Override\n public void validate() {\n boolean b = false;\n\n //retrieving the contact us form details from request object\n String firstName = objContactUsForm.getName().trim();\n String email = objContactUsForm.getEmail().trim();\n String message = objContactUsForm.getMessage().trim();\n\n //now validating each of the field\n if (firstName.isEmpty()) {\n addFieldError(\"name\", getText(\"name.required\"));\n b = true;\n }\n\n if (email.isEmpty()) {\n addFieldError(\"email\", getText(\"email.required\"));\n b = true;\n }\n if (!b) {\n Pattern p = Pattern.compile(\".+@.+\\\\.[a-z]+\");\n Matcher m = p.matcher(email);\n boolean matchFound = m.matches();\n if (!matchFound) {\n addFieldError(\"email\", \"Please Provide Valid Email ID\");\n }\n }\n\n if (message.isEmpty()) {\n addFieldError(\"message\", getText(\"message.required\"));\n b = true;\n }\n\n if (!b) {\n boolean matches = message.matches(\"[<>!~@$%^&\\\"|!\\\\[#$]\");\n if (matches) {\n addFieldError(\"message\", \"Please Provide Valid Message Name\");\n b = true;\n }\n }\n }", "public static void validation() {\n\t\tif ((!textFieldName.getText().isEmpty()) && (!textField_FirstName.getText().isEmpty())\n\t\t\t\t&& (!textField_Town.getText().isEmpty()) && (!textField_Town.getText().isEmpty())) {\n\n\t\t\tif ((isValidEmailAddress(textField_Email.getText()) == true)) {\n\t\t\t\ttextField_Email.setBackground(Color.white);\n\t\t\t\tif ((force(textField_Mtp.getText()) > 82)) {\n\t\t\t\t\ttextField_Mtp.setBackground(Color.white);\n\t\t\t\t\tactionGiveServeur();\n\n\t\t\t\t} else {\n\t\t\t\t\tshowMessageDialog(null, \"Votre mot de passe est trop faible\");\n\t\t\t\t\ttextField_Mtp.setText(\"Mot de passe trop simple : changer le \");\n\t\t\t\t\ttextField_Mtp.setBackground(Color.RED);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextField_Email.setText(\"Email invalide\");\n\t\t\t\ttextField_Email.setBackground(Color.RED);\n\t\t\t\tshowMessageDialog(null, \"Email est invalide\");\n\t\t\t}\n\t\t} else {\n\n\t\t\tshowMessageDialog(null, \"Certain champs sont vide !\");\n\t\t}\n\t}", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "void telephoneValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"+391111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"1111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"111 1111111\");\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data\n person.setTelephone(\"AAA\");\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }", "@Test\r\n\tpublic void view3_COEs_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\t\t//Table 3 - Data .\r\n\t\tList<WebElement> data_of_table3 = driver.findElements(view3_COEs_table_data_val);\r\n\t\t//Table 3 - Columns\r\n\t\tList<WebElement> col_of_table3 = driver.findElements(By.xpath(view3_curr_agent_stats_col));\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> updated_col_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t\r\n\t\t//Adding Column data from another table.\r\n\t\tdata_of_table3 = helper.modify_cols_data_of_table(col_of_table1, data_of_table3, updated_col_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table3, data_of_table3 );\r\n\t}", "@Test\r\n\tpublic void view3_todays_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"CML Service Level\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table2 = driver.findElements(view3_todays_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table2 = driver.findElements(By.xpath(view3_today_data_table));\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table2, data_of_table2 );\r\n\t}", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "boolean validateInput() {\n if (etFullname.getText().toString().equals(\"\")) {\n etFullname.setError(\"Please Enter Full Name\");\n return false;\n }\n if (etId.getText().toString().equals(\"\")) {\n etId.setError(\"Please Enter ID\");\n return false;\n }\n if (etEmail.getText().toString().equals(\"\")) {\n etEmail.setError(\"Please Enter Email\");\n return false;\n }\n if (etHall.getText().toString().equals(\"\")) {\n etHall.setError(\"Please Enter Hall Name\");\n return false;\n }\n if (etAge.getText().toString().equals(\"\")) {\n etAge.setError(\"Please Enter Age\");\n return false;\n }\n if (etPhone.getText().toString().equals(\"\")) {\n etPhone.setError(\"Please Enter Contact Number\");\n return false;\n }\n if (etPassword.getText().toString().equals(\"\")) {\n etPassword.setError(\"Please Enter Password\");\n return false;\n }\n\n // checking the proper email format\n if (!isEmailValid(etEmail.getText().toString())) {\n etEmail.setError(\"Please Enter Valid Email\");\n return false;\n }\n\n // checking minimum password Length\n if (etPassword.getText().length() < MIN_PASSWORD_LENGTH) {\n etPassword.setError(\"Password Length must be more than \" + MIN_PASSWORD_LENGTH + \"characters\");\n return false;\n }\n\n\n return true;\n }", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "@Override\n\tpublic Boolean isValidApplication(ApplicationBean applicationBean) {\n\t\tPattern namePattern=Pattern.compile(\"^[A-Za-z\\\\s]{3,}$\");\n\t\tMatcher nameMatcher=namePattern.matcher(applicationBean.getName());\n\t\tPattern dobPattern=Pattern.compile(\"^[0-3]?[0-9].[0-3]?[0-9].(?:[0-9]{2})?[0-9]{2}$\");\n\t\tMatcher dobMatcher=dobPattern.matcher(applicationBean.getDateOfBirth());\n\t\tPattern goalPattern=Pattern.compile(\"^[A-Za-z\\\\s]{1,}$\");\n\t\tMatcher goalMatcher=goalPattern.matcher(applicationBean.getGoals());\n\t\tPattern marksPattern=Pattern.compile(\"^[1-9][0-9]?$|^100$\");\n\t\tMatcher marksMatcher=marksPattern.matcher(applicationBean.getMarksObtained());\n\t\tPattern scheduleIdPattern=Pattern.compile(\"^[0-9]{1,2}$\");\n\t\tMatcher scheduleIdMatcher=scheduleIdPattern.matcher(applicationBean.getScheduledProgramID());\n\t\tPattern emailPattern=Pattern.compile(\"^[A-Za-z0-9+_.-]+@(.+)$\");\n\t\tMatcher emailMatcher=emailPattern.matcher(applicationBean.getEmailID());\n\t\t\n\t\t\n\t\tif(!(nameMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nApplicant Name Should Be In Alphabets and minimum 1 characters long.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(dobMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nDate of birth should be in DD/MM/YYYY format.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(goalMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\n Goal should be alphabetical and having minimum one letter\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(marksMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nMarks should be less than 100\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(scheduleIdMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nSchedule Id should be of one or two digit\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(emailMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nEnter valid email address\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public static void validate() {\r\n\t\tfrmMfhEmailer.validate();\r\n\t}", "@Override\n\tpublic void validate() {\n\t\t if(pname==null||pname.toString().equals(\"\")){\n\t\t\t addActionError(\"父项节点名称必填!\");\n\t\t }\n\t\t if(cname==null||cname.toString().equals(\"\")){\n\t\t\t addActionError(\"子项节点名称必填!\");\n\t\t }\n\t\t if(caction==null||caction.toString().equals(\"\")){\n\t\t\t addActionError(\"子项节点动作必填!\");\n\t\t }\n\t\t \n\t\t List l=new ArrayList();\n\t\t\tl=userService.QueryByTabId(\"Resfun\", \"resfunid\", resfunid);\n\t\t\t//判断是否修改\n\t\t\tif(l.size()!=0){\n\t\t\t\t\n\t\t\t\tfor(int i=0;i<l.size();i++){\n\t\t\t\t\tResfun rf=new Resfun();\n\t\t\t\t\trf=(Resfun)l.get(i);\n\t\t\t\t\tif(rf.getCaction().equals(caction.trim())&&rf.getCname().equals(cname)&&rf.getPname().equals(pname)){\n\t\t\t\t\t\tSystem.out.println(\"mei gai\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tList n=new ArrayList();\n\t\t\t\t\t\tn=userService.QueryByPcac(\"Resfun\", \"pname\", pname, \"cname\", cname, \"caction\", caction);\n\t\t\t\t\t\tif(n.size()!=0){\n\t\t\t\t\t\t\taddActionError(\"该记录已经存在!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t \n\t\t \n\t\t \n\t\t \n\t}", "@Test\r\n\tpublic void view3_current_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Columns\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t//Removing Column data from another table.\r\n\t\tdata_of_table1 = helper.modify_cols_data_of_table(col_of_table1, data_of_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table1, data_of_table1 );\r\n\t}", "public boolean validation(){\n String Venuename= venuename.getText().toString();\n String Address= address.getText().toString();\n String Details= details.getText().toString();\n String Venueimage= venueimage.getText().toString();\n if(Venuename.isEmpty()){\n venuename.setError(\"Please enter the item name\");\n venuename.requestFocus();\n return false;\n }\n if(Address.isEmpty()){\n address.setError(\"Please enter the item name\");\n address.requestFocus();\n return false;\n }\n if(Details.isEmpty()){\n details.setError(\"Please enter the item name\");\n details.requestFocus();\n return false;\n }\n if(Venueimage.isEmpty()){\n venueimage.setError(\"Please Select the image first\");\n return false;\n }\n\n\n return true;\n }", "@Test\n\t\tvoid givenEmail_CheckForValidationForMobile_RetrunTrue() {\n\t\t\tboolean result = ValidateUserDetails.validateMobile(\"98 9808229348\");\n\t\t\tAssertions.assertTrue(result);\n\t\t}", "private boolean tableDataValid()\r\n {\r\n // if there are any form level validations that should go there\r\n int rowTotal = tblProtoCorresp.getRowCount();\r\n int colTotal = tblProtoCorresp.getColumnCount();\r\n for (int rowIndex = 0; rowIndex < rowTotal ; rowIndex++)\r\n {\r\n for (int colIndex = 0; colIndex < colTotal; colIndex++)\r\n {\r\n TableColumn column = codeTableColumnModel.getColumn(colIndex) ;\r\n\r\n ColumnBean columnBean = (ColumnBean)column.getIdentifier() ;\r\n\r\n if (columnBean.getColumnEditable()\r\n && !columnBean.getColumnCanBeNull())\r\n {\r\n if ( tblProtoCorresp.getValueAt(rowIndex,colIndex) != null)\r\n {\r\n if (tblProtoCorresp.getValueAt(rowIndex,colIndex).equals(\"\")\r\n || tblProtoCorresp.getValueAt(rowIndex,colIndex).toString().trim().equals(\"\") )\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n else\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n }\r\n return true ;\r\n }", "public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "private boolean validateInputInfo(){\n\n //Get user input\n String firstName = newContactFirstName.getText().toString();\n String lastName = newContactLastName.getText().toString();\n String email = newContactEmailAddress.getText().toString();\n String phone = newContactPhoneNumber.getText().toString();\n\n //Check to make sure no boxes were left empty\n if(firstName.isEmpty() || lastName.isEmpty() || email.isEmpty() || phone.isEmpty()){\n Toast.makeText(this, \"You must fill all fields before continuing!\", Toast.LENGTH_LONG).show();\n return false;\n }\n //Check to see if phone number is valid\n else if(!(phone.length() >= 10)){\n Toast.makeText(this, \"Make sure to input a valid 10 digit phone number!\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n return true;\n }", "private boolean validateData() {\n if (!mCommon.validateData()) return false;\n\n Core core = new Core(this);\n\n // Due Date is required\n if (TextUtils.isEmpty(getRecurringTransaction().getDueDateString())) {\n core.alert(R.string.due_date_required);\n return false;\n }\n\n if (TextUtils.isEmpty(mCommon.viewHolder.dateTextView.getText().toString())) {\n core.alert(R.string.error_next_occurrence_not_populate);\n\n return false;\n }\n\n // Payments Left must have a value\n if (getRecurringTransaction().getPaymentsLeft() == null) {\n core.alert(R.string.payments_left_required);\n return false;\n }\n return true;\n }", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean validateFields(Customer customer) {\r\n if (isEmpty(customer.getFirstName(), customer.getLastName(), customer.getPhoneNum(),\r\n customer.getEmail(), customer.getDate())) {\r\n Alert alert = new Alert(Alert.AlertType.WARNING);\r\n alert.setTitle(\"Invalid info\");\r\n alert.setHeaderText(null);\r\n alert.setContentText(\"Invalid info.\\nAll fields must be filled.\");\r\n alert.showAndWait();\r\n return false;\r\n }\r\n return true;\r\n }", "private void validateFields(){\n String email = edtEmail.getText().toString().trim();\n String number=edtPhone.getText().toString().trim();\n String cc=txtCountryCode.getText().toString();//edtcc.getText().toString().trim();\n String phoneNo=cc+number;\n // Check for a valid email address.\n\n\n if (TextUtils.isEmpty(email)) {\n mActivity.showSnackbar(getString(R.string.error_empty_email), Toast.LENGTH_SHORT);\n return;\n\n } else if (!Validation.isValidEmail(email)) {\n mActivity.showSnackbar(getString(R.string.error_title_invalid_email), Toast.LENGTH_SHORT);\n return;\n\n }\n\n if(TextUtils.isEmpty(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_empty_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n if(!Validation.isValidMobile(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_title_invalid_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n\n if(selectedCurrency==null){\n //mActivity.showSnackbar(getString(R.string.str_select_currency), Toast.LENGTH_SHORT);\n Snackbar.make(getView(),\"Currency data not found!\",Snackbar.LENGTH_LONG)\n .setAction(\"Try again\", new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n getAllCurrency();\n }\n }).show();\n return;\n }\n try {\n JsonObject object = new JsonObject();\n object.addProperty(KEY_EMAIL, email);\n object.addProperty(KEY_PHONE,phoneNo);\n object.addProperty(KEY_CURRENCY,selectedCurrency.getId().toString());\n updateUser(object,token);\n }catch (Exception e){\n\n }\n\n }", "private boolean validate(String name, String phone, String email, String description) {\n if (name.equals(null) || name.equals(\"\") || !isValidMobile(phone) || !isValidMail(email) || description.equals(null) || description.equals(\"\")) {\n\n if (name.equals(null) || name.equals(\"\")) {\n nameText.setError(\"Enter a valid Name\");\n } else {\n nameText.setError(null);\n }\n if (!isValidMobile(phone)) {\n phoneNumber.setError(\"Enter a valid Mobile Number\");\n } else {\n phoneNumber.setError(null);\n }\n if (!isValidMail(email)) {\n emailText.setError(\"Enter a valid Email ID\");\n } else {\n emailText.setError(null);\n }\n if (description.equals(null) || description.equals(\"\")) {\n descriptionText.setError(\"Add few lines about you\");\n } else {\n descriptionText.setError(null);\n }\n return false;\n } else\n return true;\n }", "private boolean isInputValid() {\n String errorMessage = \"\";\n\n if (ServiceName.getText() == null || ServiceName.getText().length() == 0) {\n errorMessage += \"No valid name!\\n\";\n }\n if (Serviceemail.getText() == null || Serviceemail.getText().length() == 0) {\n Pattern p = Pattern.compile(\"[_A-Za-z0-9][A-Za-z0-9._]*?@[_A-Za-z0-9]+([.][_A-Za-z]+)+\");\n Matcher m = p.matcher(Serviceemail.getText());\n if (m.find() && m.group().equals(Serviceemail.getText())) {\n errorMessage += \"No valid Mail Forment!\\n\";\n }\n }\n if (servicedescrip.getText() == null || servicedescrip.getText().length() == 0) {\n errorMessage += \"No valid description !\\n\";\n }\n if (f == null && s.getImage() == null) {\n errorMessage += \"No valid photo ( please upload a photo !)\\n\";\n }\n if (Serviceprice.getText() == null || Serviceprice.getText().length() == 0) {\n errorMessage += \"No valid prix !\\n\";\n } else {\n // try to parse the postal code into an int.\n try {\n Float.parseFloat(Serviceprice.getText());\n } catch (NumberFormatException e) {\n errorMessage += \"No valid prix (must be a Float)!\\n\";\n }\n }\n if ( !Weekly.isSelected() && !Daily.isSelected() && !Monthly.isSelected()) {\n errorMessage += \"No valid Etat ( select an item !)\\n\";\n }\n if (Servicesatet.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid etat ( select an item !)\\n\";\n }\n if (ServiceCity.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid City ( select an item !)\\n\";\n }\n if (servicetype.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid Type ( select an item !)\\n\";\n }\n if (errorMessage.length() == 0) {\n return true;\n } else {\n // Show the error message.\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Invalid Fields\");\n alert.setHeaderText(\"Please correct invalid fields\");\n alert.setContentText(errorMessage);\n alert.showAndWait();\n return false;\n }\n }", "@Override\n\t@FXML\n\tpublic boolean validate() {\n\t\t\n\t\tboolean isDataEntered = true;\n\t\tLocalDate startDate = Database.getInstance().getStartingDate();\n\t\tSystem.out.println();\n\t\tif(amountField.getText() == null || amountField.getText().trim().isEmpty())\n\t\t\tisDataEntered = setErrorTxt(\"You left the amount field empty.\");\n\t\telse if(!(Validation.validateAmount(amountField.getText())))\n\t\t\tisDataEntered = setErrorTxt(\"Please enter a valid amount\");\n\t\telse if(creditTextField.getText() == null || creditTextField.getText().trim().isEmpty())\n\t\t\tisDataEntered = setErrorTxt(\"You left the credit text field empty.\");\n\t\telse if(!(Validation.validateChars(creditTextField.getText())))\n\t\t\tisDataEntered = setErrorTxt(\"Please only enter valid characters\");\n\t\telse if(dateField.getValue() == null) {\n\t\t\tisDataEntered = setErrorTxt(\"You left the date field empty.\");\t\t\t\n\t\t}\n\t\telse if(dateField.getValue().isBefore(startDate))\n\t\t\tisDataEntered = setErrorTxt(\"Sorry, the date you entered is before the starting date.\");\n\t\treturn isDataEntered;\n\t}", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "private void ValidateEditTextFields() {\n\tfor (int i = 0; i < etArray.length; i++) {\n\t if (etArray[i].getText().toString().trim().length() <= 0) {\n\t\tvalidCustomer = false;\n\t\tetArray[i].setError(\"Blank Field\");\n\t }\n\t}\n\n\tif (etPhoneNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etPhoneNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (etEmergencyNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etEmergencyNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (calendarDob == null) {\n\t validCustomer = false;\n\t}\n }", "abstract void fiscalCodeValidity();", "public void validateRpd11s7()\n {\n // This guideline cannot be automatically tested.\n }", "protected void validateEmail(){\n\n //Creating Boolean Value And checking More Accurate Email Validator Added\n\n Boolean email = Pattern.matches(\"^[A-Za-z]+([.+-]?[a-z A-z0-9]+)?@[a-zA-z0-9]{1,6}\\\\.[a-zA-Z]{2,6},?([.][a-zA-z+,]{2,6})?$\",getEmail());\n System.out.println(emailResult(email));\n }", "@And(\"^Enter user phone and confirmation code$\")\t\t\t\t\t\n public void Enter_user_phone_and_confirmation_code() throws Throwable \t\t\t\t\t\t\t\n { \t\t\n \tdriver.findElement(By.id(\"phoneNumberId\")).sendKeys(\"01116844320\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvPhoneNext']/content/span\")).click();\n driver.findElement(By.id(\"code\")).sendKeys(\"172978\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvVerifyNext']/content/span\")).click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\t\t\n }", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "private void checkValidation() {\n // Get email id and password\n MainActivity.EmailAddress = emailid.getText().toString();\n finalPassword = password.getText().toString();\n\n // Check patter for email id\n Pattern p = Pattern.compile(Utils.regEx);\n\n Matcher m = p.matcher(MainActivity.EmailAddress);\n\n // Check for both field is empty or not\n if (MainActivity.EmailAddress.equals(\"\") || MainActivity.EmailAddress.length() == 0\n || finalPassword.equals(\"\") || finalPassword.length() == 0) {\n loginLayout.startAnimation(shakeAnimation);\n new CustomToast().Show_Toast(getActivity(), view,\n \"Enter both credentials.\");\n\n }\n // Check if email id is valid or not\n else if (!m.find())\n new CustomToast().Show_Toast(getActivity(), view,\n \"Your Email Id is Invalid.\");\n // Else do login and do your stuff\n else\n tryLoginUser();\n\n }", "private void checkFields() {\n\t\t\n\t\tboolean errors = false;\n\t\t\n\t\t// contact name\n\t\tString newName = ((TextView) findViewById(R.id.tvNewContactName)).getText().toString();\n\t\tTextView nameErrorView = (TextView) findViewById(R.id.tvContactNameError);\n\t\tif(newName == null || newName.isEmpty()) {\n\t\t\terrors = true;\n\t\t\tnameErrorView.setText(\"Contact must have a name!\");\n\t\t} else {\n\t\t\tnameErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact phone number\n\t\tString newPhone = ((TextView) findViewById(R.id.tvNewContactPhone)).getText().toString();\n\t\tTextView phoneNumberErrorView = (TextView) findViewById(R.id.tvContactPhoneError);\n\t\tif(newPhone == null || newPhone.isEmpty()) {\n\t\t\terrors = true;\n\t\t\tphoneNumberErrorView.setText(\"Contact must have a phone number!\");\n\t\t} else {\n\t\t\tphoneNumberErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact e-mail\n\t\tString newEmail= ((TextView) findViewById(R.id.tvNewContactEmail)).getText().toString();\n\t\tTextView emailErrorView = (TextView) findViewById(R.id.tvContactEmailError);\n\t\tif(newEmail == null || newEmail.isEmpty()) {\n\t\t\terrors = true;\n\t\t\temailErrorView.setText(\"Contact must have an E-mail!\");\n\t\t} else if (!newEmail.matches(\".+@.+\\\\..+\")) {\n\t\t\terrors = true;\n\t\t\temailErrorView.setText(\"Invalid E-mail address! Example:\"\n\t\t\t\t\t+ \"[email protected]\");\n\t\t} else {\n\t\t\temailErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact note\n\t\tString newNote = ((TextView) findViewById(R.id.tvNewContactNote)).getText().toString();\n\t\t\n\t\t// contact Facebook profile address\n\t\tString newAddress = ((TextView) findViewById(R.id.tvNewContactAddress)).getText().toString();\n\t\t\n\t\t// save the new contact if all the required fields are filled out\n\t\tif(!errors) {\n\t\t\tif(newNote == null || newNote.isEmpty()) {\n\t\t\t\tnewNote = \"No note.\";\n\t\t\t}\n\t\t\t\n\t\t\tif(newAddress == null || newAddress.isEmpty()) {\n\t\t\t\tnewAddress = \"No address.\";\n\t\t\t}\n\t\t\tHomeActivity.listOfContacts.add(new Contact(newName, newPhone, newEmail, \n\t\t\t\t\tnewNote, newAddress));\n\t\t\tIntent intent = new Intent(AddContactActivity.this, HomeActivity.class);\n\t\t\tstartActivity(intent);\n\t\t}\n\t}", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "private String validarEntradas()\n { \n return Utilitarios.validarEntradas(campoNomeAC, campoEnderecoAC, campoBairroAC, campoCidadeAC, campoUfAC, campoCepAC, campoTelefoneAC, campoEmailAC);\n }", "public void validate() {}", "private boolean isInputValid() {\r\n \r\n String errorMessage = \"\";\r\n \r\n // Email regex provided by emailregex.com using the RFC5322 standard\r\n String emailPatternString = \"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\r\n \r\n // Phone number regex provided by Ravi Thapliyal on Stack Overflow:\r\n // http://stackoverflow.com/questions/16699007/regular-expression-to-match-standard-10-digit-phone-number\r\n String phoneNumString = \"^(\\\\+\\\\d{1,2}\\\\s)?\\\\(?\\\\d{3}\\\\)?[\\\\s.-]?\\\\d{3}[\\\\s.-]?\\\\d{4}$\";\r\n \r\n Pattern emailPattern = Pattern.compile(emailPatternString, Pattern.CASE_INSENSITIVE);\r\n Matcher emailMatcher;\r\n \r\n Pattern phoneNumPattern = Pattern.compile(phoneNumString);\r\n Matcher phoneNumMatcher;\r\n \r\n // Validation for no length or over database size limit\r\n if ((custFirstNameTextField.getText() == null || custFirstNameTextField.getText().length() == 0) || (custFirstNameTextField.getText().length() > 25)) {\r\n errorMessage += \"First name has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custLastNameTextField.getText() == null || custLastNameTextField.getText().length() == 0) || (custLastNameTextField.getText().length() > 25)) {\r\n errorMessage += \"Last name has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custAddressTextField.getText() == null || custAddressTextField.getText().length() == 0) || (custAddressTextField.getText().length() > 75)) {\r\n errorMessage += \"Address has to be between 1 and 75 characters.\\n\";\r\n }\r\n \r\n if ((custCityTextField.getText() == null || custCityTextField.getText().length() == 0) || (custCityTextField.getText().length() > 50)) {\r\n errorMessage += \"City has to be between 1 and 50 characters.\\n\";\r\n }\r\n \r\n if ((custProvinceTextField.getText() == null || custProvinceTextField.getText().length() == 0) || (custProvinceTextField.getText().length() > 2)) {\r\n errorMessage += \"Province has to be a two-letter abbreviation.\\n\";\r\n }\r\n \r\n if ((custPostalCodeTextField.getText() == null || custPostalCodeTextField.getText().length() == 0) || (custPostalCodeTextField.getText().length() > 7)) {\r\n errorMessage += \"Postal Code has to be between 1 and 7 characters.\\n\";\r\n }\r\n \r\n if ((custCountryTextField.getText() == null || custCountryTextField.getText().length() == 0) || (custCountryTextField.getText().length() > 25)) {\r\n errorMessage += \"Country has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custHomePhoneTextField.getText() == null || custHomePhoneTextField.getText().length() == 0) || (custHomePhoneTextField.getText().length() > 20)) {\r\n errorMessage += \"Phone number has to be between 1 and 20 characters long.\\n\";\r\n } else {\r\n phoneNumMatcher = phoneNumPattern.matcher(custHomePhoneTextField.getText());\r\n if (!phoneNumMatcher.matches()) {\r\n errorMessage += \"Phone number not in the correct format: (111) 111-1111.\\n\";\r\n }\r\n }\r\n \r\n if ((custBusinessPhoneTextField.getText() == null || custBusinessPhoneTextField.getText().length() == 0) || (custBusinessPhoneTextField.getText().length() > 20)) {\r\n errorMessage += \"Phone number has to be between 1 and 20 characters long.\\n\";\r\n } else {\r\n phoneNumMatcher = phoneNumPattern.matcher(custBusinessPhoneTextField.getText());\r\n if (!phoneNumMatcher.matches()) {\r\n errorMessage += \"Phone number not in the correct format: (111) 111-1111.\\n\";\r\n }\r\n }\r\n \r\n if ((custEmailTextField.getText() == null || custEmailTextField.getText().length() == 0) || (custEmailTextField.getText().length() > 50)) {\r\n errorMessage += \"Email has to be between 1 and 50 characters.\\n\";\r\n } else {\r\n emailMatcher = emailPattern.matcher(custEmailTextField.getText());\r\n if (!emailMatcher.matches()) {\r\n errorMessage += \"Email format is not correct. Should be in the format [email protected].\\n\"; \r\n } \r\n }\r\n \r\n if (errorMessage.length() > 0) {\r\n Alert alert = new Alert(AlertType.ERROR, errorMessage, ButtonType.OK);\r\n alert.setTitle(\"Input Error\");\r\n alert.setHeaderText(\"Please correct invalid fields\");\r\n alert.showAndWait();\r\n \r\n return false;\r\n }\r\n \r\n return true;\r\n }", "private String checkUserDetail(UserModel userModel) {\n\t\tString name = userModel.getName();\n\t\tString mobileNumber = userModel.getMobileNumber();\n\t\tString email = userModel.getEmail();\n\t\tString pincode = userModel.getPincode();\n\t\tString area = userModel.getAreaName();\n\t\tString state = userModel.getStateName();\n\t\tString res = \"okkk\";\n\t\tif (mobileNumber.length() != 10) {\n\t\t\tres = \"Enter ten digit mobile number\";\n\t\t} else if (!checkMobileDigit(mobileNumber)) {\n\t\t\tres = \"enter only digit\";\n\t\t} else if (!checkNameChar(name)) {\n\t\t\tres = \"name shuld be only in alphabet\";\n\t\t} else if (!checkEmail(email)) {\n\t\t\tres = \"enter a valid email\";\n\t\t} else if (pincode.length() != 6) {\n\t\t\tres = \"enter valid pincode and enter only six digit\";\n\t\t} else if (!checkPincode(pincode)) {\n\t\t\tres = \"enter only digit\";\n\t\t} else if (area.equals(null)) {\n\t\t\tres = \"choose area\";\n\t\t} else if (state.equals(null)) {\n\t\t\tres = \"choose state\";\n\t\t}\n\t\treturn res;\n\t}", "public boolean verifyData()\n {\n if(jTextFieldName.getText().equals(\"\") && jTextFieldNumber.getText().equals(\"\") \n || jTextFieldSupplier.getText().equals(\"\") || jTextArea1.getText().equals(\"\") || jTextFieldModel.getText().equals(\"\"))\n {\n JOptionPane.showMessageDialog(null, \"One or More Fields Are Empty\");\n return false;\n }\n \n else\n {\n return true;\n }\n \n }", "private static void validateEntity(AdminOffice entity) throws ValidationException {\n\t\t//Validator.validateStringField(\"officeName\", entity.getOfficeName(), 55, true);\n\t\t//Validator.validateStringField(\"phone\", entity.getPhone(), 12, false);\t\t\n\t}", "public void validate(DataRecord value) {\n\r\n\t}", "private boolean getValidation() {\n strLoginMail = inputLoginMail.getText().toString().trim();\n strLoginPass = inputLoginPass.getText().toString().trim();\n\n if (strLoginMail.isEmpty()) { // Check Email Address\n inputLoginMail.setError(getString(dk.eatmore.demo.R.string.email_blank));\n inputLoginMail.requestFocus();\n return false;\n } else if (!isValidEmail(strLoginMail)) {\n inputLoginMail.setError(getString(dk.eatmore.demo.R.string.invalid_email));\n inputLoginMail.requestFocus();\n return false;\n } else if (strLoginPass.isEmpty()) { // Check Password\n inputLoginPass.setError(getString(dk.eatmore.demo.R.string.password_empty));\n inputLoginPass.requestFocus();\n return false;\n }\n\n return true;\n }", "private boolean checkInfo()\n {\n boolean flag = true;\n if(gName.isEmpty())\n {\n groupName.setError(\"Invalid name\");\n flag = false;\n }\n if(gId.isEmpty())\n {\n groupId.setError(\"Invalid id\");\n flag = false;\n }\n if(gAddress.isEmpty())\n {\n groupAddress.setError(\"Invalid address\");\n flag = false;\n }\n\n for(char c : gName.toCharArray()){\n if(Character.isDigit(c)){\n groupName.setError(\"Invalid Name\");\n flag = false;\n groupName.requestFocus();\n }\n }\n\n if(groupType.isEmpty())\n {\n flag = false;\n rPublic.setError(\"Choose one option\");\n }\n\n if(time.isEmpty())\n time = \"not set\";\n\n if(groupDescription.getText().toString().length()<20||groupDescription.getText().toString().length()>200)\n groupDescription.setError(\"Invalid description\");\n\n return flag;\n }", "public void validateRpd13s9()\n {\n // This guideline cannot be automatically tested.\n }", "void validate();", "void validate();", "public void validateRpd11s6()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean isFormValid(AdminAddEditUserDTO dto)\r\n\t{\n\t\tSOWError error;\r\n\t\tList<IError> errors = new ArrayList<IError>();\t\t\r\n\t\t\r\n\t\t// First Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getFirstName()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_First_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_First_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\t// Last Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getLastName()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Last_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Last_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\t\r\n\t\t// User Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getUsername()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_User_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\telse\r\n\t\t{\t\r\n\t\t\t//User Name Length Check\r\n\t\t\tif((dto.getUsername().length() < 8) || (dto.getUsername().length() >30)){\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"),getTheResourceBundle().getString(\"Admin_User_Name_Length_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString jobRole = getParameter(\"jobRole\");\r\n\t\tif(\"-1\".equals(jobRole))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Job_Role\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Job_Role_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Handle Primary Email\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getEmail()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Email\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isEmailValid(dto.getEmail()) == false)\r\n\t\t\t{\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_PrimaryEmail\"),\r\n\t\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Pattern_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if(dto.getEmail().equals(dto.getEmailConfirm()) == false)\r\n\t\t\t{\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_PrimaryEmail\"),\r\n\t\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Confirm_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Check for existing username, only in Add mode\r\n\t\tString mode = (String)getSession().getAttribute(\"addEditUserMode\");\r\n\t\tif(mode != null)\r\n\t\t{\r\n\t\t\tif(mode.equals(\"add\"))\r\n\t\t\t{\r\n\t\t\t\tif(manageUsersDelegate.getAdminUser(dto.getUsername()) != null || manageUsersDelegate.getBuyerUser(dto.getUsername()) != null)\r\n\t\t\t\t{\r\n\t\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"), getTheResourceBundle().getString(\"Admin_Existing_User_Validation_Msg1\")+\" \" + dto.getUsername() +\" \" +getTheResourceBundle().getString(\"Admin_Existing_User_Validation_Msg2\"), OrderConstants.FM_ERROR);\r\n\t\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// If we have errors, put them in request.\r\n\t\tif(errors.size() > 0)\r\n\t\t{\r\n\t\t\tsetAttribute(\"errors\", errors);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tgetSession().removeAttribute(\"addEditUserMode\");\r\n\t\t\tgetSession().removeAttribute(\"originalUsername\");\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "private int completionCheck() {\n if (nameTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(1);\n return -1;\n }\n if (addressTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(2);\n return -1;\n }\n if (postCodeTB.getText().trim().isEmpty()){\n AlertMessage.addCustomerError(3);\n return -1;\n }\n if (countryCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(4);\n return -1;\n }\n if (stateProvinceCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(5);\n return -1;\n }\n if (phone.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(6);\n return -1;\n }\n return 1;\n }", "public void SetCreditCarddetails(String ccnumber, String ccname, String ccmonth, String ccyear, String ccseccode){\r\n\t\tString countrygroup_ccdetails= \"UK,PresselAustria\";\r\n\t\tString CCnum = getValue(ccnumber);\r\n\t\tString CCName = getValue(ccname);\r\n\t\tString CCMonth = getValue(ccmonth);\r\n\t\tString CCYear = getValue(ccyear);\r\n\t\tString CCSecCode = getValue(ccseccode);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+CCnum+\", \"+CCName+\", \"+CCMonth+\", \"+CCYear+\", \"+CCSecCode);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The CreditCard details should be entered\");\r\n\t\ttry{\r\n\t\t\tif(!(countrygroup_ccdetails).contains(countries.get(countrycount))){\r\n\t\t\t\tswitchframe(\"TokenizationPage\");\r\n\t\t\t\tsleep(2000);\r\n\t\t\t\tsendKeys(locator_split(\"txtCCnumber\"), CCnum);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCname\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCname\"), CCName);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCMonth\"), CCMonth);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCYear\"), CCYear);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCcode\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCcode\"), CCSecCode);\t\t\t\t\t\t\r\n\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The CreditCard details are entered\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The new CreditCard details are applicable to this \" +country);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- The CreditCard details are not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"One of the element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCnumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCname\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCMonth\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCYear\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCcode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" are not found\");\r\n\r\n\t\t}\r\n\t}", "@Test(priority=1)\n\tpublic void checkFirstNameAndLastNameFieldValiditywithNumbers(){\n\t\tsignup.clearAllFields();\n\t\tsignup.enterId(\"[email protected]\");\n\t\tsignup.enterFirstName(\"12345\");\n\t\tsignup.enterLastName(\"56386\");\n\t\tsignup.clickSubmit();\n\t\tList<String> errors = signup.getErrors();\n\t\t// given page accepts numbers into the firstname and lastname fields\n\t\tAssert.assertFalse(TestHelper.isStringPresent(errors, \"Please enter your last name.\"));\n\t\tAssert.assertFalse(TestHelper.isStringPresent(errors, \"Please enter your first name.\"));\n\t}", "public boolean isValidPart() {\n boolean result = false;\n boolean isComplete = !partPrice.getText().equals(\"\")\n && !partName.getText().equals(\"\")\n && !inventoryCount.getText().equals(\"\")\n && !partId.getText().equals(\"\")\n && !maximumInventory.getText().equals(\"\")\n && !minimumInventory.getText().equals(\"\")\n && !variableTextField.getText().equals(\"\");\n boolean isValidPrice = isDoubleValid(partPrice);\n boolean isValidName = isCSVTextValid(partName);\n boolean isValidId = isIntegerValid(partId);\n boolean isValidMax = isIntegerValid(maximumInventory);\n boolean isValidMin = isIntegerValid(minimumInventory);\n boolean isMinLessThanMax = false;\n if (isComplete)\n isMinLessThanMax = Integer.parseInt(maximumInventory.getText()) > Integer.parseInt(minimumInventory.getText());\n\n if (!isComplete) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Missing Information\");\n errorMessage.setHeaderText(\"You didn't enter required information!\");\n errorMessage.setContentText(\"All fields are required! Your part has not been saved. Press \\\"OK\\\" and try again.\");\n errorMessage.show();\n } else if (!isMinLessThanMax) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Invalid Entry\");\n errorMessage.setHeaderText(\"Min must be less than Max!\");\n errorMessage.setContentText(\"Re-enter your data! Your part has not been saved.Press \\\"OK\\\" and try again.\");\n errorMessage.show();\n } else if (!isValidPrice) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Price is not valid\");\n errorMessage.setHeaderText(\"The value you entered for price is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered does\" +\n \" not include more than one decimal point (.), does not contain any letters, and does not \" +\n \"have more than two digits after the decimal. \");\n errorMessage.show();\n } else if (!isValidName) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Invalid Name\");\n errorMessage.setHeaderText(\"The value you entered for name is not valid.\");\n errorMessage.setContentText(\"Please ensure that the text you enter does not\" +\n \" include any quotation marks,\" +\n \"(\\\"), or commas (,).\");\n errorMessage.show();\n } else if (!isValidId) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect ID\");\n errorMessage.setHeaderText(\"The value you entered for ID is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else if (!isValidMax) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect Max Inventory\");\n errorMessage.setHeaderText(\"The value you entered for Max is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else if (!isValidMin) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect Min Inventory\");\n errorMessage.setHeaderText(\"The value you entered for Min is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else {\n result = true;\n }\n\n return result;\n }", "public void validateRpd13s6()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean checkUserInformation(String name,String userName,String email,String password)\n {\n\n if(userName.isEmpty())\n {\n eUserName.setError(\"empty field\");\n return false;\n }\n\n if(name.isEmpty())\n {\n eName.setError(\"empty field\");\n return false;\n }\n\n if(email.isEmpty())\n {\n eEmail.setError(\"empty field\");\n return false;\n }\n if(password.isEmpty())\n {\n ePassword.setError(\"empty field\");\n return false;\n }\n\n\n if(password.length()<6)\n {\n ePassword.setError(\"Invalid password\");\n ePassword.requestFocus();\n return false;\n }\n if(password.length()>16)\n {\n ePassword.setError(\"Invalid password\");\n ePassword.requestFocus();\n return false;\n }\n\n if(eAddress.getText().toString().isEmpty())\n {\n eAddress.setError(\"Invalid address\");\n eAddress.requestFocus();\n return false;\n }\n\n if(eFavourite.getText().toString().isEmpty())\n {\n eFavourite.setError(\"empty field\");\n eFavourite.requestFocus();\n return false;\n }\n\n if(!email.contains(\"@\"))\n {\n eEmail.setError(\"Invalid email\");\n eEmail.requestFocus();\n return false;\n }\n\n if(name.length()<3)\n {\n eName.setError(\"Invalid name\");\n eName.requestFocus();\n return false;\n }\n\n for(char c : name.toCharArray()){\n if(Character.isDigit(c)){\n eName.setError(\"Invalid Name\");\n eName.requestFocus();\n return false;\n }\n }\n\n if(userName.length()<5)\n {\n eUserName.setError(\"User name must be in 6 to 12 character\");\n eUserName.requestFocus();\n return false;\n }\n\n if(eAddress.getText().toString().length()<10||eAddress.getText().toString().length()>30)\n {\n eAddress.setError(\"Must be in 10-30 characters\");\n eAddress.requestFocus();\n return false;\n }\n return true;\n }", "private boolean checkFields() {\n boolean test = true;\n if (fname.isEmpty()) {\n test = false;\n }\n if (lname.isEmpty()) {\n test = false;\n }\n if (cin.isEmpty()) {\n test = false;\n }\n if (typeCompte.equals(\"Bancaire\")) {\n if (decouvertNF.isEmpty())\n test = false;\n } else if (typeCompte.equals(\"Epargne\")) {\n if (tauxInteretNF.isEmpty())\n test = false;\n }\n if (s_datePK.getValue() == null) {\n s_datePK.setStyle(\"-fx-border-color:red;-fx-border-radius:3px;-fx-border-size: 1px;\");\n test = false;\n }\n\n return test;\n }", "private static boolean validatePhoneNumber(String phoneNo) {\n if (phoneNo.matches(\"\\\\d{10}\")) return true;\n //validating phone number with -, . or spaces\n else if(phoneNo.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) return true;\n //validating phone number with extension length from 3 to 5\n else if(phoneNo.matches(\"\\\\d{3}-\\\\d{3}-\\\\d{4}\\\\s(x|(ext))\\\\d{3,5}\")) return true;\n //validating phone number where area code is in braces ()\n else if(phoneNo.matches(\"\\\\(\\\\d{3}\\\\)-\\\\d{3}-\\\\d{4}\")) return true;\n //return false if nothing matches the input\n else return false;\n\n }", "public boolean validate() {\n String sDayCheck = sDayView.getText().toString();\n String eDayCheck = eDayView.getText().toString();\n String sTimeCheck = sTimeView.getText().toString();\n String eTimeCheck = eTimeView.getText().toString();\n\n if ((titleView.getText().toString().matches(\"\")) || (roomView.getText().toString().matches(\"\"))) {\n Toast.makeText(getApplicationContext(),\"Please fill in all fields.\",Toast.LENGTH_SHORT).show();\n return false;\n }\n\n if ((sDayCheck.length() != 10) ||\n (eDayCheck.length() != 10) ||\n (sTimeCheck.length() != 5) ||\n (eTimeCheck.length() != 5)) {\n Toast.makeText(getApplicationContext(),\"Please check your Date and Time fields.\",Toast.LENGTH_SHORT).show();\n return false;\n } else if ((sDayCheck.charAt(2) != '/') || (sDayCheck.charAt(5) != '/') ||\n (eDayCheck.charAt(2) != '/') || (eDayCheck.charAt(5) != '/')) {\n Toast.makeText(getApplicationContext(), \"Please check your Date fields.\", Toast.LENGTH_SHORT).show();\n return false;\n } else if ((sTimeCheck.charAt(2) != ':') || (eTimeCheck.charAt(2) != ':')) {\n Toast.makeText(getApplicationContext(), \"Please check your Time fields.\", Toast.LENGTH_SHORT).show();\n return false;\n }\n if (!endDateAfter(sDayCheck, eDayCheck)) {\n Toast.makeText(getApplicationContext(), \"End date must be on or after the Start date.\", Toast.LENGTH_SHORT).show();\n return false;\n }\n if (!endTimeAfter(sTimeCheck, eTimeCheck)) {\n Toast.makeText(getApplicationContext(), \"End time must be on or after the Start time.\", Toast.LENGTH_SHORT).show();\n return false;\n }\n if (isOutOfDate(eDayCheck)) {\n Toast.makeText(getApplicationContext(), \"End date must be on or after Today's Date.\", Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "public PaymentRequestPage paymentRequestPaymentAvailabilityValidation(String cashbackType,String cashbackValue,String rewardsValue) {\r\n\r\n\t\tString actual = \"\";\r\n\r\n\t\treportStep(\"About to validate the Cashback and Rewards Payment avilablity section in the payment Request page \", \"INFO\");\r\n\r\n\t\tswitch (cashbackType) {\r\n\r\n\t\tcase \"Only_Cashback\":\r\n\r\n\t\t\tvalidateTheElementPresence(cashbackAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, cashbackValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"Only_Rewards\":\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, rewardsValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase \"BothCashback_Rewards\":\r\n\r\n\t\t\tfloat cashbackAmount = Float.parseFloat(cashbackValue);\r\n\t\t\tfloat rewardsAmount = Float.parseFloat(rewardsValue);\r\n\t\t\tfloat totalAmount = cashbackAmount + rewardsAmount ;\r\n\r\n\t\t\tString strTotalAmount = Float.toString(totalAmount) + \"0\";\r\n\t\t\tString strOnlyCashbackAmount = Float.toString(cashbackAmount) + \"0\";\r\n\t\t\tString strOnlyRewardsAmount = Float.toString(rewardsAmount) + \"0\";\r\n\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\t\t\tvalidateTheElementPresence(cashbackText);\r\n\t\t\tvalidateTheElementPresence(rewardsText);\r\n\r\n\t\t\t//validate total cashback amount\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strTotalAmount);\r\n\r\n\t\t\t//validate only cashback amount\r\n\t\t\tactual = getText(cashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyCashbackAmount);\r\n\r\n\r\n\t\t\t//validate only rewards amount\r\n\t\t\tactual = getText(rewardsAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyRewardsAmount);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\r\n\t}", "public void checkInputCompany(TextField phoneNo, TextField zip, TextField name, KeyEvent event) {\n if (event.getSource() == phoneNo) {\n redFieldNumber(phoneNo, event);\n } else if (event.getSource() == zip) {\n redFieldCPRNoAndZip(zip, event);\n } else if (event.getSource() == name) {\n checkIfRedName(name, event);\n }\n }", "public PaymentRequestPage validateNEFTFieldErrorMessages() {\r\n\r\n\t\treportStep(\"About to validate the NEFT field error validation - \", \"INFO\");\r\n\r\n\t\tvalidateTheElementPresence(nameOfBankAccountHolderName);\r\n\t\tvalidateTheElementPresence(pleaseEnterValidACHolderName);\r\n\t\tvalidateTheElementPresence(bank_Name);\r\n\t\tvalidateTheElementPresence(pleaseEnterValidBankName);\r\n\t\tvalidateTheElementPresence(bank_BranchName);\r\n\r\n\t\tscrollFromDownToUpinApp();\r\n\r\n\t\tvalidateTheElementPresence(pleaseEnterBranchNameOr4DigitBranchCode);\r\n\t\tvalidateTheElementPresence(bank_AccountNumber);\r\n\t\tscrollFromDownToUpinApp();\t\t\r\n\t\tvalidateTheElementPresence(pleaseEnterTheBankAccountNum);\r\n\t\tscrollFromDownToUpinApp();\t\t\r\n\t\tvalidateTheElementPresence(ifscCodeForBank);\r\n\t\tvalidateTheElementPresence(pleaseEnterTheIFSC);\r\n\r\n\t\treturn this;\r\n\r\n\t}", "private void validate() throws FlightCreationException {\n validateNotNull(\"number\", number);\n validateNotNull(\"company name\", companyName);\n validateNotNull(\"aircraft\", aircraft);\n validateNotNull(\"pilot\", pilot);\n validateNotNull(\"origin\", origin);\n validateNotNull(\"destination\", destination);\n validateNotNull(\"departure time\", scheduledDepartureTime);\n\n if (scheduledDepartureTime.isPast()) {\n throw new FlightCreationException(\"The departure time cannot be in the past\");\n }\n\n if (origin.equals(destination)) {\n throw new FlightCreationException(\"The origin and destination cannot be the same\");\n }\n }", "private boolean isValid(){\n if(txtFirstname.getText().trim().isEmpty() || txtLastname.getText().trim().isEmpty() ||\n txtEmailAddress.getText().trim().isEmpty() || dobPicker.getValue()==null\n || txtPNum.getText().trim().isEmpty()\n || txtDefUsername.getText().trim().isEmpty()\n || curPassword.getText().trim().isEmpty()){\n \n return false; // return false if one/more fields are not filled\n }else{\n if(!newPassword.getText().trim().isEmpty()){\n if(!confirmPassword.getText().trim().isEmpty()){\n return true;\n }else{\n return false;\n }\n }\n return true; // return true if all fields are filled\n }\n }", "@Override\n public void validate(ValidationContext vc) {\n Map<String,Property> beanProps = vc.getProperties(vc.getProperty().getBase());\n \n validateKode(vc, (String)beanProps.get(\"idKurikulum\").getValue(), (Boolean)vc.getValidatorArg(\"tambahBaru\")); \n validateDeskripsi(vc, (String)beanProps.get(\"deskripsi\").getValue()); \n }", "private void setupRequiredValidation() {\n requiredMafExpressions.put(FIELD_HUGO_SYMBOL, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_HUGO_SYMBOL, \"may not be blank\");\r\n requiredMafExpressions.put(FIELD_ENTREZ_GENE_ID, Pattern.compile(\"\\\\d+\")); // number\r\n requiredFieldDescriptions.put(FIELD_ENTREZ_GENE_ID, \"must be an integer number\");\r\n requiredMafExpressions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_TUMOR_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_TUMOR_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_VALIDATION_STATUS, Pattern.compile(\"Valid|Wildtype|Unknown|\\\\S?\"));\r\n requiredFieldDescriptions.put(FIELD_VALIDATION_STATUS, \"must be Valid, Wildtype, Unknown, or blank\");\r\n requiredMafExpressions.put(FIELD_CHROMOSOME, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_CHROMOSOME, \"must be one of: X, Y, M, 1-22, or full name of unassigned fragment\");\r\n setupMafSpecificChecks();\r\n }", "private boolean validatePhone(String phone) {\n if (phone.matches(\"\\\\d{10}\")) {\n return true;\n } //validating phone number with -, . or spaces\n else if (phone.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) {\n return true;\n } //validating phone number where area code is in braces ()\n else if (phone.matches(\"\\\\(\\\\d{3}\\\\)-\\\\d{3}-\\\\d{4}\")) {\n return true;\n } //return false if nothing matches the input\n else {\n return false;\n }\n }", "public static void main(String[] args){\n\tValidateUser first =(String Fname) -> {\n\t\tif(Pattern.matches(\"[A-Z]{1}[a-z]{2,}\",Fname))\n\t\t\tSystem.out.println(\"First Name Validate\");\n\t\t\telse \n\t\t\tSystem.out.println(\"Invalid Name, Try again\");\n\t}; \n\t//Lambda expression for Validate User Last Name\n\tValidateUser last =(String Lname) -> {\n\t\tif(Pattern.matches(\"[A-Z]{1}[a-z]{2,}\",Lname))\n\t\t\tSystem.out.println(\"Last Name Validate\");\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Invalid Last Name, Try again\");\n\t};\n\t//Lambda expression for Validate User Email\n\tValidateUser Email =(String email) -> {\n\t\tif(Pattern.matches(\"^[\\\\w-\\\\+]+(\\\\.[\\\\w]+)*@[\\\\w-]+(\\\\.[\\\\w]+)*(\\\\.[a-z]{2,})$\",email))\n\t\t\tSystem.out.println(\"email Validate\");\n\t\telse\n\t\t\tSystem.out.println(\"Invalid Email, Try again\");\n\t};\n\t//Lambda expression for Validate User Phone Number\n\tValidateUser Num =(String Number) -> {\n\t\tif(Pattern.matches(\"^[0-9]{2}[\\\\s][0-9]{10}\",Number))\n\t\t\tSystem.out.println(\"Phone Number Validate\");\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Invalid Number, Try Again\");\n\t};\n\t//Lambda expression for Validate User Password\n\tValidateUser Password =(String pass) -> {\n\t\tif(Pattern.matches(\"(?=.*[$#@!%^&*])(?=.*[0-9])(?=.*[A-Z]).{8,20}$\",pass))\n\t\t\tSystem.out.println(\"Password Validate\");\n\t\t\telse\n\t\t\tSystem.out.println(\"Invalid Password Try Again\");\n\t};\n\t\n\tfirst.CheckUser(\"Raghav\");\n\tlast.CheckUser(\"Shettay\");\n\tEmail.CheckUser(\"[email protected]\");\n\tNum.CheckUser(\"91 8998564522\");\n\tPassword.CheckUser(\"Abcd@321\");\n\t\n\t\n\t\n\t//Checking all Email's Sample Separately\n\tArrayList<String> emails = new ArrayList<String>();\n\t//Valid Email's\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\t\n\t//Invalid Email's\n\temails.add(\"[email protected]\");\n\temails.add(\"abc123@%*.com\");\n\t\n\tString regex=\"^[\\\\w-\\\\+]+(\\\\.[\\\\w]+)*@[\\\\w-]+(\\\\.[\\\\w]+)*(\\\\.[a-z]{2,})$\";\n\t\n\tPattern pattern = Pattern.compile(regex);\n\t\n\tfor(String mail : emails) {\n\t\tMatcher matcher = pattern.matcher(mail);\n\t System.out.println(mail +\" : \"+ matcher.matches());\n\t}\n \n}" ]
[ "0.70979804", "0.6769843", "0.6723519", "0.66703993", "0.6574861", "0.65062296", "0.64814913", "0.6401523", "0.6366657", "0.6365757", "0.6243885", "0.6231306", "0.617249", "0.6152366", "0.61344033", "0.611224", "0.60867906", "0.6069157", "0.60620785", "0.60586077", "0.6057202", "0.6022002", "0.6013558", "0.60095614", "0.6002831", "0.59766924", "0.59561974", "0.594878", "0.5917296", "0.59162486", "0.5913066", "0.590692", "0.5902199", "0.5898288", "0.58971965", "0.5890493", "0.5873421", "0.5864893", "0.5842328", "0.58288854", "0.5827194", "0.58225596", "0.58166206", "0.58045405", "0.57968193", "0.5780973", "0.57800645", "0.5779901", "0.57690996", "0.5764344", "0.5760754", "0.57588094", "0.57494646", "0.5748043", "0.5744232", "0.57403195", "0.57330644", "0.57330644", "0.57276523", "0.572347", "0.5720863", "0.5696866", "0.5686374", "0.568279", "0.5675433", "0.5673328", "0.567252", "0.5671407", "0.566629", "0.566419", "0.5639927", "0.5635181", "0.56250536", "0.5621302", "0.56191945", "0.5618585", "0.5613283", "0.56077284", "0.5602857", "0.5602857", "0.5592471", "0.55894804", "0.5585231", "0.55835587", "0.5582466", "0.5579648", "0.5576607", "0.5570779", "0.5570366", "0.55702996", "0.5567114", "0.5540834", "0.5540761", "0.55292505", "0.55292207", "0.5525813", "0.5524894", "0.552337", "0.5518138", "0.5517415" ]
0.70770067
1
Validation Functions Description : To validate the Telephone Work in Contact Details of Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:05 Oct 2016 Modified By:Raja Parameter:TelephoneWork
public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll("M_Header", "Contact Details").replaceAll("M_Category", "Telephone - Work").replaceAll("M_InnerText", TelephoneWork), "Telephone - Work - "+TelephoneWork, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "void telephoneValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"+391111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"1111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"111 1111111\");\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data\n person.setTelephone(\"AAA\");\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "public void validate_the_Telephone_Home_in_Contact_Details_of_Customer_Tab(String TelephoneHome)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneHome.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Home\").replaceAll(\"M_InnerText\", TelephoneHome), \"Telephone - Home - \"+TelephoneHome, false);\n\t}", "public void validate_the_Telephone_Mobile_in_Contact_Details_of_Customer_Tab(String TelephoneMobile)throws Exception {\n\t\tReport.fnReportPageBreak(\"Telephone Details\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneMobile.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Mobile\").replaceAll(\"M_InnerText\", TelephoneMobile), \"Telephone - Mobile - \"+TelephoneMobile, false);\n\t}", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private boolean validate(){\n\n String MobilePattern = \"[0-9]{10}\";\n String name = String.valueOf(userName.getText());\n String number = String.valueOf(userNumber.getText());\n\n\n if(name.length() > 25){\n Toast.makeText(getApplicationContext(), \"pls enter less the 25 characher in user name\",\n Toast.LENGTH_SHORT).show();\n return true;\n }\n\n\n\n else if(name.length() == 0 || number.length() == 0 ){\n Toast.makeText(getApplicationContext(), \"pls fill the empty fields\",\n Toast.LENGTH_SHORT).show();\n return false;\n }\n\n\n\n else if(number.matches(MobilePattern))\n {\n\n return true;\n }\n else if(!number.matches(MobilePattern))\n {\n Toast.makeText(getApplicationContext(), \"Please enter valid 10\" +\n \"digit phone number\", Toast.LENGTH_SHORT).show();\n\n\n return false;\n }\n\n return false;\n\n }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "abstract void telephoneValidity();", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private void validateData() {\n }", "public void checkvalidate()\n\t{\n\t\tif((fn.getText().toString()).equals(\"\"))\n \t{\n \t\t//text1.setText(\"Name not entered!!\");\n\t\t\tToast.makeText(AddContact.this, \"Name Not Entered\",Toast.LENGTH_SHORT).show();\n \t}\n \telse if((mobno.getText().toString()).equals(\"\"))\n \t{\n \t\t//text1.setText(\"Phone not entered!!\");\n \t\tToast.makeText(AddContact.this, \"Phone No. not Entered\",Toast.LENGTH_SHORT).show();\n \t}\t\n \telse\n \t{\n \t\tname=fn.getText().toString();\n\t\t\tstrln=ln.getText().toString();\n\t\t\t//mname=mn.getText().toString();\n\t\t\tstrmno=mobno.getText().toString();\n\t\t\tstreid=eid.getText().toString();\n\t\t\tstrtag_type=stag.getSelectedItem().toString();\n\t\t\tstrtag=tag.getText().toString();\n\t\t\tmshome=mhome.getText().toString();\n\t\t\tmswork=mwork.getText().toString();\n\t\t\tmsother=moth.getText().toString();\n\t\t\teswork=ework.getText().toString();\n\t\t\tesother=eoth.getText().toString();\n\t\t\tnotes=enotes.getText().toString();\n\t\t\tdata.Insert(name,mname,strln,strmno,mshome,mswork,msother,mscust, streid,eswork,esother,mscust,imagePath,strtag_type,strtag,0,date,time,notes,0);\n\t\t\tToast.makeText(AddContact.this, \"Added Successfully\",Toast.LENGTH_SHORT).show();\n\t\t\tCursor c=data.getData();\n\t\t\twhile(c.moveToNext())\n\t\t\t{\n\t\t\t\tString name1=c.getString(0);\n\t\t\t\tSystem.out.println(\"Name:\"+name1);\n\t\t\t\t\n\t\t\t}\n\t\t\tc.close();\n\t\t\tviewcontacts();\n \t}\n\t\t\n\t}", "private boolean validate() {\n if(edtMobileNumber.getText().toString().length() <= 0){\n edtMobileNumber.setFocusable(true);\n edtMobileNumber.setError(Constants.ERR_MSG_MOBILE);\n return false;\n }else if(edtFirstName.getText().toString().length() <= 0){\n edtFirstName.setFocusable(true);\n edtFirstName.setError(Constants.ERR_MSG_FIRST_NAME);\n return false;\n }else if(edtLastName.getText().toString().length() <= 0){\n edtLastName.setFocusable(true);\n edtLastName.setError(Constants.ERR_MSG_LAST_NAME);\n return false;\n }else if(edtDateOfBirth.getText().toString().length() <= 0){\n edtDateOfBirth.setFocusable(true);\n edtDateOfBirth.setError(Constants.ERR_MSG_DATE_OF_BIRTH);\n return false;\n }else if(edtEnterPin.getText().toString().length() <= 0){\n edtEnterPin.setFocusable(true);\n edtEnterPin.setError(Constants.ERR_MSG_PIN);\n return false;\n }else if(edtConfirmPin.getText().toString().length() <= 0){\n edtConfirmPin.setFocusable(true);\n edtConfirmPin.setError(Constants.ERR_MSG_CONFIRM_PIN);\n return false;\n }else if(spnStatus.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_STATUS, Toast.LENGTH_SHORT).show();\n return false;\n }else if(spnBloodGroup.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_BLOOD_GROUP, Toast.LENGTH_SHORT).show();\n return false;\n }else if(rgGender.getCheckedRadioButtonId() == -1){\n Toast.makeText(context,Constants.ERR_MSG_GENDER,Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "void validateMobileNumber(String stringToBeValidated,String name);", "private boolean validateInput(){\n Window owner=root.getScene().getWindow();\n inputFileds.addAll(txtfn,txtln,txtsurname,txtDOB,txtResidence,txtMobile,txtID,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().isEmpty()){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n inputFileds.removeAll(txtDOB,txtMobile,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().length()>30){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Sorry the text you entered can not be greater that 30 characters\",\"Text too Long\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n if(username.getText().length()>20 || username.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Username has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid input\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n if(pass.getText().isEmpty()){\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n if(pass.getText().length()>20 || pass.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Password has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n SimpleDateFormat yearFormat = new SimpleDateFormat(\"yyyy\");\n try {\n date = dateFormat.parse(txtDOB.getText());\n Calendar cal=Calendar.getInstance();\n int year=Integer.parseInt(yearFormat.format(date));\n if (year <= 1900 || year>cal.get(Calendar.YEAR)) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n String initialEntry=txtDOB.getText();\n String parsedValue=dateFormat.format(date);\n if(!initialEntry.equals(parsedValue)){\n Dialog.showMessageDialog(owner, \"Note your Date of Birth has been corrected\", \"Date Corrected\",DialogIcon.INFORMATION);\n }\n txtDOB.setText(dateFormat.format(date));\n } catch (ParseException ex) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n try {\n int mobile=Integer.parseInt(txtMobile.getText());\n } catch (NumberFormatException e) {\n Dialog.showMessageDialog(owner, \"Invalid Mobile Number\", \"Invalid data\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n if(txtMobile.getText().length() != 10){\n Dialog.showMessageDialog(owner, \"Sorry your Mobile Number is invalid\", \"Invalid input\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n String sql=\"select Username,Password from users where Username=?\";\n try(PreparedStatement prstmt=con.prepareStatement(sql)) {\n prstmt.setString(1, username.getText());\n ResultSet rs=prstmt.executeQuery();\n if(rs.next()){\n Dialog.showMessageDialog(owner, \"Sorry Username already exists\\n Please change to different Username\", \"Username Exists\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n rs.close();\n } catch (SQLException e) {\n System.err.println(e);\n }\n return true;\n }", "private void validateDetails() {\n\n clearErrors();\n Utils.hide_keyboard(getActivity());\n\n boolean valid = true;\n\n String cvv = cvvTv.getText().toString();\n String expiryDate = cardExpiryTv.getText().toString();\n String cardNo = cardNoTv.getText().toString();\n\n if (cvv.length() < 3) {\n valid = false;\n cvvTil.setError(\"Enter a valid cvv\");\n }\n\n if (expiryDate.length() != 5) {\n cardExpiryTil.setError(\"Enter a valid expiry date\");\n valid = false;\n }\n\n String cardNoStripped = cardNo.replaceAll(\"\\\\s\", \"\");\n\n if (cardNoStripped.length() < 12 ) {\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n else {\n try {\n Long parsed = Long.parseLong(cardNoStripped);\n }\n catch (Exception e) {\n e.printStackTrace();\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n }\n\n if (valid) {\n\n if (saveCardSwitch.isChecked()) {\n int cardLen = cardNoStripped.length();\n cardFirst6 = cardNoStripped.substring(0, 6);\n cardLast4 = cardNoStripped.substring(cardLen - 4, cardLen);\n shouldISaveThisCard = true;\n presenter.savePotentialCardDets(cardFirst6, cardLast4);\n }\n\n //make request\n PayloadBuilder builder = new PayloadBuilder();\n builder.setAmount(thetellerInitializer.getAmount() + \"\")\n .setNarration(thetellerInitializer.getNarration())\n .setCardno(cardNoStripped)\n .set3dUrl(thetellerInitializer.get3dUrl())\n .setEmail(thetellerInitializer.getEmail())\n .setCurrency(thetellerInitializer.getCurrency())\n .setMerchant_id(thetellerInitializer.getMerchant_id())\n .setCvv(cvv).setFirstname(thetellerInitializer.getfName())\n .setLastname(thetellerInitializer.getlName())\n .setIP(Utils.getDeviceImei(getActivity()))\n .setTxRef(thetellerInitializer.getTxRef())\n .setExpiryyear(expiryDate.substring(3,5))\n .setExpirymonth(expiryDate.substring(0,2))\n .setMeta(thetellerInitializer.getMeta())\n .setApiUser(thetellerInitializer.getApiUser())\n .setApiKey(thetellerInitializer.getApiKey())\n .setDevice_fingerprint(Utils.getDeviceImei(getActivity()))\n .setCardType(cardType);\n\n if (thetellerInitializer.getPayment_plan() != null) {\n builder.setPaymentPlan(thetellerInitializer.getPayment_plan());\n }\n\n body = builder.createPayload();\n\n presenter.chargeCard(body, thetellerConstants.API_KEY);\n }\n }", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic void validate() {\n\t\t if(pname==null||pname.toString().equals(\"\")){\n\t\t\t addActionError(\"父项节点名称必填!\");\n\t\t }\n\t\t if(cname==null||cname.toString().equals(\"\")){\n\t\t\t addActionError(\"子项节点名称必填!\");\n\t\t }\n\t\t if(caction==null||caction.toString().equals(\"\")){\n\t\t\t addActionError(\"子项节点动作必填!\");\n\t\t }\n\t\t \n\t\t List l=new ArrayList();\n\t\t\tl=userService.QueryByTabId(\"Resfun\", \"resfunid\", resfunid);\n\t\t\t//判断是否修改\n\t\t\tif(l.size()!=0){\n\t\t\t\t\n\t\t\t\tfor(int i=0;i<l.size();i++){\n\t\t\t\t\tResfun rf=new Resfun();\n\t\t\t\t\trf=(Resfun)l.get(i);\n\t\t\t\t\tif(rf.getCaction().equals(caction.trim())&&rf.getCname().equals(cname)&&rf.getPname().equals(pname)){\n\t\t\t\t\t\tSystem.out.println(\"mei gai\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tList n=new ArrayList();\n\t\t\t\t\t\tn=userService.QueryByPcac(\"Resfun\", \"pname\", pname, \"cname\", cname, \"caction\", caction);\n\t\t\t\t\t\tif(n.size()!=0){\n\t\t\t\t\t\t\taddActionError(\"该记录已经存在!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t \n\t\t \n\t\t \n\t\t \n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "protected void validateMobileNumber(){\n /*\n Checking For Mobile number\n The Accepted Types Are +00 000000000 ; +00 0000000000 ;+000 0000000000; 0 0000000000 ; 00 0000000000\n */\n Boolean mobileNumber = Pattern.matches(\"^[0]?([+][0-9]{2,3})?[-][6-9]+[0-9]{9}\",getMobileNumber());\n System.out.println(mobileNumberResult(mobileNumber));\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public boolean Validate() \r\n {\n return phoneNumber.matcher(getText()).matches();\r\n }", "public boolean isValid(){\n Email.setErrorEnabled(false);\n Email.setError(\"\");\n Fname.setErrorEnabled(false);\n Fname.setError(\"\");\n Lname.setErrorEnabled(false);\n Lname.setError(\"\");\n Pass.setErrorEnabled(false);\n Pass.setError(\"\");\n Mobileno.setErrorEnabled(false);\n Mobileno.setError(\"\");\n Cpass.setErrorEnabled(false);\n Cpass.setError(\"\");\n area.setErrorEnabled(false);\n area.setError(\"\");\n Houseno.setErrorEnabled(false);\n Houseno.setError(\"\");\n Pincode.setErrorEnabled(false);\n Pincode.setError(\"\");\n\n boolean isValid=false,isValidname=false,isValidhouseno=false,isValidlname=false,isValidemail=false,isValidpassword=false,isValidconfpassword=false,isValidmobilenum=false,isValidarea=false,isValidpincode=false;\n if(TextUtils.isEmpty(fname)){\n Fname.setErrorEnabled(true);\n Fname.setError(\"Enter First Name\");\n }else{\n isValidname=true;\n }\n if(TextUtils.isEmpty(lname)){\n Lname.setErrorEnabled(true);\n Lname.setError(\"Enter Last Name\");\n }else{\n isValidlname=true;\n }\n if(TextUtils.isEmpty(emailid)){\n Email.setErrorEnabled(true);\n Email.setError(\"Email Address is required\");\n }else {\n if (emailid.matches(emailpattern)) {\n isValidemail = true;\n } else {\n Email.setErrorEnabled(true);\n Email.setError(\"Enter a Valid Email Address\");\n }\n }\n if(TextUtils.isEmpty(password)){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Enter Password\");\n }else {\n if (password.length()<8){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Weak Password\");\n }else {\n isValidpassword = true;\n }\n }\n if(TextUtils.isEmpty(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Enter Password Again\");\n }else{\n if (!password.equals(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Password Dosent Match\");\n }else{\n isValidconfpassword=true;\n }\n }\n if(TextUtils.isEmpty(mobile)){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Enter Phone Number\");\n }else{\n if (mobile.length()<10){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Invalid Mobile Number\");\n } else {\n isValidmobilenum = true;\n }\n }\n if(TextUtils.isEmpty(Area)){\n area.setErrorEnabled(true);\n area.setError(\"Area is Required\");\n }else{\n isValidarea=true;\n }\n if(TextUtils.isEmpty(pincode)){\n Pincode.setErrorEnabled(true);\n Pincode.setError(\"Please Enter Pincode\");\n }else{\n isValidpincode=true;\n }\n if(TextUtils.isEmpty(house)){\n Houseno.setErrorEnabled(true);\n Houseno.setError(\"House field cant be empty\");\n }else{\n isValidhouseno=true;\n }\n isValid=(isValidarea && isValidpincode && isValidconfpassword && isValidpassword && isValidemail && isValidname &&isValidmobilenum && isValidhouseno && isValidlname)? true:false;\n return isValid;\n\n }", "private boolean tableDataValid()\r\n {\r\n // if there are any form level validations that should go there\r\n int rowTotal = tblProtoCorresp.getRowCount();\r\n int colTotal = tblProtoCorresp.getColumnCount();\r\n for (int rowIndex = 0; rowIndex < rowTotal ; rowIndex++)\r\n {\r\n for (int colIndex = 0; colIndex < colTotal; colIndex++)\r\n {\r\n TableColumn column = codeTableColumnModel.getColumn(colIndex) ;\r\n\r\n ColumnBean columnBean = (ColumnBean)column.getIdentifier() ;\r\n\r\n if (columnBean.getColumnEditable()\r\n && !columnBean.getColumnCanBeNull())\r\n {\r\n if ( tblProtoCorresp.getValueAt(rowIndex,colIndex) != null)\r\n {\r\n if (tblProtoCorresp.getValueAt(rowIndex,colIndex).equals(\"\")\r\n || tblProtoCorresp.getValueAt(rowIndex,colIndex).toString().trim().equals(\"\") )\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n else\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n }\r\n return true ;\r\n }", "public void validateWaveDetails(String strWaveStatus, String strWaveRunDate, String strOrderLines, String strUnitsRequired, String strUnitsAllocated, String strUnitsShorted, String strTasks, String stroLPNs){\n\t\ttry{\n\t\t\tString actualWaveNumber=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:wave']\", \"XPATH\").getText();\n\t\t\tString actualWaveStatus=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:status']\", \"XPATH\").getText();\n\t\t\tString actualWaveRunDate=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:waveRunDate']\", \"XPATH\").getText();\n\t\t\tString actualOrderLines=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:OrderLinesSelected']\", \"XPATH\").getText();\n\t\t\tString actualUnitsRequired=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:UnitsRequired']\", \"XPATH\").getText();\n\t\t\tString actualUnitsAllocated=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:UnitsAllocated']\", \"XPATH\").getText();\n\t\t\tString actualUnitsShorted=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:UnitsShorted']\", \"XPATH\").getText();\n\t\t\tString actualTasks=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:Tasks']\", \"XPATH\").getText();\n\t\t\tString actualoLPNs=libManhattanCommonFunctions.getElementByProperty(\".//*[@id='dataForm:OLPNsSelected']\", \"XPATH\").getText();\n\t\t\tif(actualWaveStatus.trim().equals(strWaveStatus) && actualWaveRunDate.trim().equals(strWaveRunDate) && actualOrderLines.trim().equals(strOrderLines) && actualUnitsRequired.trim().equals(strUnitsRequired) && actualUnitsAllocated.trim().equals(strUnitsAllocated) && actualUnitsShorted.trim().equals(strUnitsShorted) && actualTasks.trim().equals(strTasks) && actualoLPNs.trim().equals(stroLPNs))\n\t\t\t{\n\t\t\t\treport.updateTestLog(\"Wave Details verification\", \"Wave Details verified successfully\", Status.PASS);\n\t\t\t}else\n\t\t\t{\n\t\t\t\treport.updateTestLog(\"Wave Details verification\", \"Wave Details verification failed \", Status.FAIL);\n\t\t\t}\n\t\t}catch(Exception e){\n\t\t\treport.updateTestLog(\"Element\", \"Element Not Found\", Status.FAIL);\n\n\n\t\t} \n\t}", "@Test\r\n\tpublic void view3_COEs_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\t\t//Table 3 - Data .\r\n\t\tList<WebElement> data_of_table3 = driver.findElements(view3_COEs_table_data_val);\r\n\t\t//Table 3 - Columns\r\n\t\tList<WebElement> col_of_table3 = driver.findElements(By.xpath(view3_curr_agent_stats_col));\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> updated_col_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t\r\n\t\t//Adding Column data from another table.\r\n\t\tdata_of_table3 = helper.modify_cols_data_of_table(col_of_table1, data_of_table3, updated_col_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table3, data_of_table3 );\r\n\t}", "private boolean validateData() {\n if (!mCommon.validateData()) return false;\n\n Core core = new Core(this);\n\n // Due Date is required\n if (TextUtils.isEmpty(getRecurringTransaction().getDueDateString())) {\n core.alert(R.string.due_date_required);\n return false;\n }\n\n if (TextUtils.isEmpty(mCommon.viewHolder.dateTextView.getText().toString())) {\n core.alert(R.string.error_next_occurrence_not_populate);\n\n return false;\n }\n\n // Payments Left must have a value\n if (getRecurringTransaction().getPaymentsLeft() == null) {\n core.alert(R.string.payments_left_required);\n return false;\n }\n return true;\n }", "public Boolean validateTransCode(String noteCode, Long staffId, String transType) throws Exception;", "@Test\r\n\tpublic void view3_current_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Columns\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t//Removing Column data from another table.\r\n\t\tdata_of_table1 = helper.modify_cols_data_of_table(col_of_table1, data_of_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table1, data_of_table1 );\r\n\t}", "private void validation() {\n Pattern pattern = validationfilterStringData();\n if (pattern.matcher(txtDrug.getText().trim()).matches() && pattern.matcher(txtGenericName.getText().trim()).matches()) {\n try {\n TblTreatmentadvise treatmentadvise = new TblTreatmentadvise();\n treatmentadvise.setDrugname(txtDrug.getText());\n treatmentadvise.setGenericname(txtGenericName.getText());\n treatmentadvise.setTiming(cmbDosestiming.getSelectedItem().toString());\n cmbtiming.setSelectedItem(cmbDosestiming);\n treatmentadvise.setDoses(loadcomboDoses());\n treatmentadvise.setDuration(loadcomboDuration());\n PatientService.saveEntity(treatmentadvise);\n JOptionPane.showMessageDialog(this, \"SAVE SUCCESSFULLY\");\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(this, \"STARTUP THE DATABASE CONNECTION\");\n }\n } else {\n JOptionPane.showMessageDialog(this, \"WRONG DATA ENTERED.\");\n }\n }", "public void validate(DataRecord value) {\n\r\n\t}", "public void validateMailAlerts() {\n System.out.println(\"Validating Mail Alerts\");\n boolean mailPasstoCheck = false, mailPassccCheck = false, mailFailtoCheck = false, mailFailccCheck = false;\n\n if (!mailpassto.getText().isEmpty()) {\n\n String[] emailAdd = mailpassto.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailPasstoCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". To Email address for passed test cases should not be empty.\\n\");\n\n }\n if (!mailpasscc.getText().isEmpty()) {\n String[] emailAdd = mailpasscc.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailPassccCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". CC Email address for passed test cases should not be empty.\\n\");\n\n }\n if (!mailfailto.getText().isEmpty()) {\n String[] emailAdd = mailfailto.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailFailtoCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". To Email address for failed test cases should not be empty.\\n\");\n\n }\n if (!mailfailcc.getText().isEmpty()) {\n String[] emailAdd = mailfailcc.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailFailccCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n } else {\n execptionData.append((++exceptionCount) + \".CC Email address for failed test cases should not be empty.\\n\");\n\n }\n\n if (mailPasstoCheck == true && mailPassccCheck == true && mailFailccCheck == true && mailFailtoCheck == true) {\n /*try {\n Properties connectionProperties = new Properties();\n String socketFactory_class = \"javax.net.ssl.SSLSocketFactory\"; //SSL Factory Class\n String mail_smtp_auth = \"true\";\n connectionProperties.put(\"mail.smtp.port\", port);\n connectionProperties.put(\"mail.smtp.socketFactory.port\", socketProperty);\n connectionProperties.put(\"mail.smtp.host\", hostSmtp.getText());\n connectionProperties.put(\"mail.smtp.socketFactory.class\", socketFactory_class);\n connectionProperties.put(\"mail.smtp.auth\", mail_smtp_auth);\n connectionProperties.put(\"mail.smtp.socketFactory.fallback\", \"false\");\n connectionProperties.put(\"mail.smtp.starttls.enable\", \"true\");\n Mail mail = new Mail(\"\");\n mail.createSession(fromMail.getText(), password.getText(), connectionProperties);\n mail.sendEmail(fromMail.getText(), mailpassto.getText(), mailpasscc.getText(), \"Test Mail from FACT\", \"Hi, This is the Test Mail for the FACT Tool\", \"\");\n mail.sendEmail(fromMail.getText(), mailfailto.getText(), mailfailcc.getText(), \"Test Mail from FACT\", \"Hi, This is the Test Mail for the FACT Tool\", \"\");*/\n mailAlertsCheck = true;\n /* } catch (IOException ex) {\n Logger.getLogger(ConfigFile.class.getName()).log(Level.SEVERE, null, ex);\n mailAlertsCheck = false;\n new ExceptionUI(ex);\n } catch (MessagingException ex) {\n Logger.getLogger(ConfigFile.class.getName()).log(Level.SEVERE, null, ex);\n mailAlertsCheck = false;\n new ExceptionUI(ex);\n }*/\n } else {\n mailAlertsCheck = false;\n mailPasstoCheck = false;\n mailPassccCheck = false;\n mailFailtoCheck = false;\n mailFailccCheck = false;\n }\n\n }", "abstract void fiscalCodeValidity();", "public static void validation() {\n\t\tif ((!textFieldName.getText().isEmpty()) && (!textField_FirstName.getText().isEmpty())\n\t\t\t\t&& (!textField_Town.getText().isEmpty()) && (!textField_Town.getText().isEmpty())) {\n\n\t\t\tif ((isValidEmailAddress(textField_Email.getText()) == true)) {\n\t\t\t\ttextField_Email.setBackground(Color.white);\n\t\t\t\tif ((force(textField_Mtp.getText()) > 82)) {\n\t\t\t\t\ttextField_Mtp.setBackground(Color.white);\n\t\t\t\t\tactionGiveServeur();\n\n\t\t\t\t} else {\n\t\t\t\t\tshowMessageDialog(null, \"Votre mot de passe est trop faible\");\n\t\t\t\t\ttextField_Mtp.setText(\"Mot de passe trop simple : changer le \");\n\t\t\t\t\ttextField_Mtp.setBackground(Color.RED);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextField_Email.setText(\"Email invalide\");\n\t\t\t\ttextField_Email.setBackground(Color.RED);\n\t\t\t\tshowMessageDialog(null, \"Email est invalide\");\n\t\t\t}\n\t\t} else {\n\n\t\t\tshowMessageDialog(null, \"Certain champs sont vide !\");\n\t\t}\n\t}", "@Override\n public void validate() {\n boolean b = false;\n\n //retrieving the contact us form details from request object\n String firstName = objContactUsForm.getName().trim();\n String email = objContactUsForm.getEmail().trim();\n String message = objContactUsForm.getMessage().trim();\n\n //now validating each of the field\n if (firstName.isEmpty()) {\n addFieldError(\"name\", getText(\"name.required\"));\n b = true;\n }\n\n if (email.isEmpty()) {\n addFieldError(\"email\", getText(\"email.required\"));\n b = true;\n }\n if (!b) {\n Pattern p = Pattern.compile(\".+@.+\\\\.[a-z]+\");\n Matcher m = p.matcher(email);\n boolean matchFound = m.matches();\n if (!matchFound) {\n addFieldError(\"email\", \"Please Provide Valid Email ID\");\n }\n }\n\n if (message.isEmpty()) {\n addFieldError(\"message\", getText(\"message.required\"));\n b = true;\n }\n\n if (!b) {\n boolean matches = message.matches(\"[<>!~@$%^&\\\"|!\\\\[#$]\");\n if (matches) {\n addFieldError(\"message\", \"Please Provide Valid Message Name\");\n b = true;\n }\n }\n }", "@Test\r\n\tpublic void view3_todays_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"CML Service Level\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table2 = driver.findElements(view3_todays_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table2 = driver.findElements(By.xpath(view3_today_data_table));\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table2, data_of_table2 );\r\n\t}", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "public void validateRpd11s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "private boolean validateForm() {\n Boolean validFlag = true;\n String email = emailTxt.getText().toString().trim();\n String name = nameTxt.getText().toString().trim();\n String phone = phoneTxt.getText().toString().trim();\n String password = passwordTxt.getText().toString();\n String confirPassWord = confirmPasswordTxt.getText().toString();\n\n Pattern emailP = Pattern.compile(\"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\", Pattern.CASE_INSENSITIVE);\n Matcher emailM = emailP.matcher(email);\n boolean emailB = emailM.find();\n\n if (TextUtils.isEmpty(email) || email.equals(\"\") || !emailB) {\n emailTxt.setError(\"Email bị để trống hoặc không dúng định dạng.\");\n validFlag = false;\n } else {\n emailTxt.setError(null);\n }\n\n if (TextUtils.isEmpty(password) || password.length() < 6) {\n passwordTxt.setError(\"Mật khẩu phải 6 ký tự trở lên\");\n validFlag = false;\n } else {\n passwordTxt.setError(null);\n }\n\n Pattern phoneP = Pattern.compile(\"[0-9]{8,15}$\");\n Matcher phoneM = phoneP.matcher(phone);\n boolean phoneB = phoneM.find();\n\n if (TextUtils.isEmpty(phone) || phone.length() < 8 || phone.length() > 15 || !phoneB) {\n phoneTxt.setError(\"Số điện thoại bị để trống hoặc không đúng định dạng\");\n validFlag = false;\n } else {\n phoneTxt.setError(null);\n }\n if (confirPassWord.length() < 6 || !confirPassWord.equals(password)) {\n confirmPasswordTxt.setError(\"Xác nhận mật khẩu không đúng\");\n validFlag = false;\n } else {\n confirmPasswordTxt.setError(null);\n }\n\n Pattern p = Pattern.compile(\"[0-9]\", Pattern.CASE_INSENSITIVE);\n Matcher m = p.matcher(name);\n boolean b = m.find();\n if (b) {\n nameTxt.setError(\"Tên tồn tại ký tự đặc biệt\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n if (TextUtils.isEmpty(name)) {\n nameTxt.setError(\"Không được để trống tên.\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n\n return validFlag;\n }", "public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public static void validate() {\r\n\t\tfrmMfhEmailer.validate();\r\n\t}", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "private boolean isInputValid() {\n String errorMessage = \"\";\n\n if (ServiceName.getText() == null || ServiceName.getText().length() == 0) {\n errorMessage += \"No valid name!\\n\";\n }\n if (Serviceemail.getText() == null || Serviceemail.getText().length() == 0) {\n Pattern p = Pattern.compile(\"[_A-Za-z0-9][A-Za-z0-9._]*?@[_A-Za-z0-9]+([.][_A-Za-z]+)+\");\n Matcher m = p.matcher(Serviceemail.getText());\n if (m.find() && m.group().equals(Serviceemail.getText())) {\n errorMessage += \"No valid Mail Forment!\\n\";\n }\n }\n if (servicedescrip.getText() == null || servicedescrip.getText().length() == 0) {\n errorMessage += \"No valid description !\\n\";\n }\n if (f == null && s.getImage() == null) {\n errorMessage += \"No valid photo ( please upload a photo !)\\n\";\n }\n if (Serviceprice.getText() == null || Serviceprice.getText().length() == 0) {\n errorMessage += \"No valid prix !\\n\";\n } else {\n // try to parse the postal code into an int.\n try {\n Float.parseFloat(Serviceprice.getText());\n } catch (NumberFormatException e) {\n errorMessage += \"No valid prix (must be a Float)!\\n\";\n }\n }\n if ( !Weekly.isSelected() && !Daily.isSelected() && !Monthly.isSelected()) {\n errorMessage += \"No valid Etat ( select an item !)\\n\";\n }\n if (Servicesatet.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid etat ( select an item !)\\n\";\n }\n if (ServiceCity.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid City ( select an item !)\\n\";\n }\n if (servicetype.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid Type ( select an item !)\\n\";\n }\n if (errorMessage.length() == 0) {\n return true;\n } else {\n // Show the error message.\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Invalid Fields\");\n alert.setHeaderText(\"Please correct invalid fields\");\n alert.setContentText(errorMessage);\n alert.showAndWait();\n return false;\n }\n }", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "private int completionCheck() {\n if (nameTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(1);\n return -1;\n }\n if (addressTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(2);\n return -1;\n }\n if (postCodeTB.getText().trim().isEmpty()){\n AlertMessage.addCustomerError(3);\n return -1;\n }\n if (countryCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(4);\n return -1;\n }\n if (stateProvinceCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(5);\n return -1;\n }\n if (phone.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(6);\n return -1;\n }\n return 1;\n }", "public void ValidationData() {\n try {\n ConnectionClass connectionClass = new ConnectionClass();\n connect = connectionClass.CONN();\n if (connect == null) {\n ConnectionResult = \"Check your Internet Connection\";\n } else {\n String query = \"Select No from machinestatustest where Line='\" + Line + \"' and Station = '\" + Station + \"'\";\n Statement stmt = connect.createStatement();\n ResultSet rs = stmt.executeQuery(query);\n if (rs.next()) {\n Validation = rs.getString(\"No\");\n }\n ConnectionResult = \"Successfull\";\n connect.close();\n }\n } catch (Exception ex) {\n ConnectionResult = ex.getMessage();\n }\n }", "public void validateRpd13s9()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "public boolean verifyData()\n {\n if(jTextFieldName.getText().equals(\"\") && jTextFieldNumber.getText().equals(\"\") \n || jTextFieldSupplier.getText().equals(\"\") || jTextArea1.getText().equals(\"\") || jTextFieldModel.getText().equals(\"\"))\n {\n JOptionPane.showMessageDialog(null, \"One or More Fields Are Empty\");\n return false;\n }\n \n else\n {\n return true;\n }\n \n }", "private void ValidateEditTextFields() {\n\tfor (int i = 0; i < etArray.length; i++) {\n\t if (etArray[i].getText().toString().trim().length() <= 0) {\n\t\tvalidCustomer = false;\n\t\tetArray[i].setError(\"Blank Field\");\n\t }\n\t}\n\n\tif (etPhoneNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etPhoneNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (etEmergencyNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etEmergencyNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (calendarDob == null) {\n\t validCustomer = false;\n\t}\n }", "public void validate() {}", "private boolean triggerValidation()\r\n {\r\n System.out.println(\"*** Validation row : \" + selRow + \" col : \" + selColumn + \" ***\") ;\r\n /*\r\n * using the colIndex u can get the column bean for that column and then depending the\r\n * datatype of the column u apply appropriate validation rules\r\n */\r\n Object newValue = ((CoeusTextField)txtCell).getText();\r\n\r\n if (!tableStructureBeanPCDR.isIdAutoGenerated()\r\n && (selColumn == tableStructureBeanPCDR.getPrimaryKeyIndex(0)))\r\n {\r\n if (checkDependency(selRow, \"\"))\r\n {\r\n if(!CheckUniqueId(newValue.toString(), selRow, selColumn))\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"chkPKeyUniqVal_exceptionCode.2401\");\r\n\r\n CoeusOptionPane.showInfoDialog(msg);\r\n //after failure of checking, make sure selecting the failed row\r\n\r\n return false; //fail in uniqueid check\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }\r\n else\r\n {\r\n return false;//fail in dependency check\r\n }\r\n\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n\r\n\r\n }", "@Test(priority=1)\n\tpublic void checkFirstNameAndLastNameFieldValiditywithNumbers(){\n\t\tsignup.clearAllFields();\n\t\tsignup.enterId(\"[email protected]\");\n\t\tsignup.enterFirstName(\"12345\");\n\t\tsignup.enterLastName(\"56386\");\n\t\tsignup.clickSubmit();\n\t\tList<String> errors = signup.getErrors();\n\t\t// given page accepts numbers into the firstname and lastname fields\n\t\tAssert.assertFalse(TestHelper.isStringPresent(errors, \"Please enter your last name.\"));\n\t\tAssert.assertFalse(TestHelper.isStringPresent(errors, \"Please enter your first name.\"));\n\t}", "private static boolean validatePhoneNumber(String phoneNo) {\n if (phoneNo.matches(\"\\\\d{10}\")) return true;\n //validating phone number with -, . or spaces\n else if(phoneNo.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) return true;\n //validating phone number with extension length from 3 to 5\n else if(phoneNo.matches(\"\\\\d{3}-\\\\d{3}-\\\\d{4}\\\\s(x|(ext))\\\\d{3,5}\")) return true;\n //validating phone number where area code is in braces ()\n else if(phoneNo.matches(\"\\\\(\\\\d{3}\\\\)-\\\\d{3}-\\\\d{4}\")) return true;\n //return false if nothing matches the input\n else return false;\n\n }", "void validateTransactionForPremiumWorksheet(Record inputRecord, Connection conn);", "public boolean validateFields(Customer customer) {\r\n if (isEmpty(customer.getFirstName(), customer.getLastName(), customer.getPhoneNum(),\r\n customer.getEmail(), customer.getDate())) {\r\n Alert alert = new Alert(Alert.AlertType.WARNING);\r\n alert.setTitle(\"Invalid info\");\r\n alert.setHeaderText(null);\r\n alert.setContentText(\"Invalid info.\\nAll fields must be filled.\");\r\n alert.showAndWait();\r\n return false;\r\n }\r\n return true;\r\n }", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "private boolean isInfoValidate(){\n if(mEmailAddress.getText() == null || mEmailAddress.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_email_address);\n return false;\n }\n\n if(!mEmailAddress.getText().toString().contains(\"@\")){\n errorText = getString(R.string.register_warning_valid_email_address);\n return false;\n }\n\n// if(mRegionSpinner.getSelectedItemPosition() == Constant.NON_SELECT){\n// errorText = getString(R.string.register_warning_select_region);\n// return false;\n// }\n\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.HONG_KONG)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.HONGKONG_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n//\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.CHINA)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.CHINA_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n\n if(mPassword.getText() == null || mPassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_password);\n return false;\n }\n\n if(mRetypePassword.getText() == null || mRetypePassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_retype_password);\n return false;\n }\n\n if(!mPassword.getText().toString().equals(mRetypePassword.getText().toString())){\n errorText = getString(R.string.register_warning_not_the_same);\n return false;\n }\n\n if(!Utility.judgeContainsStr( mPassword.getText().toString())){\n errorText = getString(R.string.register_warning_contains_character);\n return false;\n }\n\n// if(!mPolicyCheckBox.isChecked()){\n// errorText = getString(R.string.register_warning_check_agreement);\n// return false;\n// }\n\n return true;\n }", "@Test\n\t\tvoid givenEmail_CheckForValidationForMobile_RetrunTrue() {\n\t\t\tboolean result = ValidateUserDetails.validateMobile(\"98 9808229348\");\n\t\t\tAssertions.assertTrue(result);\n\t\t}", "private boolean isFormValid(AdminAddEditUserDTO dto)\r\n\t{\n\t\tSOWError error;\r\n\t\tList<IError> errors = new ArrayList<IError>();\t\t\r\n\t\t\r\n\t\t// First Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getFirstName()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_First_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_First_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\t// Last Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getLastName()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Last_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Last_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\t\r\n\t\t// User Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getUsername()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_User_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\telse\r\n\t\t{\t\r\n\t\t\t//User Name Length Check\r\n\t\t\tif((dto.getUsername().length() < 8) || (dto.getUsername().length() >30)){\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"),getTheResourceBundle().getString(\"Admin_User_Name_Length_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString jobRole = getParameter(\"jobRole\");\r\n\t\tif(\"-1\".equals(jobRole))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Job_Role\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Job_Role_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Handle Primary Email\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getEmail()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Email\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isEmailValid(dto.getEmail()) == false)\r\n\t\t\t{\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_PrimaryEmail\"),\r\n\t\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Pattern_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if(dto.getEmail().equals(dto.getEmailConfirm()) == false)\r\n\t\t\t{\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_PrimaryEmail\"),\r\n\t\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Confirm_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Check for existing username, only in Add mode\r\n\t\tString mode = (String)getSession().getAttribute(\"addEditUserMode\");\r\n\t\tif(mode != null)\r\n\t\t{\r\n\t\t\tif(mode.equals(\"add\"))\r\n\t\t\t{\r\n\t\t\t\tif(manageUsersDelegate.getAdminUser(dto.getUsername()) != null || manageUsersDelegate.getBuyerUser(dto.getUsername()) != null)\r\n\t\t\t\t{\r\n\t\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"), getTheResourceBundle().getString(\"Admin_Existing_User_Validation_Msg1\")+\" \" + dto.getUsername() +\" \" +getTheResourceBundle().getString(\"Admin_Existing_User_Validation_Msg2\"), OrderConstants.FM_ERROR);\r\n\t\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// If we have errors, put them in request.\r\n\t\tif(errors.size() > 0)\r\n\t\t{\r\n\t\t\tsetAttribute(\"errors\", errors);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tgetSession().removeAttribute(\"addEditUserMode\");\r\n\t\t\tgetSession().removeAttribute(\"originalUsername\");\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public boolean validation(){\n String Venuename= venuename.getText().toString();\n String Address= address.getText().toString();\n String Details= details.getText().toString();\n String Venueimage= venueimage.getText().toString();\n if(Venuename.isEmpty()){\n venuename.setError(\"Please enter the item name\");\n venuename.requestFocus();\n return false;\n }\n if(Address.isEmpty()){\n address.setError(\"Please enter the item name\");\n address.requestFocus();\n return false;\n }\n if(Details.isEmpty()){\n details.setError(\"Please enter the item name\");\n details.requestFocus();\n return false;\n }\n if(Venueimage.isEmpty()){\n venueimage.setError(\"Please Select the image first\");\n return false;\n }\n\n\n return true;\n }", "void validate();", "void validate();", "public void checkInputCompany(TextField phoneNo, TextField zip, TextField name, KeyEvent event) {\n if (event.getSource() == phoneNo) {\n redFieldNumber(phoneNo, event);\n } else if (event.getSource() == zip) {\n redFieldCPRNoAndZip(zip, event);\n } else if (event.getSource() == name) {\n checkIfRedName(name, event);\n }\n }", "private boolean validate(String name, String phone, String email, String description) {\n if (name.equals(null) || name.equals(\"\") || !isValidMobile(phone) || !isValidMail(email) || description.equals(null) || description.equals(\"\")) {\n\n if (name.equals(null) || name.equals(\"\")) {\n nameText.setError(\"Enter a valid Name\");\n } else {\n nameText.setError(null);\n }\n if (!isValidMobile(phone)) {\n phoneNumber.setError(\"Enter a valid Mobile Number\");\n } else {\n phoneNumber.setError(null);\n }\n if (!isValidMail(email)) {\n emailText.setError(\"Enter a valid Email ID\");\n } else {\n emailText.setError(null);\n }\n if (description.equals(null) || description.equals(\"\")) {\n descriptionText.setError(\"Add few lines about you\");\n } else {\n descriptionText.setError(null);\n }\n return false;\n } else\n return true;\n }", "private boolean validate(){\n return EditorUtils.editTextValidator(generalnformation,etGeneralnformation,\"Type in information\") &&\n EditorUtils.editTextValidator(symptoms,etSymptoms, \"Type in symptoms\") &&\n EditorUtils.editTextValidator(management,etManagement, \"Type in management\");\n }", "public Boolean validEntries() {\n String orderNumber = orderNo.getText();\n String planTime = plannedTime.getText();\n String realTime = actualTime.getText();\n String worker = workerSelected();\n String productType = productTypeSelected();\n Boolean validData = false;\n if (orderNumber.equals(\"\")) {\n warning.setText(emptyOrderNum);\n } else if (!Validation.isValidOrderNumber(orderNumber)) {\n warning.setText(invalidOrderNum);\n } else if (worker.equals(\"\")) {\n warning.setText(workerNotSelected);\n } else if (productType.equals(\"\")) {\n warning.setText(productTypeNotSelected);\n } else if (planTime.equals(\"\")) {\n warning.setText(emptyPlannedTime);\n } else if (!Validation.isValidPlannedTime(planTime)) {\n warning.setText(invalidPlannedTime);\n } else if (!actualTime.getText().isEmpty() && !Validation.isValidActualTime(realTime)) {\n warning.setText(invalidActualTime);\n } else if (comboStatus.getSelectionModel().isEmpty()) {\n warning.setText(emptyStatus);\n } else validData = true;\n return validData;\n }", "private void validt() {\n\t\t// -\n\t\tnmfkpinds.setPgmInd99(false);\n\t\tstateVariable.setZmsage(blanks(78));\n\t\tfor (int idxCntdo = 1; idxCntdo <= 1; idxCntdo++) {\n\t\t\tproductMaster.retrieve(stateVariable.getXwabcd());\n\t\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t\t// BR00005 Product not found on Product_Master\n\t\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\t\tmsgObjIdx = setMsgObj(\"OEM0003\", \"XWABCD\", msgObjIdx, messages);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// - If addition, pull the price from file:\n\t\t\tif (nmfkpinds.funKey06()) {\n\t\t\t\tstateVariable.setXwpric(stateVariable.getXwanpr());\n\t\t\t}\n\t\t\t// -\n\t\t\tstoreMaster.retrieve(stateVariable.getXwaacs());\n\t\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t\t// BR00006 Store not found on Store_Master\n\t\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\t\tmsgObjIdx = setMsgObj(\"OES0369\", \"XWAACS\", msgObjIdx, messages);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tstockBalances.retrieve(stateVariable.getXwabcd(), stateVariable.getXwaacs());\n\t\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t\t// BR00007 Store not found on Stock_Balances or CONDET.Contract_Qty >\n\t\t\t// BR Onhand_Quantity\n\t\t\tif (nmfkpinds.pgmInd99() || (stateVariable.getXwa5qt() > stateVariable.getXwbhqt())) {\n\t\t\t\tmsgObjIdx = setMsgObj(\"OES0370\", \"XWAACS\", msgObjIdx, messages);\n\t\t\t\tnmfkpinds.setPgmInd99(true);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// - Transaction Type:\n\t\t\ttransactionTypeDescription.retrieve(stateVariable.getXwricd());\n\t\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t\t// BR00008 Trn_Hst_Trn_Type not found on Transaction_type_description\n\t\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\t\tstateVariable.setXwtdsc(all(\"-\", 20));\n\t\t\t\tmsgObjIdx = setMsgObj(\"OES0371\", \"XWRICD\", msgObjIdx, messages);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// - Unit of measure:\n\t\t\t// BR00009 U_M = 'EAC'\n\t\t\tif (equal(\"EAC\", stateVariable.getXwa2cd())) {\n\t\t\t\tstateVariable.setUmdes(replaceStr(stateVariable.getUmdes(), 1, 11, um[1]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnmfkpinds.setPgmInd99(true);\n\t\t\t\tmsgObjIdx = setMsgObj(\"OES0372\", \"XWA2CD\", msgObjIdx, messages);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private void validateUpdateCustomers(List<CustomersInputDTO> customers, String formatDate) {\n // inner validate\n if (customers == null || customers.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(ConstantsCustomers.CUSTOMERS, Constants.RIQUIRED_CODE));\n }\n // validate common\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n List<Map<String, Object>> customParams = new ArrayList<>();\n customers.forEach(cus -> {\n Map<String, Object> customField = new HashMap<>();\n customField.put(\"rowId\", cus.getCustomerId());\n customField.putAll(buildParamsValidateCustomersInput(cus, jsonBuilder));\n customParams.add(customField);\n });\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n customParams, formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n List<Map<String, Object>> listValidate = CustomersCommonUtil.validateCommon(validateJson, restOperationUtils,\n token, tenantName);\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validateRpd11s9()\n {\n // This guideline cannot be automatically tested.\n }", "private void validateFields(){\n String email = edtEmail.getText().toString().trim();\n String number=edtPhone.getText().toString().trim();\n String cc=txtCountryCode.getText().toString();//edtcc.getText().toString().trim();\n String phoneNo=cc+number;\n // Check for a valid email address.\n\n\n if (TextUtils.isEmpty(email)) {\n mActivity.showSnackbar(getString(R.string.error_empty_email), Toast.LENGTH_SHORT);\n return;\n\n } else if (!Validation.isValidEmail(email)) {\n mActivity.showSnackbar(getString(R.string.error_title_invalid_email), Toast.LENGTH_SHORT);\n return;\n\n }\n\n if(TextUtils.isEmpty(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_empty_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n if(!Validation.isValidMobile(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_title_invalid_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n\n if(selectedCurrency==null){\n //mActivity.showSnackbar(getString(R.string.str_select_currency), Toast.LENGTH_SHORT);\n Snackbar.make(getView(),\"Currency data not found!\",Snackbar.LENGTH_LONG)\n .setAction(\"Try again\", new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n getAllCurrency();\n }\n }).show();\n return;\n }\n try {\n JsonObject object = new JsonObject();\n object.addProperty(KEY_EMAIL, email);\n object.addProperty(KEY_PHONE,phoneNo);\n object.addProperty(KEY_CURRENCY,selectedCurrency.getId().toString());\n updateUser(object,token);\n }catch (Exception e){\n\n }\n\n }", "public void validateRpd22s9()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean isValidPart() {\n boolean result = false;\n boolean isComplete = !partPrice.getText().equals(\"\")\n && !partName.getText().equals(\"\")\n && !inventoryCount.getText().equals(\"\")\n && !partId.getText().equals(\"\")\n && !maximumInventory.getText().equals(\"\")\n && !minimumInventory.getText().equals(\"\")\n && !variableTextField.getText().equals(\"\");\n boolean isValidPrice = isDoubleValid(partPrice);\n boolean isValidName = isCSVTextValid(partName);\n boolean isValidId = isIntegerValid(partId);\n boolean isValidMax = isIntegerValid(maximumInventory);\n boolean isValidMin = isIntegerValid(minimumInventory);\n boolean isMinLessThanMax = false;\n if (isComplete)\n isMinLessThanMax = Integer.parseInt(maximumInventory.getText()) > Integer.parseInt(minimumInventory.getText());\n\n if (!isComplete) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Missing Information\");\n errorMessage.setHeaderText(\"You didn't enter required information!\");\n errorMessage.setContentText(\"All fields are required! Your part has not been saved. Press \\\"OK\\\" and try again.\");\n errorMessage.show();\n } else if (!isMinLessThanMax) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Invalid Entry\");\n errorMessage.setHeaderText(\"Min must be less than Max!\");\n errorMessage.setContentText(\"Re-enter your data! Your part has not been saved.Press \\\"OK\\\" and try again.\");\n errorMessage.show();\n } else if (!isValidPrice) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Price is not valid\");\n errorMessage.setHeaderText(\"The value you entered for price is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered does\" +\n \" not include more than one decimal point (.), does not contain any letters, and does not \" +\n \"have more than two digits after the decimal. \");\n errorMessage.show();\n } else if (!isValidName) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Invalid Name\");\n errorMessage.setHeaderText(\"The value you entered for name is not valid.\");\n errorMessage.setContentText(\"Please ensure that the text you enter does not\" +\n \" include any quotation marks,\" +\n \"(\\\"), or commas (,).\");\n errorMessage.show();\n } else if (!isValidId) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect ID\");\n errorMessage.setHeaderText(\"The value you entered for ID is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else if (!isValidMax) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect Max Inventory\");\n errorMessage.setHeaderText(\"The value you entered for Max is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else if (!isValidMin) {\n Alert errorMessage = new Alert(Alert.AlertType.INFORMATION);\n errorMessage.setTitle(\"Incorrect Min Inventory\");\n errorMessage.setHeaderText(\"The value you entered for Min is not valid\");\n errorMessage.setContentText(\"Please ensure that the value you have entered\" +\n \" is a whole number, with no letters, symbols or decimal points. \");\n errorMessage.show();\n } else {\n result = true;\n }\n\n return result;\n }", "@Override\n\t@FXML\n\tpublic boolean validate() {\n\t\t\n\t\tboolean isDataEntered = true;\n\t\tLocalDate startDate = Database.getInstance().getStartingDate();\n\t\tSystem.out.println();\n\t\tif(amountField.getText() == null || amountField.getText().trim().isEmpty())\n\t\t\tisDataEntered = setErrorTxt(\"You left the amount field empty.\");\n\t\telse if(!(Validation.validateAmount(amountField.getText())))\n\t\t\tisDataEntered = setErrorTxt(\"Please enter a valid amount\");\n\t\telse if(creditTextField.getText() == null || creditTextField.getText().trim().isEmpty())\n\t\t\tisDataEntered = setErrorTxt(\"You left the credit text field empty.\");\n\t\telse if(!(Validation.validateChars(creditTextField.getText())))\n\t\t\tisDataEntered = setErrorTxt(\"Please only enter valid characters\");\n\t\telse if(dateField.getValue() == null) {\n\t\t\tisDataEntered = setErrorTxt(\"You left the date field empty.\");\t\t\t\n\t\t}\n\t\telse if(dateField.getValue().isBefore(startDate))\n\t\t\tisDataEntered = setErrorTxt(\"Sorry, the date you entered is before the starting date.\");\n\t\treturn isDataEntered;\n\t}", "public void validateRpd22s7()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validityChecker(TextField employeeId) {\n\t\tString empid = employeeId.getValue();\n\t\tint length = empid.length();\n\t\tif (empid.matches(\".*[A-Za-z].*\") || length < minLength || length> maxLength)\n\t\t\treturn false;\n\t\tif(!isNew){\n\t\tif (EmployeeDAO.getEmployee(empid) == null)\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public void validate(ValidationContext vc) {\n Map<String,Property> beanProps = vc.getProperties(vc.getProperty().getBase());\n \n validateKode(vc, (String)beanProps.get(\"idKurikulum\").getValue(), (Boolean)vc.getValidatorArg(\"tambahBaru\")); \n validateDeskripsi(vc, (String)beanProps.get(\"deskripsi\").getValue()); \n }", "@SuppressWarnings(\"unused\")\n\t@Test(groups = {\"All\", \"Regression\"})\n\t@AdditionalInfo(module = \"OpenEVV\")\n\tpublic void TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid() throws InterruptedException, java.text.ParseException, IOException, ParseException, ConfigurationException, SQLException\n\t{\n\n\t\t// logger = extent.startTest(\"TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid\");\n\n\t\tlogger.log(LogStatus.INFO, \"To validate valid TC95800_Xref_EmployeeQual_num_and_ClientQual_num_valid\");\n\n\t\tJSONArray jsonarray=GenerateUniqueParam.XrefParams(globalVariables.xref_json);\n\t\tJSONObject jsonobject = (JSONObject) jsonarray.get(0);\n\t\tjsonobject.put(\"EmployeeQualifier\", CommonMethods.generateRandomNumberOfFixLength(7));\n\t\tjsonobject.put(\"ClientIDQualifier\", CommonMethods.generateRandomNumberOfFixLength(7));\n\n\n\t\tString bodyAsString = CommonMethods.capturePostResponse(jsonarray, CommonMethods.propertyfileReader(globalVariables.openevv_xref_url));\n\t\tCommonMethods.verifyjsonassertFailcase(bodyAsString, globalVariables.ClientidQualifierFormatError);\n\t\tCommonMethods.verifyjsonassertFailcase(bodyAsString, globalVariables.EmployeeidQualifierFormatError);\n\n\n\t}", "public void checkInputEmployee(TextField nameTF, TextField cprNo, TextField phoneNo, KeyEvent event) {\n if (event.getSource() == nameTF) {\n checkIfRedName(nameTF, event);\n } else if (event.getSource() == phoneNo) {\n redFieldNumber(phoneNo, event);\n } else if (event.getSource() == cprNo) {\n redFieldCPRNoAndZip(cprNo, event);\n }\n }", "private boolean checkFields() {\n boolean test = true;\n if (fname.isEmpty()) {\n test = false;\n }\n if (lname.isEmpty()) {\n test = false;\n }\n if (cin.isEmpty()) {\n test = false;\n }\n if (typeCompte.equals(\"Bancaire\")) {\n if (decouvertNF.isEmpty())\n test = false;\n } else if (typeCompte.equals(\"Epargne\")) {\n if (tauxInteretNF.isEmpty())\n test = false;\n }\n if (s_datePK.getValue() == null) {\n s_datePK.setStyle(\"-fx-border-color:red;-fx-border-radius:3px;-fx-border-size: 1px;\");\n test = false;\n }\n\n return test;\n }", "@Override\n\tpublic Boolean isValidApplication(ApplicationBean applicationBean) {\n\t\tPattern namePattern=Pattern.compile(\"^[A-Za-z\\\\s]{3,}$\");\n\t\tMatcher nameMatcher=namePattern.matcher(applicationBean.getName());\n\t\tPattern dobPattern=Pattern.compile(\"^[0-3]?[0-9].[0-3]?[0-9].(?:[0-9]{2})?[0-9]{2}$\");\n\t\tMatcher dobMatcher=dobPattern.matcher(applicationBean.getDateOfBirth());\n\t\tPattern goalPattern=Pattern.compile(\"^[A-Za-z\\\\s]{1,}$\");\n\t\tMatcher goalMatcher=goalPattern.matcher(applicationBean.getGoals());\n\t\tPattern marksPattern=Pattern.compile(\"^[1-9][0-9]?$|^100$\");\n\t\tMatcher marksMatcher=marksPattern.matcher(applicationBean.getMarksObtained());\n\t\tPattern scheduleIdPattern=Pattern.compile(\"^[0-9]{1,2}$\");\n\t\tMatcher scheduleIdMatcher=scheduleIdPattern.matcher(applicationBean.getScheduledProgramID());\n\t\tPattern emailPattern=Pattern.compile(\"^[A-Za-z0-9+_.-]+@(.+)$\");\n\t\tMatcher emailMatcher=emailPattern.matcher(applicationBean.getEmailID());\n\t\t\n\t\t\n\t\tif(!(nameMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nApplicant Name Should Be In Alphabets and minimum 1 characters long.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(dobMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nDate of birth should be in DD/MM/YYYY format.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(goalMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\n Goal should be alphabetical and having minimum one letter\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(marksMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nMarks should be less than 100\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(scheduleIdMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nSchedule Id should be of one or two digit\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(emailMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nEnter valid email address\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public static Customer validateCustomer(TextField shopname, TextField shopcontact, TextField streetadd, ComboBox area, TextField city, TextField zip) {\r\n Customer customer = new Customer();\r\n customer = null;\r\n\r\n if (shopname.getText().isEmpty() || shopcontact.getText().isEmpty() || streetadd.getText().isEmpty()\r\n || city.getText().isEmpty()\r\n || zip.getText().isEmpty() || area.getValue() == null) {\r\n new PopUp(\"Name Error\", \"Field is Empty\").alert();\r\n } else if (!shopcontact.getText().matches(\"\\\\d{10}\")) {\r\n new PopUp(\"Name Error\", \"Contact must be 10 Digit\").alert();\r\n } else if (!zip.getText().matches(\"\\\\d{6}\")) {\r\n new PopUp(\"Error\", \"Zip Code must be 6 Digit\").alert();\r\n } else {\r\n customer.setShopName(shopname.getText());\r\n customer.setShopCont(Long.valueOf(shopcontact.getText()));\r\n customer.setStreetAdd(streetadd.getText());\r\n customer.setArea(area.getValue().toString());\r\n customer.setCity(city.getText());\r\n customer.setZipcode(Integer.valueOf(zip.getText()));\r\n }\r\n\r\n return customer;\r\n }", "private void checkValidation() {\n String getInstituteName = NameofInstitute.getText().toString();\n String getDegreename = SpinnerDegree.getSelectedItem().toString();\n\n\n // Check if all strings are null or not\n if (getInstituteName.equals(\"\") || getInstituteName.length() == 0 || getDegreename.equals(\"\") || getDegreename.length() == 0)\n new CustomToast().Show_Toast(getActivity(), getView(),\"All fields are required.\");\n // Else do signup or do your stuff\n else {\n //Toast.makeText(getActivity(), \"All Ok till Now\", Toast.LENGTH_SHORT).show();\n AddQualifications(getDegreename,getInstituteName);\n }\n\n }", "public void AddCustomer(View v) {\r\n try {\r\n if (edtCustName.getText().toString().equalsIgnoreCase(\"\") || edtCustPhoneNo.getText().toString().equalsIgnoreCase(\"\") || edtCustAddress.getText().toString().equalsIgnoreCase(\"\")) {\r\n MsgBox.Show(\"Warning\", \"Please fill all details before adding customer\");\r\n } else if (edtCustPhoneNo.getText().toString().length()!= 10)\r\n {\r\n MsgBox.Show(\"Warning\", \"Please fill 10 digit customer phone number\");\r\n return;\r\n } else{\r\n Cursor crsrCust = dbBillScreen.getCustomer(edtCustPhoneNo.getText().toString());\r\n if (crsrCust.moveToFirst()) {\r\n MsgBox.Show(\"Note\", \"Customer Already Exists\");\r\n } else {\r\n String gstin = etCustGSTIN.getText().toString().trim().toUpperCase();\r\n if (gstin == null) {\r\n gstin = \"\";\r\n }\r\n boolean mFlag = GSTINValidation.checkGSTINValidation(gstin);\r\n if(mFlag)\r\n {\r\n if( !GSTINValidation.checkValidStateCode(gstin,this))\r\n {\r\n MsgBox.Show(\"Invalid Information\",\"Please Enter Valid StateCode for GSTIN\");\r\n }\r\n else {\r\n InsertCustomer(edtCustAddress.getText().toString(), edtCustPhoneNo.getText().toString(),\r\n edtCustName.getText().toString(), 0, 0, 0, gstin);\r\n //ResetCustomer();\r\n //MsgBox.Show(\"\", \"Customer Added Successfully\");\r\n Toast.makeText(myContext, \"Customer Added Successfully\", Toast.LENGTH_SHORT).show();\r\n ControlsSetEnabled();\r\n checkForInterStateTax();\r\n }\r\n }else\r\n {\r\n MsgBox.Show(\"Invalid Information\",\"Please enter valid GSTIN for customer\");\r\n }\r\n\r\n }\r\n }\r\n } catch (Exception ex) {\r\n MsgBox.Show(\"Error\", ex.getMessage());\r\n }\r\n }", "public void validateRegistration(RegistrationModel register) {\n\t\tif (registerDao.checkAccountNoIfExist(register.getAccount_no(), register.getJai())) {\n\t\t\t// Checks if account if not Existing and not Verified \n\t\t\tif (!registerDao.checkCustomerLinkIfExist(register.getAccount_no())) {\n\t\t\t\t\tgenerateCustomerRecord(register);\n\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// Account already registered.\n\t\t\t\tVerificationModel verify = new VerificationModel();\n\t\t\t\tverify.setAccount_no(register.getAccount_no());\n\t\t\t\t\n\t\t\t\tTimestamp todayTimeStamp = new Timestamp(System.currentTimeMillis());\n\t\t\t\tTimestamp regTimeStamp = verifyDao.retireveReg_date(verify); \n\t\t\t\tlong diffHours = (regTimeStamp.getTime()-todayTimeStamp.getTime()) / (60 * 60 * 1000);\n\t\t\t\t\n\t\t\t\tif (diffHours>24) {\n\t\t\t\t\tgenerateCustomerRecord(register);\n\t\t\t\t} else {\n\t\t\t\t\t// Account already registered. Please verify your registration\n\t\t\t\t\tsetRegistrationError(\"R02\"); \n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Customer not allowed to access online service of OBS!\n\t\t\tsetRegistrationError(\"R01\"); \n\t\t}\n\t}", "public void SetCreditCarddetails(String ccnumber, String ccname, String ccmonth, String ccyear, String ccseccode){\r\n\t\tString countrygroup_ccdetails= \"UK,PresselAustria\";\r\n\t\tString CCnum = getValue(ccnumber);\r\n\t\tString CCName = getValue(ccname);\r\n\t\tString CCMonth = getValue(ccmonth);\r\n\t\tString CCYear = getValue(ccyear);\r\n\t\tString CCSecCode = getValue(ccseccode);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+CCnum+\", \"+CCName+\", \"+CCMonth+\", \"+CCYear+\", \"+CCSecCode);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The CreditCard details should be entered\");\r\n\t\ttry{\r\n\t\t\tif(!(countrygroup_ccdetails).contains(countries.get(countrycount))){\r\n\t\t\t\tswitchframe(\"TokenizationPage\");\r\n\t\t\t\tsleep(2000);\r\n\t\t\t\tsendKeys(locator_split(\"txtCCnumber\"), CCnum);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCname\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCname\"), CCName);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCMonth\"), CCMonth);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCYear\"), CCYear);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCcode\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCcode\"), CCSecCode);\t\t\t\t\t\t\r\n\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The CreditCard details are entered\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The new CreditCard details are applicable to this \" +country);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- The CreditCard details are not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"One of the element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCnumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCname\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCMonth\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCYear\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCcode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" are not found\");\r\n\r\n\t\t}\r\n\t}", "void validate(T regData, Errors errors);", "public static void main(String[] args){\n\tValidateUser first =(String Fname) -> {\n\t\tif(Pattern.matches(\"[A-Z]{1}[a-z]{2,}\",Fname))\n\t\t\tSystem.out.println(\"First Name Validate\");\n\t\t\telse \n\t\t\tSystem.out.println(\"Invalid Name, Try again\");\n\t}; \n\t//Lambda expression for Validate User Last Name\n\tValidateUser last =(String Lname) -> {\n\t\tif(Pattern.matches(\"[A-Z]{1}[a-z]{2,}\",Lname))\n\t\t\tSystem.out.println(\"Last Name Validate\");\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Invalid Last Name, Try again\");\n\t};\n\t//Lambda expression for Validate User Email\n\tValidateUser Email =(String email) -> {\n\t\tif(Pattern.matches(\"^[\\\\w-\\\\+]+(\\\\.[\\\\w]+)*@[\\\\w-]+(\\\\.[\\\\w]+)*(\\\\.[a-z]{2,})$\",email))\n\t\t\tSystem.out.println(\"email Validate\");\n\t\telse\n\t\t\tSystem.out.println(\"Invalid Email, Try again\");\n\t};\n\t//Lambda expression for Validate User Phone Number\n\tValidateUser Num =(String Number) -> {\n\t\tif(Pattern.matches(\"^[0-9]{2}[\\\\s][0-9]{10}\",Number))\n\t\t\tSystem.out.println(\"Phone Number Validate\");\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Invalid Number, Try Again\");\n\t};\n\t//Lambda expression for Validate User Password\n\tValidateUser Password =(String pass) -> {\n\t\tif(Pattern.matches(\"(?=.*[$#@!%^&*])(?=.*[0-9])(?=.*[A-Z]).{8,20}$\",pass))\n\t\t\tSystem.out.println(\"Password Validate\");\n\t\t\telse\n\t\t\tSystem.out.println(\"Invalid Password Try Again\");\n\t};\n\t\n\tfirst.CheckUser(\"Raghav\");\n\tlast.CheckUser(\"Shettay\");\n\tEmail.CheckUser(\"[email protected]\");\n\tNum.CheckUser(\"91 8998564522\");\n\tPassword.CheckUser(\"Abcd@321\");\n\t\n\t\n\t\n\t//Checking all Email's Sample Separately\n\tArrayList<String> emails = new ArrayList<String>();\n\t//Valid Email's\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\t\n\t//Invalid Email's\n\temails.add(\"[email protected]\");\n\temails.add(\"abc123@%*.com\");\n\t\n\tString regex=\"^[\\\\w-\\\\+]+(\\\\.[\\\\w]+)*@[\\\\w-]+(\\\\.[\\\\w]+)*(\\\\.[a-z]{2,})$\";\n\t\n\tPattern pattern = Pattern.compile(regex);\n\t\n\tfor(String mail : emails) {\n\t\tMatcher matcher = pattern.matcher(mail);\n\t System.out.println(mail +\" : \"+ matcher.matches());\n\t}\n \n}" ]
[ "0.7048949", "0.680163", "0.6644192", "0.6453485", "0.6449159", "0.6364069", "0.62718356", "0.62493354", "0.6236564", "0.62315583", "0.62223667", "0.62080294", "0.61992824", "0.6160854", "0.6149589", "0.6146503", "0.6090861", "0.60397846", "0.6024921", "0.60065293", "0.6005442", "0.5964133", "0.59470654", "0.5938898", "0.5911594", "0.59076387", "0.589903", "0.58959687", "0.585774", "0.585774", "0.5839168", "0.58284324", "0.5825401", "0.5799423", "0.57946765", "0.5773019", "0.57723475", "0.576608", "0.5755893", "0.57387066", "0.5726918", "0.57148385", "0.5710951", "0.57004064", "0.5699942", "0.5687718", "0.5684057", "0.56830955", "0.5676286", "0.5666477", "0.5650433", "0.5648359", "0.56425196", "0.5642073", "0.56381285", "0.5630939", "0.56288826", "0.5622615", "0.5617615", "0.56169856", "0.56029606", "0.56007767", "0.56005275", "0.55898935", "0.55833787", "0.55828", "0.55802786", "0.5577781", "0.55692726", "0.5558149", "0.55575085", "0.5544536", "0.5533294", "0.55194366", "0.55194366", "0.55187625", "0.5518145", "0.55155873", "0.551345", "0.55124104", "0.550767", "0.549895", "0.5496048", "0.5493979", "0.54905987", "0.54859793", "0.5476143", "0.5474651", "0.54677325", "0.54635876", "0.54609245", "0.5457722", "0.54576755", "0.5456763", "0.54566103", "0.545624", "0.5451749", "0.54507685", "0.5448255", "0.5446663" ]
0.732186
0
Validation Functions Description : To validate the Telephone Mobile in Contact Details of Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:05 Oct 2016 Modified By:Raja Parameter:TelephoneMobile
public void validate_the_Telephone_Mobile_in_Contact_Details_of_Customer_Tab(String TelephoneMobile)throws Exception { Report.fnReportPageBreak("Telephone Details", driver); VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneMobile.replaceAll("M_Header", "Contact Details").replaceAll("M_Category", "Telephone - Mobile").replaceAll("M_InnerText", TelephoneMobile), "Telephone - Mobile - "+TelephoneMobile, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void validateMobileNumber(){\n /*\n Checking For Mobile number\n The Accepted Types Are +00 000000000 ; +00 0000000000 ;+000 0000000000; 0 0000000000 ; 00 0000000000\n */\n Boolean mobileNumber = Pattern.matches(\"^[0]?([+][0-9]{2,3})?[-][6-9]+[0-9]{9}\",getMobileNumber());\n System.out.println(mobileNumberResult(mobileNumber));\n }", "void validateMobileNumber(String stringToBeValidated,String name);", "private boolean validate(){\n\n String MobilePattern = \"[0-9]{10}\";\n String name = String.valueOf(userName.getText());\n String number = String.valueOf(userNumber.getText());\n\n\n if(name.length() > 25){\n Toast.makeText(getApplicationContext(), \"pls enter less the 25 characher in user name\",\n Toast.LENGTH_SHORT).show();\n return true;\n }\n\n\n\n else if(name.length() == 0 || number.length() == 0 ){\n Toast.makeText(getApplicationContext(), \"pls fill the empty fields\",\n Toast.LENGTH_SHORT).show();\n return false;\n }\n\n\n\n else if(number.matches(MobilePattern))\n {\n\n return true;\n }\n else if(!number.matches(MobilePattern))\n {\n Toast.makeText(getApplicationContext(), \"Please enter valid 10\" +\n \"digit phone number\", Toast.LENGTH_SHORT).show();\n\n\n return false;\n }\n\n return false;\n\n }", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "@Test\n\t\tvoid givenEmail_CheckForValidationForMobile_RetrunTrue() {\n\t\t\tboolean result = ValidateUserDetails.validateMobile(\"98 9808229348\");\n\t\t\tAssertions.assertTrue(result);\n\t\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "abstract void telephoneValidity();", "public void validate_the_Telephone_Home_in_Contact_Details_of_Customer_Tab(String TelephoneHome)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneHome.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Home\").replaceAll(\"M_InnerText\", TelephoneHome), \"Telephone - Home - \"+TelephoneHome, false);\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public static boolean validateMobile(String phone){\n int k=0;\n k=phone.length();\n if(k==10){\n return true;\n }\n return false;\n }", "@Test\n\t\tvoid WithoutSpace_CheckForValidationForMobile_RetrunFalse() {\n\t\t\tboolean result = ValidateUserDetails.validateMobile(\"919874563214\");\n\t\t\tAssertions.assertFalse(result);\n\t\t}", "void telephoneValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"+391111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"1111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"111 1111111\");\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data\n person.setTelephone(\"AAA\");\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "public static boolean validate(String mobileNo) {\n//\t\tif(mobileNo.length() > 10)\n//\t\t\tmobileNo = mobileNo.substring(mobileNo.length()-10);\n\n\t\tpattern = Pattern.compile(MOBILE_PATTERN);\n\t\tmatcher = pattern.matcher(mobileNo);\n\t\treturn matcher.matches();\n \n\t}", "public boolean Validate() \r\n {\n return phoneNumber.matcher(getText()).matches();\r\n }", "@RequiresApi(api = Build.VERSION_CODES.KITKAT)\n public boolean validateDetails(String email, String mobile) {\n email = email.trim();\n mobile = mobile.trim();\n\n if (TextUtils.isEmpty(mobile)) {\n setErrorInputLayout(mobile_et, getString(R.string.err_phone_empty), mobile_til);\n return false;\n } else if (!isValidPhone(mobile)) {\n setErrorInputLayout(mobile_et, getString(R.string.err_phone_not_valid), mobile_til);\n return false;\n } else if (TextUtils.isEmpty(email)) {\n setErrorInputLayout(email_et, getString(R.string.err_email_empty), email_til);\n return false;\n } else if (!isValidEmail(email)) {\n setErrorInputLayout(email_et, getString(R.string.email_not_valid), email_til);\n return false;\n } else if (Objects.equals(name_et.getText().toString(), \"\")) {\n setErrorInputLayout(name_et, \"Name is not valid\", name_til);\n return false;\n } else {\n return true;\n }\n }", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "private void validateDetails() {\n\n clearErrors();\n Utils.hide_keyboard(getActivity());\n\n boolean valid = true;\n\n String cvv = cvvTv.getText().toString();\n String expiryDate = cardExpiryTv.getText().toString();\n String cardNo = cardNoTv.getText().toString();\n\n if (cvv.length() < 3) {\n valid = false;\n cvvTil.setError(\"Enter a valid cvv\");\n }\n\n if (expiryDate.length() != 5) {\n cardExpiryTil.setError(\"Enter a valid expiry date\");\n valid = false;\n }\n\n String cardNoStripped = cardNo.replaceAll(\"\\\\s\", \"\");\n\n if (cardNoStripped.length() < 12 ) {\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n else {\n try {\n Long parsed = Long.parseLong(cardNoStripped);\n }\n catch (Exception e) {\n e.printStackTrace();\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n }\n\n if (valid) {\n\n if (saveCardSwitch.isChecked()) {\n int cardLen = cardNoStripped.length();\n cardFirst6 = cardNoStripped.substring(0, 6);\n cardLast4 = cardNoStripped.substring(cardLen - 4, cardLen);\n shouldISaveThisCard = true;\n presenter.savePotentialCardDets(cardFirst6, cardLast4);\n }\n\n //make request\n PayloadBuilder builder = new PayloadBuilder();\n builder.setAmount(thetellerInitializer.getAmount() + \"\")\n .setNarration(thetellerInitializer.getNarration())\n .setCardno(cardNoStripped)\n .set3dUrl(thetellerInitializer.get3dUrl())\n .setEmail(thetellerInitializer.getEmail())\n .setCurrency(thetellerInitializer.getCurrency())\n .setMerchant_id(thetellerInitializer.getMerchant_id())\n .setCvv(cvv).setFirstname(thetellerInitializer.getfName())\n .setLastname(thetellerInitializer.getlName())\n .setIP(Utils.getDeviceImei(getActivity()))\n .setTxRef(thetellerInitializer.getTxRef())\n .setExpiryyear(expiryDate.substring(3,5))\n .setExpirymonth(expiryDate.substring(0,2))\n .setMeta(thetellerInitializer.getMeta())\n .setApiUser(thetellerInitializer.getApiUser())\n .setApiKey(thetellerInitializer.getApiKey())\n .setDevice_fingerprint(Utils.getDeviceImei(getActivity()))\n .setCardType(cardType);\n\n if (thetellerInitializer.getPayment_plan() != null) {\n builder.setPaymentPlan(thetellerInitializer.getPayment_plan());\n }\n\n body = builder.createPayload();\n\n presenter.chargeCard(body, thetellerConstants.API_KEY);\n }\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "private boolean validate() {\n if(edtMobileNumber.getText().toString().length() <= 0){\n edtMobileNumber.setFocusable(true);\n edtMobileNumber.setError(Constants.ERR_MSG_MOBILE);\n return false;\n }else if(edtFirstName.getText().toString().length() <= 0){\n edtFirstName.setFocusable(true);\n edtFirstName.setError(Constants.ERR_MSG_FIRST_NAME);\n return false;\n }else if(edtLastName.getText().toString().length() <= 0){\n edtLastName.setFocusable(true);\n edtLastName.setError(Constants.ERR_MSG_LAST_NAME);\n return false;\n }else if(edtDateOfBirth.getText().toString().length() <= 0){\n edtDateOfBirth.setFocusable(true);\n edtDateOfBirth.setError(Constants.ERR_MSG_DATE_OF_BIRTH);\n return false;\n }else if(edtEnterPin.getText().toString().length() <= 0){\n edtEnterPin.setFocusable(true);\n edtEnterPin.setError(Constants.ERR_MSG_PIN);\n return false;\n }else if(edtConfirmPin.getText().toString().length() <= 0){\n edtConfirmPin.setFocusable(true);\n edtConfirmPin.setError(Constants.ERR_MSG_CONFIRM_PIN);\n return false;\n }else if(spnStatus.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_STATUS, Toast.LENGTH_SHORT).show();\n return false;\n }else if(spnBloodGroup.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_BLOOD_GROUP, Toast.LENGTH_SHORT).show();\n return false;\n }else if(rgGender.getCheckedRadioButtonId() == -1){\n Toast.makeText(context,Constants.ERR_MSG_GENDER,Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public boolean mobileValidate(final String mobile) {\n\n\t\ttry {\n\t\t\tif (empMobile.equals(employeeMobile.getText().toString()))\n\t\t\t\treturn true;\n\t\t\tmatcher = mobilePattern.matcher(mobile);\n\t\t\treturn matcher.matches();\n\n\t\t} catch (NumberFormatException e) {\n\t\t\tLog.e(\"Phone length is null\", \"Please fill the phone field\");\n\t\t\tToast.makeText(this, \"Phone Field is Empty\", Toast.LENGTH_SHORT)\n\t\t\t\t\t.show();\n\t\t\treturn false;\n\t\t}\n\n\t}", "public boolean isValid(){\n Email.setErrorEnabled(false);\n Email.setError(\"\");\n Fname.setErrorEnabled(false);\n Fname.setError(\"\");\n Lname.setErrorEnabled(false);\n Lname.setError(\"\");\n Pass.setErrorEnabled(false);\n Pass.setError(\"\");\n Mobileno.setErrorEnabled(false);\n Mobileno.setError(\"\");\n Cpass.setErrorEnabled(false);\n Cpass.setError(\"\");\n area.setErrorEnabled(false);\n area.setError(\"\");\n Houseno.setErrorEnabled(false);\n Houseno.setError(\"\");\n Pincode.setErrorEnabled(false);\n Pincode.setError(\"\");\n\n boolean isValid=false,isValidname=false,isValidhouseno=false,isValidlname=false,isValidemail=false,isValidpassword=false,isValidconfpassword=false,isValidmobilenum=false,isValidarea=false,isValidpincode=false;\n if(TextUtils.isEmpty(fname)){\n Fname.setErrorEnabled(true);\n Fname.setError(\"Enter First Name\");\n }else{\n isValidname=true;\n }\n if(TextUtils.isEmpty(lname)){\n Lname.setErrorEnabled(true);\n Lname.setError(\"Enter Last Name\");\n }else{\n isValidlname=true;\n }\n if(TextUtils.isEmpty(emailid)){\n Email.setErrorEnabled(true);\n Email.setError(\"Email Address is required\");\n }else {\n if (emailid.matches(emailpattern)) {\n isValidemail = true;\n } else {\n Email.setErrorEnabled(true);\n Email.setError(\"Enter a Valid Email Address\");\n }\n }\n if(TextUtils.isEmpty(password)){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Enter Password\");\n }else {\n if (password.length()<8){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Weak Password\");\n }else {\n isValidpassword = true;\n }\n }\n if(TextUtils.isEmpty(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Enter Password Again\");\n }else{\n if (!password.equals(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Password Dosent Match\");\n }else{\n isValidconfpassword=true;\n }\n }\n if(TextUtils.isEmpty(mobile)){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Enter Phone Number\");\n }else{\n if (mobile.length()<10){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Invalid Mobile Number\");\n } else {\n isValidmobilenum = true;\n }\n }\n if(TextUtils.isEmpty(Area)){\n area.setErrorEnabled(true);\n area.setError(\"Area is Required\");\n }else{\n isValidarea=true;\n }\n if(TextUtils.isEmpty(pincode)){\n Pincode.setErrorEnabled(true);\n Pincode.setError(\"Please Enter Pincode\");\n }else{\n isValidpincode=true;\n }\n if(TextUtils.isEmpty(house)){\n Houseno.setErrorEnabled(true);\n Houseno.setError(\"House field cant be empty\");\n }else{\n isValidhouseno=true;\n }\n isValid=(isValidarea && isValidpincode && isValidconfpassword && isValidpassword && isValidemail && isValidname &&isValidmobilenum && isValidhouseno && isValidlname)? true:false;\n return isValid;\n\n }", "private boolean isValidMobile(String phone) {\n if (!Pattern.matches(\"[a-zA-Z]+\", phone)) {\n return phone.length() == 10;\n }\n return false;\n }", "private static boolean validatePhoneNumber(String phoneNo) {\n if (phoneNo.matches(\"\\\\d{10}\")) return true;\n //validating phone number with -, . or spaces\n else if(phoneNo.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) return true;\n //validating phone number with extension length from 3 to 5\n else if(phoneNo.matches(\"\\\\d{3}-\\\\d{3}-\\\\d{4}\\\\s(x|(ext))\\\\d{3,5}\")) return true;\n //validating phone number where area code is in braces ()\n else if(phoneNo.matches(\"\\\\(\\\\d{3}\\\\)-\\\\d{3}-\\\\d{4}\")) return true;\n //return false if nothing matches the input\n else return false;\n\n }", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "public final boolean checkPhoneNum() {\n EditText editText = (EditText) _$_findCachedViewById(R.id.etPhoneNum);\n Intrinsics.checkExpressionValueIsNotNull(editText, \"etPhoneNum\");\n CharSequence text = editText.getText();\n if (text == null || text.length() == 0) {\n showMsg(\"请输入手机号\");\n return false;\n }\n EditText editText2 = (EditText) _$_findCachedViewById(R.id.etPhoneNum);\n Intrinsics.checkExpressionValueIsNotNull(editText2, \"etPhoneNum\");\n if (editText2.getText().length() == 11) {\n return true;\n }\n showMsg(\"请输入正确的手机号\");\n return false;\n }", "public static boolean isValidMobileNo(String str) {\n Pattern ptrn = Pattern.compile(\"(0/91)?[7-9][0-9]{9}\"); \r\n //the matcher() method creates a matcher that will match the given input against this pattern \r\n Matcher match = ptrn.matcher(str); \r\n //returns a boolean value \r\n return (match.find() && match.group().equals(str)); \r\n }", "private boolean validatePhone(String phone) {\n if (phone.matches(\"\\\\d{10}\")) {\n return true;\n } //validating phone number with -, . or spaces\n else if (phone.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) {\n return true;\n } //validating phone number where area code is in braces ()\n else if (phone.matches(\"\\\\(\\\\d{3}\\\\)-\\\\d{3}-\\\\d{4}\")) {\n return true;\n } //return false if nothing matches the input\n else {\n return false;\n }\n }", "private boolean validateForm() {\n Boolean validFlag = true;\n String email = emailTxt.getText().toString().trim();\n String name = nameTxt.getText().toString().trim();\n String phone = phoneTxt.getText().toString().trim();\n String password = passwordTxt.getText().toString();\n String confirPassWord = confirmPasswordTxt.getText().toString();\n\n Pattern emailP = Pattern.compile(\"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\", Pattern.CASE_INSENSITIVE);\n Matcher emailM = emailP.matcher(email);\n boolean emailB = emailM.find();\n\n if (TextUtils.isEmpty(email) || email.equals(\"\") || !emailB) {\n emailTxt.setError(\"Email bị để trống hoặc không dúng định dạng.\");\n validFlag = false;\n } else {\n emailTxt.setError(null);\n }\n\n if (TextUtils.isEmpty(password) || password.length() < 6) {\n passwordTxt.setError(\"Mật khẩu phải 6 ký tự trở lên\");\n validFlag = false;\n } else {\n passwordTxt.setError(null);\n }\n\n Pattern phoneP = Pattern.compile(\"[0-9]{8,15}$\");\n Matcher phoneM = phoneP.matcher(phone);\n boolean phoneB = phoneM.find();\n\n if (TextUtils.isEmpty(phone) || phone.length() < 8 || phone.length() > 15 || !phoneB) {\n phoneTxt.setError(\"Số điện thoại bị để trống hoặc không đúng định dạng\");\n validFlag = false;\n } else {\n phoneTxt.setError(null);\n }\n if (confirPassWord.length() < 6 || !confirPassWord.equals(password)) {\n confirmPasswordTxt.setError(\"Xác nhận mật khẩu không đúng\");\n validFlag = false;\n } else {\n confirmPasswordTxt.setError(null);\n }\n\n Pattern p = Pattern.compile(\"[0-9]\", Pattern.CASE_INSENSITIVE);\n Matcher m = p.matcher(name);\n boolean b = m.find();\n if (b) {\n nameTxt.setError(\"Tên tồn tại ký tự đặc biệt\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n if (TextUtils.isEmpty(name)) {\n nameTxt.setError(\"Không được để trống tên.\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n\n return validFlag;\n }", "private boolean isValidNumber() {\n String mobileNumber = ((EditText) findViewById(\n R.id.account_mobile_number_edit_text)).getText().toString();\n\n return PhoneNumberUtils.isValidMobileNumber(PhoneNumberUtils.formatMobileNumber(mobileNumber));\n }", "@Override\n public void verifyHasPhone() {\n }", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "public void checkvalidate()\n\t{\n\t\tif((fn.getText().toString()).equals(\"\"))\n \t{\n \t\t//text1.setText(\"Name not entered!!\");\n\t\t\tToast.makeText(AddContact.this, \"Name Not Entered\",Toast.LENGTH_SHORT).show();\n \t}\n \telse if((mobno.getText().toString()).equals(\"\"))\n \t{\n \t\t//text1.setText(\"Phone not entered!!\");\n \t\tToast.makeText(AddContact.this, \"Phone No. not Entered\",Toast.LENGTH_SHORT).show();\n \t}\t\n \telse\n \t{\n \t\tname=fn.getText().toString();\n\t\t\tstrln=ln.getText().toString();\n\t\t\t//mname=mn.getText().toString();\n\t\t\tstrmno=mobno.getText().toString();\n\t\t\tstreid=eid.getText().toString();\n\t\t\tstrtag_type=stag.getSelectedItem().toString();\n\t\t\tstrtag=tag.getText().toString();\n\t\t\tmshome=mhome.getText().toString();\n\t\t\tmswork=mwork.getText().toString();\n\t\t\tmsother=moth.getText().toString();\n\t\t\teswork=ework.getText().toString();\n\t\t\tesother=eoth.getText().toString();\n\t\t\tnotes=enotes.getText().toString();\n\t\t\tdata.Insert(name,mname,strln,strmno,mshome,mswork,msother,mscust, streid,eswork,esother,mscust,imagePath,strtag_type,strtag,0,date,time,notes,0);\n\t\t\tToast.makeText(AddContact.this, \"Added Successfully\",Toast.LENGTH_SHORT).show();\n\t\t\tCursor c=data.getData();\n\t\t\twhile(c.moveToNext())\n\t\t\t{\n\t\t\t\tString name1=c.getString(0);\n\t\t\t\tSystem.out.println(\"Name:\"+name1);\n\t\t\t\t\n\t\t\t}\n\t\t\tc.close();\n\t\t\tviewcontacts();\n \t}\n\t\t\n\t}", "private void validateFields(){\n String email = edtEmail.getText().toString().trim();\n String number=edtPhone.getText().toString().trim();\n String cc=txtCountryCode.getText().toString();//edtcc.getText().toString().trim();\n String phoneNo=cc+number;\n // Check for a valid email address.\n\n\n if (TextUtils.isEmpty(email)) {\n mActivity.showSnackbar(getString(R.string.error_empty_email), Toast.LENGTH_SHORT);\n return;\n\n } else if (!Validation.isValidEmail(email)) {\n mActivity.showSnackbar(getString(R.string.error_title_invalid_email), Toast.LENGTH_SHORT);\n return;\n\n }\n\n if(TextUtils.isEmpty(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_empty_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n if(!Validation.isValidMobile(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_title_invalid_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n\n if(selectedCurrency==null){\n //mActivity.showSnackbar(getString(R.string.str_select_currency), Toast.LENGTH_SHORT);\n Snackbar.make(getView(),\"Currency data not found!\",Snackbar.LENGTH_LONG)\n .setAction(\"Try again\", new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n getAllCurrency();\n }\n }).show();\n return;\n }\n try {\n JsonObject object = new JsonObject();\n object.addProperty(KEY_EMAIL, email);\n object.addProperty(KEY_PHONE,phoneNo);\n object.addProperty(KEY_CURRENCY,selectedCurrency.getId().toString());\n updateUser(object,token);\n }catch (Exception e){\n\n }\n\n }", "@RequestMapping(value = \"/user/validate\")\n @Service\n public @ResponseBody ValidateResult validatePhoneNumberAPI(@RequestParam(value = \"phoneNumber\", required = true) String phoneNumber) {\n \tValidateResult result = new ValidateResult();\n \t\n \tresult.setResult(phoneNumber.substring(0, Math.min(phoneNumber.length(), 10)));\n \t\n \treturn result;\n }", "@And(\"^Enter user phone and confirmation code$\")\t\t\t\t\t\n public void Enter_user_phone_and_confirmation_code() throws Throwable \t\t\t\t\t\t\t\n { \t\t\n \tdriver.findElement(By.id(\"phoneNumberId\")).sendKeys(\"01116844320\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvPhoneNext']/content/span\")).click();\n driver.findElement(By.id(\"code\")).sendKeys(\"172978\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvVerifyNext']/content/span\")).click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\t\t\n }", "private boolean CheckPhoneNumber() {\n\t\tString phoneNumber = Phone_textBox.getText();\n\n\t\t// if field is empty\n\t\tif (phoneNumber.equals(\"\")) {\n\t\t\tif (!Phone_textBox.getStyleClass().contains(\"error\"))\n\t\t\t\tPhone_textBox.getStyleClass().add(\"error\");\n\t\t\tPhoneNote.setText(\"* Enter Number\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// if field contains a character that is not a digit\n\t\tif (!phoneNumber.matches(\"([0-9])+\")) {\n\t\t\tif (!Phone_textBox.getStyleClass().contains(\"error\"))\n\t\t\t\tPhone_textBox.getStyleClass().add(\"error\");\n\t\t\tPhoneNote.setText(\"* Worng Format(?)\");\n\t\t\tTooltip.install(PhoneNote, new Tooltip(\"Phone Number can only contain digits\"));\n\t\t\treturn false;\n\t\t}\n\n\t\t// if field contains more or less than 10 digits\n\t\tif (phoneNumber.length() != 10) {\n\t\t\tif (!Phone_textBox.getStyleClass().contains(\"error\"))\n\t\t\t\tPhone_textBox.getStyleClass().add(\"error\");\n\t\t\tPhoneNote.setText(\"* Worng Format(?)\");\n\t\t\tTooltip.install(PhoneNote, new Tooltip(\"Phone Number must be 10 digits long\"));\n\t\t\treturn false;\n\t\t}\n\n\t\tPhone_textBox.getStyleClass().remove(\"error\");\n\t\tPhoneNote.setText(\"*\");\n\t\tTooltip.uninstall(PhoneNote, new Tooltip(\"Phone Number can only contain digits\"));\n\t\tTooltip.uninstall(PhoneNote, new Tooltip(\"Phone Number must be 10 digits long\"));\n\t\treturn true;\n\t}", "@Override\n public boolean isValid(PhoneNumber phoneNumber) {\n String number = phoneNumber.getNumber();\n return isPhoneNumber(number) && number.startsWith(\"+380\") && number.length() == 13;\n }", "private boolean isPhoneValid(String phoneno) {\n return phoneno.length() > 9;\n }", "private boolean validate(String name, String phone, String email, String description) {\n if (name.equals(null) || name.equals(\"\") || !isValidMobile(phone) || !isValidMail(email) || description.equals(null) || description.equals(\"\")) {\n\n if (name.equals(null) || name.equals(\"\")) {\n nameText.setError(\"Enter a valid Name\");\n } else {\n nameText.setError(null);\n }\n if (!isValidMobile(phone)) {\n phoneNumber.setError(\"Enter a valid Mobile Number\");\n } else {\n phoneNumber.setError(null);\n }\n if (!isValidMail(email)) {\n emailText.setError(\"Enter a valid Email ID\");\n } else {\n emailText.setError(null);\n }\n if (description.equals(null) || description.equals(\"\")) {\n descriptionText.setError(\"Add few lines about you\");\n } else {\n descriptionText.setError(null);\n }\n return false;\n } else\n return true;\n }", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "public static boolean isValidMobile(String target) {\n\n// String mobile = \"^\\\\(?([0-9]{3})\\\\)?[-.]?([0-9]{3})[-.]?([0-9]{4})$\";\n String mobile = \"^[789]\\\\d{9}$\";\n Matcher matcherEmail = Pattern.compile(mobile).matcher(target);\n return matcherEmail.matches();\n }", "@GET(\"numbervalidation\")\n Call<ResponseBody> numbervalidation(@Query(\"mobile_number\") String mobile_number, @Query(\"country_code\") String country_code, @Query(\"user_type\") String user_type, @Query(\"language\") String language, @Query(\"forgotpassword\") String forgotpassword);", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "@And(\"^I enter the plenti phone number using mobile website$\")\n public void I_enter_the_plenti_phone_number_using_mobile_website() throws Throwable {\n TextBoxes.typeTextbox(Elements.element(\"plenti_enroll.phone_number\"), TestUsers.getuslCustomer(null).getUser().getProfileAddress().getBestPhone());\n }", "private boolean isInfoValidate(){\n if(mEmailAddress.getText() == null || mEmailAddress.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_email_address);\n return false;\n }\n\n if(!mEmailAddress.getText().toString().contains(\"@\")){\n errorText = getString(R.string.register_warning_valid_email_address);\n return false;\n }\n\n// if(mRegionSpinner.getSelectedItemPosition() == Constant.NON_SELECT){\n// errorText = getString(R.string.register_warning_select_region);\n// return false;\n// }\n\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.HONG_KONG)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.HONGKONG_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n//\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.CHINA)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.CHINA_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n\n if(mPassword.getText() == null || mPassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_password);\n return false;\n }\n\n if(mRetypePassword.getText() == null || mRetypePassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_retype_password);\n return false;\n }\n\n if(!mPassword.getText().toString().equals(mRetypePassword.getText().toString())){\n errorText = getString(R.string.register_warning_not_the_same);\n return false;\n }\n\n if(!Utility.judgeContainsStr( mPassword.getText().toString())){\n errorText = getString(R.string.register_warning_contains_character);\n return false;\n }\n\n// if(!mPolicyCheckBox.isChecked()){\n// errorText = getString(R.string.register_warning_check_agreement);\n// return false;\n// }\n\n return true;\n }", "private void ValidateEditTextFields() {\n\tfor (int i = 0; i < etArray.length; i++) {\n\t if (etArray[i].getText().toString().trim().length() <= 0) {\n\t\tvalidCustomer = false;\n\t\tetArray[i].setError(\"Blank Field\");\n\t }\n\t}\n\n\tif (etPhoneNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etPhoneNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (etEmergencyNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etEmergencyNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (calendarDob == null) {\n\t validCustomer = false;\n\t}\n }", "private boolean checkPhoneNum() {\n\t\tphoneNum = et_phone.getText().toString().trim();\r\n\t\tif(isMobileNO(phoneNum)){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public String validarTelefono(String tel) {\n int lon = tel.length();\n if (lon == 9) {\n if (isNumeric(tel)) {\n return tel;\n } else {\n return \"\";\n }\n } else if (lon == 8) {\n return \"0\" + tel;\n } else if (lon == 7) {\n return \"07\" + tel;\n } else if (lon == 6) {\n return \"072\" + tel;\n } else {\n return \"\";\n }\n }", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public boolean isValidPhone(TextInputLayout tiPhone, EditText etPhone) {\n String phone = etPhone.getText().toString().trim();\n boolean result = false;\n\n if (phone.length() == 0)\n tiPhone.setError(c.getString(R.string.required));\n else if (phone.length() != PHONE_SIZE)\n tiPhone.setError(c.getString(R.string.specificLength, Integer.toString(PHONE_SIZE)));\n else if (!phone.matches(\"\\\\d{10}\"))\n tiPhone.setError(c.getString(R.string.onlyNumbers));\n else {\n result = true;\n tiPhone.setError(null);\n }\n return result;\n }", "public boolean validateFields(Customer customer) {\r\n if (isEmpty(customer.getFirstName(), customer.getLastName(), customer.getPhoneNum(),\r\n customer.getEmail(), customer.getDate())) {\r\n Alert alert = new Alert(Alert.AlertType.WARNING);\r\n alert.setTitle(\"Invalid info\");\r\n alert.setHeaderText(null);\r\n alert.setContentText(\"Invalid info.\\nAll fields must be filled.\");\r\n alert.showAndWait();\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public void validate() {\n boolean b = false;\n\n //retrieving the contact us form details from request object\n String firstName = objContactUsForm.getName().trim();\n String email = objContactUsForm.getEmail().trim();\n String message = objContactUsForm.getMessage().trim();\n\n //now validating each of the field\n if (firstName.isEmpty()) {\n addFieldError(\"name\", getText(\"name.required\"));\n b = true;\n }\n\n if (email.isEmpty()) {\n addFieldError(\"email\", getText(\"email.required\"));\n b = true;\n }\n if (!b) {\n Pattern p = Pattern.compile(\".+@.+\\\\.[a-z]+\");\n Matcher m = p.matcher(email);\n boolean matchFound = m.matches();\n if (!matchFound) {\n addFieldError(\"email\", \"Please Provide Valid Email ID\");\n }\n }\n\n if (message.isEmpty()) {\n addFieldError(\"message\", getText(\"message.required\"));\n b = true;\n }\n\n if (!b) {\n boolean matches = message.matches(\"[<>!~@$%^&\\\"|!\\\\[#$]\");\n if (matches) {\n addFieldError(\"message\", \"Please Provide Valid Message Name\");\n b = true;\n }\n }\n }", "private boolean validateInputInfo(){\n\n //Get user input\n String firstName = newContactFirstName.getText().toString();\n String lastName = newContactLastName.getText().toString();\n String email = newContactEmailAddress.getText().toString();\n String phone = newContactPhoneNumber.getText().toString();\n\n //Check to make sure no boxes were left empty\n if(firstName.isEmpty() || lastName.isEmpty() || email.isEmpty() || phone.isEmpty()){\n Toast.makeText(this, \"You must fill all fields before continuing!\", Toast.LENGTH_LONG).show();\n return false;\n }\n //Check to see if phone number is valid\n else if(!(phone.length() >= 10)){\n Toast.makeText(this, \"Make sure to input a valid 10 digit phone number!\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n return true;\n }", "@Override\n public String provideCustomerMobilePhone( )\n {\n return _signaleur.getIdTelephone( );\n }", "public String checkPhone() {\n String phone = \"\"; // Create phone\n boolean isOK = true; // Condition loop\n\n while (isOK) {\n phone = checkEmpty(\"Phone\"); // Call method to check input of phone\n String phoneRegex = \"\\\\d{10,11}\"; // Pattern for phone number\n boolean isContinue = true; // Condition loop\n\n while (isContinue) {\n // If pattern not match, the print out error\n if (!Pattern.matches(phoneRegex, phone)) {\n System.out.println(\"Phone number must be 10 or 11 number!\");\n System.out.print(\"Try anthor phone: \");\n phone = checkEmpty(\"Phone\");\n } else {\n isContinue = false;\n }\n }\n\n boolean isExist = false; // Check exist phone\n for (Account acc : accounts) {\n if (phone.equals(acc.getPhone())) {\n // Check phone if exist print out error\n System.out.println(\"This phone has already existed!\");\n System.out.print(\"Try another phone: \");\n isExist = true;\n }\n }\n\n // If phone not exist then return phone\n if (!isExist) {\n return phone;\n }\n }\n return phone; // Return phone\n }", "public static boolean isValidMobileNo(String str) \n\t\t\t{\n\t\t\tPattern ptrn = Pattern.compile(\"(0/91)?[0-9]{9}\"); \n\t\t\t//the matcher() method creates a matcher that will match the given input against this pattern \n\t\t\tMatcher match = ptrn.matcher(str); \n\t\t\t//returns a boolean value \n\t\t\treturn (match.find() && match.group().equals(str)); \n\t\t\t}", "private String checkUserDetail(UserModel userModel) {\n\t\tString name = userModel.getName();\n\t\tString mobileNumber = userModel.getMobileNumber();\n\t\tString email = userModel.getEmail();\n\t\tString pincode = userModel.getPincode();\n\t\tString area = userModel.getAreaName();\n\t\tString state = userModel.getStateName();\n\t\tString res = \"okkk\";\n\t\tif (mobileNumber.length() != 10) {\n\t\t\tres = \"Enter ten digit mobile number\";\n\t\t} else if (!checkMobileDigit(mobileNumber)) {\n\t\t\tres = \"enter only digit\";\n\t\t} else if (!checkNameChar(name)) {\n\t\t\tres = \"name shuld be only in alphabet\";\n\t\t} else if (!checkEmail(email)) {\n\t\t\tres = \"enter a valid email\";\n\t\t} else if (pincode.length() != 6) {\n\t\t\tres = \"enter valid pincode and enter only six digit\";\n\t\t} else if (!checkPincode(pincode)) {\n\t\t\tres = \"enter only digit\";\n\t\t} else if (area.equals(null)) {\n\t\t\tres = \"choose area\";\n\t\t} else if (state.equals(null)) {\n\t\t\tres = \"choose state\";\n\t\t}\n\t\treturn res;\n\t}", "private void checkMobileAvailable(HttpServletRequest request, @NotNull long mobile) {\r\n\t\tString action = getCleanParam(request, config.getParam().getSmsActionName());\r\n\t\t// bind phone , needn't Check account exist\r\n\t\tif (BIND == (Action.safeOf(action))) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// Getting account information\r\n\t\tIamAccountInfo acc = configurer.getIamAccount(new SmsParameter(String.valueOf(mobile)));\r\n\r\n\t\t// Check mobile(user) available\r\n\t\tif (!(acc != null && !StringUtils.isEmpty(acc.getPrincipal()))) {\r\n\t\t\tlog.warn(\"Illegal users, because mobile phone number: {} corresponding users do not exist\", mobile);\r\n\t\t\tthrow new UnknownAccountException(bundle.getMessage(\"GeneralAuthorizingRealm.notAccount\", String.valueOf(mobile)));\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tString mobilePattern =\"^[7-9]\\\\d{9}$\";\r\n\t\t\r\n\t\tString userNamePattern = \"^r[A-Za-z]+vi$\" ;\r\n\t\t\r\n\t\tString mobileNo;\r\n\t\tString userName;\r\n\t\tScanner scanner = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Please Enter Mobile No( 10 digits)\");\r\n\t \r\n\t\tmobileNo = scanner.next();\r\n\t\r\n\t Pattern mobile=Pattern.compile(mobilePattern);\r\n\t \r\n\t Matcher matcher = mobile.matcher(mobileNo);\r\n\t \r\n\t if(matcher.find()){\r\n\t \tSystem.out.println(\"Correct Formate\");\r\n\t }\r\n\t else\r\n\t {\r\n\t \tSystem.out.println(\"Wrong Mobile Number format!\");\r\n\t }\r\n\t \r\n\t \r\n\t System.out.println(\"Please Enter UserName( mandatory) ( it should be started with 'r' and follwed by any character and ends with \\\"vi\\\"\");\r\n\t\t \r\n\t\tuserName = scanner.next();\r\n\t\r\n\t Pattern userPattern=Pattern.compile(uaerNamePattern);\r\n\t \r\n\t matcher = userPattern.matcher(userName);\r\n\t \r\n\t \r\n\t if(matcher.find()){\r\n\t \tSystem.out.println(\"Correct Formate\");\r\n\t }\r\n\t else\r\n\t {\r\n\t \tSystem.out.println(\"Wrong userName format!\");\r\n\t }\r\n\t \r\n\t \r\n\t \r\n\t \r\n\t \r\n\t}", "public boolean validarTelefono1() {\n\t\treturn validadores.validarLongitud(telefonos[0], 15);\n\t}", "private boolean validateInput(){\n Window owner=root.getScene().getWindow();\n inputFileds.addAll(txtfn,txtln,txtsurname,txtDOB,txtResidence,txtMobile,txtID,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().isEmpty()){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n inputFileds.removeAll(txtDOB,txtMobile,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().length()>30){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Sorry the text you entered can not be greater that 30 characters\",\"Text too Long\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n if(username.getText().length()>20 || username.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Username has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid input\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n if(pass.getText().isEmpty()){\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n if(pass.getText().length()>20 || pass.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Password has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n SimpleDateFormat yearFormat = new SimpleDateFormat(\"yyyy\");\n try {\n date = dateFormat.parse(txtDOB.getText());\n Calendar cal=Calendar.getInstance();\n int year=Integer.parseInt(yearFormat.format(date));\n if (year <= 1900 || year>cal.get(Calendar.YEAR)) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n String initialEntry=txtDOB.getText();\n String parsedValue=dateFormat.format(date);\n if(!initialEntry.equals(parsedValue)){\n Dialog.showMessageDialog(owner, \"Note your Date of Birth has been corrected\", \"Date Corrected\",DialogIcon.INFORMATION);\n }\n txtDOB.setText(dateFormat.format(date));\n } catch (ParseException ex) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n try {\n int mobile=Integer.parseInt(txtMobile.getText());\n } catch (NumberFormatException e) {\n Dialog.showMessageDialog(owner, \"Invalid Mobile Number\", \"Invalid data\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n if(txtMobile.getText().length() != 10){\n Dialog.showMessageDialog(owner, \"Sorry your Mobile Number is invalid\", \"Invalid input\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n String sql=\"select Username,Password from users where Username=?\";\n try(PreparedStatement prstmt=con.prepareStatement(sql)) {\n prstmt.setString(1, username.getText());\n ResultSet rs=prstmt.executeQuery();\n if(rs.next()){\n Dialog.showMessageDialog(owner, \"Sorry Username already exists\\n Please change to different Username\", \"Username Exists\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n rs.close();\n } catch (SQLException e) {\n System.err.println(e);\n }\n return true;\n }", "private boolean isInputValid() {\r\n \r\n String errorMessage = \"\";\r\n \r\n // Email regex provided by emailregex.com using the RFC5322 standard\r\n String emailPatternString = \"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\r\n \r\n // Phone number regex provided by Ravi Thapliyal on Stack Overflow:\r\n // http://stackoverflow.com/questions/16699007/regular-expression-to-match-standard-10-digit-phone-number\r\n String phoneNumString = \"^(\\\\+\\\\d{1,2}\\\\s)?\\\\(?\\\\d{3}\\\\)?[\\\\s.-]?\\\\d{3}[\\\\s.-]?\\\\d{4}$\";\r\n \r\n Pattern emailPattern = Pattern.compile(emailPatternString, Pattern.CASE_INSENSITIVE);\r\n Matcher emailMatcher;\r\n \r\n Pattern phoneNumPattern = Pattern.compile(phoneNumString);\r\n Matcher phoneNumMatcher;\r\n \r\n // Validation for no length or over database size limit\r\n if ((custFirstNameTextField.getText() == null || custFirstNameTextField.getText().length() == 0) || (custFirstNameTextField.getText().length() > 25)) {\r\n errorMessage += \"First name has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custLastNameTextField.getText() == null || custLastNameTextField.getText().length() == 0) || (custLastNameTextField.getText().length() > 25)) {\r\n errorMessage += \"Last name has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custAddressTextField.getText() == null || custAddressTextField.getText().length() == 0) || (custAddressTextField.getText().length() > 75)) {\r\n errorMessage += \"Address has to be between 1 and 75 characters.\\n\";\r\n }\r\n \r\n if ((custCityTextField.getText() == null || custCityTextField.getText().length() == 0) || (custCityTextField.getText().length() > 50)) {\r\n errorMessage += \"City has to be between 1 and 50 characters.\\n\";\r\n }\r\n \r\n if ((custProvinceTextField.getText() == null || custProvinceTextField.getText().length() == 0) || (custProvinceTextField.getText().length() > 2)) {\r\n errorMessage += \"Province has to be a two-letter abbreviation.\\n\";\r\n }\r\n \r\n if ((custPostalCodeTextField.getText() == null || custPostalCodeTextField.getText().length() == 0) || (custPostalCodeTextField.getText().length() > 7)) {\r\n errorMessage += \"Postal Code has to be between 1 and 7 characters.\\n\";\r\n }\r\n \r\n if ((custCountryTextField.getText() == null || custCountryTextField.getText().length() == 0) || (custCountryTextField.getText().length() > 25)) {\r\n errorMessage += \"Country has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custHomePhoneTextField.getText() == null || custHomePhoneTextField.getText().length() == 0) || (custHomePhoneTextField.getText().length() > 20)) {\r\n errorMessage += \"Phone number has to be between 1 and 20 characters long.\\n\";\r\n } else {\r\n phoneNumMatcher = phoneNumPattern.matcher(custHomePhoneTextField.getText());\r\n if (!phoneNumMatcher.matches()) {\r\n errorMessage += \"Phone number not in the correct format: (111) 111-1111.\\n\";\r\n }\r\n }\r\n \r\n if ((custBusinessPhoneTextField.getText() == null || custBusinessPhoneTextField.getText().length() == 0) || (custBusinessPhoneTextField.getText().length() > 20)) {\r\n errorMessage += \"Phone number has to be between 1 and 20 characters long.\\n\";\r\n } else {\r\n phoneNumMatcher = phoneNumPattern.matcher(custBusinessPhoneTextField.getText());\r\n if (!phoneNumMatcher.matches()) {\r\n errorMessage += \"Phone number not in the correct format: (111) 111-1111.\\n\";\r\n }\r\n }\r\n \r\n if ((custEmailTextField.getText() == null || custEmailTextField.getText().length() == 0) || (custEmailTextField.getText().length() > 50)) {\r\n errorMessage += \"Email has to be between 1 and 50 characters.\\n\";\r\n } else {\r\n emailMatcher = emailPattern.matcher(custEmailTextField.getText());\r\n if (!emailMatcher.matches()) {\r\n errorMessage += \"Email format is not correct. Should be in the format [email protected].\\n\"; \r\n } \r\n }\r\n \r\n if (errorMessage.length() > 0) {\r\n Alert alert = new Alert(AlertType.ERROR, errorMessage, ButtonType.OK);\r\n alert.setTitle(\"Input Error\");\r\n alert.setHeaderText(\"Please correct invalid fields\");\r\n alert.showAndWait();\r\n \r\n return false;\r\n }\r\n \r\n return true;\r\n }", "private boolean isValidMobileNumber(String number) {\n return Patterns.PHONE.matcher(number).matches() && (number.length() > 10);\n }", "private boolean validatePhone(String phone_value) {\n \tboolean result;\n \t\n \tif (phone_value == null)\n \t{\n \t\tresult = false;\n \t}\n \telse\n \t{\n \t\tif ( phone_value.equals(\"\") )\n \t\t\tresult = true;\n \t\telse\n \t\t\tresult = android.util.Patterns.PHONE.matcher(phone_value).matches();\n \t}\n \t\n \treturn result;\n }", "private void validateData() {\n }", "private boolean checkPhoneStatusOK() {\n return true;\n }", "public void validateMobile(String lang) {\n boolean valid = false;\n if (StringUtils.isNotBlank(this.mobile)) {\n Pattern p = Pattern.compile(\"^\\\\+\\\\d{1,2}[ ]\\\\d{10,11}$\");\n Matcher m = p.matcher(this.mobile);\n valid = m.matches();\n }\n if (!valid) throw new ValidateException(new ErrorEntity(ErrorCode.INVALID, lang));\n }", "boolean validateInput() {\n if (etFullname.getText().toString().equals(\"\")) {\n etFullname.setError(\"Please Enter Full Name\");\n return false;\n }\n if (etId.getText().toString().equals(\"\")) {\n etId.setError(\"Please Enter ID\");\n return false;\n }\n if (etEmail.getText().toString().equals(\"\")) {\n etEmail.setError(\"Please Enter Email\");\n return false;\n }\n if (etHall.getText().toString().equals(\"\")) {\n etHall.setError(\"Please Enter Hall Name\");\n return false;\n }\n if (etAge.getText().toString().equals(\"\")) {\n etAge.setError(\"Please Enter Age\");\n return false;\n }\n if (etPhone.getText().toString().equals(\"\")) {\n etPhone.setError(\"Please Enter Contact Number\");\n return false;\n }\n if (etPassword.getText().toString().equals(\"\")) {\n etPassword.setError(\"Please Enter Password\");\n return false;\n }\n\n // checking the proper email format\n if (!isEmailValid(etEmail.getText().toString())) {\n etEmail.setError(\"Please Enter Valid Email\");\n return false;\n }\n\n // checking minimum password Length\n if (etPassword.getText().length() < MIN_PASSWORD_LENGTH) {\n etPassword.setError(\"Password Length must be more than \" + MIN_PASSWORD_LENGTH + \"characters\");\n return false;\n }\n\n\n return true;\n }", "private boolean checkLengthDeviceSerialEditText (EditText text, TextInputLayout TFB, String massage) {\n if(text.getText().toString().length() > 10 || text.getText().toString().length() < 10)\n {\n TFB.setErrorEnabled(true);\n TFB.setError(massage);\n return false;\n }\n else\n {\n TFB.setErrorEnabled(false);\n return true;\n }\n\n\n }", "public static boolean isValidMobile(String mobilePhone)\n {\n\t\tif (mobilePhone == null)\n\t\t\treturn false;\n\n // only digits and '+' are accepted.\n if(mobilePhone.matches(\"^.*[^\\\\d\\\\+]+.*\"))\n return false;\n\n if(!mobilePhone.startsWith(\"+\"))\n mobilePhone = canonicalizeMobilePhone(mobilePhone);\n\n //local mobile should be >=11;\n if(mobilePhone.startsWith(\"+65\") && mobilePhone.length()<11)\n return false;\n\n\t\treturn true;\n\t}", "public boolean phoneValidate(final String phone) {\n\n\t\ttry {\n\t\t\tif (empHomePhone.equals(employeeHomePhone.getText().toString()))\n\t\t\t\treturn true;\n\t\t\tint pNumber = Integer.parseInt(phone);\n\t\t\tif ((pNumber < Integer.MAX_VALUE) && (pNumber > 999999))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\n\t\t} catch (NumberFormatException e) {\n\t\t\tLog.e(\"Phone length is null\", \"Please fill the phone field\");\n\t\t\tToast.makeText(this, \"Phone Field is Empty\", Toast.LENGTH_SHORT)\n\t\t\t\t\t.show();\n\t\t\treturn false;\n\t\t}\n\n\t}", "private boolean isPhoneValid(String password) {\n return password.length() == 10;\r\n }", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "public static boolean checkPhoneNumber (String phoneNumber) throws UserRegistrationException{\n check = Pattern.compile(\"^[0-9]{1,3} [0-9]{10}$\").matcher(phoneNumber).matches();\n if (check) {\n return true;\n } else {\n throw new UserRegistrationException(\"Enter a valid Phone number\");\n }\n }", "public static void validation() {\n\t\tif ((!textFieldName.getText().isEmpty()) && (!textField_FirstName.getText().isEmpty())\n\t\t\t\t&& (!textField_Town.getText().isEmpty()) && (!textField_Town.getText().isEmpty())) {\n\n\t\t\tif ((isValidEmailAddress(textField_Email.getText()) == true)) {\n\t\t\t\ttextField_Email.setBackground(Color.white);\n\t\t\t\tif ((force(textField_Mtp.getText()) > 82)) {\n\t\t\t\t\ttextField_Mtp.setBackground(Color.white);\n\t\t\t\t\tactionGiveServeur();\n\n\t\t\t\t} else {\n\t\t\t\t\tshowMessageDialog(null, \"Votre mot de passe est trop faible\");\n\t\t\t\t\ttextField_Mtp.setText(\"Mot de passe trop simple : changer le \");\n\t\t\t\t\ttextField_Mtp.setBackground(Color.RED);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextField_Email.setText(\"Email invalide\");\n\t\t\t\ttextField_Email.setBackground(Color.RED);\n\t\t\t\tshowMessageDialog(null, \"Email est invalide\");\n\t\t\t}\n\t\t} else {\n\n\t\t\tshowMessageDialog(null, \"Certain champs sont vide !\");\n\t\t}\n\t}", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "@Test\n public void invalidCaleeNumber(){\n PhoneCall call = new PhoneCall(\"503-449-7833\", \"ABCD\", \"01/01/2020\", \"1:00 am\", \"01/01/2020\", \"1:00 am\");\n assertThat(call.getCallee(), not(nullValue()));\n }", "private boolean isPhoneValid(String phone) {\n return !phone.contains(\" \");\r\n }", "public boolean validation(){\n String Venuename= venuename.getText().toString();\n String Address= address.getText().toString();\n String Details= details.getText().toString();\n String Venueimage= venueimage.getText().toString();\n if(Venuename.isEmpty()){\n venuename.setError(\"Please enter the item name\");\n venuename.requestFocus();\n return false;\n }\n if(Address.isEmpty()){\n address.setError(\"Please enter the item name\");\n address.requestFocus();\n return false;\n }\n if(Details.isEmpty()){\n details.setError(\"Please enter the item name\");\n details.requestFocus();\n return false;\n }\n if(Venueimage.isEmpty()){\n venueimage.setError(\"Please Select the image first\");\n return false;\n }\n\n\n return true;\n }", "public void AddCustomer(View v) {\r\n try {\r\n if (edtCustName.getText().toString().equalsIgnoreCase(\"\") || edtCustPhoneNo.getText().toString().equalsIgnoreCase(\"\") || edtCustAddress.getText().toString().equalsIgnoreCase(\"\")) {\r\n MsgBox.Show(\"Warning\", \"Please fill all details before adding customer\");\r\n } else if (edtCustPhoneNo.getText().toString().length()!= 10)\r\n {\r\n MsgBox.Show(\"Warning\", \"Please fill 10 digit customer phone number\");\r\n return;\r\n } else{\r\n Cursor crsrCust = dbBillScreen.getCustomer(edtCustPhoneNo.getText().toString());\r\n if (crsrCust.moveToFirst()) {\r\n MsgBox.Show(\"Note\", \"Customer Already Exists\");\r\n } else {\r\n String gstin = etCustGSTIN.getText().toString().trim().toUpperCase();\r\n if (gstin == null) {\r\n gstin = \"\";\r\n }\r\n boolean mFlag = GSTINValidation.checkGSTINValidation(gstin);\r\n if(mFlag)\r\n {\r\n if( !GSTINValidation.checkValidStateCode(gstin,this))\r\n {\r\n MsgBox.Show(\"Invalid Information\",\"Please Enter Valid StateCode for GSTIN\");\r\n }\r\n else {\r\n InsertCustomer(edtCustAddress.getText().toString(), edtCustPhoneNo.getText().toString(),\r\n edtCustName.getText().toString(), 0, 0, 0, gstin);\r\n //ResetCustomer();\r\n //MsgBox.Show(\"\", \"Customer Added Successfully\");\r\n Toast.makeText(myContext, \"Customer Added Successfully\", Toast.LENGTH_SHORT).show();\r\n ControlsSetEnabled();\r\n checkForInterStateTax();\r\n }\r\n }else\r\n {\r\n MsgBox.Show(\"Invalid Information\",\"Please enter valid GSTIN for customer\");\r\n }\r\n\r\n }\r\n }\r\n } catch (Exception ex) {\r\n MsgBox.Show(\"Error\", ex.getMessage());\r\n }\r\n }", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "public void SetCreditCarddetails(String ccnumber, String ccname, String ccmonth, String ccyear, String ccseccode){\r\n\t\tString countrygroup_ccdetails= \"UK,PresselAustria\";\r\n\t\tString CCnum = getValue(ccnumber);\r\n\t\tString CCName = getValue(ccname);\r\n\t\tString CCMonth = getValue(ccmonth);\r\n\t\tString CCYear = getValue(ccyear);\r\n\t\tString CCSecCode = getValue(ccseccode);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+CCnum+\", \"+CCName+\", \"+CCMonth+\", \"+CCYear+\", \"+CCSecCode);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The CreditCard details should be entered\");\r\n\t\ttry{\r\n\t\t\tif(!(countrygroup_ccdetails).contains(countries.get(countrycount))){\r\n\t\t\t\tswitchframe(\"TokenizationPage\");\r\n\t\t\t\tsleep(2000);\r\n\t\t\t\tsendKeys(locator_split(\"txtCCnumber\"), CCnum);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCname\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCname\"), CCName);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCMonth\"), CCMonth);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCYear\"), CCYear);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCcode\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCcode\"), CCSecCode);\t\t\t\t\t\t\r\n\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The CreditCard details are entered\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The new CreditCard details are applicable to this \" +country);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- The CreditCard details are not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"One of the element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCnumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCname\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCMonth\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCYear\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCcode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" are not found\");\r\n\r\n\t\t}\r\n\t}", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public boolean validarTelefono(String telefono){\n boolean isTelefono = true;\n isTelefono = validarLong(telefono);\n if(isTelefono){\n isTelefono = telefono.length()<15 && telefono.length()>7?true:false;\n }\n return isTelefono;\n }", "public void validateRpd13s9()\n {\n // This guideline cannot be automatically tested.\n }", "private void checkValidation() {\n // Get email id and password\n MainActivity.EmailAddress = emailid.getText().toString();\n finalPassword = password.getText().toString();\n\n // Check patter for email id\n Pattern p = Pattern.compile(Utils.regEx);\n\n Matcher m = p.matcher(MainActivity.EmailAddress);\n\n // Check for both field is empty or not\n if (MainActivity.EmailAddress.equals(\"\") || MainActivity.EmailAddress.length() == 0\n || finalPassword.equals(\"\") || finalPassword.length() == 0) {\n loginLayout.startAnimation(shakeAnimation);\n new CustomToast().Show_Toast(getActivity(), view,\n \"Enter both credentials.\");\n\n }\n // Check if email id is valid or not\n else if (!m.find())\n new CustomToast().Show_Toast(getActivity(), view,\n \"Your Email Id is Invalid.\");\n // Else do login and do your stuff\n else\n tryLoginUser();\n\n }", "public static boolean mobileNo(String mobileNo) throws UserRegistrationException {\n\t\tboolean resultMobileNo = validateMobileNo.validator(mobileNo);\n\t\tif(true) {\n\t\t\treturn Pattern.matches(patternMobileNo, mobileNo);\n\t\t}else\n\t\t\tthrow new UserRegistrationException(\"Enter correct Mobile number\");\n\t}", "public void validateRpd11s7()\n {\n // This guideline cannot be automatically tested.\n }", "public boolean validatePhoneNumber(String input){\n\t\tif (input.matches(\"\\\\d{10}\")) return true;\n\t\t//validating phone number with -, . or spaces\n\t\telse if(input.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) return true;\n\t\t//validating phone number with extension length from 3 to 5\n\t\telse if(input.matches(\"\\\\d{3}-\\\\d{3}-\\\\d{4}\\\\s(x|(ext))\\\\d{3,5}\")) return true;\n\t\t//validating phone number where area code is in braces ()\n\t\telse if(input.matches(\"\\\\(\\\\d{3}\\\\)-\\\\d{3}-\\\\d{4}\")) return true;\n\t\t//return false if nothing matches the input\n\t\telse return false;\n\t}", "private boolean validateForm() {\n\n String email = mEditTextViewEmail.getText().toString();\n if (TextUtils.isEmpty(email)) {\n mTextInputLayoutEmail.setError(\"Emaill Id Required\");\n Toast.makeText(MainActivity.this, \"Email field required\", Toast.LENGTH_SHORT).show();\n return false;\n } else if (!isEmailValid(email)) {\n mTextInputLayoutEmail.setError(\"A valid Email id is required\");\n return false;\n } else {\n mTextInputLayoutEmail.setError(null);\n }\n\n String password = mEditTextViewPassword.getText().toString();\n if (TextUtils.isEmpty(password)) {\n mTextInputLayoutPassword.setError(\"Password required\");\n Toast.makeText(MainActivity.this, \"Password field required\", Toast.LENGTH_SHORT).show();\n return false;\n } else if (!isPasswordValid(password)) {\n mTextInputLayoutPassword.setError(\"Password must be at least 6 characters\");\n return false;\n } else {\n mTextInputLayoutPassword.setError(null);\n }\n\n return true;\n }", "public long mobCheck(long mob) { \n\t\twhile(true) {\n\t\t\tif(String.valueOf(mob).length() != 10) {\n\t\t\t\tSystem.out.println(\"Enter valid mobile number.\");\n\t\t\t\tmob = sc.nextLong();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn mob;\n\t\t\t}\n\t\t}\n\t}", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "@Test\n public void contactNumber_WhenValid_ShouldReturnTrue(){\n RegexTest valid = new RegexTest();\n boolean result = valid.contactNumber( \"91 1234567890\");\n Assert.assertEquals(true,result);\n }", "public void validate_the_Preferred_Contact_Method_in_Contact_Details_of_Customer_Tab_SMS(boolean status)throws Exception {\n\t\t\t\n\t\t\tboolean checked=VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Preferred Contact Method\").replaceAll(\"M_InnerText\", \"SMSPreference\"), \"Preferred Contact Method on SMS \");\n\t\t\t\n\t\t\tif(checked==status)\n\t\t\t\tReport.fnReportPass(\"Preferred Contact Method - SMS : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\telse\n\t\t\t\tReport.fnReportFail(\"Preferred Contact Method - SMS : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\n\t\t\n\t}" ]
[ "0.7159005", "0.70841587", "0.698063", "0.6698861", "0.66400003", "0.6624252", "0.65249264", "0.6503727", "0.6447244", "0.6412222", "0.6398612", "0.6373448", "0.63560265", "0.6328559", "0.6235877", "0.6194484", "0.618182", "0.61580753", "0.61489123", "0.6136938", "0.61349183", "0.61152947", "0.6110078", "0.61017585", "0.6072289", "0.6058598", "0.605455", "0.60284036", "0.60201645", "0.6019359", "0.6000607", "0.59513503", "0.59483254", "0.592701", "0.5919308", "0.59129626", "0.59012866", "0.5864256", "0.58503777", "0.58479106", "0.58406496", "0.58356297", "0.58335304", "0.5832719", "0.58312315", "0.57995033", "0.5799292", "0.57828933", "0.57654333", "0.57510597", "0.57487106", "0.57446253", "0.5740822", "0.57386804", "0.5728629", "0.57272094", "0.57114404", "0.569336", "0.5688782", "0.56800985", "0.56593764", "0.56414276", "0.56350297", "0.5629601", "0.5626091", "0.56254315", "0.5604758", "0.56047046", "0.5603766", "0.5571549", "0.5570487", "0.5568935", "0.5568032", "0.55647975", "0.55613345", "0.5547202", "0.55428135", "0.5532286", "0.552656", "0.5514957", "0.5511006", "0.5506572", "0.5505754", "0.5500476", "0.54991686", "0.5490579", "0.54861903", "0.548266", "0.5477299", "0.54750246", "0.5474483", "0.5471154", "0.5469813", "0.54693604", "0.54518074", "0.5450349", "0.544836", "0.5440858", "0.54375416", "0.5434003" ]
0.74118483
0
Validation Functions Description : To validate the Marketing preferences in Contact Details of Customer Tab for Phone Coded by :Rajan Created Data:23 Oct 2016 Last Modified Date: Modified By: Parameter:
public void validate_the_Marketing_preferences_in_Contact_Details_of_Customer_Tab(String type,String i)throws Exception { boolean checked= false; boolean status= false; try { checked = VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll("M_Header", "Contact Details").replaceAll("M_Category", "Marketing preferences").replaceAll("M_InnerText", type), "Marketing preferences on "+type); if(i.equalsIgnoreCase("1")) status=true; else status=false; } catch (NullPointerException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { if(checked==status) Report.fnReportPass("Marketing preferences - "+type+" : Checked status = "+status+" Display Status"+checked, driver); else Report.fnReportFail("Marketing preferences - "+type+" : Checked status = "+status+" Display Status"+checked, driver); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "private void validateDetails() {\n\n clearErrors();\n Utils.hide_keyboard(getActivity());\n\n boolean valid = true;\n\n String cvv = cvvTv.getText().toString();\n String expiryDate = cardExpiryTv.getText().toString();\n String cardNo = cardNoTv.getText().toString();\n\n if (cvv.length() < 3) {\n valid = false;\n cvvTil.setError(\"Enter a valid cvv\");\n }\n\n if (expiryDate.length() != 5) {\n cardExpiryTil.setError(\"Enter a valid expiry date\");\n valid = false;\n }\n\n String cardNoStripped = cardNo.replaceAll(\"\\\\s\", \"\");\n\n if (cardNoStripped.length() < 12 ) {\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n else {\n try {\n Long parsed = Long.parseLong(cardNoStripped);\n }\n catch (Exception e) {\n e.printStackTrace();\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n }\n\n if (valid) {\n\n if (saveCardSwitch.isChecked()) {\n int cardLen = cardNoStripped.length();\n cardFirst6 = cardNoStripped.substring(0, 6);\n cardLast4 = cardNoStripped.substring(cardLen - 4, cardLen);\n shouldISaveThisCard = true;\n presenter.savePotentialCardDets(cardFirst6, cardLast4);\n }\n\n //make request\n PayloadBuilder builder = new PayloadBuilder();\n builder.setAmount(thetellerInitializer.getAmount() + \"\")\n .setNarration(thetellerInitializer.getNarration())\n .setCardno(cardNoStripped)\n .set3dUrl(thetellerInitializer.get3dUrl())\n .setEmail(thetellerInitializer.getEmail())\n .setCurrency(thetellerInitializer.getCurrency())\n .setMerchant_id(thetellerInitializer.getMerchant_id())\n .setCvv(cvv).setFirstname(thetellerInitializer.getfName())\n .setLastname(thetellerInitializer.getlName())\n .setIP(Utils.getDeviceImei(getActivity()))\n .setTxRef(thetellerInitializer.getTxRef())\n .setExpiryyear(expiryDate.substring(3,5))\n .setExpirymonth(expiryDate.substring(0,2))\n .setMeta(thetellerInitializer.getMeta())\n .setApiUser(thetellerInitializer.getApiUser())\n .setApiKey(thetellerInitializer.getApiKey())\n .setDevice_fingerprint(Utils.getDeviceImei(getActivity()))\n .setCardType(cardType);\n\n if (thetellerInitializer.getPayment_plan() != null) {\n builder.setPaymentPlan(thetellerInitializer.getPayment_plan());\n }\n\n body = builder.createPayload();\n\n presenter.chargeCard(body, thetellerConstants.API_KEY);\n }\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "private void validateFields(){\n String email = edtEmail.getText().toString().trim();\n String number=edtPhone.getText().toString().trim();\n String cc=txtCountryCode.getText().toString();//edtcc.getText().toString().trim();\n String phoneNo=cc+number;\n // Check for a valid email address.\n\n\n if (TextUtils.isEmpty(email)) {\n mActivity.showSnackbar(getString(R.string.error_empty_email), Toast.LENGTH_SHORT);\n return;\n\n } else if (!Validation.isValidEmail(email)) {\n mActivity.showSnackbar(getString(R.string.error_title_invalid_email), Toast.LENGTH_SHORT);\n return;\n\n }\n\n if(TextUtils.isEmpty(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_empty_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n if(!Validation.isValidMobile(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_title_invalid_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n\n if(selectedCurrency==null){\n //mActivity.showSnackbar(getString(R.string.str_select_currency), Toast.LENGTH_SHORT);\n Snackbar.make(getView(),\"Currency data not found!\",Snackbar.LENGTH_LONG)\n .setAction(\"Try again\", new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n getAllCurrency();\n }\n }).show();\n return;\n }\n try {\n JsonObject object = new JsonObject();\n object.addProperty(KEY_EMAIL, email);\n object.addProperty(KEY_PHONE,phoneNo);\n object.addProperty(KEY_CURRENCY,selectedCurrency.getId().toString());\n updateUser(object,token);\n }catch (Exception e){\n\n }\n\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "private boolean isInfoValidate(){\n if(mEmailAddress.getText() == null || mEmailAddress.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_email_address);\n return false;\n }\n\n if(!mEmailAddress.getText().toString().contains(\"@\")){\n errorText = getString(R.string.register_warning_valid_email_address);\n return false;\n }\n\n// if(mRegionSpinner.getSelectedItemPosition() == Constant.NON_SELECT){\n// errorText = getString(R.string.register_warning_select_region);\n// return false;\n// }\n\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.HONG_KONG)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.HONGKONG_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n//\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.CHINA)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.CHINA_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n\n if(mPassword.getText() == null || mPassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_password);\n return false;\n }\n\n if(mRetypePassword.getText() == null || mRetypePassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_retype_password);\n return false;\n }\n\n if(!mPassword.getText().toString().equals(mRetypePassword.getText().toString())){\n errorText = getString(R.string.register_warning_not_the_same);\n return false;\n }\n\n if(!Utility.judgeContainsStr( mPassword.getText().toString())){\n errorText = getString(R.string.register_warning_contains_character);\n return false;\n }\n\n// if(!mPolicyCheckBox.isChecked()){\n// errorText = getString(R.string.register_warning_check_agreement);\n// return false;\n// }\n\n return true;\n }", "private boolean validate() {\n if(edtMobileNumber.getText().toString().length() <= 0){\n edtMobileNumber.setFocusable(true);\n edtMobileNumber.setError(Constants.ERR_MSG_MOBILE);\n return false;\n }else if(edtFirstName.getText().toString().length() <= 0){\n edtFirstName.setFocusable(true);\n edtFirstName.setError(Constants.ERR_MSG_FIRST_NAME);\n return false;\n }else if(edtLastName.getText().toString().length() <= 0){\n edtLastName.setFocusable(true);\n edtLastName.setError(Constants.ERR_MSG_LAST_NAME);\n return false;\n }else if(edtDateOfBirth.getText().toString().length() <= 0){\n edtDateOfBirth.setFocusable(true);\n edtDateOfBirth.setError(Constants.ERR_MSG_DATE_OF_BIRTH);\n return false;\n }else if(edtEnterPin.getText().toString().length() <= 0){\n edtEnterPin.setFocusable(true);\n edtEnterPin.setError(Constants.ERR_MSG_PIN);\n return false;\n }else if(edtConfirmPin.getText().toString().length() <= 0){\n edtConfirmPin.setFocusable(true);\n edtConfirmPin.setError(Constants.ERR_MSG_CONFIRM_PIN);\n return false;\n }else if(spnStatus.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_STATUS, Toast.LENGTH_SHORT).show();\n return false;\n }else if(spnBloodGroup.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_BLOOD_GROUP, Toast.LENGTH_SHORT).show();\n return false;\n }else if(rgGender.getCheckedRadioButtonId() == -1){\n Toast.makeText(context,Constants.ERR_MSG_GENDER,Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "public boolean isValid(){\n Email.setErrorEnabled(false);\n Email.setError(\"\");\n Fname.setErrorEnabled(false);\n Fname.setError(\"\");\n Lname.setErrorEnabled(false);\n Lname.setError(\"\");\n Pass.setErrorEnabled(false);\n Pass.setError(\"\");\n Mobileno.setErrorEnabled(false);\n Mobileno.setError(\"\");\n Cpass.setErrorEnabled(false);\n Cpass.setError(\"\");\n area.setErrorEnabled(false);\n area.setError(\"\");\n Houseno.setErrorEnabled(false);\n Houseno.setError(\"\");\n Pincode.setErrorEnabled(false);\n Pincode.setError(\"\");\n\n boolean isValid=false,isValidname=false,isValidhouseno=false,isValidlname=false,isValidemail=false,isValidpassword=false,isValidconfpassword=false,isValidmobilenum=false,isValidarea=false,isValidpincode=false;\n if(TextUtils.isEmpty(fname)){\n Fname.setErrorEnabled(true);\n Fname.setError(\"Enter First Name\");\n }else{\n isValidname=true;\n }\n if(TextUtils.isEmpty(lname)){\n Lname.setErrorEnabled(true);\n Lname.setError(\"Enter Last Name\");\n }else{\n isValidlname=true;\n }\n if(TextUtils.isEmpty(emailid)){\n Email.setErrorEnabled(true);\n Email.setError(\"Email Address is required\");\n }else {\n if (emailid.matches(emailpattern)) {\n isValidemail = true;\n } else {\n Email.setErrorEnabled(true);\n Email.setError(\"Enter a Valid Email Address\");\n }\n }\n if(TextUtils.isEmpty(password)){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Enter Password\");\n }else {\n if (password.length()<8){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Weak Password\");\n }else {\n isValidpassword = true;\n }\n }\n if(TextUtils.isEmpty(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Enter Password Again\");\n }else{\n if (!password.equals(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Password Dosent Match\");\n }else{\n isValidconfpassword=true;\n }\n }\n if(TextUtils.isEmpty(mobile)){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Enter Phone Number\");\n }else{\n if (mobile.length()<10){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Invalid Mobile Number\");\n } else {\n isValidmobilenum = true;\n }\n }\n if(TextUtils.isEmpty(Area)){\n area.setErrorEnabled(true);\n area.setError(\"Area is Required\");\n }else{\n isValidarea=true;\n }\n if(TextUtils.isEmpty(pincode)){\n Pincode.setErrorEnabled(true);\n Pincode.setError(\"Please Enter Pincode\");\n }else{\n isValidpincode=true;\n }\n if(TextUtils.isEmpty(house)){\n Houseno.setErrorEnabled(true);\n Houseno.setError(\"House field cant be empty\");\n }else{\n isValidhouseno=true;\n }\n isValid=(isValidarea && isValidpincode && isValidconfpassword && isValidpassword && isValidemail && isValidname &&isValidmobilenum && isValidhouseno && isValidlname)? true:false;\n return isValid;\n\n }", "public void checkvalidate()\n\t{\n\t\tif((fn.getText().toString()).equals(\"\"))\n \t{\n \t\t//text1.setText(\"Name not entered!!\");\n\t\t\tToast.makeText(AddContact.this, \"Name Not Entered\",Toast.LENGTH_SHORT).show();\n \t}\n \telse if((mobno.getText().toString()).equals(\"\"))\n \t{\n \t\t//text1.setText(\"Phone not entered!!\");\n \t\tToast.makeText(AddContact.this, \"Phone No. not Entered\",Toast.LENGTH_SHORT).show();\n \t}\t\n \telse\n \t{\n \t\tname=fn.getText().toString();\n\t\t\tstrln=ln.getText().toString();\n\t\t\t//mname=mn.getText().toString();\n\t\t\tstrmno=mobno.getText().toString();\n\t\t\tstreid=eid.getText().toString();\n\t\t\tstrtag_type=stag.getSelectedItem().toString();\n\t\t\tstrtag=tag.getText().toString();\n\t\t\tmshome=mhome.getText().toString();\n\t\t\tmswork=mwork.getText().toString();\n\t\t\tmsother=moth.getText().toString();\n\t\t\teswork=ework.getText().toString();\n\t\t\tesother=eoth.getText().toString();\n\t\t\tnotes=enotes.getText().toString();\n\t\t\tdata.Insert(name,mname,strln,strmno,mshome,mswork,msother,mscust, streid,eswork,esother,mscust,imagePath,strtag_type,strtag,0,date,time,notes,0);\n\t\t\tToast.makeText(AddContact.this, \"Added Successfully\",Toast.LENGTH_SHORT).show();\n\t\t\tCursor c=data.getData();\n\t\t\twhile(c.moveToNext())\n\t\t\t{\n\t\t\t\tString name1=c.getString(0);\n\t\t\t\tSystem.out.println(\"Name:\"+name1);\n\t\t\t\t\n\t\t\t}\n\t\t\tc.close();\n\t\t\tviewcontacts();\n \t}\n\t\t\n\t}", "public void validate_the_Preferred_Contact_Method_in_Contact_Details_of_Customer_Tab_Email(boolean status)throws Exception {\n\t\t\t\n\t\t\tboolean checked=VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Preferred Contact Method\").replaceAll(\"M_InnerText\", \"Email\"), \"Preferred Contact Method on Email \");\n\t\t\t\n\t\t\tif(checked==status)\n\t\t\t\tReport.fnReportPass(\"Preferred Contact Method - Email : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\telse\n\t\t\t\tReport.fnReportFail(\"Preferred Contact Method - Email : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\n\t\t\n\t}", "private void validateData() {\n }", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "abstract void telephoneValidity();", "public void validateMailAlerts() {\n System.out.println(\"Validating Mail Alerts\");\n boolean mailPasstoCheck = false, mailPassccCheck = false, mailFailtoCheck = false, mailFailccCheck = false;\n\n if (!mailpassto.getText().isEmpty()) {\n\n String[] emailAdd = mailpassto.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailPasstoCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". To Email address for passed test cases should not be empty.\\n\");\n\n }\n if (!mailpasscc.getText().isEmpty()) {\n String[] emailAdd = mailpasscc.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailPassccCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". CC Email address for passed test cases should not be empty.\\n\");\n\n }\n if (!mailfailto.getText().isEmpty()) {\n String[] emailAdd = mailfailto.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailFailtoCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". To Email address for failed test cases should not be empty.\\n\");\n\n }\n if (!mailfailcc.getText().isEmpty()) {\n String[] emailAdd = mailfailcc.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailFailccCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n } else {\n execptionData.append((++exceptionCount) + \".CC Email address for failed test cases should not be empty.\\n\");\n\n }\n\n if (mailPasstoCheck == true && mailPassccCheck == true && mailFailccCheck == true && mailFailtoCheck == true) {\n /*try {\n Properties connectionProperties = new Properties();\n String socketFactory_class = \"javax.net.ssl.SSLSocketFactory\"; //SSL Factory Class\n String mail_smtp_auth = \"true\";\n connectionProperties.put(\"mail.smtp.port\", port);\n connectionProperties.put(\"mail.smtp.socketFactory.port\", socketProperty);\n connectionProperties.put(\"mail.smtp.host\", hostSmtp.getText());\n connectionProperties.put(\"mail.smtp.socketFactory.class\", socketFactory_class);\n connectionProperties.put(\"mail.smtp.auth\", mail_smtp_auth);\n connectionProperties.put(\"mail.smtp.socketFactory.fallback\", \"false\");\n connectionProperties.put(\"mail.smtp.starttls.enable\", \"true\");\n Mail mail = new Mail(\"\");\n mail.createSession(fromMail.getText(), password.getText(), connectionProperties);\n mail.sendEmail(fromMail.getText(), mailpassto.getText(), mailpasscc.getText(), \"Test Mail from FACT\", \"Hi, This is the Test Mail for the FACT Tool\", \"\");\n mail.sendEmail(fromMail.getText(), mailfailto.getText(), mailfailcc.getText(), \"Test Mail from FACT\", \"Hi, This is the Test Mail for the FACT Tool\", \"\");*/\n mailAlertsCheck = true;\n /* } catch (IOException ex) {\n Logger.getLogger(ConfigFile.class.getName()).log(Level.SEVERE, null, ex);\n mailAlertsCheck = false;\n new ExceptionUI(ex);\n } catch (MessagingException ex) {\n Logger.getLogger(ConfigFile.class.getName()).log(Level.SEVERE, null, ex);\n mailAlertsCheck = false;\n new ExceptionUI(ex);\n }*/\n } else {\n mailAlertsCheck = false;\n mailPasstoCheck = false;\n mailPassccCheck = false;\n mailFailtoCheck = false;\n mailFailccCheck = false;\n }\n\n }", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private void alertBox_validation(String msg, final int validateflag) {\r\n\t\tAlertDialog.Builder validation_alert = new AlertDialog.Builder(this);\r\n\t\tvalidation_alert.setTitle(\"Information\");\r\n\t\tvalidation_alert.setMessage(msg);\r\n\t\tif (validateflag != 21) {\r\n\t\t\tvalidation_alert.setNeutralButton(\"OK\",\tnew DialogInterface.OnClickListener() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t\tif (validateflag != 0) {\r\n\t\t\t\t\t\tif (validateflag == 1) {\r\n\t\t\t\t\t\t\tmStreetNumberValue.requestFocus();\r\n\t\t\t\t\t\t}else if (validateflag == 3) {\r\n\t\t\t\t\t\t\tmCardNoValue1.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue2.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue3.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue4.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue1.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 7) {\r\n\t\t\t\t\t\t\tmCardNoValue4.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue4.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 8) {\r\n\t\t\t\t\t\t\tmExpirationDateValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 9) {\r\n\t\t\t\t\t\t\tmExpirationDateValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 10) {\r\n\t\t\t\t\t\t\tmCVVNoValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 11) {\r\n\t\t\t\t\t\t\tmCVVNoValue.setText(\"\");\r\n\t\t\t\t\t\t\tmCVVNoValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 15) {\r\n\t\t\t\t\t\t\tmZipCodeValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 19) {\r\n\t\t\t\t\t\t\tmCardNoValue1.getText().clear();\r\n\t\t\t\t\t\t\tmCardNoValue2.getText().clear();\r\n\t\t\t\t\t\t\tmCardNoValue3.getText().clear();\r\n\t\t\t\t\t\t\tmCardNoValue4.getText().clear();\r\n\t\t\t\t\t\t} else if (validateflag == 20) {\r\n\t\t\t\t\t\t\tmZipCodeValue.getText().clear();\r\n\t\t\t\t\t\t\tmZipCodeValue.requestFocus();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdialog.dismiss();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tvalidation_alert.setPositiveButton(\"Yes\",new DialogInterface.OnClickListener() {\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t\t// Calling funtion to save fields\r\n\t\t\t\t\tsaveFields();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvalidation_alert.setNegativeButton(\"No\",new DialogInterface.OnClickListener() {\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvalidation_alert.show();\r\n\t}", "private boolean validateData() {\n if (!mCommon.validateData()) return false;\n\n Core core = new Core(this);\n\n // Due Date is required\n if (TextUtils.isEmpty(getRecurringTransaction().getDueDateString())) {\n core.alert(R.string.due_date_required);\n return false;\n }\n\n if (TextUtils.isEmpty(mCommon.viewHolder.dateTextView.getText().toString())) {\n core.alert(R.string.error_next_occurrence_not_populate);\n\n return false;\n }\n\n // Payments Left must have a value\n if (getRecurringTransaction().getPaymentsLeft() == null) {\n core.alert(R.string.payments_left_required);\n return false;\n }\n return true;\n }", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validate_the_Preferred_Contact_Method_in_Contact_Details_of_Customer_Tab_Mail(boolean status)throws Exception {\n\t\t\t\n\t\t\tboolean checked=VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Preferred Contact Method\").replaceAll(\"M_InnerText\", \"Mail\"), \"Preferred Contact Method on Mail \");\n\t\t\t\n\t\t\tif(checked==status)\n\t\t\t\tReport.fnReportPass(\"Preferred Contact Method - Mail : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\telse\n\t\t\t\tReport.fnReportFail(\"Preferred Contact Method - Mail : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\n\t\t\n\t}", "void telephoneValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"+391111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"1111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"111 1111111\");\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data\n person.setTelephone(\"AAA\");\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "private boolean validateForm() {\n Boolean validFlag = true;\n String email = emailTxt.getText().toString().trim();\n String name = nameTxt.getText().toString().trim();\n String phone = phoneTxt.getText().toString().trim();\n String password = passwordTxt.getText().toString();\n String confirPassWord = confirmPasswordTxt.getText().toString();\n\n Pattern emailP = Pattern.compile(\"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\", Pattern.CASE_INSENSITIVE);\n Matcher emailM = emailP.matcher(email);\n boolean emailB = emailM.find();\n\n if (TextUtils.isEmpty(email) || email.equals(\"\") || !emailB) {\n emailTxt.setError(\"Email bị để trống hoặc không dúng định dạng.\");\n validFlag = false;\n } else {\n emailTxt.setError(null);\n }\n\n if (TextUtils.isEmpty(password) || password.length() < 6) {\n passwordTxt.setError(\"Mật khẩu phải 6 ký tự trở lên\");\n validFlag = false;\n } else {\n passwordTxt.setError(null);\n }\n\n Pattern phoneP = Pattern.compile(\"[0-9]{8,15}$\");\n Matcher phoneM = phoneP.matcher(phone);\n boolean phoneB = phoneM.find();\n\n if (TextUtils.isEmpty(phone) || phone.length() < 8 || phone.length() > 15 || !phoneB) {\n phoneTxt.setError(\"Số điện thoại bị để trống hoặc không đúng định dạng\");\n validFlag = false;\n } else {\n phoneTxt.setError(null);\n }\n if (confirPassWord.length() < 6 || !confirPassWord.equals(password)) {\n confirmPasswordTxt.setError(\"Xác nhận mật khẩu không đúng\");\n validFlag = false;\n } else {\n confirmPasswordTxt.setError(null);\n }\n\n Pattern p = Pattern.compile(\"[0-9]\", Pattern.CASE_INSENSITIVE);\n Matcher m = p.matcher(name);\n boolean b = m.find();\n if (b) {\n nameTxt.setError(\"Tên tồn tại ký tự đặc biệt\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n if (TextUtils.isEmpty(name)) {\n nameTxt.setError(\"Không được để trống tên.\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n\n return validFlag;\n }", "public void validate_the_Telephone_Home_in_Contact_Details_of_Customer_Tab(String TelephoneHome)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneHome.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Home\").replaceAll(\"M_InnerText\", TelephoneHome), \"Telephone - Home - \"+TelephoneHome, false);\n\t}", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "void validateMobileNumber(String stringToBeValidated,String name);", "private void ValidateEditTextFields() {\n\tfor (int i = 0; i < etArray.length; i++) {\n\t if (etArray[i].getText().toString().trim().length() <= 0) {\n\t\tvalidCustomer = false;\n\t\tetArray[i].setError(\"Blank Field\");\n\t }\n\t}\n\n\tif (etPhoneNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etPhoneNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (etEmergencyNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etEmergencyNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (calendarDob == null) {\n\t validCustomer = false;\n\t}\n }", "private boolean checkInfo()\n {\n boolean flag = true;\n if(gName.isEmpty())\n {\n groupName.setError(\"Invalid name\");\n flag = false;\n }\n if(gId.isEmpty())\n {\n groupId.setError(\"Invalid id\");\n flag = false;\n }\n if(gAddress.isEmpty())\n {\n groupAddress.setError(\"Invalid address\");\n flag = false;\n }\n\n for(char c : gName.toCharArray()){\n if(Character.isDigit(c)){\n groupName.setError(\"Invalid Name\");\n flag = false;\n groupName.requestFocus();\n }\n }\n\n if(groupType.isEmpty())\n {\n flag = false;\n rPublic.setError(\"Choose one option\");\n }\n\n if(time.isEmpty())\n time = \"not set\";\n\n if(groupDescription.getText().toString().length()<20||groupDescription.getText().toString().length()>200)\n groupDescription.setError(\"Invalid description\");\n\n return flag;\n }", "public void validate_the_Preferred_Contact_Method_in_Contact_Details_of_Customer_Tab_SMS(boolean status)throws Exception {\n\t\t\t\n\t\t\tboolean checked=VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Preferred Contact Method\").replaceAll(\"M_InnerText\", \"SMSPreference\"), \"Preferred Contact Method on SMS \");\n\t\t\t\n\t\t\tif(checked==status)\n\t\t\t\tReport.fnReportPass(\"Preferred Contact Method - SMS : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\telse\n\t\t\t\tReport.fnReportFail(\"Preferred Contact Method - SMS : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\n\t\t\n\t}", "private void checkFields() {\n\t\t\n\t\tboolean errors = false;\n\t\t\n\t\t// contact name\n\t\tString newName = ((TextView) findViewById(R.id.tvNewContactName)).getText().toString();\n\t\tTextView nameErrorView = (TextView) findViewById(R.id.tvContactNameError);\n\t\tif(newName == null || newName.isEmpty()) {\n\t\t\terrors = true;\n\t\t\tnameErrorView.setText(\"Contact must have a name!\");\n\t\t} else {\n\t\t\tnameErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact phone number\n\t\tString newPhone = ((TextView) findViewById(R.id.tvNewContactPhone)).getText().toString();\n\t\tTextView phoneNumberErrorView = (TextView) findViewById(R.id.tvContactPhoneError);\n\t\tif(newPhone == null || newPhone.isEmpty()) {\n\t\t\terrors = true;\n\t\t\tphoneNumberErrorView.setText(\"Contact must have a phone number!\");\n\t\t} else {\n\t\t\tphoneNumberErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact e-mail\n\t\tString newEmail= ((TextView) findViewById(R.id.tvNewContactEmail)).getText().toString();\n\t\tTextView emailErrorView = (TextView) findViewById(R.id.tvContactEmailError);\n\t\tif(newEmail == null || newEmail.isEmpty()) {\n\t\t\terrors = true;\n\t\t\temailErrorView.setText(\"Contact must have an E-mail!\");\n\t\t} else if (!newEmail.matches(\".+@.+\\\\..+\")) {\n\t\t\terrors = true;\n\t\t\temailErrorView.setText(\"Invalid E-mail address! Example:\"\n\t\t\t\t\t+ \"[email protected]\");\n\t\t} else {\n\t\t\temailErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact note\n\t\tString newNote = ((TextView) findViewById(R.id.tvNewContactNote)).getText().toString();\n\t\t\n\t\t// contact Facebook profile address\n\t\tString newAddress = ((TextView) findViewById(R.id.tvNewContactAddress)).getText().toString();\n\t\t\n\t\t// save the new contact if all the required fields are filled out\n\t\tif(!errors) {\n\t\t\tif(newNote == null || newNote.isEmpty()) {\n\t\t\t\tnewNote = \"No note.\";\n\t\t\t}\n\t\t\t\n\t\t\tif(newAddress == null || newAddress.isEmpty()) {\n\t\t\t\tnewAddress = \"No address.\";\n\t\t\t}\n\t\t\tHomeActivity.listOfContacts.add(new Contact(newName, newPhone, newEmail, \n\t\t\t\t\tnewNote, newAddress));\n\t\t\tIntent intent = new Intent(AddContactActivity.this, HomeActivity.class);\n\t\t\tstartActivity(intent);\n\t\t}\n\t}", "private boolean validateInputInfo(){\n\n //Get user input\n String firstName = newContactFirstName.getText().toString();\n String lastName = newContactLastName.getText().toString();\n String email = newContactEmailAddress.getText().toString();\n String phone = newContactPhoneNumber.getText().toString();\n\n //Check to make sure no boxes were left empty\n if(firstName.isEmpty() || lastName.isEmpty() || email.isEmpty() || phone.isEmpty()){\n Toast.makeText(this, \"You must fill all fields before continuing!\", Toast.LENGTH_LONG).show();\n return false;\n }\n //Check to see if phone number is valid\n else if(!(phone.length() >= 10)){\n Toast.makeText(this, \"Make sure to input a valid 10 digit phone number!\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n return true;\n }", "public static void validation() {\n\t\tif ((!textFieldName.getText().isEmpty()) && (!textField_FirstName.getText().isEmpty())\n\t\t\t\t&& (!textField_Town.getText().isEmpty()) && (!textField_Town.getText().isEmpty())) {\n\n\t\t\tif ((isValidEmailAddress(textField_Email.getText()) == true)) {\n\t\t\t\ttextField_Email.setBackground(Color.white);\n\t\t\t\tif ((force(textField_Mtp.getText()) > 82)) {\n\t\t\t\t\ttextField_Mtp.setBackground(Color.white);\n\t\t\t\t\tactionGiveServeur();\n\n\t\t\t\t} else {\n\t\t\t\t\tshowMessageDialog(null, \"Votre mot de passe est trop faible\");\n\t\t\t\t\ttextField_Mtp.setText(\"Mot de passe trop simple : changer le \");\n\t\t\t\t\ttextField_Mtp.setBackground(Color.RED);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextField_Email.setText(\"Email invalide\");\n\t\t\t\ttextField_Email.setBackground(Color.RED);\n\t\t\t\tshowMessageDialog(null, \"Email est invalide\");\n\t\t\t}\n\t\t} else {\n\n\t\t\tshowMessageDialog(null, \"Certain champs sont vide !\");\n\t\t}\n\t}", "private boolean validate(){\n\n String MobilePattern = \"[0-9]{10}\";\n String name = String.valueOf(userName.getText());\n String number = String.valueOf(userNumber.getText());\n\n\n if(name.length() > 25){\n Toast.makeText(getApplicationContext(), \"pls enter less the 25 characher in user name\",\n Toast.LENGTH_SHORT).show();\n return true;\n }\n\n\n\n else if(name.length() == 0 || number.length() == 0 ){\n Toast.makeText(getApplicationContext(), \"pls fill the empty fields\",\n Toast.LENGTH_SHORT).show();\n return false;\n }\n\n\n\n else if(number.matches(MobilePattern))\n {\n\n return true;\n }\n else if(!number.matches(MobilePattern))\n {\n Toast.makeText(getApplicationContext(), \"Please enter valid 10\" +\n \"digit phone number\", Toast.LENGTH_SHORT).show();\n\n\n return false;\n }\n\n return false;\n\n }", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validateInput(){\n Window owner=root.getScene().getWindow();\n inputFileds.addAll(txtfn,txtln,txtsurname,txtDOB,txtResidence,txtMobile,txtID,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().isEmpty()){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n inputFileds.removeAll(txtDOB,txtMobile,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().length()>30){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Sorry the text you entered can not be greater that 30 characters\",\"Text too Long\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n if(username.getText().length()>20 || username.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Username has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid input\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n if(pass.getText().isEmpty()){\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n if(pass.getText().length()>20 || pass.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Password has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n SimpleDateFormat yearFormat = new SimpleDateFormat(\"yyyy\");\n try {\n date = dateFormat.parse(txtDOB.getText());\n Calendar cal=Calendar.getInstance();\n int year=Integer.parseInt(yearFormat.format(date));\n if (year <= 1900 || year>cal.get(Calendar.YEAR)) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n String initialEntry=txtDOB.getText();\n String parsedValue=dateFormat.format(date);\n if(!initialEntry.equals(parsedValue)){\n Dialog.showMessageDialog(owner, \"Note your Date of Birth has been corrected\", \"Date Corrected\",DialogIcon.INFORMATION);\n }\n txtDOB.setText(dateFormat.format(date));\n } catch (ParseException ex) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n try {\n int mobile=Integer.parseInt(txtMobile.getText());\n } catch (NumberFormatException e) {\n Dialog.showMessageDialog(owner, \"Invalid Mobile Number\", \"Invalid data\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n if(txtMobile.getText().length() != 10){\n Dialog.showMessageDialog(owner, \"Sorry your Mobile Number is invalid\", \"Invalid input\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n String sql=\"select Username,Password from users where Username=?\";\n try(PreparedStatement prstmt=con.prepareStatement(sql)) {\n prstmt.setString(1, username.getText());\n ResultSet rs=prstmt.executeQuery();\n if(rs.next()){\n Dialog.showMessageDialog(owner, \"Sorry Username already exists\\n Please change to different Username\", \"Username Exists\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n rs.close();\n } catch (SQLException e) {\n System.err.println(e);\n }\n return true;\n }", "@Override\n\tpublic Boolean isValidApplication(ApplicationBean applicationBean) {\n\t\tPattern namePattern=Pattern.compile(\"^[A-Za-z\\\\s]{3,}$\");\n\t\tMatcher nameMatcher=namePattern.matcher(applicationBean.getName());\n\t\tPattern dobPattern=Pattern.compile(\"^[0-3]?[0-9].[0-3]?[0-9].(?:[0-9]{2})?[0-9]{2}$\");\n\t\tMatcher dobMatcher=dobPattern.matcher(applicationBean.getDateOfBirth());\n\t\tPattern goalPattern=Pattern.compile(\"^[A-Za-z\\\\s]{1,}$\");\n\t\tMatcher goalMatcher=goalPattern.matcher(applicationBean.getGoals());\n\t\tPattern marksPattern=Pattern.compile(\"^[1-9][0-9]?$|^100$\");\n\t\tMatcher marksMatcher=marksPattern.matcher(applicationBean.getMarksObtained());\n\t\tPattern scheduleIdPattern=Pattern.compile(\"^[0-9]{1,2}$\");\n\t\tMatcher scheduleIdMatcher=scheduleIdPattern.matcher(applicationBean.getScheduledProgramID());\n\t\tPattern emailPattern=Pattern.compile(\"^[A-Za-z0-9+_.-]+@(.+)$\");\n\t\tMatcher emailMatcher=emailPattern.matcher(applicationBean.getEmailID());\n\t\t\n\t\t\n\t\tif(!(nameMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nApplicant Name Should Be In Alphabets and minimum 1 characters long.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(dobMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nDate of birth should be in DD/MM/YYYY format.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(goalMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\n Goal should be alphabetical and having minimum one letter\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(marksMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nMarks should be less than 100\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(scheduleIdMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nSchedule Id should be of one or two digit\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(emailMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nEnter valid email address\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "@Test\n\t\tvoid givenEmail_CheckForValidationForMobile_RetrunTrue() {\n\t\t\tboolean result = ValidateUserDetails.validateMobile(\"98 9808229348\");\n\t\t\tAssertions.assertTrue(result);\n\t\t}", "public boolean validation(){\n String Venuename= venuename.getText().toString();\n String Address= address.getText().toString();\n String Details= details.getText().toString();\n String Venueimage= venueimage.getText().toString();\n if(Venuename.isEmpty()){\n venuename.setError(\"Please enter the item name\");\n venuename.requestFocus();\n return false;\n }\n if(Address.isEmpty()){\n address.setError(\"Please enter the item name\");\n address.requestFocus();\n return false;\n }\n if(Details.isEmpty()){\n details.setError(\"Please enter the item name\");\n details.requestFocus();\n return false;\n }\n if(Venueimage.isEmpty()){\n venueimage.setError(\"Please Select the image first\");\n return false;\n }\n\n\n return true;\n }", "protected void validateMobileNumber(){\n /*\n Checking For Mobile number\n The Accepted Types Are +00 000000000 ; +00 0000000000 ;+000 0000000000; 0 0000000000 ; 00 0000000000\n */\n Boolean mobileNumber = Pattern.matches(\"^[0]?([+][0-9]{2,3})?[-][6-9]+[0-9]{9}\",getMobileNumber());\n System.out.println(mobileNumberResult(mobileNumber));\n }", "protected void validateEmail(){\n\n //Creating Boolean Value And checking More Accurate Email Validator Added\n\n Boolean email = Pattern.matches(\"^[A-Za-z]+([.+-]?[a-z A-z0-9]+)?@[a-zA-z0-9]{1,6}\\\\.[a-zA-Z]{2,6},?([.][a-zA-z+,]{2,6})?$\",getEmail());\n System.out.println(emailResult(email));\n }", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "@Override\n public void validate() {\n boolean b = false;\n\n //retrieving the contact us form details from request object\n String firstName = objContactUsForm.getName().trim();\n String email = objContactUsForm.getEmail().trim();\n String message = objContactUsForm.getMessage().trim();\n\n //now validating each of the field\n if (firstName.isEmpty()) {\n addFieldError(\"name\", getText(\"name.required\"));\n b = true;\n }\n\n if (email.isEmpty()) {\n addFieldError(\"email\", getText(\"email.required\"));\n b = true;\n }\n if (!b) {\n Pattern p = Pattern.compile(\".+@.+\\\\.[a-z]+\");\n Matcher m = p.matcher(email);\n boolean matchFound = m.matches();\n if (!matchFound) {\n addFieldError(\"email\", \"Please Provide Valid Email ID\");\n }\n }\n\n if (message.isEmpty()) {\n addFieldError(\"message\", getText(\"message.required\"));\n b = true;\n }\n\n if (!b) {\n boolean matches = message.matches(\"[<>!~@$%^&\\\"|!\\\\[#$]\");\n if (matches) {\n addFieldError(\"message\", \"Please Provide Valid Message Name\");\n b = true;\n }\n }\n }", "private boolean isInputValid() {\n String errorMessage = \"\";\n\n if (ServiceName.getText() == null || ServiceName.getText().length() == 0) {\n errorMessage += \"No valid name!\\n\";\n }\n if (Serviceemail.getText() == null || Serviceemail.getText().length() == 0) {\n Pattern p = Pattern.compile(\"[_A-Za-z0-9][A-Za-z0-9._]*?@[_A-Za-z0-9]+([.][_A-Za-z]+)+\");\n Matcher m = p.matcher(Serviceemail.getText());\n if (m.find() && m.group().equals(Serviceemail.getText())) {\n errorMessage += \"No valid Mail Forment!\\n\";\n }\n }\n if (servicedescrip.getText() == null || servicedescrip.getText().length() == 0) {\n errorMessage += \"No valid description !\\n\";\n }\n if (f == null && s.getImage() == null) {\n errorMessage += \"No valid photo ( please upload a photo !)\\n\";\n }\n if (Serviceprice.getText() == null || Serviceprice.getText().length() == 0) {\n errorMessage += \"No valid prix !\\n\";\n } else {\n // try to parse the postal code into an int.\n try {\n Float.parseFloat(Serviceprice.getText());\n } catch (NumberFormatException e) {\n errorMessage += \"No valid prix (must be a Float)!\\n\";\n }\n }\n if ( !Weekly.isSelected() && !Daily.isSelected() && !Monthly.isSelected()) {\n errorMessage += \"No valid Etat ( select an item !)\\n\";\n }\n if (Servicesatet.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid etat ( select an item !)\\n\";\n }\n if (ServiceCity.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid City ( select an item !)\\n\";\n }\n if (servicetype.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid Type ( select an item !)\\n\";\n }\n if (errorMessage.length() == 0) {\n return true;\n } else {\n // Show the error message.\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Invalid Fields\");\n alert.setHeaderText(\"Please correct invalid fields\");\n alert.setContentText(errorMessage);\n alert.showAndWait();\n return false;\n }\n }", "@Test\r\n\tpublic void view3_COEs_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\t\t//Table 3 - Data .\r\n\t\tList<WebElement> data_of_table3 = driver.findElements(view3_COEs_table_data_val);\r\n\t\t//Table 3 - Columns\r\n\t\tList<WebElement> col_of_table3 = driver.findElements(By.xpath(view3_curr_agent_stats_col));\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> updated_col_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t\r\n\t\t//Adding Column data from another table.\r\n\t\tdata_of_table3 = helper.modify_cols_data_of_table(col_of_table1, data_of_table3, updated_col_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table3, data_of_table3 );\r\n\t}", "public static void validate() {\r\n\t\tfrmMfhEmailer.validate();\r\n\t}", "public boolean Validate() \r\n {\n return phoneNumber.matcher(getText()).matches();\r\n }", "private void checkValidation() {\n String getInstituteName = NameofInstitute.getText().toString();\n String getDegreename = SpinnerDegree.getSelectedItem().toString();\n\n\n // Check if all strings are null or not\n if (getInstituteName.equals(\"\") || getInstituteName.length() == 0 || getDegreename.equals(\"\") || getDegreename.length() == 0)\n new CustomToast().Show_Toast(getActivity(), getView(),\"All fields are required.\");\n // Else do signup or do your stuff\n else {\n //Toast.makeText(getActivity(), \"All Ok till Now\", Toast.LENGTH_SHORT).show();\n AddQualifications(getDegreename,getInstituteName);\n }\n\n }", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "boolean validateInput() {\n if (etFullname.getText().toString().equals(\"\")) {\n etFullname.setError(\"Please Enter Full Name\");\n return false;\n }\n if (etId.getText().toString().equals(\"\")) {\n etId.setError(\"Please Enter ID\");\n return false;\n }\n if (etEmail.getText().toString().equals(\"\")) {\n etEmail.setError(\"Please Enter Email\");\n return false;\n }\n if (etHall.getText().toString().equals(\"\")) {\n etHall.setError(\"Please Enter Hall Name\");\n return false;\n }\n if (etAge.getText().toString().equals(\"\")) {\n etAge.setError(\"Please Enter Age\");\n return false;\n }\n if (etPhone.getText().toString().equals(\"\")) {\n etPhone.setError(\"Please Enter Contact Number\");\n return false;\n }\n if (etPassword.getText().toString().equals(\"\")) {\n etPassword.setError(\"Please Enter Password\");\n return false;\n }\n\n // checking the proper email format\n if (!isEmailValid(etEmail.getText().toString())) {\n etEmail.setError(\"Please Enter Valid Email\");\n return false;\n }\n\n // checking minimum password Length\n if (etPassword.getText().length() < MIN_PASSWORD_LENGTH) {\n etPassword.setError(\"Password Length must be more than \" + MIN_PASSWORD_LENGTH + \"characters\");\n return false;\n }\n\n\n return true;\n }", "private boolean validate(String name, String phone, String email, String description) {\n if (name.equals(null) || name.equals(\"\") || !isValidMobile(phone) || !isValidMail(email) || description.equals(null) || description.equals(\"\")) {\n\n if (name.equals(null) || name.equals(\"\")) {\n nameText.setError(\"Enter a valid Name\");\n } else {\n nameText.setError(null);\n }\n if (!isValidMobile(phone)) {\n phoneNumber.setError(\"Enter a valid Mobile Number\");\n } else {\n phoneNumber.setError(null);\n }\n if (!isValidMail(email)) {\n emailText.setError(\"Enter a valid Email ID\");\n } else {\n emailText.setError(null);\n }\n if (description.equals(null) || description.equals(\"\")) {\n descriptionText.setError(\"Add few lines about you\");\n } else {\n descriptionText.setError(null);\n }\n return false;\n } else\n return true;\n }", "public void validate_the_Telephone_Mobile_in_Contact_Details_of_Customer_Tab(String TelephoneMobile)throws Exception {\n\t\tReport.fnReportPageBreak(\"Telephone Details\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneMobile.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Mobile\").replaceAll(\"M_InnerText\", TelephoneMobile), \"Telephone - Mobile - \"+TelephoneMobile, false);\n\t}", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public boolean validateFields(Customer customer) {\r\n if (isEmpty(customer.getFirstName(), customer.getLastName(), customer.getPhoneNum(),\r\n customer.getEmail(), customer.getDate())) {\r\n Alert alert = new Alert(Alert.AlertType.WARNING);\r\n alert.setTitle(\"Invalid info\");\r\n alert.setHeaderText(null);\r\n alert.setContentText(\"Invalid info.\\nAll fields must be filled.\");\r\n alert.showAndWait();\r\n return false;\r\n }\r\n return true;\r\n }", "@Test\r\n\tpublic void view3_current_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"Calls In Queue\";\r\n\t\t//Text on which we will fetch other tables columns\r\n\t\tString check_text = \"Agents\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table1 = driver.findElements(view3_Current_table_data_val);\r\n\t\t//Table 1 - Columns\r\n\t\tList<WebElement> col_of_table1 = driver.findElements(By.xpath(view3_curr_data_table));\r\n\t\t//Removing Column data from another table.\r\n\t\tdata_of_table1 = helper.modify_cols_data_of_table(col_of_table1, data_of_table1 , check_text );\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table1, data_of_table1 );\r\n\t}", "public void validateRpd11s7()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validate(){\n return EditorUtils.editTextValidator(generalnformation,etGeneralnformation,\"Type in information\") &&\n EditorUtils.editTextValidator(symptoms,etSymptoms, \"Type in symptoms\") &&\n EditorUtils.editTextValidator(management,etManagement, \"Type in management\");\n }", "public void onClick(View v1){\n EditText first_name_validate = (EditText)findViewById(R.id.first_name);\n String name = first_name_validate.getText().toString();\n\n //Setting String to validate the e-mail ID entry\n EditText emailValidate = (EditText)findViewById(R.id.email_id);\n String email = emailValidate.getText().toString().trim();\n String emailPattern = \"[a-zA-Z0-9._-]+@[a-z]+\\\\.+[a-z]+\";//String to check the e-mail pattern\n\n //Setting String to validate the phone number entry\n EditText phone_num_validate = (EditText)findViewById(R.id.phone_number);\n String phone_num = phone_num_validate.getText().toString();\n\n\n if (name.length()==0 || email.length()==0 || phone_num.length()==0)//Checking if any one of the compulsory fields is not filled\n Toast.makeText(getApplicationContext(),\"Fill the compulsory fields\", Toast.LENGTH_SHORT).show();\n\n else if (!(email.matches(emailPattern)))//Checking the e-mail pattern\n Toast.makeText(getApplicationContext(),\"Incorrect Email Format\", Toast.LENGTH_SHORT).show();\n\n else if(phone_num.length()!=10)//Checking the phone number length\n Toast.makeText(getApplicationContext(),\"Incorrect Phone Number\", Toast.LENGTH_SHORT).show();\n\n\n else//If everything is as required then message is displayed showing \"Registered for (Name of the Event)\"\n {\n Toast.makeText(getApplicationContext(), \"Registered for \"+data[pos][8], Toast.LENGTH_SHORT).show();\n finish();\n }\n }", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s13()\n {\n // This guideline cannot be automatically tested.\n }", "public void validate(DataRecord value) {\n\r\n\t}", "public boolean validatePersonalData() {\n\t\tif (firstName == null)\n\t\t\treturn false;\n\t\tif (lastName == null)\n\t\t\treturn false;\n\t\tif (phoneNum == null)\n\t\t\treturn false;\n\t\tif (email == null)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "public boolean validateData(){\n boolean dataOk=true;\n if (etName.getText().toString().equals(\"\")){\n Log.i(\"ProfileEditActivity\",\"Name field is void.\");\n dataOk=false;\n }\n if (etSurname.getText().toString().equals(\"\")){\n Log.i(\"ProfileEditActivity\",\"Surname field is void.\");\n dataOk=false;\n }\n if (etDescription.getText().toString().equals(\"\")){\n Log.i(\"ProfileEditActivity\",\"Description field is void.\");\n dataOk=false;\n }\n return dataOk;\n }", "private void getSponsorInfo(String sponsorCode){\r\n int resultConfirm =0;\r\n /**\r\n * Updated for REF ID :0003 Feb'21 2003.\r\n * Hour Glass implementation while DB Trsactions Wait\r\n * by Subramanya Feb' 21 2003\r\n */\r\n if( dlgWindow != null){\r\n dlgWindow.setCursor( new Cursor( Cursor.WAIT_CURSOR ) );\r\n }\r\n String sponsorName = rldxController.getSponsorName(sponsorCode);\r\n //Added for COEUSQA-1434 : Add the functionality to set a status on a Sponsor record - start\r\n String sponsorStatus = rldxController.getSponsorStatus();\r\n //Added for COEUSQA-1434 : Add the functionality to set a status on a Sponsor record - end\r\n if( dlgWindow != null ){\r\n dlgWindow.setCursor( new Cursor( Cursor.DEFAULT_CURSOR ) );\r\n }\r\n \r\n //Commented for case#3341 - Sponsor Code Validation - start\r\n// lblSponsorName.setText( trimSponsorName( sponsorName ) );\r\n// txtOrganization.requestFocus();\r\n //Commented for case#3341 - Sponsor Code Validation - end\r\n if ((sponsorName != null) && (!sponsorName.trim().equals(\"\")) && ! INACTIVE_STATUS.equalsIgnoreCase(sponsorStatus)){\r\n //Added for case#3341 - Sponsor Code Validation - start\r\n lblSponsorName.setText(trimSponsorName(sponsorName));\r\n txtOrganization.requestFocus();\r\n //Added for case#3341 - Sponsor Code Validation - end \r\n if ( (!txtOrganization.getText().trim().equals(\"\")) &&\r\n ( !sponsorName.equals(txtOrganization.getText().trim()) ) ){\r\n String msgStr = \"Do you want to overwrite the organization: \" +\r\n txtOrganization.getText().trim() + \" with \" + sponsorName + \"?\";\r\n resultConfirm = CoeusOptionPane.showQuestionDialog(msgStr,\r\n CoeusOptionPane.OPTION_YES_NO,\r\n CoeusOptionPane.DEFAULT_YES);\r\n if (resultConfirm == 0) {\r\n txtOrganization.setText(sponsorName.trim());\r\n }\r\n \r\n }else {\r\n txtOrganization.setText(sponsorName.trim());\r\n //do nothing\r\n }\r\n if (!txtSponsorCode.getText().trim().equals(\"\") ) {\r\n if ( !txtAddress1.getText().trim().equals(\"\") ||\r\n !txtAddress2.getText().trim().equals(\"\") ||\r\n !txtAddress3.getText().trim().equals(\"\") ||\r\n !txtCity.getText().trim().equals(\"\") ||\r\n !txtCounty.getText().trim().equals(\"\") ||\r\n //Commented for Case#4252 - Rolodex state dropdown associated with country - Start\r\n// !((ComboBoxBean)cmbCountry.getItemAt(\r\n// cmbCountry.getSelectedIndex())).getCode().trim().equals(\"USA\") ||\r\n //Case#4252 - End\r\n !txtPostalCode.getText().trim().equals(\"\") ||\r\n !txtPhone.getText().trim().equals(\"\") ||\r\n !txtEMail.getText().trim().equals(\"\") ||\r\n !txtFax.getText().trim().equals(\"\") ) {\r\n \r\n String msgStr =\r\n coeusMessageResources.parseMessageKey(\r\n \"roldxMntDetFrm_confirmationCode.1145\");\r\n resultConfirm = CoeusOptionPane.showQuestionDialog(msgStr,\r\n CoeusOptionPane.OPTION_YES_NO,\r\n CoeusOptionPane.DEFAULT_YES);\r\n if (resultConfirm == 0) {\r\n /* prompt the user for replacing base address on\r\n * confirmation replace the address\r\n */\r\n replaceWithSponsorBaseAdress(sponsorCode);\r\n }\r\n }else {\r\n replaceWithSponsorBaseAdress(sponsorCode);\r\n }\r\n }\r\n //Added for case#3341 - Sponsor Code Validation\r\n txtOrganization.requestFocus(); \r\n //Added for case#3341 - Sponsor Code Validation - start \r\n }else{\r\n lblSponsorName.setText(\"\");\r\n txtSponsorCode.setText(\"\");\r\n txtSponsorCode.requestFocus(); \r\n //Added for COEUSQA-1434 : Add the functionality to set a status on a Sponsor record - start\r\n txtOrganization.setText(CoeusGuiConstants.EMPTY_STRING); \r\n txtAddress1.setText(CoeusGuiConstants.EMPTY_STRING);\r\n txtAddress2.setText(CoeusGuiConstants.EMPTY_STRING);\r\n txtAddress3.setText(CoeusGuiConstants.EMPTY_STRING);\r\n //Added for COEUSQA-1434 : Add the functionality to set a status on a Sponsor record - end\r\n CoeusOptionPane.showInfoDialog(\r\n coeusMessageResources.parseMessageKey(\"roldxMntDetFrm_exceptionCode.1108\")); \r\n }\r\n //Added for case#3341 - Sponsor Code Validation - end\r\n isSponsorInfoRequired =false;\r\n //Commented for case#3341 - Sponsor Code Validation\r\n //txtOrganization.requestFocus(); \r\n }", "public void validateRpd13s17()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s9()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean tableDataValid()\r\n {\r\n // if there are any form level validations that should go there\r\n int rowTotal = tblProtoCorresp.getRowCount();\r\n int colTotal = tblProtoCorresp.getColumnCount();\r\n for (int rowIndex = 0; rowIndex < rowTotal ; rowIndex++)\r\n {\r\n for (int colIndex = 0; colIndex < colTotal; colIndex++)\r\n {\r\n TableColumn column = codeTableColumnModel.getColumn(colIndex) ;\r\n\r\n ColumnBean columnBean = (ColumnBean)column.getIdentifier() ;\r\n\r\n if (columnBean.getColumnEditable()\r\n && !columnBean.getColumnCanBeNull())\r\n {\r\n if ( tblProtoCorresp.getValueAt(rowIndex,colIndex) != null)\r\n {\r\n if (tblProtoCorresp.getValueAt(rowIndex,colIndex).equals(\"\")\r\n || tblProtoCorresp.getValueAt(rowIndex,colIndex).toString().trim().equals(\"\") )\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n else\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n }\r\n return true ;\r\n }", "public static void validate_Criteo_SDK_inapp_v2_call_param_value_with_gampad_param_value(String sheetName, String cust_param, boolean clearList) throws Exception {\n\n\t\t\tString[][] data = read_excel_data.exceldataread(sheetName);\n\t\tDeviceStatus device_status = new DeviceStatus();\n\t\tint Cap = device_status.Device_Status();\n\t\tString placementId = null;\n\t\tif (sheetName.equalsIgnoreCase(\"Pulltorefresh\")) {\n\t\t\tplacementId = \"weather.feed1\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Hourly\")) {\n\t\t\tplacementId = \"weather.hourly\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Feed1\")) {\n\t\t\tplacementId = \"weather.feed2\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Feed2\")) {\n\t\t\tplacementId = \"weather.feed3\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Feed3\")) {\n\t\t\tplacementId = \"weather.feed4\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Feed4\")) {\n\t\t\tplacementId = \"weather.feed5\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Feed5\")) {\n\t\t\tplacementId = \"weather.feed6\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Feed6\")) {\n\t\t\tplacementId = \"weather.feed6\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Feed7\")) {\n\t\t\tplacementId = \"weather.feed7\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Air Quality(Content)\")) {\n\t\t\tplacementId = \"weather.aq\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"SeasonalHub(Details)\")) {\n\t\t\tplacementId = \"weather.sh.details\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Today\")) {\n\t\t\tplacementId = \"weather.trending\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Daily(10day)\")) {\n\t\t\tplacementId = \"weather.dailydetails.largeAds.1\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Map\")) {\n\t\t\tplacementId = \"weather.maps\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"MyAlerts\")) {\n\t\t\tplacementId = \"weather.alerts.center\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"weather.alerts\")) {\n\t\t\tplacementId = \"weather.alerts\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Health(coldAndFluArticles)\")) {\n\t\t\t/*\n\t\t\t * News detils, flu articles, alergy articles has same placement Id, here anything can be used\n\t\t\t */\n\t\t\tplacementId = \"weather.articles\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Health(goRun)\")) {\n\t\t\tplacementId = \"content.run.largeAds\";\n\t\t} else if (sheetName.equalsIgnoreCase(\"Health(boatAndBeach)\")) {\n\t\t\tplacementId = \"content.beach.largeAds\";\n\t\t}\n\t\t\n\t\tString feedCall = null;\n\t\t// \"iu=%2F7646%2Fapp_iphone_us%2Fdb_display%2Fhome_screen%2Ftoday\";\n\t\tif (sheetName.equalsIgnoreCase(\"PreRollVideo\")) {\n\t\t\tfeedCall = videoIUValue;\n\t\t} /*\n\t\t\t * else if (sheetName.equalsIgnoreCase(\"IDD\")) { String today =\n\t\t\t * dailyDetailsDayOfWeek.concat(\"1\"); feedCall = readExcelValues.data[18][Cap];\n\t\t\t * feedCall = feedCall.concat(\"_\") + today; }\n\t\t\t */else {\n\t\t\t\t\tfeedCall = data[11][Cap];\n\t\t}\n\n\t\tboolean testpass = false;\n\t\tint failCount = 0;\n\n\t\tget_Criteo_SDK_inapp_v2_call_response_parameter_by_placementId(\"Criteo\", placementId, cust_param,\n\t\t\t\tclearList);\n\n\t\tif (criteocallsSize == 0) {\n\t\t\tSystem.out.println(\"Criteo call is not generated in current session, so skipping the \" + cust_param\n\t\t\t\t\t+ \" value verification\");\n\t\t\tlogStep(\"Criteo call is not generated in current session, so skipping the \" + cust_param\n\t\t\t\t\t+ \" value verification\");\n\n\t\t} else if (criteocallsResponseSize == 0) {\n\t\t\tSystem.out.println(\"Criteo call response doesn't have the placement id: \" + placementId\n\t\t\t\t\t+ \" i.e. bidding is not happened in current session, so skipping the \" + cust_param\n\t\t\t\t\t+ \" value verification\");\n\t\t\tlogStep(\"Criteo call response doesn't have the placement id: \" + placementId\n\t\t\t\t\t+ \" i.e. bidding is not happened in current session, so skipping the \" + cust_param\n\t\t\t\t\t+ \" value verification\");\n\n\t\t} else if (criteoparamErrorCount == criteocallsResponseSize) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"Criteo call response contains error i.e. bidding is not happened in current session, so skipping the \"\n\t\t\t\t\t\t\t+ cust_param + \" value verification\");\n\t\t\tlogStep(\"Criteo call response contains error i.e. bidding is not happened in current session, so skipping the \"\n\t\t\t\t\t+ cust_param + \" value verification\");\n\n\t\t} else if (nextGenIMadDisplayed && sheetName.equalsIgnoreCase(\"Pulltorefresh\")) {\n\t\t\t/*\n\t\t\t * There may be chances that gampad call might not generated.. for ex: when IM\n\t\t\t * ad displayed on home screen, then homescreen today call doesnt generate\n\t\t\t * \n\t\t\t */\n\t\t\tSystem.out.println(\"Since IM Ad displayed on App Launch, Homescreen Today call: \" + cust_param\n\t\t\t\t\t+ \" id validation is skipped\");\n\t\t\tlogStep(\"Since IM Ad displayed on App Launch, Homescreen Today call: \" + cust_param\n\t\t\t\t\t+ \" id validation is skipped\");\n\t\t} else {\n\t\t\tif (cust_param.contentEquals(\"displayUrl\")) {\n\t\t\t\tcust_param = \"displayurl\";\n\t\t\t}\n\t\t\tget_custom_param_values_from_gampadCalls(feedCall, \"crt_\" + cust_param);\n\t\t\tif (criteogampadcallcount == 0) {\n\t\t\t\tSystem.out.println(\"Ad Call :\" + feedCall + \" not found in charles session, hence Custom Parameter: \"\n\t\t\t\t\t\t+ cust_param + \" validation failed\");\n\t\t\t\tlogStep(\"Ad Call :\" + feedCall + \" not found in charles session, hence Custom Parameter: \" + cust_param\n\t\t\t\t\t\t+ \" validation failed\");\n\t\t\t\tAssert.fail(\"Ad Call :\" + feedCall + \" not found in charles session, hence Custom Parameter: \"\n\t\t\t\t\t\t+ cust_param + \" validation failed\");\n\t\t\t} else if (customParamsList.size() == 0) {\n\t\t\t\tSystem.out.println(\"Ad Call :\" + feedCall + \" not having Custom Parameter: \" + cust_param\n\t\t\t\t\t\t+ \", hence Custom Parameter: \" + cust_param + \" validation failed\");\n\t\t\t\tlogStep(\"Ad Call :\" + feedCall + \" not having Custom Parameter: \" + cust_param\n\t\t\t\t\t\t+ \", hence Custom Parameter: \" + cust_param + \" validation failed\");\n\t\t\t\tAssert.fail(\"Ad Call :\" + feedCall + \" not having Custom Parameter: \" + cust_param\n\t\t\t\t\t\t+ \", hence Custom Parameter: \" + cust_param + \" validation failed\");\n\t\t\t} else {\n\n\t\t\t\tint maxIterations = 0;\n\t\t\t\tif (listOf_criteo_Params.size() > customParamsList.size()) {\n\t\t\t\t\tmaxIterations = customParamsList.size();\n\t\t\t\t} else {\n\t\t\t\t\tmaxIterations = listOf_criteo_Params.size();\n\t\t\t\t}\n\n\t\t\t\tif (!sheetName.equalsIgnoreCase(\"Health(goRun)\")\n\t\t\t\t\t\t&& !sheetName.equalsIgnoreCase(\"Health(boatAndBeach)\")) {\n\t\t\t\t\tfor (int i = 0; i < maxIterations; i++) {\n\n\t\t\t\t\t\tif (listOf_criteo_Params.get(i).equalsIgnoreCase(\"-1\")) {\n\t\t\t\t\t\t\tif (listOf_criteo_Params.size() == 1) {\n\t\t\t\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\t\t\t\"It looks that the only Occurance of Criteo Call bidding is not happened..Hence skipping the further validation...inspect the charles response for more details\");\n\t\t\t\t\t\t\t\tlogStep(\"It looks that the only Occurance of Criteo Call bidding is not happened..Hence skipping the further validation...inspect the charles response for more details\");\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tSystem.out.println(\"It looks that: \" + i\n\t\t\t\t\t\t\t\t\t\t+ \" Occurance of Criteo Call bidding is not happened..Hence skipping the current instance validation...inspect the charles response for more details\");\n\t\t\t\t\t\t\t\tlogStep(\"It looks that: \" + i\n\t\t\t\t\t\t\t\t\t\t+ \" Occurance of Criteo Call bidding is not happened..Hence skipping the current instance validation...inspect the charles response for more details\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif (cust_param.equalsIgnoreCase(\"displayurl\")) {\n\n\t\t\t\t\t\t\t\tif (customParamsList.get(i).equalsIgnoreCase(\"-1\")) {\n\t\t\t\t\t\t\t\t\tSystem.out.println(i + \" Occurance of corresponding \" + sheetName + \" gampad call: \"\n\t\t\t\t\t\t\t\t\t\t\t+ feedCall + \" not having parameter \" + cust_param);\n\t\t\t\t\t\t\t\t\tlogStep(i + \" Occurance of corresponding \" + sheetName + \" gampad call: \" + feedCall\n\t\t\t\t\t\t\t\t\t\t\t+ \" not having parameter \" + cust_param);\n\t\t\t\t\t\t\t\t\tfailCount++;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tSystem.out.println(i + \" Occurance of Criteo call \" + cust_param + \" value: \"\n\t\t\t\t\t\t\t\t\t\t\t+ listOf_criteo_Params.get(i) + \" is matched with \" + i\n\t\t\t\t\t\t\t\t\t\t\t+ \" Occurance of corresponding \" + sheetName + \" gampad call \" + cust_param\n\t\t\t\t\t\t\t\t\t\t\t+ \" value: \" + customParamsList.get(i));\n\t\t\t\t\t\t\t\t\tlogStep(i + \" Occurance of Criteo call \" + cust_param + \" value: \"\n\t\t\t\t\t\t\t\t\t\t\t+ listOf_criteo_Params.get(i) + \" is matched with \" + i\n\t\t\t\t\t\t\t\t\t\t\t+ \" Occurance of corresponding \" + sheetName + \" gampad call \" + cust_param\n\t\t\t\t\t\t\t\t\t\t\t+ \" value: \" + customParamsList.get(i));\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (listOf_criteo_Params.get(i).equalsIgnoreCase(customParamsList.get(i))) {\n\n\t\t\t\t\t\t\t\t\tSystem.out.println(i + \" Occurance of Criteo call \" + cust_param + \" value: \"\n\t\t\t\t\t\t\t\t\t\t\t+ listOf_criteo_Params.get(i) + \" is matched with \" + i\n\t\t\t\t\t\t\t\t\t\t\t+ \" Occurance of corresponding \" + sheetName + \" gampad call \" + cust_param\n\t\t\t\t\t\t\t\t\t\t\t+ \" value: \" + customParamsList.get(i));\n\t\t\t\t\t\t\t\t\tlogStep(i + \" Occurance of Criteo call \" + cust_param + \" value: \"\n\t\t\t\t\t\t\t\t\t\t\t+ listOf_criteo_Params.get(i) + \" is matched with \" + i\n\t\t\t\t\t\t\t\t\t\t\t+ \" Occurance of corresponding \" + sheetName + \" gampad call \" + cust_param\n\t\t\t\t\t\t\t\t\t\t\t+ \" value: \" + customParamsList.get(i));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (customParamsList.get(i).equalsIgnoreCase(\"-1\")) {\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(i + \" Occurance of corresponding \" + sheetName\n\t\t\t\t\t\t\t\t\t\t\t\t+ \" gampad call: \" + feedCall + \" not having parameter \" + cust_param);\n\t\t\t\t\t\t\t\t\t\tlogStep(i + \" Occurance of corresponding \" + sheetName + \" gampad call: \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ feedCall + \" not having parameter \" + cust_param);\n\t\t\t\t\t\t\t\t\t\tfailCount++;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(i + \" Occurance of Criteo call \" + cust_param + \" value: \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ listOf_criteo_Params.get(i) + \" is not matched with \" + i\n\t\t\t\t\t\t\t\t\t\t\t\t+ \" Occurance of corresponding \" + sheetName + \" gampad call \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ cust_param + \" value: \" + customParamsList.get(i));\n\t\t\t\t\t\t\t\t\t\tlogStep(i + \" Occurance of Criteo call \" + cust_param + \" value: \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ listOf_criteo_Params.get(i) + \" is not matched with \" + i\n\t\t\t\t\t\t\t\t\t\t\t\t+ \" Occurance of corresponding \" + sheetName + \" gampad call \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ cust_param + \" value: \" + customParamsList.get(i));\n\t\t\t\t\t\t\t\t\t\tfailCount++;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tfor (int i = 0; i < maxIterations / 2; i++) {\n\n\t\t\t\t\t\tif (listOf_criteo_Params.get(i).equalsIgnoreCase(\"-1\")) {\n\t\t\t\t\t\t\tif (listOf_criteo_Params.size() == 1) {\n\t\t\t\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\t\t\t\"It looks that the only Occurance of Criteo Call bidding is not happened..Hence skipping the further validation...inspect the charles response for more details\");\n\t\t\t\t\t\t\t\tlogStep(\"It looks that the only Occurance of Criteo Call bidding is not happened..Hence skipping the further validation...inspect the charles response for more details\");\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tSystem.out.println(\"It looks that: \" + i\n\t\t\t\t\t\t\t\t\t\t+ \" Occurance of Criteo Call bidding is not happened..Hence skipping the current instance validation...inspect the charles response for more details\");\n\t\t\t\t\t\t\t\tlogStep(\"It looks that: \" + i\n\t\t\t\t\t\t\t\t\t\t+ \" Occurance of Criteo Call bidding is not happened..Hence skipping the current instance validation...inspect the charles response for more details\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (cust_param.equalsIgnoreCase(\"displayurl\")) {\n\n\t\t\t\t\t\t\t\tif (customParamsList.get(i + 1).equalsIgnoreCase(\"-1\")) {\n\t\t\t\t\t\t\t\t\tSystem.out.println(i + 1 + \" Occurance of corresponding \" + sheetName\n\t\t\t\t\t\t\t\t\t\t\t+ \" gampad call: \" + feedCall + \" not having parameter \" + cust_param);\n\t\t\t\t\t\t\t\t\tlogStep(i + 1 + \" Occurance of corresponding \" + sheetName + \" gampad call: \"\n\t\t\t\t\t\t\t\t\t\t\t+ feedCall + \" not having parameter \" + cust_param);\n\t\t\t\t\t\t\t\t\tfailCount++;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tSystem.out.println(i + \" Occurance of Criteo call \" + cust_param + \" value: \"\n\t\t\t\t\t\t\t\t\t\t\t+ listOf_criteo_Params.get(i) + \" is matched with \" + i + 1\n\t\t\t\t\t\t\t\t\t\t\t+ \" Occurance of corresponding \" + sheetName + \" gampad call \" + cust_param\n\t\t\t\t\t\t\t\t\t\t\t+ \" value: \" + customParamsList.get(i + 1));\n\t\t\t\t\t\t\t\t\tlogStep(i + \" Occurance of Criteo call \" + cust_param + \" value: \"\n\t\t\t\t\t\t\t\t\t\t\t+ listOf_criteo_Params.get(i) + \" is matched with \" + i + 1\n\t\t\t\t\t\t\t\t\t\t\t+ \" Occurance of corresponding \" + sheetName + \" gampad call \" + cust_param\n\t\t\t\t\t\t\t\t\t\t\t+ \" value: \" + customParamsList.get(i + 1));\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (listOf_criteo_Params.get(i).equalsIgnoreCase(customParamsList.get(i + 1))) {\n\n\t\t\t\t\t\t\t\t\tSystem.out.println(i + \" Occurance of Criteo call \" + cust_param + \" value: \"\n\t\t\t\t\t\t\t\t\t\t\t+ listOf_criteo_Params.get(i) + \" is matched with \" + i + 1\n\t\t\t\t\t\t\t\t\t\t\t+ \" Occurance of corresponding \" + sheetName + \" gampad call \" + cust_param\n\t\t\t\t\t\t\t\t\t\t\t+ \" value: \" + customParamsList.get(i + 1));\n\t\t\t\t\t\t\t\t\tlogStep(i + \" Occurance of Criteo call \" + cust_param + \" value: \"\n\t\t\t\t\t\t\t\t\t\t\t+ listOf_criteo_Params.get(i) + \" is matched with \" + i + 1\n\t\t\t\t\t\t\t\t\t\t\t+ \" Occurance of corresponding \" + sheetName + \" gampad call \" + cust_param\n\t\t\t\t\t\t\t\t\t\t\t+ \" value: \" + customParamsList.get(i + 1));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (customParamsList.get(i + 1).equalsIgnoreCase(\"-1\")) {\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(i + 1 + \" Occurance of corresponding \" + sheetName\n\t\t\t\t\t\t\t\t\t\t\t\t+ \" gampad call: \" + feedCall + \" not having parameter \" + cust_param);\n\t\t\t\t\t\t\t\t\t\tlogStep(i + 1 + \" Occurance of corresponding \" + sheetName + \" gampad call: \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ feedCall + \" not having parameter \" + cust_param);\n\t\t\t\t\t\t\t\t\t\tfailCount++;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(i + \" Occurance of Criteo call \" + cust_param + \" value: \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ listOf_criteo_Params.get(i) + \" is not matched with \" + i + 1\n\t\t\t\t\t\t\t\t\t\t\t\t+ \" Occurance of corresponding \" + sheetName + \" gampad call \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ cust_param + \" value: \" + customParamsList.get(i + 1));\n\t\t\t\t\t\t\t\t\t\tlogStep(i + \" Occurance of Criteo call \" + cust_param + \" value: \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ listOf_criteo_Params.get(i) + \" is not matched with \" + i + 1\n\t\t\t\t\t\t\t\t\t\t\t\t+ \" Occurance of corresponding \" + sheetName + \" gampad call \"\n\t\t\t\t\t\t\t\t\t\t\t\t+ cust_param + \" value: \" + customParamsList.get(i + 1));\n\t\t\t\t\t\t\t\t\t\tfailCount++;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tif (failCount > 0) {\n\t\t\tSystem.out.println(\"Criteo call \" + cust_param + \" values not matched with corresponding \" + sheetName\n\t\t\t\t\t+ \" gampad call \" + cust_param + \" values\");\n\t\t\tlogStep(\"Criteo call \" + cust_param + \" values not matched with corresponding \" + sheetName\n\t\t\t\t\t+ \" gampad call \" + cust_param + \" values\");\n\t\t\tAssert.fail(\"Criteo call \" + cust_param + \" values not matched with corresponding \" + sheetName\n\t\t\t\t\t+ \" gampad call \" + cust_param + \" values\");\n\t\t}\n\n\t}", "public void validateRpd13s6()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateInput(Information information) {\n information.validateFirstName();\n information.validateLastName();\n information.validateZipcode();\n information.validateEmployeeID();\n }", "@Test\r\n\tpublic void view3_todays_table_data_validation()\r\n\t{\t\r\n\t\t//Key on which we have to validate other values.\r\n\t\tString key = \"CML Service Level\";\r\n\r\n\t\t//Initialize Elements of tables and their columns data.\r\n\r\n\t\t//Table 1 - Data\r\n\t\tList<WebElement> data_of_table2 = driver.findElements(view3_todays_table_data_val);\r\n\t\t//Table 1 - Colums\r\n\t\tList<WebElement> col_of_table2 = driver.findElements(By.xpath(view3_today_data_table));\r\n\t\t//Validating N/A and integer for columns\r\n\t\thelper.data_validate_Down(driver, key , col_of_table2, data_of_table2 );\r\n\t}", "public void SetCreditCarddetails(String ccnumber, String ccname, String ccmonth, String ccyear, String ccseccode){\r\n\t\tString countrygroup_ccdetails= \"UK,PresselAustria\";\r\n\t\tString CCnum = getValue(ccnumber);\r\n\t\tString CCName = getValue(ccname);\r\n\t\tString CCMonth = getValue(ccmonth);\r\n\t\tString CCYear = getValue(ccyear);\r\n\t\tString CCSecCode = getValue(ccseccode);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+CCnum+\", \"+CCName+\", \"+CCMonth+\", \"+CCYear+\", \"+CCSecCode);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The CreditCard details should be entered\");\r\n\t\ttry{\r\n\t\t\tif(!(countrygroup_ccdetails).contains(countries.get(countrycount))){\r\n\t\t\t\tswitchframe(\"TokenizationPage\");\r\n\t\t\t\tsleep(2000);\r\n\t\t\t\tsendKeys(locator_split(\"txtCCnumber\"), CCnum);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCname\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCname\"), CCName);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCMonth\"), CCMonth);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCYear\"), CCYear);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCcode\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCcode\"), CCSecCode);\t\t\t\t\t\t\r\n\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The CreditCard details are entered\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The new CreditCard details are applicable to this \" +country);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- The CreditCard details are not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"One of the element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCnumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCname\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCMonth\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCYear\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCcode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" are not found\");\r\n\r\n\t\t}\r\n\t}", "@Override\n public boolean isValid(PhoneNumber phoneNumber) {\n String number = phoneNumber.getNumber();\n return isPhoneNumber(number) && number.startsWith(\"+380\") && number.length() == 13;\n }", "public Boolean validEntries() {\n String orderNumber = orderNo.getText();\n String planTime = plannedTime.getText();\n String realTime = actualTime.getText();\n String worker = workerSelected();\n String productType = productTypeSelected();\n Boolean validData = false;\n if (orderNumber.equals(\"\")) {\n warning.setText(emptyOrderNum);\n } else if (!Validation.isValidOrderNumber(orderNumber)) {\n warning.setText(invalidOrderNum);\n } else if (worker.equals(\"\")) {\n warning.setText(workerNotSelected);\n } else if (productType.equals(\"\")) {\n warning.setText(productTypeNotSelected);\n } else if (planTime.equals(\"\")) {\n warning.setText(emptyPlannedTime);\n } else if (!Validation.isValidPlannedTime(planTime)) {\n warning.setText(invalidPlannedTime);\n } else if (!actualTime.getText().isEmpty() && !Validation.isValidActualTime(realTime)) {\n warning.setText(invalidActualTime);\n } else if (comboStatus.getSelectionModel().isEmpty()) {\n warning.setText(emptyStatus);\n } else validData = true;\n return validData;\n }", "abstract void fiscalCodeValidity();", "public boolean validate() {\n String sDayCheck = sDayView.getText().toString();\n String eDayCheck = eDayView.getText().toString();\n String sTimeCheck = sTimeView.getText().toString();\n String eTimeCheck = eTimeView.getText().toString();\n\n if ((titleView.getText().toString().matches(\"\")) || (roomView.getText().toString().matches(\"\"))) {\n Toast.makeText(getApplicationContext(),\"Please fill in all fields.\",Toast.LENGTH_SHORT).show();\n return false;\n }\n\n if ((sDayCheck.length() != 10) ||\n (eDayCheck.length() != 10) ||\n (sTimeCheck.length() != 5) ||\n (eTimeCheck.length() != 5)) {\n Toast.makeText(getApplicationContext(),\"Please check your Date and Time fields.\",Toast.LENGTH_SHORT).show();\n return false;\n } else if ((sDayCheck.charAt(2) != '/') || (sDayCheck.charAt(5) != '/') ||\n (eDayCheck.charAt(2) != '/') || (eDayCheck.charAt(5) != '/')) {\n Toast.makeText(getApplicationContext(), \"Please check your Date fields.\", Toast.LENGTH_SHORT).show();\n return false;\n } else if ((sTimeCheck.charAt(2) != ':') || (eTimeCheck.charAt(2) != ':')) {\n Toast.makeText(getApplicationContext(), \"Please check your Time fields.\", Toast.LENGTH_SHORT).show();\n return false;\n }\n if (!endDateAfter(sDayCheck, eDayCheck)) {\n Toast.makeText(getApplicationContext(), \"End date must be on or after the Start date.\", Toast.LENGTH_SHORT).show();\n return false;\n }\n if (!endTimeAfter(sTimeCheck, eTimeCheck)) {\n Toast.makeText(getApplicationContext(), \"End time must be on or after the Start time.\", Toast.LENGTH_SHORT).show();\n return false;\n }\n if (isOutOfDate(eDayCheck)) {\n Toast.makeText(getApplicationContext(), \"End date must be on or after Today's Date.\", Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "private boolean Validate() {\n EditText titleText = findViewById(R.id.register_movie_title_txt);\n EditText yearText = findViewById(R.id.register_movie_year_txt);\n EditText ratingText = findViewById(R.id.register_movie_rating_txt);\n\n\n boolean is_filled_required_fields = false;\n is_filled_required_fields = titleText.getText().toString().length() > 0\n && yearText.getText().toString().length() > 0\n && ratingText.getText().toString().length() > 0;\n\n if (!is_filled_required_fields) {\n Snackbar mySnackbar = Snackbar.make(findViewById(R.id.activity_register_base_layout), \"Please fill required fields\", BaseTransientBottomBar.LENGTH_SHORT);\n mySnackbar.show();\n }\n return is_filled_required_fields;\n }", "private boolean validatePuchase() {\n if (TextUtils.isEmpty(editextPurchaseSupplierName.getText().toString())) {\n editextPurchaseSupplierName.setError(getString(R.string.supplier_name));\n editextPurchaseSupplierName.requestFocus();\n return false;\n }\n\n if (TextUtils.isEmpty(edittextPurchaseAmount.getText().toString())) {\n if (flowpurchaseReceivedOrPaid == 2) {\n edittextPurchaseAmount.setError(getString(R.string.menu_purchasePaid));\n edittextPurchaseAmount.requestFocus();\n\n } else {\n edittextPurchaseAmount.setError(getString(R.string.purchase_amount));\n edittextPurchaseAmount.requestFocus();\n }\n return false;\n }\n\n if (TextUtils.isEmpty(edittextPurchasePurpose.getText().toString())) {\n edittextPurchasePurpose.setError(getString(R.string.remark_bill_number));\n edittextPurchasePurpose.requestFocus();\n return false;\n }\n\n\n return true;\n }", "private void checkValidation() {\n // Get email id and password\n MainActivity.EmailAddress = emailid.getText().toString();\n finalPassword = password.getText().toString();\n\n // Check patter for email id\n Pattern p = Pattern.compile(Utils.regEx);\n\n Matcher m = p.matcher(MainActivity.EmailAddress);\n\n // Check for both field is empty or not\n if (MainActivity.EmailAddress.equals(\"\") || MainActivity.EmailAddress.length() == 0\n || finalPassword.equals(\"\") || finalPassword.length() == 0) {\n loginLayout.startAnimation(shakeAnimation);\n new CustomToast().Show_Toast(getActivity(), view,\n \"Enter both credentials.\");\n\n }\n // Check if email id is valid or not\n else if (!m.find())\n new CustomToast().Show_Toast(getActivity(), view,\n \"Your Email Id is Invalid.\");\n // Else do login and do your stuff\n else\n tryLoginUser();\n\n }", "public void validateRpd13s10()\n {\n // This guideline cannot be automatically tested.\n }", "public PaymentRequestPage paymentRequestPaymentAvailabilityValidation(String cashbackType,String cashbackValue,String rewardsValue) {\r\n\r\n\t\tString actual = \"\";\r\n\r\n\t\treportStep(\"About to validate the Cashback and Rewards Payment avilablity section in the payment Request page \", \"INFO\");\r\n\r\n\t\tswitch (cashbackType) {\r\n\r\n\t\tcase \"Only_Cashback\":\r\n\r\n\t\t\tvalidateTheElementPresence(cashbackAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, cashbackValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"Only_Rewards\":\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, rewardsValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase \"BothCashback_Rewards\":\r\n\r\n\t\t\tfloat cashbackAmount = Float.parseFloat(cashbackValue);\r\n\t\t\tfloat rewardsAmount = Float.parseFloat(rewardsValue);\r\n\t\t\tfloat totalAmount = cashbackAmount + rewardsAmount ;\r\n\r\n\t\t\tString strTotalAmount = Float.toString(totalAmount) + \"0\";\r\n\t\t\tString strOnlyCashbackAmount = Float.toString(cashbackAmount) + \"0\";\r\n\t\t\tString strOnlyRewardsAmount = Float.toString(rewardsAmount) + \"0\";\r\n\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\t\t\tvalidateTheElementPresence(cashbackText);\r\n\t\t\tvalidateTheElementPresence(rewardsText);\r\n\r\n\t\t\t//validate total cashback amount\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strTotalAmount);\r\n\r\n\t\t\t//validate only cashback amount\r\n\t\t\tactual = getText(cashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyCashbackAmount);\r\n\r\n\r\n\t\t\t//validate only rewards amount\r\n\t\t\tactual = getText(rewardsAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyRewardsAmount);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\r\n\t}", "public void validate() {}", "public void validateRpd14s1()\n {\n // This guideline cannot be automatically tested.\n }", "private void setupRequiredValidation() {\n requiredMafExpressions.put(FIELD_HUGO_SYMBOL, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_HUGO_SYMBOL, \"may not be blank\");\r\n requiredMafExpressions.put(FIELD_ENTREZ_GENE_ID, Pattern.compile(\"\\\\d+\")); // number\r\n requiredFieldDescriptions.put(FIELD_ENTREZ_GENE_ID, \"must be an integer number\");\r\n requiredMafExpressions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_TUMOR_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_TUMOR_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_VALIDATION_STATUS, Pattern.compile(\"Valid|Wildtype|Unknown|\\\\S?\"));\r\n requiredFieldDescriptions.put(FIELD_VALIDATION_STATUS, \"must be Valid, Wildtype, Unknown, or blank\");\r\n requiredMafExpressions.put(FIELD_CHROMOSOME, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_CHROMOSOME, \"must be one of: X, Y, M, 1-22, or full name of unassigned fragment\");\r\n setupMafSpecificChecks();\r\n }", "public void validateRpd13s2()\n {\n // This guideline cannot be automatically tested.\n }", "@Override\n public Boolean validate() throws EwpException {\n List<String> message = new ArrayList<String>();\n Map<EnumsForExceptions.ErrorDataType, String[]> dicError = new HashMap<EnumsForExceptions.ErrorDataType, String[]>();\n if (this.name == null) {\n message.add(AppMessage.NAME_REQUIRED);\n dicError.put(EnumsForExceptions.ErrorDataType.REQUIRED, new String[]{\"Name\"});\n }\n\n if (this.tenantStatus <= 0) {\n message.add(AppMessage.TENANT_STATUS_REQUIRED);\n dicError.put(EnumsForExceptions.ErrorDataType.REQUIRED, new String[]{\"Status\"});\n }\n if (message.isEmpty()) {\n return true;\n } else {\n throw new EwpException(new EwpException(\"Validation Exception in TENANT\"), EnumsForExceptions.ErrorType.VALIDATION_ERROR, message, EnumsForExceptions.ErrorModule.DATA_SERVICE, dicError, 0);\n }\n }", "@And(\"^Enter user phone and confirmation code$\")\t\t\t\t\t\n public void Enter_user_phone_and_confirmation_code() throws Throwable \t\t\t\t\t\t\t\n { \t\t\n \tdriver.findElement(By.id(\"phoneNumberId\")).sendKeys(\"01116844320\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvPhoneNext']/content/span\")).click();\n driver.findElement(By.id(\"code\")).sendKeys(\"172978\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvVerifyNext']/content/span\")).click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\t\t\n }", "private void validateInputParameters(){\n\n }", "private boolean validateForm() {\n\n String email = mEditTextViewEmail.getText().toString();\n if (TextUtils.isEmpty(email)) {\n mTextInputLayoutEmail.setError(\"Emaill Id Required\");\n Toast.makeText(MainActivity.this, \"Email field required\", Toast.LENGTH_SHORT).show();\n return false;\n } else if (!isEmailValid(email)) {\n mTextInputLayoutEmail.setError(\"A valid Email id is required\");\n return false;\n } else {\n mTextInputLayoutEmail.setError(null);\n }\n\n String password = mEditTextViewPassword.getText().toString();\n if (TextUtils.isEmpty(password)) {\n mTextInputLayoutPassword.setError(\"Password required\");\n Toast.makeText(MainActivity.this, \"Password field required\", Toast.LENGTH_SHORT).show();\n return false;\n } else if (!isPasswordValid(password)) {\n mTextInputLayoutPassword.setError(\"Password must be at least 6 characters\");\n return false;\n } else {\n mTextInputLayoutPassword.setError(null);\n }\n\n return true;\n }", "private void checkInvalidInformation(EditPlanDirectToManaged editPlanPage) throws Exception {\n //\n Reporter.log(\"Verifying Error Messages on Edit Plan Page\", true);\n editPlanPage.invalidEditPlanUpdate();\n softAssert.assertTrue(editPlanPage.verifyEditPlanErrorMessage());\n\n //Re-Enter correct details\n editPlanPage.updateAnnualHouseHoldincome(Constants.DEFAULT_ANNUAL_HOUSEHOLD_INCOME);\n editPlanPage.updateRetirementAge(Constants.DEFAULT_RETIREMENT_AGE + \"\");\n }" ]
[ "0.66528875", "0.65737826", "0.6491541", "0.63862056", "0.6292239", "0.62325186", "0.6221931", "0.6170555", "0.61422276", "0.6096212", "0.60486144", "0.59812194", "0.59754926", "0.597219", "0.59658045", "0.59584004", "0.5942546", "0.5935069", "0.5926927", "0.5923938", "0.5904912", "0.5902231", "0.59012854", "0.58901834", "0.5881865", "0.5873449", "0.5805788", "0.57953143", "0.57944447", "0.57903326", "0.5788245", "0.5788245", "0.5778785", "0.5774198", "0.576083", "0.57604134", "0.5757763", "0.5754575", "0.5754459", "0.5753321", "0.5742494", "0.5735736", "0.5729983", "0.57099044", "0.57034487", "0.5680257", "0.56693006", "0.56551003", "0.5655075", "0.56395847", "0.56368965", "0.56206805", "0.56197864", "0.561563", "0.56152797", "0.56135905", "0.5607803", "0.5605495", "0.56025624", "0.5598653", "0.55920815", "0.5589222", "0.55805165", "0.55734575", "0.5573239", "0.55617845", "0.554537", "0.5544993", "0.55397403", "0.5530421", "0.5529723", "0.55160344", "0.5514769", "0.5508021", "0.5504866", "0.5494643", "0.54881907", "0.5486282", "0.548456", "0.5483446", "0.5479915", "0.54768556", "0.54763013", "0.5475597", "0.5471899", "0.5470978", "0.5469944", "0.5468334", "0.54665184", "0.54637265", "0.54610157", "0.5455173", "0.54543847", "0.54459673", "0.54432106", "0.54423803", "0.5432683", "0.5429411", "0.54261655", "0.5426037" ]
0.59226567
20
Validation Functions Description : To validate the Preferred Contact Method in Contact Details of Customer Tab for Email Coded by :Rajan Created Data:23 Oct 2016 Last Modified Date: Modified By: Parameter:
public void validate_the_Preferred_Contact_Method_in_Contact_Details_of_Customer_Tab_Email(boolean status)throws Exception { boolean checked=VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll("M_Header", "Contact Details").replaceAll("M_Category", "Preferred Contact Method").replaceAll("M_InnerText", "Email"), "Preferred Contact Method on Email "); if(checked==status) Report.fnReportPass("Preferred Contact Method - Email : Checked status = "+status+"Display Status"+checked, driver); else Report.fnReportFail("Preferred Contact Method - Email : Checked status = "+status+"Display Status"+checked, driver); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Preferred_Contact_Method_in_Contact_Details_of_Customer_Tab_Mail(boolean status)throws Exception {\n\t\t\t\n\t\t\tboolean checked=VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Preferred Contact Method\").replaceAll(\"M_InnerText\", \"Mail\"), \"Preferred Contact Method on Mail \");\n\t\t\t\n\t\t\tif(checked==status)\n\t\t\t\tReport.fnReportPass(\"Preferred Contact Method - Mail : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\telse\n\t\t\t\tReport.fnReportFail(\"Preferred Contact Method - Mail : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\n\t\t\n\t}", "protected void validateEmail(){\n\n //Creating Boolean Value And checking More Accurate Email Validator Added\n\n Boolean email = Pattern.matches(\"^[A-Za-z]+([.+-]?[a-z A-z0-9]+)?@[a-zA-z0-9]{1,6}\\\\.[a-zA-Z]{2,6},?([.][a-zA-z+,]{2,6})?$\",getEmail());\n System.out.println(emailResult(email));\n }", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "@Override\n public void validate() {\n boolean b = false;\n\n //retrieving the contact us form details from request object\n String firstName = objContactUsForm.getName().trim();\n String email = objContactUsForm.getEmail().trim();\n String message = objContactUsForm.getMessage().trim();\n\n //now validating each of the field\n if (firstName.isEmpty()) {\n addFieldError(\"name\", getText(\"name.required\"));\n b = true;\n }\n\n if (email.isEmpty()) {\n addFieldError(\"email\", getText(\"email.required\"));\n b = true;\n }\n if (!b) {\n Pattern p = Pattern.compile(\".+@.+\\\\.[a-z]+\");\n Matcher m = p.matcher(email);\n boolean matchFound = m.matches();\n if (!matchFound) {\n addFieldError(\"email\", \"Please Provide Valid Email ID\");\n }\n }\n\n if (message.isEmpty()) {\n addFieldError(\"message\", getText(\"message.required\"));\n b = true;\n }\n\n if (!b) {\n boolean matches = message.matches(\"[<>!~@$%^&\\\"|!\\\\[#$]\");\n if (matches) {\n addFieldError(\"message\", \"Please Provide Valid Message Name\");\n b = true;\n }\n }\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "public void validate_the_Preferred_Contact_Method_in_Contact_Details_of_Customer_Tab_SMS(boolean status)throws Exception {\n\t\t\t\n\t\t\tboolean checked=VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Preferred Contact Method\").replaceAll(\"M_InnerText\", \"SMSPreference\"), \"Preferred Contact Method on SMS \");\n\t\t\t\n\t\t\tif(checked==status)\n\t\t\t\tReport.fnReportPass(\"Preferred Contact Method - SMS : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\telse\n\t\t\t\tReport.fnReportFail(\"Preferred Contact Method - SMS : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\n\t\t\n\t}", "public void validateMailAlerts() {\n System.out.println(\"Validating Mail Alerts\");\n boolean mailPasstoCheck = false, mailPassccCheck = false, mailFailtoCheck = false, mailFailccCheck = false;\n\n if (!mailpassto.getText().isEmpty()) {\n\n String[] emailAdd = mailpassto.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailPasstoCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". To Email address for passed test cases should not be empty.\\n\");\n\n }\n if (!mailpasscc.getText().isEmpty()) {\n String[] emailAdd = mailpasscc.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailPassccCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". CC Email address for passed test cases should not be empty.\\n\");\n\n }\n if (!mailfailto.getText().isEmpty()) {\n String[] emailAdd = mailfailto.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailFailtoCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". To Email address for failed test cases should not be empty.\\n\");\n\n }\n if (!mailfailcc.getText().isEmpty()) {\n String[] emailAdd = mailfailcc.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailFailccCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n } else {\n execptionData.append((++exceptionCount) + \".CC Email address for failed test cases should not be empty.\\n\");\n\n }\n\n if (mailPasstoCheck == true && mailPassccCheck == true && mailFailccCheck == true && mailFailtoCheck == true) {\n /*try {\n Properties connectionProperties = new Properties();\n String socketFactory_class = \"javax.net.ssl.SSLSocketFactory\"; //SSL Factory Class\n String mail_smtp_auth = \"true\";\n connectionProperties.put(\"mail.smtp.port\", port);\n connectionProperties.put(\"mail.smtp.socketFactory.port\", socketProperty);\n connectionProperties.put(\"mail.smtp.host\", hostSmtp.getText());\n connectionProperties.put(\"mail.smtp.socketFactory.class\", socketFactory_class);\n connectionProperties.put(\"mail.smtp.auth\", mail_smtp_auth);\n connectionProperties.put(\"mail.smtp.socketFactory.fallback\", \"false\");\n connectionProperties.put(\"mail.smtp.starttls.enable\", \"true\");\n Mail mail = new Mail(\"\");\n mail.createSession(fromMail.getText(), password.getText(), connectionProperties);\n mail.sendEmail(fromMail.getText(), mailpassto.getText(), mailpasscc.getText(), \"Test Mail from FACT\", \"Hi, This is the Test Mail for the FACT Tool\", \"\");\n mail.sendEmail(fromMail.getText(), mailfailto.getText(), mailfailcc.getText(), \"Test Mail from FACT\", \"Hi, This is the Test Mail for the FACT Tool\", \"\");*/\n mailAlertsCheck = true;\n /* } catch (IOException ex) {\n Logger.getLogger(ConfigFile.class.getName()).log(Level.SEVERE, null, ex);\n mailAlertsCheck = false;\n new ExceptionUI(ex);\n } catch (MessagingException ex) {\n Logger.getLogger(ConfigFile.class.getName()).log(Level.SEVERE, null, ex);\n mailAlertsCheck = false;\n new ExceptionUI(ex);\n }*/\n } else {\n mailAlertsCheck = false;\n mailPasstoCheck = false;\n mailPassccCheck = false;\n mailFailtoCheck = false;\n mailFailccCheck = false;\n }\n\n }", "void validate(String email);", "@Test(groups ={Slingshot,Regression})\n\tpublic void ValidateAdduserEmailidField() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify the Email address Field validations and its appropriate error message\"); \t \t \t \n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMVTestDataspl\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ClickAddNewUserLink()\n\t\t.AddUserRadioButton()\n\t\t.StandardUserCreation()\n\t\t.validateEmailidField(userProfile);\t\t\t\t \t \t\t\t\t\t\t\n\t}", "private void validateFields(){\n String email = edtEmail.getText().toString().trim();\n String number=edtPhone.getText().toString().trim();\n String cc=txtCountryCode.getText().toString();//edtcc.getText().toString().trim();\n String phoneNo=cc+number;\n // Check for a valid email address.\n\n\n if (TextUtils.isEmpty(email)) {\n mActivity.showSnackbar(getString(R.string.error_empty_email), Toast.LENGTH_SHORT);\n return;\n\n } else if (!Validation.isValidEmail(email)) {\n mActivity.showSnackbar(getString(R.string.error_title_invalid_email), Toast.LENGTH_SHORT);\n return;\n\n }\n\n if(TextUtils.isEmpty(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_empty_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n if(!Validation.isValidMobile(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_title_invalid_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n\n if(selectedCurrency==null){\n //mActivity.showSnackbar(getString(R.string.str_select_currency), Toast.LENGTH_SHORT);\n Snackbar.make(getView(),\"Currency data not found!\",Snackbar.LENGTH_LONG)\n .setAction(\"Try again\", new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n getAllCurrency();\n }\n }).show();\n return;\n }\n try {\n JsonObject object = new JsonObject();\n object.addProperty(KEY_EMAIL, email);\n object.addProperty(KEY_PHONE,phoneNo);\n object.addProperty(KEY_CURRENCY,selectedCurrency.getId().toString());\n updateUser(object,token);\n }catch (Exception e){\n\n }\n\n }", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private boolean isInputValid() {\r\n \r\n String errorMessage = \"\";\r\n \r\n // Email regex provided by emailregex.com using the RFC5322 standard\r\n String emailPatternString = \"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\r\n \r\n // Phone number regex provided by Ravi Thapliyal on Stack Overflow:\r\n // http://stackoverflow.com/questions/16699007/regular-expression-to-match-standard-10-digit-phone-number\r\n String phoneNumString = \"^(\\\\+\\\\d{1,2}\\\\s)?\\\\(?\\\\d{3}\\\\)?[\\\\s.-]?\\\\d{3}[\\\\s.-]?\\\\d{4}$\";\r\n \r\n Pattern emailPattern = Pattern.compile(emailPatternString, Pattern.CASE_INSENSITIVE);\r\n Matcher emailMatcher;\r\n \r\n Pattern phoneNumPattern = Pattern.compile(phoneNumString);\r\n Matcher phoneNumMatcher;\r\n \r\n // Validation for no length or over database size limit\r\n if ((custFirstNameTextField.getText() == null || custFirstNameTextField.getText().length() == 0) || (custFirstNameTextField.getText().length() > 25)) {\r\n errorMessage += \"First name has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custLastNameTextField.getText() == null || custLastNameTextField.getText().length() == 0) || (custLastNameTextField.getText().length() > 25)) {\r\n errorMessage += \"Last name has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custAddressTextField.getText() == null || custAddressTextField.getText().length() == 0) || (custAddressTextField.getText().length() > 75)) {\r\n errorMessage += \"Address has to be between 1 and 75 characters.\\n\";\r\n }\r\n \r\n if ((custCityTextField.getText() == null || custCityTextField.getText().length() == 0) || (custCityTextField.getText().length() > 50)) {\r\n errorMessage += \"City has to be between 1 and 50 characters.\\n\";\r\n }\r\n \r\n if ((custProvinceTextField.getText() == null || custProvinceTextField.getText().length() == 0) || (custProvinceTextField.getText().length() > 2)) {\r\n errorMessage += \"Province has to be a two-letter abbreviation.\\n\";\r\n }\r\n \r\n if ((custPostalCodeTextField.getText() == null || custPostalCodeTextField.getText().length() == 0) || (custPostalCodeTextField.getText().length() > 7)) {\r\n errorMessage += \"Postal Code has to be between 1 and 7 characters.\\n\";\r\n }\r\n \r\n if ((custCountryTextField.getText() == null || custCountryTextField.getText().length() == 0) || (custCountryTextField.getText().length() > 25)) {\r\n errorMessage += \"Country has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custHomePhoneTextField.getText() == null || custHomePhoneTextField.getText().length() == 0) || (custHomePhoneTextField.getText().length() > 20)) {\r\n errorMessage += \"Phone number has to be between 1 and 20 characters long.\\n\";\r\n } else {\r\n phoneNumMatcher = phoneNumPattern.matcher(custHomePhoneTextField.getText());\r\n if (!phoneNumMatcher.matches()) {\r\n errorMessage += \"Phone number not in the correct format: (111) 111-1111.\\n\";\r\n }\r\n }\r\n \r\n if ((custBusinessPhoneTextField.getText() == null || custBusinessPhoneTextField.getText().length() == 0) || (custBusinessPhoneTextField.getText().length() > 20)) {\r\n errorMessage += \"Phone number has to be between 1 and 20 characters long.\\n\";\r\n } else {\r\n phoneNumMatcher = phoneNumPattern.matcher(custBusinessPhoneTextField.getText());\r\n if (!phoneNumMatcher.matches()) {\r\n errorMessage += \"Phone number not in the correct format: (111) 111-1111.\\n\";\r\n }\r\n }\r\n \r\n if ((custEmailTextField.getText() == null || custEmailTextField.getText().length() == 0) || (custEmailTextField.getText().length() > 50)) {\r\n errorMessage += \"Email has to be between 1 and 50 characters.\\n\";\r\n } else {\r\n emailMatcher = emailPattern.matcher(custEmailTextField.getText());\r\n if (!emailMatcher.matches()) {\r\n errorMessage += \"Email format is not correct. Should be in the format [email protected].\\n\"; \r\n } \r\n }\r\n \r\n if (errorMessage.length() > 0) {\r\n Alert alert = new Alert(AlertType.ERROR, errorMessage, ButtonType.OK);\r\n alert.setTitle(\"Input Error\");\r\n alert.setHeaderText(\"Please correct invalid fields\");\r\n alert.showAndWait();\r\n \r\n return false;\r\n }\r\n \r\n return true;\r\n }", "public static void validation() {\n\t\tif ((!textFieldName.getText().isEmpty()) && (!textField_FirstName.getText().isEmpty())\n\t\t\t\t&& (!textField_Town.getText().isEmpty()) && (!textField_Town.getText().isEmpty())) {\n\n\t\t\tif ((isValidEmailAddress(textField_Email.getText()) == true)) {\n\t\t\t\ttextField_Email.setBackground(Color.white);\n\t\t\t\tif ((force(textField_Mtp.getText()) > 82)) {\n\t\t\t\t\ttextField_Mtp.setBackground(Color.white);\n\t\t\t\t\tactionGiveServeur();\n\n\t\t\t\t} else {\n\t\t\t\t\tshowMessageDialog(null, \"Votre mot de passe est trop faible\");\n\t\t\t\t\ttextField_Mtp.setText(\"Mot de passe trop simple : changer le \");\n\t\t\t\t\ttextField_Mtp.setBackground(Color.RED);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextField_Email.setText(\"Email invalide\");\n\t\t\t\ttextField_Email.setBackground(Color.RED);\n\t\t\t\tshowMessageDialog(null, \"Email est invalide\");\n\t\t\t}\n\t\t} else {\n\n\t\t\tshowMessageDialog(null, \"Certain champs sont vide !\");\n\t\t}\n\t}", "private void checkFields() {\n\t\t\n\t\tboolean errors = false;\n\t\t\n\t\t// contact name\n\t\tString newName = ((TextView) findViewById(R.id.tvNewContactName)).getText().toString();\n\t\tTextView nameErrorView = (TextView) findViewById(R.id.tvContactNameError);\n\t\tif(newName == null || newName.isEmpty()) {\n\t\t\terrors = true;\n\t\t\tnameErrorView.setText(\"Contact must have a name!\");\n\t\t} else {\n\t\t\tnameErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact phone number\n\t\tString newPhone = ((TextView) findViewById(R.id.tvNewContactPhone)).getText().toString();\n\t\tTextView phoneNumberErrorView = (TextView) findViewById(R.id.tvContactPhoneError);\n\t\tif(newPhone == null || newPhone.isEmpty()) {\n\t\t\terrors = true;\n\t\t\tphoneNumberErrorView.setText(\"Contact must have a phone number!\");\n\t\t} else {\n\t\t\tphoneNumberErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact e-mail\n\t\tString newEmail= ((TextView) findViewById(R.id.tvNewContactEmail)).getText().toString();\n\t\tTextView emailErrorView = (TextView) findViewById(R.id.tvContactEmailError);\n\t\tif(newEmail == null || newEmail.isEmpty()) {\n\t\t\terrors = true;\n\t\t\temailErrorView.setText(\"Contact must have an E-mail!\");\n\t\t} else if (!newEmail.matches(\".+@.+\\\\..+\")) {\n\t\t\terrors = true;\n\t\t\temailErrorView.setText(\"Invalid E-mail address! Example:\"\n\t\t\t\t\t+ \"[email protected]\");\n\t\t} else {\n\t\t\temailErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact note\n\t\tString newNote = ((TextView) findViewById(R.id.tvNewContactNote)).getText().toString();\n\t\t\n\t\t// contact Facebook profile address\n\t\tString newAddress = ((TextView) findViewById(R.id.tvNewContactAddress)).getText().toString();\n\t\t\n\t\t// save the new contact if all the required fields are filled out\n\t\tif(!errors) {\n\t\t\tif(newNote == null || newNote.isEmpty()) {\n\t\t\t\tnewNote = \"No note.\";\n\t\t\t}\n\t\t\t\n\t\t\tif(newAddress == null || newAddress.isEmpty()) {\n\t\t\t\tnewAddress = \"No address.\";\n\t\t\t}\n\t\t\tHomeActivity.listOfContacts.add(new Contact(newName, newPhone, newEmail, \n\t\t\t\t\tnewNote, newAddress));\n\t\t\tIntent intent = new Intent(AddContactActivity.this, HomeActivity.class);\n\t\t\tstartActivity(intent);\n\t\t}\n\t}", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "abstract void fiscalCodeValidity();", "abstract void telephoneValidity();", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "@Test\r\n\tpublic void TC_07_verify_Invalid_Email_Address_format() {\r\n\r\n\t\thomePgObj = new Page_Home(driver);\r\n\t\tregPgObj = homePgObj.click_RegistrationLink();\r\n\t\t\r\n\t\t// Step 1: Verify the registration page is displayed\r\n\t\t\r\n\t\tflag = regPgObj.registrationPgDisplay();\r\n\t\t\r\n\t\t// Step 2: Enter valid/mandatory registration details with invalid email address format\r\n\t\tAssert.assertTrue(flag, \"Registration page is displayed\");\r\n\t\tregPgObj.enterRegistrationDetails(\"firstName\", firstName);\r\n\t\tregPgObj.enterRegistrationDetails(\"lastName\", lastName);\r\n\t\tregPgObj.enterRegistrationDetails(\"email\", InvalidEmail);\r\n\t\tregPgObj.enterRegistrationDetails(\"password\", password);\r\n\t\tregPgObj.enterRegistrationDetails(\"confirmPassword\", confirmPassword);\r\n\t\t\r\n\t\t// Step 3: Click on Sign in button\r\n\t\t\r\n\t\tregPgObj.clickSignInButton();\r\n\t\t\r\n\t\t// Step 4: Verify user should NOT be able to proceed further with registration as proper validation message regarding invalid email address\r\n\t\t//format is displayed\r\n\t\t\r\n\t\terrMsg = Page_Registration.getMandatoryFieldErrMsg();\r\n\t\tAssert.assertEquals(errMsg, \"The email address is invalid.\");\r\n\r\n\t}", "void telephoneValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"+391111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"1111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"111 1111111\");\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data\n person.setTelephone(\"AAA\");\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }", "public static void validate() {\r\n\t\tfrmMfhEmailer.validate();\r\n\t}", "private boolean isInfoValidate(){\n if(mEmailAddress.getText() == null || mEmailAddress.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_email_address);\n return false;\n }\n\n if(!mEmailAddress.getText().toString().contains(\"@\")){\n errorText = getString(R.string.register_warning_valid_email_address);\n return false;\n }\n\n// if(mRegionSpinner.getSelectedItemPosition() == Constant.NON_SELECT){\n// errorText = getString(R.string.register_warning_select_region);\n// return false;\n// }\n\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.HONG_KONG)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.HONGKONG_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n//\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.CHINA)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.CHINA_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n\n if(mPassword.getText() == null || mPassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_password);\n return false;\n }\n\n if(mRetypePassword.getText() == null || mRetypePassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_retype_password);\n return false;\n }\n\n if(!mPassword.getText().toString().equals(mRetypePassword.getText().toString())){\n errorText = getString(R.string.register_warning_not_the_same);\n return false;\n }\n\n if(!Utility.judgeContainsStr( mPassword.getText().toString())){\n errorText = getString(R.string.register_warning_contains_character);\n return false;\n }\n\n// if(!mPolicyCheckBox.isChecked()){\n// errorText = getString(R.string.register_warning_check_agreement);\n// return false;\n// }\n\n return true;\n }", "public void validate_the_Telephone_Home_in_Contact_Details_of_Customer_Tab(String TelephoneHome)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneHome.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Home\").replaceAll(\"M_InnerText\", TelephoneHome), \"Telephone - Home - \"+TelephoneHome, false);\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "@Test\n\t\tvoid givenEmail_CheckForValidationForMobile_RetrunTrue() {\n\t\t\tboolean result = ValidateUserDetails.validateMobile(\"98 9808229348\");\n\t\t\tAssertions.assertTrue(result);\n\t\t}", "public boolean isValid(){\n Email.setErrorEnabled(false);\n Email.setError(\"\");\n Fname.setErrorEnabled(false);\n Fname.setError(\"\");\n Lname.setErrorEnabled(false);\n Lname.setError(\"\");\n Pass.setErrorEnabled(false);\n Pass.setError(\"\");\n Mobileno.setErrorEnabled(false);\n Mobileno.setError(\"\");\n Cpass.setErrorEnabled(false);\n Cpass.setError(\"\");\n area.setErrorEnabled(false);\n area.setError(\"\");\n Houseno.setErrorEnabled(false);\n Houseno.setError(\"\");\n Pincode.setErrorEnabled(false);\n Pincode.setError(\"\");\n\n boolean isValid=false,isValidname=false,isValidhouseno=false,isValidlname=false,isValidemail=false,isValidpassword=false,isValidconfpassword=false,isValidmobilenum=false,isValidarea=false,isValidpincode=false;\n if(TextUtils.isEmpty(fname)){\n Fname.setErrorEnabled(true);\n Fname.setError(\"Enter First Name\");\n }else{\n isValidname=true;\n }\n if(TextUtils.isEmpty(lname)){\n Lname.setErrorEnabled(true);\n Lname.setError(\"Enter Last Name\");\n }else{\n isValidlname=true;\n }\n if(TextUtils.isEmpty(emailid)){\n Email.setErrorEnabled(true);\n Email.setError(\"Email Address is required\");\n }else {\n if (emailid.matches(emailpattern)) {\n isValidemail = true;\n } else {\n Email.setErrorEnabled(true);\n Email.setError(\"Enter a Valid Email Address\");\n }\n }\n if(TextUtils.isEmpty(password)){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Enter Password\");\n }else {\n if (password.length()<8){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Weak Password\");\n }else {\n isValidpassword = true;\n }\n }\n if(TextUtils.isEmpty(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Enter Password Again\");\n }else{\n if (!password.equals(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Password Dosent Match\");\n }else{\n isValidconfpassword=true;\n }\n }\n if(TextUtils.isEmpty(mobile)){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Enter Phone Number\");\n }else{\n if (mobile.length()<10){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Invalid Mobile Number\");\n } else {\n isValidmobilenum = true;\n }\n }\n if(TextUtils.isEmpty(Area)){\n area.setErrorEnabled(true);\n area.setError(\"Area is Required\");\n }else{\n isValidarea=true;\n }\n if(TextUtils.isEmpty(pincode)){\n Pincode.setErrorEnabled(true);\n Pincode.setError(\"Please Enter Pincode\");\n }else{\n isValidpincode=true;\n }\n if(TextUtils.isEmpty(house)){\n Houseno.setErrorEnabled(true);\n Houseno.setError(\"House field cant be empty\");\n }else{\n isValidhouseno=true;\n }\n isValid=(isValidarea && isValidpincode && isValidconfpassword && isValidpassword && isValidemail && isValidname &&isValidmobilenum && isValidhouseno && isValidlname)? true:false;\n return isValid;\n\n }", "private boolean validate(String name, String phone, String email, String description) {\n if (name.equals(null) || name.equals(\"\") || !isValidMobile(phone) || !isValidMail(email) || description.equals(null) || description.equals(\"\")) {\n\n if (name.equals(null) || name.equals(\"\")) {\n nameText.setError(\"Enter a valid Name\");\n } else {\n nameText.setError(null);\n }\n if (!isValidMobile(phone)) {\n phoneNumber.setError(\"Enter a valid Mobile Number\");\n } else {\n phoneNumber.setError(null);\n }\n if (!isValidMail(email)) {\n emailText.setError(\"Enter a valid Email ID\");\n } else {\n emailText.setError(null);\n }\n if (description.equals(null) || description.equals(\"\")) {\n descriptionText.setError(\"Add few lines about you\");\n } else {\n descriptionText.setError(null);\n }\n return false;\n } else\n return true;\n }", "public static void main(String[] args){\n\tValidateUser first =(String Fname) -> {\n\t\tif(Pattern.matches(\"[A-Z]{1}[a-z]{2,}\",Fname))\n\t\t\tSystem.out.println(\"First Name Validate\");\n\t\t\telse \n\t\t\tSystem.out.println(\"Invalid Name, Try again\");\n\t}; \n\t//Lambda expression for Validate User Last Name\n\tValidateUser last =(String Lname) -> {\n\t\tif(Pattern.matches(\"[A-Z]{1}[a-z]{2,}\",Lname))\n\t\t\tSystem.out.println(\"Last Name Validate\");\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Invalid Last Name, Try again\");\n\t};\n\t//Lambda expression for Validate User Email\n\tValidateUser Email =(String email) -> {\n\t\tif(Pattern.matches(\"^[\\\\w-\\\\+]+(\\\\.[\\\\w]+)*@[\\\\w-]+(\\\\.[\\\\w]+)*(\\\\.[a-z]{2,})$\",email))\n\t\t\tSystem.out.println(\"email Validate\");\n\t\telse\n\t\t\tSystem.out.println(\"Invalid Email, Try again\");\n\t};\n\t//Lambda expression for Validate User Phone Number\n\tValidateUser Num =(String Number) -> {\n\t\tif(Pattern.matches(\"^[0-9]{2}[\\\\s][0-9]{10}\",Number))\n\t\t\tSystem.out.println(\"Phone Number Validate\");\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Invalid Number, Try Again\");\n\t};\n\t//Lambda expression for Validate User Password\n\tValidateUser Password =(String pass) -> {\n\t\tif(Pattern.matches(\"(?=.*[$#@!%^&*])(?=.*[0-9])(?=.*[A-Z]).{8,20}$\",pass))\n\t\t\tSystem.out.println(\"Password Validate\");\n\t\t\telse\n\t\t\tSystem.out.println(\"Invalid Password Try Again\");\n\t};\n\t\n\tfirst.CheckUser(\"Raghav\");\n\tlast.CheckUser(\"Shettay\");\n\tEmail.CheckUser(\"[email protected]\");\n\tNum.CheckUser(\"91 8998564522\");\n\tPassword.CheckUser(\"Abcd@321\");\n\t\n\t\n\t\n\t//Checking all Email's Sample Separately\n\tArrayList<String> emails = new ArrayList<String>();\n\t//Valid Email's\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\t\n\t//Invalid Email's\n\temails.add(\"[email protected]\");\n\temails.add(\"abc123@%*.com\");\n\t\n\tString regex=\"^[\\\\w-\\\\+]+(\\\\.[\\\\w]+)*@[\\\\w-]+(\\\\.[\\\\w]+)*(\\\\.[a-z]{2,})$\";\n\t\n\tPattern pattern = Pattern.compile(regex);\n\t\n\tfor(String mail : emails) {\n\t\tMatcher matcher = pattern.matcher(mail);\n\t System.out.println(mail +\" : \"+ matcher.matches());\n\t}\n \n}", "private boolean validateForm() {\n Boolean validFlag = true;\n String email = emailTxt.getText().toString().trim();\n String name = nameTxt.getText().toString().trim();\n String phone = phoneTxt.getText().toString().trim();\n String password = passwordTxt.getText().toString();\n String confirPassWord = confirmPasswordTxt.getText().toString();\n\n Pattern emailP = Pattern.compile(\"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\", Pattern.CASE_INSENSITIVE);\n Matcher emailM = emailP.matcher(email);\n boolean emailB = emailM.find();\n\n if (TextUtils.isEmpty(email) || email.equals(\"\") || !emailB) {\n emailTxt.setError(\"Email bị để trống hoặc không dúng định dạng.\");\n validFlag = false;\n } else {\n emailTxt.setError(null);\n }\n\n if (TextUtils.isEmpty(password) || password.length() < 6) {\n passwordTxt.setError(\"Mật khẩu phải 6 ký tự trở lên\");\n validFlag = false;\n } else {\n passwordTxt.setError(null);\n }\n\n Pattern phoneP = Pattern.compile(\"[0-9]{8,15}$\");\n Matcher phoneM = phoneP.matcher(phone);\n boolean phoneB = phoneM.find();\n\n if (TextUtils.isEmpty(phone) || phone.length() < 8 || phone.length() > 15 || !phoneB) {\n phoneTxt.setError(\"Số điện thoại bị để trống hoặc không đúng định dạng\");\n validFlag = false;\n } else {\n phoneTxt.setError(null);\n }\n if (confirPassWord.length() < 6 || !confirPassWord.equals(password)) {\n confirmPasswordTxt.setError(\"Xác nhận mật khẩu không đúng\");\n validFlag = false;\n } else {\n confirmPasswordTxt.setError(null);\n }\n\n Pattern p = Pattern.compile(\"[0-9]\", Pattern.CASE_INSENSITIVE);\n Matcher m = p.matcher(name);\n boolean b = m.find();\n if (b) {\n nameTxt.setError(\"Tên tồn tại ký tự đặc biệt\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n if (TextUtils.isEmpty(name)) {\n nameTxt.setError(\"Không được để trống tên.\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n\n return validFlag;\n }", "@Override\n\tpublic Boolean isValidApplication(ApplicationBean applicationBean) {\n\t\tPattern namePattern=Pattern.compile(\"^[A-Za-z\\\\s]{3,}$\");\n\t\tMatcher nameMatcher=namePattern.matcher(applicationBean.getName());\n\t\tPattern dobPattern=Pattern.compile(\"^[0-3]?[0-9].[0-3]?[0-9].(?:[0-9]{2})?[0-9]{2}$\");\n\t\tMatcher dobMatcher=dobPattern.matcher(applicationBean.getDateOfBirth());\n\t\tPattern goalPattern=Pattern.compile(\"^[A-Za-z\\\\s]{1,}$\");\n\t\tMatcher goalMatcher=goalPattern.matcher(applicationBean.getGoals());\n\t\tPattern marksPattern=Pattern.compile(\"^[1-9][0-9]?$|^100$\");\n\t\tMatcher marksMatcher=marksPattern.matcher(applicationBean.getMarksObtained());\n\t\tPattern scheduleIdPattern=Pattern.compile(\"^[0-9]{1,2}$\");\n\t\tMatcher scheduleIdMatcher=scheduleIdPattern.matcher(applicationBean.getScheduledProgramID());\n\t\tPattern emailPattern=Pattern.compile(\"^[A-Za-z0-9+_.-]+@(.+)$\");\n\t\tMatcher emailMatcher=emailPattern.matcher(applicationBean.getEmailID());\n\t\t\n\t\t\n\t\tif(!(nameMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nApplicant Name Should Be In Alphabets and minimum 1 characters long.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(dobMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nDate of birth should be in DD/MM/YYYY format.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(goalMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\n Goal should be alphabetical and having minimum one letter\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(marksMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nMarks should be less than 100\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(scheduleIdMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nSchedule Id should be of one or two digit\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(emailMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nEnter valid email address\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "private boolean validate() {\n if(edtMobileNumber.getText().toString().length() <= 0){\n edtMobileNumber.setFocusable(true);\n edtMobileNumber.setError(Constants.ERR_MSG_MOBILE);\n return false;\n }else if(edtFirstName.getText().toString().length() <= 0){\n edtFirstName.setFocusable(true);\n edtFirstName.setError(Constants.ERR_MSG_FIRST_NAME);\n return false;\n }else if(edtLastName.getText().toString().length() <= 0){\n edtLastName.setFocusable(true);\n edtLastName.setError(Constants.ERR_MSG_LAST_NAME);\n return false;\n }else if(edtDateOfBirth.getText().toString().length() <= 0){\n edtDateOfBirth.setFocusable(true);\n edtDateOfBirth.setError(Constants.ERR_MSG_DATE_OF_BIRTH);\n return false;\n }else if(edtEnterPin.getText().toString().length() <= 0){\n edtEnterPin.setFocusable(true);\n edtEnterPin.setError(Constants.ERR_MSG_PIN);\n return false;\n }else if(edtConfirmPin.getText().toString().length() <= 0){\n edtConfirmPin.setFocusable(true);\n edtConfirmPin.setError(Constants.ERR_MSG_CONFIRM_PIN);\n return false;\n }else if(spnStatus.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_STATUS, Toast.LENGTH_SHORT).show();\n return false;\n }else if(spnBloodGroup.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_BLOOD_GROUP, Toast.LENGTH_SHORT).show();\n return false;\n }else if(rgGender.getCheckedRadioButtonId() == -1){\n Toast.makeText(context,Constants.ERR_MSG_GENDER,Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "void validateMobileNumber(String stringToBeValidated,String name);", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "private void validateDetails() {\n\n clearErrors();\n Utils.hide_keyboard(getActivity());\n\n boolean valid = true;\n\n String cvv = cvvTv.getText().toString();\n String expiryDate = cardExpiryTv.getText().toString();\n String cardNo = cardNoTv.getText().toString();\n\n if (cvv.length() < 3) {\n valid = false;\n cvvTil.setError(\"Enter a valid cvv\");\n }\n\n if (expiryDate.length() != 5) {\n cardExpiryTil.setError(\"Enter a valid expiry date\");\n valid = false;\n }\n\n String cardNoStripped = cardNo.replaceAll(\"\\\\s\", \"\");\n\n if (cardNoStripped.length() < 12 ) {\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n else {\n try {\n Long parsed = Long.parseLong(cardNoStripped);\n }\n catch (Exception e) {\n e.printStackTrace();\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n }\n\n if (valid) {\n\n if (saveCardSwitch.isChecked()) {\n int cardLen = cardNoStripped.length();\n cardFirst6 = cardNoStripped.substring(0, 6);\n cardLast4 = cardNoStripped.substring(cardLen - 4, cardLen);\n shouldISaveThisCard = true;\n presenter.savePotentialCardDets(cardFirst6, cardLast4);\n }\n\n //make request\n PayloadBuilder builder = new PayloadBuilder();\n builder.setAmount(thetellerInitializer.getAmount() + \"\")\n .setNarration(thetellerInitializer.getNarration())\n .setCardno(cardNoStripped)\n .set3dUrl(thetellerInitializer.get3dUrl())\n .setEmail(thetellerInitializer.getEmail())\n .setCurrency(thetellerInitializer.getCurrency())\n .setMerchant_id(thetellerInitializer.getMerchant_id())\n .setCvv(cvv).setFirstname(thetellerInitializer.getfName())\n .setLastname(thetellerInitializer.getlName())\n .setIP(Utils.getDeviceImei(getActivity()))\n .setTxRef(thetellerInitializer.getTxRef())\n .setExpiryyear(expiryDate.substring(3,5))\n .setExpirymonth(expiryDate.substring(0,2))\n .setMeta(thetellerInitializer.getMeta())\n .setApiUser(thetellerInitializer.getApiUser())\n .setApiKey(thetellerInitializer.getApiKey())\n .setDevice_fingerprint(Utils.getDeviceImei(getActivity()))\n .setCardType(cardType);\n\n if (thetellerInitializer.getPayment_plan() != null) {\n builder.setPaymentPlan(thetellerInitializer.getPayment_plan());\n }\n\n body = builder.createPayload();\n\n presenter.chargeCard(body, thetellerConstants.API_KEY);\n }\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "@RequiresApi(api = Build.VERSION_CODES.KITKAT)\n public boolean validateDetails(String email, String mobile) {\n email = email.trim();\n mobile = mobile.trim();\n\n if (TextUtils.isEmpty(mobile)) {\n setErrorInputLayout(mobile_et, getString(R.string.err_phone_empty), mobile_til);\n return false;\n } else if (!isValidPhone(mobile)) {\n setErrorInputLayout(mobile_et, getString(R.string.err_phone_not_valid), mobile_til);\n return false;\n } else if (TextUtils.isEmpty(email)) {\n setErrorInputLayout(email_et, getString(R.string.err_email_empty), email_til);\n return false;\n } else if (!isValidEmail(email)) {\n setErrorInputLayout(email_et, getString(R.string.email_not_valid), email_til);\n return false;\n } else if (Objects.equals(name_et.getText().toString(), \"\")) {\n setErrorInputLayout(name_et, \"Name is not valid\", name_til);\n return false;\n } else {\n return true;\n }\n }", "@Test\n\t\tvoid givenEmail_CheckForValidationForEmail_RetrunTrue() {\n\t\t\tboolean result = ValidateUserDetails.validateEmails(\"[email protected]\");\n\t\t\tAssertions.assertTrue(result);\n\t\t}", "public void checkvalidate()\n\t{\n\t\tif((fn.getText().toString()).equals(\"\"))\n \t{\n \t\t//text1.setText(\"Name not entered!!\");\n\t\t\tToast.makeText(AddContact.this, \"Name Not Entered\",Toast.LENGTH_SHORT).show();\n \t}\n \telse if((mobno.getText().toString()).equals(\"\"))\n \t{\n \t\t//text1.setText(\"Phone not entered!!\");\n \t\tToast.makeText(AddContact.this, \"Phone No. not Entered\",Toast.LENGTH_SHORT).show();\n \t}\t\n \telse\n \t{\n \t\tname=fn.getText().toString();\n\t\t\tstrln=ln.getText().toString();\n\t\t\t//mname=mn.getText().toString();\n\t\t\tstrmno=mobno.getText().toString();\n\t\t\tstreid=eid.getText().toString();\n\t\t\tstrtag_type=stag.getSelectedItem().toString();\n\t\t\tstrtag=tag.getText().toString();\n\t\t\tmshome=mhome.getText().toString();\n\t\t\tmswork=mwork.getText().toString();\n\t\t\tmsother=moth.getText().toString();\n\t\t\teswork=ework.getText().toString();\n\t\t\tesother=eoth.getText().toString();\n\t\t\tnotes=enotes.getText().toString();\n\t\t\tdata.Insert(name,mname,strln,strmno,mshome,mswork,msother,mscust, streid,eswork,esother,mscust,imagePath,strtag_type,strtag,0,date,time,notes,0);\n\t\t\tToast.makeText(AddContact.this, \"Added Successfully\",Toast.LENGTH_SHORT).show();\n\t\t\tCursor c=data.getData();\n\t\t\twhile(c.moveToNext())\n\t\t\t{\n\t\t\t\tString name1=c.getString(0);\n\t\t\t\tSystem.out.println(\"Name:\"+name1);\n\t\t\t\t\n\t\t\t}\n\t\t\tc.close();\n\t\t\tviewcontacts();\n \t}\n\t\t\n\t}", "public boolean validateFields(Customer customer) {\r\n if (isEmpty(customer.getFirstName(), customer.getLastName(), customer.getPhoneNum(),\r\n customer.getEmail(), customer.getDate())) {\r\n Alert alert = new Alert(Alert.AlertType.WARNING);\r\n alert.setTitle(\"Invalid info\");\r\n alert.setHeaderText(null);\r\n alert.setContentText(\"Invalid info.\\nAll fields must be filled.\");\r\n alert.showAndWait();\r\n return false;\r\n }\r\n return true;\r\n }", "private String validarEntradas()\n { \n return Utilitarios.validarEntradas(campoNomeAC, campoEnderecoAC, campoBairroAC, campoCidadeAC, campoUfAC, campoCepAC, campoTelefoneAC, campoEmailAC);\n }", "private boolean revisarFormatoCorreo() {\n\t\tString correoE = this.campoCorreo.getText();\n\t\tPattern pat = Pattern.compile(\"^[\\\\w-]+(\\\\.[\\\\w-]+)*@[\\\\w-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\");\n\t\tMatcher mat = pat.matcher(correoE);\n\t\tif (mat.matches()) {\n\t\t\treturn true;\n\t\t} else\n\t\t\treturn false;\n\t}", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "@Override\n public void validaEmailInteractor(CharSequence charSequence) {\n verificaEmail(charToString(charSequence));\n }", "private boolean Validarformatocorreo(String correo) {\n Pattern pat = Pattern.compile(\"^([0-9a-zA-Z]([_.w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-w]*[0-9a-zA-Z].)+([a-zA-Z]{2,9}.)+[a-zA-Z]{2,3})$\");\n Matcher mat = pat.matcher(correo);\n\n return mat.find();\n }", "private void checkValidation() {\n // Get email id and password\n MainActivity.EmailAddress = emailid.getText().toString();\n finalPassword = password.getText().toString();\n\n // Check patter for email id\n Pattern p = Pattern.compile(Utils.regEx);\n\n Matcher m = p.matcher(MainActivity.EmailAddress);\n\n // Check for both field is empty or not\n if (MainActivity.EmailAddress.equals(\"\") || MainActivity.EmailAddress.length() == 0\n || finalPassword.equals(\"\") || finalPassword.length() == 0) {\n loginLayout.startAnimation(shakeAnimation);\n new CustomToast().Show_Toast(getActivity(), view,\n \"Enter both credentials.\");\n\n }\n // Check if email id is valid or not\n else if (!m.find())\n new CustomToast().Show_Toast(getActivity(), view,\n \"Your Email Id is Invalid.\");\n // Else do login and do your stuff\n else\n tryLoginUser();\n\n }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "private void ValidateEditTextFields() {\n\tfor (int i = 0; i < etArray.length; i++) {\n\t if (etArray[i].getText().toString().trim().length() <= 0) {\n\t\tvalidCustomer = false;\n\t\tetArray[i].setError(\"Blank Field\");\n\t }\n\t}\n\n\tif (etPhoneNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etPhoneNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (etEmergencyNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etEmergencyNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (calendarDob == null) {\n\t validCustomer = false;\n\t}\n }", "private boolean tableDataValid()\r\n {\r\n // if there are any form level validations that should go there\r\n int rowTotal = tblProtoCorresp.getRowCount();\r\n int colTotal = tblProtoCorresp.getColumnCount();\r\n for (int rowIndex = 0; rowIndex < rowTotal ; rowIndex++)\r\n {\r\n for (int colIndex = 0; colIndex < colTotal; colIndex++)\r\n {\r\n TableColumn column = codeTableColumnModel.getColumn(colIndex) ;\r\n\r\n ColumnBean columnBean = (ColumnBean)column.getIdentifier() ;\r\n\r\n if (columnBean.getColumnEditable()\r\n && !columnBean.getColumnCanBeNull())\r\n {\r\n if ( tblProtoCorresp.getValueAt(rowIndex,colIndex) != null)\r\n {\r\n if (tblProtoCorresp.getValueAt(rowIndex,colIndex).equals(\"\")\r\n || tblProtoCorresp.getValueAt(rowIndex,colIndex).toString().trim().equals(\"\") )\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n else\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n }\r\n return true ;\r\n }", "public static void main(String[] args) {\n\n\t\tString emailID = \"[email protected]\";\n\t\tboolean isValidEmailID = true;\n\n\t\t//get index(position) value of '@' and '.'\n\t\tint at_index = emailID.indexOf('@');\n\t\tint dot_index = emailID.indexOf('.');\n\t\t\t\t\n\t\t// Check all rules one by one, if any one of the rule is not satisfied then it returns false immediately,\n\t\t// it returns true only after all the rules are satisfied\n\t\tisValidEmailID = (at_index < 0 || dot_index < 0) ? false\n\t\t\t\t: (at_index != emailID.lastIndexOf('@') || dot_index != emailID.lastIndexOf('.')) ? false\n\t\t\t\t\t\t: (emailID.substring(at_index + 1, dot_index).length() != 4) ? false\n\t\t\t\t\t\t\t\t: (emailID.substring(0, at_index).length() < 3) ? false\n\t\t\t\t\t\t\t\t\t\t: (emailID.toLowerCase().endsWith(\".com\") == false) ? false : true;\n\t\t\n\t\tSystem.out.println(\"Email ID : \" + emailID);\n\t\t\n\t\t\t\t\t\t\n\t\tif (isValidEmailID) {\n\t\t\tSystem.out.println(\"Email Validation Result : True (ie given maild is in vaild format)\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Email Validation Result : False (ie given maild is not in vaild format)\");\n\t\t}\n\n\t}", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "public PersonInfo addPerson(PersonInfo p) {\n\t\tlog.info(\"Enter First Name\");\n\t\tString fname = obj.next();\n\t\tlog.info(\"Enter Last Name\");\n\t\tString lname = obj.next();\n\t\tlog.info(\"Enter Address\");\n\t\tString address = obj.next();\n\t\tlog.info(\"Enter City\");\n\t\tString city = obj.next();\n\t\tlog.info(\"Enter State\");\n\t\tString state = obj.next();\n\t\tlog.info(\"Enter the six digit Zip Code\");\n\t\tString zipCode = obj.next();\n\t\tString pattern3 = \"^[1-9]{1}[0-9]{5}$\";\n\t\tPattern zip_pattern = Pattern.compile(pattern3);\n\t\tMatcher m3 = zip_pattern.matcher(zipCode);\n\t\tif (m3.matches() == false) {\n\t\t\tlog.info(\"zip code not in format enter again\");\n\t\t\tzipCode = obj.next();\n\t\t}\n\t\tlog.info(\"Enter the ten digit Phone Number\");\n\t\tString phoneNo = obj.next();\n\t\tString pattern1 = \"^[1-9]{1}[0-9]{9}$\";\n\t\tPattern mobile_pattern = Pattern.compile(pattern1);\n\t\tMatcher m1 = mobile_pattern.matcher(phoneNo);\n\t\tif (m1.matches() == false) {\n\t\t\tlog.info(\"phone number not in format enter again\");\n\t\t\tphoneNo = obj.next();\n\t\t}\n\t\tlog.info(\"Enter Email\");\n\t\tString email = obj.next();\n\t\tString pattern2 = \"^[a-zA-Z0-9]+((\\\\.[0-9]+)|(\\\\+[0-9]+)|(\\\\-[0-9]+)|([0-9]))*@*+[a-zA-Z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\";\n\t\tPattern email_sample = Pattern.compile(pattern2);\n\t\tMatcher m2 = email_sample.matcher(email);\n\t\tif (m2.matches() == false) {\n\t\t\tlog.info(\"email not in format enter again\");\n\t\t\temail = obj.next();\n\t\t}\n\t\tp = new PersonInfo(fname, lname, address, city, state, zipCode, phoneNo, email);\n\t\treturn p;\n\t}", "private boolean validate(){\n\n String MobilePattern = \"[0-9]{10}\";\n String name = String.valueOf(userName.getText());\n String number = String.valueOf(userNumber.getText());\n\n\n if(name.length() > 25){\n Toast.makeText(getApplicationContext(), \"pls enter less the 25 characher in user name\",\n Toast.LENGTH_SHORT).show();\n return true;\n }\n\n\n\n else if(name.length() == 0 || number.length() == 0 ){\n Toast.makeText(getApplicationContext(), \"pls fill the empty fields\",\n Toast.LENGTH_SHORT).show();\n return false;\n }\n\n\n\n else if(number.matches(MobilePattern))\n {\n\n return true;\n }\n else if(!number.matches(MobilePattern))\n {\n Toast.makeText(getApplicationContext(), \"Please enter valid 10\" +\n \"digit phone number\", Toast.LENGTH_SHORT).show();\n\n\n return false;\n }\n\n return false;\n\n }", "private void setupRequiredValidation() {\n requiredMafExpressions.put(FIELD_HUGO_SYMBOL, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_HUGO_SYMBOL, \"may not be blank\");\r\n requiredMafExpressions.put(FIELD_ENTREZ_GENE_ID, Pattern.compile(\"\\\\d+\")); // number\r\n requiredFieldDescriptions.put(FIELD_ENTREZ_GENE_ID, \"must be an integer number\");\r\n requiredMafExpressions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_TUMOR_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_TUMOR_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_VALIDATION_STATUS, Pattern.compile(\"Valid|Wildtype|Unknown|\\\\S?\"));\r\n requiredFieldDescriptions.put(FIELD_VALIDATION_STATUS, \"must be Valid, Wildtype, Unknown, or blank\");\r\n requiredMafExpressions.put(FIELD_CHROMOSOME, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_CHROMOSOME, \"must be one of: X, Y, M, 1-22, or full name of unassigned fragment\");\r\n setupMafSpecificChecks();\r\n }", "private boolean checkInfo()\n {\n boolean flag = true;\n if(gName.isEmpty())\n {\n groupName.setError(\"Invalid name\");\n flag = false;\n }\n if(gId.isEmpty())\n {\n groupId.setError(\"Invalid id\");\n flag = false;\n }\n if(gAddress.isEmpty())\n {\n groupAddress.setError(\"Invalid address\");\n flag = false;\n }\n\n for(char c : gName.toCharArray()){\n if(Character.isDigit(c)){\n groupName.setError(\"Invalid Name\");\n flag = false;\n groupName.requestFocus();\n }\n }\n\n if(groupType.isEmpty())\n {\n flag = false;\n rPublic.setError(\"Choose one option\");\n }\n\n if(time.isEmpty())\n time = \"not set\";\n\n if(groupDescription.getText().toString().length()<20||groupDescription.getText().toString().length()>200)\n groupDescription.setError(\"Invalid description\");\n\n return flag;\n }", "private void validateData() {\n }", "private boolean isInputValid() {\n String errorMessage = \"\";\n\n if (ServiceName.getText() == null || ServiceName.getText().length() == 0) {\n errorMessage += \"No valid name!\\n\";\n }\n if (Serviceemail.getText() == null || Serviceemail.getText().length() == 0) {\n Pattern p = Pattern.compile(\"[_A-Za-z0-9][A-Za-z0-9._]*?@[_A-Za-z0-9]+([.][_A-Za-z]+)+\");\n Matcher m = p.matcher(Serviceemail.getText());\n if (m.find() && m.group().equals(Serviceemail.getText())) {\n errorMessage += \"No valid Mail Forment!\\n\";\n }\n }\n if (servicedescrip.getText() == null || servicedescrip.getText().length() == 0) {\n errorMessage += \"No valid description !\\n\";\n }\n if (f == null && s.getImage() == null) {\n errorMessage += \"No valid photo ( please upload a photo !)\\n\";\n }\n if (Serviceprice.getText() == null || Serviceprice.getText().length() == 0) {\n errorMessage += \"No valid prix !\\n\";\n } else {\n // try to parse the postal code into an int.\n try {\n Float.parseFloat(Serviceprice.getText());\n } catch (NumberFormatException e) {\n errorMessage += \"No valid prix (must be a Float)!\\n\";\n }\n }\n if ( !Weekly.isSelected() && !Daily.isSelected() && !Monthly.isSelected()) {\n errorMessage += \"No valid Etat ( select an item !)\\n\";\n }\n if (Servicesatet.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid etat ( select an item !)\\n\";\n }\n if (ServiceCity.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid City ( select an item !)\\n\";\n }\n if (servicetype.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid Type ( select an item !)\\n\";\n }\n if (errorMessage.length() == 0) {\n return true;\n } else {\n // Show the error message.\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Invalid Fields\");\n alert.setHeaderText(\"Please correct invalid fields\");\n alert.setContentText(errorMessage);\n alert.showAndWait();\n return false;\n }\n }", "@Test\n //@Disabled\n public void testValidateEmail() {\n assertTrue(RegExprMain.validateEmail(\"[email protected]\"));\n assertTrue(RegExprMain.validateEmail(\"[email protected]\"));\n assertTrue(RegExprMain.validateEmail(\"[email protected]\"));\n assertTrue(RegExprMain.validateEmail(\"[email protected]\"));\n assertFalse(RegExprMain.validateEmail(\"[email protected]\"));\n assertFalse(RegExprMain.validateEmail(\"luna@gmail\"));\n assertFalse(RegExprMain.validateEmail(\"[email protected]\"));\n assertFalse(RegExprMain.validateEmail(\"lubo.xaviluna@gmai_l.com\"));\n assertTrue(RegExprMain.validateEmail(\"luna#[email protected]\"));\n assertTrue(RegExprMain.validateEmail(\"[email protected]\"));\n \n \n\n }", "@Override\n\tprotected Boolean isValid(String[] fields) {\n\t\t//check - evnet_id, yes, maybe, invited, no\n return (fields.length > 4);\n\t}", "private String checkUserDetail(UserModel userModel) {\n\t\tString name = userModel.getName();\n\t\tString mobileNumber = userModel.getMobileNumber();\n\t\tString email = userModel.getEmail();\n\t\tString pincode = userModel.getPincode();\n\t\tString area = userModel.getAreaName();\n\t\tString state = userModel.getStateName();\n\t\tString res = \"okkk\";\n\t\tif (mobileNumber.length() != 10) {\n\t\t\tres = \"Enter ten digit mobile number\";\n\t\t} else if (!checkMobileDigit(mobileNumber)) {\n\t\t\tres = \"enter only digit\";\n\t\t} else if (!checkNameChar(name)) {\n\t\t\tres = \"name shuld be only in alphabet\";\n\t\t} else if (!checkEmail(email)) {\n\t\t\tres = \"enter a valid email\";\n\t\t} else if (pincode.length() != 6) {\n\t\t\tres = \"enter valid pincode and enter only six digit\";\n\t\t} else if (!checkPincode(pincode)) {\n\t\t\tres = \"enter only digit\";\n\t\t} else if (area.equals(null)) {\n\t\t\tres = \"choose area\";\n\t\t} else if (state.equals(null)) {\n\t\t\tres = \"choose state\";\n\t\t}\n\t\treturn res;\n\t}", "public void validate_the_Marketing_preferences_in_Contact_Details_of_Customer_Tab(String type,String i)throws Exception {\n\t\t\t\n\t\t\tboolean checked= false;\n\t\t\tboolean status= false;\n\t\t\ttry {\n\t\t\t\tchecked = VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Marketing preferences\").replaceAll(\"M_InnerText\", type), \"Marketing preferences on \"+type);\n\t\t\t\t\n\t\t\t\tif(i.equalsIgnoreCase(\"1\"))\n\t\t\t\t\tstatus=true;\n\t\t\t\telse\n\t\t\t\t\tstatus=false;\n\t\t\t} catch (NullPointerException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tfinally\n\t\t\t{\n\t\t\tif(checked==status)\n\t\t\t\tReport.fnReportPass(\"Marketing preferences - \"+type+\" : Checked status = \"+status+\"\tDisplay Status\"+checked, driver);\n\t\t\t\telse\n\t\t\t\tReport.fnReportFail(\"Marketing preferences - \"+type+\" : Checked status = \"+status+\"\tDisplay Status\"+checked, driver);\n\t\t\t\n\t\t\t}\n\t}", "@Override\n\tprotected void validators() {\n\t\tString nsrmc = getDj_nsrxx().getNsrmc();\n\n\t\tif (ValidateUtils.isNullOrEmpty(nsrmc)) {\n\t\t\tthis.setSystemMessage(\"纳税人名称不能为空\", true, null);\n\t\t}\n\n\t}", "public PaymentRequestPage paymentRequestPaymentAvailabilityValidation(String cashbackType,String cashbackValue,String rewardsValue) {\r\n\r\n\t\tString actual = \"\";\r\n\r\n\t\treportStep(\"About to validate the Cashback and Rewards Payment avilablity section in the payment Request page \", \"INFO\");\r\n\r\n\t\tswitch (cashbackType) {\r\n\r\n\t\tcase \"Only_Cashback\":\r\n\r\n\t\t\tvalidateTheElementPresence(cashbackAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, cashbackValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"Only_Rewards\":\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, rewardsValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase \"BothCashback_Rewards\":\r\n\r\n\t\t\tfloat cashbackAmount = Float.parseFloat(cashbackValue);\r\n\t\t\tfloat rewardsAmount = Float.parseFloat(rewardsValue);\r\n\t\t\tfloat totalAmount = cashbackAmount + rewardsAmount ;\r\n\r\n\t\t\tString strTotalAmount = Float.toString(totalAmount) + \"0\";\r\n\t\t\tString strOnlyCashbackAmount = Float.toString(cashbackAmount) + \"0\";\r\n\t\t\tString strOnlyRewardsAmount = Float.toString(rewardsAmount) + \"0\";\r\n\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\t\t\tvalidateTheElementPresence(cashbackText);\r\n\t\t\tvalidateTheElementPresence(rewardsText);\r\n\r\n\t\t\t//validate total cashback amount\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strTotalAmount);\r\n\r\n\t\t\t//validate only cashback amount\r\n\t\t\tactual = getText(cashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyCashbackAmount);\r\n\r\n\r\n\t\t\t//validate only rewards amount\r\n\t\t\tactual = getText(rewardsAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyRewardsAmount);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\r\n\t}", "private String creditCardValidate(CardPayment payment) {\r\n \tString validate = null;\r\n \t\r\n \tString cardType = payment.getCreditCardType();\r\n \t\r\n \tif(cardType.equals(\"MASTERCARD\") || cardType.equals(\"VISA\")) {\r\n \t\tif(payment.getCreditCardNumber().matches(\"[0-9]+\") && payment.getCreditCardNumber().length() != 16) {\r\n \t\t\treturn \"Credit Card Number is invalid\";\r\n \t\t} else if(String.valueOf(payment.getCreditcardcvv()).length() != 3) {\r\n \t\t\treturn \"Credit Card CVV is invalid\";\r\n \t\t}\r\n \t} else if(cardType.equals(\"AMEX\")) {\r\n \t\tif(payment.getCreditCardNumber().matches(\"[0-9]+\") && payment.getCreditCardNumber().length() != 15) {\r\n \t\t\treturn \"Credit Card Number is invalid\";\r\n \t\t} else if(String.valueOf(payment.getCreditcardcvv()).length() != 4) {\r\n \t\t\treturn \"Credit Card CVV is invalid\";\r\n \t\t}\r\n \t} else {\r\n \t\tvalidate = \"Invalid card type\";\r\n \t}\r\n \t\r\n \treturn validate;\r\n }", "boolean validateInput() {\n if (etFullname.getText().toString().equals(\"\")) {\n etFullname.setError(\"Please Enter Full Name\");\n return false;\n }\n if (etId.getText().toString().equals(\"\")) {\n etId.setError(\"Please Enter ID\");\n return false;\n }\n if (etEmail.getText().toString().equals(\"\")) {\n etEmail.setError(\"Please Enter Email\");\n return false;\n }\n if (etHall.getText().toString().equals(\"\")) {\n etHall.setError(\"Please Enter Hall Name\");\n return false;\n }\n if (etAge.getText().toString().equals(\"\")) {\n etAge.setError(\"Please Enter Age\");\n return false;\n }\n if (etPhone.getText().toString().equals(\"\")) {\n etPhone.setError(\"Please Enter Contact Number\");\n return false;\n }\n if (etPassword.getText().toString().equals(\"\")) {\n etPassword.setError(\"Please Enter Password\");\n return false;\n }\n\n // checking the proper email format\n if (!isEmailValid(etEmail.getText().toString())) {\n etEmail.setError(\"Please Enter Valid Email\");\n return false;\n }\n\n // checking minimum password Length\n if (etPassword.getText().length() < MIN_PASSWORD_LENGTH) {\n etPassword.setError(\"Password Length must be more than \" + MIN_PASSWORD_LENGTH + \"characters\");\n return false;\n }\n\n\n return true;\n }", "private void alertBox_validation(String msg, final int validateflag) {\r\n\t\tAlertDialog.Builder validation_alert = new AlertDialog.Builder(this);\r\n\t\tvalidation_alert.setTitle(\"Information\");\r\n\t\tvalidation_alert.setMessage(msg);\r\n\t\tif (validateflag != 21) {\r\n\t\t\tvalidation_alert.setNeutralButton(\"OK\",\tnew DialogInterface.OnClickListener() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t\tif (validateflag != 0) {\r\n\t\t\t\t\t\tif (validateflag == 1) {\r\n\t\t\t\t\t\t\tmStreetNumberValue.requestFocus();\r\n\t\t\t\t\t\t}else if (validateflag == 3) {\r\n\t\t\t\t\t\t\tmCardNoValue1.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue2.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue3.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue4.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue1.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 7) {\r\n\t\t\t\t\t\t\tmCardNoValue4.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue4.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 8) {\r\n\t\t\t\t\t\t\tmExpirationDateValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 9) {\r\n\t\t\t\t\t\t\tmExpirationDateValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 10) {\r\n\t\t\t\t\t\t\tmCVVNoValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 11) {\r\n\t\t\t\t\t\t\tmCVVNoValue.setText(\"\");\r\n\t\t\t\t\t\t\tmCVVNoValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 15) {\r\n\t\t\t\t\t\t\tmZipCodeValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 19) {\r\n\t\t\t\t\t\t\tmCardNoValue1.getText().clear();\r\n\t\t\t\t\t\t\tmCardNoValue2.getText().clear();\r\n\t\t\t\t\t\t\tmCardNoValue3.getText().clear();\r\n\t\t\t\t\t\t\tmCardNoValue4.getText().clear();\r\n\t\t\t\t\t\t} else if (validateflag == 20) {\r\n\t\t\t\t\t\t\tmZipCodeValue.getText().clear();\r\n\t\t\t\t\t\t\tmZipCodeValue.requestFocus();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdialog.dismiss();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tvalidation_alert.setPositiveButton(\"Yes\",new DialogInterface.OnClickListener() {\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t\t// Calling funtion to save fields\r\n\t\t\t\t\tsaveFields();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvalidation_alert.setNegativeButton(\"No\",new DialogInterface.OnClickListener() {\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvalidation_alert.show();\r\n\t}", "boolean isEmailRequired();", "private void validationEmail(String email) throws FormValidationException {\n\t\tif (email != null) {\n\t\t\tif (!email.matches(\"([^.@]+)(\\\\.[^.@]+)*@([^.@]+\\\\.)+([^.@]+)\")) {\n\t\t\t\tSystem.out.println(\"Merci de saisir une adresse mail valide.\");\n\n\t\t\t\tthrow new FormValidationException(\n\t\t\t\t\t\t\"Merci de saisir une adresse mail valide.\");\n\t\t\t\t// } else if ( groupDao.trouver( email ) != null ) {\n\t\t\t\t// System.out.println(\"Cette adresse email est déjà utilisée, merci d'en choisir une autre.\");\n\t\t\t\t// throw new FormValidationException(\n\t\t\t\t// \"Cette adresse email est déjà utilisée, merci d'en choisir une autre.\"\n\t\t\t\t// );\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic boolean isValid(String code, ConstraintValidatorContext theConstaint) {\r\n \r\n titles = customerService.getTitles();\r\n \r\n for(String i : titles)\r\n {\r\n \tSystem.out.println(i);\r\n }\r\n //descriptions = ec.getDescriptions();\r\n for(String i : titles)\r\n {\r\n\t result = code.equals(i);\r\n\t\tif(code != null)\t\t\r\n\t\t\tresult = code.equals(i);\r\n\t\telse\r\n\t\t\tresult = true;\r\n\t\tif(result == true)\r\n\t\t\tbreak;\r\n }\r\n\t\treturn result;\r\n\t}", "static boolean isValid(String email) {\r\n\t\t String regex = \"^[\\\\w-_\\\\.+]*[\\\\w-_\\\\.]\\\\@([\\\\w]+\\\\.)+[\\\\w]+[\\\\w]$\";\r\n\t\t return email.matches(regex);\r\n\t}", "private boolean isFormValid(AdminAddEditUserDTO dto)\r\n\t{\n\t\tSOWError error;\r\n\t\tList<IError> errors = new ArrayList<IError>();\t\t\r\n\t\t\r\n\t\t// First Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getFirstName()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_First_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_First_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\t// Last Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getLastName()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Last_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Last_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\t\r\n\t\t// User Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getUsername()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_User_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\telse\r\n\t\t{\t\r\n\t\t\t//User Name Length Check\r\n\t\t\tif((dto.getUsername().length() < 8) || (dto.getUsername().length() >30)){\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"),getTheResourceBundle().getString(\"Admin_User_Name_Length_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString jobRole = getParameter(\"jobRole\");\r\n\t\tif(\"-1\".equals(jobRole))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Job_Role\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Job_Role_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Handle Primary Email\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getEmail()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Email\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isEmailValid(dto.getEmail()) == false)\r\n\t\t\t{\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_PrimaryEmail\"),\r\n\t\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Pattern_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if(dto.getEmail().equals(dto.getEmailConfirm()) == false)\r\n\t\t\t{\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_PrimaryEmail\"),\r\n\t\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Confirm_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Check for existing username, only in Add mode\r\n\t\tString mode = (String)getSession().getAttribute(\"addEditUserMode\");\r\n\t\tif(mode != null)\r\n\t\t{\r\n\t\t\tif(mode.equals(\"add\"))\r\n\t\t\t{\r\n\t\t\t\tif(manageUsersDelegate.getAdminUser(dto.getUsername()) != null || manageUsersDelegate.getBuyerUser(dto.getUsername()) != null)\r\n\t\t\t\t{\r\n\t\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"), getTheResourceBundle().getString(\"Admin_Existing_User_Validation_Msg1\")+\" \" + dto.getUsername() +\" \" +getTheResourceBundle().getString(\"Admin_Existing_User_Validation_Msg2\"), OrderConstants.FM_ERROR);\r\n\t\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// If we have errors, put them in request.\r\n\t\tif(errors.size() > 0)\r\n\t\t{\r\n\t\t\tsetAttribute(\"errors\", errors);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tgetSession().removeAttribute(\"addEditUserMode\");\r\n\t\t\tgetSession().removeAttribute(\"originalUsername\");\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public void onClick(View v1){\n EditText first_name_validate = (EditText)findViewById(R.id.first_name);\n String name = first_name_validate.getText().toString();\n\n //Setting String to validate the e-mail ID entry\n EditText emailValidate = (EditText)findViewById(R.id.email_id);\n String email = emailValidate.getText().toString().trim();\n String emailPattern = \"[a-zA-Z0-9._-]+@[a-z]+\\\\.+[a-z]+\";//String to check the e-mail pattern\n\n //Setting String to validate the phone number entry\n EditText phone_num_validate = (EditText)findViewById(R.id.phone_number);\n String phone_num = phone_num_validate.getText().toString();\n\n\n if (name.length()==0 || email.length()==0 || phone_num.length()==0)//Checking if any one of the compulsory fields is not filled\n Toast.makeText(getApplicationContext(),\"Fill the compulsory fields\", Toast.LENGTH_SHORT).show();\n\n else if (!(email.matches(emailPattern)))//Checking the e-mail pattern\n Toast.makeText(getApplicationContext(),\"Incorrect Email Format\", Toast.LENGTH_SHORT).show();\n\n else if(phone_num.length()!=10)//Checking the phone number length\n Toast.makeText(getApplicationContext(),\"Incorrect Phone Number\", Toast.LENGTH_SHORT).show();\n\n\n else//If everything is as required then message is displayed showing \"Registered for (Name of the Event)\"\n {\n Toast.makeText(getApplicationContext(), \"Registered for \"+data[pos][8], Toast.LENGTH_SHORT).show();\n finish();\n }\n }", "public String validate() {\n\t\tString msg=\"\";\n\t\t// for name..\n\t\tif(name==null||name.equals(\"\"))\n\t\t{\n\t\t\tmsg=\"Task name should not be blank or null\";\n\t\t}\n\t\tif(name.split(\" \").length>1)\n\t\t{\n\t\t\tmsg=\"multiple words are not allowed\";\n\t\t}\n\t\telse\n\t\t{\n\t\t for(int i=0;i<name.length();i++)\n\t\t {\n\t\t\t char c=name.charAt(i);\n\t\t\t\tif(!(Character.isDigit(c)||Character.isLetter(c)))\n\t\t\t\t{\n\t\t\t\t\tmsg=\"special characters are not allowed\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t }\n\t\t}\n\t\t\t\n\t\t\n\t\t\t// for Description...\n\t\t\tif(desc==null||desc.equals(\"\"))\n\t\t\t{\n\t\t\t\tmsg=\"Task descrshould not be blank or null\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t // for tag...\n\t\t\t \n\t\t\t if(tag==null||tag.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tmsg=\"Task tags not be blank or null\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t // for date { imp here}\n\t\t\t if(tarik!=null)\n\t\t\t {\n\t\t\t SimpleDateFormat sdf=new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\t sdf.setLenient(false); // very imp here..\n\t\t\t try {\n\t\t\t\tDate d=sdf.parse(tarik);\n\t\t\t} catch (ParseException e) {\n\t\t\t\t\n\t\t\t//\tmsg=\"date should be correct foramat\";\n\t\t\t\tmsg=e.getMessage();\n\t\t\t}\n\t\t\t }\n\t\t\t// for prority..\n\t\t\t if(prio<1&&prio>10)\n\t\t\t {\n\t\t\t\t msg=\"prority range is 1 to 10 oly pa\";\n\t\t\t }\n\t\t\t\t\n\t\t\t\tif(msg.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\treturn Constant.SUCCESS;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\treturn msg;\n\t}", "public interface ValidacionConstantes {\n\t\n\t/**\n\t * Expresión regular para validar correos electrónicos.\n\t */\n\tString EXPR_REG_EMAIL = \"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"\"\n\t\t\t+ \"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x\"\n\t\t\t+ \"0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-\"\n\t\t\t+ \"9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4\"\n\t\t\t+ \"][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\"\n\t\t\t+ \"-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\n\t\n\t\n\t/*\n\t * Mensajes de validación\n\t */\n\t\n\t\n\tString MSG_EMAIL_REQUERIDO = \"Correo electrónico no válido\";\n\t\n\t\n\n}", "private boolean validateForm() {\n\n String email = mEditTextViewEmail.getText().toString();\n if (TextUtils.isEmpty(email)) {\n mTextInputLayoutEmail.setError(\"Emaill Id Required\");\n Toast.makeText(MainActivity.this, \"Email field required\", Toast.LENGTH_SHORT).show();\n return false;\n } else if (!isEmailValid(email)) {\n mTextInputLayoutEmail.setError(\"A valid Email id is required\");\n return false;\n } else {\n mTextInputLayoutEmail.setError(null);\n }\n\n String password = mEditTextViewPassword.getText().toString();\n if (TextUtils.isEmpty(password)) {\n mTextInputLayoutPassword.setError(\"Password required\");\n Toast.makeText(MainActivity.this, \"Password field required\", Toast.LENGTH_SHORT).show();\n return false;\n } else if (!isPasswordValid(password)) {\n mTextInputLayoutPassword.setError(\"Password must be at least 6 characters\");\n return false;\n } else {\n mTextInputLayoutPassword.setError(null);\n }\n\n return true;\n }", "public String CheckPostCode (HashMap<String, ?> InputObj) throws NoSuchElementException {\n\t\tString outRetVal = \"-1\";\n\t\t\n\t\tString inCountryCode = InputObj.get(\"CountryCode\").toString();\n\t\tString inPostCode = InputObj.get(\"PostCode\").toString();\n\t\t\n\t\tCustSiteEditorObj Obj = new CustSiteEditorObj(webdriver);\n\t\t\n\t\tWebElement TxtCountryCode = Obj.getTxtCountryCode();\n\t\tif (!TxtCountryCode.getAttribute(\"value\").equals(inCountryCode)) {\n\t\t\tTxtCountryCode.clear();\n\t\t\tTxtCountryCode.sendKeys(inCountryCode);\n\t\t\tWebElement TxtPostCode = Obj.getTxtPostCode();\n\t\t\tTxtPostCode.click();\n\t\t}\n\t\t\n\t\tboolean isCountryCodeMsgExist = SeleniumUtil.isWebElementExist(webdriver, Obj.getLblCountryCodeMessageLocator(), 1);\n\t\tif (isCountryCodeMsgExist) {\n\t\t\tWebElement LblCountryCodeMessage = Obj.getLblCountryCodeMessage();\n\t\t\tboolean isVisible = LblCountryCodeMessage.isDisplayed();\n\t\t\tif (isVisible) {\n\t\t\t\tCommUtil.logger.info(\" > Msg: \"+LblCountryCodeMessage.getText());\n\t\t\t\tif (CommUtil.isMatchByReg(LblCountryCodeMessage.getText(), \"Only 2 characters\")) {\n\t\t\t\t\toutRetVal = \"1\";\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t} else {\n\t\t\t\t\tCommUtil.logger.info(\" > Unhandled message.\");\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tWebElement TxtPostCode = Obj.getTxtPostCode();\n\t\tif (!TxtPostCode.getAttribute(\"value\").equals(inPostCode)) {\n\t\t\tTxtPostCode.clear();\n\t\t\tTxtPostCode.sendKeys(inPostCode);\n\t\t\tTxtCountryCode = Obj.getTxtCountryCode();\n\t\t\tTxtCountryCode.click();\n\t\t}\t\n\t\t\n\t\tboolean isPostCodeMsgExist = SeleniumUtil.isWebElementExist(webdriver, Obj.getLblPostCodeMessageLocator(), 1);\n\t\tif (isPostCodeMsgExist) {\n\t\t\tWebElement LblPostCodeMessage = Obj.getLblPostCodeMessage();\n\t\t\tboolean isVisible = LblPostCodeMessage.isDisplayed();\n\t\t\tif (isVisible) {\n\t\t\t\tCommUtil.logger.info(\" > Msg: \"+LblPostCodeMessage.getText());\n\t\t\t\tif (CommUtil.isMatchByReg(LblPostCodeMessage.getText(), \"Only 5 digits\")) {\n\t\t\t\t\toutRetVal = \"2\";\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t} else if (CommUtil.isMatchByReg(LblPostCodeMessage.getText(), \"Only alpha numeric dash space\")) {\n\t\t\t\t\toutRetVal = \"3\";\n\t\t\t\t\treturn outRetVal;\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tCommUtil.logger.info(\" > Unhandled message.\");\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\toutRetVal = \"0\";\n\t\treturn outRetVal;\n\t\t\n\t}", "public abstract FieldReport validate(int fieldSequence, Object fieldValue);", "boolean validateMailAddress(final String mailAddress);", "@Test\n public void testBasicValid() {\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"admin@mailserver1\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"user%[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n }", "public void validate_the_Country_of_Correspondence_Address_in_Customer_Tab(String Country)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Country\").replaceAll(\"M_InnerText\", Country), \"Country of Correspondence Address - \"+Country, false);\n\t}", "private boolean validateInputInfo(){\n\n //Get user input\n String firstName = newContactFirstName.getText().toString();\n String lastName = newContactLastName.getText().toString();\n String email = newContactEmailAddress.getText().toString();\n String phone = newContactPhoneNumber.getText().toString();\n\n //Check to make sure no boxes were left empty\n if(firstName.isEmpty() || lastName.isEmpty() || email.isEmpty() || phone.isEmpty()){\n Toast.makeText(this, \"You must fill all fields before continuing!\", Toast.LENGTH_LONG).show();\n return false;\n }\n //Check to see if phone number is valid\n else if(!(phone.length() >= 10)){\n Toast.makeText(this, \"Make sure to input a valid 10 digit phone number!\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n return true;\n }", "private boolean validateData() {\n if (!mCommon.validateData()) return false;\n\n Core core = new Core(this);\n\n // Due Date is required\n if (TextUtils.isEmpty(getRecurringTransaction().getDueDateString())) {\n core.alert(R.string.due_date_required);\n return false;\n }\n\n if (TextUtils.isEmpty(mCommon.viewHolder.dateTextView.getText().toString())) {\n core.alert(R.string.error_next_occurrence_not_populate);\n\n return false;\n }\n\n // Payments Left must have a value\n if (getRecurringTransaction().getPaymentsLeft() == null) {\n core.alert(R.string.payments_left_required);\n return false;\n }\n return true;\n }", "public void validate_the_Email_Address_1_of_Security_in_Customer_Tab(String EmailAddress1)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Email Address 1\").replaceAll(\"M_InnerText\", EmailAddress1), \"Email Address 1 - \"+EmailAddress1, false);\n\t}", "private boolean getValidation() {\n strLoginMail = inputLoginMail.getText().toString().trim();\n strLoginPass = inputLoginPass.getText().toString().trim();\n\n if (strLoginMail.isEmpty()) { // Check Email Address\n inputLoginMail.setError(getString(dk.eatmore.demo.R.string.email_blank));\n inputLoginMail.requestFocus();\n return false;\n } else if (!isValidEmail(strLoginMail)) {\n inputLoginMail.setError(getString(dk.eatmore.demo.R.string.invalid_email));\n inputLoginMail.requestFocus();\n return false;\n } else if (strLoginPass.isEmpty()) { // Check Password\n inputLoginPass.setError(getString(dk.eatmore.demo.R.string.password_empty));\n inputLoginPass.requestFocus();\n return false;\n }\n\n return true;\n }", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "@Test\r\n\tpublic void TC_05_verify_email_Mandatory_Field() {\r\n\r\n\t\thomePgObj = new Page_Home(driver);\r\n\t\tregPgObj = homePgObj.click_RegistrationLink();\r\n\t\t\r\n\t\t// Step 1: Verify the registration page is displayed\r\n\t\t\r\n\t\tflag = regPgObj.registrationPgDisplay();\r\n\t\tAssert.assertTrue(flag, \"Registration page is displayed\");\r\n\t\t\r\n\t\t// Step 2: Enter valid/mandatory registration details except email address\r\n\t\tregPgObj.enterRegistrationDetails(\"firstName\", firstName);\r\n\t\tregPgObj.enterRegistrationDetails(\"lastName\", lastName);\r\n\t\tregPgObj.enterRegistrationDetails(\"email\", \"\");\r\n\t\tregPgObj.enterRegistrationDetails(\"password\", password);\r\n\t\tregPgObj.enterRegistrationDetails(\"confirmPassword\", confirmPassword);\r\n\t\t\r\n\t\t// Step 3: Click on Sign in button\r\n\t\tregPgObj.clickSignInButton();\r\n\t\t// Step 4: Verify user should NOT be able to proceed further with registration as proper validation message regarding email address\r\n\t\t// is displayed\r\n\t\terrMsg = Page_Registration.getMandatoryFieldErrMsg();\r\n\t\tAssert.assertEquals(errMsg, \"Please enter a value for Email\");\r\n\r\n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "private int completionCheck() {\n if (nameTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(1);\n return -1;\n }\n if (addressTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(2);\n return -1;\n }\n if (postCodeTB.getText().trim().isEmpty()){\n AlertMessage.addCustomerError(3);\n return -1;\n }\n if (countryCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(4);\n return -1;\n }\n if (stateProvinceCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(5);\n return -1;\n }\n if (phone.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(6);\n return -1;\n }\n return 1;\n }", "private boolean validate(){\n return EditorUtils.editTextValidator(generalnformation,etGeneralnformation,\"Type in information\") &&\n EditorUtils.editTextValidator(symptoms,etSymptoms, \"Type in symptoms\") &&\n EditorUtils.editTextValidator(management,etManagement, \"Type in management\");\n }", "private void checkValidation() {\n String getInstituteName = NameofInstitute.getText().toString();\n String getDegreename = SpinnerDegree.getSelectedItem().toString();\n\n\n // Check if all strings are null or not\n if (getInstituteName.equals(\"\") || getInstituteName.length() == 0 || getDegreename.equals(\"\") || getDegreename.length() == 0)\n new CustomToast().Show_Toast(getActivity(), getView(),\"All fields are required.\");\n // Else do signup or do your stuff\n else {\n //Toast.makeText(getActivity(), \"All Ok till Now\", Toast.LENGTH_SHORT).show();\n AddQualifications(getDegreename,getInstituteName);\n }\n\n }", "public void validate_the_Telephone_Mobile_in_Contact_Details_of_Customer_Tab(String TelephoneMobile)throws Exception {\n\t\tReport.fnReportPageBreak(\"Telephone Details\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneMobile.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Mobile\").replaceAll(\"M_InnerText\", TelephoneMobile), \"Telephone - Mobile - \"+TelephoneMobile, false);\n\t}", "void fiscalCodeValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data\n person.setFiscalCode(null);\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n person.setFiscalCode(\"A\");\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }", "public PaymentRequestPage validateNEFTFieldErrorMessages() {\r\n\r\n\t\treportStep(\"About to validate the NEFT field error validation - \", \"INFO\");\r\n\r\n\t\tvalidateTheElementPresence(nameOfBankAccountHolderName);\r\n\t\tvalidateTheElementPresence(pleaseEnterValidACHolderName);\r\n\t\tvalidateTheElementPresence(bank_Name);\r\n\t\tvalidateTheElementPresence(pleaseEnterValidBankName);\r\n\t\tvalidateTheElementPresence(bank_BranchName);\r\n\r\n\t\tscrollFromDownToUpinApp();\r\n\r\n\t\tvalidateTheElementPresence(pleaseEnterBranchNameOr4DigitBranchCode);\r\n\t\tvalidateTheElementPresence(bank_AccountNumber);\r\n\t\tscrollFromDownToUpinApp();\t\t\r\n\t\tvalidateTheElementPresence(pleaseEnterTheBankAccountNum);\r\n\t\tscrollFromDownToUpinApp();\t\t\r\n\t\tvalidateTheElementPresence(ifscCodeForBank);\r\n\t\tvalidateTheElementPresence(pleaseEnterTheIFSC);\r\n\r\n\t\treturn this;\r\n\r\n\t}", "UserPayment validate(String cardHolderName,String cardType,String securityCode,String paymentType);" ]
[ "0.6606611", "0.6361711", "0.6284672", "0.6172129", "0.6052491", "0.6043319", "0.5987236", "0.5976068", "0.59483796", "0.59402704", "0.58826256", "0.5823812", "0.57325524", "0.5728297", "0.57203543", "0.56830764", "0.566869", "0.56646454", "0.5651075", "0.56432354", "0.5639503", "0.5623567", "0.56228226", "0.5615433", "0.5611379", "0.56066877", "0.55990607", "0.5588715", "0.5588011", "0.5570409", "0.5568128", "0.556341", "0.555019", "0.55401564", "0.5527415", "0.5526029", "0.5516996", "0.5516783", "0.5507338", "0.5496248", "0.5491675", "0.54913086", "0.54902977", "0.5462698", "0.5451099", "0.54494435", "0.5442417", "0.5440489", "0.54179895", "0.5414369", "0.54100555", "0.54068357", "0.540406", "0.54014033", "0.5397136", "0.5397136", "0.53840584", "0.53827757", "0.53802866", "0.5372171", "0.53667593", "0.53636086", "0.5359751", "0.53486454", "0.5346377", "0.53317815", "0.5331491", "0.532494", "0.53228134", "0.5320749", "0.531565", "0.5306416", "0.5305476", "0.53035325", "0.5299234", "0.52986723", "0.52947", "0.5275255", "0.5269417", "0.5266573", "0.5263839", "0.5262409", "0.5260499", "0.5257925", "0.5257266", "0.524892", "0.5246293", "0.5245199", "0.5244452", "0.5243964", "0.5242097", "0.5232696", "0.5231057", "0.522993", "0.5228787", "0.52239525", "0.5218714", "0.521491", "0.5214696", "0.5214133" ]
0.67735
0
Validation Functions Description : To validate the Preferred Contact Method in Contact Details of Customer Tab for Mail Coded by :Rajan Created Data:23 Oct 2016 Last Modified Date: Modified By: Parameter:
public void validate_the_Preferred_Contact_Method_in_Contact_Details_of_Customer_Tab_Mail(boolean status)throws Exception { boolean checked=VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll("M_Header", "Contact Details").replaceAll("M_Category", "Preferred Contact Method").replaceAll("M_InnerText", "Mail"), "Preferred Contact Method on Mail "); if(checked==status) Report.fnReportPass("Preferred Contact Method - Mail : Checked status = "+status+"Display Status"+checked, driver); else Report.fnReportFail("Preferred Contact Method - Mail : Checked status = "+status+"Display Status"+checked, driver); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Preferred_Contact_Method_in_Contact_Details_of_Customer_Tab_Email(boolean status)throws Exception {\n\t\t\t\n\t\t\tboolean checked=VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Preferred Contact Method\").replaceAll(\"M_InnerText\", \"Email\"), \"Preferred Contact Method on Email \");\n\t\t\t\n\t\t\tif(checked==status)\n\t\t\t\tReport.fnReportPass(\"Preferred Contact Method - Email : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\telse\n\t\t\t\tReport.fnReportFail(\"Preferred Contact Method - Email : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\n\t\t\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "public void validate_the_Preferred_Contact_Method_in_Contact_Details_of_Customer_Tab_SMS(boolean status)throws Exception {\n\t\t\t\n\t\t\tboolean checked=VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Preferred Contact Method\").replaceAll(\"M_InnerText\", \"SMSPreference\"), \"Preferred Contact Method on SMS \");\n\t\t\t\n\t\t\tif(checked==status)\n\t\t\t\tReport.fnReportPass(\"Preferred Contact Method - SMS : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\telse\n\t\t\t\tReport.fnReportFail(\"Preferred Contact Method - SMS : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\n\t\t\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "@Override\n public void validate() {\n boolean b = false;\n\n //retrieving the contact us form details from request object\n String firstName = objContactUsForm.getName().trim();\n String email = objContactUsForm.getEmail().trim();\n String message = objContactUsForm.getMessage().trim();\n\n //now validating each of the field\n if (firstName.isEmpty()) {\n addFieldError(\"name\", getText(\"name.required\"));\n b = true;\n }\n\n if (email.isEmpty()) {\n addFieldError(\"email\", getText(\"email.required\"));\n b = true;\n }\n if (!b) {\n Pattern p = Pattern.compile(\".+@.+\\\\.[a-z]+\");\n Matcher m = p.matcher(email);\n boolean matchFound = m.matches();\n if (!matchFound) {\n addFieldError(\"email\", \"Please Provide Valid Email ID\");\n }\n }\n\n if (message.isEmpty()) {\n addFieldError(\"message\", getText(\"message.required\"));\n b = true;\n }\n\n if (!b) {\n boolean matches = message.matches(\"[<>!~@$%^&\\\"|!\\\\[#$]\");\n if (matches) {\n addFieldError(\"message\", \"Please Provide Valid Message Name\");\n b = true;\n }\n }\n }", "protected void validateEmail(){\n\n //Creating Boolean Value And checking More Accurate Email Validator Added\n\n Boolean email = Pattern.matches(\"^[A-Za-z]+([.+-]?[a-z A-z0-9]+)?@[a-zA-z0-9]{1,6}\\\\.[a-zA-Z]{2,6},?([.][a-zA-z+,]{2,6})?$\",getEmail());\n System.out.println(emailResult(email));\n }", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public void validateMailAlerts() {\n System.out.println(\"Validating Mail Alerts\");\n boolean mailPasstoCheck = false, mailPassccCheck = false, mailFailtoCheck = false, mailFailccCheck = false;\n\n if (!mailpassto.getText().isEmpty()) {\n\n String[] emailAdd = mailpassto.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailPasstoCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". To Email address for passed test cases should not be empty.\\n\");\n\n }\n if (!mailpasscc.getText().isEmpty()) {\n String[] emailAdd = mailpasscc.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailPassccCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". CC Email address for passed test cases should not be empty.\\n\");\n\n }\n if (!mailfailto.getText().isEmpty()) {\n String[] emailAdd = mailfailto.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailFailtoCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". To Email address for failed test cases should not be empty.\\n\");\n\n }\n if (!mailfailcc.getText().isEmpty()) {\n String[] emailAdd = mailfailcc.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailFailccCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n } else {\n execptionData.append((++exceptionCount) + \".CC Email address for failed test cases should not be empty.\\n\");\n\n }\n\n if (mailPasstoCheck == true && mailPassccCheck == true && mailFailccCheck == true && mailFailtoCheck == true) {\n /*try {\n Properties connectionProperties = new Properties();\n String socketFactory_class = \"javax.net.ssl.SSLSocketFactory\"; //SSL Factory Class\n String mail_smtp_auth = \"true\";\n connectionProperties.put(\"mail.smtp.port\", port);\n connectionProperties.put(\"mail.smtp.socketFactory.port\", socketProperty);\n connectionProperties.put(\"mail.smtp.host\", hostSmtp.getText());\n connectionProperties.put(\"mail.smtp.socketFactory.class\", socketFactory_class);\n connectionProperties.put(\"mail.smtp.auth\", mail_smtp_auth);\n connectionProperties.put(\"mail.smtp.socketFactory.fallback\", \"false\");\n connectionProperties.put(\"mail.smtp.starttls.enable\", \"true\");\n Mail mail = new Mail(\"\");\n mail.createSession(fromMail.getText(), password.getText(), connectionProperties);\n mail.sendEmail(fromMail.getText(), mailpassto.getText(), mailpasscc.getText(), \"Test Mail from FACT\", \"Hi, This is the Test Mail for the FACT Tool\", \"\");\n mail.sendEmail(fromMail.getText(), mailfailto.getText(), mailfailcc.getText(), \"Test Mail from FACT\", \"Hi, This is the Test Mail for the FACT Tool\", \"\");*/\n mailAlertsCheck = true;\n /* } catch (IOException ex) {\n Logger.getLogger(ConfigFile.class.getName()).log(Level.SEVERE, null, ex);\n mailAlertsCheck = false;\n new ExceptionUI(ex);\n } catch (MessagingException ex) {\n Logger.getLogger(ConfigFile.class.getName()).log(Level.SEVERE, null, ex);\n mailAlertsCheck = false;\n new ExceptionUI(ex);\n }*/\n } else {\n mailAlertsCheck = false;\n mailPasstoCheck = false;\n mailPassccCheck = false;\n mailFailtoCheck = false;\n mailFailccCheck = false;\n }\n\n }", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "void telephoneValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"+391111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"1111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"111 1111111\");\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data\n person.setTelephone(\"AAA\");\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }", "public void validate_the_Telephone_Home_in_Contact_Details_of_Customer_Tab(String TelephoneHome)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneHome.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Home\").replaceAll(\"M_InnerText\", TelephoneHome), \"Telephone - Home - \"+TelephoneHome, false);\n\t}", "abstract void telephoneValidity();", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private void checkFields() {\n\t\t\n\t\tboolean errors = false;\n\t\t\n\t\t// contact name\n\t\tString newName = ((TextView) findViewById(R.id.tvNewContactName)).getText().toString();\n\t\tTextView nameErrorView = (TextView) findViewById(R.id.tvContactNameError);\n\t\tif(newName == null || newName.isEmpty()) {\n\t\t\terrors = true;\n\t\t\tnameErrorView.setText(\"Contact must have a name!\");\n\t\t} else {\n\t\t\tnameErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact phone number\n\t\tString newPhone = ((TextView) findViewById(R.id.tvNewContactPhone)).getText().toString();\n\t\tTextView phoneNumberErrorView = (TextView) findViewById(R.id.tvContactPhoneError);\n\t\tif(newPhone == null || newPhone.isEmpty()) {\n\t\t\terrors = true;\n\t\t\tphoneNumberErrorView.setText(\"Contact must have a phone number!\");\n\t\t} else {\n\t\t\tphoneNumberErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact e-mail\n\t\tString newEmail= ((TextView) findViewById(R.id.tvNewContactEmail)).getText().toString();\n\t\tTextView emailErrorView = (TextView) findViewById(R.id.tvContactEmailError);\n\t\tif(newEmail == null || newEmail.isEmpty()) {\n\t\t\terrors = true;\n\t\t\temailErrorView.setText(\"Contact must have an E-mail!\");\n\t\t} else if (!newEmail.matches(\".+@.+\\\\..+\")) {\n\t\t\terrors = true;\n\t\t\temailErrorView.setText(\"Invalid E-mail address! Example:\"\n\t\t\t\t\t+ \"[email protected]\");\n\t\t} else {\n\t\t\temailErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact note\n\t\tString newNote = ((TextView) findViewById(R.id.tvNewContactNote)).getText().toString();\n\t\t\n\t\t// contact Facebook profile address\n\t\tString newAddress = ((TextView) findViewById(R.id.tvNewContactAddress)).getText().toString();\n\t\t\n\t\t// save the new contact if all the required fields are filled out\n\t\tif(!errors) {\n\t\t\tif(newNote == null || newNote.isEmpty()) {\n\t\t\t\tnewNote = \"No note.\";\n\t\t\t}\n\t\t\t\n\t\t\tif(newAddress == null || newAddress.isEmpty()) {\n\t\t\t\tnewAddress = \"No address.\";\n\t\t\t}\n\t\t\tHomeActivity.listOfContacts.add(new Contact(newName, newPhone, newEmail, \n\t\t\t\t\tnewNote, newAddress));\n\t\t\tIntent intent = new Intent(AddContactActivity.this, HomeActivity.class);\n\t\t\tstartActivity(intent);\n\t\t}\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "public void checkvalidate()\n\t{\n\t\tif((fn.getText().toString()).equals(\"\"))\n \t{\n \t\t//text1.setText(\"Name not entered!!\");\n\t\t\tToast.makeText(AddContact.this, \"Name Not Entered\",Toast.LENGTH_SHORT).show();\n \t}\n \telse if((mobno.getText().toString()).equals(\"\"))\n \t{\n \t\t//text1.setText(\"Phone not entered!!\");\n \t\tToast.makeText(AddContact.this, \"Phone No. not Entered\",Toast.LENGTH_SHORT).show();\n \t}\t\n \telse\n \t{\n \t\tname=fn.getText().toString();\n\t\t\tstrln=ln.getText().toString();\n\t\t\t//mname=mn.getText().toString();\n\t\t\tstrmno=mobno.getText().toString();\n\t\t\tstreid=eid.getText().toString();\n\t\t\tstrtag_type=stag.getSelectedItem().toString();\n\t\t\tstrtag=tag.getText().toString();\n\t\t\tmshome=mhome.getText().toString();\n\t\t\tmswork=mwork.getText().toString();\n\t\t\tmsother=moth.getText().toString();\n\t\t\teswork=ework.getText().toString();\n\t\t\tesother=eoth.getText().toString();\n\t\t\tnotes=enotes.getText().toString();\n\t\t\tdata.Insert(name,mname,strln,strmno,mshome,mswork,msother,mscust, streid,eswork,esother,mscust,imagePath,strtag_type,strtag,0,date,time,notes,0);\n\t\t\tToast.makeText(AddContact.this, \"Added Successfully\",Toast.LENGTH_SHORT).show();\n\t\t\tCursor c=data.getData();\n\t\t\twhile(c.moveToNext())\n\t\t\t{\n\t\t\t\tString name1=c.getString(0);\n\t\t\t\tSystem.out.println(\"Name:\"+name1);\n\t\t\t\t\n\t\t\t}\n\t\t\tc.close();\n\t\t\tviewcontacts();\n \t}\n\t\t\n\t}", "public static void validation() {\n\t\tif ((!textFieldName.getText().isEmpty()) && (!textField_FirstName.getText().isEmpty())\n\t\t\t\t&& (!textField_Town.getText().isEmpty()) && (!textField_Town.getText().isEmpty())) {\n\n\t\t\tif ((isValidEmailAddress(textField_Email.getText()) == true)) {\n\t\t\t\ttextField_Email.setBackground(Color.white);\n\t\t\t\tif ((force(textField_Mtp.getText()) > 82)) {\n\t\t\t\t\ttextField_Mtp.setBackground(Color.white);\n\t\t\t\t\tactionGiveServeur();\n\n\t\t\t\t} else {\n\t\t\t\t\tshowMessageDialog(null, \"Votre mot de passe est trop faible\");\n\t\t\t\t\ttextField_Mtp.setText(\"Mot de passe trop simple : changer le \");\n\t\t\t\t\ttextField_Mtp.setBackground(Color.RED);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextField_Email.setText(\"Email invalide\");\n\t\t\t\ttextField_Email.setBackground(Color.RED);\n\t\t\t\tshowMessageDialog(null, \"Email est invalide\");\n\t\t\t}\n\t\t} else {\n\n\t\t\tshowMessageDialog(null, \"Certain champs sont vide !\");\n\t\t}\n\t}", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "void validateMobileNumber(String stringToBeValidated,String name);", "public static void validate() {\r\n\t\tfrmMfhEmailer.validate();\r\n\t}", "abstract void fiscalCodeValidity();", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "public boolean validateFields(Customer customer) {\r\n if (isEmpty(customer.getFirstName(), customer.getLastName(), customer.getPhoneNum(),\r\n customer.getEmail(), customer.getDate())) {\r\n Alert alert = new Alert(Alert.AlertType.WARNING);\r\n alert.setTitle(\"Invalid info\");\r\n alert.setHeaderText(null);\r\n alert.setContentText(\"Invalid info.\\nAll fields must be filled.\");\r\n alert.showAndWait();\r\n return false;\r\n }\r\n return true;\r\n }", "private void validateFields(){\n String email = edtEmail.getText().toString().trim();\n String number=edtPhone.getText().toString().trim();\n String cc=txtCountryCode.getText().toString();//edtcc.getText().toString().trim();\n String phoneNo=cc+number;\n // Check for a valid email address.\n\n\n if (TextUtils.isEmpty(email)) {\n mActivity.showSnackbar(getString(R.string.error_empty_email), Toast.LENGTH_SHORT);\n return;\n\n } else if (!Validation.isValidEmail(email)) {\n mActivity.showSnackbar(getString(R.string.error_title_invalid_email), Toast.LENGTH_SHORT);\n return;\n\n }\n\n if(TextUtils.isEmpty(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_empty_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n if(!Validation.isValidMobile(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_title_invalid_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n\n if(selectedCurrency==null){\n //mActivity.showSnackbar(getString(R.string.str_select_currency), Toast.LENGTH_SHORT);\n Snackbar.make(getView(),\"Currency data not found!\",Snackbar.LENGTH_LONG)\n .setAction(\"Try again\", new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n getAllCurrency();\n }\n }).show();\n return;\n }\n try {\n JsonObject object = new JsonObject();\n object.addProperty(KEY_EMAIL, email);\n object.addProperty(KEY_PHONE,phoneNo);\n object.addProperty(KEY_CURRENCY,selectedCurrency.getId().toString());\n updateUser(object,token);\n }catch (Exception e){\n\n }\n\n }", "private boolean isInfoValidate(){\n if(mEmailAddress.getText() == null || mEmailAddress.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_email_address);\n return false;\n }\n\n if(!mEmailAddress.getText().toString().contains(\"@\")){\n errorText = getString(R.string.register_warning_valid_email_address);\n return false;\n }\n\n// if(mRegionSpinner.getSelectedItemPosition() == Constant.NON_SELECT){\n// errorText = getString(R.string.register_warning_select_region);\n// return false;\n// }\n\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.HONG_KONG)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.HONGKONG_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n//\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.CHINA)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.CHINA_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n\n if(mPassword.getText() == null || mPassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_password);\n return false;\n }\n\n if(mRetypePassword.getText() == null || mRetypePassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_retype_password);\n return false;\n }\n\n if(!mPassword.getText().toString().equals(mRetypePassword.getText().toString())){\n errorText = getString(R.string.register_warning_not_the_same);\n return false;\n }\n\n if(!Utility.judgeContainsStr( mPassword.getText().toString())){\n errorText = getString(R.string.register_warning_contains_character);\n return false;\n }\n\n// if(!mPolicyCheckBox.isChecked()){\n// errorText = getString(R.string.register_warning_check_agreement);\n// return false;\n// }\n\n return true;\n }", "private void validateDetails() {\n\n clearErrors();\n Utils.hide_keyboard(getActivity());\n\n boolean valid = true;\n\n String cvv = cvvTv.getText().toString();\n String expiryDate = cardExpiryTv.getText().toString();\n String cardNo = cardNoTv.getText().toString();\n\n if (cvv.length() < 3) {\n valid = false;\n cvvTil.setError(\"Enter a valid cvv\");\n }\n\n if (expiryDate.length() != 5) {\n cardExpiryTil.setError(\"Enter a valid expiry date\");\n valid = false;\n }\n\n String cardNoStripped = cardNo.replaceAll(\"\\\\s\", \"\");\n\n if (cardNoStripped.length() < 12 ) {\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n else {\n try {\n Long parsed = Long.parseLong(cardNoStripped);\n }\n catch (Exception e) {\n e.printStackTrace();\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n }\n\n if (valid) {\n\n if (saveCardSwitch.isChecked()) {\n int cardLen = cardNoStripped.length();\n cardFirst6 = cardNoStripped.substring(0, 6);\n cardLast4 = cardNoStripped.substring(cardLen - 4, cardLen);\n shouldISaveThisCard = true;\n presenter.savePotentialCardDets(cardFirst6, cardLast4);\n }\n\n //make request\n PayloadBuilder builder = new PayloadBuilder();\n builder.setAmount(thetellerInitializer.getAmount() + \"\")\n .setNarration(thetellerInitializer.getNarration())\n .setCardno(cardNoStripped)\n .set3dUrl(thetellerInitializer.get3dUrl())\n .setEmail(thetellerInitializer.getEmail())\n .setCurrency(thetellerInitializer.getCurrency())\n .setMerchant_id(thetellerInitializer.getMerchant_id())\n .setCvv(cvv).setFirstname(thetellerInitializer.getfName())\n .setLastname(thetellerInitializer.getlName())\n .setIP(Utils.getDeviceImei(getActivity()))\n .setTxRef(thetellerInitializer.getTxRef())\n .setExpiryyear(expiryDate.substring(3,5))\n .setExpirymonth(expiryDate.substring(0,2))\n .setMeta(thetellerInitializer.getMeta())\n .setApiUser(thetellerInitializer.getApiUser())\n .setApiKey(thetellerInitializer.getApiKey())\n .setDevice_fingerprint(Utils.getDeviceImei(getActivity()))\n .setCardType(cardType);\n\n if (thetellerInitializer.getPayment_plan() != null) {\n builder.setPaymentPlan(thetellerInitializer.getPayment_plan());\n }\n\n body = builder.createPayload();\n\n presenter.chargeCard(body, thetellerConstants.API_KEY);\n }\n }", "private boolean validate() {\n if(edtMobileNumber.getText().toString().length() <= 0){\n edtMobileNumber.setFocusable(true);\n edtMobileNumber.setError(Constants.ERR_MSG_MOBILE);\n return false;\n }else if(edtFirstName.getText().toString().length() <= 0){\n edtFirstName.setFocusable(true);\n edtFirstName.setError(Constants.ERR_MSG_FIRST_NAME);\n return false;\n }else if(edtLastName.getText().toString().length() <= 0){\n edtLastName.setFocusable(true);\n edtLastName.setError(Constants.ERR_MSG_LAST_NAME);\n return false;\n }else if(edtDateOfBirth.getText().toString().length() <= 0){\n edtDateOfBirth.setFocusable(true);\n edtDateOfBirth.setError(Constants.ERR_MSG_DATE_OF_BIRTH);\n return false;\n }else if(edtEnterPin.getText().toString().length() <= 0){\n edtEnterPin.setFocusable(true);\n edtEnterPin.setError(Constants.ERR_MSG_PIN);\n return false;\n }else if(edtConfirmPin.getText().toString().length() <= 0){\n edtConfirmPin.setFocusable(true);\n edtConfirmPin.setError(Constants.ERR_MSG_CONFIRM_PIN);\n return false;\n }else if(spnStatus.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_STATUS, Toast.LENGTH_SHORT).show();\n return false;\n }else if(spnBloodGroup.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_BLOOD_GROUP, Toast.LENGTH_SHORT).show();\n return false;\n }else if(rgGender.getCheckedRadioButtonId() == -1){\n Toast.makeText(context,Constants.ERR_MSG_GENDER,Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "private boolean revisarFormatoCorreo() {\n\t\tString correoE = this.campoCorreo.getText();\n\t\tPattern pat = Pattern.compile(\"^[\\\\w-]+(\\\\.[\\\\w-]+)*@[\\\\w-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\");\n\t\tMatcher mat = pat.matcher(correoE);\n\t\tif (mat.matches()) {\n\t\t\treturn true;\n\t\t} else\n\t\t\treturn false;\n\t}", "private boolean validate(String name, String phone, String email, String description) {\n if (name.equals(null) || name.equals(\"\") || !isValidMobile(phone) || !isValidMail(email) || description.equals(null) || description.equals(\"\")) {\n\n if (name.equals(null) || name.equals(\"\")) {\n nameText.setError(\"Enter a valid Name\");\n } else {\n nameText.setError(null);\n }\n if (!isValidMobile(phone)) {\n phoneNumber.setError(\"Enter a valid Mobile Number\");\n } else {\n phoneNumber.setError(null);\n }\n if (!isValidMail(email)) {\n emailText.setError(\"Enter a valid Email ID\");\n } else {\n emailText.setError(null);\n }\n if (description.equals(null) || description.equals(\"\")) {\n descriptionText.setError(\"Add few lines about you\");\n } else {\n descriptionText.setError(null);\n }\n return false;\n } else\n return true;\n }", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "private boolean validate(){\n\n String MobilePattern = \"[0-9]{10}\";\n String name = String.valueOf(userName.getText());\n String number = String.valueOf(userNumber.getText());\n\n\n if(name.length() > 25){\n Toast.makeText(getApplicationContext(), \"pls enter less the 25 characher in user name\",\n Toast.LENGTH_SHORT).show();\n return true;\n }\n\n\n\n else if(name.length() == 0 || number.length() == 0 ){\n Toast.makeText(getApplicationContext(), \"pls fill the empty fields\",\n Toast.LENGTH_SHORT).show();\n return false;\n }\n\n\n\n else if(number.matches(MobilePattern))\n {\n\n return true;\n }\n else if(!number.matches(MobilePattern))\n {\n Toast.makeText(getApplicationContext(), \"Please enter valid 10\" +\n \"digit phone number\", Toast.LENGTH_SHORT).show();\n\n\n return false;\n }\n\n return false;\n\n }", "@Override\n\tpublic Boolean isValidApplication(ApplicationBean applicationBean) {\n\t\tPattern namePattern=Pattern.compile(\"^[A-Za-z\\\\s]{3,}$\");\n\t\tMatcher nameMatcher=namePattern.matcher(applicationBean.getName());\n\t\tPattern dobPattern=Pattern.compile(\"^[0-3]?[0-9].[0-3]?[0-9].(?:[0-9]{2})?[0-9]{2}$\");\n\t\tMatcher dobMatcher=dobPattern.matcher(applicationBean.getDateOfBirth());\n\t\tPattern goalPattern=Pattern.compile(\"^[A-Za-z\\\\s]{1,}$\");\n\t\tMatcher goalMatcher=goalPattern.matcher(applicationBean.getGoals());\n\t\tPattern marksPattern=Pattern.compile(\"^[1-9][0-9]?$|^100$\");\n\t\tMatcher marksMatcher=marksPattern.matcher(applicationBean.getMarksObtained());\n\t\tPattern scheduleIdPattern=Pattern.compile(\"^[0-9]{1,2}$\");\n\t\tMatcher scheduleIdMatcher=scheduleIdPattern.matcher(applicationBean.getScheduledProgramID());\n\t\tPattern emailPattern=Pattern.compile(\"^[A-Za-z0-9+_.-]+@(.+)$\");\n\t\tMatcher emailMatcher=emailPattern.matcher(applicationBean.getEmailID());\n\t\t\n\t\t\n\t\tif(!(nameMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nApplicant Name Should Be In Alphabets and minimum 1 characters long.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(dobMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nDate of birth should be in DD/MM/YYYY format.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(goalMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\n Goal should be alphabetical and having minimum one letter\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(marksMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nMarks should be less than 100\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(scheduleIdMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nSchedule Id should be of one or two digit\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(emailMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nEnter valid email address\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public PersonInfo addPerson(PersonInfo p) {\n\t\tlog.info(\"Enter First Name\");\n\t\tString fname = obj.next();\n\t\tlog.info(\"Enter Last Name\");\n\t\tString lname = obj.next();\n\t\tlog.info(\"Enter Address\");\n\t\tString address = obj.next();\n\t\tlog.info(\"Enter City\");\n\t\tString city = obj.next();\n\t\tlog.info(\"Enter State\");\n\t\tString state = obj.next();\n\t\tlog.info(\"Enter the six digit Zip Code\");\n\t\tString zipCode = obj.next();\n\t\tString pattern3 = \"^[1-9]{1}[0-9]{5}$\";\n\t\tPattern zip_pattern = Pattern.compile(pattern3);\n\t\tMatcher m3 = zip_pattern.matcher(zipCode);\n\t\tif (m3.matches() == false) {\n\t\t\tlog.info(\"zip code not in format enter again\");\n\t\t\tzipCode = obj.next();\n\t\t}\n\t\tlog.info(\"Enter the ten digit Phone Number\");\n\t\tString phoneNo = obj.next();\n\t\tString pattern1 = \"^[1-9]{1}[0-9]{9}$\";\n\t\tPattern mobile_pattern = Pattern.compile(pattern1);\n\t\tMatcher m1 = mobile_pattern.matcher(phoneNo);\n\t\tif (m1.matches() == false) {\n\t\t\tlog.info(\"phone number not in format enter again\");\n\t\t\tphoneNo = obj.next();\n\t\t}\n\t\tlog.info(\"Enter Email\");\n\t\tString email = obj.next();\n\t\tString pattern2 = \"^[a-zA-Z0-9]+((\\\\.[0-9]+)|(\\\\+[0-9]+)|(\\\\-[0-9]+)|([0-9]))*@*+[a-zA-Z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\";\n\t\tPattern email_sample = Pattern.compile(pattern2);\n\t\tMatcher m2 = email_sample.matcher(email);\n\t\tif (m2.matches() == false) {\n\t\t\tlog.info(\"email not in format enter again\");\n\t\t\temail = obj.next();\n\t\t}\n\t\tp = new PersonInfo(fname, lname, address, city, state, zipCode, phoneNo, email);\n\t\treturn p;\n\t}", "private boolean validateForm() {\n Boolean validFlag = true;\n String email = emailTxt.getText().toString().trim();\n String name = nameTxt.getText().toString().trim();\n String phone = phoneTxt.getText().toString().trim();\n String password = passwordTxt.getText().toString();\n String confirPassWord = confirmPasswordTxt.getText().toString();\n\n Pattern emailP = Pattern.compile(\"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\", Pattern.CASE_INSENSITIVE);\n Matcher emailM = emailP.matcher(email);\n boolean emailB = emailM.find();\n\n if (TextUtils.isEmpty(email) || email.equals(\"\") || !emailB) {\n emailTxt.setError(\"Email bị để trống hoặc không dúng định dạng.\");\n validFlag = false;\n } else {\n emailTxt.setError(null);\n }\n\n if (TextUtils.isEmpty(password) || password.length() < 6) {\n passwordTxt.setError(\"Mật khẩu phải 6 ký tự trở lên\");\n validFlag = false;\n } else {\n passwordTxt.setError(null);\n }\n\n Pattern phoneP = Pattern.compile(\"[0-9]{8,15}$\");\n Matcher phoneM = phoneP.matcher(phone);\n boolean phoneB = phoneM.find();\n\n if (TextUtils.isEmpty(phone) || phone.length() < 8 || phone.length() > 15 || !phoneB) {\n phoneTxt.setError(\"Số điện thoại bị để trống hoặc không đúng định dạng\");\n validFlag = false;\n } else {\n phoneTxt.setError(null);\n }\n if (confirPassWord.length() < 6 || !confirPassWord.equals(password)) {\n confirmPasswordTxt.setError(\"Xác nhận mật khẩu không đúng\");\n validFlag = false;\n } else {\n confirmPasswordTxt.setError(null);\n }\n\n Pattern p = Pattern.compile(\"[0-9]\", Pattern.CASE_INSENSITIVE);\n Matcher m = p.matcher(name);\n boolean b = m.find();\n if (b) {\n nameTxt.setError(\"Tên tồn tại ký tự đặc biệt\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n if (TextUtils.isEmpty(name)) {\n nameTxt.setError(\"Không được để trống tên.\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n\n return validFlag;\n }", "private boolean Validarformatocorreo(String correo) {\n Pattern pat = Pattern.compile(\"^([0-9a-zA-Z]([_.w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-w]*[0-9a-zA-Z].)+([a-zA-Z]{2,9}.)+[a-zA-Z]{2,3})$\");\n Matcher mat = pat.matcher(correo);\n\n return mat.find();\n }", "private boolean checkInfo()\n {\n boolean flag = true;\n if(gName.isEmpty())\n {\n groupName.setError(\"Invalid name\");\n flag = false;\n }\n if(gId.isEmpty())\n {\n groupId.setError(\"Invalid id\");\n flag = false;\n }\n if(gAddress.isEmpty())\n {\n groupAddress.setError(\"Invalid address\");\n flag = false;\n }\n\n for(char c : gName.toCharArray()){\n if(Character.isDigit(c)){\n groupName.setError(\"Invalid Name\");\n flag = false;\n groupName.requestFocus();\n }\n }\n\n if(groupType.isEmpty())\n {\n flag = false;\n rPublic.setError(\"Choose one option\");\n }\n\n if(time.isEmpty())\n time = \"not set\";\n\n if(groupDescription.getText().toString().length()<20||groupDescription.getText().toString().length()>200)\n groupDescription.setError(\"Invalid description\");\n\n return flag;\n }", "private boolean isInputValid() {\r\n \r\n String errorMessage = \"\";\r\n \r\n // Email regex provided by emailregex.com using the RFC5322 standard\r\n String emailPatternString = \"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\r\n \r\n // Phone number regex provided by Ravi Thapliyal on Stack Overflow:\r\n // http://stackoverflow.com/questions/16699007/regular-expression-to-match-standard-10-digit-phone-number\r\n String phoneNumString = \"^(\\\\+\\\\d{1,2}\\\\s)?\\\\(?\\\\d{3}\\\\)?[\\\\s.-]?\\\\d{3}[\\\\s.-]?\\\\d{4}$\";\r\n \r\n Pattern emailPattern = Pattern.compile(emailPatternString, Pattern.CASE_INSENSITIVE);\r\n Matcher emailMatcher;\r\n \r\n Pattern phoneNumPattern = Pattern.compile(phoneNumString);\r\n Matcher phoneNumMatcher;\r\n \r\n // Validation for no length or over database size limit\r\n if ((custFirstNameTextField.getText() == null || custFirstNameTextField.getText().length() == 0) || (custFirstNameTextField.getText().length() > 25)) {\r\n errorMessage += \"First name has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custLastNameTextField.getText() == null || custLastNameTextField.getText().length() == 0) || (custLastNameTextField.getText().length() > 25)) {\r\n errorMessage += \"Last name has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custAddressTextField.getText() == null || custAddressTextField.getText().length() == 0) || (custAddressTextField.getText().length() > 75)) {\r\n errorMessage += \"Address has to be between 1 and 75 characters.\\n\";\r\n }\r\n \r\n if ((custCityTextField.getText() == null || custCityTextField.getText().length() == 0) || (custCityTextField.getText().length() > 50)) {\r\n errorMessage += \"City has to be between 1 and 50 characters.\\n\";\r\n }\r\n \r\n if ((custProvinceTextField.getText() == null || custProvinceTextField.getText().length() == 0) || (custProvinceTextField.getText().length() > 2)) {\r\n errorMessage += \"Province has to be a two-letter abbreviation.\\n\";\r\n }\r\n \r\n if ((custPostalCodeTextField.getText() == null || custPostalCodeTextField.getText().length() == 0) || (custPostalCodeTextField.getText().length() > 7)) {\r\n errorMessage += \"Postal Code has to be between 1 and 7 characters.\\n\";\r\n }\r\n \r\n if ((custCountryTextField.getText() == null || custCountryTextField.getText().length() == 0) || (custCountryTextField.getText().length() > 25)) {\r\n errorMessage += \"Country has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custHomePhoneTextField.getText() == null || custHomePhoneTextField.getText().length() == 0) || (custHomePhoneTextField.getText().length() > 20)) {\r\n errorMessage += \"Phone number has to be between 1 and 20 characters long.\\n\";\r\n } else {\r\n phoneNumMatcher = phoneNumPattern.matcher(custHomePhoneTextField.getText());\r\n if (!phoneNumMatcher.matches()) {\r\n errorMessage += \"Phone number not in the correct format: (111) 111-1111.\\n\";\r\n }\r\n }\r\n \r\n if ((custBusinessPhoneTextField.getText() == null || custBusinessPhoneTextField.getText().length() == 0) || (custBusinessPhoneTextField.getText().length() > 20)) {\r\n errorMessage += \"Phone number has to be between 1 and 20 characters long.\\n\";\r\n } else {\r\n phoneNumMatcher = phoneNumPattern.matcher(custBusinessPhoneTextField.getText());\r\n if (!phoneNumMatcher.matches()) {\r\n errorMessage += \"Phone number not in the correct format: (111) 111-1111.\\n\";\r\n }\r\n }\r\n \r\n if ((custEmailTextField.getText() == null || custEmailTextField.getText().length() == 0) || (custEmailTextField.getText().length() > 50)) {\r\n errorMessage += \"Email has to be between 1 and 50 characters.\\n\";\r\n } else {\r\n emailMatcher = emailPattern.matcher(custEmailTextField.getText());\r\n if (!emailMatcher.matches()) {\r\n errorMessage += \"Email format is not correct. Should be in the format [email protected].\\n\"; \r\n } \r\n }\r\n \r\n if (errorMessage.length() > 0) {\r\n Alert alert = new Alert(AlertType.ERROR, errorMessage, ButtonType.OK);\r\n alert.setTitle(\"Input Error\");\r\n alert.setHeaderText(\"Please correct invalid fields\");\r\n alert.showAndWait();\r\n \r\n return false;\r\n }\r\n \r\n return true;\r\n }", "void validate(String email);", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "public void validate_the_Telephone_Mobile_in_Contact_Details_of_Customer_Tab(String TelephoneMobile)throws Exception {\n\t\tReport.fnReportPageBreak(\"Telephone Details\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneMobile.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Mobile\").replaceAll(\"M_InnerText\", TelephoneMobile), \"Telephone - Mobile - \"+TelephoneMobile, false);\n\t}", "private String validarEntradas()\n { \n return Utilitarios.validarEntradas(campoNomeAC, campoEnderecoAC, campoBairroAC, campoCidadeAC, campoUfAC, campoCepAC, campoTelefoneAC, campoEmailAC);\n }", "private boolean tableDataValid()\r\n {\r\n // if there are any form level validations that should go there\r\n int rowTotal = tblProtoCorresp.getRowCount();\r\n int colTotal = tblProtoCorresp.getColumnCount();\r\n for (int rowIndex = 0; rowIndex < rowTotal ; rowIndex++)\r\n {\r\n for (int colIndex = 0; colIndex < colTotal; colIndex++)\r\n {\r\n TableColumn column = codeTableColumnModel.getColumn(colIndex) ;\r\n\r\n ColumnBean columnBean = (ColumnBean)column.getIdentifier() ;\r\n\r\n if (columnBean.getColumnEditable()\r\n && !columnBean.getColumnCanBeNull())\r\n {\r\n if ( tblProtoCorresp.getValueAt(rowIndex,colIndex) != null)\r\n {\r\n if (tblProtoCorresp.getValueAt(rowIndex,colIndex).equals(\"\")\r\n || tblProtoCorresp.getValueAt(rowIndex,colIndex).toString().trim().equals(\"\") )\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n else\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n }\r\n return true ;\r\n }", "@Test(groups ={Slingshot,Regression})\n\tpublic void ValidateAdduserEmailidField() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify the Email address Field validations and its appropriate error message\"); \t \t \t \n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMVTestDataspl\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ClickAddNewUserLink()\n\t\t.AddUserRadioButton()\n\t\t.StandardUserCreation()\n\t\t.validateEmailidField(userProfile);\t\t\t\t \t \t\t\t\t\t\t\n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "public boolean isValid(){\n Email.setErrorEnabled(false);\n Email.setError(\"\");\n Fname.setErrorEnabled(false);\n Fname.setError(\"\");\n Lname.setErrorEnabled(false);\n Lname.setError(\"\");\n Pass.setErrorEnabled(false);\n Pass.setError(\"\");\n Mobileno.setErrorEnabled(false);\n Mobileno.setError(\"\");\n Cpass.setErrorEnabled(false);\n Cpass.setError(\"\");\n area.setErrorEnabled(false);\n area.setError(\"\");\n Houseno.setErrorEnabled(false);\n Houseno.setError(\"\");\n Pincode.setErrorEnabled(false);\n Pincode.setError(\"\");\n\n boolean isValid=false,isValidname=false,isValidhouseno=false,isValidlname=false,isValidemail=false,isValidpassword=false,isValidconfpassword=false,isValidmobilenum=false,isValidarea=false,isValidpincode=false;\n if(TextUtils.isEmpty(fname)){\n Fname.setErrorEnabled(true);\n Fname.setError(\"Enter First Name\");\n }else{\n isValidname=true;\n }\n if(TextUtils.isEmpty(lname)){\n Lname.setErrorEnabled(true);\n Lname.setError(\"Enter Last Name\");\n }else{\n isValidlname=true;\n }\n if(TextUtils.isEmpty(emailid)){\n Email.setErrorEnabled(true);\n Email.setError(\"Email Address is required\");\n }else {\n if (emailid.matches(emailpattern)) {\n isValidemail = true;\n } else {\n Email.setErrorEnabled(true);\n Email.setError(\"Enter a Valid Email Address\");\n }\n }\n if(TextUtils.isEmpty(password)){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Enter Password\");\n }else {\n if (password.length()<8){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Weak Password\");\n }else {\n isValidpassword = true;\n }\n }\n if(TextUtils.isEmpty(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Enter Password Again\");\n }else{\n if (!password.equals(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Password Dosent Match\");\n }else{\n isValidconfpassword=true;\n }\n }\n if(TextUtils.isEmpty(mobile)){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Enter Phone Number\");\n }else{\n if (mobile.length()<10){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Invalid Mobile Number\");\n } else {\n isValidmobilenum = true;\n }\n }\n if(TextUtils.isEmpty(Area)){\n area.setErrorEnabled(true);\n area.setError(\"Area is Required\");\n }else{\n isValidarea=true;\n }\n if(TextUtils.isEmpty(pincode)){\n Pincode.setErrorEnabled(true);\n Pincode.setError(\"Please Enter Pincode\");\n }else{\n isValidpincode=true;\n }\n if(TextUtils.isEmpty(house)){\n Houseno.setErrorEnabled(true);\n Houseno.setError(\"House field cant be empty\");\n }else{\n isValidhouseno=true;\n }\n isValid=(isValidarea && isValidpincode && isValidconfpassword && isValidpassword && isValidemail && isValidname &&isValidmobilenum && isValidhouseno && isValidlname)? true:false;\n return isValid;\n\n }", "public void validateInput(String fName, String lName, String zipCode, String employID){\n boolean firstname = firstNameTwoCharactersLong(fName);\n //boolean firstFilled = firstNameFilled\n boolean firstFilled = firstNameFilled(fName);\n //boolean lastname = lastNameTwoCharactersLong\n boolean lastname = lastNameTwoCharactersLong(lName);\n //boolean lastFilled = lastNameFilled\n boolean lastFilled = lastNameFilled(lName);\n //boolean the rest\n boolean employeeID = employeeIDValid(employID);\n boolean zCode = zipCodeValid(zipCode);\n\n //if all of them are valid=true then error prints \"there are no errors found\n if (firstname && firstFilled && lastname && lastFilled && employeeID && zCode){\n errorMessage = \"There were no errors found\";\n }\n //Display error message\n System.out.println(errorMessage);\n\n }", "public ContactInfo getContactInfo(String document) {\r\n //Scanner object is initialized\r\n Scanner doc = new Scanner(document);\r\n\r\n //Scanner object is used to iterate line-by-line through the document\r\n while(doc.hasNextLine()) {\r\n String line = doc.nextLine();\r\n\r\n //Checks for the '@' char to find what line is an email address\r\n if(line.indexOf('@') >= 0) {\r\n email = line;\r\n }\r\n //Checks for the '-' char to find what line is a number\r\n else if(line.indexOf('-') >= 0) {\r\n if(!line.contains(\"Fax\") && !line.contains(\"Pager\")) {\r\n //Uses a regular expression to remove any character that is not a digit\r\n number = line.replaceAll(\"\\\\D\", \"\");\r\n }\r\n }\r\n }\r\n\r\n doc = new Scanner(document);\r\n\r\n /*Makes a second pass through the document to find the name. It uses the last\r\n name in the email that we found earlier*/\r\n while(doc.hasNextLine()) {\r\n String line = doc.nextLine();\r\n //The index of the last letter of the last name\r\n int emailIndex = document.indexOf('@') - 1;\r\n\r\n /*Iterates through the line in reverse to check for the last name found\r\n on the email*/\r\n for(int i = line.length() - 1; i >= 0; i--) {\r\n //End of last name\r\n if(line.charAt(i) == ' ') {\r\n name = line;\r\n break;\r\n }\r\n //Compares characters from the email and the line\r\n else if(Character.toLowerCase(line.charAt(i)) != Character.toLowerCase(document.charAt(emailIndex))) {\r\n break;\r\n } else {\r\n emailIndex--;\r\n }\r\n }\r\n\r\n if(name != null)\r\n break;\r\n }\r\n\r\n doc.close();\r\n\r\n return this;\r\n }", "public static Customer validateCustomer(TextField shopname, TextField shopcontact, TextField streetadd, ComboBox area, TextField city, TextField zip) {\r\n Customer customer = new Customer();\r\n customer = null;\r\n\r\n if (shopname.getText().isEmpty() || shopcontact.getText().isEmpty() || streetadd.getText().isEmpty()\r\n || city.getText().isEmpty()\r\n || zip.getText().isEmpty() || area.getValue() == null) {\r\n new PopUp(\"Name Error\", \"Field is Empty\").alert();\r\n } else if (!shopcontact.getText().matches(\"\\\\d{10}\")) {\r\n new PopUp(\"Name Error\", \"Contact must be 10 Digit\").alert();\r\n } else if (!zip.getText().matches(\"\\\\d{6}\")) {\r\n new PopUp(\"Error\", \"Zip Code must be 6 Digit\").alert();\r\n } else {\r\n customer.setShopName(shopname.getText());\r\n customer.setShopCont(Long.valueOf(shopcontact.getText()));\r\n customer.setStreetAdd(streetadd.getText());\r\n customer.setArea(area.getValue().toString());\r\n customer.setCity(city.getText());\r\n customer.setZipcode(Integer.valueOf(zip.getText()));\r\n }\r\n\r\n return customer;\r\n }", "@Override\n\tprotected void validators() {\n\t\tString nsrmc = getDj_nsrxx().getNsrmc();\n\n\t\tif (ValidateUtils.isNullOrEmpty(nsrmc)) {\n\t\t\tthis.setSystemMessage(\"纳税人名称不能为空\", true, null);\n\t\t}\n\n\t}", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "private void validateData() {\n }", "public void validate_the_Marketing_preferences_in_Contact_Details_of_Customer_Tab(String type,String i)throws Exception {\n\t\t\t\n\t\t\tboolean checked= false;\n\t\t\tboolean status= false;\n\t\t\ttry {\n\t\t\t\tchecked = VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Marketing preferences\").replaceAll(\"M_InnerText\", type), \"Marketing preferences on \"+type);\n\t\t\t\t\n\t\t\t\tif(i.equalsIgnoreCase(\"1\"))\n\t\t\t\t\tstatus=true;\n\t\t\t\telse\n\t\t\t\t\tstatus=false;\n\t\t\t} catch (NullPointerException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tfinally\n\t\t\t{\n\t\t\tif(checked==status)\n\t\t\t\tReport.fnReportPass(\"Marketing preferences - \"+type+\" : Checked status = \"+status+\"\tDisplay Status\"+checked, driver);\n\t\t\t\telse\n\t\t\t\tReport.fnReportFail(\"Marketing preferences - \"+type+\" : Checked status = \"+status+\"\tDisplay Status\"+checked, driver);\n\t\t\t\n\t\t\t}\n\t}", "private String checkUserDetail(UserModel userModel) {\n\t\tString name = userModel.getName();\n\t\tString mobileNumber = userModel.getMobileNumber();\n\t\tString email = userModel.getEmail();\n\t\tString pincode = userModel.getPincode();\n\t\tString area = userModel.getAreaName();\n\t\tString state = userModel.getStateName();\n\t\tString res = \"okkk\";\n\t\tif (mobileNumber.length() != 10) {\n\t\t\tres = \"Enter ten digit mobile number\";\n\t\t} else if (!checkMobileDigit(mobileNumber)) {\n\t\t\tres = \"enter only digit\";\n\t\t} else if (!checkNameChar(name)) {\n\t\t\tres = \"name shuld be only in alphabet\";\n\t\t} else if (!checkEmail(email)) {\n\t\t\tres = \"enter a valid email\";\n\t\t} else if (pincode.length() != 6) {\n\t\t\tres = \"enter valid pincode and enter only six digit\";\n\t\t} else if (!checkPincode(pincode)) {\n\t\t\tres = \"enter only digit\";\n\t\t} else if (area.equals(null)) {\n\t\t\tres = \"choose area\";\n\t\t} else if (state.equals(null)) {\n\t\t\tres = \"choose state\";\n\t\t}\n\t\treturn res;\n\t}", "public static void main(String[] args){\n\tValidateUser first =(String Fname) -> {\n\t\tif(Pattern.matches(\"[A-Z]{1}[a-z]{2,}\",Fname))\n\t\t\tSystem.out.println(\"First Name Validate\");\n\t\t\telse \n\t\t\tSystem.out.println(\"Invalid Name, Try again\");\n\t}; \n\t//Lambda expression for Validate User Last Name\n\tValidateUser last =(String Lname) -> {\n\t\tif(Pattern.matches(\"[A-Z]{1}[a-z]{2,}\",Lname))\n\t\t\tSystem.out.println(\"Last Name Validate\");\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Invalid Last Name, Try again\");\n\t};\n\t//Lambda expression for Validate User Email\n\tValidateUser Email =(String email) -> {\n\t\tif(Pattern.matches(\"^[\\\\w-\\\\+]+(\\\\.[\\\\w]+)*@[\\\\w-]+(\\\\.[\\\\w]+)*(\\\\.[a-z]{2,})$\",email))\n\t\t\tSystem.out.println(\"email Validate\");\n\t\telse\n\t\t\tSystem.out.println(\"Invalid Email, Try again\");\n\t};\n\t//Lambda expression for Validate User Phone Number\n\tValidateUser Num =(String Number) -> {\n\t\tif(Pattern.matches(\"^[0-9]{2}[\\\\s][0-9]{10}\",Number))\n\t\t\tSystem.out.println(\"Phone Number Validate\");\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Invalid Number, Try Again\");\n\t};\n\t//Lambda expression for Validate User Password\n\tValidateUser Password =(String pass) -> {\n\t\tif(Pattern.matches(\"(?=.*[$#@!%^&*])(?=.*[0-9])(?=.*[A-Z]).{8,20}$\",pass))\n\t\t\tSystem.out.println(\"Password Validate\");\n\t\t\telse\n\t\t\tSystem.out.println(\"Invalid Password Try Again\");\n\t};\n\t\n\tfirst.CheckUser(\"Raghav\");\n\tlast.CheckUser(\"Shettay\");\n\tEmail.CheckUser(\"[email protected]\");\n\tNum.CheckUser(\"91 8998564522\");\n\tPassword.CheckUser(\"Abcd@321\");\n\t\n\t\n\t\n\t//Checking all Email's Sample Separately\n\tArrayList<String> emails = new ArrayList<String>();\n\t//Valid Email's\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\temails.add(\"[email protected]\");\n\t\n\t//Invalid Email's\n\temails.add(\"[email protected]\");\n\temails.add(\"abc123@%*.com\");\n\t\n\tString regex=\"^[\\\\w-\\\\+]+(\\\\.[\\\\w]+)*@[\\\\w-]+(\\\\.[\\\\w]+)*(\\\\.[a-z]{2,})$\";\n\t\n\tPattern pattern = Pattern.compile(regex);\n\t\n\tfor(String mail : emails) {\n\t\tMatcher matcher = pattern.matcher(mail);\n\t System.out.println(mail +\" : \"+ matcher.matches());\n\t}\n \n}", "private void getSponsorInfo(String sponsorCode){\r\n int resultConfirm =0;\r\n /**\r\n * Updated for REF ID :0003 Feb'21 2003.\r\n * Hour Glass implementation while DB Trsactions Wait\r\n * by Subramanya Feb' 21 2003\r\n */\r\n if( dlgWindow != null){\r\n dlgWindow.setCursor( new Cursor( Cursor.WAIT_CURSOR ) );\r\n }\r\n String sponsorName = rldxController.getSponsorName(sponsorCode);\r\n //Added for COEUSQA-1434 : Add the functionality to set a status on a Sponsor record - start\r\n String sponsorStatus = rldxController.getSponsorStatus();\r\n //Added for COEUSQA-1434 : Add the functionality to set a status on a Sponsor record - end\r\n if( dlgWindow != null ){\r\n dlgWindow.setCursor( new Cursor( Cursor.DEFAULT_CURSOR ) );\r\n }\r\n \r\n //Commented for case#3341 - Sponsor Code Validation - start\r\n// lblSponsorName.setText( trimSponsorName( sponsorName ) );\r\n// txtOrganization.requestFocus();\r\n //Commented for case#3341 - Sponsor Code Validation - end\r\n if ((sponsorName != null) && (!sponsorName.trim().equals(\"\")) && ! INACTIVE_STATUS.equalsIgnoreCase(sponsorStatus)){\r\n //Added for case#3341 - Sponsor Code Validation - start\r\n lblSponsorName.setText(trimSponsorName(sponsorName));\r\n txtOrganization.requestFocus();\r\n //Added for case#3341 - Sponsor Code Validation - end \r\n if ( (!txtOrganization.getText().trim().equals(\"\")) &&\r\n ( !sponsorName.equals(txtOrganization.getText().trim()) ) ){\r\n String msgStr = \"Do you want to overwrite the organization: \" +\r\n txtOrganization.getText().trim() + \" with \" + sponsorName + \"?\";\r\n resultConfirm = CoeusOptionPane.showQuestionDialog(msgStr,\r\n CoeusOptionPane.OPTION_YES_NO,\r\n CoeusOptionPane.DEFAULT_YES);\r\n if (resultConfirm == 0) {\r\n txtOrganization.setText(sponsorName.trim());\r\n }\r\n \r\n }else {\r\n txtOrganization.setText(sponsorName.trim());\r\n //do nothing\r\n }\r\n if (!txtSponsorCode.getText().trim().equals(\"\") ) {\r\n if ( !txtAddress1.getText().trim().equals(\"\") ||\r\n !txtAddress2.getText().trim().equals(\"\") ||\r\n !txtAddress3.getText().trim().equals(\"\") ||\r\n !txtCity.getText().trim().equals(\"\") ||\r\n !txtCounty.getText().trim().equals(\"\") ||\r\n //Commented for Case#4252 - Rolodex state dropdown associated with country - Start\r\n// !((ComboBoxBean)cmbCountry.getItemAt(\r\n// cmbCountry.getSelectedIndex())).getCode().trim().equals(\"USA\") ||\r\n //Case#4252 - End\r\n !txtPostalCode.getText().trim().equals(\"\") ||\r\n !txtPhone.getText().trim().equals(\"\") ||\r\n !txtEMail.getText().trim().equals(\"\") ||\r\n !txtFax.getText().trim().equals(\"\") ) {\r\n \r\n String msgStr =\r\n coeusMessageResources.parseMessageKey(\r\n \"roldxMntDetFrm_confirmationCode.1145\");\r\n resultConfirm = CoeusOptionPane.showQuestionDialog(msgStr,\r\n CoeusOptionPane.OPTION_YES_NO,\r\n CoeusOptionPane.DEFAULT_YES);\r\n if (resultConfirm == 0) {\r\n /* prompt the user for replacing base address on\r\n * confirmation replace the address\r\n */\r\n replaceWithSponsorBaseAdress(sponsorCode);\r\n }\r\n }else {\r\n replaceWithSponsorBaseAdress(sponsorCode);\r\n }\r\n }\r\n //Added for case#3341 - Sponsor Code Validation\r\n txtOrganization.requestFocus(); \r\n //Added for case#3341 - Sponsor Code Validation - start \r\n }else{\r\n lblSponsorName.setText(\"\");\r\n txtSponsorCode.setText(\"\");\r\n txtSponsorCode.requestFocus(); \r\n //Added for COEUSQA-1434 : Add the functionality to set a status on a Sponsor record - start\r\n txtOrganization.setText(CoeusGuiConstants.EMPTY_STRING); \r\n txtAddress1.setText(CoeusGuiConstants.EMPTY_STRING);\r\n txtAddress2.setText(CoeusGuiConstants.EMPTY_STRING);\r\n txtAddress3.setText(CoeusGuiConstants.EMPTY_STRING);\r\n //Added for COEUSQA-1434 : Add the functionality to set a status on a Sponsor record - end\r\n CoeusOptionPane.showInfoDialog(\r\n coeusMessageResources.parseMessageKey(\"roldxMntDetFrm_exceptionCode.1108\")); \r\n }\r\n //Added for case#3341 - Sponsor Code Validation - end\r\n isSponsorInfoRequired =false;\r\n //Commented for case#3341 - Sponsor Code Validation\r\n //txtOrganization.requestFocus(); \r\n }", "private void ValidateEditTextFields() {\n\tfor (int i = 0; i < etArray.length; i++) {\n\t if (etArray[i].getText().toString().trim().length() <= 0) {\n\t\tvalidCustomer = false;\n\t\tetArray[i].setError(\"Blank Field\");\n\t }\n\t}\n\n\tif (etPhoneNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etPhoneNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (etEmergencyNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etEmergencyNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (calendarDob == null) {\n\t validCustomer = false;\n\t}\n }", "private int completionCheck() {\n if (nameTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(1);\n return -1;\n }\n if (addressTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(2);\n return -1;\n }\n if (postCodeTB.getText().trim().isEmpty()){\n AlertMessage.addCustomerError(3);\n return -1;\n }\n if (countryCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(4);\n return -1;\n }\n if (stateProvinceCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(5);\n return -1;\n }\n if (phone.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(6);\n return -1;\n }\n return 1;\n }", "public String CheckPostCode (HashMap<String, ?> InputObj) throws NoSuchElementException {\n\t\tString outRetVal = \"-1\";\n\t\t\n\t\tString inCountryCode = InputObj.get(\"CountryCode\").toString();\n\t\tString inPostCode = InputObj.get(\"PostCode\").toString();\n\t\t\n\t\tCustSiteEditorObj Obj = new CustSiteEditorObj(webdriver);\n\t\t\n\t\tWebElement TxtCountryCode = Obj.getTxtCountryCode();\n\t\tif (!TxtCountryCode.getAttribute(\"value\").equals(inCountryCode)) {\n\t\t\tTxtCountryCode.clear();\n\t\t\tTxtCountryCode.sendKeys(inCountryCode);\n\t\t\tWebElement TxtPostCode = Obj.getTxtPostCode();\n\t\t\tTxtPostCode.click();\n\t\t}\n\t\t\n\t\tboolean isCountryCodeMsgExist = SeleniumUtil.isWebElementExist(webdriver, Obj.getLblCountryCodeMessageLocator(), 1);\n\t\tif (isCountryCodeMsgExist) {\n\t\t\tWebElement LblCountryCodeMessage = Obj.getLblCountryCodeMessage();\n\t\t\tboolean isVisible = LblCountryCodeMessage.isDisplayed();\n\t\t\tif (isVisible) {\n\t\t\t\tCommUtil.logger.info(\" > Msg: \"+LblCountryCodeMessage.getText());\n\t\t\t\tif (CommUtil.isMatchByReg(LblCountryCodeMessage.getText(), \"Only 2 characters\")) {\n\t\t\t\t\toutRetVal = \"1\";\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t} else {\n\t\t\t\t\tCommUtil.logger.info(\" > Unhandled message.\");\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tWebElement TxtPostCode = Obj.getTxtPostCode();\n\t\tif (!TxtPostCode.getAttribute(\"value\").equals(inPostCode)) {\n\t\t\tTxtPostCode.clear();\n\t\t\tTxtPostCode.sendKeys(inPostCode);\n\t\t\tTxtCountryCode = Obj.getTxtCountryCode();\n\t\t\tTxtCountryCode.click();\n\t\t}\t\n\t\t\n\t\tboolean isPostCodeMsgExist = SeleniumUtil.isWebElementExist(webdriver, Obj.getLblPostCodeMessageLocator(), 1);\n\t\tif (isPostCodeMsgExist) {\n\t\t\tWebElement LblPostCodeMessage = Obj.getLblPostCodeMessage();\n\t\t\tboolean isVisible = LblPostCodeMessage.isDisplayed();\n\t\t\tif (isVisible) {\n\t\t\t\tCommUtil.logger.info(\" > Msg: \"+LblPostCodeMessage.getText());\n\t\t\t\tif (CommUtil.isMatchByReg(LblPostCodeMessage.getText(), \"Only 5 digits\")) {\n\t\t\t\t\toutRetVal = \"2\";\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t} else if (CommUtil.isMatchByReg(LblPostCodeMessage.getText(), \"Only alpha numeric dash space\")) {\n\t\t\t\t\toutRetVal = \"3\";\n\t\t\t\t\treturn outRetVal;\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tCommUtil.logger.info(\" > Unhandled message.\");\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\toutRetVal = \"0\";\n\t\treturn outRetVal;\n\t\t\n\t}", "@Test\n\t\tvoid givenEmail_CheckForValidationForMobile_RetrunTrue() {\n\t\t\tboolean result = ValidateUserDetails.validateMobile(\"98 9808229348\");\n\t\t\tAssertions.assertTrue(result);\n\t\t}", "private void alertBox_validation(String msg, final int validateflag) {\r\n\t\tAlertDialog.Builder validation_alert = new AlertDialog.Builder(this);\r\n\t\tvalidation_alert.setTitle(\"Information\");\r\n\t\tvalidation_alert.setMessage(msg);\r\n\t\tif (validateflag != 21) {\r\n\t\t\tvalidation_alert.setNeutralButton(\"OK\",\tnew DialogInterface.OnClickListener() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t\tif (validateflag != 0) {\r\n\t\t\t\t\t\tif (validateflag == 1) {\r\n\t\t\t\t\t\t\tmStreetNumberValue.requestFocus();\r\n\t\t\t\t\t\t}else if (validateflag == 3) {\r\n\t\t\t\t\t\t\tmCardNoValue1.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue2.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue3.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue4.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue1.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 7) {\r\n\t\t\t\t\t\t\tmCardNoValue4.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue4.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 8) {\r\n\t\t\t\t\t\t\tmExpirationDateValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 9) {\r\n\t\t\t\t\t\t\tmExpirationDateValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 10) {\r\n\t\t\t\t\t\t\tmCVVNoValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 11) {\r\n\t\t\t\t\t\t\tmCVVNoValue.setText(\"\");\r\n\t\t\t\t\t\t\tmCVVNoValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 15) {\r\n\t\t\t\t\t\t\tmZipCodeValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 19) {\r\n\t\t\t\t\t\t\tmCardNoValue1.getText().clear();\r\n\t\t\t\t\t\t\tmCardNoValue2.getText().clear();\r\n\t\t\t\t\t\t\tmCardNoValue3.getText().clear();\r\n\t\t\t\t\t\t\tmCardNoValue4.getText().clear();\r\n\t\t\t\t\t\t} else if (validateflag == 20) {\r\n\t\t\t\t\t\t\tmZipCodeValue.getText().clear();\r\n\t\t\t\t\t\t\tmZipCodeValue.requestFocus();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdialog.dismiss();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tvalidation_alert.setPositiveButton(\"Yes\",new DialogInterface.OnClickListener() {\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t\t// Calling funtion to save fields\r\n\t\t\t\t\tsaveFields();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvalidation_alert.setNegativeButton(\"No\",new DialogInterface.OnClickListener() {\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvalidation_alert.show();\r\n\t}", "public String validate() {\n\t\tString msg=\"\";\n\t\t// for name..\n\t\tif(name==null||name.equals(\"\"))\n\t\t{\n\t\t\tmsg=\"Task name should not be blank or null\";\n\t\t}\n\t\tif(name.split(\" \").length>1)\n\t\t{\n\t\t\tmsg=\"multiple words are not allowed\";\n\t\t}\n\t\telse\n\t\t{\n\t\t for(int i=0;i<name.length();i++)\n\t\t {\n\t\t\t char c=name.charAt(i);\n\t\t\t\tif(!(Character.isDigit(c)||Character.isLetter(c)))\n\t\t\t\t{\n\t\t\t\t\tmsg=\"special characters are not allowed\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t }\n\t\t}\n\t\t\t\n\t\t\n\t\t\t// for Description...\n\t\t\tif(desc==null||desc.equals(\"\"))\n\t\t\t{\n\t\t\t\tmsg=\"Task descrshould not be blank or null\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t // for tag...\n\t\t\t \n\t\t\t if(tag==null||tag.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tmsg=\"Task tags not be blank or null\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t // for date { imp here}\n\t\t\t if(tarik!=null)\n\t\t\t {\n\t\t\t SimpleDateFormat sdf=new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\t sdf.setLenient(false); // very imp here..\n\t\t\t try {\n\t\t\t\tDate d=sdf.parse(tarik);\n\t\t\t} catch (ParseException e) {\n\t\t\t\t\n\t\t\t//\tmsg=\"date should be correct foramat\";\n\t\t\t\tmsg=e.getMessage();\n\t\t\t}\n\t\t\t }\n\t\t\t// for prority..\n\t\t\t if(prio<1&&prio>10)\n\t\t\t {\n\t\t\t\t msg=\"prority range is 1 to 10 oly pa\";\n\t\t\t }\n\t\t\t\t\n\t\t\t\tif(msg.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\treturn Constant.SUCCESS;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\treturn msg;\n\t}", "private boolean isInputValid() {\n String errorMessage = \"\";\n\n if (ServiceName.getText() == null || ServiceName.getText().length() == 0) {\n errorMessage += \"No valid name!\\n\";\n }\n if (Serviceemail.getText() == null || Serviceemail.getText().length() == 0) {\n Pattern p = Pattern.compile(\"[_A-Za-z0-9][A-Za-z0-9._]*?@[_A-Za-z0-9]+([.][_A-Za-z]+)+\");\n Matcher m = p.matcher(Serviceemail.getText());\n if (m.find() && m.group().equals(Serviceemail.getText())) {\n errorMessage += \"No valid Mail Forment!\\n\";\n }\n }\n if (servicedescrip.getText() == null || servicedescrip.getText().length() == 0) {\n errorMessage += \"No valid description !\\n\";\n }\n if (f == null && s.getImage() == null) {\n errorMessage += \"No valid photo ( please upload a photo !)\\n\";\n }\n if (Serviceprice.getText() == null || Serviceprice.getText().length() == 0) {\n errorMessage += \"No valid prix !\\n\";\n } else {\n // try to parse the postal code into an int.\n try {\n Float.parseFloat(Serviceprice.getText());\n } catch (NumberFormatException e) {\n errorMessage += \"No valid prix (must be a Float)!\\n\";\n }\n }\n if ( !Weekly.isSelected() && !Daily.isSelected() && !Monthly.isSelected()) {\n errorMessage += \"No valid Etat ( select an item !)\\n\";\n }\n if (Servicesatet.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid etat ( select an item !)\\n\";\n }\n if (ServiceCity.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid City ( select an item !)\\n\";\n }\n if (servicetype.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid Type ( select an item !)\\n\";\n }\n if (errorMessage.length() == 0) {\n return true;\n } else {\n // Show the error message.\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Invalid Fields\");\n alert.setHeaderText(\"Please correct invalid fields\");\n alert.setContentText(errorMessage);\n alert.showAndWait();\n return false;\n }\n }", "private static Contact getContactDetails() {\n System.out.println(\"enter contact details ----\");\n Scanner scan = new Scanner(System.in);\n System.out.println(\"enter first name\");\n String firstName = scan.nextLine();\n\n System.out.println(\"enter last name\");\n String lastName = scan.nextLine();\n\n System.out.println(\"enter street address\");\n String address = scan.nextLine();\n\n System.out.println(\"enter city name\");\n String cityName = scan.nextLine();\n\n System.out.println(\"enter state name\");\n String stateName = scan.nextLine();\n\n System.out.println(\"enter phone number\");\n String phoneNumber = scan.nextLine();\n\n System.out.println(\"enter email Address\");\n String emailAddress = scan.nextLine();\n\n System.out.println(\"enter zip code \");\n String zipCode = scan.nextLine();\n\n Contact entry = new Contact(firstName, lastName,address, cityName, stateName, zipCode, phoneNumber,\n emailAddress);\n return entry;\n\n }", "private boolean isFormValid(AdminAddEditUserDTO dto)\r\n\t{\n\t\tSOWError error;\r\n\t\tList<IError> errors = new ArrayList<IError>();\t\t\r\n\t\t\r\n\t\t// First Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getFirstName()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_First_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_First_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\t// Last Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getLastName()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Last_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Last_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\t\r\n\t\t// User Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getUsername()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_User_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\telse\r\n\t\t{\t\r\n\t\t\t//User Name Length Check\r\n\t\t\tif((dto.getUsername().length() < 8) || (dto.getUsername().length() >30)){\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"),getTheResourceBundle().getString(\"Admin_User_Name_Length_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString jobRole = getParameter(\"jobRole\");\r\n\t\tif(\"-1\".equals(jobRole))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Job_Role\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Job_Role_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Handle Primary Email\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getEmail()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Email\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isEmailValid(dto.getEmail()) == false)\r\n\t\t\t{\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_PrimaryEmail\"),\r\n\t\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Pattern_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if(dto.getEmail().equals(dto.getEmailConfirm()) == false)\r\n\t\t\t{\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_PrimaryEmail\"),\r\n\t\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Confirm_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Check for existing username, only in Add mode\r\n\t\tString mode = (String)getSession().getAttribute(\"addEditUserMode\");\r\n\t\tif(mode != null)\r\n\t\t{\r\n\t\t\tif(mode.equals(\"add\"))\r\n\t\t\t{\r\n\t\t\t\tif(manageUsersDelegate.getAdminUser(dto.getUsername()) != null || manageUsersDelegate.getBuyerUser(dto.getUsername()) != null)\r\n\t\t\t\t{\r\n\t\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"), getTheResourceBundle().getString(\"Admin_Existing_User_Validation_Msg1\")+\" \" + dto.getUsername() +\" \" +getTheResourceBundle().getString(\"Admin_Existing_User_Validation_Msg2\"), OrderConstants.FM_ERROR);\r\n\t\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// If we have errors, put them in request.\r\n\t\tif(errors.size() > 0)\r\n\t\t{\r\n\t\t\tsetAttribute(\"errors\", errors);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tgetSession().removeAttribute(\"addEditUserMode\");\r\n\t\t\tgetSession().removeAttribute(\"originalUsername\");\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "private boolean validate(MessageType mt) {\n if (mt.getDesignation() == null) {\n DialogUtility\n .showMessageBox(this.shell, SWT.ICON_ERROR | SWT.OK,\n \"Message Type - Designation\",\n \"Designation is a required field. Please select a Designation.\");\n return false;\n }\n\n /*\n * verify that an afos id has been set.\n */\n if (mt.getAfosid() == null || mt.getAfosid().isEmpty()) {\n DialogUtility\n .showMessageBox(this.shell, SWT.ICON_ERROR | SWT.OK,\n \"Message Type - Message Type\",\n \"Message Type is a required field. Please enter a Message Type.\");\n return false;\n }\n\n /*\n * verify that a title has been set.\n */\n if (mt.getTitle() == null || mt.getTitle().isEmpty()) {\n DialogUtility.showMessageBox(this.shell, SWT.ICON_ERROR | SWT.OK,\n \"Message Type - Title\",\n \"Title is a required field. Please enter a Title.\");\n return false;\n }\n\n /*\n * verify that the afos id is unique.\n */\n try {\n MessageType existingMessageType = this.mtdm.getMessageType(mt\n .getAfosid());\n if (existingMessageType != null) {\n DialogUtility\n .showMessageBox(\n this.shell,\n SWT.ICON_ERROR | SWT.OK,\n \"Message Type - Message Type\",\n \"Message Type \"\n + mt.getAfosid()\n + \" already exists. Please enter a unique Message Type.\");\n return false;\n }\n } catch (Exception e) {\n statusHandler.error(\n \"Failed to determine if Message Type \" + mt.getAfosid()\n + \" is unique.\", e);\n return false;\n }\n\n return true;\n }", "public void checkInputCompany(TextField phoneNo, TextField zip, TextField name, KeyEvent event) {\n if (event.getSource() == phoneNo) {\n redFieldNumber(phoneNo, event);\n } else if (event.getSource() == zip) {\n redFieldCPRNoAndZip(zip, event);\n } else if (event.getSource() == name) {\n checkIfRedName(name, event);\n }\n }", "public PaymentRequestPage paymentRequestPaymentAvailabilityValidation(String cashbackType,String cashbackValue,String rewardsValue) {\r\n\r\n\t\tString actual = \"\";\r\n\r\n\t\treportStep(\"About to validate the Cashback and Rewards Payment avilablity section in the payment Request page \", \"INFO\");\r\n\r\n\t\tswitch (cashbackType) {\r\n\r\n\t\tcase \"Only_Cashback\":\r\n\r\n\t\t\tvalidateTheElementPresence(cashbackAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, cashbackValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"Only_Rewards\":\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, rewardsValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase \"BothCashback_Rewards\":\r\n\r\n\t\t\tfloat cashbackAmount = Float.parseFloat(cashbackValue);\r\n\t\t\tfloat rewardsAmount = Float.parseFloat(rewardsValue);\r\n\t\t\tfloat totalAmount = cashbackAmount + rewardsAmount ;\r\n\r\n\t\t\tString strTotalAmount = Float.toString(totalAmount) + \"0\";\r\n\t\t\tString strOnlyCashbackAmount = Float.toString(cashbackAmount) + \"0\";\r\n\t\t\tString strOnlyRewardsAmount = Float.toString(rewardsAmount) + \"0\";\r\n\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\t\t\tvalidateTheElementPresence(cashbackText);\r\n\t\t\tvalidateTheElementPresence(rewardsText);\r\n\r\n\t\t\t//validate total cashback amount\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strTotalAmount);\r\n\r\n\t\t\t//validate only cashback amount\r\n\t\t\tactual = getText(cashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyCashbackAmount);\r\n\r\n\r\n\t\t\t//validate only rewards amount\r\n\t\t\tactual = getText(rewardsAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyRewardsAmount);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\r\n\t}", "private String creditCardValidate(CardPayment payment) {\r\n \tString validate = null;\r\n \t\r\n \tString cardType = payment.getCreditCardType();\r\n \t\r\n \tif(cardType.equals(\"MASTERCARD\") || cardType.equals(\"VISA\")) {\r\n \t\tif(payment.getCreditCardNumber().matches(\"[0-9]+\") && payment.getCreditCardNumber().length() != 16) {\r\n \t\t\treturn \"Credit Card Number is invalid\";\r\n \t\t} else if(String.valueOf(payment.getCreditcardcvv()).length() != 3) {\r\n \t\t\treturn \"Credit Card CVV is invalid\";\r\n \t\t}\r\n \t} else if(cardType.equals(\"AMEX\")) {\r\n \t\tif(payment.getCreditCardNumber().matches(\"[0-9]+\") && payment.getCreditCardNumber().length() != 15) {\r\n \t\t\treturn \"Credit Card Number is invalid\";\r\n \t\t} else if(String.valueOf(payment.getCreditcardcvv()).length() != 4) {\r\n \t\t\treturn \"Credit Card CVV is invalid\";\r\n \t\t}\r\n \t} else {\r\n \t\tvalidate = \"Invalid card type\";\r\n \t}\r\n \t\r\n \treturn validate;\r\n }", "@Override\r\n\tpublic boolean isValid(String code, ConstraintValidatorContext theConstaint) {\r\n \r\n titles = customerService.getTitles();\r\n \r\n for(String i : titles)\r\n {\r\n \tSystem.out.println(i);\r\n }\r\n //descriptions = ec.getDescriptions();\r\n for(String i : titles)\r\n {\r\n\t result = code.equals(i);\r\n\t\tif(code != null)\t\t\r\n\t\t\tresult = code.equals(i);\r\n\t\telse\r\n\t\t\tresult = true;\r\n\t\tif(result == true)\r\n\t\t\tbreak;\r\n }\r\n\t\treturn result;\r\n\t}", "protected void validateMobileNumber(){\n /*\n Checking For Mobile number\n The Accepted Types Are +00 000000000 ; +00 0000000000 ;+000 0000000000; 0 0000000000 ; 00 0000000000\n */\n Boolean mobileNumber = Pattern.matches(\"^[0]?([+][0-9]{2,3})?[-][6-9]+[0-9]{9}\",getMobileNumber());\n System.out.println(mobileNumberResult(mobileNumber));\n }", "@RequiresApi(api = Build.VERSION_CODES.KITKAT)\n public boolean validateDetails(String email, String mobile) {\n email = email.trim();\n mobile = mobile.trim();\n\n if (TextUtils.isEmpty(mobile)) {\n setErrorInputLayout(mobile_et, getString(R.string.err_phone_empty), mobile_til);\n return false;\n } else if (!isValidPhone(mobile)) {\n setErrorInputLayout(mobile_et, getString(R.string.err_phone_not_valid), mobile_til);\n return false;\n } else if (TextUtils.isEmpty(email)) {\n setErrorInputLayout(email_et, getString(R.string.err_email_empty), email_til);\n return false;\n } else if (!isValidEmail(email)) {\n setErrorInputLayout(email_et, getString(R.string.email_not_valid), email_til);\n return false;\n } else if (Objects.equals(name_et.getText().toString(), \"\")) {\n setErrorInputLayout(name_et, \"Name is not valid\", name_til);\n return false;\n } else {\n return true;\n }\n }", "private boolean validate(){\n return EditorUtils.editTextValidator(generalnformation,etGeneralnformation,\"Type in information\") &&\n EditorUtils.editTextValidator(symptoms,etSymptoms, \"Type in symptoms\") &&\n EditorUtils.editTextValidator(management,etManagement, \"Type in management\");\n }", "private void validateUpdateCustomers(List<CustomersInputDTO> customers, String formatDate) {\n // inner validate\n if (customers == null || customers.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(ConstantsCustomers.CUSTOMERS, Constants.RIQUIRED_CODE));\n }\n // validate common\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n List<Map<String, Object>> customParams = new ArrayList<>();\n customers.forEach(cus -> {\n Map<String, Object> customField = new HashMap<>();\n customField.put(\"rowId\", cus.getCustomerId());\n customField.putAll(buildParamsValidateCustomersInput(cus, jsonBuilder));\n customParams.add(customField);\n });\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n customParams, formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n List<Map<String, Object>> listValidate = CustomersCommonUtil.validateCommon(validateJson, restOperationUtils,\n token, tenantName);\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "@Override\n public void validaEmailInteractor(CharSequence charSequence) {\n verificaEmail(charToString(charSequence));\n }", "private boolean validateInputInfo(){\n\n //Get user input\n String firstName = newContactFirstName.getText().toString();\n String lastName = newContactLastName.getText().toString();\n String email = newContactEmailAddress.getText().toString();\n String phone = newContactPhoneNumber.getText().toString();\n\n //Check to make sure no boxes were left empty\n if(firstName.isEmpty() || lastName.isEmpty() || email.isEmpty() || phone.isEmpty()){\n Toast.makeText(this, \"You must fill all fields before continuing!\", Toast.LENGTH_LONG).show();\n return false;\n }\n //Check to see if phone number is valid\n else if(!(phone.length() >= 10)){\n Toast.makeText(this, \"Make sure to input a valid 10 digit phone number!\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n return true;\n }", "@Test\n\tpublic void testValidate() {\n\t\tSystem.out.println(\"starting testValidate()\");\n\t\tPersonalData personalData = new PersonalData(\"Kelvin\", \"Huynh\", \"4081234567\", \"[email protected]\");\n\t\tassertTrue (\"address validates\", personalData.validatePersonalData());\n\t System.out.println(\"testValidate PASSED\");\n\t}", "@Override\n\tprotected Boolean isValid(String[] fields) {\n\t\t//check - evnet_id, yes, maybe, invited, no\n return (fields.length > 4);\n\t}", "private boolean validateInput(){\n Window owner=root.getScene().getWindow();\n inputFileds.addAll(txtfn,txtln,txtsurname,txtDOB,txtResidence,txtMobile,txtID,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().isEmpty()){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n inputFileds.removeAll(txtDOB,txtMobile,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().length()>30){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Sorry the text you entered can not be greater that 30 characters\",\"Text too Long\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n if(username.getText().length()>20 || username.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Username has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid input\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n if(pass.getText().isEmpty()){\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n if(pass.getText().length()>20 || pass.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Password has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n SimpleDateFormat yearFormat = new SimpleDateFormat(\"yyyy\");\n try {\n date = dateFormat.parse(txtDOB.getText());\n Calendar cal=Calendar.getInstance();\n int year=Integer.parseInt(yearFormat.format(date));\n if (year <= 1900 || year>cal.get(Calendar.YEAR)) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n String initialEntry=txtDOB.getText();\n String parsedValue=dateFormat.format(date);\n if(!initialEntry.equals(parsedValue)){\n Dialog.showMessageDialog(owner, \"Note your Date of Birth has been corrected\", \"Date Corrected\",DialogIcon.INFORMATION);\n }\n txtDOB.setText(dateFormat.format(date));\n } catch (ParseException ex) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n try {\n int mobile=Integer.parseInt(txtMobile.getText());\n } catch (NumberFormatException e) {\n Dialog.showMessageDialog(owner, \"Invalid Mobile Number\", \"Invalid data\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n if(txtMobile.getText().length() != 10){\n Dialog.showMessageDialog(owner, \"Sorry your Mobile Number is invalid\", \"Invalid input\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n String sql=\"select Username,Password from users where Username=?\";\n try(PreparedStatement prstmt=con.prepareStatement(sql)) {\n prstmt.setString(1, username.getText());\n ResultSet rs=prstmt.executeQuery();\n if(rs.next()){\n Dialog.showMessageDialog(owner, \"Sorry Username already exists\\n Please change to different Username\", \"Username Exists\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n rs.close();\n } catch (SQLException e) {\n System.err.println(e);\n }\n return true;\n }", "public void validate_the_Postcode_of_Correspondence_Address_in_Customer_Tab(String Postcode)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Postcode\").replaceAll(\"M_InnerText\", Postcode), \"Postcode of Correspondence Address - \"+Postcode, false);\n\t}", "public abstract FieldReport validate(int fieldSequence, Object fieldValue);", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "private boolean validateData() {\n if (!mCommon.validateData()) return false;\n\n Core core = new Core(this);\n\n // Due Date is required\n if (TextUtils.isEmpty(getRecurringTransaction().getDueDateString())) {\n core.alert(R.string.due_date_required);\n return false;\n }\n\n if (TextUtils.isEmpty(mCommon.viewHolder.dateTextView.getText().toString())) {\n core.alert(R.string.error_next_occurrence_not_populate);\n\n return false;\n }\n\n // Payments Left must have a value\n if (getRecurringTransaction().getPaymentsLeft() == null) {\n core.alert(R.string.payments_left_required);\n return false;\n }\n return true;\n }", "public void validate_the_Address_Line_1_of_Correspondence_Address_in_Customer_Tab(String AddressLine1)throws Exception {\n\t\tReport.fnReportPageBreak(\"Correspondence Address\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CorrespondenceAddress.replaceAll(\"M_Header\", \"Correspondence Address\").replaceAll(\"M_Category\", \"Address Line 1\").replaceAll(\"M_InnerText\", AddressLine1), \"Address Line 1 of Correspondence Address - \"+AddressLine1, false);\n\t\t\n\t}", "private void setupRequiredValidation() {\n requiredMafExpressions.put(FIELD_HUGO_SYMBOL, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_HUGO_SYMBOL, \"may not be blank\");\r\n requiredMafExpressions.put(FIELD_ENTREZ_GENE_ID, Pattern.compile(\"\\\\d+\")); // number\r\n requiredFieldDescriptions.put(FIELD_ENTREZ_GENE_ID, \"must be an integer number\");\r\n requiredMafExpressions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_TUMOR_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_TUMOR_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_VALIDATION_STATUS, Pattern.compile(\"Valid|Wildtype|Unknown|\\\\S?\"));\r\n requiredFieldDescriptions.put(FIELD_VALIDATION_STATUS, \"must be Valid, Wildtype, Unknown, or blank\");\r\n requiredMafExpressions.put(FIELD_CHROMOSOME, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_CHROMOSOME, \"must be one of: X, Y, M, 1-22, or full name of unassigned fragment\");\r\n setupMafSpecificChecks();\r\n }", "public Boolean validateTransCode(String noteCode, Long staffId, String transType) throws Exception;", "public static void main(String[] args) {\n\n\t\tString emailID = \"[email protected]\";\n\t\tboolean isValidEmailID = true;\n\n\t\t//get index(position) value of '@' and '.'\n\t\tint at_index = emailID.indexOf('@');\n\t\tint dot_index = emailID.indexOf('.');\n\t\t\t\t\n\t\t// Check all rules one by one, if any one of the rule is not satisfied then it returns false immediately,\n\t\t// it returns true only after all the rules are satisfied\n\t\tisValidEmailID = (at_index < 0 || dot_index < 0) ? false\n\t\t\t\t: (at_index != emailID.lastIndexOf('@') || dot_index != emailID.lastIndexOf('.')) ? false\n\t\t\t\t\t\t: (emailID.substring(at_index + 1, dot_index).length() != 4) ? false\n\t\t\t\t\t\t\t\t: (emailID.substring(0, at_index).length() < 3) ? false\n\t\t\t\t\t\t\t\t\t\t: (emailID.toLowerCase().endsWith(\".com\") == false) ? false : true;\n\t\t\n\t\tSystem.out.println(\"Email ID : \" + emailID);\n\t\t\n\t\t\t\t\t\t\n\t\tif (isValidEmailID) {\n\t\t\tSystem.out.println(\"Email Validation Result : True (ie given maild is in vaild format)\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Email Validation Result : False (ie given maild is not in vaild format)\");\n\t\t}\n\n\t}", "void fiscalCodeValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data\n person.setFiscalCode(null);\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n person.setFiscalCode(\"A\");\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }", "public boolean validateContactAddress(String contactId, List<String> result)\n {\n return true;\n }", "public boolean Validate() \r\n {\n return phoneNumber.matcher(getText()).matches();\r\n }", "@Override\n public void validateSearchParameters(Map fieldValues) {\n List<String> lookupFieldAttributeList = null;\n if (getBusinessObjectMetaDataService().isLookupable(getBusinessObjectClass())) {\n lookupFieldAttributeList = getBusinessObjectMetaDataService().getLookupableFieldNames(getBusinessObjectClass());\n }\n if (ObjectUtils.isNull(lookupFieldAttributeList)) {\n throw new RuntimeException(\"Lookup not defined for business object \" + getBusinessObjectClass());\n }\n\n String agencyNumber = (String) fieldValues.get(KFSPropertyConstants.AGENCY_NUMBER);\n String proposalNumber = (String) fieldValues.get(KFSPropertyConstants.PROPOSAL_NUMBER);\n String invoiceDocumentNumber = (String) fieldValues.get(ArPropertyConstants.INVOICE_DOCUMENT_NUMBER);\n String customerNumber = (String) fieldValues.get(ArPropertyConstants.CustomerInvoiceWriteoffLookupResultFields.CUSTOMER_NUMBER);\n String customerName = (String) fieldValues.get(ArPropertyConstants.CustomerInvoiceWriteoffLookupResultFields.CUSTOMER_NAME);\n\n if ((ObjectUtils.isNull(customerNumber) || StringUtils.isBlank(customerNumber)) && (ObjectUtils.isNull(agencyNumber) || StringUtils.isBlank(agencyNumber)) && (ObjectUtils.isNull(customerName) || StringUtils.isBlank(customerName)) && (ObjectUtils.isNull(proposalNumber) || StringUtils.isBlank(proposalNumber)) && (ObjectUtils.isNull(invoiceDocumentNumber) || StringUtils.isBlank(invoiceDocumentNumber))) {\n GlobalVariables.getMessageMap().putError(KFSPropertyConstants.AGENCY_NUMBER, ArKeyConstants.ReferralToCollectionsDocumentErrors.ERROR_EMPTY_REQUIRED_FIELDS);\n }\n\n if (GlobalVariables.getMessageMap().hasErrors()) {\n throw new ValidationException(\"errors in search criteria\");\n }\n\n }", "public interface ValidacionConstantes {\n\t\n\t/**\n\t * Expresión regular para validar correos electrónicos.\n\t */\n\tString EXPR_REG_EMAIL = \"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"\"\n\t\t\t+ \"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x\"\n\t\t\t+ \"0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-\"\n\t\t\t+ \"9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4\"\n\t\t\t+ \"][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\"\n\t\t\t+ \"-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\n\t\n\t\n\t/*\n\t * Mensajes de validación\n\t */\n\t\n\t\n\tString MSG_EMAIL_REQUERIDO = \"Correo electrónico no válido\";\n\t\n\t\n\n}", "@Test\r\n\tpublic void TC_07_verify_Invalid_Email_Address_format() {\r\n\r\n\t\thomePgObj = new Page_Home(driver);\r\n\t\tregPgObj = homePgObj.click_RegistrationLink();\r\n\t\t\r\n\t\t// Step 1: Verify the registration page is displayed\r\n\t\t\r\n\t\tflag = regPgObj.registrationPgDisplay();\r\n\t\t\r\n\t\t// Step 2: Enter valid/mandatory registration details with invalid email address format\r\n\t\tAssert.assertTrue(flag, \"Registration page is displayed\");\r\n\t\tregPgObj.enterRegistrationDetails(\"firstName\", firstName);\r\n\t\tregPgObj.enterRegistrationDetails(\"lastName\", lastName);\r\n\t\tregPgObj.enterRegistrationDetails(\"email\", InvalidEmail);\r\n\t\tregPgObj.enterRegistrationDetails(\"password\", password);\r\n\t\tregPgObj.enterRegistrationDetails(\"confirmPassword\", confirmPassword);\r\n\t\t\r\n\t\t// Step 3: Click on Sign in button\r\n\t\t\r\n\t\tregPgObj.clickSignInButton();\r\n\t\t\r\n\t\t// Step 4: Verify user should NOT be able to proceed further with registration as proper validation message regarding invalid email address\r\n\t\t//format is displayed\r\n\t\t\r\n\t\terrMsg = Page_Registration.getMandatoryFieldErrMsg();\r\n\t\tAssert.assertEquals(errMsg, \"The email address is invalid.\");\r\n\r\n\t}", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "UserPayment validate(String cardHolderName,String cardType,String securityCode,String paymentType);" ]
[ "0.6650722", "0.6217014", "0.6086967", "0.60280496", "0.5947238", "0.5944201", "0.59208447", "0.58571684", "0.58157635", "0.5751028", "0.573602", "0.57191837", "0.5718714", "0.5707463", "0.56975853", "0.5637773", "0.56296045", "0.56264234", "0.56083316", "0.55629736", "0.5551999", "0.5549118", "0.5526831", "0.5518445", "0.55093616", "0.54745793", "0.54721177", "0.5466445", "0.54572576", "0.5454025", "0.54509103", "0.54503554", "0.5447186", "0.54329956", "0.5412925", "0.54047805", "0.5401638", "0.5394882", "0.5383155", "0.5370365", "0.53641737", "0.53601444", "0.53578347", "0.5356276", "0.5347637", "0.53473175", "0.53410596", "0.5338634", "0.5334784", "0.53340024", "0.53329855", "0.53260094", "0.53191113", "0.53179616", "0.53179616", "0.5309378", "0.5303296", "0.5296375", "0.52942055", "0.52909094", "0.5289021", "0.52768195", "0.5276152", "0.52685857", "0.5266485", "0.52645975", "0.5252753", "0.52523583", "0.5248026", "0.5245267", "0.52451354", "0.5239837", "0.5238758", "0.5232229", "0.5226215", "0.5222363", "0.52187264", "0.5210547", "0.5200919", "0.5196057", "0.51872426", "0.518662", "0.5180973", "0.5178901", "0.5178241", "0.51780516", "0.51756835", "0.51751935", "0.5164234", "0.51619077", "0.51510155", "0.51504797", "0.515022", "0.5137955", "0.5134282", "0.51166666", "0.5112945", "0.5108963", "0.51081556", "0.5100482" ]
0.6731941
0
Validation Functions Description : To validate the Preferred Contact Method in Contact Details of Customer Tab for SMS Coded by :Padma Created Data:25 Jan 2017 Last Modified Date: Modified By: Parameter:
public void validate_the_Preferred_Contact_Method_in_Contact_Details_of_Customer_Tab_SMS(boolean status)throws Exception { boolean checked=VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll("M_Header", "Contact Details").replaceAll("M_Category", "Preferred Contact Method").replaceAll("M_InnerText", "SMSPreference"), "Preferred Contact Method on SMS "); if(checked==status) Report.fnReportPass("Preferred Contact Method - SMS : Checked status = "+status+"Display Status"+checked, driver); else Report.fnReportFail("Preferred Contact Method - SMS : Checked status = "+status+"Display Status"+checked, driver); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate_the_Preferred_Contact_Method_in_Contact_Details_of_Customer_Tab_Mail(boolean status)throws Exception {\n\t\t\t\n\t\t\tboolean checked=VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Preferred Contact Method\").replaceAll(\"M_InnerText\", \"Mail\"), \"Preferred Contact Method on Mail \");\n\t\t\t\n\t\t\tif(checked==status)\n\t\t\t\tReport.fnReportPass(\"Preferred Contact Method - Mail : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\telse\n\t\t\t\tReport.fnReportFail(\"Preferred Contact Method - Mail : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\n\t\t\n\t}", "public void validate_the_Preferred_Contact_Method_in_Contact_Details_of_Customer_Tab_Email(boolean status)throws Exception {\n\t\t\t\n\t\t\tboolean checked=VerifyElementPresentAndGetCheckBoxStatus(Desktop_XPATH_Verify_Customer_Page_MarketingPreferences.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Preferred Contact Method\").replaceAll(\"M_InnerText\", \"Email\"), \"Preferred Contact Method on Email \");\n\t\t\t\n\t\t\tif(checked==status)\n\t\t\t\tReport.fnReportPass(\"Preferred Contact Method - Email : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\telse\n\t\t\t\tReport.fnReportFail(\"Preferred Contact Method - Email : Checked status = \"+status+\"Display Status\"+checked, driver);\n\t\t\t\n\t\t\n\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "void validateMobileNumber(String stringToBeValidated,String name);", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "abstract void telephoneValidity();", "private boolean checkValidations() {\n if (TextUtils.isEmpty(etFirstName.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_name_war));\n return false;\n } else if (etPhoneNo.getText().length() > 0 && etPhoneNo.getText().toString().trim().length() < 7) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.valid_mo_no_war));\n return false;\n }\n /*else if (TextUtils.isEmpty(etAdress.getText().toString().trim())) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.empty_address_war));\n return false;\n } else if (countryId==null || countryId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.country_war));\n return false;\n } else if (stateId==null || stateId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.state_war));\n return false;\n }*/ /*else if (cityId==null || cityId.equals(\"\")) {\n appUtils.showSnackBar(getActivity().findViewById(android.R.id.content), getString(R.string.city_war));\n return false;\n }*/\n else\n return true;\n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "private boolean validate(){\n\n String MobilePattern = \"[0-9]{10}\";\n String name = String.valueOf(userName.getText());\n String number = String.valueOf(userNumber.getText());\n\n\n if(name.length() > 25){\n Toast.makeText(getApplicationContext(), \"pls enter less the 25 characher in user name\",\n Toast.LENGTH_SHORT).show();\n return true;\n }\n\n\n\n else if(name.length() == 0 || number.length() == 0 ){\n Toast.makeText(getApplicationContext(), \"pls fill the empty fields\",\n Toast.LENGTH_SHORT).show();\n return false;\n }\n\n\n\n else if(number.matches(MobilePattern))\n {\n\n return true;\n }\n else if(!number.matches(MobilePattern))\n {\n Toast.makeText(getApplicationContext(), \"Please enter valid 10\" +\n \"digit phone number\", Toast.LENGTH_SHORT).show();\n\n\n return false;\n }\n\n return false;\n\n }", "public void checkvalidate()\n\t{\n\t\tif((fn.getText().toString()).equals(\"\"))\n \t{\n \t\t//text1.setText(\"Name not entered!!\");\n\t\t\tToast.makeText(AddContact.this, \"Name Not Entered\",Toast.LENGTH_SHORT).show();\n \t}\n \telse if((mobno.getText().toString()).equals(\"\"))\n \t{\n \t\t//text1.setText(\"Phone not entered!!\");\n \t\tToast.makeText(AddContact.this, \"Phone No. not Entered\",Toast.LENGTH_SHORT).show();\n \t}\t\n \telse\n \t{\n \t\tname=fn.getText().toString();\n\t\t\tstrln=ln.getText().toString();\n\t\t\t//mname=mn.getText().toString();\n\t\t\tstrmno=mobno.getText().toString();\n\t\t\tstreid=eid.getText().toString();\n\t\t\tstrtag_type=stag.getSelectedItem().toString();\n\t\t\tstrtag=tag.getText().toString();\n\t\t\tmshome=mhome.getText().toString();\n\t\t\tmswork=mwork.getText().toString();\n\t\t\tmsother=moth.getText().toString();\n\t\t\teswork=ework.getText().toString();\n\t\t\tesother=eoth.getText().toString();\n\t\t\tnotes=enotes.getText().toString();\n\t\t\tdata.Insert(name,mname,strln,strmno,mshome,mswork,msother,mscust, streid,eswork,esother,mscust,imagePath,strtag_type,strtag,0,date,time,notes,0);\n\t\t\tToast.makeText(AddContact.this, \"Added Successfully\",Toast.LENGTH_SHORT).show();\n\t\t\tCursor c=data.getData();\n\t\t\twhile(c.moveToNext())\n\t\t\t{\n\t\t\t\tString name1=c.getString(0);\n\t\t\t\tSystem.out.println(\"Name:\"+name1);\n\t\t\t\t\n\t\t\t}\n\t\t\tc.close();\n\t\t\tviewcontacts();\n \t}\n\t\t\n\t}", "private void validateFields(){\n String email = edtEmail.getText().toString().trim();\n String number=edtPhone.getText().toString().trim();\n String cc=txtCountryCode.getText().toString();//edtcc.getText().toString().trim();\n String phoneNo=cc+number;\n // Check for a valid email address.\n\n\n if (TextUtils.isEmpty(email)) {\n mActivity.showSnackbar(getString(R.string.error_empty_email), Toast.LENGTH_SHORT);\n return;\n\n } else if (!Validation.isValidEmail(email)) {\n mActivity.showSnackbar(getString(R.string.error_title_invalid_email), Toast.LENGTH_SHORT);\n return;\n\n }\n\n if(TextUtils.isEmpty(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_empty_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n if(!Validation.isValidMobile(phoneNo)){\n mActivity.showSnackbar(getString(R.string.error_title_invalid_Mobile), Toast.LENGTH_SHORT);\n return;\n }\n\n if(selectedCurrency==null){\n //mActivity.showSnackbar(getString(R.string.str_select_currency), Toast.LENGTH_SHORT);\n Snackbar.make(getView(),\"Currency data not found!\",Snackbar.LENGTH_LONG)\n .setAction(\"Try again\", new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n getAllCurrency();\n }\n }).show();\n return;\n }\n try {\n JsonObject object = new JsonObject();\n object.addProperty(KEY_EMAIL, email);\n object.addProperty(KEY_PHONE,phoneNo);\n object.addProperty(KEY_CURRENCY,selectedCurrency.getId().toString());\n updateUser(object,token);\n }catch (Exception e){\n\n }\n\n }", "private void validateDetails() {\n\n clearErrors();\n Utils.hide_keyboard(getActivity());\n\n boolean valid = true;\n\n String cvv = cvvTv.getText().toString();\n String expiryDate = cardExpiryTv.getText().toString();\n String cardNo = cardNoTv.getText().toString();\n\n if (cvv.length() < 3) {\n valid = false;\n cvvTil.setError(\"Enter a valid cvv\");\n }\n\n if (expiryDate.length() != 5) {\n cardExpiryTil.setError(\"Enter a valid expiry date\");\n valid = false;\n }\n\n String cardNoStripped = cardNo.replaceAll(\"\\\\s\", \"\");\n\n if (cardNoStripped.length() < 12 ) {\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n else {\n try {\n Long parsed = Long.parseLong(cardNoStripped);\n }\n catch (Exception e) {\n e.printStackTrace();\n valid = false;\n cardNoTil.setError(\"Enter a valid credit card number\");\n }\n }\n\n if (valid) {\n\n if (saveCardSwitch.isChecked()) {\n int cardLen = cardNoStripped.length();\n cardFirst6 = cardNoStripped.substring(0, 6);\n cardLast4 = cardNoStripped.substring(cardLen - 4, cardLen);\n shouldISaveThisCard = true;\n presenter.savePotentialCardDets(cardFirst6, cardLast4);\n }\n\n //make request\n PayloadBuilder builder = new PayloadBuilder();\n builder.setAmount(thetellerInitializer.getAmount() + \"\")\n .setNarration(thetellerInitializer.getNarration())\n .setCardno(cardNoStripped)\n .set3dUrl(thetellerInitializer.get3dUrl())\n .setEmail(thetellerInitializer.getEmail())\n .setCurrency(thetellerInitializer.getCurrency())\n .setMerchant_id(thetellerInitializer.getMerchant_id())\n .setCvv(cvv).setFirstname(thetellerInitializer.getfName())\n .setLastname(thetellerInitializer.getlName())\n .setIP(Utils.getDeviceImei(getActivity()))\n .setTxRef(thetellerInitializer.getTxRef())\n .setExpiryyear(expiryDate.substring(3,5))\n .setExpirymonth(expiryDate.substring(0,2))\n .setMeta(thetellerInitializer.getMeta())\n .setApiUser(thetellerInitializer.getApiUser())\n .setApiKey(thetellerInitializer.getApiKey())\n .setDevice_fingerprint(Utils.getDeviceImei(getActivity()))\n .setCardType(cardType);\n\n if (thetellerInitializer.getPayment_plan() != null) {\n builder.setPaymentPlan(thetellerInitializer.getPayment_plan());\n }\n\n body = builder.createPayload();\n\n presenter.chargeCard(body, thetellerConstants.API_KEY);\n }\n }", "protected void validateMobileNumber(){\n /*\n Checking For Mobile number\n The Accepted Types Are +00 000000000 ; +00 0000000000 ;+000 0000000000; 0 0000000000 ; 00 0000000000\n */\n Boolean mobileNumber = Pattern.matches(\"^[0]?([+][0-9]{2,3})?[-][6-9]+[0-9]{9}\",getMobileNumber());\n System.out.println(mobileNumberResult(mobileNumber));\n }", "private void validateCreateCustomer(CustomersInputDTO inputData, String formatDate) {\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData.getCustomerName() == null || inputData.getCustomerName().isBlank()) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_CUSTOMER_NAME, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessMainId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_MAIN_ID, Constants.RIQUIRED_CODE));\n }\n if (inputData.getBusinessSubId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.PARAM_BUSINESS_SUB_ID, Constants.RIQUIRED_CODE));\n }\n\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "void telephoneValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"+391111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"1111111111\");\n assertDoesNotThrow(person::checkDataValidity);\n person.setTelephone(\"111 1111111\");\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data\n person.setTelephone(\"AAA\");\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }", "@Override\n public void validate() {\n boolean b = false;\n\n //retrieving the contact us form details from request object\n String firstName = objContactUsForm.getName().trim();\n String email = objContactUsForm.getEmail().trim();\n String message = objContactUsForm.getMessage().trim();\n\n //now validating each of the field\n if (firstName.isEmpty()) {\n addFieldError(\"name\", getText(\"name.required\"));\n b = true;\n }\n\n if (email.isEmpty()) {\n addFieldError(\"email\", getText(\"email.required\"));\n b = true;\n }\n if (!b) {\n Pattern p = Pattern.compile(\".+@.+\\\\.[a-z]+\");\n Matcher m = p.matcher(email);\n boolean matchFound = m.matches();\n if (!matchFound) {\n addFieldError(\"email\", \"Please Provide Valid Email ID\");\n }\n }\n\n if (message.isEmpty()) {\n addFieldError(\"message\", getText(\"message.required\"));\n b = true;\n }\n\n if (!b) {\n boolean matches = message.matches(\"[<>!~@$%^&\\\"|!\\\\[#$]\");\n if (matches) {\n addFieldError(\"message\", \"Please Provide Valid Message Name\");\n b = true;\n }\n }\n }", "private boolean isInfoValidate(){\n if(mEmailAddress.getText() == null || mEmailAddress.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_email_address);\n return false;\n }\n\n if(!mEmailAddress.getText().toString().contains(\"@\")){\n errorText = getString(R.string.register_warning_valid_email_address);\n return false;\n }\n\n// if(mRegionSpinner.getSelectedItemPosition() == Constant.NON_SELECT){\n// errorText = getString(R.string.register_warning_select_region);\n// return false;\n// }\n\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.HONG_KONG)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.HONGKONG_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n//\n// if( (mRegionSpinner.getSelectedItemPosition() == Constant.CHINA)\n// &&\n// (mEmailAddress.getText().toString().length() != Constant.CHINA_PHONE_LENGTH) ){\n//\n// errorText = getString(R.string.register_warning_valid_phone_num);\n// return false;\n// }\n\n if(mPassword.getText() == null || mPassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_input_password);\n return false;\n }\n\n if(mRetypePassword.getText() == null || mRetypePassword.getText().toString().equals(\"\")){\n errorText = getString(R.string.register_warning_retype_password);\n return false;\n }\n\n if(!mPassword.getText().toString().equals(mRetypePassword.getText().toString())){\n errorText = getString(R.string.register_warning_not_the_same);\n return false;\n }\n\n if(!Utility.judgeContainsStr( mPassword.getText().toString())){\n errorText = getString(R.string.register_warning_contains_character);\n return false;\n }\n\n// if(!mPolicyCheckBox.isChecked()){\n// errorText = getString(R.string.register_warning_check_agreement);\n// return false;\n// }\n\n return true;\n }", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "private boolean validateForm() {\n Boolean validFlag = true;\n String email = emailTxt.getText().toString().trim();\n String name = nameTxt.getText().toString().trim();\n String phone = phoneTxt.getText().toString().trim();\n String password = passwordTxt.getText().toString();\n String confirPassWord = confirmPasswordTxt.getText().toString();\n\n Pattern emailP = Pattern.compile(\"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\", Pattern.CASE_INSENSITIVE);\n Matcher emailM = emailP.matcher(email);\n boolean emailB = emailM.find();\n\n if (TextUtils.isEmpty(email) || email.equals(\"\") || !emailB) {\n emailTxt.setError(\"Email bị để trống hoặc không dúng định dạng.\");\n validFlag = false;\n } else {\n emailTxt.setError(null);\n }\n\n if (TextUtils.isEmpty(password) || password.length() < 6) {\n passwordTxt.setError(\"Mật khẩu phải 6 ký tự trở lên\");\n validFlag = false;\n } else {\n passwordTxt.setError(null);\n }\n\n Pattern phoneP = Pattern.compile(\"[0-9]{8,15}$\");\n Matcher phoneM = phoneP.matcher(phone);\n boolean phoneB = phoneM.find();\n\n if (TextUtils.isEmpty(phone) || phone.length() < 8 || phone.length() > 15 || !phoneB) {\n phoneTxt.setError(\"Số điện thoại bị để trống hoặc không đúng định dạng\");\n validFlag = false;\n } else {\n phoneTxt.setError(null);\n }\n if (confirPassWord.length() < 6 || !confirPassWord.equals(password)) {\n confirmPasswordTxt.setError(\"Xác nhận mật khẩu không đúng\");\n validFlag = false;\n } else {\n confirmPasswordTxt.setError(null);\n }\n\n Pattern p = Pattern.compile(\"[0-9]\", Pattern.CASE_INSENSITIVE);\n Matcher m = p.matcher(name);\n boolean b = m.find();\n if (b) {\n nameTxt.setError(\"Tên tồn tại ký tự đặc biệt\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n if (TextUtils.isEmpty(name)) {\n nameTxt.setError(\"Không được để trống tên.\");\n validFlag = false;\n } else {\n nameTxt.setError(null);\n }\n\n return validFlag;\n }", "private boolean validate() {\n if(edtMobileNumber.getText().toString().length() <= 0){\n edtMobileNumber.setFocusable(true);\n edtMobileNumber.setError(Constants.ERR_MSG_MOBILE);\n return false;\n }else if(edtFirstName.getText().toString().length() <= 0){\n edtFirstName.setFocusable(true);\n edtFirstName.setError(Constants.ERR_MSG_FIRST_NAME);\n return false;\n }else if(edtLastName.getText().toString().length() <= 0){\n edtLastName.setFocusable(true);\n edtLastName.setError(Constants.ERR_MSG_LAST_NAME);\n return false;\n }else if(edtDateOfBirth.getText().toString().length() <= 0){\n edtDateOfBirth.setFocusable(true);\n edtDateOfBirth.setError(Constants.ERR_MSG_DATE_OF_BIRTH);\n return false;\n }else if(edtEnterPin.getText().toString().length() <= 0){\n edtEnterPin.setFocusable(true);\n edtEnterPin.setError(Constants.ERR_MSG_PIN);\n return false;\n }else if(edtConfirmPin.getText().toString().length() <= 0){\n edtConfirmPin.setFocusable(true);\n edtConfirmPin.setError(Constants.ERR_MSG_CONFIRM_PIN);\n return false;\n }else if(spnStatus.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_STATUS, Toast.LENGTH_SHORT).show();\n return false;\n }else if(spnBloodGroup.getSelectedItemPosition() == 0){\n Toast.makeText(context, Constants.ERR_MSG_BLOOD_GROUP, Toast.LENGTH_SHORT).show();\n return false;\n }else if(rgGender.getCheckedRadioButtonId() == -1){\n Toast.makeText(context,Constants.ERR_MSG_GENDER,Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "private void validateUpdateCustomer(CustomersInputDTO inputData, String formatDate) {\n List<Map<String, Object>> listValidate = new ArrayList<>();\n if (inputData == null) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(\"inputData\", Constants.RIQUIRED_CODE));\n }\n Long customerId = inputData.getCustomerId();\n if (inputData.getCustomerId() == null) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_ID, Constants.RIQUIRED_CODE));\n }\n // 1.2 Validate parent relation\n if (inputData.getParentId() != null && inputData.getParentId().longValue() > 0l) {\n if (!isSameParentId(customerId, inputData.getParentId())) {\n Long countRelParentId = customersRepository.countCustomerExistedWithParentId(inputData.getParentId(),\n customerId);\n if (ConstantsCustomers.NUMBER_CHECK_PARENT_ID.equals(countRelParentId)) {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n } else {\n listValidate.add(CommonUtils.putError(ConstantsCustomers.CUSTOMER_PARENT,\n ConstantsCustomers.CUSTOMER_PARENT_INVAIL));\n }\n }\n // build map parameters\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n buildParamsValidateCustomersInput(inputData, jsonBuilder), formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n listValidate.addAll(CustomersCommonUtil.validateCommon(validateJson, restOperationUtils, token, tenantName));\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "private void checkFields() {\n\t\t\n\t\tboolean errors = false;\n\t\t\n\t\t// contact name\n\t\tString newName = ((TextView) findViewById(R.id.tvNewContactName)).getText().toString();\n\t\tTextView nameErrorView = (TextView) findViewById(R.id.tvContactNameError);\n\t\tif(newName == null || newName.isEmpty()) {\n\t\t\terrors = true;\n\t\t\tnameErrorView.setText(\"Contact must have a name!\");\n\t\t} else {\n\t\t\tnameErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact phone number\n\t\tString newPhone = ((TextView) findViewById(R.id.tvNewContactPhone)).getText().toString();\n\t\tTextView phoneNumberErrorView = (TextView) findViewById(R.id.tvContactPhoneError);\n\t\tif(newPhone == null || newPhone.isEmpty()) {\n\t\t\terrors = true;\n\t\t\tphoneNumberErrorView.setText(\"Contact must have a phone number!\");\n\t\t} else {\n\t\t\tphoneNumberErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact e-mail\n\t\tString newEmail= ((TextView) findViewById(R.id.tvNewContactEmail)).getText().toString();\n\t\tTextView emailErrorView = (TextView) findViewById(R.id.tvContactEmailError);\n\t\tif(newEmail == null || newEmail.isEmpty()) {\n\t\t\terrors = true;\n\t\t\temailErrorView.setText(\"Contact must have an E-mail!\");\n\t\t} else if (!newEmail.matches(\".+@.+\\\\..+\")) {\n\t\t\terrors = true;\n\t\t\temailErrorView.setText(\"Invalid E-mail address! Example:\"\n\t\t\t\t\t+ \"[email protected]\");\n\t\t} else {\n\t\t\temailErrorView.setText(\"\");\n\t\t}\n\t\t\n\t\t// contact note\n\t\tString newNote = ((TextView) findViewById(R.id.tvNewContactNote)).getText().toString();\n\t\t\n\t\t// contact Facebook profile address\n\t\tString newAddress = ((TextView) findViewById(R.id.tvNewContactAddress)).getText().toString();\n\t\t\n\t\t// save the new contact if all the required fields are filled out\n\t\tif(!errors) {\n\t\t\tif(newNote == null || newNote.isEmpty()) {\n\t\t\t\tnewNote = \"No note.\";\n\t\t\t}\n\t\t\t\n\t\t\tif(newAddress == null || newAddress.isEmpty()) {\n\t\t\t\tnewAddress = \"No address.\";\n\t\t\t}\n\t\t\tHomeActivity.listOfContacts.add(new Contact(newName, newPhone, newEmail, \n\t\t\t\t\tnewNote, newAddress));\n\t\t\tIntent intent = new Intent(AddContactActivity.this, HomeActivity.class);\n\t\t\tstartActivity(intent);\n\t\t}\n\t}", "private boolean isValidate() {\n name = edt_name.getText().toString();\n phone = edt_phone.getText().toString();\n landMark = edt_landmark.getText().toString();\n address = edt_address.getText().toString();\n city = edt_city.getText().toString();\n state = edt_state.getText().toString();\n if (name.length() == 0) {\n edt_name.setError(\"Please Enter Name \");\n requestFocus(edt_name);\n return false;\n } else if (phone.isEmpty()) {\n edt_phone.setError(\"Please Enter Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (phone.length() != 10) {\n edt_phone.setError(\"Please Enter Valid Phone Number \");\n requestFocus(edt_phone);\n return false;\n } else if (address.length() == 0) {\n edt_address.setError(\"Please Enter Address\");\n requestFocus(edt_address);\n return false;\n } else if (city.length() == 0) {\n edt_city.setError(\"Please Enter City Name\");\n requestFocus(edt_city);\n return false;\n } else if (state.length() == 0) {\n edt_state.setError(\"Please Enter State Name\");\n requestFocus(edt_state);\n return false;\n }\n return true;\n }", "public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Work\").replaceAll(\"M_InnerText\", TelephoneWork), \"Telephone - Work - \"+TelephoneWork, false);\n\t}", "public void validate_the_Telephone_Mobile_in_Contact_Details_of_Customer_Tab(String TelephoneMobile)throws Exception {\n\t\tReport.fnReportPageBreak(\"Telephone Details\", driver);\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneMobile.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Mobile\").replaceAll(\"M_InnerText\", TelephoneMobile), \"Telephone - Mobile - \"+TelephoneMobile, false);\n\t}", "public void validate_the_Telephone_Home_in_Contact_Details_of_Customer_Tab(String TelephoneHome)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneHome.replaceAll(\"M_Header\", \"Contact Details\").replaceAll(\"M_Category\", \"Telephone - Home\").replaceAll(\"M_InnerText\", TelephoneHome), \"Telephone - Home - \"+TelephoneHome, false);\n\t}", "private boolean validate(MessageType mt) {\n if (mt.getDesignation() == null) {\n DialogUtility\n .showMessageBox(this.shell, SWT.ICON_ERROR | SWT.OK,\n \"Message Type - Designation\",\n \"Designation is a required field. Please select a Designation.\");\n return false;\n }\n\n /*\n * verify that an afos id has been set.\n */\n if (mt.getAfosid() == null || mt.getAfosid().isEmpty()) {\n DialogUtility\n .showMessageBox(this.shell, SWT.ICON_ERROR | SWT.OK,\n \"Message Type - Message Type\",\n \"Message Type is a required field. Please enter a Message Type.\");\n return false;\n }\n\n /*\n * verify that a title has been set.\n */\n if (mt.getTitle() == null || mt.getTitle().isEmpty()) {\n DialogUtility.showMessageBox(this.shell, SWT.ICON_ERROR | SWT.OK,\n \"Message Type - Title\",\n \"Title is a required field. Please enter a Title.\");\n return false;\n }\n\n /*\n * verify that the afos id is unique.\n */\n try {\n MessageType existingMessageType = this.mtdm.getMessageType(mt\n .getAfosid());\n if (existingMessageType != null) {\n DialogUtility\n .showMessageBox(\n this.shell,\n SWT.ICON_ERROR | SWT.OK,\n \"Message Type - Message Type\",\n \"Message Type \"\n + mt.getAfosid()\n + \" already exists. Please enter a unique Message Type.\");\n return false;\n }\n } catch (Exception e) {\n statusHandler.error(\n \"Failed to determine if Message Type \" + mt.getAfosid()\n + \" is unique.\", e);\n return false;\n }\n\n return true;\n }", "public static void validation() {\n\t\tif ((!textFieldName.getText().isEmpty()) && (!textField_FirstName.getText().isEmpty())\n\t\t\t\t&& (!textField_Town.getText().isEmpty()) && (!textField_Town.getText().isEmpty())) {\n\n\t\t\tif ((isValidEmailAddress(textField_Email.getText()) == true)) {\n\t\t\t\ttextField_Email.setBackground(Color.white);\n\t\t\t\tif ((force(textField_Mtp.getText()) > 82)) {\n\t\t\t\t\ttextField_Mtp.setBackground(Color.white);\n\t\t\t\t\tactionGiveServeur();\n\n\t\t\t\t} else {\n\t\t\t\t\tshowMessageDialog(null, \"Votre mot de passe est trop faible\");\n\t\t\t\t\ttextField_Mtp.setText(\"Mot de passe trop simple : changer le \");\n\t\t\t\t\ttextField_Mtp.setBackground(Color.RED);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextField_Email.setText(\"Email invalide\");\n\t\t\t\ttextField_Email.setBackground(Color.RED);\n\t\t\t\tshowMessageDialog(null, \"Email est invalide\");\n\t\t\t}\n\t\t} else {\n\n\t\t\tshowMessageDialog(null, \"Certain champs sont vide !\");\n\t\t}\n\t}", "public boolean isValid(){\n Email.setErrorEnabled(false);\n Email.setError(\"\");\n Fname.setErrorEnabled(false);\n Fname.setError(\"\");\n Lname.setErrorEnabled(false);\n Lname.setError(\"\");\n Pass.setErrorEnabled(false);\n Pass.setError(\"\");\n Mobileno.setErrorEnabled(false);\n Mobileno.setError(\"\");\n Cpass.setErrorEnabled(false);\n Cpass.setError(\"\");\n area.setErrorEnabled(false);\n area.setError(\"\");\n Houseno.setErrorEnabled(false);\n Houseno.setError(\"\");\n Pincode.setErrorEnabled(false);\n Pincode.setError(\"\");\n\n boolean isValid=false,isValidname=false,isValidhouseno=false,isValidlname=false,isValidemail=false,isValidpassword=false,isValidconfpassword=false,isValidmobilenum=false,isValidarea=false,isValidpincode=false;\n if(TextUtils.isEmpty(fname)){\n Fname.setErrorEnabled(true);\n Fname.setError(\"Enter First Name\");\n }else{\n isValidname=true;\n }\n if(TextUtils.isEmpty(lname)){\n Lname.setErrorEnabled(true);\n Lname.setError(\"Enter Last Name\");\n }else{\n isValidlname=true;\n }\n if(TextUtils.isEmpty(emailid)){\n Email.setErrorEnabled(true);\n Email.setError(\"Email Address is required\");\n }else {\n if (emailid.matches(emailpattern)) {\n isValidemail = true;\n } else {\n Email.setErrorEnabled(true);\n Email.setError(\"Enter a Valid Email Address\");\n }\n }\n if(TextUtils.isEmpty(password)){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Enter Password\");\n }else {\n if (password.length()<8){\n Pass.setErrorEnabled(true);\n Pass.setError(\"Weak Password\");\n }else {\n isValidpassword = true;\n }\n }\n if(TextUtils.isEmpty(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Enter Password Again\");\n }else{\n if (!password.equals(confpassword)){\n Cpass.setErrorEnabled(true);\n Cpass.setError(\"Password Dosent Match\");\n }else{\n isValidconfpassword=true;\n }\n }\n if(TextUtils.isEmpty(mobile)){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Enter Phone Number\");\n }else{\n if (mobile.length()<10){\n Mobileno.setErrorEnabled(true);\n Mobileno.setError(\"Invalid Mobile Number\");\n } else {\n isValidmobilenum = true;\n }\n }\n if(TextUtils.isEmpty(Area)){\n area.setErrorEnabled(true);\n area.setError(\"Area is Required\");\n }else{\n isValidarea=true;\n }\n if(TextUtils.isEmpty(pincode)){\n Pincode.setErrorEnabled(true);\n Pincode.setError(\"Please Enter Pincode\");\n }else{\n isValidpincode=true;\n }\n if(TextUtils.isEmpty(house)){\n Houseno.setErrorEnabled(true);\n Houseno.setError(\"House field cant be empty\");\n }else{\n isValidhouseno=true;\n }\n isValid=(isValidarea && isValidpincode && isValidconfpassword && isValidpassword && isValidemail && isValidname &&isValidmobilenum && isValidhouseno && isValidlname)? true:false;\n return isValid;\n\n }", "private boolean validate(String name, String phone, String email, String description) {\n if (name.equals(null) || name.equals(\"\") || !isValidMobile(phone) || !isValidMail(email) || description.equals(null) || description.equals(\"\")) {\n\n if (name.equals(null) || name.equals(\"\")) {\n nameText.setError(\"Enter a valid Name\");\n } else {\n nameText.setError(null);\n }\n if (!isValidMobile(phone)) {\n phoneNumber.setError(\"Enter a valid Mobile Number\");\n } else {\n phoneNumber.setError(null);\n }\n if (!isValidMail(email)) {\n emailText.setError(\"Enter a valid Email ID\");\n } else {\n emailText.setError(null);\n }\n if (description.equals(null) || description.equals(\"\")) {\n descriptionText.setError(\"Add few lines about you\");\n } else {\n descriptionText.setError(null);\n }\n return false;\n } else\n return true;\n }", "private boolean tableDataValid()\r\n {\r\n // if there are any form level validations that should go there\r\n int rowTotal = tblProtoCorresp.getRowCount();\r\n int colTotal = tblProtoCorresp.getColumnCount();\r\n for (int rowIndex = 0; rowIndex < rowTotal ; rowIndex++)\r\n {\r\n for (int colIndex = 0; colIndex < colTotal; colIndex++)\r\n {\r\n TableColumn column = codeTableColumnModel.getColumn(colIndex) ;\r\n\r\n ColumnBean columnBean = (ColumnBean)column.getIdentifier() ;\r\n\r\n if (columnBean.getColumnEditable()\r\n && !columnBean.getColumnCanBeNull())\r\n {\r\n if ( tblProtoCorresp.getValueAt(rowIndex,colIndex) != null)\r\n {\r\n if (tblProtoCorresp.getValueAt(rowIndex,colIndex).equals(\"\")\r\n || tblProtoCorresp.getValueAt(rowIndex,colIndex).toString().trim().equals(\"\") )\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n else\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"checkInputValue_exceptionCode.2402\");\r\n\r\n String msgColName = \" \" + columnBean.getDisplayName() + \". \";\r\n CoeusOptionPane.showInfoDialog(msg + msgColName);\r\n tblProtoCorresp.changeSelection(rowIndex, colIndex, false, false) ;\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n }\r\n return true ;\r\n }", "@Override\n\tprotected void validators() {\n\t\tString nsrmc = getDj_nsrxx().getNsrmc();\n\n\t\tif (ValidateUtils.isNullOrEmpty(nsrmc)) {\n\t\t\tthis.setSystemMessage(\"纳税人名称不能为空\", true, null);\n\t\t}\n\n\t}", "private void getSponsorInfo(String sponsorCode){\r\n int resultConfirm =0;\r\n /**\r\n * Updated for REF ID :0003 Feb'21 2003.\r\n * Hour Glass implementation while DB Trsactions Wait\r\n * by Subramanya Feb' 21 2003\r\n */\r\n if( dlgWindow != null){\r\n dlgWindow.setCursor( new Cursor( Cursor.WAIT_CURSOR ) );\r\n }\r\n String sponsorName = rldxController.getSponsorName(sponsorCode);\r\n //Added for COEUSQA-1434 : Add the functionality to set a status on a Sponsor record - start\r\n String sponsorStatus = rldxController.getSponsorStatus();\r\n //Added for COEUSQA-1434 : Add the functionality to set a status on a Sponsor record - end\r\n if( dlgWindow != null ){\r\n dlgWindow.setCursor( new Cursor( Cursor.DEFAULT_CURSOR ) );\r\n }\r\n \r\n //Commented for case#3341 - Sponsor Code Validation - start\r\n// lblSponsorName.setText( trimSponsorName( sponsorName ) );\r\n// txtOrganization.requestFocus();\r\n //Commented for case#3341 - Sponsor Code Validation - end\r\n if ((sponsorName != null) && (!sponsorName.trim().equals(\"\")) && ! INACTIVE_STATUS.equalsIgnoreCase(sponsorStatus)){\r\n //Added for case#3341 - Sponsor Code Validation - start\r\n lblSponsorName.setText(trimSponsorName(sponsorName));\r\n txtOrganization.requestFocus();\r\n //Added for case#3341 - Sponsor Code Validation - end \r\n if ( (!txtOrganization.getText().trim().equals(\"\")) &&\r\n ( !sponsorName.equals(txtOrganization.getText().trim()) ) ){\r\n String msgStr = \"Do you want to overwrite the organization: \" +\r\n txtOrganization.getText().trim() + \" with \" + sponsorName + \"?\";\r\n resultConfirm = CoeusOptionPane.showQuestionDialog(msgStr,\r\n CoeusOptionPane.OPTION_YES_NO,\r\n CoeusOptionPane.DEFAULT_YES);\r\n if (resultConfirm == 0) {\r\n txtOrganization.setText(sponsorName.trim());\r\n }\r\n \r\n }else {\r\n txtOrganization.setText(sponsorName.trim());\r\n //do nothing\r\n }\r\n if (!txtSponsorCode.getText().trim().equals(\"\") ) {\r\n if ( !txtAddress1.getText().trim().equals(\"\") ||\r\n !txtAddress2.getText().trim().equals(\"\") ||\r\n !txtAddress3.getText().trim().equals(\"\") ||\r\n !txtCity.getText().trim().equals(\"\") ||\r\n !txtCounty.getText().trim().equals(\"\") ||\r\n //Commented for Case#4252 - Rolodex state dropdown associated with country - Start\r\n// !((ComboBoxBean)cmbCountry.getItemAt(\r\n// cmbCountry.getSelectedIndex())).getCode().trim().equals(\"USA\") ||\r\n //Case#4252 - End\r\n !txtPostalCode.getText().trim().equals(\"\") ||\r\n !txtPhone.getText().trim().equals(\"\") ||\r\n !txtEMail.getText().trim().equals(\"\") ||\r\n !txtFax.getText().trim().equals(\"\") ) {\r\n \r\n String msgStr =\r\n coeusMessageResources.parseMessageKey(\r\n \"roldxMntDetFrm_confirmationCode.1145\");\r\n resultConfirm = CoeusOptionPane.showQuestionDialog(msgStr,\r\n CoeusOptionPane.OPTION_YES_NO,\r\n CoeusOptionPane.DEFAULT_YES);\r\n if (resultConfirm == 0) {\r\n /* prompt the user for replacing base address on\r\n * confirmation replace the address\r\n */\r\n replaceWithSponsorBaseAdress(sponsorCode);\r\n }\r\n }else {\r\n replaceWithSponsorBaseAdress(sponsorCode);\r\n }\r\n }\r\n //Added for case#3341 - Sponsor Code Validation\r\n txtOrganization.requestFocus(); \r\n //Added for case#3341 - Sponsor Code Validation - start \r\n }else{\r\n lblSponsorName.setText(\"\");\r\n txtSponsorCode.setText(\"\");\r\n txtSponsorCode.requestFocus(); \r\n //Added for COEUSQA-1434 : Add the functionality to set a status on a Sponsor record - start\r\n txtOrganization.setText(CoeusGuiConstants.EMPTY_STRING); \r\n txtAddress1.setText(CoeusGuiConstants.EMPTY_STRING);\r\n txtAddress2.setText(CoeusGuiConstants.EMPTY_STRING);\r\n txtAddress3.setText(CoeusGuiConstants.EMPTY_STRING);\r\n //Added for COEUSQA-1434 : Add the functionality to set a status on a Sponsor record - end\r\n CoeusOptionPane.showInfoDialog(\r\n coeusMessageResources.parseMessageKey(\"roldxMntDetFrm_exceptionCode.1108\")); \r\n }\r\n //Added for case#3341 - Sponsor Code Validation - end\r\n isSponsorInfoRequired =false;\r\n //Commented for case#3341 - Sponsor Code Validation\r\n //txtOrganization.requestFocus(); \r\n }", "private void alertBox_validation(String msg, final int validateflag) {\r\n\t\tAlertDialog.Builder validation_alert = new AlertDialog.Builder(this);\r\n\t\tvalidation_alert.setTitle(\"Information\");\r\n\t\tvalidation_alert.setMessage(msg);\r\n\t\tif (validateflag != 21) {\r\n\t\t\tvalidation_alert.setNeutralButton(\"OK\",\tnew DialogInterface.OnClickListener() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t\tif (validateflag != 0) {\r\n\t\t\t\t\t\tif (validateflag == 1) {\r\n\t\t\t\t\t\t\tmStreetNumberValue.requestFocus();\r\n\t\t\t\t\t\t}else if (validateflag == 3) {\r\n\t\t\t\t\t\t\tmCardNoValue1.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue2.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue3.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue4.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue1.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 7) {\r\n\t\t\t\t\t\t\tmCardNoValue4.setText(\"\");\r\n\t\t\t\t\t\t\tmCardNoValue4.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 8) {\r\n\t\t\t\t\t\t\tmExpirationDateValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 9) {\r\n\t\t\t\t\t\t\tmExpirationDateValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 10) {\r\n\t\t\t\t\t\t\tmCVVNoValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 11) {\r\n\t\t\t\t\t\t\tmCVVNoValue.setText(\"\");\r\n\t\t\t\t\t\t\tmCVVNoValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 15) {\r\n\t\t\t\t\t\t\tmZipCodeValue.requestFocus();\r\n\t\t\t\t\t\t} else if (validateflag == 19) {\r\n\t\t\t\t\t\t\tmCardNoValue1.getText().clear();\r\n\t\t\t\t\t\t\tmCardNoValue2.getText().clear();\r\n\t\t\t\t\t\t\tmCardNoValue3.getText().clear();\r\n\t\t\t\t\t\t\tmCardNoValue4.getText().clear();\r\n\t\t\t\t\t\t} else if (validateflag == 20) {\r\n\t\t\t\t\t\t\tmZipCodeValue.getText().clear();\r\n\t\t\t\t\t\t\tmZipCodeValue.requestFocus();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdialog.dismiss();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tvalidation_alert.setPositiveButton(\"Yes\",new DialogInterface.OnClickListener() {\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t\t// Calling funtion to save fields\r\n\t\t\t\t\tsaveFields();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvalidation_alert.setNegativeButton(\"No\",new DialogInterface.OnClickListener() {\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvalidation_alert.show();\r\n\t}", "@And(\"^Enter user phone and confirmation code$\")\t\t\t\t\t\n public void Enter_user_phone_and_confirmation_code() throws Throwable \t\t\t\t\t\t\t\n { \t\t\n \tdriver.findElement(By.id(\"phoneNumberId\")).sendKeys(\"01116844320\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvPhoneNext']/content/span\")).click();\n driver.findElement(By.id(\"code\")).sendKeys(\"172978\");\n driver.findElement(By.xpath(\"//*[@id='gradsIdvVerifyNext']/content/span\")).click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\t\t\n }", "public boolean Validate() \r\n {\n return phoneNumber.matcher(getText()).matches();\r\n }", "@Test\n\t\tvoid givenEmail_CheckForValidationForMobile_RetrunTrue() {\n\t\t\tboolean result = ValidateUserDetails.validateMobile(\"98 9808229348\");\n\t\t\tAssertions.assertTrue(result);\n\t\t}", "public void validate_the_Phone_Number_in_Customer_Account_Summary_of_Customer_Tab(String PhoneNumber)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_CustomerAccountSummary.replaceAll(\"M_Header\", \"Landline Account Summary\").replaceAll(\"M_Category\", \"Phone Number\").replaceAll(\"M_InnerText\", PhoneNumber), \"Phone Number - \"+PhoneNumber, false);\n\t}", "private boolean validateInputInfo(){\n\n //Get user input\n String firstName = newContactFirstName.getText().toString();\n String lastName = newContactLastName.getText().toString();\n String email = newContactEmailAddress.getText().toString();\n String phone = newContactPhoneNumber.getText().toString();\n\n //Check to make sure no boxes were left empty\n if(firstName.isEmpty() || lastName.isEmpty() || email.isEmpty() || phone.isEmpty()){\n Toast.makeText(this, \"You must fill all fields before continuing!\", Toast.LENGTH_LONG).show();\n return false;\n }\n //Check to see if phone number is valid\n else if(!(phone.length() >= 10)){\n Toast.makeText(this, \"Make sure to input a valid 10 digit phone number!\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n return true;\n }", "@Override\n public void verifyHasPhone() {\n }", "private int completionCheck() {\n if (nameTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(1);\n return -1;\n }\n if (addressTB.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(2);\n return -1;\n }\n if (postCodeTB.getText().trim().isEmpty()){\n AlertMessage.addCustomerError(3);\n return -1;\n }\n if (countryCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(4);\n return -1;\n }\n if (stateProvinceCB.getSelectionModel().getSelectedItem() == null) {\n AlertMessage.addCustomerError(5);\n return -1;\n }\n if (phone.getText().trim().isEmpty()) {\n AlertMessage.addCustomerError(6);\n return -1;\n }\n return 1;\n }", "public void validateRpd13s11()\n {\n // This guideline cannot be automatically tested.\n }", "@Override\n public void afterTextChanged(Editable s) {\n if (s.length() == 0)\n edtCodeNumber5.requestFocus();\n else {\n if (strMobileNumber == null || strMobileNumber.equals(\"\")) return;\n //checkValidationCodeInputs();\n\n confirmYourCode();\n }\n\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "private boolean isInputValid() {\n String errorMessage = \"\";\n\n if (ServiceName.getText() == null || ServiceName.getText().length() == 0) {\n errorMessage += \"No valid name!\\n\";\n }\n if (Serviceemail.getText() == null || Serviceemail.getText().length() == 0) {\n Pattern p = Pattern.compile(\"[_A-Za-z0-9][A-Za-z0-9._]*?@[_A-Za-z0-9]+([.][_A-Za-z]+)+\");\n Matcher m = p.matcher(Serviceemail.getText());\n if (m.find() && m.group().equals(Serviceemail.getText())) {\n errorMessage += \"No valid Mail Forment!\\n\";\n }\n }\n if (servicedescrip.getText() == null || servicedescrip.getText().length() == 0) {\n errorMessage += \"No valid description !\\n\";\n }\n if (f == null && s.getImage() == null) {\n errorMessage += \"No valid photo ( please upload a photo !)\\n\";\n }\n if (Serviceprice.getText() == null || Serviceprice.getText().length() == 0) {\n errorMessage += \"No valid prix !\\n\";\n } else {\n // try to parse the postal code into an int.\n try {\n Float.parseFloat(Serviceprice.getText());\n } catch (NumberFormatException e) {\n errorMessage += \"No valid prix (must be a Float)!\\n\";\n }\n }\n if ( !Weekly.isSelected() && !Daily.isSelected() && !Monthly.isSelected()) {\n errorMessage += \"No valid Etat ( select an item !)\\n\";\n }\n if (Servicesatet.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid etat ( select an item !)\\n\";\n }\n if (ServiceCity.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid City ( select an item !)\\n\";\n }\n if (servicetype.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid Type ( select an item !)\\n\";\n }\n if (errorMessage.length() == 0) {\n return true;\n } else {\n // Show the error message.\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Invalid Fields\");\n alert.setHeaderText(\"Please correct invalid fields\");\n alert.setContentText(errorMessage);\n alert.showAndWait();\n return false;\n }\n }", "private void ValidateEditTextFields() {\n\tfor (int i = 0; i < etArray.length; i++) {\n\t if (etArray[i].getText().toString().trim().length() <= 0) {\n\t\tvalidCustomer = false;\n\t\tetArray[i].setError(\"Blank Field\");\n\t }\n\t}\n\n\tif (etPhoneNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etPhoneNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (etEmergencyNumber.getText().length() != 11) {\n\t validCustomer = false;\n\t etEmergencyNumber.setError(\"Invalid Phone Number\");\n\t}\n\n\tif (calendarDob == null) {\n\t validCustomer = false;\n\t}\n }", "public void validateMailAlerts() {\n System.out.println(\"Validating Mail Alerts\");\n boolean mailPasstoCheck = false, mailPassccCheck = false, mailFailtoCheck = false, mailFailccCheck = false;\n\n if (!mailpassto.getText().isEmpty()) {\n\n String[] emailAdd = mailpassto.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailPasstoCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". To Email address for passed test cases should not be empty.\\n\");\n\n }\n if (!mailpasscc.getText().isEmpty()) {\n String[] emailAdd = mailpasscc.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailPassccCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". CC Email address for passed test cases should not be empty.\\n\");\n\n }\n if (!mailfailto.getText().isEmpty()) {\n String[] emailAdd = mailfailto.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailFailtoCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n\n } else {\n execptionData.append((++exceptionCount) + \". To Email address for failed test cases should not be empty.\\n\");\n\n }\n if (!mailfailcc.getText().isEmpty()) {\n String[] emailAdd = mailfailcc.getText().split(\",\");\n\n for (String email : emailAdd) {\n if (VALID_EMAIL_ADDRESS_REGEX.matcher(email).find()) {\n mailFailccCheck = true;\n } else {\n execptionData.append((++exceptionCount) + \". Invalid Email address: \" + email + \".\\n\");\n }\n }\n } else {\n execptionData.append((++exceptionCount) + \".CC Email address for failed test cases should not be empty.\\n\");\n\n }\n\n if (mailPasstoCheck == true && mailPassccCheck == true && mailFailccCheck == true && mailFailtoCheck == true) {\n /*try {\n Properties connectionProperties = new Properties();\n String socketFactory_class = \"javax.net.ssl.SSLSocketFactory\"; //SSL Factory Class\n String mail_smtp_auth = \"true\";\n connectionProperties.put(\"mail.smtp.port\", port);\n connectionProperties.put(\"mail.smtp.socketFactory.port\", socketProperty);\n connectionProperties.put(\"mail.smtp.host\", hostSmtp.getText());\n connectionProperties.put(\"mail.smtp.socketFactory.class\", socketFactory_class);\n connectionProperties.put(\"mail.smtp.auth\", mail_smtp_auth);\n connectionProperties.put(\"mail.smtp.socketFactory.fallback\", \"false\");\n connectionProperties.put(\"mail.smtp.starttls.enable\", \"true\");\n Mail mail = new Mail(\"\");\n mail.createSession(fromMail.getText(), password.getText(), connectionProperties);\n mail.sendEmail(fromMail.getText(), mailpassto.getText(), mailpasscc.getText(), \"Test Mail from FACT\", \"Hi, This is the Test Mail for the FACT Tool\", \"\");\n mail.sendEmail(fromMail.getText(), mailfailto.getText(), mailfailcc.getText(), \"Test Mail from FACT\", \"Hi, This is the Test Mail for the FACT Tool\", \"\");*/\n mailAlertsCheck = true;\n /* } catch (IOException ex) {\n Logger.getLogger(ConfigFile.class.getName()).log(Level.SEVERE, null, ex);\n mailAlertsCheck = false;\n new ExceptionUI(ex);\n } catch (MessagingException ex) {\n Logger.getLogger(ConfigFile.class.getName()).log(Level.SEVERE, null, ex);\n mailAlertsCheck = false;\n new ExceptionUI(ex);\n }*/\n } else {\n mailAlertsCheck = false;\n mailPasstoCheck = false;\n mailPassccCheck = false;\n mailFailtoCheck = false;\n mailFailccCheck = false;\n }\n\n }", "private String creditCardValidate(CardPayment payment) {\r\n \tString validate = null;\r\n \t\r\n \tString cardType = payment.getCreditCardType();\r\n \t\r\n \tif(cardType.equals(\"MASTERCARD\") || cardType.equals(\"VISA\")) {\r\n \t\tif(payment.getCreditCardNumber().matches(\"[0-9]+\") && payment.getCreditCardNumber().length() != 16) {\r\n \t\t\treturn \"Credit Card Number is invalid\";\r\n \t\t} else if(String.valueOf(payment.getCreditcardcvv()).length() != 3) {\r\n \t\t\treturn \"Credit Card CVV is invalid\";\r\n \t\t}\r\n \t} else if(cardType.equals(\"AMEX\")) {\r\n \t\tif(payment.getCreditCardNumber().matches(\"[0-9]+\") && payment.getCreditCardNumber().length() != 15) {\r\n \t\t\treturn \"Credit Card Number is invalid\";\r\n \t\t} else if(String.valueOf(payment.getCreditcardcvv()).length() != 4) {\r\n \t\t\treturn \"Credit Card CVV is invalid\";\r\n \t\t}\r\n \t} else {\r\n \t\tvalidate = \"Invalid card type\";\r\n \t}\r\n \t\r\n \treturn validate;\r\n }", "public boolean validateFields(Customer customer) {\r\n if (isEmpty(customer.getFirstName(), customer.getLastName(), customer.getPhoneNum(),\r\n customer.getEmail(), customer.getDate())) {\r\n Alert alert = new Alert(Alert.AlertType.WARNING);\r\n alert.setTitle(\"Invalid info\");\r\n alert.setHeaderText(null);\r\n alert.setContentText(\"Invalid info.\\nAll fields must be filled.\");\r\n alert.showAndWait();\r\n return false;\r\n }\r\n return true;\r\n }", "private boolean checkInfo()\n {\n boolean flag = true;\n if(gName.isEmpty())\n {\n groupName.setError(\"Invalid name\");\n flag = false;\n }\n if(gId.isEmpty())\n {\n groupId.setError(\"Invalid id\");\n flag = false;\n }\n if(gAddress.isEmpty())\n {\n groupAddress.setError(\"Invalid address\");\n flag = false;\n }\n\n for(char c : gName.toCharArray()){\n if(Character.isDigit(c)){\n groupName.setError(\"Invalid Name\");\n flag = false;\n groupName.requestFocus();\n }\n }\n\n if(groupType.isEmpty())\n {\n flag = false;\n rPublic.setError(\"Choose one option\");\n }\n\n if(time.isEmpty())\n time = \"not set\";\n\n if(groupDescription.getText().toString().length()<20||groupDescription.getText().toString().length()>200)\n groupDescription.setError(\"Invalid description\");\n\n return flag;\n }", "@Override\n\tpublic Boolean isValidApplication(ApplicationBean applicationBean) {\n\t\tPattern namePattern=Pattern.compile(\"^[A-Za-z\\\\s]{3,}$\");\n\t\tMatcher nameMatcher=namePattern.matcher(applicationBean.getName());\n\t\tPattern dobPattern=Pattern.compile(\"^[0-3]?[0-9].[0-3]?[0-9].(?:[0-9]{2})?[0-9]{2}$\");\n\t\tMatcher dobMatcher=dobPattern.matcher(applicationBean.getDateOfBirth());\n\t\tPattern goalPattern=Pattern.compile(\"^[A-Za-z\\\\s]{1,}$\");\n\t\tMatcher goalMatcher=goalPattern.matcher(applicationBean.getGoals());\n\t\tPattern marksPattern=Pattern.compile(\"^[1-9][0-9]?$|^100$\");\n\t\tMatcher marksMatcher=marksPattern.matcher(applicationBean.getMarksObtained());\n\t\tPattern scheduleIdPattern=Pattern.compile(\"^[0-9]{1,2}$\");\n\t\tMatcher scheduleIdMatcher=scheduleIdPattern.matcher(applicationBean.getScheduledProgramID());\n\t\tPattern emailPattern=Pattern.compile(\"^[A-Za-z0-9+_.-]+@(.+)$\");\n\t\tMatcher emailMatcher=emailPattern.matcher(applicationBean.getEmailID());\n\t\t\n\t\t\n\t\tif(!(nameMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nApplicant Name Should Be In Alphabets and minimum 1 characters long.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(dobMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nDate of birth should be in DD/MM/YYYY format.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(goalMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\n Goal should be alphabetical and having minimum one letter\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(marksMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nMarks should be less than 100\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(scheduleIdMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nSchedule Id should be of one or two digit\");\n\t\t\treturn false;\n\t\t}\n\t\tif(!(emailMatcher.matches()))\n\t\t{\n\t\t\tSystem.out.println(\"\\nEnter valid email address\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private String validarEntradas()\n { \n return Utilitarios.validarEntradas(campoNomeAC, campoEnderecoAC, campoBairroAC, campoCidadeAC, campoUfAC, campoCepAC, campoTelefoneAC, campoEmailAC);\n }", "private boolean hasValidPreConditions() {\n if (!hasReadSmsPermission()) {\n requestReadAndSendSmsPermission();\n return false;\n }\n\n if (!SmsHelper.isValidPhoneNumber(mNumberEditText.getText().toString())) {\n Toast.makeText(getApplicationContext(), R.string.error_invalid_phone_number, Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "public static void validate() {\r\n\t\tfrmMfhEmailer.validate();\r\n\t}", "private String checkUserDetail(UserModel userModel) {\n\t\tString name = userModel.getName();\n\t\tString mobileNumber = userModel.getMobileNumber();\n\t\tString email = userModel.getEmail();\n\t\tString pincode = userModel.getPincode();\n\t\tString area = userModel.getAreaName();\n\t\tString state = userModel.getStateName();\n\t\tString res = \"okkk\";\n\t\tif (mobileNumber.length() != 10) {\n\t\t\tres = \"Enter ten digit mobile number\";\n\t\t} else if (!checkMobileDigit(mobileNumber)) {\n\t\t\tres = \"enter only digit\";\n\t\t} else if (!checkNameChar(name)) {\n\t\t\tres = \"name shuld be only in alphabet\";\n\t\t} else if (!checkEmail(email)) {\n\t\t\tres = \"enter a valid email\";\n\t\t} else if (pincode.length() != 6) {\n\t\t\tres = \"enter valid pincode and enter only six digit\";\n\t\t} else if (!checkPincode(pincode)) {\n\t\t\tres = \"enter only digit\";\n\t\t} else if (area.equals(null)) {\n\t\t\tres = \"choose area\";\n\t\t} else if (state.equals(null)) {\n\t\t\tres = \"choose state\";\n\t\t}\n\t\treturn res;\n\t}", "private void setupRequiredValidation() {\n requiredMafExpressions.put(FIELD_HUGO_SYMBOL, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_HUGO_SYMBOL, \"may not be blank\");\r\n requiredMafExpressions.put(FIELD_ENTREZ_GENE_ID, Pattern.compile(\"\\\\d+\")); // number\r\n requiredFieldDescriptions.put(FIELD_ENTREZ_GENE_ID, \"must be an integer number\");\r\n requiredMafExpressions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_TUMOR_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_TUMOR_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_VALIDATION_STATUS, Pattern.compile(\"Valid|Wildtype|Unknown|\\\\S?\"));\r\n requiredFieldDescriptions.put(FIELD_VALIDATION_STATUS, \"must be Valid, Wildtype, Unknown, or blank\");\r\n requiredMafExpressions.put(FIELD_CHROMOSOME, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_CHROMOSOME, \"must be one of: X, Y, M, 1-22, or full name of unassigned fragment\");\r\n setupMafSpecificChecks();\r\n }", "private void validateData() {\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "abstract void fiscalCodeValidity();", "UserPayment validate(String cardHolderName,String cardType,String securityCode,String paymentType);", "private boolean isInputValid() {\r\n \r\n String errorMessage = \"\";\r\n \r\n // Email regex provided by emailregex.com using the RFC5322 standard\r\n String emailPatternString = \"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\r\n \r\n // Phone number regex provided by Ravi Thapliyal on Stack Overflow:\r\n // http://stackoverflow.com/questions/16699007/regular-expression-to-match-standard-10-digit-phone-number\r\n String phoneNumString = \"^(\\\\+\\\\d{1,2}\\\\s)?\\\\(?\\\\d{3}\\\\)?[\\\\s.-]?\\\\d{3}[\\\\s.-]?\\\\d{4}$\";\r\n \r\n Pattern emailPattern = Pattern.compile(emailPatternString, Pattern.CASE_INSENSITIVE);\r\n Matcher emailMatcher;\r\n \r\n Pattern phoneNumPattern = Pattern.compile(phoneNumString);\r\n Matcher phoneNumMatcher;\r\n \r\n // Validation for no length or over database size limit\r\n if ((custFirstNameTextField.getText() == null || custFirstNameTextField.getText().length() == 0) || (custFirstNameTextField.getText().length() > 25)) {\r\n errorMessage += \"First name has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custLastNameTextField.getText() == null || custLastNameTextField.getText().length() == 0) || (custLastNameTextField.getText().length() > 25)) {\r\n errorMessage += \"Last name has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custAddressTextField.getText() == null || custAddressTextField.getText().length() == 0) || (custAddressTextField.getText().length() > 75)) {\r\n errorMessage += \"Address has to be between 1 and 75 characters.\\n\";\r\n }\r\n \r\n if ((custCityTextField.getText() == null || custCityTextField.getText().length() == 0) || (custCityTextField.getText().length() > 50)) {\r\n errorMessage += \"City has to be between 1 and 50 characters.\\n\";\r\n }\r\n \r\n if ((custProvinceTextField.getText() == null || custProvinceTextField.getText().length() == 0) || (custProvinceTextField.getText().length() > 2)) {\r\n errorMessage += \"Province has to be a two-letter abbreviation.\\n\";\r\n }\r\n \r\n if ((custPostalCodeTextField.getText() == null || custPostalCodeTextField.getText().length() == 0) || (custPostalCodeTextField.getText().length() > 7)) {\r\n errorMessage += \"Postal Code has to be between 1 and 7 characters.\\n\";\r\n }\r\n \r\n if ((custCountryTextField.getText() == null || custCountryTextField.getText().length() == 0) || (custCountryTextField.getText().length() > 25)) {\r\n errorMessage += \"Country has to be between 1 and 25 characters.\\n\";\r\n }\r\n \r\n if ((custHomePhoneTextField.getText() == null || custHomePhoneTextField.getText().length() == 0) || (custHomePhoneTextField.getText().length() > 20)) {\r\n errorMessage += \"Phone number has to be between 1 and 20 characters long.\\n\";\r\n } else {\r\n phoneNumMatcher = phoneNumPattern.matcher(custHomePhoneTextField.getText());\r\n if (!phoneNumMatcher.matches()) {\r\n errorMessage += \"Phone number not in the correct format: (111) 111-1111.\\n\";\r\n }\r\n }\r\n \r\n if ((custBusinessPhoneTextField.getText() == null || custBusinessPhoneTextField.getText().length() == 0) || (custBusinessPhoneTextField.getText().length() > 20)) {\r\n errorMessage += \"Phone number has to be between 1 and 20 characters long.\\n\";\r\n } else {\r\n phoneNumMatcher = phoneNumPattern.matcher(custBusinessPhoneTextField.getText());\r\n if (!phoneNumMatcher.matches()) {\r\n errorMessage += \"Phone number not in the correct format: (111) 111-1111.\\n\";\r\n }\r\n }\r\n \r\n if ((custEmailTextField.getText() == null || custEmailTextField.getText().length() == 0) || (custEmailTextField.getText().length() > 50)) {\r\n errorMessage += \"Email has to be between 1 and 50 characters.\\n\";\r\n } else {\r\n emailMatcher = emailPattern.matcher(custEmailTextField.getText());\r\n if (!emailMatcher.matches()) {\r\n errorMessage += \"Email format is not correct. Should be in the format [email protected].\\n\"; \r\n } \r\n }\r\n \r\n if (errorMessage.length() > 0) {\r\n Alert alert = new Alert(AlertType.ERROR, errorMessage, ButtonType.OK);\r\n alert.setTitle(\"Input Error\");\r\n alert.setHeaderText(\"Please correct invalid fields\");\r\n alert.showAndWait();\r\n \r\n return false;\r\n }\r\n \r\n return true;\r\n }", "public final boolean checkPhoneNum() {\n EditText editText = (EditText) _$_findCachedViewById(R.id.etPhoneNum);\n Intrinsics.checkExpressionValueIsNotNull(editText, \"etPhoneNum\");\n CharSequence text = editText.getText();\n if (text == null || text.length() == 0) {\n showMsg(\"请输入手机号\");\n return false;\n }\n EditText editText2 = (EditText) _$_findCachedViewById(R.id.etPhoneNum);\n Intrinsics.checkExpressionValueIsNotNull(editText2, \"etPhoneNum\");\n if (editText2.getText().length() == 11) {\n return true;\n }\n showMsg(\"请输入正确的手机号\");\n return false;\n }", "@Override\n public boolean isValid(PhoneNumber phoneNumber) {\n String number = phoneNumber.getNumber();\n return isPhoneNumber(number) && number.startsWith(\"+380\") && number.length() == 13;\n }", "private boolean validate(){\n return EditorUtils.editTextValidator(generalnformation,etGeneralnformation,\"Type in information\") &&\n EditorUtils.editTextValidator(symptoms,etSymptoms, \"Type in symptoms\") &&\n EditorUtils.editTextValidator(management,etManagement, \"Type in management\");\n }", "@RequiresApi(api = Build.VERSION_CODES.KITKAT)\n public boolean validateDetails(String email, String mobile) {\n email = email.trim();\n mobile = mobile.trim();\n\n if (TextUtils.isEmpty(mobile)) {\n setErrorInputLayout(mobile_et, getString(R.string.err_phone_empty), mobile_til);\n return false;\n } else if (!isValidPhone(mobile)) {\n setErrorInputLayout(mobile_et, getString(R.string.err_phone_not_valid), mobile_til);\n return false;\n } else if (TextUtils.isEmpty(email)) {\n setErrorInputLayout(email_et, getString(R.string.err_email_empty), email_til);\n return false;\n } else if (!isValidEmail(email)) {\n setErrorInputLayout(email_et, getString(R.string.email_not_valid), email_til);\n return false;\n } else if (Objects.equals(name_et.getText().toString(), \"\")) {\n setErrorInputLayout(name_et, \"Name is not valid\", name_til);\n return false;\n } else {\n return true;\n }\n }", "public String CheckPostCode (HashMap<String, ?> InputObj) throws NoSuchElementException {\n\t\tString outRetVal = \"-1\";\n\t\t\n\t\tString inCountryCode = InputObj.get(\"CountryCode\").toString();\n\t\tString inPostCode = InputObj.get(\"PostCode\").toString();\n\t\t\n\t\tCustSiteEditorObj Obj = new CustSiteEditorObj(webdriver);\n\t\t\n\t\tWebElement TxtCountryCode = Obj.getTxtCountryCode();\n\t\tif (!TxtCountryCode.getAttribute(\"value\").equals(inCountryCode)) {\n\t\t\tTxtCountryCode.clear();\n\t\t\tTxtCountryCode.sendKeys(inCountryCode);\n\t\t\tWebElement TxtPostCode = Obj.getTxtPostCode();\n\t\t\tTxtPostCode.click();\n\t\t}\n\t\t\n\t\tboolean isCountryCodeMsgExist = SeleniumUtil.isWebElementExist(webdriver, Obj.getLblCountryCodeMessageLocator(), 1);\n\t\tif (isCountryCodeMsgExist) {\n\t\t\tWebElement LblCountryCodeMessage = Obj.getLblCountryCodeMessage();\n\t\t\tboolean isVisible = LblCountryCodeMessage.isDisplayed();\n\t\t\tif (isVisible) {\n\t\t\t\tCommUtil.logger.info(\" > Msg: \"+LblCountryCodeMessage.getText());\n\t\t\t\tif (CommUtil.isMatchByReg(LblCountryCodeMessage.getText(), \"Only 2 characters\")) {\n\t\t\t\t\toutRetVal = \"1\";\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t} else {\n\t\t\t\t\tCommUtil.logger.info(\" > Unhandled message.\");\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tWebElement TxtPostCode = Obj.getTxtPostCode();\n\t\tif (!TxtPostCode.getAttribute(\"value\").equals(inPostCode)) {\n\t\t\tTxtPostCode.clear();\n\t\t\tTxtPostCode.sendKeys(inPostCode);\n\t\t\tTxtCountryCode = Obj.getTxtCountryCode();\n\t\t\tTxtCountryCode.click();\n\t\t}\t\n\t\t\n\t\tboolean isPostCodeMsgExist = SeleniumUtil.isWebElementExist(webdriver, Obj.getLblPostCodeMessageLocator(), 1);\n\t\tif (isPostCodeMsgExist) {\n\t\t\tWebElement LblPostCodeMessage = Obj.getLblPostCodeMessage();\n\t\t\tboolean isVisible = LblPostCodeMessage.isDisplayed();\n\t\t\tif (isVisible) {\n\t\t\t\tCommUtil.logger.info(\" > Msg: \"+LblPostCodeMessage.getText());\n\t\t\t\tif (CommUtil.isMatchByReg(LblPostCodeMessage.getText(), \"Only 5 digits\")) {\n\t\t\t\t\toutRetVal = \"2\";\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t} else if (CommUtil.isMatchByReg(LblPostCodeMessage.getText(), \"Only alpha numeric dash space\")) {\n\t\t\t\t\toutRetVal = \"3\";\n\t\t\t\t\treturn outRetVal;\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tCommUtil.logger.info(\" > Unhandled message.\");\n\t\t\t\t\treturn outRetVal;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\toutRetVal = \"0\";\n\t\treturn outRetVal;\n\t\t\n\t}", "public void validateRpd11s1()\n {\n // This guideline cannot be automatically tested.\n }", "protected void validateEmail(){\n\n //Creating Boolean Value And checking More Accurate Email Validator Added\n\n Boolean email = Pattern.matches(\"^[A-Za-z]+([.+-]?[a-z A-z0-9]+)?@[a-zA-z0-9]{1,6}\\\\.[a-zA-Z]{2,6},?([.][a-zA-z+,]{2,6})?$\",getEmail());\n System.out.println(emailResult(email));\n }", "public void validateRpd13s7()\n {\n // This guideline cannot be automatically tested.\n }", "public static Customer validateCustomer(TextField shopname, TextField shopcontact, TextField streetadd, ComboBox area, TextField city, TextField zip) {\r\n Customer customer = new Customer();\r\n customer = null;\r\n\r\n if (shopname.getText().isEmpty() || shopcontact.getText().isEmpty() || streetadd.getText().isEmpty()\r\n || city.getText().isEmpty()\r\n || zip.getText().isEmpty() || area.getValue() == null) {\r\n new PopUp(\"Name Error\", \"Field is Empty\").alert();\r\n } else if (!shopcontact.getText().matches(\"\\\\d{10}\")) {\r\n new PopUp(\"Name Error\", \"Contact must be 10 Digit\").alert();\r\n } else if (!zip.getText().matches(\"\\\\d{6}\")) {\r\n new PopUp(\"Error\", \"Zip Code must be 6 Digit\").alert();\r\n } else {\r\n customer.setShopName(shopname.getText());\r\n customer.setShopCont(Long.valueOf(shopcontact.getText()));\r\n customer.setStreetAdd(streetadd.getText());\r\n customer.setArea(area.getValue().toString());\r\n customer.setCity(city.getText());\r\n customer.setZipcode(Integer.valueOf(zip.getText()));\r\n }\r\n\r\n return customer;\r\n }", "private void validatePurchaseOrder(MaintenanceRequest mrq) throws MalBusinessException{\n\t\tArrayList<String> messages = new ArrayList<String>();\n\t\tBigDecimal amount = new BigDecimal(0.00);\n\t\t\t\t\n\t\t//Validate PO header required data\n\t\tif(MALUtilities.isEmptyString(mrq.getJobNo()))\n\t\t\tmessages.add(\"Job No. is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqStatus()))\n\t\t\tmessages.add(\"PO Status is required\");\n\t\tif(MALUtilities.isEmptyString(mrq.getMaintReqType()))\n\t\t\tmessages.add(\"PO Type is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getCurrentOdo()))\n\t\t\tmessages.add(\"Odo is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getActualStartDate()))\n\t\t\tmessages.add(\"Actual Start Date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getPlannedEndDate()))\n\t\t\tmessages.add(\"End date is required\");\n\t\tif(MALUtilities.isEmpty(mrq.getServiceProvider()))\n\t\t\tmessages.add(\"Service Provider is required\");\n\t\t/* TODO Need to determine if this check is necessary. We do not have a hard requirement for this.\n\t\tif(!MALUtilities.isEmpty(po.getServiceProvider()) \n\t\t\t\t&& (!MALUtilities.convertYNToBoolean(po.getServiceProvider().getNetworkVendor()) \n\t\t\t\t\t\t&& this.calculateMarkUp(po).compareTo(new BigDecimal(0.00)) < 1))\n\t\t\tmessages.add(\"Mark Up is required for out of network service providers\");\n\t */\n\t\t\n\t\t//Validate PO Line items (tasks) required data\n\t\tif(!MALUtilities.isEmpty(mrq.getMaintenanceRequestTasks())){\n\t\t\tfor(MaintenanceRequestTask line : mrq.getMaintenanceRequestTasks()){\n\t\t\t\tif(MALUtilities.isEmptyString(line.getMaintCatCode()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Maint Category is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTaskQty()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Qty is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getUnitCost()))\n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Unit Price is required\");\n\t\t\t\tif(MALUtilities.isEmpty(line.getTotalCost())) \n\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total Amount is required\");\t\t\t\t\t\t\t\t\n\t\t\t\tif(!(MALUtilities.isEmpty(line.getTaskQty()) && MALUtilities.isEmpty(line.getUnitCost()))){\n\t\t\t\t\tamount = line.getUnitCost().multiply(line.getTaskQty()).setScale(2, BigDecimal.ROUND_HALF_UP); \n\t\t\t\t\tif( amount.compareTo(line.getTotalCost().setScale(2, BigDecimal.ROUND_HALF_UP)) != 0)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Total amount is incorrect\");\t\t\t\t\t\t\t\n\t\t\t\t}\t\n/** TODO This will not work well with goodwill POs as the user will not have the changes to add cost avoidance data to subsequent lines.\t\t\t\t\n\t\t\t\tif(mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillReason()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillCost()) || line.getGoodwillCost().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Amount is required\");\t\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getGoodwillPercent()) || line.getGoodwillPercent().compareTo(new BigDecimal(0)) < 1)\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Goodwill Percent is required\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(!mrq.isGoodwillIndicator() && line.isCostAvoidanceIndicator()){\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceCode()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Reason is required\");\n\t\t\t\t\tif(MALUtilities.isEmpty(line.getCostAvoidanceAmount()))\n\t\t\t\t\t\tmessages.add(\"Line \" + line.getIndex() + \": Cost Avoidance Amount is required\");\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(messages.size() > 0)\n\t\t\tthrow new MalBusinessException(\"service.validation\", messages.toArray(new String[messages.size()]));\t\t\n\t\t\n\t}", "private boolean validateInput(){\n Window owner=root.getScene().getWindow();\n inputFileds.addAll(txtfn,txtln,txtsurname,txtDOB,txtResidence,txtMobile,txtID,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().isEmpty()){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n inputFileds.removeAll(txtDOB,txtMobile,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().length()>30){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Sorry the text you entered can not be greater that 30 characters\",\"Text too Long\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n if(username.getText().length()>20 || username.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Username has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid input\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n if(pass.getText().isEmpty()){\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n if(pass.getText().length()>20 || pass.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Password has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n SimpleDateFormat yearFormat = new SimpleDateFormat(\"yyyy\");\n try {\n date = dateFormat.parse(txtDOB.getText());\n Calendar cal=Calendar.getInstance();\n int year=Integer.parseInt(yearFormat.format(date));\n if (year <= 1900 || year>cal.get(Calendar.YEAR)) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n String initialEntry=txtDOB.getText();\n String parsedValue=dateFormat.format(date);\n if(!initialEntry.equals(parsedValue)){\n Dialog.showMessageDialog(owner, \"Note your Date of Birth has been corrected\", \"Date Corrected\",DialogIcon.INFORMATION);\n }\n txtDOB.setText(dateFormat.format(date));\n } catch (ParseException ex) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n try {\n int mobile=Integer.parseInt(txtMobile.getText());\n } catch (NumberFormatException e) {\n Dialog.showMessageDialog(owner, \"Invalid Mobile Number\", \"Invalid data\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n if(txtMobile.getText().length() != 10){\n Dialog.showMessageDialog(owner, \"Sorry your Mobile Number is invalid\", \"Invalid input\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n String sql=\"select Username,Password from users where Username=?\";\n try(PreparedStatement prstmt=con.prepareStatement(sql)) {\n prstmt.setString(1, username.getText());\n ResultSet rs=prstmt.executeQuery();\n if(rs.next()){\n Dialog.showMessageDialog(owner, \"Sorry Username already exists\\n Please change to different Username\", \"Username Exists\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n rs.close();\n } catch (SQLException e) {\n System.err.println(e);\n }\n return true;\n }", "public void SetCreditCarddetails(String ccnumber, String ccname, String ccmonth, String ccyear, String ccseccode){\r\n\t\tString countrygroup_ccdetails= \"UK,PresselAustria\";\r\n\t\tString CCnum = getValue(ccnumber);\r\n\t\tString CCName = getValue(ccname);\r\n\t\tString CCMonth = getValue(ccmonth);\r\n\t\tString CCYear = getValue(ccyear);\r\n\t\tString CCSecCode = getValue(ccseccode);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+CCnum+\", \"+CCName+\", \"+CCMonth+\", \"+CCYear+\", \"+CCSecCode);\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The CreditCard details should be entered\");\r\n\t\ttry{\r\n\t\t\tif(!(countrygroup_ccdetails).contains(countries.get(countrycount))){\r\n\t\t\t\tswitchframe(\"TokenizationPage\");\r\n\t\t\t\tsleep(2000);\r\n\t\t\t\tsendKeys(locator_split(\"txtCCnumber\"), CCnum);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCname\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCname\"), CCName);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCMonth\"), CCMonth);\r\n\t\t\t\tsendKeys(locator_split(\"dpCCYear\"), CCYear);\r\n\t\t\t\tclearWebEdit(locator_split(\"txtCCcode\"));\r\n\t\t\t\tsendKeys(locator_split(\"txtCCcode\"), CCSecCode);\t\t\t\t\t\t\r\n\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The CreditCard details are entered\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The new CreditCard details are applicable to this \" +country);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- The CreditCard details are not entered\");\r\n\t\t\tthrow new NoSuchElementException(\"One of the element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCnumber\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCname\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCMonth\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"dpCCYear\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCCcode\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" are not found\");\r\n\r\n\t\t}\r\n\t}", "private boolean isFormValid(AdminAddEditUserDTO dto)\r\n\t{\n\t\tSOWError error;\r\n\t\tList<IError> errors = new ArrayList<IError>();\t\t\r\n\t\t\r\n\t\t// First Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getFirstName()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_First_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_First_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\t// Last Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getLastName()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Last_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Last_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\t\r\n\t\t// User Name\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getUsername()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_User_Name_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\r\n\t\t}\r\n\t\telse\r\n\t\t{\t\r\n\t\t\t//User Name Length Check\r\n\t\t\tif((dto.getUsername().length() < 8) || (dto.getUsername().length() >30)){\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"),getTheResourceBundle().getString(\"Admin_User_Name_Length_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString jobRole = getParameter(\"jobRole\");\r\n\t\tif(\"-1\".equals(jobRole))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Job_Role\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Job_Role_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Handle Primary Email\r\n\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isNullOrEmpty(dto.getEmail()))\r\n\t\t{\r\n\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_Email\"),\r\n\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(com.newco.marketplace.web.utils.SLStringUtils.isEmailValid(dto.getEmail()) == false)\r\n\t\t\t{\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_PrimaryEmail\"),\r\n\t\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Pattern_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if(dto.getEmail().equals(dto.getEmailConfirm()) == false)\r\n\t\t\t{\r\n\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_PrimaryEmail\"),\r\n\t\t\t\t\t\tgetTheResourceBundle().getString(\"Admin_Email_Confirm_Validation_Msg\"), OrderConstants.FM_ERROR);\r\n\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Check for existing username, only in Add mode\r\n\t\tString mode = (String)getSession().getAttribute(\"addEditUserMode\");\r\n\t\tif(mode != null)\r\n\t\t{\r\n\t\t\tif(mode.equals(\"add\"))\r\n\t\t\t{\r\n\t\t\t\tif(manageUsersDelegate.getAdminUser(dto.getUsername()) != null || manageUsersDelegate.getBuyerUser(dto.getUsername()) != null)\r\n\t\t\t\t{\r\n\t\t\t\t\terror = new SOWError(getTheResourceBundle().getString(\"Admin_User_Name\"), getTheResourceBundle().getString(\"Admin_Existing_User_Validation_Msg1\")+\" \" + dto.getUsername() +\" \" +getTheResourceBundle().getString(\"Admin_Existing_User_Validation_Msg2\"), OrderConstants.FM_ERROR);\r\n\t\t\t\t\terrors.add(error);\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t\r\n\t\t// If we have errors, put them in request.\r\n\t\tif(errors.size() > 0)\r\n\t\t{\r\n\t\t\tsetAttribute(\"errors\", errors);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tgetSession().removeAttribute(\"addEditUserMode\");\r\n\t\t\tgetSession().removeAttribute(\"originalUsername\");\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "@GET(\"numbervalidation\")\n Call<ResponseBody> numbervalidation(@Query(\"mobile_number\") String mobile_number, @Query(\"country_code\") String country_code, @Query(\"user_type\") String user_type, @Query(\"language\") String language, @Query(\"forgotpassword\") String forgotpassword);", "private boolean validateData() {\n if (!mCommon.validateData()) return false;\n\n Core core = new Core(this);\n\n // Due Date is required\n if (TextUtils.isEmpty(getRecurringTransaction().getDueDateString())) {\n core.alert(R.string.due_date_required);\n return false;\n }\n\n if (TextUtils.isEmpty(mCommon.viewHolder.dateTextView.getText().toString())) {\n core.alert(R.string.error_next_occurrence_not_populate);\n\n return false;\n }\n\n // Payments Left must have a value\n if (getRecurringTransaction().getPaymentsLeft() == null) {\n core.alert(R.string.payments_left_required);\n return false;\n }\n return true;\n }", "@Test\n public void invalidCaleeNumber(){\n PhoneCall call = new PhoneCall(\"503-449-7833\", \"ABCD\", \"01/01/2020\", \"1:00 am\", \"01/01/2020\", \"1:00 am\");\n assertThat(call.getCallee(), not(nullValue()));\n }", "private boolean revisarFormatoCorreo() {\n\t\tString correoE = this.campoCorreo.getText();\n\t\tPattern pat = Pattern.compile(\"^[\\\\w-]+(\\\\.[\\\\w-]+)*@[\\\\w-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\");\n\t\tMatcher mat = pat.matcher(correoE);\n\t\tif (mat.matches()) {\n\t\t\treturn true;\n\t\t} else\n\t\t\treturn false;\n\t}", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "boolean validateInput() {\n if (etFullname.getText().toString().equals(\"\")) {\n etFullname.setError(\"Please Enter Full Name\");\n return false;\n }\n if (etId.getText().toString().equals(\"\")) {\n etId.setError(\"Please Enter ID\");\n return false;\n }\n if (etEmail.getText().toString().equals(\"\")) {\n etEmail.setError(\"Please Enter Email\");\n return false;\n }\n if (etHall.getText().toString().equals(\"\")) {\n etHall.setError(\"Please Enter Hall Name\");\n return false;\n }\n if (etAge.getText().toString().equals(\"\")) {\n etAge.setError(\"Please Enter Age\");\n return false;\n }\n if (etPhone.getText().toString().equals(\"\")) {\n etPhone.setError(\"Please Enter Contact Number\");\n return false;\n }\n if (etPassword.getText().toString().equals(\"\")) {\n etPassword.setError(\"Please Enter Password\");\n return false;\n }\n\n // checking the proper email format\n if (!isEmailValid(etEmail.getText().toString())) {\n etEmail.setError(\"Please Enter Valid Email\");\n return false;\n }\n\n // checking minimum password Length\n if (etPassword.getText().length() < MIN_PASSWORD_LENGTH) {\n etPassword.setError(\"Password Length must be more than \" + MIN_PASSWORD_LENGTH + \"characters\");\n return false;\n }\n\n\n return true;\n }", "public void onClick(View v1){\n EditText first_name_validate = (EditText)findViewById(R.id.first_name);\n String name = first_name_validate.getText().toString();\n\n //Setting String to validate the e-mail ID entry\n EditText emailValidate = (EditText)findViewById(R.id.email_id);\n String email = emailValidate.getText().toString().trim();\n String emailPattern = \"[a-zA-Z0-9._-]+@[a-z]+\\\\.+[a-z]+\";//String to check the e-mail pattern\n\n //Setting String to validate the phone number entry\n EditText phone_num_validate = (EditText)findViewById(R.id.phone_number);\n String phone_num = phone_num_validate.getText().toString();\n\n\n if (name.length()==0 || email.length()==0 || phone_num.length()==0)//Checking if any one of the compulsory fields is not filled\n Toast.makeText(getApplicationContext(),\"Fill the compulsory fields\", Toast.LENGTH_SHORT).show();\n\n else if (!(email.matches(emailPattern)))//Checking the e-mail pattern\n Toast.makeText(getApplicationContext(),\"Incorrect Email Format\", Toast.LENGTH_SHORT).show();\n\n else if(phone_num.length()!=10)//Checking the phone number length\n Toast.makeText(getApplicationContext(),\"Incorrect Phone Number\", Toast.LENGTH_SHORT).show();\n\n\n else//If everything is as required then message is displayed showing \"Registered for (Name of the Event)\"\n {\n Toast.makeText(getApplicationContext(), \"Registered for \"+data[pos][8], Toast.LENGTH_SHORT).show();\n finish();\n }\n }", "private boolean Validarformatocorreo(String correo) {\n Pattern pat = Pattern.compile(\"^([0-9a-zA-Z]([_.w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-w]*[0-9a-zA-Z].)+([a-zA-Z]{2,9}.)+[a-zA-Z]{2,3})$\");\n Matcher mat = pat.matcher(correo);\n\n return mat.find();\n }", "public boolean validaCampos() {\n \n if(!this.ftCpf.getText().isEmpty()){\n \n String cpf = this.ftCpf.getText();\n Validador valida = new Validador();\n cpf = valida.tiraPontosCPF(cpf);\n\n\n if (!cpf.isEmpty() || cpf.length() == 11)\n if (!this.tfCarro.getText().isEmpty())\n if ((this.cbPlano.getSelectedItem().toString().equals(\"Diaria Simples\")) || ((this.cbPlano.getSelectedItem().toString().equals(\"Diaria Quilometrada\") && !this.tfQuilometragem.getText().isEmpty())))\n if (!this.tfValorTotal.getText().isEmpty())\n return true;\n else \n JOptionPane.showMessageDialog(null, \"O Valor não pode estar Zerado\", \"Informação\", JOptionPane.INFORMATION_MESSAGE);\n else\n JOptionPane.showMessageDialog(null, \"Insira a Quantidade de quilometros\", \"Informação\", JOptionPane.INFORMATION_MESSAGE);\n else\n JOptionPane.showMessageDialog(null, \"Escolha um carro\", \"Informação\", JOptionPane.INFORMATION_MESSAGE);\n else\n JOptionPane.showMessageDialog(null, \"Digite o CPF corretamente\", \"Informação\", JOptionPane.INFORMATION_MESSAGE);\n \n }\n else\n JOptionPane.showMessageDialog(null, \"Informe o CPF corretamente\", \"Informação\", JOptionPane.INFORMATION_MESSAGE);\n return false;\n \n }", "private static boolean validatePhoneNumber(String phoneNo) {\n if (phoneNo.matches(\"\\\\d{10}\")) return true;\n //validating phone number with -, . or spaces\n else if(phoneNo.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) return true;\n //validating phone number with extension length from 3 to 5\n else if(phoneNo.matches(\"\\\\d{3}-\\\\d{3}-\\\\d{4}\\\\s(x|(ext))\\\\d{3,5}\")) return true;\n //validating phone number where area code is in braces ()\n else if(phoneNo.matches(\"\\\\(\\\\d{3}\\\\)-\\\\d{3}-\\\\d{4}\")) return true;\n //return false if nothing matches the input\n else return false;\n\n }", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "public void validateRpd13s13()\n {\n // This guideline cannot be automatically tested.\n }", "private void validateUpdateCustomers(List<CustomersInputDTO> customers, String formatDate) {\n // inner validate\n if (customers == null || customers.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.MSG_PARAMETER_VALUE_INVALID,\n CommonUtils.putError(ConstantsCustomers.CUSTOMERS, Constants.RIQUIRED_CODE));\n }\n // validate common\n CommonValidateJsonBuilder jsonBuilder = new CommonValidateJsonBuilder();\n List<Map<String, Object>> customParams = new ArrayList<>();\n customers.forEach(cus -> {\n Map<String, Object> customField = new HashMap<>();\n customField.put(\"rowId\", cus.getCustomerId());\n customField.putAll(buildParamsValidateCustomersInput(cus, jsonBuilder));\n customParams.add(customField);\n });\n String validateJson = jsonBuilder.build(FieldBelongEnum.CUSTOMER.getCode(), (Map<String, Object>) null,\n customParams, formatDate);\n String token = SecurityUtils.getTokenValue().orElse(null);\n String tenantName = jwtTokenUtil.getTenantIdFromToken();\n List<Map<String, Object>> listValidate = CustomersCommonUtil.validateCommon(validateJson, restOperationUtils,\n token, tenantName);\n if (!listValidate.isEmpty()) {\n throw new CustomRestException(ConstantsCustomers.VALIDATE_MSG_FAILED, listValidate);\n }\n }", "private void checkValidation() {\n String getInstituteName = NameofInstitute.getText().toString();\n String getDegreename = SpinnerDegree.getSelectedItem().toString();\n\n\n // Check if all strings are null or not\n if (getInstituteName.equals(\"\") || getInstituteName.length() == 0 || getDegreename.equals(\"\") || getDegreename.length() == 0)\n new CustomToast().Show_Toast(getActivity(), getView(),\"All fields are required.\");\n // Else do signup or do your stuff\n else {\n //Toast.makeText(getActivity(), \"All Ok till Now\", Toast.LENGTH_SHORT).show();\n AddQualifications(getDegreename,getInstituteName);\n }\n\n }", "public void validateRpd13s2()\n {\n // This guideline cannot be automatically tested.\n }", "public void validateRpd13s12()\n {\n // This guideline cannot be automatically tested.\n }", "@Override\r\n\tpublic boolean isValid(String code, ConstraintValidatorContext theConstaint) {\r\n \r\n titles = customerService.getTitles();\r\n \r\n for(String i : titles)\r\n {\r\n \tSystem.out.println(i);\r\n }\r\n //descriptions = ec.getDescriptions();\r\n for(String i : titles)\r\n {\r\n\t result = code.equals(i);\r\n\t\tif(code != null)\t\t\r\n\t\t\tresult = code.equals(i);\r\n\t\telse\r\n\t\t\tresult = true;\r\n\t\tif(result == true)\r\n\t\t\tbreak;\r\n }\r\n\t\treturn result;\r\n\t}", "public Boolean validateTransCode(String noteCode, Long staffId, String transType) throws Exception;", "public PaymentRequestPage paymentRequestPaymentAvailabilityValidation(String cashbackType,String cashbackValue,String rewardsValue) {\r\n\r\n\t\tString actual = \"\";\r\n\r\n\t\treportStep(\"About to validate the Cashback and Rewards Payment avilablity section in the payment Request page \", \"INFO\");\r\n\r\n\t\tswitch (cashbackType) {\r\n\r\n\t\tcase \"Only_Cashback\":\r\n\r\n\t\t\tvalidateTheElementPresence(cashbackAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, cashbackValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"Only_Rewards\":\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, rewardsValue);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase \"BothCashback_Rewards\":\r\n\r\n\t\t\tfloat cashbackAmount = Float.parseFloat(cashbackValue);\r\n\t\t\tfloat rewardsAmount = Float.parseFloat(rewardsValue);\r\n\t\t\tfloat totalAmount = cashbackAmount + rewardsAmount ;\r\n\r\n\t\t\tString strTotalAmount = Float.toString(totalAmount) + \"0\";\r\n\t\t\tString strOnlyCashbackAmount = Float.toString(cashbackAmount) + \"0\";\r\n\t\t\tString strOnlyRewardsAmount = Float.toString(rewardsAmount) + \"0\";\r\n\r\n\r\n\t\t\tvalidateTheElementPresence(rewardsAvailableForPaymentText);\r\n\t\t\tvalidateTheElementPresence(cashbackText);\r\n\t\t\tvalidateTheElementPresence(rewardsText);\r\n\r\n\t\t\t//validate total cashback amount\r\n\t\t\tactual = getText(totalcashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strTotalAmount);\r\n\r\n\t\t\t//validate only cashback amount\r\n\t\t\tactual = getText(cashbackAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyCashbackAmount);\r\n\r\n\r\n\t\t\t//validate only rewards amount\r\n\t\t\tactual = getText(rewardsAvailableForPaymentAmount);\r\n\t\t\tvalidateTheActualValueContainsExpectedValue(actual, strOnlyRewardsAmount);\r\n\r\n\t\t\tbreak;\r\n\r\n\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\r\n\t}", "public interface ValidacionConstantes {\n\t\n\t/**\n\t * Expresión regular para validar correos electrónicos.\n\t */\n\tString EXPR_REG_EMAIL = \"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"\"\n\t\t\t+ \"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x\"\n\t\t\t+ \"0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-\"\n\t\t\t+ \"9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4\"\n\t\t\t+ \"][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\"\n\t\t\t+ \"-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\n\t\n\t\n\t/*\n\t * Mensajes de validación\n\t */\n\t\n\t\n\tString MSG_EMAIL_REQUERIDO = \"Correo electrónico no válido\";\n\t\n\t\n\n}", "private boolean validatePhone(String phone) {\n if (phone.matches(\"\\\\d{10}\")) {\n return true;\n } //validating phone number with -, . or spaces\n else if (phone.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) {\n return true;\n } //validating phone number where area code is in braces ()\n else if (phone.matches(\"\\\\(\\\\d{3}\\\\)-\\\\d{3}-\\\\d{4}\")) {\n return true;\n } //return false if nothing matches the input\n else {\n return false;\n }\n }" ]
[ "0.6454857", "0.6375749", "0.61506987", "0.6077307", "0.60728467", "0.6037204", "0.59424543", "0.5910584", "0.5909753", "0.5883374", "0.5856978", "0.58549905", "0.5854257", "0.58511823", "0.5828195", "0.5809561", "0.5807153", "0.57624656", "0.575208", "0.5750531", "0.5729857", "0.57274216", "0.5724476", "0.5683345", "0.56605124", "0.5656066", "0.5641839", "0.5606399", "0.5601092", "0.55798346", "0.55577165", "0.5557363", "0.554924", "0.5530282", "0.55287", "0.5527036", "0.5501533", "0.54867804", "0.54720724", "0.54710484", "0.54648316", "0.5463536", "0.5463492", "0.5462857", "0.5460625", "0.54580593", "0.54535645", "0.5447173", "0.5447173", "0.54281193", "0.5404288", "0.540066", "0.53898656", "0.5386201", "0.53747773", "0.53694975", "0.5365251", "0.53487074", "0.53474766", "0.53473526", "0.5344103", "0.53388107", "0.53300804", "0.5329464", "0.5320943", "0.5309722", "0.530811", "0.53071785", "0.5301332", "0.52970105", "0.5291549", "0.5267172", "0.5264007", "0.5262131", "0.5261428", "0.52608097", "0.5260556", "0.5258447", "0.525154", "0.5248599", "0.5243089", "0.5240495", "0.52343893", "0.5230635", "0.5217496", "0.5214576", "0.5214128", "0.52137244", "0.52134866", "0.5211871", "0.5192945", "0.5188666", "0.51885545", "0.5179777", "0.51769906", "0.5175163", "0.5169485", "0.5166429", "0.5163873", "0.5161124" ]
0.6630379
0
Validation Functions Description : To validate the Password of Security in Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:05 Oct 2016 Modified By:Raja Parameter:Password
public void validate_the_Password_of_Security_in_Customer_Tab(String Password)throws Exception { Report.fnReportPageBreak("Security", driver); if(Password==null) Password="N/A"; VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll("M_Header", "Security").replaceAll("M_Category", "Password").replaceAll("M_InnerText", Password), "Password - "+Password, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void validatePassword(){\n //Only Checking For Word Type Password With Minimum Of 8 Digits, At Least One Capital Letter,At Least One Number,At Least One Special Character\n Boolean password = Pattern.matches(\"^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9](?=.*[!@#$%^&*()])).{8,}$\",getPassword());\n System.out.println(passwordResult(password));\n }", "void validatePassword(String usid, String password) throws Exception;", "@Test\n\t\tvoid givenPassword_CheckForValidationForPasswordRule4_RetrunTrue() {\n\t\t\tboolean result =ValidateUserDetails.validatePassword(\"Srewoirfjkbh#3\");\n\t\t\tAssertions.assertTrue(result);\n\t\t}", "private void validatePassword() {\n mPassWordValidator.processResult(\n mPassWordValidator.apply(binding.registerPassword.getText().toString()),\n this::verifyAuthWithServer,\n result -> binding.registerPassword.setError(\"Please enter a valid Password.\"));\n }", "private boolean validatePassword() {\n\t\tEditText pw = (EditText)view.findViewById(R.id.et_enter_new_password);\n\t\tEditText confPW = (EditText)view.findViewById(R.id.et_reenter_new_password);\n\t\t\t\n\t\tString passwd = pw.getText().toString();\n\t\tString confpw = confPW.getText().toString();\n\t\t\n\t\t// Check for nulls\n\t\tif (passwd == null || confpw == null) {\n\t\t\tToast.makeText(view.getContext(), \"Passwords are required\", Toast.LENGTH_LONG).show();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Ensure password and retypted passwords match\n\t\tif (!passwd.contentEquals(confpw)) {\n\t\t\tToast.makeText(view.getContext(), \"Passwords must match\", Toast.LENGTH_LONG).show();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Ensure password meets complexity\n\t\tif (passwd.length() < 7) { // min length of 7 chars\n\t\t\tToast.makeText(view.getContext(), \"Password must be at least 7 characters long\", \n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Not really sure what the requirements are for private key password complexity yet\n\t\tnewPassword = passwd; // Set class variable with new password\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean checkPassword(String pwd) {\n\t\tif(temp.getCustomerPwd().matches(pwd))\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "boolean getPasswordValid();", "@VisibleForTesting\n int validatePassword(byte[] password) {\n int errorCode = NO_ERROR;\n final PasswordMetrics metrics = PasswordMetrics.computeForPassword(password);\n mergeMinComplexityAndDpmRequirements(metrics.quality);\n\n if (password == null || password.length < mPasswordMinLength) {\n if (mPasswordMinLength > mPasswordMinLengthToFulfillAllPolicies) {\n errorCode |= TOO_SHORT;\n }\n } else if (password.length > mPasswordMaxLength) {\n errorCode |= TOO_LONG;\n } else {\n // The length requirements are fulfilled.\n if (!mPasswordNumSequenceAllowed\n && !requiresLettersOrSymbols()\n && metrics.numeric == password.length) {\n // Check for repeated characters or sequences (e.g. '1234', '0000', '2468')\n // if DevicePolicyManager or min password complexity requires a complex numeric\n // password. There can be two cases in the UI: 1. User chooses to enroll a\n // PIN, 2. User chooses to enroll a password but enters a numeric-only pin. We\n // should carry out the sequence check in both cases.\n //\n // Conditions for the !requiresLettersOrSymbols() to be necessary:\n // - DPM requires NUMERIC_COMPLEX\n // - min complexity not NONE, user picks PASSWORD type so ALPHABETIC or\n // ALPHANUMERIC is required\n // Imagine user has entered \"12345678\", if we don't skip the sequence check, the\n // validation result would show both \"requires a letter\" and \"sequence not\n // allowed\", while the only requirement the user needs to know is \"requires a\n // letter\" because once the user has fulfilled the alphabetic requirement, the\n // password would not be containing only digits so this check would not be\n // performed anyway.\n final int sequence = PasswordMetrics.maxLengthSequence(password);\n if (sequence > PasswordMetrics.MAX_ALLOWED_SEQUENCE) {\n errorCode |= CONTAIN_SEQUENTIAL_DIGITS;\n }\n }\n // Is the password recently used?\n if (mLockPatternUtils.checkPasswordHistory(password, getPasswordHistoryHashFactor(),\n mUserId)) {\n errorCode |= RECENTLY_USED;\n }\n }\n\n // Allow non-control Latin-1 characters only.\n for (int i = 0; i < password.length; i++) {\n char c = (char) password[i];\n if (c < 32 || c > 127) {\n errorCode |= CONTAIN_INVALID_CHARACTERS;\n break;\n }\n }\n\n // Ensure no non-digits if we are requesting numbers. This shouldn't be possible unless\n // user finds some way to bring up soft keyboard.\n if (mRequestedQuality == PASSWORD_QUALITY_NUMERIC\n || mRequestedQuality == PASSWORD_QUALITY_NUMERIC_COMPLEX) {\n if (metrics.letters > 0 || metrics.symbols > 0) {\n errorCode |= CONTAIN_NON_DIGITS;\n }\n }\n\n if (metrics.letters < mPasswordMinLetters) {\n errorCode |= NOT_ENOUGH_LETTER;\n }\n if (metrics.upperCase < mPasswordMinUpperCase) {\n errorCode |= NOT_ENOUGH_UPPER_CASE;\n }\n if (metrics.lowerCase < mPasswordMinLowerCase) {\n errorCode |= NOT_ENOUGH_LOWER_CASE;\n }\n if (metrics.symbols < mPasswordMinSymbols) {\n errorCode |= NOT_ENOUGH_SYMBOLS;\n }\n if (metrics.numeric < mPasswordMinNumeric) {\n errorCode |= NOT_ENOUGH_DIGITS;\n }\n if (metrics.nonLetter < mPasswordMinNonLetter) {\n errorCode |= NOT_ENOUGH_NON_LETTER;\n }\n return errorCode;\n }", "private boolean validatePassword() throws NoSuchAlgorithmException, NoSuchProviderException \n {\n String passwordToHash = Password.getText(); \n\t\t\n \tString securePassword = null;\n \tString testPass;\n \tBoolean success=false;\n \tbyte[] salt = null;\n\n\t \n\t \n\t \n try{ \n \t\tmycon=connect.getConnect();\n \t\t \n \t\t \n String query;\n\t query =\"select password, salt\\n\" + \n\t \t\t\"from employee\\n\" + \n\t \t\t\"where userName= ?;\";\n\t \n\t PreparedStatement pstm= mycon.prepareStatement(query);\n\t pstm.setString(1, Username.getText());\n\t ResultSet rs = pstm.executeQuery();\n\t \n\t if(rs.next()) {\n\t \tsecurePassword =rs.getString(1);\n\t \t\n\t \tBlob blob = rs.getBlob(2);\n\t \t int bloblen= (int) blob.length();\n\t \t salt = blob.getBytes(1, bloblen);\n\t \t blob.free();\n\t \t\n\t \t\n\t \n\t }\n\t \n\t \n\t testPass=SecurePass.getSecurePassword(passwordToHash, salt);\n \n \t if(securePassword.equals(testPass)) {\n \t success=true;\n \t this.ActiveUser=Username.getText();\n \t }\n \t\n \t\t\n \t\t\n \t\t\n \t\t} catch (SQLException e ) {\n \t\t\te.printStackTrace(); \t\n \t\t\t\n \t\t}\n\t\treturn success;\n \n\t \t \n \n \n\t\t\n \n }", "private boolean checkPassword() {\n String password = getPassword.getText();\n \n if(password.compareTo(\"\") == 0) {\n errorMessage.setText(\"Please enter a password.\");\n return false;\n }\n else if(password.compareTo(getConfirmPassword.getText()) == 0) {\n //Password must be min of 8 characters max of 16\n if((8 > password.length()) || (\n password.length() > 16)) {\n errorMessage.setText(\"Password must be 8-16 characters long.\");\n return false;\n }\n \n boolean upperFlag = false;\n boolean lowerFlag = false;\n boolean numFlag = false;\n boolean charFlag = false;\n \n for(int i = 0; i < password.length(); ++i) {\n String sp = \"/*!@#$%^&*()\\\\\\\"{}_[]|\\\\\\\\?/<>,.\";\n char ch = password.charAt(i);\n \n if(Character.isUpperCase(ch)) { upperFlag = true; }\n if(Character.isLowerCase(ch)) { lowerFlag = true; }\n if(Character.isDigit(ch)) { numFlag = true; }\n if(sp.contains(password.substring(i, i))) { charFlag = true; }\n } \n //Password must contain 1 uppercase letter\n if(!upperFlag) {\n errorMessage.setText(\"Password must contain at least one uppercase letter.\");\n return false;\n }\n //Password must contain 1 lowercase letter\n if(!lowerFlag) {\n errorMessage.setText(\"Password must contain at least one lowercase letter.\");\n return false;\n }\n //Password must contain 1 number\n if(!numFlag) {\n errorMessage.setText(\"Password must contain at least one digit.\");\n return false;\n }\n //Password must contain 1 special character\n if(!charFlag) {\n errorMessage.setText(\"Password must contain at least one special character.\");\n return false;\n }\n return true;\n }\n else {\n errorMessage.setText(\"The entered passwords do not match.\");\n return false; \n }\n }", "public void testvalidatePassword0001()\n\t{\n\t\tLoginCheck loginCheckTest = new LoginCheck();\n\t\t\n\t\tassertFalse(loginCheckTest.validatePassword(\"pwd\"));\n\t}", "public static boolean checkPassword (String password) throws UserRegistrationException{\n check = Pattern.compile(\"^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[!@#$%^&*()_+=-]?){8,}.*$\").matcher(password).matches();\n if (check) {\n return true;\n } else {\n throw new UserRegistrationException(\"Enter a valid password\");\n }\n }", "public List<String> passwordMessageValidations() {\n name.sendKeys(\"Karan Prinja\");\n email.sendKeys(\"[email protected]\");\n password.sendKeys(\"12345678\");\n helperMethods.waitForWebElement(smallPassword, 30);\n String sosoPassword = smallPassword.getText();\n password.clear();\n password.sendKeys(\"Randomer12345678\");\n helperMethods.waitForWebElement(smallPassword, 30);\n String goodPassword = smallPassword.getText();\n List<String> passwordValidationText = new ArrayList<>();\n passwordValidationText.add(sosoPassword);\n passwordValidationText.add(goodPassword);\n return passwordValidationText;\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "@Override\n public void validate() {\n if (this.password.length() < 2) {\n addFieldError(\"password\", \"too short\");\n }\n System.out.println(\"**************Validation\");\n }", "@Test(priority=1)\n\tpublic void testPasswordValidity() {\n\t\tsignup.clearAllFields();\n\t\tsignup.enterId(\"[email protected]\");\n\t\tsignup.enterPassword(\"1234567\");\n\t\tsignup.reenterPassword(\"1234567\");\n\t\tsignup.clickSubmit();\n\t\tList<String> errors = signup.getErrors();\n\t\t\n\t\t// is String Present looks for the presence of expected error message from all of errors present on current screen. \n\t\tAssert.assertTrue(TestHelper.isStringPresent(errors, \"Passwords do not match; please enter a password and reenter to confirm.\\nPasswords must contain at least 6 characters and no spaces.\"));\n\t}", "Boolean validateOldPassword(LoginInformationDTO loginInformationDTO) throws BusinessException;", "public boolean validatePassword() {\r\n\t\tif (txtPassword.getValue() == null || txtPassword.getValue().length() == 0 || !txtPassword.getValue().equals(txtRetypePassword.getValue()))\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "Boolean checkPass(Customer customer, String pass);", "@Test\r\n\tpublic void TC_09_verify_Passowrd_Does_Not_Match_with_confirm_password() {\r\n\t\thomePgObj = new Page_Home(driver);\r\n\t\tregPgObj = homePgObj.click_RegistrationLink();\r\n\t\t// Step 1: Verify the registration page is displayed\r\n\t\t\r\n\t\tflag = regPgObj.registrationPgDisplay();\r\n\t\tAssert.assertTrue(flag, \"Registration page is displayed\");\r\n\t\t\r\n\t\t// Step 2: Enter valid/mandatory registration details with both password and confirm password do'nt match\r\n\t\t\r\n\t\tregPgObj.enterRegistrationDetails(\"firstName\", firstName);\r\n\t\tregPgObj.enterRegistrationDetails(\"lastName\", lastName);\r\n\t\tregPgObj.enterRegistrationDetails(\"email\", email);\r\n\t\tregPgObj.enterRegistrationDetails(\"password\", password);\r\n\t\tregPgObj.enterRegistrationDetails(\"confirmPassword\", \"test12345\");\r\n\t\t\r\n\t\t// Step 3: Click on Sign in button\r\n\t\t\r\n\t\tregPgObj.clickSignInButton();\r\n\t\t\r\n\t\t// Step 4: Verify user should NOT be able to proceed further with registration as proper validation message regarding password and confirm\r\n\t\t// password do'nt match is displayed\r\n\t\t\r\n\t\terrMsg = Page_Registration.getpswdErrMsg();\r\n\t\tAssert.assertEquals(errMsg, \"The password you entered does not match\");\r\n\r\n\t}", "@When(\"^user should enter the valid password in the loginpage$\")\n\tpublic void user_should_enter_the_valid_password_in_the_loginpage() throws Throwable {\n\t\tinputValuestoElement(pa.getAp().getPasswordinput(), \"superman@1010\");\n\t\n\t \n\t}", "@Override\r\n\tpublic boolean validatePassword(String arg0, String arg1) {\n\t\treturn false;\r\n\t}", "@Test\r\n\tpublic void TC_10_verify_Passowrd_Requirements() {\r\n\t\thomePgObj = new Page_Home(driver);\r\n\t\tregPgObj = homePgObj.click_RegistrationLink();\r\n\t\t\r\n\t\t// Step 1: Verify the registration page is displayed\r\n\t\t\r\n\t\tflag = regPgObj.registrationPgDisplay();\r\n\t\t\r\n\t\t// Step 2: Enter valid/mandatory registration details with password does not meet system requirements\r\n\t\t\r\n\t\tAssert.assertTrue(flag, \"Registration page is displayed\");\r\n\t\tregPgObj.enterRegistrationDetails(\"firstName\", firstName);\r\n\t\tregPgObj.enterRegistrationDetails(\"lastName\", lastName);\r\n\t\tregPgObj.enterRegistrationDetails(\"email\", email);\r\n\t\tregPgObj.enterRegistrationDetails(\"password\", \"test\");\r\n\t\tregPgObj.enterRegistrationDetails(\"confirmPassword\", \"test\");\r\n\t\t\r\n\t\t// Step 3: Click on Sign in button\r\n\t\t\r\n\t\tregPgObj.clickSignInButton();\r\n\t\terrMsg = Page_Registration.getpswdRqmtErrMsg();\r\n\t\t\r\n\t\t// Step 4: Verify user should NOT be able to proceed further with registration as proper validation message regarding password \r\n\t\t// system requirements\r\n\t\t\r\n\t\tAssert.assertEquals(errMsg, \"Password does not meet the minimum requirements. It must be at least 7 characters in length, contain one number and one letter.\");\r\n\r\n\t}", "@Test\r\n\tpublic void testIsValidPasswordSuccessful()\r\n\t{\r\n\t\tassertTrue(PasswordCheckerUtility.isValidPassword(\"#SuperMan1\"));\r\n\t}", "boolean hasPassword2();", "@Test\n\t\tvoid withoutRule4_CheckForValidationForPasswordRule4_ReturnFalse() {\n\t\t\tboolean result =ValidateUserDetails.validatePassword(\"Sbvdfrjjbcxv5\");\n\t\t\tAssertions.assertFalse(result);\n\t\t}", "private boolean isPasswordValid(String password){\n return password.length() > 2; //mot de passe de longueur sup à 2\n }", "public boolean validate(String id, String password);", "public CredentialValidationResult validate(UsernamePasswordCredential unpc){\r\n \r\n \r\n return null;\r\n}", "public boolean verifyFields() {\n String fname = firstName.getText();\n String lname = lastName.getText();\n String username = userName.getText();\n String emailString = email.getText();\n String passwordString = String.valueOf(password.getText());\n String confirmPasswordString = String.valueOf(confirmPassword.getText());\n\n\n if (fname.trim().equals(\"\") || lname.trim().equals(\"\") || username.trim().equals(\"\") || emailString.trim().equals(\"\") || passwordString.trim().equals(\"\")) {\n\n outputText.setStyle(\"-fx-text-fill: #d33232\");\n outputText.setText(\"Fill in the Required Fields\");\n\n return false;\n }\n\n //check if confirm password equals password\n else if (!passwordString.equals(confirmPasswordString)) {\n outputText.setStyle(\"-fx-text-fill: #D33232\");\n outputText.setText(\"Password does not match Confirm Password\");\n return false;\n }\n\n // if everything is fine\n else {\n return true;\n }\n }", "public void testvalidatePassword0002()\n\t{\n\t\tLoginCheck loginCheckTest = new LoginCheck();\n\t\t\n\t\tassertTrue(loginCheckTest.validatePassword(\"passwd\"));\n\t}", "@Test\r\n\tpublic void TC_07_verify_Confirmpassword_Mandatory_Field() {\r\n\r\n\t\thomePgObj = new Page_Home(driver);\r\n\t\tregPgObj = homePgObj.click_RegistrationLink();\r\n\t\t\r\n\t\t// Step 1: Verify the registration page is displayed\r\n\t\t\r\n\t\tflag = regPgObj.registrationPgDisplay();\r\n\t\t\r\n\t\t// Step 2: Enter valid/mandatory registration details except confirm password\r\n\t\t\r\n\t\tAssert.assertTrue(flag, \"Registration page is displayed\");\r\n\t\tregPgObj.enterRegistrationDetails(\"firstName\", firstName);\r\n\t\tregPgObj.enterRegistrationDetails(\"lastName\", lastName);\r\n\t\tregPgObj.enterRegistrationDetails(\"email\", email);\r\n\t\tregPgObj.enterRegistrationDetails(\"password\", password);\r\n\t\tregPgObj.enterRegistrationDetails(\"confirmPassword\", \"\");\r\n\t\t\r\n\t\t// Step 3: Click on Sign in button\r\n\t\tregPgObj.clickSignInButton();\r\n\t\t\r\n\t\t// Step 4: Verify user should NOT be able to proceed further with registration as proper validation message regarding confirm password\r\n\t\t// is displayed\r\n\t\t\r\n\t\terrMsg = Page_Registration.getMandatoryFieldErrMsg();\r\n\t\tAssert.assertEquals(errMsg, \"Please enter a value for Confirm Password\");\r\n\r\n\t}", "private void checkValidation() {\n // Get email id and password\n MainActivity.EmailAddress = emailid.getText().toString();\n finalPassword = password.getText().toString();\n\n // Check patter for email id\n Pattern p = Pattern.compile(Utils.regEx);\n\n Matcher m = p.matcher(MainActivity.EmailAddress);\n\n // Check for both field is empty or not\n if (MainActivity.EmailAddress.equals(\"\") || MainActivity.EmailAddress.length() == 0\n || finalPassword.equals(\"\") || finalPassword.length() == 0) {\n loginLayout.startAnimation(shakeAnimation);\n new CustomToast().Show_Toast(getActivity(), view,\n \"Enter both credentials.\");\n\n }\n // Check if email id is valid or not\n else if (!m.find())\n new CustomToast().Show_Toast(getActivity(), view,\n \"Your Email Id is Invalid.\");\n // Else do login and do your stuff\n else\n tryLoginUser();\n\n }", "@Test\r\n\tpublic void TC_06_verify_password_Mandatory_Field() {\r\n\r\n\t\thomePgObj = new Page_Home(driver);\r\n\t\tregPgObj = homePgObj.click_RegistrationLink();\r\n\t\t\r\n\t\t// Step 1: Verify the registration page is displayed\r\n\t\t\r\n\t\tflag = regPgObj.registrationPgDisplay();\r\n\t\tAssert.assertTrue(flag, \"Registration page is displayed\");\r\n\t\t\r\n\t\t// Step 2: Enter valid/mandatory registration details except password\r\n\t\tregPgObj.enterRegistrationDetails(\"firstName\", firstName);\r\n\t\tregPgObj.enterRegistrationDetails(\"lastName\", lastName);\r\n\t\tregPgObj.enterRegistrationDetails(\"email\", email);\r\n\t\tregPgObj.enterRegistrationDetails(\"password\", \"\");\r\n\t\tregPgObj.enterRegistrationDetails(\"confirmPassword\", confirmPassword);\r\n\t\t\r\n\t\t// Step 3: Click on Sign in button\r\n\t\tregPgObj.clickSignInButton();\r\n\t\t// Step 4: Verify user should NOT be able to proceed further with registration as proper validation message regarding password\r\n\t\t// is displayed\r\n\t\terrMsg = Page_Registration.getMandatoryFieldErrMsg();\r\n\t\tAssert.assertEquals(errMsg, \"Please enter a value for Password\");\r\n\r\n\t}", "private void passwordvalidation( String password ) throws Exception {\r\n if ( password != null ) {\r\n if ( password.length() < 6 ) {\r\n throw new Exception( \"Le mot de passe doit contenir au moins 6 caracteres.\" );\r\n }\r\n } else {\r\n throw new Exception( \"Merci de saisir votre mot de passe.\" );\r\n }\r\n }", "private boolean isValidPassword(final String thePassword) {\n return thePassword.length() > PASSWORD_LENGTH;\n }", "@Test\n public void testLessThanEightCharactersPassword() {\n String password = \"Pass123\";\n\n try {\n User.validatePassword(password);\n } catch (IntelligenceIdentityException e) {\n return;\n }\n\n fail(\"Password is wrong, an exception should be thrown, check implementation of password validation\");\n }", "public void testvalidatePassword0003()\n\t{\n\t\tLoginCheck loginCheckTest = new LoginCheck();\n\t\t\n\t\tassertFalse(loginCheckTest.validatePassword(\"password test greater than\"));\n\t}", "private boolean isPasswordValid(String password) {\n\n String x = \"word1234$\";\n\n\t\t//check if password is direct match\n if (!password.equals(x)){\n return false;\n }\n\n\n //check length of password\n if (password.length() < 8) {\n return false;\n }\n\n\t//check for at least 1 special character\n for (int i=0; i < password.length(); i++){\n int ascii = (int) password.charAt(i);\n if (!(ascii >= 65 && ascii <= 90) && !(ascii >= 97 && ascii <= 122)){\n return true;\n }\n }\n\n \t\t//check for at least 1 number character\n for (int i=0; i < password.length(); i++){\n int ascii = (int) password.charAt(i);\n if (ascii >= 48 && ascii <= 57){\n return true;\n }\n }\n\n\t//check for at least 1 upper case and 1 lower case character\n boolean upper = false;\n boolean lower = false;\n for (int i=0; i < password.length(); i++){\n int ascii = (int) password.charAt(i);\n if (ascii >= 65 && ascii <= 90){\n upper = true;\n }\n if (ascii >= 97 && ascii <= 122){\n lower = true;\n }\n if (upper == true && lower == true){\n return true;\n }\n }\n return false;\n\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "private boolean checkPassword() {\n String password = Objects.requireNonNull(password1.getEditText()).getText().toString();\n\n return password.length() >= 8 && ContainSpecial(password) && noUpper(password);\n }", "@Test(priority=1)\n\tpublic void verifyPasswordsMatch() {\n\t\tsignup.clearAllFields();\n\t\tsignup.enterId(\"[email protected]\");\n\t\tsignup.enterPassword(\"abcd\");\n\t\tsignup.reenterPassword(\"1235\");\n\t\tsignup.clickSubmit();\n\t\tList<String> errors = signup.getErrors();\n\t\tAssert.assertTrue(TestHelper.isStringPresent(errors, \"Passwords do not match; please enter a password and reenter to confirm.\\nPasswords must contain at least 6 characters and no spaces.\"));\n\t}", "private boolean validate() {\n\n EditText fnameET = findViewById(R.id.fnameET);\n EditText lnameET = findViewById(R.id.lnameET);\n EditText perNoET = findViewById(R.id.perNoET);\n EditText lecEmailET = findViewById(R.id.lecEmailET);\n EditText adminCodeET = findViewById(R.id.adminCodeET);\n EditText passwET = findViewById(R.id.passwET);\n EditText cpasswET = findViewById(R.id.cpasswET);\n\n String fname = fnameET.getText().toString().trim();\n String lname = lnameET.getText().toString().trim();\n String personNo = perNoET.getText().toString().trim();\n String lectEmail = lecEmailET.getText().toString().trim();\n String adminCode = adminCodeET.getText().toString().trim();\n String password = passwET.getText().toString().trim();\n String cpassword = cpasswET.getText().toString().trim();\n\n //boolean flag;\n\n if(fname.isEmpty()) {\n fnameET.setError(\"Field can't be empty!\");\n fnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lname.isEmpty()) {\n lnameET.setError(\"Field can't be empty!\");\n lnameET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(personNo.isEmpty()) {\n perNoET.setError(\"Field can't be empty!\");\n perNoET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(lectEmail.isEmpty()) {\n lecEmailET.setError(\"Field can't be empty!\");\n lecEmailET.requestFocus();\n return false;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(lectEmail).matches()) {\n lecEmailET.setError(\"check that your email is entered correctly!\");\n lecEmailET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(adminCode.isEmpty()) {\n adminCodeET.setError(\"Field can't be empty!\");\n adminCodeET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(password.isEmpty()) {\n passwET.setError(\"Field can't be empty!\");\n passwET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n if(cpassword.isEmpty()) {\n cpasswET.setError(\"Field can't be empty!\");\n cpasswET.requestFocus();\n return false;\n } else if (!cpassword.equals(password)) {\n cpasswET.setError(\"password doesn't match the above entered password!\");\n cpasswET.requestFocus();\n return false;\n } /*else {\n flag = false;\n }*/\n\n return true;\n }", "private boolean checkPassword(){\n Pattern p = Pattern.compile(\"^[A-z0-9]*$\");\n Matcher m = p.matcher(newPass.getText());\n boolean b = m.matches();\n if(newPass.getText().compareTo(repeatPass.getText()) != 0 || newPass.getText().isEmpty() || repeatPass.getText().isEmpty()){\n repeatPass.setBackground(Color.red);\n JOptionPane.showMessageDialog(null, \"Password Error\");\n return false;\n }\n else if(newPass.getText().length() > 10 || b == false){\n newPass.setBackground(Color.red);\n JOptionPane.showMessageDialog(null, \"Password Error\");\n return false;\n }\n newPass.setBackground(Color.green);\n repeatPass.setBackground(Color.green);\n return true;\n }", "public boolean isPasswordValid(String password) {\n boolean errorFlag = true;\n Pattern specailCharPattern = Pattern.compile(\"[^a-z0-9 ]\", Pattern.CASE_INSENSITIVE);\n Pattern upperCasePattern = Pattern.compile(\"[A-Z ]\");\n Pattern lowerCasePattern = Pattern.compile(\"[a-z ]\");\n Pattern digitCasePattern = Pattern.compile(\"[0-9 ]\");\n if(password.length() < 8){\n errorFlag =false;\n } else if(!specailCharPattern.matcher(password).find()){\n errorFlag = false;\n } else if(!upperCasePattern.matcher(password).find()){\n errorFlag = false;\n } else if(!lowerCasePattern.matcher(password).find()){\n errorFlag = false;\n } else if(!digitCasePattern.matcher(password).find()){\n errorFlag = false;\n }\n return errorFlag;\n }", "private boolean checkPass(String enterPass) {\n JdbcConnection connection = JdbcConnection.getInstance();\n DaoFactory daoFactory = new RealDaoFactory(connection);\n List<User> users = daoFactory.createUserDao().findAll();\n for (User user : users) {\n if (user.getPasswordHash() == enterPass.hashCode()) {\n return true;\n }\n }\n return false;\n }", "@Test\n public void testGetPassword() {\n System.out.println(\"getPassword Test (Passing value)\");\n String expResult = \"$2a$10$EblZqNptyYvcLm/VwDCVAuBjzZOI7khzdyGPBr08PpIi0na624b8.\";\n String result = user.getPassword();\n // Check for and print any violations of validation annotations\n Set<ConstraintViolation<User>> violations = validator.validate(user);\n String message =\n violations.iterator().hasNext() ? violations.iterator().next().getMessage() : \"\";\n if (!violations.isEmpty()) {\n System.out.println(\"Violation caught: \" + message);\n }\n // Test method\n assertEquals(expResult, result);\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 4;\r\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 4;\r\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 4;\r\n }", "@Override\n\tpublic void validatePassword(String password) throws UserException {\n\t\t\n\t}", "private boolean isPasswordValid(String password) {\n return password.length() > 4;\n }", "public String validation(String inputStaffId, String inputStaffPw) {\n\t\t\tif(restaurant.findStaff(inputStaffId) != null) {\n\t\t\t\tstaff = restaurant.findStaff(inputStaffId);\t\t\n\t\t\t\tif(staff.getStaffPassword().equals(inputStaffPw)) {\n\t\t\t\t\treturn \"Login successfully!\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn \"Invalid password!\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn \"Invalid staff ID!\";\n\t\t\t}\n\t}", "private static boolean isValid(String passWord) {\n\t\tString password = passWord;\n\t\tboolean noWhite = noWhiteSpace(password);\n\t\tboolean isOver = isOverEight(password);\n\t\tif (noWhite && isOver) {\n\t\t\tSystem.out.println(\"Password accepted!\");\n\t\t\treturn true;\n\t\t} else return false;\n\t}", "private boolean isPasswordValid(String password) {\n return true;\n }", "private boolean isPasswordValid(String password) {\n return true;\n }", "public static boolean checkPassword()\n {\n String pw = SmartDashboard.getString(\"Password\");\n SmartDashboard.putString(\"Password\", \"\"); //Clear the password field so that it must be reentered\n\n if(pw.equals(ADMIN_PASSWORD))\n return true;\n else\n {\n log(\"Password invalid\"); //The user gave an incorrect password, inform them.\n return false;\n }\n }", "private boolean checkValidation(Reset reset, String confirmPassword) {\n if (reset.getPassword().isEmpty()) {\n mValidateLiveData.setValue(new FailureResponse(\n AppConstants.UIVALIDATIONS.NEW_PASSWORD_EMPTY, ResourceUtils.getInstance()\n .getString(R.string.new_password_empty)\n ));\n return false;\n } else if (reset.getPassword().length() < 6) {\n mValidateLiveData.setValue(new FailureResponse(\n AppConstants.UIVALIDATIONS.INVALID_PASSWORD, ResourceUtils.getInstance()\n .getString(R.string.enter_valid_password)\n ));\n return false;\n } else if (confirmPassword.isEmpty()) {\n mValidateLiveData.setValue(new FailureResponse(\n AppConstants.UIVALIDATIONS.CONFIRM_PASSWORD_EMPTY, ResourceUtils.getInstance()\n .getString(R.string.confirm_password_empty)\n ));\n return false;\n } else if (confirmPassword.length() < 6) {\n mValidateLiveData.setValue(new FailureResponse(\n AppConstants.UIVALIDATIONS.INVALID_PASSWORD, ResourceUtils.getInstance()\n .getString(R.string.enter_valid_password)\n ));\n return false;\n\n } else if (!reset.getPassword().equals(confirmPassword)) {\n mValidateLiveData.setValue(new FailureResponse(\n AppConstants.UIVALIDATIONS.PASSWORD_NOT_MATCHED, ResourceUtils.getInstance()\n .getString(R.string.password_not_matched)\n ));\n return false;\n }\n return true;\n }", "@Override\n protected boolean isValidValue(String value) {\n // Password must be at least 8 characters long and contain at least\n // one number\n //\n if (value != null\n && (value.length() < 8 || !value.matches(\".*\\\\d.*\"))) {\n return false;\n }\n return true;\n }", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "public String CheckPassword(String Password)\n\t{\n\t\tif(Pattern.matches(\"(?=.*[$#@!%^&*])(?=.*[0-9])(?=.*[A-Z]).{8,20}$\",Password))\n\t\treturn \"HAPPY\";\n\t\telse \n\t\treturn \"SAD\";\n\t}", "@Test\n public void testIsValidPassword() {\n System.out.println(\"isValidPassword\");\n String input = \".%6gwdye\";\n boolean expResult = false;\n boolean result = ValidVariables.isValidPassword(input);\n assertEquals(expResult, result);\n }", "public ResultSet validate(String NetId, String Password) {\n\t\t\n\t\ttry\n\t\t{ \n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\"); \t\n\t\t\tConnection conn = DriverManager.getConnection(url, username, password); \n\t\t\tPreparedStatement ps=conn.prepareStatement(\"select * from registration where idNetId = ? and Password = ?\"); \n\t\t\t ps.setString(1, NetId);\n\t\t\t ps.setString(2, Password);\n\t\t\t rs = ps.executeQuery();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\treturn rs;\n\t}", "private boolean isPasswordValid(String password)\n {\n return password.length() > MagazzinoService.getPasswordMinLength(this);\n }", "private boolean validate(String username, String password) {\n\t\tif(username.equals(\"Venkat\") && password.equals(\"kumar\")) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Test\n public void testValidPassword() {\n String password = \"PassWord123\";\n\n try {\n User.validatePassword(password);\n } catch (IntelligenceIdentityException e) {\n fail(\"Password is ok, exception wrongly thrown, check implementation of password validation\");\n }\n\n }", "public void validate(String id, String pw) throws RemoteException;", "public static boolean is_valid_password(String s)\n\t{\n\t\t\n\t\tint chars=0;\n\t\tint syms=0;\n\t\tint nums=0;\n\t\tfor(int i=0; i<s.length(); i++)\n\t\t{\n\t\t\t\n\t\t\tint value = (int)(s.charAt(i));//ASCII value of the character\n\t\t\tif(value==52||value==49||value==97||value==105)\n\t\t\t{\n\t\t\t\treturn false;//password cannot contain 4, 1, a, or i\n\t\t\t\t\n\t\t\t}\n\t\t\tif(value<=122&&value>=97)\n\t\t\t{\n\t\t\t\tchars++;\n\t\t\t}\n\t\t\telse if(value<=57&&value>=48)\n\t\t\t\t{\n\t\t\t\tnums++;\n\t\t\t\t}\n\t\t\telse if(value==33||value==64||value==35||value==36||value==37||value==38||value==42)\n\t\t\t{\n\t\t\t\tsyms++;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif(!((chars>=1&&chars<=3)&&(nums>=1&&nums<=2)&&(syms>=1&&syms<=2)))\n\t\t\t{\n\t\t\t\t\n\t\t\treturn false; //must contain 1 to 3 characters, 1 to 2 symbols, and 1 to 2 numbers\n\t\t}\n\t\t\n\t\t/*dictionary check section*/\n\t\t\n\t\tif(d.contains(s.substring(0,1)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif(d.contains(s.substring(1,2)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif(d.contains(s.substring(2,3)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif(d.contains(s.substring(3,4)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif(d.contains(s.substring(4)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif(d.contains(s.substring(0,2)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif(d.contains(s.substring(1,3)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif(d.contains(s.substring(2,4)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif(d.contains(s.substring(3)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif(d.contains(s.substring(0,3)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif(d.contains(s.substring(1,4)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif(d.contains(s.substring(2)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif(d.contains(s.substring(0,4)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif(d.contains(s.substring(1)))\n\t\t{\n\t\t\treturn false;\n\t\t}\t\n\t\t\n\t\t\n\t\treturn true;//it must be true I guess idk\n\t}", "public void testUnmatchedPassword() {\n\n // unmatched length\n boolean test1 = UserService.checkPasswordMatch(\"password123\", \"ppassword123\");\n assertFalse(test1);\n\n boolean test2 = UserService.checkPasswordMatch(\"ppassword123\", \"password123\");\n assertFalse(test2);\n\n // unmatched number\n boolean test3 = UserService.checkPasswordMatch(\"password123\", \"password124\");\n assertFalse(test3);\n\n // unmatched letter (case sensitive)\n boolean test4 = UserService.checkPasswordMatch(\"123password\", \"123Password\");\n assertFalse(test4);\n\n // unmatched letter\n boolean test5 = UserService.checkPasswordMatch(\"123password\", \"123passward\");\n assertFalse(test5);\n\n // unmatched letter/number\n boolean test6 = UserService.checkPasswordMatch(\"123password\", \"12password3\");\n assertFalse(test6);\n }", "public static Boolean checkPassowd(String password){\n\t\t//String password = txtPassword.getText();\n\t\t//System.out.println(password);\n\t\treturn password.equals(\"password\");\n\t}", "void onChangePasswordSuccess(ConformationRes data);", "public void validateResetPassword()\r\n {\r\n boolean flag = this.hasErrors();\r\n if (userProfile == null || userProfile.getLoginId() == null\r\n || \"\".equals(userProfile.getLoginId().trim()))\r\n {\r\n this.setErrorMsg(this.getText(\"B2BPC0809\"));\r\n }\r\n else\r\n {\r\n try\r\n {\r\n log.info(this.getText(\"B2BPC0802\", new String[] {\r\n userProfile.getLoginId(),\r\n this.getRequest().getRemoteAddr() }));\r\n String loginId = userProfile.getLoginId();\r\n userProfile = userProfileService\r\n .getUserProfileByLoginId(userProfile.getLoginId());\r\n if (userProfile == null)\r\n {\r\n log.info(this.getText(\"B2BPC0810\", new String[] { loginId,\r\n this.getRequest().getRemoteAddr() }));\r\n this.setErrorMsg(this.getText(\"B2BPC0811\",\r\n new String[] { loginId }));\r\n flag = true;\r\n }\r\n if (!flag)\r\n {\r\n if (!flag && !userProfile.getActive())\r\n {\r\n this.setErrorMsg(this.getText(\"B2BPC0824\",\r\n new String[] { userProfile.getLoginId() }));\r\n flag = true;\r\n }\r\n if (!flag && userProfile.getBlocked())\r\n {\r\n this.setErrorMsg(this.getText(\"B2BPC0825\",\r\n new String[] { userProfile.getLoginId() }));\r\n flag = true;\r\n }\r\n }\r\n if (!flag)\r\n {\r\n previousResetPwdRecord = new ResetPasswordRequestHistoryHolder();\r\n previousResetPwdRecord.setLoginId(userProfile.getLoginId());\r\n previousResetPwdRecord.setValid(Boolean.TRUE);\r\n List<? extends Object> resetPasswordRequestHistorys = resetPasswordRequestHistoryService\r\n .select(previousResetPwdRecord);\r\n if (resetPasswordRequestHistorys == null\r\n || resetPasswordRequestHistorys.isEmpty())\r\n {\r\n previousResetPwdRecord = null;\r\n }\r\n else\r\n {\r\n previousResetPwdRecord = (ResetPasswordRequestHistoryHolder) resetPasswordRequestHistorys\r\n .get(0);\r\n int reqInvl = controlParameterService\r\n .selectCacheControlParameterBySectIdAndParamId(\r\n SECT_ID_CTRL, \"REQ_INVL\").getNumValue();\r\n Date canResetDate = new Date(previousResetPwdRecord\r\n .getRequestTime().getTime()\r\n + reqInvl * 60L * 1000);\r\n if ((new Date()).before(canResetDate))\r\n {\r\n log.info(this.getText(\"B2BPC0812\", new String[] {\r\n String.valueOf(reqInvl),\r\n DateUtil.getInstance().convertDateToString(\r\n previousResetPwdRecord\r\n .getRequestTime(),\r\n DATA_FORMAT),\r\n DateUtil.getInstance().convertDateToString(\r\n new Date(), DATA_FORMAT) }));\r\n this\r\n .setErrorMsg(this\r\n .getText(\r\n \"B2BPC0812\",\r\n new String[] {\r\n String\r\n .valueOf(reqInvl),\r\n DateUtil\r\n .getInstance()\r\n .convertDateToString(\r\n previousResetPwdRecord\r\n .getRequestTime(),\r\n DATA_FORMAT),\r\n DateUtil\r\n .getInstance()\r\n .convertDateToString(\r\n new Date(),\r\n DATA_FORMAT) }));\r\n flag = true;\r\n }\r\n }\r\n\r\n }\r\n }\r\n catch (Exception e)\r\n {\r\n ErrorHelper.getInstance().logError(log, this, e);\r\n try\r\n {\r\n this\r\n .setErrorMsg(this\r\n .getText(\r\n \"B2BPC0814\",\r\n new String[] { controlParameterService\r\n .selectCacheControlParameterBySectIdAndParamId(\r\n SECT_ID_CTRL,\r\n PARAM_ID_HELPDESK_NO)\r\n .getStringValue() }));\r\n }\r\n catch (Exception e1)\r\n {\r\n ErrorHelper.getInstance().logError(log, this, e1);\r\n }\r\n }\r\n }\r\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 0;\r\n }", "private String getPassword(){\n System.out.println(\"Enter the Password Minimum Of 8 Charters\");\n return sc.next();\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 2;\n }", "Password getPsw();", "public User validate(String emailID , String password);", "boolean validate(String name, String email, String password)\n {\n //Check if the name is empty and password field is 8 characters long, also including email check\n if(name.isEmpty() || !rfc2822.matcher(email).matches() || (password.length() < 8))\n {\n Toast.makeText(this, \"Please enter your name and email. Ensure password is more than 8 characters long!\", Toast.LENGTH_SHORT).show();\n\n //reset TextEdits\n eRegName.setText(null);\n eRegEmail.setText(null);\n eRegPassword.setText(null);\n\n return false;\n }\n return true;\n }", "@Test\n public void testCantRegisterMismatchPassword() {\n enterValuesAndClick(\"name\", \"[email protected]\", \"123456\", \"123478\");\n checkErrors(nameNoError, emailNoError, pwdsDoNotMatchError, pwdsDoNotMatchError);\n }", "private boolean checkValidation() {\n boolean result = true;\n\n if(!Validate.isEmailAddress(editTextLogin, true)){\n result = false;\n }\n if(!Validate.isPassword(editTextPassword, true)) {\n result = false;\n }\n\n return result;\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 6;\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 6;\n }", "private boolean validateForm() {\r\n\t\tResources res = getResources();\r\n\t\tif (this.textViewPrivateKey.getText().toString().equalsIgnoreCase(\"\") ||\r\n\t\t\t\tthis.editTextPassword1.getText().toString().equalsIgnoreCase(\"\") ||\r\n\t\t\t\tthis.editTextPassword2.getText().toString().equalsIgnoreCase(\"\")) {\r\n\t\t\tToast.makeText(this.getApplicationContext(), R.string.all_fields_required, Toast.LENGTH_SHORT).show();\r\n\t\t\treturn false;\r\n\t\t} else if (!(this.editTextPassword1.getText().toString().equals(this.editTextPassword2.getText().toString()))) {\r\n\t\t\tToast.makeText(this.getApplicationContext(), R.string.passwords_not_the_same, Toast.LENGTH_SHORT).show();\r\n\t\t\treturn false;\r\n\t\t} else if (!(this.editTextPassword1.getText().length() >= MIN_PASSWORD_LENGTH)) {\r\n\t\t\tToast.makeText(this.getApplicationContext(), R.string.password_too_short + MIN_PASSWORD_LENGTH + \".\", Toast.LENGTH_SHORT).show();\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "@Test\n\t\n\t\tpublic void Login_invalid() \n\t\t\n\t\t{\n\n\t\t\tString un = \"vivek\";\n\t\t\tString pw = \"vivek kumar\";\n\n\t\t\tlogger.info(\"********** Verify that use can able to login with correct username & incorrect password***********\");\n\t\t\t\n\t\t\tWebElement uname = d.findElement(By.id(\"kitchen_user_user_name\"));\n\t\t\tWebElement pwd = d.findElement(By.id(\"kitchen_user_password_digest\"));\n\t\t\t// WebElement Rme = d.findElement(By.name(\"remember\"));\n\t\t\tWebElement submit = d.findElement(By.name(\"commit\"));\n\n\t\t\t\n\t\t\tif (uname.isDisplayed()) {\n\n\t\t\t\tlogger.info(\"Verify that if the User Name field is present \");\n\n\t\t\t} else {\n\n\t\t\t\tlogger.error(\"Verify that if the User Name field is present \");\n\n\t\t\t}\n\t\t\t\n\n\t\t\tif (uname.equals(d.switchTo().activeElement())) {\n\n\t\t\t\tlogger.info(\"Verify that if the username fields get autofocus\");\n\n\t\t\t\tuname.sendKeys(\"vivek\");\n\t\t\t\t\n\t\t\t\tuname.sendKeys(Keys.TAB);\n\n\t\t\t} else {\n\n\t\t\t\tlogger.error(\"Verify that if the username fields get autofocus\");\n\n\t\t\t}\n\t\t\tSystem.out.println(\"TESTNGINGIN\");\n\t\t\tSystem.out.println(\"TESTNGINGIN\");\n\t\t\tSystem.out.println(\"TESTNGINGIN\");\n \n\t\t\tSystem.out.println(\"TESTNGINGIN\");\n \n\t\t\tSystem.out.println(\"TESTNGINGIN\");\n \n\t\t\tSystem.out.println(\"TESTNGINGIN\");\n \n\t\t\tif (pwd.isDisplayed()) {\n\n\t\t\t\tlogger.info(\"Verify that if the Password field is present \");\n\n\t\t\t} else {\n\n\t\t\t\tlogger.error(\"Verify that if the Password field is present \");\n\n\t\t\t}\n\t\t\tSystem.out.println(\"TESTNGINGIN\");\n\t\t\tSystem.out.println(\"TESTNGINGIN\");\n\t\t\tSystem.out.println(\"TESTNGINGIN\");\n\t\t\tSystem.out.println(\"TESTNGINGIN\");\n\t\t\t\n\n\t\t\tif (pwd.isDisplayed()) {\n\n\t\t\t\tlogger.info(\"Verify that if the Password field is present \");\n\n\t\t\t} else {\n\n\t\t\t\tlogger.error(\"Verify that if the Password field is present \");\n\n\t\t\t}\n\n\t\t\tif (pwd.equals(d.switchTo().activeElement())) {\n\n\t\t\t\tlogger.info(\"Verify that if the password fields get focused\");\n\n\t\t\t\tpwd.sendKeys(\"vivek kumar\");\n\n\t\t\t} else {\n\n\t\t\t\tlogger.error(\"Verify that if the password fields get focused\");\n\t\t\t}\n\n\t\t\t\n\t\t\tif (submit.isEnabled()) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tsubmit.click();\n\t\t\t\t\n\n\t\t\t\tString url = \"http://192.168.1.73:4000\";\n\t\t\t\t\n\t\t\t\tString curl = d.getCurrentUrl();\n\t\t\t\t\n\t\t\t\tif (d.getCurrentUrl().equals(url)) {\n\t\t\t\t\t\n\t\t\t\t\tlogger.error(\"Verify that if the user can't able to login with correct un & incorrect password\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t} else {\t\t\t\t\n\n\t\t\t\t\tlogger.info(\"Verify that if the user can't able to login with correct un & incorrect password\");\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t} else {\n\n\t\t\t\tlogger.error(\"Verify that user can't able to click the submit\");\n\t\t\t\t\n\t\t}\n\t\t\t\n\t\t}", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 4 && password.equals(\"123456\");\n }", "Boolean isValidUserPassword(String username, String password);", "boolean validateUserAndPassword(String username, String password);", "public static String validate(String password, String check_password){\n\t\tif (password == null || check_password == null || \"\".compareTo(password) == 0 || \"\".compareTo(check_password) == 0) {\n\t\t\treturn \"Invalid Password. Need a Password\\n\";\n\t\t}\n\t\t//two passwords don't match up\n\t\tif(password.compareTo(check_password) != 0){\n\t\t\treturn \"Invalid Password. Passwords don't match.\\n\";\n\t\t}\n\t\t//from here on we can assume the two passwords are ==\n\t\tif(password.length() < 6){\n\t\t\treturn \"Invalid Password. Need 7 characters with at least one number\\n\";\n\t\t}\n\t\t//too long\n\t\tif(password.length()>99){\n\t\t\treturn \"Invalid Password. Too Long.\\n\";\n\t\t}\n\t\t//count the numbers in passwords\n\t\tint numbers = 0;\n\t\tfor (int i = 0; i < password.length(); i++) {\n\t\t\tif(Character.isDigit(password.charAt(i))){\n\t\t\t\tnumbers++;\n\t\t\t}\n\t\t}\n\t\t//if the numbers are are greater than 1 and less than length then we are good to go\n\t\t//This is the only method that should return null\n\t\tif(numbers < password.length() && numbers >= 1){\n\t\t\treturn null;\n\n\t\t}\n\t\t//if numbers are the entire password: error\n\t\tif(numbers == password.length()){\n\t\t\treturn \"Invalid Password. Can't be all numbers.\\n\";\n\t\t}\n\t\t//if no numbers, error\n\t\tif(numbers == 0 ){\n\t\t\treturn \"Invalid Password. No Numbers.\\n\";\n\t\t}\n\t\t//anything else is an error\n\t\telse return \"Invalid Password.\\n\";\n\n\t}", "private boolean isPasswordValid(String password) {\n return password.length() > 4;\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 4;\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 4;\n }", "private boolean isPasswordValid(String password) {\n return password.length() > 4;\n }" ]
[ "0.76522934", "0.70494425", "0.700977", "0.693075", "0.67477506", "0.67207867", "0.6691139", "0.6672961", "0.66421664", "0.6637778", "0.6602648", "0.6598916", "0.65863895", "0.6575002", "0.656037", "0.6543626", "0.65209717", "0.64643353", "0.64611757", "0.6457352", "0.64553136", "0.64443904", "0.6410518", "0.6389234", "0.6387194", "0.6375709", "0.63474816", "0.6347472", "0.6336304", "0.6331111", "0.63286436", "0.6319017", "0.63141644", "0.6313755", "0.63137025", "0.63060874", "0.62882775", "0.6277914", "0.6272185", "0.62382597", "0.6232479", "0.6219139", "0.6209744", "0.62087893", "0.6205448", "0.6202312", "0.6194616", "0.6190089", "0.6190089", "0.6190089", "0.618774", "0.6186797", "0.61725926", "0.6169412", "0.61658126", "0.61658126", "0.61656296", "0.6148357", "0.6142203", "0.61399066", "0.61399066", "0.61399066", "0.61399066", "0.61399066", "0.61399066", "0.61399066", "0.61399066", "0.6133092", "0.61273813", "0.61257374", "0.6123725", "0.6107319", "0.6105301", "0.609717", "0.6067471", "0.60519814", "0.6051257", "0.6050853", "0.60395336", "0.6033611", "0.60259", "0.6021965", "0.6012868", "0.6009735", "0.6006422", "0.5999644", "0.59926885", "0.5988764", "0.5988764", "0.5981932", "0.5981268", "0.5980468", "0.5977232", "0.59756565", "0.597394", "0.59732836", "0.59690917", "0.59690917", "0.59690917", "0.59690917" ]
0.7310514
1